* Makefile.in (RUNTEST): Fix path to runtest.
[deliverable/binutils-gdb.git] / gprof / aclocal.m4
CommitLineData
50fb7977 1dnl aclocal.m4 generated automatically by aclocal 1.2
2f1fec47
ILT
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
9dnl Usage:
10dnl AM_INIT_AUTOMAKE(package,version, [no-define])
11
12AC_DEFUN(AM_INIT_AUTOMAKE,
13[AC_REQUIRE([AM_PROG_INSTALL])
14PACKAGE=[$1]
15AC_SUBST(PACKAGE)
16VERSION=[$2]
17AC_SUBST(VERSION)
50fb7977
ILT
18dnl test to see if srcdir already configured
19if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
20 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
21fi
2f1fec47
ILT
22ifelse([$3],,
23AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
24AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
25AM_SANITY_CHECK
26AC_ARG_PROGRAM
27dnl FIXME This is truly gross.
28missing_dir=`cd $ac_aux_dir && pwd`
29AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
30AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
31AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
32AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
33AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
34AC_PROG_MAKE_SET])
35
36
37# serial 1
38
39AC_DEFUN(AM_PROG_INSTALL,
40[AC_REQUIRE([AC_PROG_INSTALL])
41test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
42AC_SUBST(INSTALL_SCRIPT)dnl
43])
44
45#
46# Check to make sure that the build environment is sane.
47#
48
49AC_DEFUN(AM_SANITY_CHECK,
50[AC_MSG_CHECKING([whether build environment is sane])
51# Just in case
52sleep 1
53echo 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).
59if (
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 )
67then
68 # Ok.
69 :
70else
71 AC_MSG_ERROR([newly created file is older than distributed files!
72Check your system clock])
73fi
74rm -f conftest*
75AC_MSG_RESULT(yes)])
76
77dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
78dnl The program must properly implement --version.
79AC_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.
50fb7977
ILT
83# Redirect stdin to placate older versions of autoconf. Sigh.
84if ($2 --version) < /dev/null > /dev/null 2>&1; then
2f1fec47
ILT
85 $1=$2
86 AC_MSG_RESULT(found)
87else
88 $1="$3/missing $2"
89 AC_MSG_RESULT(missing)
90fi
91AC_SUBST($1)])
92
274e44ae 93
641146fe 94# serial 19 AM_PROG_LIBTOOL
274e44ae
ILT
95AC_DEFUN(AM_PROG_LIBTOOL,
96[AC_REQUIRE([AC_CANONICAL_HOST])
274e44ae 97AC_REQUIRE([AC_PROG_RANLIB])
fa1a1b32 98AC_REQUIRE([AC_PROG_CC])
274e44ae 99AC_REQUIRE([AM_PROG_LD])
fa1a1b32 100AC_REQUIRE([AM_PROG_NM])
274e44ae
ILT
101AC_REQUIRE([AC_PROG_LN_S])
102
103# Always use our own libtool.
c3de2a19 104LIBTOOL='$(SHELL) $(top_builddir)/libtool'
274e44ae
ILT
105AC_SUBST(LIBTOOL)
106
c3de2a19 107dnl CYGNUS LOCAL arguments to enable-shared
274e44ae
ILT
108dnl Allow the --disable-shared flag to stop us from building shared libs.
109AC_ARG_ENABLE(shared,
110[ --enable-shared build shared libraries [default=yes]],
c3de2a19
ILT
111[p=${PACKAGE-bogus-package-name}
112 case "$enableval" in
fa1a1b32
ILT
113 yes) libtool_enable_shared=yes ;;
114 no) libtool_enable_shared=no ;;
c3de2a19
ILT
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.
fa1a1b32
ILT
118 *$p*) libtool_enable_shared=yes ;;
119 *) libtool_enable_shared=no ;;
c3de2a19 120esac])
fa1a1b32 121test -n "$libtool_enable_shared" && enable_shared="$libtool_enable_shared"
274e44ae
ILT
122libtool_shared=
123test "$enable_shared" = no && libtool_shared=" --disable-shared"
c3de2a19 124dnl END CYGNUS LOCAL
274e44ae
ILT
125
126dnl Allow the --disable-static flag to stop us from building static libs.
127AC_ARG_ENABLE(static,
128[ --enable-static build static libraries [default=yes]],
129[if test "$enableval" = no; then
fa1a1b32 130 libtool_enable_static=no
274e44ae 131else
fa1a1b32 132 libtool_enable_static=yes
274e44ae 133fi])
fa1a1b32 134test -n "$libtool_enable_static" && enable_static="$libtool_enable_static"
274e44ae
ILT
135libtool_static=
136test "$enable_static" = no && libtool_static=" --disable-static"
137
138libtool_flags="$libtool_shared$libtool_static"
139test "$silent" = yes && libtool_flags="$libtool_flags --silent"
140test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
141test "$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.
641146fe
ILT
145case "$host" in
146*-*-irix*)
147 # Find out which ABI we are using.
148 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
149 if AC_TRY_EVAL(ac_compile); then
150 case "`/usr/bin/file conftest.o`" in
151 *32-bit*)
152 LD="${LD-ld} -32"
fa1a1b32 153 ;;
641146fe
ILT
154 *N32*)
155 LD="${LD-ld} -n32"
156 ;;
157 *64-bit*)
158 LD="${LD-ld} -64"
fa1a1b32
ILT
159 ;;
160 esac
641146fe
ILT
161 fi
162 rm -rf conftest*
274e44ae
ILT
163 ;;
164
165*-*-sco3.2v5*)
166 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
167 CFLAGS="$CFLAGS -belf"
168 ;;
641146fe 169esac
274e44ae
ILT
170
171# Actually configure libtool. ac_aux_dir is where install-sh is found.
172CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
fa1a1b32 173LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
274e44ae
ILT
174${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
175$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
176|| AC_MSG_ERROR([libtool configure failed])
177])
178
179# AM_PROG_LD - find the path to the GNU or non-GNU linker
180AC_DEFUN(AM_PROG_LD,
181[AC_ARG_WITH(gnu-ld,
182[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
183test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
fa1a1b32
ILT
184AC_REQUIRE([AC_PROG_CC])
185ac_prog=ld
186if test "$ac_cv_prog_gcc" = yes; then
187 # Check if gcc -print-prog-name=ld gives a path.
188 AC_MSG_CHECKING([for ld used by GCC])
189 ac_prog=`($CC -print-prog-name=ld) 2>&5`
190 case "$ac_prog" in
191 # Accept absolute paths.
192 /*)
193 test -z "$LD" && LD="$ac_prog"
194 ;;
195 "")
196 # If it fails, then pretend we aren't using GCC.
197 ac_prog=ld
198 ;;
199 *)
200 # If it is relative, then search for the first ld in PATH.
201 with_gnu_ld=unknown
202 ;;
203 esac
204elif test "$with_gnu_ld" = yes; then
274e44ae
ILT
205 AC_MSG_CHECKING([for GNU ld])
206else
207 AC_MSG_CHECKING([for non-GNU ld])
208fi
209AC_CACHE_VAL(ac_cv_path_LD,
fa1a1b32 210[if test -z "$LD"; then
274e44ae
ILT
211 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
212 for ac_dir in $PATH; do
213 test -z "$ac_dir" && ac_dir=.
fa1a1b32
ILT
214 if test -f "$ac_dir/$ac_prog"; then
215 ac_cv_path_LD="$ac_dir/$ac_prog"
274e44ae
ILT
216 # Check to see if the program is GNU ld. I'd rather use --version,
217 # but apparently some GNU ld's only accept -v.
218 # Break only if it was the GNU/non-GNU ld that we prefer.
fa1a1b32
ILT
219 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
220 test "$with_gnu_ld" != no && break
274e44ae
ILT
221 else
222 test "$with_gnu_ld" != yes && break
223 fi
224 fi
225 done
226 IFS="$ac_save_ifs"
fa1a1b32 227else
42a62317 228 ac_cv_path_LD="$LD" # Let the user override the test with a path.
fa1a1b32 229fi])
274e44ae
ILT
230LD="$ac_cv_path_LD"
231if test -n "$LD"; then
232 AC_MSG_RESULT($LD)
233else
234 AC_MSG_RESULT(no)
235fi
236test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
237AC_SUBST(LD)
238AM_PROG_LD_GNU
239])
240
241AC_DEFUN(AM_PROG_LD_GNU,
fa1a1b32 242[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
274e44ae 243[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
fa1a1b32 244if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
274e44ae
ILT
245 ac_cv_prog_gnu_ld=yes
246else
247 ac_cv_prog_gnu_ld=no
248fi])
249])
250
fa1a1b32
ILT
251# AM_PROG_NM - find the path to a BSD-compatible name lister
252AC_DEFUN(AM_PROG_NM,
253[AC_MSG_CHECKING([for BSD-compatible nm])
254AC_CACHE_VAL(ac_cv_path_NM,
255[case "$NM" in
256/*)
257 ac_cv_path_NM="$NM" # Let the user override the test with a path.
258 ;;
259*)
260 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
261 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
262 test -z "$ac_dir" && dir=.
263 if test -f $ac_dir/nm; then
264 # Check to see if the nm accepts a BSD-compat flag.
265 # Adding the `sed 1!d' prevents false positives on HP-UX, which says:
266 # nm: unknown option "B" ignored
267 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
268 ac_cv_path_NM="$ac_dir/nm -B"
269 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
270 ac_cv_path_NM="$ac_dir/nm -p"
271 else
272 ac_cv_path_NM="$ac_dir/nm"
273 fi
274 break
275 fi
276 done
277 IFS="$ac_save_ifs"
278 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
279 ;;
280esac])
281NM="$ac_cv_path_NM"
282AC_MSG_RESULT([$NM])
283AC_SUBST(NM)
284])
285
274e44ae
ILT
286# Like AC_CONFIG_HEADER, but automatically create stamp file.
287
288AC_DEFUN(AM_CONFIG_HEADER,
289[AC_PREREQ([2.12])
290AC_CONFIG_HEADER([$1])
291dnl When config.status generates a header, we must update the stamp-h file.
292dnl This file resides in the same directory as the config header
293dnl that is generated. We must strip everything past the first ":",
294dnl and everything past the last "/".
295AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
296ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
297<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
298<<am_indx=1
299for am_file in <<$1>>; do
300 case " <<$>>CONFIG_HEADERS " in
301 *" <<$>>am_file "*<<)>>
302 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
303 ;;
304 esac
305 am_indx=`expr "<<$>>am_indx" + 1`
306done<<>>dnl>>)
307changequote([,]))])
308
2f1fec47
ILT
309# Add --enable-maintainer-mode option to configure.
310# From Jim Meyering
311
312# serial 1
313
314AC_DEFUN(AM_MAINTAINER_MODE,
315[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
316 dnl maintainer-mode is disabled by default
317 AC_ARG_ENABLE(maintainer-mode,
318[ --enable-maintainer-mode enable make rules and dependencies not useful
319 (and sometimes confusing) to the casual installer],
320 USE_MAINTAINER_MODE=$enableval,
321 USE_MAINTAINER_MODE=no)
322 AC_MSG_RESULT($USE_MAINTAINER_MODE)
323 if test $USE_MAINTAINER_MODE = yes; then
324 MAINT=
325 else
326 MAINT='#M#'
327 fi
328 AC_SUBST(MAINT)dnl
329]
330)
331
332# Check to see if we're running under Cygwin32, without using
274e44ae
ILT
333# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
334# Otherwise set it to "no".
2f1fec47
ILT
335
336dnl AM_CYGWIN32()
337AC_DEFUN(AM_CYGWIN32,
50fb7977 338[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
c3de2a19 339[AC_TRY_COMPILE(,[return __CYGWIN32__;],
274e44ae
ILT
340am_cv_cygwin32=yes, am_cv_cygwin32=no)
341rm -f conftest*])
342CYGWIN32=
343test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
344
345# Check to see if we're running under Win32, without using
346# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
347# Otherwise set it to "".
348
349dnl AM_EXEEXT()
350dnl This knows we add .exe if we're building in the Cygwin32
351dnl environment. But if we're not, then it compiles a test program
352dnl to see if there is a suffix for executables.
353AC_DEFUN(AM_EXEEXT,
354[AC_REQUIRE([AM_CYGWIN32])
c3de2a19 355AC_REQUIRE([AM_MINGW32])
274e44ae 356AC_MSG_CHECKING([for executable suffix])
c3de2a19
ILT
357AC_CACHE_VAL(am_cv_exeext,[
358if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
274e44ae 359am_cv_exeext=.exe
50fb7977 360else
274e44ae
ILT
361cat > am_c_test.c << 'EOF'
362int main() {
363/* Nothing needed here */
364}
365EOF
366${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
367am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
368rm -f am_c_test*])
369test x"${am_cv_exeext}" = x && am_cv_exeext=no
50fb7977 370fi
274e44ae
ILT
371EXEEXT=""
372test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
373AC_MSG_RESULT(${am_cv_exeext})
2f1fec47
ILT
374AC_SUBST(EXEEXT)])
375
c3de2a19
ILT
376# Check to see if we're running under Mingw, without using
377# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
378# Otherwise set it to "no".
379
380dnl AM_MINGW32()
381AC_DEFUN(AM_MINGW32,
382[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
383[AC_TRY_COMPILE(,[return __MINGW32__;],
384am_cv_mingw32=yes, am_cv_mingw32=no)
385rm -f conftest*])
386MINGW32=
387test "$am_cv_mingw32" = yes && MINGW32=yes])
388
This page took 0.058847 seconds and 4 git commands to generate.