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