]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gprof/aclocal.m4
* configure, Makefile.in, aclocal.m4: Rebuild with new libtool.
[thirdparty/binutils-gdb.git] / gprof / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.2
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)
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
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.
83 # Redirect stdin to placate older versions of autoconf. Sigh.
84 if ($2 --version) < /dev/null > /dev/null 2>&1; then
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
93
94 # serial 18 AM_PROG_LIBTOOL
95 AC_DEFUN(AM_PROG_LIBTOOL,
96 [AC_REQUIRE([AC_CANONICAL_HOST])
97 AC_REQUIRE([AC_PROG_RANLIB])
98 AC_REQUIRE([AC_PROG_CC])
99 AC_REQUIRE([AM_PROG_LD])
100 AC_REQUIRE([AM_PROG_NM])
101 AC_REQUIRE([AC_PROG_LN_S])
102
103 # Always use our own libtool.
104 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
105 AC_SUBST(LIBTOOL)
106
107 dnl CYGNUS LOCAL arguments to enable-shared
108 dnl Allow the --disable-shared flag to stop us from building shared libs.
109 AC_ARG_ENABLE(shared,
110 [ --enable-shared build shared libraries [default=yes]],
111 [p=${PACKAGE-bogus-package-name}
112 case "$enableval" in
113 yes) libtool_enable_shared=yes ;;
114 no) libtool_enable_shared=no ;;
115 # The value of $p (aka $PACKAGE) is assumed to come from AM_INIT_AUTOMAKE.
116 # If it didn't, it'll be `bogus-package-name', thus making this condition
117 # not be used.
118 *$p*) libtool_enable_shared=yes ;;
119 *) libtool_enable_shared=no ;;
120 esac])
121 test -n "$libtool_enable_shared" && enable_shared="$libtool_enable_shared"
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 libtool_enable_static=no
131 else
132 libtool_enable_static=yes
133 fi])
134 test -n "$libtool_enable_static" && enable_static="$libtool_enable_static"
135 libtool_static=
136 test "$enable_static" = no && libtool_static=" --disable-static"
137
138 libtool_flags="$libtool_shared$libtool_static"
139 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
140 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
141 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
142
143 # Some flags need to be propagated to the compiler or linker for good
144 # libtool support.
145 [case "$host" in
146 *-*-irix6*)
147 ac_save_CFLAGS="$CFLAGS"
148 flag_passed=no
149 for f in -32 -64 -n32 ABI -cckr -mips1 -mips2 -mips3 -mips4; do
150 case "$f" in
151 ABI)
152 test -n "$SGI_ABI" && flag_passed=yes
153 if test "$flag_passed" = no && test "$ac_cv_prog_gcc" = yes; then
154 # Choose the ABI flag according to GCC's specs.
155 if $CC -dumpspecs 2>&1 | sed '/^\*link:$/,/^$/!d' | egrep -e '[ ]-32' >/dev/null; then
156 LD="${LD-ld} -32"
157 else
158 LD="${LD-ld} -n32"
159 fi
160 fi
161 ;;
162
163 *)
164 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
165 flag_passed=yes
166 LD="${LD-ld} $f"
167 fi
168 ;;
169 esac
170 done
171 CFLAGS="$ac_save_CFLAGS"
172 ;;
173
174 *-*-sco3.2v5*)
175 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
176 CFLAGS="$CFLAGS -belf"
177 ;;
178 esac]
179
180 # Actually configure libtool. ac_aux_dir is where install-sh is found.
181 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
182 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
183 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
184 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
185 || AC_MSG_ERROR([libtool configure failed])
186 ])
187
188 # AM_PROG_LD - find the path to the GNU or non-GNU linker
189 AC_DEFUN(AM_PROG_LD,
190 [AC_ARG_WITH(gnu-ld,
191 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
192 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
193 AC_REQUIRE([AC_PROG_CC])
194 ac_prog=ld
195 if test "$ac_cv_prog_gcc" = yes; then
196 # Check if gcc -print-prog-name=ld gives a path.
197 AC_MSG_CHECKING([for ld used by GCC])
198 ac_prog=`($CC -print-prog-name=ld) 2>&5`
199 case "$ac_prog" in
200 # Accept absolute paths.
201 /*)
202 test -z "$LD" && LD="$ac_prog"
203 ;;
204 "")
205 # If it fails, then pretend we aren't using GCC.
206 ac_prog=ld
207 ;;
208 *)
209 # If it is relative, then search for the first ld in PATH.
210 with_gnu_ld=unknown
211 ;;
212 esac
213 elif test "$with_gnu_ld" = yes; then
214 AC_MSG_CHECKING([for GNU ld])
215 else
216 AC_MSG_CHECKING([for non-GNU ld])
217 fi
218 AC_CACHE_VAL(ac_cv_path_LD,
219 [if test -z "$LD"; then
220 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
221 for ac_dir in $PATH; do
222 test -z "$ac_dir" && ac_dir=.
223 if test -f "$ac_dir/$ac_prog"; then
224 ac_cv_path_LD="$ac_dir/$ac_prog"
225 # Check to see if the program is GNU ld. I'd rather use --version,
226 # but apparently some GNU ld's only accept -v.
227 # Break only if it was the GNU/non-GNU ld that we prefer.
228 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
229 test "$with_gnu_ld" != no && break
230 else
231 test "$with_gnu_ld" != yes && break
232 fi
233 fi
234 done
235 IFS="$ac_save_ifs"
236 else
237 ac_cv_path_LD="$LD" # Let the user override the test with a path.
238 fi])
239 LD="$ac_cv_path_LD"
240 if test -n "$LD"; then
241 AC_MSG_RESULT($LD)
242 else
243 AC_MSG_RESULT(no)
244 fi
245 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
246 AC_SUBST(LD)
247 AM_PROG_LD_GNU
248 ])
249
250 AC_DEFUN(AM_PROG_LD_GNU,
251 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
252 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
253 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
254 ac_cv_prog_gnu_ld=yes
255 else
256 ac_cv_prog_gnu_ld=no
257 fi])
258 ])
259
260 # AM_PROG_NM - find the path to a BSD-compatible name lister
261 AC_DEFUN(AM_PROG_NM,
262 [AC_MSG_CHECKING([for BSD-compatible nm])
263 AC_CACHE_VAL(ac_cv_path_NM,
264 [case "$NM" in
265 /*)
266 ac_cv_path_NM="$NM" # Let the user override the test with a path.
267 ;;
268 *)
269 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
270 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
271 test -z "$ac_dir" && dir=.
272 if test -f $ac_dir/nm; then
273 # Check to see if the nm accepts a BSD-compat flag.
274 # Adding the `sed 1!d' prevents false positives on HP-UX, which says:
275 # nm: unknown option "B" ignored
276 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
277 ac_cv_path_NM="$ac_dir/nm -B"
278 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
279 ac_cv_path_NM="$ac_dir/nm -p"
280 else
281 ac_cv_path_NM="$ac_dir/nm"
282 fi
283 break
284 fi
285 done
286 IFS="$ac_save_ifs"
287 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
288 ;;
289 esac])
290 NM="$ac_cv_path_NM"
291 AC_MSG_RESULT([$NM])
292 AC_SUBST(NM)
293 ])
294
295 # Like AC_CONFIG_HEADER, but automatically create stamp file.
296
297 AC_DEFUN(AM_CONFIG_HEADER,
298 [AC_PREREQ([2.12])
299 AC_CONFIG_HEADER([$1])
300 dnl When config.status generates a header, we must update the stamp-h file.
301 dnl This file resides in the same directory as the config header
302 dnl that is generated. We must strip everything past the first ":",
303 dnl and everything past the last "/".
304 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
305 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
306 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
307 <<am_indx=1
308 for am_file in <<$1>>; do
309 case " <<$>>CONFIG_HEADERS " in
310 *" <<$>>am_file "*<<)>>
311 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
312 ;;
313 esac
314 am_indx=`expr "<<$>>am_indx" + 1`
315 done<<>>dnl>>)
316 changequote([,]))])
317
318 # Add --enable-maintainer-mode option to configure.
319 # From Jim Meyering
320
321 # serial 1
322
323 AC_DEFUN(AM_MAINTAINER_MODE,
324 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
325 dnl maintainer-mode is disabled by default
326 AC_ARG_ENABLE(maintainer-mode,
327 [ --enable-maintainer-mode enable make rules and dependencies not useful
328 (and sometimes confusing) to the casual installer],
329 USE_MAINTAINER_MODE=$enableval,
330 USE_MAINTAINER_MODE=no)
331 AC_MSG_RESULT($USE_MAINTAINER_MODE)
332 if test $USE_MAINTAINER_MODE = yes; then
333 MAINT=
334 else
335 MAINT='#M#'
336 fi
337 AC_SUBST(MAINT)dnl
338 ]
339 )
340
341 # Check to see if we're running under Cygwin32, without using
342 # AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
343 # Otherwise set it to "no".
344
345 dnl AM_CYGWIN32()
346 AC_DEFUN(AM_CYGWIN32,
347 [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
348 [AC_TRY_COMPILE(,[return __CYGWIN32__;],
349 am_cv_cygwin32=yes, am_cv_cygwin32=no)
350 rm -f conftest*])
351 CYGWIN32=
352 test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
353
354 # Check to see if we're running under Win32, without using
355 # AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
356 # Otherwise set it to "".
357
358 dnl AM_EXEEXT()
359 dnl This knows we add .exe if we're building in the Cygwin32
360 dnl environment. But if we're not, then it compiles a test program
361 dnl to see if there is a suffix for executables.
362 AC_DEFUN(AM_EXEEXT,
363 [AC_REQUIRE([AM_CYGWIN32])
364 AC_REQUIRE([AM_MINGW32])
365 AC_MSG_CHECKING([for executable suffix])
366 AC_CACHE_VAL(am_cv_exeext,[
367 if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
368 am_cv_exeext=.exe
369 else
370 cat > am_c_test.c << 'EOF'
371 int main() {
372 /* Nothing needed here */
373 }
374 EOF
375 ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
376 am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
377 rm -f am_c_test*])
378 test x"${am_cv_exeext}" = x && am_cv_exeext=no
379 fi
380 EXEEXT=""
381 test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
382 AC_MSG_RESULT(${am_cv_exeext})
383 AC_SUBST(EXEEXT)])
384
385 # Check to see if we're running under Mingw, without using
386 # AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
387 # Otherwise set it to "no".
388
389 dnl AM_MINGW32()
390 AC_DEFUN(AM_MINGW32,
391 [AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
392 [AC_TRY_COMPILE(,[return __MINGW32__;],
393 am_cv_mingw32=yes, am_cv_mingw32=no)
394 rm -f conftest*])
395 MINGW32=
396 test "$am_cv_mingw32" = yes && MINGW32=yes])
397