xref: /openbsd/gnu/usr.bin/binutils/ld/aclocal.m4 (revision c074d1c9)
1*c074d1c9Sdrahndnl aclocal.m4 generated automatically by aclocal 1.4-p5
2f7cc78ecSespie
3*c074d1c9Sdrahndnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4f7cc78ecSespiednl This file is free software; the Free Software Foundation
5f7cc78ecSespiednl gives unlimited permission to copy and/or distribute it,
6f7cc78ecSespiednl with or without modifications, as long as this notice is preserved.
7f7cc78ecSespie
8f7cc78ecSespiednl This program is distributed in the hope that it will be useful,
9f7cc78ecSespiednl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10f7cc78ecSespiednl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11f7cc78ecSespiednl PARTICULAR PURPOSE.
12f7cc78ecSespie
13f7cc78ecSespiesinclude(../bfd/acinclude.m4)
14f7cc78ecSespie
15b55d4692Sfgschdnl sinclude(../libtool.m4) already included in bfd/acinclude.m4
16b55d4692Sfgschdnl The lines below arrange for aclocal not to bring libtool.m4
17b55d4692Sfgschdnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
18b55d4692Sfgschdnl to add a definition of LIBTOOL to Makefile.in.
19b55d4692Sfgschifelse(yes,no,[
20b55d4692SfgschAC_DEFUN([AM_PROG_LIBTOOL],)
21b55d4692SfgschAC_SUBST(LIBTOOL)
22b55d4692Sfgsch])
23b55d4692Sfgsch
24b55d4692Sfgschdnl sinclude(../gettext.m4) already included in bfd/acinclude.m4
25b55d4692Sfgschifelse(yes,no,[
26b55d4692SfgschAC_DEFUN([CY_WITH_NLS],)
27b55d4692SfgschAC_SUBST(INTLLIBS)
28b55d4692Sfgsch])
29b55d4692Sfgsch
30*c074d1c9Sdrahn#serial 1
31*c074d1c9Sdrahn# This test replaces the one in autoconf.
32*c074d1c9Sdrahn# Currently this macro should have the same name as the autoconf macro
33*c074d1c9Sdrahn# because gettext's gettext.m4 (distributed in the automake package)
34*c074d1c9Sdrahn# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
35*c074d1c9Sdrahn# give these diagnostics:
36*c074d1c9Sdrahn#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
37*c074d1c9Sdrahn#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
38*c074d1c9Sdrahn
39*c074d1c9Sdrahnundefine([AC_ISC_POSIX])
40*c074d1c9Sdrahn
41*c074d1c9SdrahnAC_DEFUN([AC_ISC_POSIX],
42*c074d1c9Sdrahn  [
43*c074d1c9Sdrahn    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
44*c074d1c9Sdrahn    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
45*c074d1c9Sdrahn  ]
46*c074d1c9Sdrahn)
47*c074d1c9Sdrahn
48f7cc78ecSespie# Do all the work for Automake.  This macro actually does too much --
49f7cc78ecSespie# some checks are only needed if your package does certain things.
50f7cc78ecSespie# But this isn't really a big deal.
51f7cc78ecSespie
52f7cc78ecSespie# serial 1
53f7cc78ecSespie
54f7cc78ecSespiednl Usage:
55f7cc78ecSespiednl AM_INIT_AUTOMAKE(package,version, [no-define])
56f7cc78ecSespie
57*c074d1c9SdrahnAC_DEFUN([AM_INIT_AUTOMAKE],
58f7cc78ecSespie[AC_REQUIRE([AC_PROG_INSTALL])
59f7cc78ecSespiePACKAGE=[$1]
60f7cc78ecSespieAC_SUBST(PACKAGE)
61f7cc78ecSespieVERSION=[$2]
62f7cc78ecSespieAC_SUBST(VERSION)
63f7cc78ecSespiednl test to see if srcdir already configured
64f7cc78ecSespieif test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
65f7cc78ecSespie  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
66f7cc78ecSespiefi
67f7cc78ecSespieifelse([$3],,
68f7cc78ecSespieAC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
69f7cc78ecSespieAC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
70f7cc78ecSespieAC_REQUIRE([AM_SANITY_CHECK])
71f7cc78ecSespieAC_REQUIRE([AC_ARG_PROGRAM])
72f7cc78ecSespiednl FIXME This is truly gross.
73f7cc78ecSespiemissing_dir=`cd $ac_aux_dir && pwd`
74f7cc78ecSespieAM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
75f7cc78ecSespieAM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
76f7cc78ecSespieAM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
77f7cc78ecSespieAM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
78f7cc78ecSespieAM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
79f7cc78ecSespieAC_REQUIRE([AC_PROG_MAKE_SET])])
80f7cc78ecSespie
81f7cc78ecSespie#
82f7cc78ecSespie# Check to make sure that the build environment is sane.
83f7cc78ecSespie#
84f7cc78ecSespie
85*c074d1c9SdrahnAC_DEFUN([AM_SANITY_CHECK],
86f7cc78ecSespie[AC_MSG_CHECKING([whether build environment is sane])
87f7cc78ecSespie# Just in case
88f7cc78ecSespiesleep 1
89f7cc78ecSespieecho timestamp > conftestfile
90f7cc78ecSespie# Do `set' in a subshell so we don't clobber the current shell's
91f7cc78ecSespie# arguments.  Must try -L first in case configure is actually a
92f7cc78ecSespie# symlink; some systems play weird games with the mod time of symlinks
93f7cc78ecSespie# (eg FreeBSD returns the mod time of the symlink's containing
94f7cc78ecSespie# directory).
95f7cc78ecSespieif (
96f7cc78ecSespie   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
97f7cc78ecSespie   if test "[$]*" = "X"; then
98f7cc78ecSespie      # -L didn't work.
99f7cc78ecSespie      set X `ls -t $srcdir/configure conftestfile`
100f7cc78ecSespie   fi
101f7cc78ecSespie   if test "[$]*" != "X $srcdir/configure conftestfile" \
102f7cc78ecSespie      && test "[$]*" != "X conftestfile $srcdir/configure"; then
103f7cc78ecSespie
104f7cc78ecSespie      # If neither matched, then we have a broken ls.  This can happen
105f7cc78ecSespie      # if, for instance, CONFIG_SHELL is bash and it inherits a
106f7cc78ecSespie      # broken ls alias from the environment.  This has actually
107f7cc78ecSespie      # happened.  Such a system could not be considered "sane".
108f7cc78ecSespie      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
109f7cc78ecSespiealias in your environment])
110f7cc78ecSespie   fi
111f7cc78ecSespie
112f7cc78ecSespie   test "[$]2" = conftestfile
113f7cc78ecSespie   )
114f7cc78ecSespiethen
115f7cc78ecSespie   # Ok.
116f7cc78ecSespie   :
117f7cc78ecSespieelse
118f7cc78ecSespie   AC_MSG_ERROR([newly created file is older than distributed files!
119f7cc78ecSespieCheck your system clock])
120f7cc78ecSespiefi
121f7cc78ecSespierm -f conftest*
122f7cc78ecSespieAC_MSG_RESULT(yes)])
123f7cc78ecSespie
124f7cc78ecSespiednl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
125f7cc78ecSespiednl The program must properly implement --version.
126*c074d1c9SdrahnAC_DEFUN([AM_MISSING_PROG],
127f7cc78ecSespie[AC_MSG_CHECKING(for working $2)
128f7cc78ecSespie# Run test in a subshell; some versions of sh will print an error if
129f7cc78ecSespie# an executable is not found, even if stderr is redirected.
130f7cc78ecSespie# Redirect stdin to placate older versions of autoconf.  Sigh.
131f7cc78ecSespieif ($2 --version) < /dev/null > /dev/null 2>&1; then
132f7cc78ecSespie   $1=$2
133f7cc78ecSespie   AC_MSG_RESULT(found)
134f7cc78ecSespieelse
135f7cc78ecSespie   $1="$3/missing $2"
136f7cc78ecSespie   AC_MSG_RESULT(missing)
137f7cc78ecSespiefi
138f7cc78ecSespieAC_SUBST($1)])
139f7cc78ecSespie
140f7cc78ecSespie# Like AC_CONFIG_HEADER, but automatically create stamp file.
141f7cc78ecSespie
142*c074d1c9SdrahnAC_DEFUN([AM_CONFIG_HEADER],
143f7cc78ecSespie[AC_PREREQ([2.12])
144f7cc78ecSespieAC_CONFIG_HEADER([$1])
145f7cc78ecSespiednl When config.status generates a header, we must update the stamp-h file.
146f7cc78ecSespiednl This file resides in the same directory as the config header
147f7cc78ecSespiednl that is generated.  We must strip everything past the first ":",
148f7cc78ecSespiednl and everything past the last "/".
149f7cc78ecSespieAC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
150f7cc78ecSespieifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
151f7cc78ecSespie<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
152f7cc78ecSespie<<am_indx=1
153f7cc78ecSespiefor am_file in <<$1>>; do
154f7cc78ecSespie  case " <<$>>CONFIG_HEADERS " in
155f7cc78ecSespie  *" <<$>>am_file "*<<)>>
156f7cc78ecSespie    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
157f7cc78ecSespie    ;;
158f7cc78ecSespie  esac
159f7cc78ecSespie  am_indx=`expr "<<$>>am_indx" + 1`
160f7cc78ecSespiedone<<>>dnl>>)
161f7cc78ecSespiechangequote([,]))])
162f7cc78ecSespie
163f7cc78ecSespie
164f7cc78ecSespiednl AM_PROG_LEX
165f7cc78ecSespiednl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
166*c074d1c9SdrahnAC_DEFUN([AM_PROG_LEX],
167f7cc78ecSespie[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
168f7cc78ecSespieAC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
169f7cc78ecSespieAC_PROG_LEX
170f7cc78ecSespieAC_DECL_YYTEXT])
171f7cc78ecSespie
172f7cc78ecSespie# Add --enable-maintainer-mode option to configure.
173f7cc78ecSespie# From Jim Meyering
174f7cc78ecSespie
175f7cc78ecSespie# serial 1
176f7cc78ecSespie
177*c074d1c9SdrahnAC_DEFUN([AM_MAINTAINER_MODE],
178f7cc78ecSespie[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
179f7cc78ecSespie  dnl maintainer-mode is disabled by default
180f7cc78ecSespie  AC_ARG_ENABLE(maintainer-mode,
181f7cc78ecSespie[  --enable-maintainer-mode enable make rules and dependencies not useful
182f7cc78ecSespie                          (and sometimes confusing) to the casual installer],
183f7cc78ecSespie      USE_MAINTAINER_MODE=$enableval,
184f7cc78ecSespie      USE_MAINTAINER_MODE=no)
185f7cc78ecSespie  AC_MSG_RESULT($USE_MAINTAINER_MODE)
186f7cc78ecSespie  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
187f7cc78ecSespie  MAINT=$MAINTAINER_MODE_TRUE
188f7cc78ecSespie  AC_SUBST(MAINT)dnl
189f7cc78ecSespie]
190f7cc78ecSespie)
191f7cc78ecSespie
192f7cc78ecSespie# Define a conditional.
193f7cc78ecSespie
194*c074d1c9SdrahnAC_DEFUN([AM_CONDITIONAL],
195f7cc78ecSespie[AC_SUBST($1_TRUE)
196f7cc78ecSespieAC_SUBST($1_FALSE)
197f7cc78ecSespieif $2; then
198f7cc78ecSespie  $1_TRUE=
199f7cc78ecSespie  $1_FALSE='#'
200f7cc78ecSespieelse
201f7cc78ecSespie  $1_TRUE='#'
202f7cc78ecSespie  $1_FALSE=
203f7cc78ecSespiefi])
204f7cc78ecSespie
205