d234055df8962bf51e94b8ea719f250e8a1e7ee1
[rsync/rsync.git] / popt-1.2 / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.3
2
3 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4 dnl This Makefile.in is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 # Do all the work for Automake.  This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
16
17 # serial 1
18
19 dnl Usage:
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
21
22 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AM_PROG_INSTALL])
24 PACKAGE=[$1]
25 AC_SUBST(PACKAGE)
26 VERSION=[$2]
27 AC_SUBST(VERSION)
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
31 fi
32 ifelse([$3],,
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
45
46
47 # serial 1
48
49 AC_DEFUN(AM_PROG_INSTALL,
50 [AC_REQUIRE([AC_PROG_INSTALL])
51 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
52 AC_SUBST(INSTALL_SCRIPT)dnl
53 ])
54
55 #
56 # Check to make sure that the build environment is sane.
57 #
58
59 AC_DEFUN(AM_SANITY_CHECK,
60 [AC_MSG_CHECKING([whether build environment is sane])
61 # Just in case
62 sleep 1
63 echo timestamp > conftestfile
64 # Do `set' in a subshell so we don't clobber the current shell's
65 # arguments.  Must try -L first in case configure is actually a
66 # symlink; some systems play weird games with the mod time of symlinks
67 # (eg FreeBSD returns the mod time of the symlink's containing
68 # directory).
69 if (
70    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
71    if test "[$]*" = "X"; then
72       # -L didn't work.
73       set X `ls -t $srcdir/configure conftestfile`
74    fi
75    if test "[$]*" != "X $srcdir/configure conftestfile" \
76       && test "[$]*" != "X conftestfile $srcdir/configure"; then
77
78       # If neither matched, then we have a broken ls.  This can happen
79       # if, for instance, CONFIG_SHELL is bash and it inherits a
80       # broken ls alias from the environment.  This has actually
81       # happened.  Such a system could not be considered "sane".
82       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
83 alias in your environment])
84    fi
85
86    test "[$]2" = conftestfile
87    )
88 then
89    # Ok.
90    :
91 else
92    AC_MSG_ERROR([newly created file is older than distributed files!
93 Check your system clock])
94 fi
95 rm -f conftest*
96 AC_MSG_RESULT(yes)])
97
98 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
99 dnl The program must properly implement --version.
100 AC_DEFUN(AM_MISSING_PROG,
101 [AC_MSG_CHECKING(for working $2)
102 # Run test in a subshell; some versions of sh will print an error if
103 # an executable is not found, even if stderr is redirected.
104 # Redirect stdin to placate older versions of autoconf.  Sigh.
105 if ($2 --version) < /dev/null > /dev/null 2>&1; then
106    $1=$2
107    AC_MSG_RESULT(found)
108 else
109    $1="$3/missing $2"
110    AC_MSG_RESULT(missing)
111 fi
112 AC_SUBST($1)])
113
114 # Like AC_CONFIG_HEADER, but automatically create stamp file.
115
116 AC_DEFUN(AM_CONFIG_HEADER,
117 [AC_PREREQ([2.12])
118 AC_CONFIG_HEADER([$1])
119 dnl When config.status generates a header, we must update the stamp-h file.
120 dnl This file resides in the same directory as the config header
121 dnl that is generated.  We must strip everything past the first ":",
122 dnl and everything past the last "/".
123 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
124 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
125 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
126 <<am_indx=1
127 for am_file in <<$1>>; do
128   case " <<$>>CONFIG_HEADERS " in
129   *" <<$>>am_file "*<<)>>
130     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
131     ;;
132   esac
133   am_indx=`expr "<<$>>am_indx" + 1`
134 done<<>>dnl>>)
135 changequote([,]))])
136
137
138 # serial 1
139
140 AC_DEFUN(AM_C_PROTOTYPES,
141 [AC_REQUIRE([AM_PROG_CC_STDC])
142 AC_REQUIRE([AC_PROG_CPP])
143 AC_MSG_CHECKING([for function prototypes])
144 if test "$am_cv_prog_cc_stdc" != no; then
145   AC_MSG_RESULT(yes)
146   AC_DEFINE(PROTOTYPES)
147   U= ANSI2KNR=
148 else
149   AC_MSG_RESULT(no)
150   U=_ ANSI2KNR=./ansi2knr
151   # Ensure some checks needed by ansi2knr itself.
152   AC_HEADER_STDC
153   AC_CHECK_HEADERS(string.h)
154 fi
155 AC_SUBST(U)dnl
156 AC_SUBST(ANSI2KNR)dnl
157 ])
158
159
160 # serial 1
161
162 # @defmac AC_PROG_CC_STDC
163 # @maindex PROG_CC_STDC
164 # @ovindex CC
165 # If the C compiler in not in ANSI C mode by default, try to add an option
166 # to output variable @code{CC} to make it so.  This macro tries various
167 # options that select ANSI C on some system or another.  It considers the
168 # compiler to be in ANSI C mode if it handles function prototypes correctly.
169 #
170 # If you use this macro, you should check after calling it whether the C
171 # compiler has been set to accept ANSI C; if not, the shell variable
172 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
173 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
174 # program @code{ansi2knr}, which comes with Ghostscript.
175 # @end defmac
176
177 AC_DEFUN(AM_PROG_CC_STDC,
178 [AC_REQUIRE([AC_PROG_CC])
179 AC_BEFORE([$0], [AC_C_INLINE])
180 AC_BEFORE([$0], [AC_C_CONST])
181 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
182 dnl a magic option to avoid problems with ANSI preprocessor commands
183 dnl like #elif.
184 dnl FIXME: can't do this because then AC_AIX won't work due to a
185 dnl circular dependency.
186 dnl AC_BEFORE([$0], [AC_PROG_CPP])
187 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
188 AC_CACHE_VAL(am_cv_prog_cc_stdc,
189 [am_cv_prog_cc_stdc=no
190 ac_save_CC="$CC"
191 # Don't try gcc -ansi; that turns off useful extensions and
192 # breaks some systems' header files.
193 # AIX                   -qlanglvl=ansi
194 # Ultrix and OSF/1      -std1
195 # HP-UX                 -Aa -D_HPUX_SOURCE
196 # SVR4                  -Xc -D__EXTENSIONS__
197 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
198 do
199   CC="$ac_save_CC $ac_arg"
200   AC_TRY_COMPILE(
201 [#include <stdarg.h>
202 #include <stdio.h>
203 #include <sys/types.h>
204 #include <sys/stat.h>
205 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
206 struct buf { int x; };
207 FILE * (*rcsopen) (struct buf *, struct stat *, int);
208 static char *e (p, i)
209      char **p;
210      int i;
211 {
212   return p[i];
213 }
214 static char *f (char * (*g) (char **, int), char **p, ...)
215 {
216   char *s;
217   va_list v;
218   va_start (v,p);
219   s = g (p, va_arg (v,int));
220   va_end (v);
221   return s;
222 }
223 int test (int i, double x);
224 struct s1 {int (*f) (int a);};
225 struct s2 {int (*f) (double a);};
226 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
227 int argc;
228 char **argv;
229 ], [
230 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
231 ],
232 [am_cv_prog_cc_stdc="$ac_arg"; break])
233 done
234 CC="$ac_save_CC"
235 ])
236 if test -z "$am_cv_prog_cc_stdc"; then
237   AC_MSG_RESULT([none needed])
238 else
239   AC_MSG_RESULT($am_cv_prog_cc_stdc)
240 fi
241 case "x$am_cv_prog_cc_stdc" in
242   x|xno) ;;
243   *) CC="$CC $am_cv_prog_cc_stdc" ;;
244 esac
245 ])
246