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