'gl_INIT'. Default is 'gl'.
--po-domain=NAME Specify the prefix of the i18n domain. Usually use
the package name. A suffix '-gnulib' is appended.
+ --witness-c-macro=NAME Specify the C macro that is defined when the
+ sources in this directory are compiled or used.
--vc-files Update version control related files.
--no-vc-files Don't update version control related files
(.gitignore and/or .cvsignore).
q
}' < "$self_abspathname"
echo "#"
- echo "# This file is free software, distributed under the terms of the GNU"
- echo "# General Public License. As a special exception to the GNU General"
- echo "# Public License, this file may be distributed as part of a program"
- echo "# that contains a configuration script generated by Autoconf, under"
+ echo "# This file is free software; you can redistribute it and/or modify"
+ echo "# it under the terms of the GNU General Public License as published by"
+ echo "# the Free Software Foundation; either version 3 of the License, or"
+ echo "# (at your option) any later version."
+ echo "#"
+ echo "# This file is distributed in the hope that it will be useful,"
+ echo "# but WITHOUT ANY WARRANTY; without even the implied warranty of"
+ echo "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
+ echo "# GNU General Public License for more details."
+ echo "#"
+ echo "# You should have received a copy of the GNU General Public License"
+ echo "# along with this file. If not, see <http://www.gnu.org/licenses/>."
+ echo "#"
+ echo "# As a special exception to the GNU General Public License,"
+ echo "# this file may be distributed as part of a program that"
+ echo "# contains a configuration script generated by Autoconf, under"
echo "# the same distribution terms as the rest of that program."
echo "#"
echo "# Generated by gnulib-tool."
# given, blank otherwise
# - macro_prefix from --macro-prefix
# - po_domain from --po-domain
+# - witness_c_macro from --witness-c-macro
# - vc_files true if --vc-files was given, false if --no-vc-files was
# given, blank otherwise
# - autoconf_minversion minimum supported autoconf version
libtool=
macro_prefix=
po_domain=
+ witness_c_macro=
vc_files=
do_changelog=:
doit=:
--po-domain=* )
po_domain=`echo "X$1" | sed -e 's/^X--po-domain=//'`
shift ;;
+ --witness-c-macro )
+ shift
+ if test $# = 0; then
+ func_fatal_error "missing argument for --witness-c-macro"
+ fi
+ witness_c_macro="$1"
+ shift ;;
+ --witness-c-macro=* )
+ witness_c_macro=`echo "X$1" | sed -e 's/^X--witness-c-macro=//'`
+ shift ;;
--vc-files )
vc_files=true
shift ;;
|| test -n "$excl_privileged_tests" || test -n "$excl_unportable_tests" \
|| test -n "$avoidlist" || test -n "$lgpl" || test -n "$makefile_name" \
|| test -n "$macro_prefix" || test -n "$po_domain" \
- || test -n "$vc_files"; then
+ || test -n "$witness_c_macro" || test -n "$vc_files"; then
echo "gnulib-tool: invalid options for 'update' mode" 1>&2
echo "Try 'gnulib-tool --help' for more information." 1>&2
echo "If you really want to modify the gnulib configuration of your project," 1>&2
;;
esac
# Then the explicit dependencies listed in the module description.
- if ! $modcache; then
- func_lookup_file "modules/$1"
- sed -n -e "/^Depends-on$sed_extract_prog" < "$lookedup_file"
- else
- func_cache_lookup_module "$1"
- # Output the field's value, including the final newline (if any).
- if $have_associative; then
- if eval 'test -n "${modcache_dependson[$1]+set}"'; then
- eval 'echo "${modcache_dependson[$1]}"'
- fi
+ { if ! $modcache; then
+ func_lookup_file "modules/$1"
+ sed -n -e "/^Depends-on$sed_extract_prog" < "$lookedup_file"
else
- eval "field_set=\"\$${cachevar}_dependson_set\""
- if test -n "$field_set"; then
- eval "field_value=\"\$${cachevar}_dependson\""
- echo "${field_value}"
+ func_cache_lookup_module "$1"
+ # Output the field's value, including the final newline (if any).
+ if $have_associative; then
+ if eval 'test -n "${modcache_dependson[$1]+set}"'; then
+ eval 'echo "${modcache_dependson[$1]}"'
+ fi
+ else
+ eval "field_set=\"\$${cachevar}_dependson_set\""
+ if test -n "$field_set"; then
+ eval "field_value=\"\$${cachevar}_dependson\""
+ echo "${field_value}"
+ fi
fi
fi
- fi
+ } \
+ | sed -e '/^#/d'
}
# func_get_autoconf_early_snippet module
;;
esac
done
- if $inc; then
+ if $inc && func_acceptable "$dep"; then
func_append inmodules " $dep"
if test "$cond_dependencies" = true; then
escaped_dep=`echo "$dep" | sed -e "$sed_escape_dependency"`
# - libtool true if libtool will be used, false or blank otherwise
# - macro_prefix prefix of gl_LIBOBJS macros to use
# - po_domain prefix of i18n domain to use (without -gnulib suffix)
+# - witness_c_macro from --witness-c-macro
# - actioncmd (optional) command that will reproduce this invocation
# - for_test true if creating a package for testing, false otherwise
# - sed_replace_include_guard_prefix
fi
fi
done
+ if test -n "$witness_c_macro"; then
+ cppflags_part1=" -D$witness_c_macro=1"
+ else
+ cppflags_part1=
+ fi
+ if $for_test; then
+ cppflags_part2=" -DGNULIB_STRICT_CHECKING=1"
+ else
+ cppflags_part2=
+ fi
if test -z "$makefile_name"; then
echo
- if $for_test; then
- echo "AM_CPPFLAGS = -DGNULIB_STRICT_CHECKING=1"
- else
- echo "AM_CPPFLAGS ="
- fi
+ echo "AM_CPPFLAGS =$cppflags_part1$cppflags_part2"
echo "AM_CFLAGS ="
+ else
+ if test -n "$cppflags_part1$cppflags_part2"; then
+ echo
+ echo "AM_CPPFLAGS +=$cppflags_part1$cppflags_part2"
+ fi
fi
echo
if LC_ALL=C grep "^[a-zA-Z0-9_]*_${perhapsLT}LIBRARIES *+\{0,1\}= *$libname\\.$libext\$" "$tmp"/allsnippets > /dev/null \
# - m4base relative directory containing autoconf macros
# - testsbase relative directory containing unit test code
# - macro_prefix prefix of gl_LIBOBJS macros to use
+# - witness_c_macro from --witness-c-macro
# - for_test true if creating a package for testing, false otherwise
# - single_configure true if a single configure file should be generated,
# false for a separate configure file for the tests
if $for_test; then
echo " -DGNULIB_STRICT_CHECKING=1 \\"
fi
+ if test -n "$witness_c_macro"; then
+ echo " -D$witness_c_macro=1 \\"
+ fi
if test -n "${witness_macro}"; then
echo " -D@${witness_macro}@=1 \\"
fi
disable_libtool="$4"
disable_gettext="$5"
if test "$cond_dependencies" = true; then
+ for m in $modules; do echo $m; done | LC_ALL=C sort -u > "$tmp"/modules
# Emit the autoconf code for the unconditional modules.
for module in $1; do
eval $verifier
func_emit_autoconf_snippet " "
echo " $shellvar=true"
deps=`func_get_dependencies $module | sed -e "$sed_dependencies_without_conditions"`
+ # Intersect $deps with the modules list $1.
+ deps=`for m in $deps; do echo $m; done | LC_ALL=C sort -u | LC_ALL=C join - "$tmp"/modules`
for dep in $deps; do
if func_cond_module_p "$dep"; then
func_module_shellfunc_name "$dep"
func_cond_module_condition "$module" "$dep"
if test "$condition" != true; then
- echo ' if $condition; then'
+ echo " if $condition; then"
echo " $shellfunc"
echo ' fi'
else
:
else
deps=`func_get_dependencies $module | sed -e "$sed_dependencies_without_conditions"`
+ # Intersect $deps with the modules list $1.
+ deps=`for m in $deps; do echo $m; done | LC_ALL=C sort -u | LC_ALL=C join - "$tmp"/modules`
for dep in $deps; do
if func_cond_module_p "$dep"; then
func_module_shellfunc_name "$dep"
# - guessed_libtool true if the configure.ac file uses libtool, false otherwise
# - macro_prefix prefix of gl_EARLY, gl_INIT macros to use
# - po_domain prefix of i18n domain to use (without -gnulib suffix)
+# - witness_c_macro from --witness-c-macro
# - vc_files true if --vc-files was given, false if --no-vc-files was
# given, blank otherwise
# - autoconf_minversion minimum supported autoconf version
cached_libtool=
cached_macro_prefix=
cached_po_domain=
+ cached_witness_c_macro=
cached_vc_files=
cached_files=
if test -f "$destdir"/$m4base/gnulib-cache.m4; then
/gl_PO_DOMAIN(/ {
s,^.*gl_PO_DOMAIN([[ ]*\([^]"$`\\)]*\).*$,cached_po_domain="\1",p
}
+ /gl_WITNESS_C_MACRO(/ {
+ s,^.*gl_WITNESS_C_MACRO([[ ]*\([^]"$`\\)]*\).*$,cached_witness_c_macro="\1",p
+ }
/gl_VC_FILES(/ {
s,^.*gl_VC_FILES([[ ]*\([^]"$`\\)]*\).*$,cached_vc_files="\1",p
}'
if test -z "$po_domain"; then
po_domain="$cached_po_domain"
fi
+ # The witness_c_macro defaults to the cached one.
+ if test -z "$witness_c_macro"; then
+ witness_c_macro="$cached_witness_c_macro"
+ fi
# The vc_files defaults to the cached one.
if test -z "$vc_files"; then
vc_files="$cached_vc_files"
if test -n "$po_domain"; then
func_append actioncmd " --po-domain=$po_domain"
fi
+ if test -n "$witness_c_macro"; then
+ func_append actioncmd " --witness-c-macro=$witness_c_macro"
+ fi
if test -n "$vc_files"; then
if test "$vc_files" = true; then
func_append actioncmd " --vc-files"
fi
echo "gl_MACRO_PREFIX([$macro_prefix])"
echo "gl_PO_DOMAIN([$po_domain])"
+ echo "gl_WITNESS_C_DOMAIN([$witness_c_macro])"
if test -n "$vc_files"; then
echo "gl_VC_FILES([$vc_files])"
fi
echo " m4_pattern_allow([^gl_ES\$])dnl a valid locale name"
echo " m4_pattern_allow([^gl_LIBOBJS\$])dnl a variable"
echo " m4_pattern_allow([^gl_LTLIBOBJS\$])dnl a variable"
- echo " AC_REQUIRE([AC_PROG_RANLIB])"
+ echo " AC_REQUIRE([gl_PROG_AR_RANLIB])"
if test -n "$uses_subdirs"; then
echo " AC_REQUIRE([AM_PROG_CC_C_O])"
fi
echo " gl_m4_base='$m4base'"
func_emit_initmacro_start $macro_prefix
echo " gl_source_base='$sourcebase'"
+ if test -n "$witness_c_macro"; then
+ echo " m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$witness_c_macro])"
+ fi
func_emit_autoconf_snippets "$main_modules" func_verify_module true false true
+ if test -n "$witness_c_macro"; then
+ echo " m4_popdef([gl_MODULE_INDICATOR_CONDITION])"
+ fi
echo " # End of code from modules"
func_emit_initmacro_end $macro_prefix
echo " gltests_libdeps="
echo " - mention \"${val}\" in ${var} in ${dir}Makefile.am,"
fi
done
- echo " - invoke ${macro_prefix}_EARLY in $configure_ac, right after AC_PROG_CC,"
+ if grep '^ *AC_PROG_CC_STDC' "$configure_ac" > /dev/null; then
+ position_early_after=AC_PROG_CC_STDC
+ else
+ if grep '^ *AC_PROG_CC_C99' "$configure_ac" > /dev/null; then
+ position_early_after=AC_PROG_CC_C99
+ else
+ position_early_after=AC_PROG_CC
+ fi
+ fi
+ echo " - invoke ${macro_prefix}_EARLY in $configure_ac, right after $position_early_after,"
echo " - invoke ${macro_prefix}_INIT in $configure_ac."
}
testsbase=gltests
macro_prefix=gl
po_domain=
+ witness_c_macro=
vc_files=
# Determine final module list.
echo "AC_PROG_CC"
echo "AC_PROG_INSTALL"
echo "AC_PROG_MAKE_SET"
- echo "AC_PROG_RANLIB"
+ echo "gl_PROG_AR_RANLIB"
echo
if test -n "$uses_subdirs"; then
echo "AM_PROG_CC_C_O"
echo "m4_pattern_allow([^gl_LIBOBJS\$])dnl a variable"
echo "m4_pattern_allow([^gl_LTLIBOBJS\$])dnl a variable"
echo
- echo "AC_PROG_RANLIB"
+ echo "gl_PROG_AR_RANLIB"
echo
if test -n "$any_uses_subdirs"; then
echo "AM_PROG_CC_C_O"
# inc_longrunning_tests, inc_privileged_tests,
# inc_unportable_tests, inc_all_tests, avoidlist, sourcebase,
# m4base, pobase, docbase, testsbase, inctests, libname, lgpl,
- # makefile_name, libtool, macro_prefix, po_domain, vc_files
+ # makefile_name, libtool, macro_prefix, po_domain,
+ # witness_c_macro, vc_files
# don't propagate from one directory to another.
(func_import) || func_exit 1
done
;;
extract-dependencies )
+ if test -n "$avoidlist"; then
+ func_fatal_error "cannot combine --avoid and --extract-dependencies"
+ fi
for module
do
func_verify_module