Update copyright notices
[deliverable/binutils-gdb.git] / bfd / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
4 dnl Free Software Foundation, Inc.
5 dnl This file is free software; the Free Software Foundation
6 dnl gives unlimited permission to copy and/or distribute it,
7 dnl with or without modifications, as long as this notice is preserved.
8
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 dnl PARTICULAR PURPOSE.
13
14 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
15 AC_DEFUN(BFD_BINARY_FOPEN,
16 [AC_REQUIRE([AC_CANONICAL_SYSTEM])
17 case "${host}" in
18 changequote(,)dnl
19 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
20 changequote([,])dnl
21 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
22 esac])dnl
23
24 dnl Get a default for CC_FOR_BUILD to put into Makefile.
25 AC_DEFUN(BFD_CC_FOR_BUILD,
26 [# Put a plausible default for CC_FOR_BUILD in Makefile.
27 if test -z "$CC_FOR_BUILD"; then
28 if test "x$cross_compiling" = "xno"; then
29 CC_FOR_BUILD='$(CC)'
30 else
31 CC_FOR_BUILD=gcc
32 fi
33 fi
34 AC_SUBST(CC_FOR_BUILD)
35 # Also set EXEEXT_FOR_BUILD.
36 if test "x$cross_compiling" = "xno"; then
37 EXEEXT_FOR_BUILD='$(EXEEXT)'
38 else
39 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
40 [rm -f conftest*
41 echo 'int main () { return 0; }' > conftest.c
42 bfd_cv_build_exeext=
43 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
44 for file in conftest.*; do
45 case $file in
46 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
47 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
48 esac
49 done
50 rm -f conftest*
51 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
52 EXEEXT_FOR_BUILD=""
53 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
54 fi
55 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
56
57 dnl See whether we need a declaration for a function.
58 AC_DEFUN(BFD_NEED_DECLARATION,
59 [AC_MSG_CHECKING([whether $1 must be declared])
60 AC_CACHE_VAL(bfd_cv_decl_needed_$1,
61 [AC_TRY_COMPILE([
62 #include <stdio.h>
63 #ifdef HAVE_STRING_H
64 #include <string.h>
65 #else
66 #ifdef HAVE_STRINGS_H
67 #include <strings.h>
68 #endif
69 #endif
70 #ifdef HAVE_STDLIB_H
71 #include <stdlib.h>
72 #endif
73 #ifdef HAVE_UNISTD_H
74 #include <unistd.h>
75 #endif],
76 [char *(*pfn) = (char *(*)) $1],
77 bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
78 AC_MSG_RESULT($bfd_cv_decl_needed_$1)
79 if test $bfd_cv_decl_needed_$1 = yes; then
80 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
81 [Define if $1 is not declared in system header files.])
82 fi
83 ])dnl
84
85 dnl Check for existence of a type $1 in sys/procfs.h
86
87 AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE,
88 [AC_MSG_CHECKING([for $1 in sys/procfs.h])
89 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
90 [AC_TRY_COMPILE([
91 #define _SYSCALL32
92 #include <sys/procfs.h>],
93 [$1 avar],
94 bfd_cv_have_sys_procfs_type_$1=yes,
95 bfd_cv_have_sys_procfs_type_$1=no
96 )])
97 if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
98 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
99 [Define if <sys/procfs.h> has $1.])
100 fi
101 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
102 ])
103
104
105 dnl Check for existence of member $2 in type $1 in sys/procfs.h
106
107 AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER,
108 [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
109 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
110 [AC_TRY_COMPILE([
111 #define _SYSCALL32
112 #include <sys/procfs.h>],
113 [$1 avar; void* aref = (void*) &avar.$2],
114 bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
115 bfd_cv_have_sys_procfs_type_member_$1_$2=no
116 )])
117 if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
118 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
119 [Define if <sys/procfs.h> has $1.$2.])
120 fi
121 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
122 ])
123
124 sinclude(../libtool.m4)
125 dnl The lines below arrange for aclocal not to bring libtool.m4
126 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
127 dnl to add a definition of LIBTOOL to Makefile.in.
128 ifelse(yes,no,[
129 AC_DEFUN([AM_PROG_LIBTOOL],)
130 AC_DEFUN([AM_DISABLE_SHARED],)
131 AC_SUBST(LIBTOOL)
132 ])
133
134 sinclude(../gettext.m4)
135 ifelse(yes,no,[
136 AC_DEFUN([CY_WITH_NLS],)
137 AC_SUBST(INTLLIBS)
138 ])
139
140 #serial 1
141 # This test replaces the one in autoconf.
142 # Currently this macro should have the same name as the autoconf macro
143 # because gettext's gettext.m4 (distributed in the automake package)
144 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
145 # give these diagnostics:
146 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
147 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
148
149 undefine([AC_ISC_POSIX])
150
151 AC_DEFUN(AC_ISC_POSIX,
152 [
153 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
154 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
155 ]
156 )
157
158 # Do all the work for Automake. This macro actually does too much --
159 # some checks are only needed if your package does certain things.
160 # But this isn't really a big deal.
161
162 # serial 1
163
164 dnl Usage:
165 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
166
167 AC_DEFUN(AM_INIT_AUTOMAKE,
168 [AC_REQUIRE([AC_PROG_INSTALL])
169 PACKAGE=[$1]
170 AC_SUBST(PACKAGE)
171 VERSION=[$2]
172 AC_SUBST(VERSION)
173 dnl test to see if srcdir already configured
174 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
175 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
176 fi
177 ifelse([$3],,
178 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
179 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
180 AC_REQUIRE([AM_SANITY_CHECK])
181 AC_REQUIRE([AC_ARG_PROGRAM])
182 dnl FIXME This is truly gross.
183 missing_dir=`cd $ac_aux_dir && pwd`
184 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
185 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
186 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
187 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
188 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
189 AC_REQUIRE([AC_PROG_MAKE_SET])])
190
191 #
192 # Check to make sure that the build environment is sane.
193 #
194
195 AC_DEFUN(AM_SANITY_CHECK,
196 [AC_MSG_CHECKING([whether build environment is sane])
197 # Just in case
198 sleep 1
199 echo timestamp > conftestfile
200 # Do `set' in a subshell so we don't clobber the current shell's
201 # arguments. Must try -L first in case configure is actually a
202 # symlink; some systems play weird games with the mod time of symlinks
203 # (eg FreeBSD returns the mod time of the symlink's containing
204 # directory).
205 if (
206 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
207 if test "[$]*" = "X"; then
208 # -L didn't work.
209 set X `ls -t $srcdir/configure conftestfile`
210 fi
211 if test "[$]*" != "X $srcdir/configure conftestfile" \
212 && test "[$]*" != "X conftestfile $srcdir/configure"; then
213
214 # If neither matched, then we have a broken ls. This can happen
215 # if, for instance, CONFIG_SHELL is bash and it inherits a
216 # broken ls alias from the environment. This has actually
217 # happened. Such a system could not be considered "sane".
218 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
219 alias in your environment])
220 fi
221
222 test "[$]2" = conftestfile
223 )
224 then
225 # Ok.
226 :
227 else
228 AC_MSG_ERROR([newly created file is older than distributed files!
229 Check your system clock])
230 fi
231 rm -f conftest*
232 AC_MSG_RESULT(yes)])
233
234 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
235 dnl The program must properly implement --version.
236 AC_DEFUN(AM_MISSING_PROG,
237 [AC_MSG_CHECKING(for working $2)
238 # Run test in a subshell; some versions of sh will print an error if
239 # an executable is not found, even if stderr is redirected.
240 # Redirect stdin to placate older versions of autoconf. Sigh.
241 if ($2 --version) < /dev/null > /dev/null 2>&1; then
242 $1=$2
243 AC_MSG_RESULT(found)
244 else
245 $1="$3/missing $2"
246 AC_MSG_RESULT(missing)
247 fi
248 AC_SUBST($1)])
249
250 # Like AC_CONFIG_HEADER, but automatically create stamp file.
251
252 AC_DEFUN(AM_CONFIG_HEADER,
253 [AC_PREREQ([2.12])
254 AC_CONFIG_HEADER([$1])
255 dnl When config.status generates a header, we must update the stamp-h file.
256 dnl This file resides in the same directory as the config header
257 dnl that is generated. We must strip everything past the first ":",
258 dnl and everything past the last "/".
259 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
260 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
261 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
262 <<am_indx=1
263 for am_file in <<$1>>; do
264 case " <<$>>CONFIG_HEADERS " in
265 *" <<$>>am_file "*<<)>>
266 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
267 ;;
268 esac
269 am_indx=`expr "<<$>>am_indx" + 1`
270 done<<>>dnl>>)
271 changequote([,]))])
272
273 # Add --enable-maintainer-mode option to configure.
274 # From Jim Meyering
275
276 # serial 1
277
278 AC_DEFUN(AM_MAINTAINER_MODE,
279 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
280 dnl maintainer-mode is disabled by default
281 AC_ARG_ENABLE(maintainer-mode,
282 [ --enable-maintainer-mode enable make rules and dependencies not useful
283 (and sometimes confusing) to the casual installer],
284 USE_MAINTAINER_MODE=$enableval,
285 USE_MAINTAINER_MODE=no)
286 AC_MSG_RESULT($USE_MAINTAINER_MODE)
287 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
288 MAINT=$MAINTAINER_MODE_TRUE
289 AC_SUBST(MAINT)dnl
290 ]
291 )
292
293 # Define a conditional.
294
295 AC_DEFUN(AM_CONDITIONAL,
296 [AC_SUBST($1_TRUE)
297 AC_SUBST($1_FALSE)
298 if $2; then
299 $1_TRUE=
300 $1_FALSE='#'
301 else
302 $1_TRUE='#'
303 $1_FALSE=
304 fi])
305
This page took 0.037176 seconds and 5 git commands to generate.