From 87e761cc247953e42d8aba89317d349aee94b1ac Mon Sep 17 00:00:00 2001 From: ellson Date: Sat, 30 Jul 2005 09:41:30 +0000 Subject: [PATCH] make dot_static if --enable-static --- cmd/dot/Makefile.am | 13 +++++++------ configure.ac | 13 +++++++++++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/cmd/dot/Makefile.am b/cmd/dot/Makefile.am index 1645ba490..bfddb2009 100644 --- a/cmd/dot/Makefile.am +++ b/cmd/dot/Makefile.am @@ -13,7 +13,11 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/graph \ -I$(top_srcdir)/lib/cdt +if ENABLE_STATIC +bin_PROGRAMS = dot dot_static +else bin_PROGRAMS = dot +endif man_MANS = dot.1 pdf_DATA = dot.pdf @@ -42,8 +46,8 @@ uninstall-hook: dot.pdf: $(top_srcdir)/cmd/dot/dot.1 groff -Tps -man $(top_srcdir)/cmd/dot/dot.1 | ps2pdf - - >$@ -dot_static: dot.o - $(CC) dot.o builtins.o \ +dot_static_SOURCES = $(dot_SOURCES) +dot_static_LDADD = \ $(top_builddir)/lib/plugin/.libs/libgvplugin_dot_layout.a \ $(top_builddir)/lib/plugin/.libs/libgvplugin_neato_layout.a \ $(top_builddir)/lib/plugin/.libs/libgvplugin_usershape_gd.a \ @@ -53,11 +57,8 @@ dot_static: dot.o $(top_builddir)/lib/graph/.libs/libgraph.a \ $(top_builddir)/lib/cdt/.libs/libcdt.a \ $(top_builddir)/lib/gd/.libs/libgvgd.a \ - -lfreetype -lfontconfig -lexpat -lpng -ljpeg -lltdl -lz \ - -o dot_static + @GD_LIBS@ @EXPAT_LIBS@ @Z_LIBS@ @LIBGEN_LIBS@ @LIBLTDL@ @SOCKET_LIBS@ EXTRA_DIST = Makefile.old dot.1 dot.pdf -CLEANFILES = dot_static - DISTCLEANFILES = dot.pdf diff --git a/configure.ac b/configure.ac index 0a225a52c..ddf0e8a88 100644 --- a/configure.ac +++ b/configure.ac @@ -85,8 +85,17 @@ fi # Set of all available languages # ALL_LINGUAS="" -# Build shared libs only -AC_DISABLE_STATIC +dnl ----------------------------------- +# Static binaries + +AC_ARG_ENABLE(static, + [AC_HELP_STRING([--enable-codegens], [build static executable])]) +if test "x$enable_static" = "xyes"; then + AC_DEFINE(ENABLE_STATIC,1,[Define if you want statically linked executables]) +else + AC_DISABLE_STATIC +fi +AM_CONDITIONAL(ENABLE_STATIC, [test "x$enable_static" = "xyes"]) dnl ----------------------------------- dnl checks for compilers -- 2.40.0