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