1 |
# This file is part of Autoconf. -*- Autoconf -*- |
# This file is part of Autoconf. -*- Autoconf -*- |
2 |
# Parameterizing and creating config.status. |
# Parameterizing and creating config.status. |
3 |
# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 |
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 |
4 |
# Free Software Foundation, Inc. |
# Free Software Foundation, Inc. |
5 |
|
|
6 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
174 |
## Ensuring the unicity of the tags. ## |
## Ensuring the unicity of the tags. ## |
175 |
## ---------------------------------- ## |
## ---------------------------------- ## |
176 |
|
|
177 |
# AC_CONFIG_IF_MEMBER(DEST, LIST, ACTION-IF-TRUE, ACTION-IF-FALSE) |
# AC_CONFIG_IF_MEMBER(DEST, LIST-NAME, ACTION-IF-TRUE, ACTION-IF-FALSE) |
178 |
# ---------------------------------------------------------------- |
# ---------------------------------------------------------------- |
179 |
# If DEST is member of LIST, expand to ACTION-IF-TRUE, else ACTION-IF-FALSE. |
# If DEST is member of LIST-NAME, expand to ACTION-IF-TRUE, else |
180 |
|
# ACTION-IF-FALSE. |
181 |
# |
# |
182 |
# LIST is an AC_CONFIG list, i.e., a list of DEST[:SOURCE], separated |
# LIST is an AC_CONFIG list, i.e., a list of DEST[:SOURCE], separated |
183 |
# with spaces. |
# with spaces. |
187 |
# matching. The big problem is then that the active characters should |
# matching. The big problem is then that the active characters should |
188 |
# be quoted. Currently `+*.' are quoted. |
# be quoted. Currently `+*.' are quoted. |
189 |
m4_define([AC_CONFIG_IF_MEMBER], |
m4_define([AC_CONFIG_IF_MEMBER], |
190 |
[m4_bmatch($2, [\(^\| \)]m4_re_escape([$1])[\(:\| \|$\)]), |
[m4_bmatch(m4_defn([$2]), [\(^\| \)]m4_re_escape([$1])[\([: ]\|$\)], |
191 |
[$3], [$4])]) |
[$3], [$4])]) |
192 |
|
|
193 |
|
|
194 |
# AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...]) |
# AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...]) |
212 |
# ------------------------------------------------------- |
# ------------------------------------------------------- |
213 |
# Declare the DESTs depend upon their SOURCE1 etc. |
# Declare the DESTs depend upon their SOURCE1 etc. |
214 |
m4_define([_AC_CONFIG_DEPENDENCIES], |
m4_define([_AC_CONFIG_DEPENDENCIES], |
215 |
[m4_divert_push([KILL]) |
[AC_FOREACH([AC_File], [$1], |
216 |
AC_FOREACH([AC_File], [$1], |
[_AC_CONFIG_DEPENDENCY(m4_bpatsubst(AC_File, [:], [,]))])dnl |
|
[_AC_CONFIG_DEPENDENCY(m4_bpatsubst(AC_File, [:], [,]))]) |
|
|
m4_divert_pop([KILL])dnl |
|
217 |
]) |
]) |
218 |
|
|
219 |
|
|
227 |
# Note that this macro does not check if the list $[1] itself |
# Note that this macro does not check if the list $[1] itself |
228 |
# contains doubles. |
# contains doubles. |
229 |
m4_define([_AC_CONFIG_UNIQUE], |
m4_define([_AC_CONFIG_UNIQUE], |
230 |
[m4_divert_push([KILL]) |
[AC_FOREACH([AC_File], [$1], |
231 |
AC_FOREACH([AC_File], [$1], |
[m4_pushdef([AC_Dest], m4_bpatsubst(AC_File, [:.*]))dnl |
232 |
[m4_pushdef([AC_Dest], m4_bpatsubst(AC_File, [:.*])) |
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS], |
233 |
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS], |
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADERS.])])dnl |
|
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADER or AC_CONFIG_HEADERS.])]) |
|
234 |
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS], |
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS], |
235 |
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_LINKS.])]) |
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_LINKS.])])dnl |
236 |
AC_CONFIG_IF_MEMBER(AC_Dest, [_AC_LIST_SUBDIRS], |
AC_CONFIG_IF_MEMBER(AC_Dest, [_AC_LIST_SUBDIRS], |
237 |
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_SUBDIRS.])]) |
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_SUBDIRS.])])dnl |
238 |
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_COMMANDS], |
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_COMMANDS], |
239 |
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_COMMANDS.])]) |
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_COMMANDS.])])dnl |
240 |
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_FILES], |
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_FILES], |
241 |
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_FILES or AC_OUTPUT.])]) |
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_FILES.])])dnl |
242 |
m4_popdef([AC_Dest])]) |
m4_popdef([AC_Dest])])dnl |
|
m4_divert_pop([KILL])dnl |
|
243 |
]) |
]) |
244 |
|
|
245 |
|
|
266 |
m4_define([_AC_OUTPUT_COMMANDS_INIT]) |
m4_define([_AC_OUTPUT_COMMANDS_INIT]) |
267 |
|
|
268 |
|
|
269 |
|
# _AC_CONFIG_COMMAND(NAME, [COMMANDS]) |
270 |
|
# ------------------------------------ |
271 |
|
# See below. |
272 |
|
m4_define([_AC_CONFIG_COMMAND], |
273 |
|
[_AC_CONFIG_UNIQUE([$1])dnl |
274 |
|
m4_append([AC_LIST_COMMANDS], [ $1])dnl |
275 |
|
m4_ifval([$2], |
276 |
|
[m4_append([AC_LIST_COMMANDS_COMMANDS], |
277 |
|
[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;; |
278 |
|
])])dnl |
279 |
|
]) |
280 |
|
|
281 |
# AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS]) |
# AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS]) |
282 |
# --------------------------------------------------- |
# --------------------------------------------------- |
283 |
# |
# |
285 |
# commands must be associated with a NAME, which should be thought |
# commands must be associated with a NAME, which should be thought |
286 |
# as the name of a file the COMMANDS create. |
# as the name of a file the COMMANDS create. |
287 |
AC_DEFUN([AC_CONFIG_COMMANDS], |
AC_DEFUN([AC_CONFIG_COMMANDS], |
288 |
[m4_divert_push([KILL]) |
[AC_FOREACH([AC_Name], [$1], [_AC_CONFIG_COMMAND(m4_defn([AC_Name]), [$2])])dnl |
289 |
_AC_CONFIG_UNIQUE([$1]) |
_AC_CONFIG_COMMANDS_INIT([$3])dnl |
|
m4_append([AC_LIST_COMMANDS], [ $1]) |
|
|
|
|
|
m4_if([$2],,, [AC_FOREACH([AC_Name], [$1], |
|
|
[m4_append([AC_LIST_COMMANDS_COMMANDS], |
|
|
[ ]m4_bpatsubst(AC_Name, [:.*])[ ) $2 ;; |
|
|
])])]) |
|
|
_AC_CONFIG_COMMANDS_INIT([$3]) |
|
|
m4_divert_pop([KILL])dnl |
|
290 |
ac_config_commands="$ac_config_commands $1" |
ac_config_commands="$ac_config_commands $1" |
291 |
])dnl |
]) |
292 |
|
|
293 |
# Initialize the lists. |
# Initialize the lists. |
294 |
m4_define([AC_LIST_COMMANDS]) |
m4_define([AC_LIST_COMMANDS]) |
380 |
## ----------------------- ## |
## ----------------------- ## |
381 |
|
|
382 |
|
|
383 |
|
# _AC_CONFIG_HEADER(HEADER, [COMMANDS]) |
384 |
|
# ------------------------------------- |
385 |
|
# See below. |
386 |
|
m4_define([_AC_CONFIG_HEADER], |
387 |
|
[_AC_CONFIG_UNIQUE([$1])dnl |
388 |
|
m4_append([AC_LIST_HEADERS], [ $1])dnl |
389 |
|
_AC_CONFIG_DEPENDENCIES([$1])dnl |
390 |
|
dnl Register the commands |
391 |
|
m4_ifval([$2], |
392 |
|
[m4_append([AC_LIST_HEADERS_COMMANDS], |
393 |
|
[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;; |
394 |
|
])])dnl |
395 |
|
]) |
396 |
|
|
397 |
|
|
398 |
# AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS]) |
# AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS]) |
399 |
# ------------------------------------------------------ |
# ------------------------------------------------------ |
400 |
# Specify that the HEADERS are to be created by instantiation of the |
# Specify that the HEADERS are to be created by instantiation of the |
408 |
# AC_LIST_HEADERS_COMMANDS |
# AC_LIST_HEADERS_COMMANDS |
409 |
# esac |
# esac |
410 |
AC_DEFUN([AC_CONFIG_HEADERS], |
AC_DEFUN([AC_CONFIG_HEADERS], |
411 |
[m4_divert_push([KILL]) |
[AC_FOREACH([AC_File], [$1], [_AC_CONFIG_HEADER(m4_defn([AC_File]), [$2])])dnl |
412 |
_AC_CONFIG_UNIQUE([$1]) |
_AC_CONFIG_COMMANDS_INIT([$3])dnl |
|
_AC_CONFIG_DEPENDENCIES([$1]) |
|
|
m4_append([AC_LIST_HEADERS], [ $1]) |
|
|
dnl Register the commands |
|
|
m4_ifval([$2], [AC_FOREACH([AC_File], [$1], |
|
|
[m4_append([AC_LIST_HEADERS_COMMANDS], |
|
|
[ ]m4_bpatsubst(AC_File, [:.*])[ ) $2 ;; |
|
|
])])]) |
|
|
_AC_CONFIG_COMMANDS_INIT([$3]) |
|
|
m4_divert_pop([KILL])dnl |
|
413 |
ac_config_headers="$ac_config_headers m4_normalize([$1])" |
ac_config_headers="$ac_config_headers m4_normalize([$1])" |
414 |
])dnl |
]) |
415 |
|
|
416 |
# Initialize to empty. It is much easier and uniform to have a config |
# Initialize to empty. It is much easier and uniform to have a config |
417 |
# list expand to empty when undefined, instead of special casing when |
# list expand to empty when undefined, instead of special casing when |
671 |
## --------------------- ## |
## --------------------- ## |
672 |
|
|
673 |
|
|
674 |
|
# _AC_CONFIG_LINK(DEST:SOURCE, [COMMANDS]) |
675 |
|
# ---------------------------------------- |
676 |
|
# See below. |
677 |
|
m4_define([_AC_CONFIG_LINK], |
678 |
|
[_AC_CONFIG_UNIQUE([$1])dnl |
679 |
|
m4_append([AC_LIST_LINKS], [ $1])dnl |
680 |
|
_AC_CONFIG_DEPENDENCIES([$1])dnl |
681 |
|
m4_bmatch([$1], [^\.:\| \.:], [m4_fatal([$0: invalid destination: `.'])])dnl |
682 |
|
dnl Register the commands |
683 |
|
m4_ifval([$2], |
684 |
|
[m4_append([AC_LIST_LINKS_COMMANDS], |
685 |
|
[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;; |
686 |
|
])])dnl |
687 |
|
]) |
688 |
|
|
689 |
# AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS]) |
# AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS]) |
690 |
# -------------------------------------------------------- |
# -------------------------------------------------------- |
691 |
# Specify that config.status should establish a (symbolic if possible) |
# Specify that config.status should establish a (symbolic if possible) |
693 |
# Reject DEST=., because it is makes it hard for ./config.status |
# Reject DEST=., because it is makes it hard for ./config.status |
694 |
# to guess the links to establish (`./config.status .'). |
# to guess the links to establish (`./config.status .'). |
695 |
AC_DEFUN([AC_CONFIG_LINKS], |
AC_DEFUN([AC_CONFIG_LINKS], |
696 |
[m4_divert_push([KILL]) |
[AC_FOREACH([AC_File], [$1], [_AC_CONFIG_LINK(m4_defn([AC_File]), [$2])])dnl |
697 |
_AC_CONFIG_UNIQUE([$1]) |
_AC_CONFIG_COMMANDS_INIT([$3])dnl |
|
_AC_CONFIG_DEPENDENCIES([$1]) |
|
|
m4_bmatch([$1], [^\.:\| \.:], [m4_fatal([$0: invalid destination: `.'])]) |
|
|
m4_append([AC_LIST_LINKS], [ $1]) |
|
|
dnl Register the commands |
|
|
m4_ifval([$2], [AC_FOREACH([AC_File], [$1], |
|
|
[m4_append([AC_LIST_LINKS_COMMANDS], |
|
|
[ ]m4_bpatsubst(AC_File, [:.*])[ ) $2 ;; |
|
|
])])]) |
|
|
_AC_CONFIG_COMMANDS_INIT([$3]) |
|
|
m4_divert_pop([KILL])dnl |
|
698 |
ac_config_links="$ac_config_links m4_normalize([$1])" |
ac_config_links="$ac_config_links m4_normalize([$1])" |
699 |
])dnl |
]) |
700 |
|
|
701 |
|
|
702 |
# Initialize the list. |
# Initialize the list. |
798 |
## --------------------- ## |
## --------------------- ## |
799 |
|
|
800 |
|
|
801 |
|
# _AC_CONFIG_FILE(FILE..., [COMMANDS]) |
802 |
|
# ------------------------------------ |
803 |
|
# See below. |
804 |
|
m4_define([_AC_CONFIG_FILE], |
805 |
|
[_AC_CONFIG_UNIQUE([$1])dnl |
806 |
|
m4_append([AC_LIST_FILES], [ $1])dnl |
807 |
|
_AC_CONFIG_DEPENDENCIES([$1])dnl |
808 |
|
dnl Register the commands. |
809 |
|
m4_ifval([$2], |
810 |
|
[m4_append([AC_LIST_FILES_COMMANDS], |
811 |
|
[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;; |
812 |
|
])])dnl |
813 |
|
]) |
814 |
|
|
815 |
# AC_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS]) |
# AC_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS]) |
816 |
# ------------------------------------------------- |
# ------------------------------------------------- |
817 |
# Specify output files, as with AC_OUTPUT, i.e., files that are |
# Specify output files, as with AC_OUTPUT, i.e., files that are |
825 |
# AC_LIST_FILES_COMMANDS |
# AC_LIST_FILES_COMMANDS |
826 |
# esac |
# esac |
827 |
AC_DEFUN([AC_CONFIG_FILES], |
AC_DEFUN([AC_CONFIG_FILES], |
828 |
[m4_divert_push([KILL]) |
[AC_FOREACH([AC_File], [$1], [_AC_CONFIG_FILE(m4_defn([AC_File]), [$2])])dnl |
829 |
_AC_CONFIG_UNIQUE([$1]) |
_AC_CONFIG_COMMANDS_INIT([$3])dnl |
|
_AC_CONFIG_DEPENDENCIES([$1]) |
|
|
m4_append([AC_LIST_FILES], [ $1]) |
|
|
dnl Register the commands. |
|
|
m4_ifval([$2], [AC_FOREACH([AC_File], [$1], |
|
|
[m4_append([AC_LIST_FILES_COMMANDS], |
|
|
[ ]m4_bpatsubst(AC_File, [:.*])[ ) $2 ;; |
|
|
])])]) |
|
|
_AC_CONFIG_COMMANDS_INIT([$3]) |
|
|
m4_divert_pop([KILL])dnl |
|
830 |
ac_config_files="$ac_config_files m4_normalize([$1])" |
ac_config_files="$ac_config_files m4_normalize([$1])" |
831 |
])dnl |
]) |
832 |
|
|
833 |
# Initialize the lists. |
# Initialize the lists. |
834 |
m4_define([AC_LIST_FILES]) |
m4_define([AC_LIST_FILES]) |