From 6d3b740a2c9eb906f8f6ba23479968074579892a Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Wed, 20 May 1998 20:56:12 +0000 Subject: [PATCH] added '--enable-libgtop-server' (default=auto), '--enable-libgtop-names' * acinclude.m4 (AC_LC_SYSDEPS): added '--enable-libgtop-server' (default=auto), '--enable-libgtop-names' (default=yes) and '--enable-libgtop-guile' (default=yes); we now define 'GLIBTOP_NAMES' here. * acconfig.h: added 'GLIBTOP_NAMES' and 'GLIBTOP_GUILE_NAMES' --- Makefile.am | 2 ++ acconfig.h | 3 +++ acinclude.m4 | 48 ++++++++++++++++++++++++++++++++++++++++++++- configure.in | 55 +++++++++++++++++++++++++++++++++++++++++++--------- 4 files changed, 98 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index cfc36ad3..3b9eaeb0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,6 +32,8 @@ gtopConf.sh: gtopConf.sh.in Makefile -e 's,\@GTOP_INCLUDEDIR\@,$(includedir),g' \ -e 's,\@GTOP_LIBS\@,$(GTOP_LIBS),g' \ -e 's,\@GTOP_INCS\@,$(GTOP_INCS),g' \ + -e 's,\@GTOP_GUILE_LIBS\@,$(GTOP_GUILE_LIBS),g' \ + -e 's,\@GTOP_GUILE_INCS\@,$(GTOP_GUILE_INCS),g' \ -e 's,\@GTOP_BINDIR\@,$(GTOP_BINDIR),g' \ -e 's,\@GTOP_SERVER\@,$(GTOP_SERVER),g' \ -e 's,\@GTOP_SYSDEPS_DIR\@,$(sysdeps_dir),g' \ diff --git a/acconfig.h b/acconfig.h index 16425574..82742b69 100644 --- a/acconfig.h +++ b/acconfig.h @@ -28,3 +28,6 @@ #undef HAVE_GLIBTOP_MACHINE_H +#undef GLIBTOP_NAMES +#undef GLIBTOP_GUILE_NAMES + diff --git a/acinclude.m4 b/acinclude.m4 index d9148c37..8abbb232 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -29,7 +29,9 @@ AC_DEFUN([AC_LC_CANONICAL_HOST],[ AC_DEFUN([AC_LC_SYSDEPS],[ AC_REQUIRE([AC_LC_CANONICAL_HOST]) + AC_MSG_CHECKING(for sysdeps directory) + AC_ARG_WITH(sysdeps, [ --with-sysdeps=dir which sysdeps directory should be used [default=auto]], [if test "x$withval" = "xyes" ; then @@ -39,6 +41,7 @@ AC_DEFUN([AC_LC_SYSDEPS],[ else ac_cv_sysdeps_dir=$withval fi],[ac_cv_sysdeps_dir=yes]) + if test "x$ac_cv_sysdeps_dir" = "xyes" ; then case "$host_os" in linux*) @@ -68,13 +71,56 @@ AC_DEFUN([AC_LC_SYSDEPS],[ else sysdeps_dir=stub fi + test -d $srcdir/sysdeps/$sysdeps_dir || sysdeps_dir=stub AC_MSG_RESULT($sysdeps_dir) + + AC_MSG_CHECKING(whether we need the server) + + AC_ARG_ENABLE(libgtop-server, + [ --enable-libgtop-server use gtop_server [default=auto]], + [if test "x$enableval" = "xyes" ; then + need_server=yes + elif test "x$enableval" = "xno" ; then + need_server=no + fi]) + + AC_MSG_RESULT($need_server) + + AC_MSG_CHECKING(whether building of 'names' subdirs is requested) + + AC_ARG_ENABLE(libgtop-names, + [ --enable-libgtop-names enable building of 'names' subdirs [default=yes]], + [if test "x$enableval" = "xyes" ; then + ac_cv_want_names=yes + else + ac_cv_want_names=$enableval + fi],[ac_cv_names_subdir=yes]) + + AC_MSG_RESULT($ac_cv_want_names) + + AC_MSG_CHECKING(whether building of the guile interface is requested) + + AC_ARG_ENABLE(libgtop-guile, + [ --enable-libgtop-guile enable building of guile interface [default=yes]], + [if test "x$enableval" = "xyes" ; then + ac_cv_want_guile=yes + else + ac_cv_want_guile=$enableval + fi],[ac_cv_want_guile=yes]) + + AC_MSG_RESULT($ac_cv_want_guile) + + if test x$ac_cv_want_names = xyes ; then + AC_DEFINE(GLIBTOP_NAMES) + fi + + AM_CONDITIONAL(GLIBTOP_NAMES, test x$ac_cv_want_names = xyes) + AC_SUBST(sysdeps_dir) AC_SUBST(need_server) ]) - # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, diff --git a/configure.in b/configure.in index ac7287f1..d024f429 100644 --- a/configure.in +++ b/configure.in @@ -26,15 +26,23 @@ export CC CXX RANLIB LD AS AR NM AC_LC_SYSDEPS -GNOME_CHECK_GUILE - -if test x$ac_cv_guile_found = xyes ; then - guile_examples='third third_static third_linux' - guile_subdirs='guile' +if test x$ac_cv_want_guile = xyes ; then + GNOME_CHECK_GUILE + if test x$ac_cv_guile_found = xyes ; then + if test x$ac_cv_want_names = xyes ; then + AC_DEFINE(GLIBTOP_GUILE_NAMES) + fi + guile_examples='third third_static third_linux' + guile_subdirs='guile' + else + guile_examples= + guile_subdirs= + fi else guile_examples= guile_subdirs= fi + AC_SUBST(guile_examples) AC_SUBST(guile_subdirs) @@ -99,24 +107,53 @@ if test "$need_libgtop_support" = yes; then fi dnl These definitions are expanded in make. -GTOP_LIBS='-L$(libdir) -lgtop_common -lgtop ' +GTOP_LIBS='-L$(libdir)' GTOP_INCS='-I$(includedir) -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/include' +GTOP_GUILE_LIBS="$GTOP_LIBS" +GTOP_GUILE_INCS="$GTOP_INCS" GTOP_BINDIR='$(bindir)' GTOP_SERVER='$(bindir)/gtop_server' -GTOP_INCS="$GTOP_INCS -I\$(top_srcdir)/intl -DGTOPLOCALEDIR=\\\"\$(datadir)/locale\\\"" +if test "x$ac_cv_guile_found" = "xyes" ; then + GTOP_GUILE_LIBS="$GTOP_GUILE_LIBS -lgtop_guile" +fi + +if test "x$ac_cv_want_names" = "xyes" ; then + if test "x$ac_cv_guile_found" = "xyes" ; then + GTOP_GUILE_LIBS="$GTOP_GUILE_LIBS -lgtop_guile_names" + fi + GTOP_LIBS="$GTOP_LIBS -lgtop_names" + GTOP_GUILE_LIBS="$GTOP_GUILE_LIBS -lgtop_names" +fi + +GTOP_LIBS="$GTOP_LIBS -lgtop_common" +GTOP_GUILE_LIBS="$GTOP_GUILE_LIBS -lgtop_common" + +if test "x$need_server" = "xyes" ; then + GTOP_LIBS="$GTOP_LIBS -lgtop" + GTOP_GUILE_LIBS="$GTOP_GUILE_LIBS -lgtop" +else + GTOP_LIBS="$GTOP_LIBS -lgtop_sysdeps" + GTOP_GUILE_LIBS="$GTOP_GUILE_LIBS -lgtop_sysdeps" +fi if test "x$use_glibtop_machine_h" = "xyes" ; then GTOP_INCS="$GTOP_INCS -I\$(top_srcdir)/sysdeps/\$(sysdeps_dir)" fi +GTOP_INCS="$GTOP_INCS -I\$(top_srcdir)/intl -DGTOPLOCALEDIR=\\\\\"\$(datadir)/locale\\\\\"" + +GTOP_GUILE_INCS="$GTOP_INCS" + if test "x$ac_cv_guile_found" = "xyes" ; then - GTOP_INCS="$GTOP_INCS $GUILE_INCS" - GTOP_LIBS="$GTOP_LIBS $GUILE_LIBS" + GTOP_GUILE_INCS="$GTOP_INCS $GUILE_INCS" + GTOP_GUILE_LIBS="$GTOP_GUILE_LIBS $GUILE_LIBS" fi AC_SUBST(GTOP_LIBS) AC_SUBST(GTOP_INCS) +AC_SUBST(GTOP_GUILE_LIBS) +AC_SUBST(GTOP_GUILE_INCS) AC_SUBST(GTOP_BINDIR) AC_SUBST(GTOP_SERVER)