Commit | Line | Data |
---|---|---|
50fb7977 | 1 | dnl aclocal.m4 generated automatically by aclocal 1.2 |
2f1fec47 ILT |
2 | |
3 | # Do all the work for Automake. This macro actually does too much -- | |
4 | # some checks are only needed if your package does certain things. | |
5 | # But this isn't really a big deal. | |
6 | ||
7 | # serial 1 | |
8 | ||
9 | dnl Usage: | |
10 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
11 | ||
12 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
13 | [AC_REQUIRE([AM_PROG_INSTALL]) | |
14 | PACKAGE=[$1] | |
15 | AC_SUBST(PACKAGE) | |
16 | VERSION=[$2] | |
17 | AC_SUBST(VERSION) | |
50fb7977 ILT |
18 | dnl test to see if srcdir already configured |
19 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
20 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) | |
21 | fi | |
2f1fec47 ILT |
22 | ifelse([$3],, |
23 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") | |
24 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) | |
25 | AM_SANITY_CHECK | |
26 | AC_ARG_PROGRAM | |
27 | dnl FIXME This is truly gross. | |
28 | missing_dir=`cd $ac_aux_dir && pwd` | |
29 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
30 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
31 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
32 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
33 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
34 | AC_PROG_MAKE_SET]) | |
35 | ||
36 | ||
37 | # serial 1 | |
38 | ||
39 | AC_DEFUN(AM_PROG_INSTALL, | |
40 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
41 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
42 | AC_SUBST(INSTALL_SCRIPT)dnl | |
43 | ]) | |
44 | ||
45 | # | |
46 | # Check to make sure that the build environment is sane. | |
47 | # | |
48 | ||
49 | AC_DEFUN(AM_SANITY_CHECK, | |
50 | [AC_MSG_CHECKING([whether build environment is sane]) | |
51 | # Just in case | |
52 | sleep 1 | |
53 | echo timestamp > conftestfile | |
54 | # Do `set' in a subshell so we don't clobber the current shell's | |
55 | # arguments. Must try -L first in case configure is actually a | |
56 | # symlink; some systems play weird games with the mod time of symlinks | |
57 | # (eg FreeBSD returns the mod time of the symlink's containing | |
58 | # directory). | |
59 | if ( | |
60 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
61 | if test "$@" = "X"; then | |
62 | # -L didn't work. | |
63 | set X `ls -t $srcdir/configure conftestfile` | |
64 | fi | |
65 | test "[$]2" = conftestfile | |
66 | ) | |
67 | then | |
68 | # Ok. | |
69 | : | |
70 | else | |
71 | AC_MSG_ERROR([newly created file is older than distributed files! | |
72 | Check your system clock]) | |
73 | fi | |
74 | rm -f conftest* | |
75 | AC_MSG_RESULT(yes)]) | |
76 | ||
77 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) | |
78 | dnl The program must properly implement --version. | |
79 | AC_DEFUN(AM_MISSING_PROG, | |
80 | [AC_MSG_CHECKING(for working $2) | |
81 | # Run test in a subshell; some versions of sh will print an error if | |
82 | # an executable is not found, even if stderr is redirected. | |
50fb7977 ILT |
83 | # Redirect stdin to placate older versions of autoconf. Sigh. |
84 | if ($2 --version) < /dev/null > /dev/null 2>&1; then | |
2f1fec47 ILT |
85 | $1=$2 |
86 | AC_MSG_RESULT(found) | |
87 | else | |
88 | $1="$3/missing $2" | |
89 | AC_MSG_RESULT(missing) | |
90 | fi | |
91 | AC_SUBST($1)]) | |
92 | ||
274e44ae ILT |
93 | |
94 | # serial 9 AM_PROG_LIBTOOL | |
95 | AC_DEFUN(AM_PROG_LIBTOOL, | |
96 | [AC_REQUIRE([AC_CANONICAL_HOST]) | |
97 | AC_REQUIRE([AC_PROG_CC]) | |
98 | AC_REQUIRE([AC_PROG_RANLIB]) | |
99 | AC_REQUIRE([AM_PROG_LD]) | |
100 | AC_REQUIRE([AC_PROG_LN_S]) | |
101 | ||
102 | # Always use our own libtool. | |
103 | LIBTOOL='$(top_builddir)/libtool' | |
104 | AC_SUBST(LIBTOOL) | |
105 | ||
106 | dnl Allow the --disable-shared flag to stop us from building shared libs. | |
107 | AC_ARG_ENABLE(shared, | |
108 | [ --enable-shared build shared libraries [default=yes]], | |
109 | [if test "$enableval" = no; then | |
110 | enable_shared=no | |
111 | else | |
112 | enable_shared=yes | |
113 | fi]) | |
114 | libtool_shared= | |
115 | test "$enable_shared" = no && libtool_shared=" --disable-shared" | |
116 | ||
117 | dnl Allow the --disable-static flag to stop us from building static libs. | |
118 | AC_ARG_ENABLE(static, | |
119 | [ --enable-static build static libraries [default=yes]], | |
120 | [if test "$enableval" = no; then | |
121 | enable_static=no | |
122 | else | |
123 | enable_static=yes | |
124 | fi]) | |
125 | libtool_static= | |
126 | test "$enable_static" = no && libtool_static=" --disable-static" | |
127 | ||
128 | libtool_flags="$libtool_shared$libtool_static" | |
129 | test "$silent" = yes && libtool_flags="$libtool_flags --silent" | |
130 | test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" | |
131 | test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" | |
132 | ||
133 | # Some flags need to be propagated to the compiler or linker for good | |
134 | # libtool support. | |
135 | [case "$host" in | |
136 | *-*-irix6*) | |
137 | ac_save_CFLAGS="$CFLAGS" | |
138 | # -n32 always needs to be added to the linker when using GCC. | |
139 | test "$ac_cv_prog_gcc" = yes && CFLAGS="$CFLAGS -n32" | |
140 | for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do | |
141 | if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then | |
142 | LD="${LD-ld} $f" | |
143 | fi | |
144 | done | |
145 | CFLAGS="$ac_save_CFLAGS" | |
146 | ;; | |
147 | ||
148 | *-*-sco3.2v5*) | |
149 | # On SCO OpenServer 5, we need -belf to get full-featured binaries. | |
150 | CFLAGS="$CFLAGS -belf" | |
151 | ;; | |
152 | esac] | |
153 | ||
154 | # Actually configure libtool. ac_aux_dir is where install-sh is found. | |
155 | CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ | |
156 | LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \ | |
157 | ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ | |
158 | $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ | |
159 | || AC_MSG_ERROR([libtool configure failed]) | |
160 | ]) | |
161 | ||
162 | # AM_PROG_LD - find the path to the GNU or non-GNU linker | |
163 | AC_DEFUN(AM_PROG_LD, | |
164 | [AC_ARG_WITH(gnu-ld, | |
165 | [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], | |
166 | test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) | |
167 | if test "$with_gnu_ld" = yes; then | |
168 | AC_MSG_CHECKING([for GNU ld]) | |
169 | else | |
170 | AC_MSG_CHECKING([for non-GNU ld]) | |
171 | fi | |
172 | AC_CACHE_VAL(ac_cv_path_LD, | |
173 | [case "$LD" in | |
42a62317 | 174 | "") |
274e44ae ILT |
175 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
176 | for ac_dir in $PATH; do | |
177 | test -z "$ac_dir" && ac_dir=. | |
178 | if test -f "$ac_dir/ld"; then | |
179 | ac_cv_path_LD="$ac_dir/ld" | |
180 | # Check to see if the program is GNU ld. I'd rather use --version, | |
181 | # but apparently some GNU ld's only accept -v. | |
182 | # Break only if it was the GNU/non-GNU ld that we prefer. | |
183 | if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then | |
184 | test "$with_gnu_ld" = yes && break | |
185 | else | |
186 | test "$with_gnu_ld" != yes && break | |
187 | fi | |
188 | fi | |
189 | done | |
190 | IFS="$ac_save_ifs" | |
191 | ;; | |
42a62317 ILT |
192 | *) |
193 | ac_cv_path_LD="$LD" # Let the user override the test with a path. | |
194 | ;; | |
274e44ae ILT |
195 | esac]) |
196 | LD="$ac_cv_path_LD" | |
197 | if test -n "$LD"; then | |
198 | AC_MSG_RESULT($LD) | |
199 | else | |
200 | AC_MSG_RESULT(no) | |
201 | fi | |
202 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) | |
203 | AC_SUBST(LD) | |
204 | AM_PROG_LD_GNU | |
205 | ]) | |
206 | ||
207 | AC_DEFUN(AM_PROG_LD_GNU, | |
208 | [AC_CACHE_CHECK([whether we are using GNU ld], ac_cv_prog_gnu_ld, | |
209 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. | |
210 | if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then | |
211 | ac_cv_prog_gnu_ld=yes | |
212 | else | |
213 | ac_cv_prog_gnu_ld=no | |
214 | fi]) | |
215 | ]) | |
216 | ||
217 | # Like AC_CONFIG_HEADER, but automatically create stamp file. | |
218 | ||
219 | AC_DEFUN(AM_CONFIG_HEADER, | |
220 | [AC_PREREQ([2.12]) | |
221 | AC_CONFIG_HEADER([$1]) | |
222 | dnl When config.status generates a header, we must update the stamp-h file. | |
223 | dnl This file resides in the same directory as the config header | |
224 | dnl that is generated. We must strip everything past the first ":", | |
225 | dnl and everything past the last "/". | |
226 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl | |
227 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, | |
228 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, | |
229 | <<am_indx=1 | |
230 | for am_file in <<$1>>; do | |
231 | case " <<$>>CONFIG_HEADERS " in | |
232 | *" <<$>>am_file "*<<)>> | |
233 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx | |
234 | ;; | |
235 | esac | |
236 | am_indx=`expr "<<$>>am_indx" + 1` | |
237 | done<<>>dnl>>) | |
238 | changequote([,]))]) | |
239 | ||
2f1fec47 ILT |
240 | # Add --enable-maintainer-mode option to configure. |
241 | # From Jim Meyering | |
242 | ||
243 | # serial 1 | |
244 | ||
245 | AC_DEFUN(AM_MAINTAINER_MODE, | |
246 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) | |
247 | dnl maintainer-mode is disabled by default | |
248 | AC_ARG_ENABLE(maintainer-mode, | |
249 | [ --enable-maintainer-mode enable make rules and dependencies not useful | |
250 | (and sometimes confusing) to the casual installer], | |
251 | USE_MAINTAINER_MODE=$enableval, | |
252 | USE_MAINTAINER_MODE=no) | |
253 | AC_MSG_RESULT($USE_MAINTAINER_MODE) | |
254 | if test $USE_MAINTAINER_MODE = yes; then | |
255 | MAINT= | |
256 | else | |
257 | MAINT='#M#' | |
258 | fi | |
259 | AC_SUBST(MAINT)dnl | |
260 | ] | |
261 | ) | |
262 | ||
263 | # Check to see if we're running under Cygwin32, without using | |
274e44ae ILT |
264 | # AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes". |
265 | # Otherwise set it to "no". | |
2f1fec47 ILT |
266 | |
267 | dnl AM_CYGWIN32() | |
268 | AC_DEFUN(AM_CYGWIN32, | |
50fb7977 | 269 | [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32, |
274e44ae ILT |
270 | [AC_TRY_COMPILE(,[int main () { return __CYGWIN32__; }], |
271 | am_cv_cygwin32=yes, am_cv_cygwin32=no) | |
272 | rm -f conftest*]) | |
273 | CYGWIN32= | |
274 | test "$am_cv_cygwin32" = yes && CYGWIN32=yes]) | |
275 | ||
276 | # Check to see if we're running under Win32, without using | |
277 | # AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe". | |
278 | # Otherwise set it to "". | |
279 | ||
280 | dnl AM_EXEEXT() | |
281 | dnl This knows we add .exe if we're building in the Cygwin32 | |
282 | dnl environment. But if we're not, then it compiles a test program | |
283 | dnl to see if there is a suffix for executables. | |
284 | AC_DEFUN(AM_EXEEXT, | |
285 | [AC_REQUIRE([AM_CYGWIN32]) | |
286 | AC_MSG_CHECKING([for executable suffix]) | |
287 | AC_CACHE_VAL(am_cv_exeext, | |
288 | [if test "$CYGWIN32" = yes; then | |
289 | am_cv_exeext=.exe | |
50fb7977 | 290 | else |
274e44ae ILT |
291 | cat > am_c_test.c << 'EOF' |
292 | int main() { | |
293 | /* Nothing needed here */ | |
294 | } | |
295 | EOF | |
296 | ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5 | |
297 | am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//` | |
298 | rm -f am_c_test*]) | |
299 | test x"${am_cv_exeext}" = x && am_cv_exeext=no | |
50fb7977 | 300 | fi |
274e44ae ILT |
301 | EXEEXT="" |
302 | test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext} | |
303 | AC_MSG_RESULT(${am_cv_exeext}) | |
2f1fec47 ILT |
304 | AC_SUBST(EXEEXT)]) |
305 |