From 51089986f9d48d3bc2b4f323c05b7d10c054e32d Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 5 Feb 2001 09:06:39 +0000 Subject: [PATCH] * m4/regex.m4: Use AC_LIBSOURCES. * automake.in (scan_autoconf_traces): Trace AC_LIBSOURCE, not _AC_LIBOBJ_DECL. --- ChangeLog | 6 ++++++ automake.in | 4 ++-- m4/regex.m4 | 43 ++++++++++++++++++++++++++----------------- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index a51d045b..36a71951 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-02-05 Akim Demaille + + * m4/regex.m4: Use AC_LIBSOURCES. + * automake.in (scan_autoconf_traces): Trace AC_LIBSOURCE, not + _AC_LIBOBJ_DECL. + 2001-02-04 Tom Tromey * m4/Makefile.am (m4data_DATA): Added make.m4. diff --git a/automake.in b/automake.in index 9f9f63f6..1a6b4ef8 100755 --- a/automake.in +++ b/automake.in @@ -4345,7 +4345,7 @@ sub scan_autoconf_traces local ($traces) = "$ENV{amtraces} "; $traces .= ' -t AC_CONFIG_FILES'; - $traces .= ' -t _AC_LIBOBJ_DECL'; + $traces .= ' -t AC_LIBSOURCE'; $traces .= ' -t AC_SUBST'; open (TRACES, "$traces |") @@ -4364,7 +4364,7 @@ sub scan_autoconf_traces # Look at potential Makefile.am's. &scan_autoconf_config_files ($args[0]); } - elsif ($macro eq '_AC_LIBOBJ_DECL') + elsif ($macro eq 'AC_LIBSOURCE') { local ($source) = "$args[0].c"; # We should actually also `close' the sources: getopt.c diff --git a/m4/regex.m4 b/m4/regex.m4 index 265a239f..1d35c983 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -2,30 +2,39 @@ ## Check if --with-regex was given. ## ## --------------------------------- ## -# serial 1 - -# The idea is to distribute rx.[hc] and regex.[hc] together, for a while. -# The WITH_REGEX symbol (which should also be documented in acconfig.h) -# is used to decide which of regex.h or rx.h should be included in the -# application. If `./configure --with-regex' is given (the default), the -# package will use gawk's regex. If `./configure --without-regex', a -# check is made to see if rx is already installed, as with newer Linux'es. -# If not found, the package will use the rx from the distribution. -# If found, the package will use the system's rx which, on Linux at least, -# will result in a smaller executable file. +# serial 2 +# AM_WITH_REGEX +# ------------- +# +# The idea is to distribute rx.[hc] and regex.[hc] together, for a +# while. The WITH_REGEX symbol is used to decide which of regex.h or +# rx.h should be included in the application. If `./configure +# --with-regex' is given (the default), the package will use gawk's +# regex. If `./configure --without-regex', a check is made to see if +# rx is already installed, as with newer Linux'es. If not found, the +# package will use the rx from the distribution. If found, the +# package will use the system's rx which, on Linux at least, will +# result in a smaller executable file. +# +# FIXME: This macro seems quite obsolete now since rx doesn't seem to +# be maintained, while regex is. AC_DEFUN([AM_WITH_REGEX], -[AC_MSG_CHECKING([which of GNU rx or gawk's regex is wanted]) +[ifdef([AC_LIBSOURCES], + [AC_LIBSOURCES([rx.h, rx.c, regex.c, regex.h])])dnl +AC_MSG_CHECKING([which of GNU rx or gawk's regex is wanted]) AC_ARG_WITH(regex, [ --without-regex use GNU rx in lieu of gawk's regex for matching], -[test "$withval" = yes && am_with_regex=1], -[am_with_regex=1]) + [test "$withval" = yes && am_with_regex=1], + [am_with_regex=1]) if test -n "$am_with_regex"; then AC_MSG_RESULT(regex) - AC_DEFINE(WITH_REGEX,1,[Define if using GNU regex]) + AC_DEFINE(WITH_REGEX, 1, [Define if using GNU regex]) AC_CACHE_CHECK([for GNU regex in libc], am_cv_gnu_regex, - [AC_TRY_LINK([], [extern int re_max_failures; re_max_failures = 1], - am_cv_gnu_regex=yes, am_cv_gnu_regex=no)]) + [AC_TRY_LINK([], + [extern int re_max_failures; re_max_failures = 1], + [am_cv_gnu_regex=yes], + [am_cv_gnu_regex=no])]) if test $am_cv_gnu_regex = no; then LIBOBJS="$LIBOBJS regex.$ac_objext" fi -- 2.43.5