From: <bni...@us...> - 2007-05-09 22:51:11
|
Revision: 779 http://svn.sourceforge.net/ganglia/?rev=779&view=rev Author: bnicholes Date: 2007-05-09 15:50:58 -0700 (Wed, 09 May 2007) Log Message: ----------- Converted to dynamically link all external libraries by default. Added --with-libapr --with-libexpat --with-libconfuse to specify an alternate location for the headers and libraries. Also added --enable-static-build to link all libraries statically as before. Modified Paths: -------------- trunk/monitor-core/Makefile.am trunk/monitor-core/configure.in trunk/monitor-core/ganglia.spec.in trunk/monitor-core/gmetad/Makefile.am trunk/monitor-core/gmetric/Makefile.am trunk/monitor-core/gmond/Makefile.am trunk/monitor-core/gmond/gstat/Makefile.am trunk/monitor-core/gmond/modules/Makefile.am trunk/monitor-core/lib/Makefile.am trunk/monitor-core/srclib/Makefile.am Modified: trunk/monitor-core/Makefile.am =================================================================== --- trunk/monitor-core/Makefile.am 2007-05-07 20:30:47 UTC (rev 778) +++ trunk/monitor-core/Makefile.am 2007-05-09 22:50:58 UTC (rev 779) @@ -6,18 +6,28 @@ GMETAD_SUBDIR = endif +if STATIC_BUILD +SRCLIB_SUBDIR = srclib +EXTRA_SUBDIRS = "./$(SRCLIB_SUBDIR) ./web" +EXTRA_DIST_FILES = +else +SRCLIB_SUBDIR = +EXTRA_SUBDIRS = "./web" +EXTRA_DIST_FILES = srclib/Makefile.am srclib/Makefile.in +endif + AUTOMAKE_OPTIONS = dist-bzip2 dist-tarZ dist-shar dist-zip # Make sure we run the srclib but don't distribute it. That # is handled in the "dist-hook" below... -GANGLIA_SUBDIRS = srclib lib libmetrics tests $(GMETAD_SUBDIR) gmond gmetric +GANGLIA_SUBDIRS = $(SRCLIB_SUBDIR) lib libmetrics tests $(GMETAD_SUBDIR) gmond gmetric SUBDIRS = $(GANGLIA_SUBDIRS) # Make sure that no matter the setting for --with-gmetad # that the gmetad directory gets distributed GANGLIA_SUBDIRS_DIST = lib libmetrics tests gmetad gmond gmetric DIST_SUBDIRS = $(GANGLIA_SUBDIRS_DIST) -EXTRA_DIST = README.AIX config ganglia.spec.aix ganglia.spec ganglia.pod ganglia.html mans +EXTRA_DIST = README.AIX config ganglia.spec.aix ganglia.spec ganglia.pod ganglia.html mans $(EXTRA_DIST_FILES) ganglia.sub: ganglia.pod sed -e 's/GANGLIA_VERSION/@VERSION@/' < $(srcdir)/ganglia.pod > ganglia.sub @@ -50,7 +60,7 @@ # We also go through and make sure all the files have # the same timestamp with the last command here... dist-hook: - for subdir in "./srclib ./web"; do \ + for subdir in $(EXTRA_SUBDIRS); do \ tar -c --exclude=".libs" --exclude "core.*" \ --exclude ".svn" --exclude="*.o" --exclude="*.lo" \ --exclude="*.la" --exclude=".deps" \ @@ -67,6 +77,7 @@ touch $(distdir)/Makefile.am find $(distdir) -exec touch -r $(distdir)/Makefile.am {} \; +if STATIC_BUILD # # Make sure distclean is done in the scrlib tree # @@ -77,4 +88,5 @@ -find . -name "autom4te.cache" -exec rm -rf {} \; -find gmond gmetad gmetric lib tests libmetrics -name "Makefile.in" -exec rm -f {} \; # +endif bin_SCRIPTS = ganglia-config Modified: trunk/monitor-core/configure.in =================================================================== --- trunk/monitor-core/configure.in 2007-05-07 20:30:47 UTC (rev 778) +++ trunk/monitor-core/configure.in 2007-05-09 22:50:58 UTC (rev 779) @@ -119,26 +119,39 @@ ' ganglia_popdir=`pwd` +dnl ################################################################## +dnl Checks for programs. +dnl +AC_PROG_CC +AC_PROG_RANLIB +AM_PROG_LIBTOOL + +AC_ARG_ENABLE( static-build, +[ --enable-static-build Statically link libGanglia, APR, Expat and Confuse libraries (may disable some metric modules) ], +[ enable_static_build=yes ],[ enable_static_build=no ]) + +AM_CONDITIONAL(STATIC_BUILD, test x"$enable_static_build" = xyes) + echo $ac_n "${nl}Configuring libmetrics ...${nl}" cd libmetrics && ./configure --cache-file=$ganglia_popdir/config.cache cd $ganglia_popdir -echo $ac_n "${nl}Configuring expat ...${nl}" -cd srclib/expat && ./configure --cache-file=$ganglia_popdir/config.cache --prefix=$prefix -cd $ganglia_popdir +if test x"$enable_static_build" = xyes ; then -echo $ac_n "${nl}Configuring libconfuse ...${nl}" -cd srclib/confuse && ./configure --cache-file=$ganglia_popdir/config.cache --disable-nls --prefix=$prefix -cd $ganglia_popdir + echo $ac_n "${nl}Configuring apr ...${nl}" + cd srclib/apr && ./configure --cache-file=$ganglia_popdir/config.cache --prefix=$prefix + cd $ganglia_popdir + echo $ac_n "${nl}Configuring expat ...${nl}" + cd srclib/expat && ./configure --cache-file=$ganglia_popdir/config.cache --prefix=$prefix + cd $ganglia_popdir -dnl ################################################################## -dnl Checks for programs. -dnl -AC_PROG_CC -AC_PROG_RANLIB -AM_PROG_LIBTOOL + echo $ac_n "${nl}Configuring libconfuse ...${nl}" + cd srclib/confuse && ./configure --cache-file=$ganglia_popdir/config.cache --disable-nls --prefix=$prefix + cd $ganglia_popdir +fi + dnl ################################################################## dnl Special parameters dnl @@ -150,20 +163,16 @@ AM_CONDITIONAL(BUILD_GMETAD, test x$gmetad = xyes) AC_ARG_WITH( libapr, -[ --with-libapr Dynamically link with libapr-1.so module], -[if test x"$withval" != xno; then libapr=yes; fi]) +[ --with-libapr=DIR Specify alternate location for libapr-1], +[if test x"$withval" != xno; then libapr=yes; libaprpath=$withval; fi]) -AM_CONDITIONAL(USE_DYNAMIC_APR, test x$libapr = xyes) -if test x"$libapr" = xyes ; then - if test x"$withval" != xyes ; then - LDFLAGS="$LDFLAGS -L$withval" - fi -else - echo $ac_n "${nl}Configuring apr ...${nl}" - cd srclib/apr && ./configure --cache-file=$ganglia_popdir/config.cache --prefix=$prefix - cd $ganglia_popdir -fi +AC_ARG_WITH( libexpat, +[ --with-libexpat=DIR Specify alternate location for libexpat], +[if test x"$withval" != xno; then libexpat=yes; libexpatpath=$withval; fi]) +AC_ARG_WITH( libconfuse, +[ --with-libconfuse=DIR Specify alternate location for libconfuse], +[if test x"$withval" != xno; then libconfuse=yes; libconfusepath=$withval; fi]) AC_ARG_ENABLE(debug, [ @@ -222,19 +231,52 @@ fi fi -echo -echo Checking for apr -echo +AM_CONDITIONAL(USE_DYNAMIC_APR, test x$libapr = xyes) +AM_CONDITIONAL(USE_DYNAMIC_EXPAT, test x$libexpat = xyes) -if test x"$libapr" = xyes ; then -dnl AC_CHECK_LIB(apr-1, apr_socket_send, [echo "The ganglia utilities use the Apache Portable Runtime functions (http://www.apache.org/)"], [echo "libapr lib not found"], -lapr-1) - AC_CHECK_LIB(apr-1, apr_socket_send) -dnl AC_CHECK_HEADERS(apr.h) +if test x"$enable_static_build" = xno ; then + + echo + echo Checking for apr + if test x"$libaprpath" != x && test x"$libaprpath" != xyes ; then + CFLAGS="$CFLAGS -I$libaprpath/include" + LDFLAGS="$LDFLAGS -L$libaprpath/lib" + fi + AC_CHECK_LIB(apr-1, apr_socket_send) if test $ac_cv_lib_apr_1_apr_socket_send = yes; then echo "The ganglia utilities use the Apache Portable Runtime functions (http://www.apache.org/)" else - echo "libapr lib not found" + echo "libapr not found" fi + + echo + echo Checking for expat + if test x"$libexpatpath" != x && test x"$libexpatpath" != xyes ; then + CFLAGS="$CFLAGS -I$libexpatpath/include" + LDFLAGS="$LDFLAGS -L$libexpatpath/lib" + fi + AC_CHECK_LIB(expat, XML_ParserCreate) + if test $ac_cv_lib_expat_XML_ParserCreate = yes; then + echo "Using the installed Expat library" + else + echo "libexpat not found" + fi + echo + + echo + echo Checking for confuse + if test x"$libconfusepath" != x && test x"$libconfusepath" != xyes ; then + CFLAGS="$CFLAGS -I$libconfusepath/include" + LDFLAGS="$LDFLAGS -L$libconfusepath/lib" + fi + AC_CHECK_LIB(confuse, cfg_parse) + if test $ac_cv_lib_confuse_cfg_parse = yes; then + echo "Using the installed Confuse library" + else + echo "libconfuse not found" + fi + echo + fi AC_CHECK_LIB(rpc, xdr_string) Modified: trunk/monitor-core/ganglia.spec.in =================================================================== --- trunk/monitor-core/ganglia.spec.in 2007-05-07 20:30:47 UTC (rev 778) +++ trunk/monitor-core/ganglia.spec.in 2007-05-09 22:50:58 UTC (rev 779) @@ -107,7 +107,7 @@ ## BUILD ## %build -%configure --with-gmetad --with-libapr +%configure --with-gmetad %ifnarch noarch make %endif @@ -227,7 +227,6 @@ /etc/init.d/gmetad %config(noreplace) /etc/ganglia/gmetad.conf %{_libdir}/ganglia/* -%{_libdir}/libexpat.so* %{_libdir}/libganglia* ## @@ -245,7 +244,6 @@ %dir /etc/ganglia/conf.d/ %config(noreplace) /etc/ganglia/conf.d/* %{_libdir}/ganglia/* -%{_libdir}/libexpat.so* %{_libdir}/libganglia* ## @@ -306,6 +304,8 @@ ## CHANGELOG ## %changelog +* Wed May 9 2007 Brad Nicholes <bni...@no...> +- Converted to dynamically link all external libraries * Fri Apr 27 2007 Bernard Li <be...@va...> - Add apr-devel to BuildRequires for distro other than SuSE (Red Hat/Fedora/Mandriva) Modified: trunk/monitor-core/gmetad/Makefile.am =================================================================== --- trunk/monitor-core/gmetad/Makefile.am 2007-05-07 20:30:47 UTC (rev 778) +++ trunk/monitor-core/gmetad/Makefile.am 2007-05-09 22:50:58 UTC (rev 779) @@ -1,16 +1,22 @@ -AM_CFLAGS = -O0 -I$(top_builddir)/lib -I$(top_builddir)/gmond -I$(top_builddir)/srclib/expat/lib/ +if STATIC_BUILD +GCFLAGS = -I$(top_builddir)/srclib/expat/lib/ +GLDADD = $(top_builddir)/srclib/expat/lib/libexpat.la +GLDFLAGS = -static +else +GCFLAGS = +GLDADD = +GLDFLAGS = +endif +AM_CFLAGS = -O0 -I$(top_builddir)/lib -I$(top_builddir)/gmond $(GCFLAGS) + sbin_PROGRAMS = gmetad gmetad_SOURCES = gmetad.c cmdline.c cmdline.h gmetad.h data_thread.c \ server.c process_xml.c rrd_helpers.c conf.c conf.h type_hash.c \ xml_hash.c cleanup.c gmetad_LDADD = $(top_builddir)/lib/libganglia.la -lrrd -lm \ - $(top_builddir)/srclib/expat/lib/libexpat.la + $(GLDADD) -if USE_DYNAMIC_APR -gmetad_LDFLAGS = -else -gmetad_LDFLAGS = -static -endif +gmetad_LDFLAGS = $(GLDFLAGS) EXTRA_DIST = gmetad.aix.init gmetad.conf gmetad.init gmetad.init.SuSE Modified: trunk/monitor-core/gmetric/Makefile.am =================================================================== --- trunk/monitor-core/gmetric/Makefile.am 2007-05-07 20:30:47 UTC (rev 778) +++ trunk/monitor-core/gmetric/Makefile.am 2007-05-09 22:50:58 UTC (rev 779) @@ -1,22 +1,20 @@ -if USE_DYNAMIC_APR -APR_LIB = -APR_INC = -D_LARGEFILE64_SOURCE +if STATIC_BUILD +GCFLAGS = -I$(top_builddir)/srclib/apr/include/ +GLDADD = $(top_builddir)/srclib/apr/libapr-0.la $(top_builddir)/srclib/confuse/src/libconfuse.la +GLDFLAGS = -static else -APR_LIB = $(top_builddir)/srclib/apr/libapr-0.la -APR_INC = -I$(top_builddir)/srclib/apr/include/ +GCFLAGS = -D_LARGEFILE64_SOURCE +GLDADD = +GLDFLAGS = endif -AM_CFLAGS = -I../lib -I../gmond -I$(top_builddir)/libmetrics $(APR_INC) +AM_CFLAGS = -I../lib -I../gmond -I$(top_builddir)/libmetrics $(GCFLAGS) bin_PROGRAMS = gmetric gmetric_SOURCES = gmetric.c cmdline.c cmdline.h gmetric_LDADD = $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a \ $(top_builddir)/libmetrics/libmetrics.la \ - $(top_builddir)/srclib/confuse/src/libconfuse.la \ - $(APR_LIB) -if USE_DYNAMIC_APR -gmetric_LDFLAGS = -else -gmetric_LDFLAGS = -static -endif + $(GLDADD) + +gmetric_LDFLAGS = $(GLDFLAGS) Modified: trunk/monitor-core/gmond/Makefile.am =================================================================== --- trunk/monitor-core/gmond/Makefile.am 2007-05-07 20:30:47 UTC (rev 778) +++ trunk/monitor-core/gmond/Makefile.am 2007-05-09 22:50:58 UTC (rev 779) @@ -2,15 +2,17 @@ EXTRA_DIST = gmond.aix.init gmond.init gmond.init.SuSE gmond.conf.5 gmond.conf.html conf.pod -if USE_DYNAMIC_APR -APR_LIB = -APR_INC = -D_LARGEFILE64_SOURCE +if STATIC_BUILD +GCFLAGS = -I$(top_builddir)/srclib/apr/include/ -I$(top_builddir)/srclib/expat/lib/ -I$(top_builddir)/srclib/confuse/src/ +GLDADD = $(top_builddir)/srclib/apr/libapr-0.la $(top_builddir)/srclib/confuse/src/libconfuse.la +GLDFLAGS = -static else -APR_LIB = $(top_builddir)/srclib/apr/libapr-0.la -APR_INC = -I$(top_builddir)/srclib/apr/include/ +GCFLAGS = -D_LARGEFILE64_SOURCE +GLDADD = +GLDFLAGS = endif -AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/libmetrics/ -I$(top_builddir)/srclib/expat/lib/ $(APR_INC) -I$(top_builddir)/srclib/confuse/src/ +AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/libmetrics/ $(GCFLAGS) sbin_PROGRAMS = gmond # metric.h and dtd.h are for gmetad/gmetric for now.... @@ -30,14 +32,9 @@ gmond_LDADD = $(top_builddir)/libmetrics/libmetrics.la \ $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a \ - $(top_builddir)/srclib/confuse/src/libconfuse.la \ - $(APR_LIB) + $(GLDADD) gmond_DEPENDENCIES = $(gmond_LDADD) -if USE_DYNAMIC_APR -gmond_LDFLAGS = -else -gmond_LDFLAGS = -static -endif +gmond_LDFLAGS = $(GLDFLAGS) Modified: trunk/monitor-core/gmond/gstat/Makefile.am =================================================================== --- trunk/monitor-core/gmond/gstat/Makefile.am 2007-05-07 20:30:47 UTC (rev 778) +++ trunk/monitor-core/gmond/gstat/Makefile.am 2007-05-09 22:50:58 UTC (rev 779) @@ -1,13 +1,19 @@ -AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/srclib/expat/lib/ +if STATIC_BUILD +GCFLAGS = -I$(top_builddir)/srclib/expat/lib/ +GLDADD = $(top_builddir)/srclib/expat/lib/libexpat.la +GLDFLAGS = -static +else +GCFLAGS = +GLDADD = +GLDFLAGS = +endif +AM_CFLAGS = -I$(top_builddir)/lib $(GCFLAGS) + bin_PROGRAMS = gstat gstat_SOURCES = gstat.c cmdline.c cmdline.h gstat_LDADD = $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a \ - $(top_builddir)/srclib/expat/lib/libexpat.la + $(GLDADD) -if USE_DYNAMIC_APR -gstat_LDFLAGS = -else -gstat_LDFLAGS = -static -endif +gstat_LDFLAGS = $(GLDFLAGS) Modified: trunk/monitor-core/gmond/modules/Makefile.am =================================================================== --- trunk/monitor-core/gmond/modules/Makefile.am 2007-05-07 20:30:47 UTC (rev 778) +++ trunk/monitor-core/gmond/modules/Makefile.am 2007-05-09 22:50:58 UTC (rev 779) @@ -1,2 +1,6 @@ +if STATIC_BUILD +SUBDIRS = +else SUBDIRS = example cpu +endif Modified: trunk/monitor-core/lib/Makefile.am =================================================================== --- trunk/monitor-core/lib/Makefile.am 2007-05-07 20:30:47 UTC (rev 778) +++ trunk/monitor-core/lib/Makefile.am 2007-05-09 22:50:58 UTC (rev 779) @@ -1,15 +1,17 @@ #SUFFIXES=.x #.c.x: rpcgen $< -if USE_DYNAMIC_APR -APR_LIB = -APR_INC = -D_LARGEFILE64_SOURCE +if STATIC_BUILD +GCFLAGS = -I$(top_builddir)/srclib/apr/include/ -I$(top_builddir)/srclib/apr/include/arch/unix/ -I$(top_builddir)/srclib/expat/lib/ -I$(top_builddir)/srclib/confuse/src +GLDADD = +GLDFLAGS = else -APR_LIB = $(top_builddir)/srclib/apr/libapr-0.la -APR_INC = -I$(top_builddir)/srclib/apr/include/ -I$(top_builddir)/srclib/apr/include/arch/unix/ +GCFLAGS = -D_LARGEFILE64_SOURCE +GLDADD = +GLDFLAGS = endif -AM_CFLAGS = -I.. -I. -I$(top_builddir)/srclib/expat/lib/ -I$(top_builddir)/libmetrics/ $(APR_INC) -I$(top_builddir)/srclib/confuse/src +AM_CFLAGS = -I.. -I. -I$(top_builddir)/libmetrics/ $(GCFLAGS) include_HEADERS = ganglia.h @@ -28,14 +30,10 @@ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ -export-dynamic + $(GLDFLAGS) -if USE_DYNAMIC_APR -libganglia_la_LIBADD = $(top_builddir)/srclib/expat/lib/libexpat.la \ - $(top_builddir)/srclib/confuse/src/libconfuse.la +libganglia_la_LIBADD = $(GLDADD) -libganglia_la_DEPENDENCIES = $(libganglia_la_LIBADD) -endif - noinst_LIBRARIES = libgetopthelper.a # A little helper for getopt functions libgetopthelper_a_SOURCES = getopt1.c getopt.c getopt_init.c getopt.h Modified: trunk/monitor-core/srclib/Makefile.am =================================================================== --- trunk/monitor-core/srclib/Makefile.am 2007-05-07 20:30:47 UTC (rev 778) +++ trunk/monitor-core/srclib/Makefile.am 2007-05-09 22:50:58 UTC (rev 779) @@ -1,19 +1,9 @@ -if USE_DYNAMIC_APR -SUBDIRS = expat confuse - -install-data-hook: - rm $(DESTDIR)$(includedir)/confuse.h - rm $(DESTDIR)$(includedir)/expat.h - rm $(DESTDIR)$(libdir)/libconfuse.a - rm $(DESTDIR)$(libdir)/libconfuse.la - rm $(DESTDIR)$(libdir)/libexpat.a - rm $(DESTDIR)$(libdir)/libexpat.la - rm -r $(DESTDIR)$(libdir)/pkgconfig - if test -f $(DESTDIR)$(bindir)/confuse-config; then rm $(DESTDIR)$(bindir)/confuse-config; fi - -else +if STATIC_BUILD SUBDIRS = expat apr confuse +else +SUBDIRS = +endif test: echo @@ -29,4 +19,4 @@ echo echo "Nothing from the srclib directory gets installed" echo -endif + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |