From: Akim Demaille Date: Tue, 8 Feb 2000 13:51:55 +0000 (+0000) Subject: * acgeneral.m4 (AC_CONFIG_UNIQUE): Strip the `:foo.in' part X-Git-Tag: autoconf-2.50~1192 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b39821a30a5faf047cc3f9bbd1ca0bf0eac60516;p=thirdparty%2Fautoconf.git * acgeneral.m4 (AC_CONFIG_UNIQUE): Strip the `:foo.in' part yourself, in order to give better error messages. (AC_CONFIG_IF_MEMBER): Adapted to the above change. Quote some regexp active characters ([+.*]). Suggested by Alexandre Oliva. --- diff --git a/ChangeLog b/ChangeLog index 8e0e0e61d..3778ef76c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-02-08 Akim Demaille + + * acgeneral.m4 (AC_CONFIG_UNIQUE): Strip the `:foo.in' part + yourself, in order to give better error messages. + (AC_CONFIG_IF_MEMBER): Adapted to the above change. + Quote some regexp active characters ([+.*]). + Suggested by Alexandre Oliva. + 2000-02-08 Akim Demaille * acgeneral.m4 (AC_INCLUDES_DEFAULT): Make it more robust to diff --git a/acgeneral.m4 b/acgeneral.m4 index 16b602fb9..025b5f19c 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -2918,8 +2918,8 @@ AC_DEFUN(AC_CHECK_TYPE, ## ----------------------- ## -# AC_CONFIG_IF_MEMBER(DEST[:SOURCE], LIST, ACTION-IF-TRUE, ACTION-IF-FALSE) -# ------------------------------------------------------------------------- +# AC_CONFIG_IF_MEMBER(DEST, LIST, ACTION-IF-TRUE, ACTION-IF-FALSE) +# ---------------------------------------------------------------- # If DEST is member of LIST, expand to ACTION-IF-TRUE, else ACTION-IF-FALSE. # # LIST is an AC_CONFIG list, i.e., a list of DEST[:SOURCE], separated @@ -2928,34 +2928,37 @@ AC_DEFUN(AC_CHECK_TYPE, # FIXME: This macro is badly designed, but I'm not guilty: m4 is. There # is just no way to simply compare two strings in m4, but to use pattern # matching. The big problem is then that the active characters should -# be quoted. So an additional macro should be used here. Nevertheless, -# in the case of file names, there is not much to worry. +# be quoted. Currently `+*.' are quoted. define(AC_CONFIG_IF_MEMBER, -[pushdef([AC_Dest], patsubst([$1], [:.*]))dnl -ifelse(regexp($2, [\(^\| \)]AC_Dest[\(:\| \|$\)]), -1, [$4], [$3])dnl -popdef([AC_Dest])dnl -]) +[ifelse(regexp($2, [\(^\| \)]patsubst([$1], + [\([+*.]\)], [\\\1])[\(:\| \|$\)]), + -1, [$4], [$3])]) # AC_CONFIG_UNIQUE(DEST[:SOURCE]...) # ---------------------------------- +# # Verify that there is no double definition of an output file # (precisely, guarantees there is no common elements between # CONFIG_HEADERS, CONFIG_FILES, CONFIG_LINKS, and CONFIG_SUBDIRS). -# This macro should output nothing, so we divert to /dev/null. +# This macro should output nothing, so we divert to /dev/null. Note +# that this macro does not check if the list $[1] itself contains +# doubles. define(AC_CONFIG_UNIQUE, [AC_DIVERT_PUSH(AC_DIVERSION_KILL) AC_FOREACH([AC_File], [$1], - [AC_CONFIG_IF_MEMBER(AC_File, [AC_LIST_HEADERS], - [AC_FATAL(`AC_File' [is already registered with AC_CONFIG_HEADER or AC_CONFIG_HEADERS.])]) - AC_CONFIG_IF_MEMBER(AC_File, [AC_LIST_LINKS], - [AC_FATAL(`AC_File' [is already registered with AC_CONFIG_LINKS.])]) - AC_CONFIG_IF_MEMBER(AC_File, [AC_LIST_SUBDIRS], - [AC_FATAL(`AC_File' [is already registered with AC_CONFIG_SUBDIRS.])]) - AC_CONFIG_IF_MEMBER(AC_File, [AC_LIST_COMMANDS], - [AC_FATAL(`AC_File' [is already registered with AC_CONFIG_COMMANDS.])]) - AC_CONFIG_IF_MEMBER(AC_File, [AC_LIST_FILES], - [AC_FATAL(`AC_File' [is already registered with AC_CONFIG_FILES or AC_OUTPUT.])])]) +[pushdef([AC_Dest], patsubst(AC_File, [:.*])) +AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADER or AC_CONFIG_HEADERS.])]) + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_LINKS.])]) + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_SUBDIRS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_SUBDIRS.])]) + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_COMMANDS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_COMMANDS.])]) + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_FILES], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_FILES or AC_OUTPUT.])]) +popdef([AC_Dest])]) AC_DIVERT_POP()dnl ]) diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 16b602fb9..025b5f19c 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -2918,8 +2918,8 @@ AC_DEFUN(AC_CHECK_TYPE, ## ----------------------- ## -# AC_CONFIG_IF_MEMBER(DEST[:SOURCE], LIST, ACTION-IF-TRUE, ACTION-IF-FALSE) -# ------------------------------------------------------------------------- +# AC_CONFIG_IF_MEMBER(DEST, LIST, ACTION-IF-TRUE, ACTION-IF-FALSE) +# ---------------------------------------------------------------- # If DEST is member of LIST, expand to ACTION-IF-TRUE, else ACTION-IF-FALSE. # # LIST is an AC_CONFIG list, i.e., a list of DEST[:SOURCE], separated @@ -2928,34 +2928,37 @@ AC_DEFUN(AC_CHECK_TYPE, # FIXME: This macro is badly designed, but I'm not guilty: m4 is. There # is just no way to simply compare two strings in m4, but to use pattern # matching. The big problem is then that the active characters should -# be quoted. So an additional macro should be used here. Nevertheless, -# in the case of file names, there is not much to worry. +# be quoted. Currently `+*.' are quoted. define(AC_CONFIG_IF_MEMBER, -[pushdef([AC_Dest], patsubst([$1], [:.*]))dnl -ifelse(regexp($2, [\(^\| \)]AC_Dest[\(:\| \|$\)]), -1, [$4], [$3])dnl -popdef([AC_Dest])dnl -]) +[ifelse(regexp($2, [\(^\| \)]patsubst([$1], + [\([+*.]\)], [\\\1])[\(:\| \|$\)]), + -1, [$4], [$3])]) # AC_CONFIG_UNIQUE(DEST[:SOURCE]...) # ---------------------------------- +# # Verify that there is no double definition of an output file # (precisely, guarantees there is no common elements between # CONFIG_HEADERS, CONFIG_FILES, CONFIG_LINKS, and CONFIG_SUBDIRS). -# This macro should output nothing, so we divert to /dev/null. +# This macro should output nothing, so we divert to /dev/null. Note +# that this macro does not check if the list $[1] itself contains +# doubles. define(AC_CONFIG_UNIQUE, [AC_DIVERT_PUSH(AC_DIVERSION_KILL) AC_FOREACH([AC_File], [$1], - [AC_CONFIG_IF_MEMBER(AC_File, [AC_LIST_HEADERS], - [AC_FATAL(`AC_File' [is already registered with AC_CONFIG_HEADER or AC_CONFIG_HEADERS.])]) - AC_CONFIG_IF_MEMBER(AC_File, [AC_LIST_LINKS], - [AC_FATAL(`AC_File' [is already registered with AC_CONFIG_LINKS.])]) - AC_CONFIG_IF_MEMBER(AC_File, [AC_LIST_SUBDIRS], - [AC_FATAL(`AC_File' [is already registered with AC_CONFIG_SUBDIRS.])]) - AC_CONFIG_IF_MEMBER(AC_File, [AC_LIST_COMMANDS], - [AC_FATAL(`AC_File' [is already registered with AC_CONFIG_COMMANDS.])]) - AC_CONFIG_IF_MEMBER(AC_File, [AC_LIST_FILES], - [AC_FATAL(`AC_File' [is already registered with AC_CONFIG_FILES or AC_OUTPUT.])])]) +[pushdef([AC_Dest], patsubst(AC_File, [:.*])) +AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADER or AC_CONFIG_HEADERS.])]) + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_LINKS.])]) + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_SUBDIRS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_SUBDIRS.])]) + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_COMMANDS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_COMMANDS.])]) + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_FILES], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_FILES or AC_OUTPUT.])]) +popdef([AC_Dest])]) AC_DIVERT_POP()dnl ])