From 287b072ef5b874e7e6e7e80be8ff9c7c00ed1b49 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 9 Mar 1998 01:59:51 +0000 Subject: Set need_gnome_support shell variable. Define BUILD_GNOME_SUPPORT automake Sun Mar 8 17:04:28 1998 Tom Tromey * gnome-support.m4: Set need_gnome_support shell variable. Define BUILD_GNOME_SUPPORT automake conditional. Define LTLIBOBJS. Look for argp_domain element in struct argp. svn path=/trunk/; revision=60 --- macros/ChangeLog | 9 +++++++++ macros/gnome-support.m4 | 32 +++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/macros/ChangeLog b/macros/ChangeLog index 6953c24145..84fee605d1 100644 --- a/macros/ChangeLog +++ b/macros/ChangeLog @@ -1,5 +1,14 @@ +Sun Mar 8 17:04:28 1998 Tom Tromey + + * gnome-support.m4: Set need_gnome_support shell variable. Define + BUILD_GNOME_SUPPORT automake conditional. Define LTLIBOBJS. Look + for argp_domain element in struct argp. + Sat Mar 7 00:04:22 1998 Tom Tromey + * gnome-support.m4 (GNOME_SUPPORT_CHECKS): Add argp-pvh.o to + LIBOBJS. + * gnome-support.m4 (GNOME_SUPPORT_CHECKS): Check for strnlen(). Wed Mar 4 01:02:55 1998 Tom Tromey diff --git a/macros/gnome-support.m4 b/macros/gnome-support.m4 index 1ec30425ad..67478a8c1d 100644 --- a/macros/gnome-support.m4 +++ b/macros/gnome-support.m4 @@ -1,8 +1,24 @@ -dnl libsupport stuff dnl GNOME_SUPPORT_CHECKS +dnl Check for various support functions needed by the standard +dnl Gnome libraries. Sets LIBOBJS, might define some macros, +dnl and will set the need_gnome_support shell variable to "yes" +dnl or "no". Also sets up the Automake BUILD_GNOME_SUPPORT +dnl conditional. This should only be used when building the Gnome +dnl libs; Gnome clients should not need this macro. AC_DEFUN([GNOME_SUPPORT_CHECKS],[ + need_gnome_support=no + save_LIBOBJS="$LIBOBJS" + LIBOBJS= + AC_CHECK_FUNCS(getopt_long,,LIBOBJS="$LIBOBJS getopt.o getopt1.o") - AC_CHECK_FUNCS(argp_parse,,LIBOBJS="$LIBOBJS argp-ba.o argp-eexst.o argp-fmtstream.o argp-fs-xinl.o argp-help.o argp-parse.o argp-pv.o argp-xinl.o") + + # We check for argp_domain because we use it, and it appears only in + # very recent versions of the argp library. + AC_TRY_COMPILE([#include ], [ + struct argp foo; + extern char *foo2; + foo.argp_domain = foo2;],,LIBOBJS="$LIBOBJS argp-ba.o argp-eexst.o argp-fmtstream.o argp-fs-xinl.o argp-help.o argp-parse.o argp-pv.o argp-pvh.o argp-xinl.o") + AC_TRY_LINK([#include ],[ char *foo = program_invocation_short_name], [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME)]) @@ -10,5 +26,15 @@ AC_DEFUN([GNOME_SUPPORT_CHECKS],[ char *foo = program_invocation_name], [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME)]) AC_REPLACE_FUNCS(strtok_r strcasecmp strndup strnlen) - AC_SUBST(LIBOBJS) + + if test "$LIBOBJS" != ""; then + need_gnome_support=yes + fi + # Turn our LIBOBJS into libtool objects. This is gross, but it + # requires changes to autoconf before it goes away. + LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/.lo/g'` + AC_SUBST(LTLIBOBJS) + + LIBOBJS="$save_LIBOBJS" + AM_CONDITIONAL(BUILD_GNOME_SUPPORT, test "$need_gnome_support" = yes) ]) -- cgit v1.2.3