Commit | Line | Data |
---|---|---|
c0734708 ILT |
1 | dnl aclocal.m4 generated automatically by aclocal 1.2 |
2 | ||
b1ee3d6a RS |
3 | dnl See whether we need to use fopen-bin.h rather than fopen-same.h. |
4 | AC_DEFUN(BFD_BINARY_FOPEN, | |
5 | [AC_REQUIRE([AC_CANONICAL_SYSTEM]) | |
6 | case "${host}" in | |
7 | changequote(,)dnl | |
8 | i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows) | |
9 | changequote([,])dnl | |
10 | AC_DEFINE(USE_BINARY_FOPEN) ;; | |
11 | esac])dnl | |
12 | ||
13 | dnl Get a default for CC_FOR_BUILD to put into Makefile. | |
14 | AC_DEFUN(BFD_CC_FOR_BUILD, | |
15 | [# Put a plausible default for CC_FOR_BUILD in Makefile. | |
16 | if test -z "$CC_FOR_BUILD"; then | |
17 | if test "x$cross_compiling" = "xno"; then | |
18 | CC_FOR_BUILD='$(CC)' | |
19 | else | |
20 | CC_FOR_BUILD=gcc | |
f515fb2f | 21 | fi |
f515fb2f | 22 | fi |
b1ee3d6a RS |
23 | AC_SUBST(CC_FOR_BUILD)])dnl |
24 | ||
25 | dnl See whether we need a declaration for a function. | |
26 | AC_DEFUN(BFD_NEED_DECLARATION, | |
27 | [AC_MSG_CHECKING([whether $1 must be declared]) | |
28 | AC_CACHE_VAL(bfd_cv_decl_needed_$1, | |
29 | [AC_TRY_COMPILE([ | |
30 | #include <stdio.h> | |
31 | #ifdef HAVE_STRING_H | |
32 | #include <string.h> | |
33 | #else | |
34 | #ifdef HAVE_STRINGS_H | |
35 | #include <strings.h> | |
36 | #endif | |
37 | #endif | |
38 | #ifdef HAVE_STDLIB_H | |
39 | #include <stdlib.h> | |
40 | #endif | |
41 | #ifdef HAVE_UNISTD_H | |
42 | #include <unistd.h> | |
43 | #endif], | |
44 | [char *(*pfn) = (char *(*)) $1], | |
45 | bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)]) | |
46 | AC_MSG_RESULT($bfd_cv_decl_needed_$1) | |
47 | if test $bfd_cv_decl_needed_$1 = yes; then | |
48 | bfd_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` | |
49 | AC_DEFINE_UNQUOTED($bfd_tr_decl) | |
50 | fi | |
f515fb2f | 51 | ])dnl |
b1ee3d6a | 52 | |
c0734708 ILT |
53 | # Do all the work for Automake. This macro actually does too much -- |
54 | # some checks are only needed if your package does certain things. | |
55 | # But this isn't really a big deal. | |
56 | ||
57 | # serial 1 | |
58 | ||
59 | dnl Usage: | |
60 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
61 | ||
62 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
63 | [AC_REQUIRE([AM_PROG_INSTALL]) | |
64 | PACKAGE=[$1] | |
65 | AC_SUBST(PACKAGE) | |
66 | VERSION=[$2] | |
67 | AC_SUBST(VERSION) | |
68 | dnl test to see if srcdir already configured | |
69 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
70 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) | |
71 | fi | |
72 | ifelse([$3],, | |
73 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") | |
74 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) | |
75 | AM_SANITY_CHECK | |
76 | AC_ARG_PROGRAM | |
77 | dnl FIXME This is truly gross. | |
78 | missing_dir=`cd $ac_aux_dir && pwd` | |
79 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
80 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
81 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
82 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
83 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
84 | AC_PROG_MAKE_SET]) | |
85 | ||
86 | ||
87 | # serial 1 | |
88 | ||
89 | AC_DEFUN(AM_PROG_INSTALL, | |
90 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
91 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
92 | AC_SUBST(INSTALL_SCRIPT)dnl | |
93 | ]) | |
94 | ||
95 | # | |
96 | # Check to make sure that the build environment is sane. | |
97 | # | |
98 | ||
99 | AC_DEFUN(AM_SANITY_CHECK, | |
100 | [AC_MSG_CHECKING([whether build environment is sane]) | |
101 | # Just in case | |
102 | sleep 1 | |
103 | echo timestamp > conftestfile | |
104 | # Do `set' in a subshell so we don't clobber the current shell's | |
105 | # arguments. Must try -L first in case configure is actually a | |
106 | # symlink; some systems play weird games with the mod time of symlinks | |
107 | # (eg FreeBSD returns the mod time of the symlink's containing | |
108 | # directory). | |
109 | if ( | |
110 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
111 | if test "$@" = "X"; then | |
112 | # -L didn't work. | |
113 | set X `ls -t $srcdir/configure conftestfile` | |
114 | fi | |
115 | test "[$]2" = conftestfile | |
116 | ) | |
117 | then | |
118 | # Ok. | |
119 | : | |
120 | else | |
121 | AC_MSG_ERROR([newly created file is older than distributed files! | |
122 | Check your system clock]) | |
123 | fi | |
124 | rm -f conftest* | |
125 | AC_MSG_RESULT(yes)]) | |
126 | ||
127 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) | |
128 | dnl The program must properly implement --version. | |
129 | AC_DEFUN(AM_MISSING_PROG, | |
130 | [AC_MSG_CHECKING(for working $2) | |
131 | # Run test in a subshell; some versions of sh will print an error if | |
132 | # an executable is not found, even if stderr is redirected. | |
133 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
134 | if ($2 --version) < /dev/null > /dev/null 2>&1; then | |
135 | $1=$2 | |
136 | AC_MSG_RESULT(found) | |
137 | else | |
138 | $1="$3/missing $2" | |
139 | AC_MSG_RESULT(missing) | |
140 | fi | |
141 | AC_SUBST($1)]) | |
142 | ||
143 | # Like AC_CONFIG_HEADER, but automatically create stamp file. | |
144 | ||
145 | AC_DEFUN(AM_CONFIG_HEADER, | |
146 | [AC_PREREQ([2.12]) | |
147 | AC_CONFIG_HEADER([$1]) | |
148 | dnl When config.status generates a header, we must update the stamp-h file. | |
149 | dnl This file resides in the same directory as the config header | |
150 | dnl that is generated. We must strip everything past the first ":", | |
151 | dnl and everything past the last "/". | |
152 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl | |
153 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, | |
154 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, | |
155 | <<am_indx=1 | |
156 | for am_file in <<$1>>; do | |
157 | case " <<$>>CONFIG_HEADERS " in | |
158 | *" <<$>>am_file "*<<)>> | |
159 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx | |
160 | ;; | |
161 | esac | |
162 | am_indx=`expr "<<$>>am_indx" + 1` | |
163 | done<<>>dnl>>) | |
164 | changequote([,]))]) | |
165 | ||
166 | # Add --enable-maintainer-mode option to configure. | |
167 | # From Jim Meyering | |
168 | ||
169 | # serial 1 | |
170 | ||
171 | AC_DEFUN(AM_MAINTAINER_MODE, | |
172 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) | |
173 | dnl maintainer-mode is disabled by default | |
174 | AC_ARG_ENABLE(maintainer-mode, | |
175 | [ --enable-maintainer-mode enable make rules and dependencies not useful | |
176 | (and sometimes confusing) to the casual installer], | |
177 | USE_MAINTAINER_MODE=$enableval, | |
178 | USE_MAINTAINER_MODE=no) | |
179 | AC_MSG_RESULT($USE_MAINTAINER_MODE) | |
180 | if test $USE_MAINTAINER_MODE = yes; then | |
181 | MAINT= | |
182 | else | |
183 | MAINT='#M#' | |
184 | fi | |
185 | AC_SUBST(MAINT)dnl | |
186 | ] | |
187 | ) | |
b1ee3d6a RS |
188 | |
189 | # Check to see if we're running under Cygwin32, without using | |
190 | # AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes". | |
191 | # Otherwise set it to "no". | |
192 | ||
c0734708 ILT |
193 | dnl AM_CYGWIN32() |
194 | dnl You might think we can do this by checking for a cygwin32-specific | |
195 | dnl cpp define. | |
196 | AC_DEFUN(AM_CYGWIN32, | |
b1ee3d6a RS |
197 | [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32, |
198 | [AC_TRY_COMPILE(,[int main () { return __CYGWIN32__; }], | |
199 | am_cv_cygwin32=yes, am_cv_cygwin32=no) | |
200 | rm -f conftest*]) | |
201 | CYGWIN32= | |
202 | test "$am_cv_cygwin32" = yes && CYGWIN32=yes]) | |
c0734708 | 203 | |
b1ee3d6a RS |
204 | # Check to see if we're running under Win32, without using |
205 | # AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe". | |
206 | # Otherwise set it to "". | |
207 | ||
c0734708 | 208 | dnl AM_EXEEXT() |
b1ee3d6a RS |
209 | dnl This knows we add .exe if we're building in the Cygwin32 |
210 | dnl environment. But if we're not, then it compiles a test program | |
211 | dnl to see if there is a suffix for executables. | |
c0734708 ILT |
212 | AC_DEFUN(AM_EXEEXT, |
213 | dnl AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AM_CYGWIN32]) | |
b1ee3d6a RS |
214 | AC_MSG_CHECKING([for executable suffix]) |
215 | [AC_CACHE_VAL(am_cv_exeext, | |
216 | [if test "$CYGWIN32" = yes; then | |
217 | am_cv_exeext=.exe | |
218 | else | |
219 | cat > am_c_test.c << 'EOF' | |
220 | int main() { | |
221 | /* Nothing needed here */ | |
222 | } | |
223 | EOF | |
224 | ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5 | |
225 | am_cv_exeext=`ls am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//` | |
226 | rm -f am_c_test*]) | |
227 | test x"${am_cv_exeext}" = x && am_cv_exeext=no | |
228 | fi | |
229 | EXEEXT="" | |
230 | test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext} | |
231 | AC_MSG_RESULT(${am_cv_exeext}) | |
232 | AC_SUBST(EXEEXT)]) | |
c0734708 | 233 |