1 AC_DEFUN(AM_C_PROTOTYPES,
2 [AC_REQUIRE([AM_PROG_CC_STDC])
3 AC_BEFORE([$0], [AC_C_INLINE])
4 AC_MSG_CHECKING([for function prototypes])
5 if test "$am_cv_prog_cc_stdc" != no; then
11 U=_ ANSI2KNR=./ansi2knr
12 # Ensure some checks needed by ansi2knr itself.
14 AC_CHECK_HEADERS(string.h)
23 # @defmac AC_PROG_CC_STDC
24 # @maindex PROG_CC_STDC
26 # If the C compiler in not in ANSI C mode by default, try to add an option
27 # to output variable @code{CC} to make it so. This macro tries various
28 # options that select ANSI C on some system or another. It considers the
29 # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
30 # handles function prototypes correctly.
32 # If you use this macro, you should check after calling it whether the C
33 # compiler has been set to accept ANSI C; if not, the shell variable
34 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
35 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
36 # program @code{ansi2knr}, which comes with Ghostscript.
39 AC_DEFUN(AM_PROG_CC_STDC,
40 [AC_REQUIRE([AC_PROG_CC])
41 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
42 AC_CACHE_VAL(am_cv_prog_cc_stdc,
43 [am_cv_prog_cc_stdc=no
45 # Don't try gcc -ansi; that turns off useful extensions and
46 # breaks some systems' header files.
48 # Ultrix and OSF/1 -std1
49 # HP-UX -Aa -D_HPUX_SOURCE
50 # SVR4 -Xc -D__EXTENSIONS__
51 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
53 CC="$ac_save_CC $ac_arg"
55 [#if !defined(__STDC__) || __STDC__ != 1
58 /* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
60 # include <sys/types.h>
61 # include <sys/stat.h>
64 int test (int i, double x);
65 struct s1 {int (*f) (int a);};
66 struct s2 {int (*f) (double a);};],
67 [am_cv_prog_cc_stdc="$ac_arg"; break])
71 AC_MSG_RESULT($am_cv_prog_cc_stdc)
72 case "x$am_cv_prog_cc_stdc" in
74 *) CC="$CC $am_cv_prog_cc_stdc" ;;
78 AC_DEFUN(WGET_STRUCT_UTIMBUF,
79 [AC_MSG_CHECKING(for struct utimbuf)
80 if test x"$ac_cv_header_utime_h" = xyes; then
81 AC_EGREP_CPP([struct[ ]+utimbuf],
83 [AC_DEFINE(HAVE_STRUCT_UTIMBUF)
91 # This code originates from Ulrich Drepper's AM_WITH_NLS.
93 AC_DEFUN(WGET_WITH_NLS,
94 [AC_MSG_CHECKING([whether NLS is requested])
95 dnl Default is enabled NLS
97 [ --disable-nls do not use Native Language Support],
98 HAVE_NLS=$enableval, HAVE_NLS=yes)
99 AC_MSG_RESULT($HAVE_NLS)
101 dnl If something goes wrong, we may still decide not to use NLS.
102 dnl For this reason, defer AC_SUBST'ing HAVE_NLS until the very
105 if test x"$HAVE_NLS" = xyes; then
106 AC_MSG_RESULT("language catalogs: $ALL_LINGUAS")
107 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
108 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
109 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
110 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
112 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
117 dnl Test whether we really found GNU xgettext.
118 if test "$XGETTEXT" != ":"; then
119 dnl If it is no GNU xgettext we define it as : so that the
120 dnl Makefiles still can work.
121 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
125 [found xgettext programs is not GNU xgettext; ignore it])
130 AC_CHECK_HEADERS(locale.h libintl.h)
132 AC_CHECK_FUNCS(gettext, [], [
133 AC_CHECK_LIB(intl, gettext, [
134 dnl gettext is in libintl; announce the fact manually.
136 AC_DEFINE(HAVE_GETTEXT)
139 [gettext not found; disabling NLS])
144 dnl These rules are solely for the distribution goal. While doing this
145 dnl we only have to keep exactly one list of the available catalogs
147 for lang in $ALL_LINGUAS; do
148 GMOFILES="$GMOFILES $lang.gmo"
149 POFILES="$POFILES $lang.po"
151 dnl Construct list of names of catalog files to be constructed.
152 for lang in $ALL_LINGUAS; do
153 CATALOGS="$CATALOGS ${lang}${CATOBJEXT}"
156 dnl Make all variables we use known to autoconf.
159 AC_SUBST(DATADIRNAME)
166 dnl Some independently maintained files, such as po/Makefile.in,
167 dnl use `USE_NLS', so support it.
170 if test "x$HAVE_NLS" = xyes; then
175 dnl Generate list of files to be processed by xgettext which will
176 dnl be included in po/Makefile.
178 dnl This is not strictly an Autoconf macro, because it is run from
179 dnl within `config.status' rather than from within configure. This
180 dnl is why special rules must be applied for it.
181 AC_DEFUN(WGET_PROCESS_PO,
182 [srcdir=$ac_given_srcdir # Advanced autoconf hackery
183 dnl I wonder what the following several lines do...
184 if test "x$srcdir" != "x."; then
185 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
186 posrcprefix="$srcdir/"
188 posrcprefix="../$srcdir/"
194 dnl Use `echo' rather than AC_MSG_RESULT, because this is run from
196 echo "generating po/POTFILES from $srcdir/po/POTFILES.in"
197 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," \
198 -e "\$s/\(.*\) \\\\/\1/" \
199 < $srcdir/po/POTFILES.in > po/POTFILES
200 echo "creating po/Makefile"
201 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
204 # Search path for a program which passes the given test.
205 # Ulrich Drepper <drepper@cygnus.com>, 1996.
207 # This file may be copied and used freely without restrictions. It
208 # can be used in projects which are not available under the GNU Public
209 # License but which still want to provide support for the GNU gettext
210 # functionality. Please note that the actual code is *not* freely
215 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
216 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
217 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
218 [# Extract the first word of "$2", so it can be a program name with args.
219 set dummy $2; ac_word=[$]2
220 AC_MSG_CHECKING([for $ac_word])
221 AC_CACHE_VAL(ac_cv_path_$1,
224 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
227 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
228 for ac_dir in ifelse([$5], , $PATH, [$5]); do
229 test -z "$ac_dir" && ac_dir=.
230 if test -f $ac_dir/$ac_word; then
232 ac_cv_path_$1="$ac_dir/$ac_word"
238 dnl If no 4th arg is given, leave the cache variable unset,
239 dnl so AC_PATH_PROGS will keep looking.
240 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
245 if test -n "[$]$1"; then