Commit | Line | Data |
---|---|---|
1dc9c5b0 | 1 | dnl aclocal.m4 generated automatically by aclocal 1.1n |
733943b9 | 2 | |
2420229d JB |
3 | dnl On the NeXT, #including <utime.h> doesn't give you a definition for |
4 | dnl struct utime, unless you #define _POSIX_SOURCE. | |
5 | ||
6 | AC_DEFUN(GUILE_STRUCT_UTIMBUF, [ | |
e7247600 JB |
7 | AC_CACHE_CHECK([whether we need POSIX to get struct utimbuf], |
8 | guile_cv_struct_utimbuf_needs_posix, | |
2420229d JB |
9 | [AC_TRY_CPP([ |
10 | #ifdef __EMX__ | |
11 | #include <sys/utime.h> | |
12 | #else | |
13 | #include <utime.h> | |
14 | #endif | |
15 | struct utime blah; | |
16 | ], | |
17 | guile_cv_struct_utimbuf_needs_posix=no, | |
e7247600 JB |
18 | guile_cv_struct_utimbuf_needs_posix=yes)]) |
19 | if test "$guile_cv_struct_utimbuf_needs_posix" = yes; then | |
20 | AC_DEFINE(UTIMBUF_NEEDS_POSIX) | |
21 | fi]) | |
3594582b JB |
22 | |
23 | ||
24 | ||
25 | ||
26 | dnl | |
27 | dnl Apparently, at CMU they have a weird version of libc.h that is | |
28 | dnl installed in /usr/local/include and conflicts with unistd.h. | |
29 | dnl In these situations, we should not #include libc.h. | |
30 | dnl This test arranges to #define LIBC_H_WITH_UNISTD_H iff libc.h is | |
31 | dnl present on the system, and is safe to #include. | |
32 | dnl | |
33 | AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD], | |
34 | [ | |
35 | AC_CHECK_HEADERS(libc.h unistd.h) | |
36 | AC_CACHE_CHECK( | |
37 | "whether libc.h and unistd.h can be included together", | |
38 | guile_cv_header_libc_with_unistd, | |
39 | [ | |
40 | if test "$ac_cv_header_libc_h" = "no"; then | |
41 | guile_cv_header_libc_with_unistd="no" | |
42 | elif test "$ac_cv_header_unistd.h" = "no"; then | |
43 | guile_cv_header_libc_with_unistd="yes" | |
44 | else | |
45 | AC_TRY_COMPILE( | |
46 | [ | |
47 | # include <libc.h> | |
48 | # include <unistd.h> | |
49 | ], | |
50 | [], | |
51 | [guile_cv_header_libc_with_unistd=yes], | |
52 | [guile_cv_header_libc_with_unistd=no] | |
53 | ) | |
54 | fi | |
55 | ] | |
56 | ) | |
57 | if test "$guile_cv_header_libc_with_unistd" = yes; then | |
58 | AC_DEFINE(LIBC_H_WITH_UNISTD_H) | |
59 | fi | |
60 | ] | |
61 | ) | |
733943b9 TT |
62 | |
63 | # Like AC_CONFIG_HEADER, but automatically create stamp file. | |
64 | ||
65 | AC_DEFUN(AM_CONFIG_HEADER, | |
66 | [AC_PREREQ([2.12]) | |
67 | AC_CONFIG_HEADER([$1]) | |
68 | dnl When config.status generates a header, we must update the stamp-h file. | |
69 | dnl This file resides in the same directory as the config header | |
70 | dnl that is generated. We must strip everything past the first ":", | |
71 | dnl and everything past the last "/". | |
72 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl | |
1dc9c5b0 | 73 | test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl |
733943b9 TT |
74 | changequote([,]))]) |
75 | ||
76 | ||
77 | dnl Usage: AM_INIT_GUILE_MODULE(module-name) | |
78 | dnl This macro will automatically get the guile version from the | |
79 | dnl top-level srcdir, and will initialize automake. It also | |
80 | dnl defines the `module' variable. | |
81 | AC_DEFUN([AM_INIT_GUILE_MODULE],[ | |
82 | . $srcdir/../GUILE-VERSION | |
0705ea15 | 83 | AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define) |
1dc9c5b0 JB |
84 | AC_CONFIG_AUX_DIR(..) |
85 | module=[$1] | |
86 | AC_SUBST(module)]) | |
87 | ||
88 | # Do all the work for Automake. This macro actually does too much -- | |
89 | # some checks are only needed if your package does certain things. | |
90 | # But this isn't really a big deal. | |
91 | ||
92 | # serial 1 | |
93 | ||
94 | dnl Usage: | |
95 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
96 | ||
97 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
98 | [AC_REQUIRE([AM_PROG_INSTALL]) | |
99 | PACKAGE=[$1] | |
733943b9 | 100 | AC_SUBST(PACKAGE) |
1dc9c5b0 | 101 | VERSION=[$2] |
733943b9 | 102 | AC_SUBST(VERSION) |
1dc9c5b0 JB |
103 | ifelse([$3],, |
104 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") | |
105 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) | |
733943b9 TT |
106 | AM_SANITY_CHECK |
107 | AC_ARG_PROGRAM | |
1dc9c5b0 JB |
108 | dnl FIXME This is truly gross. |
109 | missing_dir=`cd $ac_aux_dir && pwd` | |
110 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
111 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
112 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
113 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
114 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
115 | AC_PROG_MAKE_SET]) | |
733943b9 TT |
116 | |
117 | ||
118 | # serial 1 | |
119 | ||
120 | AC_DEFUN(AM_PROG_INSTALL, | |
121 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
122 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
123 | AC_SUBST(INSTALL_SCRIPT)dnl | |
124 | ]) | |
125 | ||
126 | # | |
127 | # Check to make sure that the build environment is sane. | |
128 | # | |
129 | ||
130 | AC_DEFUN(AM_SANITY_CHECK, | |
131 | [AC_MSG_CHECKING([whether build environment is sane]) | |
1dc9c5b0 JB |
132 | # Just in case |
133 | sleep 1 | |
733943b9 | 134 | echo timestamp > conftestfile |
1dc9c5b0 JB |
135 | # Do `set' in a subshell so we don't clobber the current shell's |
136 | # arguments. Must try -L first in case configure is actually a | |
137 | # symlink; some systems play weird games with the mod time of symlinks | |
138 | # (eg FreeBSD returns the mod time of the symlink's containing | |
139 | # directory). | |
140 | if ( | |
141 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
142 | if test "$@" = "X"; then | |
143 | # -L didn't work. | |
144 | set X `ls -t $srcdir/configure conftestfile` | |
145 | fi | |
146 | test "[$]2" = conftestfile | |
147 | ) | |
733943b9 TT |
148 | then |
149 | # Ok. | |
150 | : | |
151 | else | |
152 | AC_MSG_ERROR([newly created file is older than distributed files! | |
153 | Check your system clock]) | |
154 | fi | |
155 | rm -f conftest* | |
156 | AC_MSG_RESULT(yes)]) | |
157 | ||
1dc9c5b0 JB |
158 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) |
159 | dnl The program must properly implement --version. | |
160 | AC_DEFUN(AM_MISSING_PROG, | |
161 | [AC_MSG_CHECKING(for working $2) | |
162 | # Run test in a subshell; some versions of sh will print an error if | |
163 | # an executable is not found, even if stderr is redirected. | |
164 | if ($2 --version) > /dev/null 2>&1; then | |
165 | $1=$2 | |
166 | AC_MSG_RESULT(found) | |
167 | else | |
168 | $1="$3/missing $2" | |
169 | AC_MSG_RESULT(missing) | |
170 | fi | |
171 | AC_SUBST($1)]) | |
172 | ||
15ae1bee MD |
173 | # Add --enable-maintainer-mode option to configure. |
174 | # From Jim Meyering | |
175 | ||
176 | # serial 1 | |
177 | ||
178 | AC_DEFUN(AM_MAINTAINER_MODE, | |
179 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) | |
180 | dnl maintainer-mode is disabled by default | |
181 | AC_ARG_ENABLE(maintainer-mode, | |
182 | [ --enable-maintainer-mode enable make rules and dependencies not useful | |
183 | (and sometimes confusing) to the casual installer], | |
184 | USE_MAINTAINER_MODE=$enableval, | |
185 | USE_MAINTAINER_MODE=no) | |
186 | AC_MSG_RESULT($USE_MAINTAINER_MODE) | |
187 | if test $USE_MAINTAINER_MODE = yes; then | |
188 | MAINT= | |
189 | else | |
190 | MAINT='#M#' | |
191 | fi | |
192 | AC_SUBST(MAINT)dnl | |
193 | ] | |
194 | ) | |
195 | ||
1dc9c5b0 JB |
196 | |
197 | # serial 4 AM_PROG_LIBTOOL | |
1bb9f4db MV |
198 | AC_DEFUN(AM_PROG_LIBTOOL, |
199 | [AC_REQUIRE([AC_CANONICAL_HOST]) | |
200 | AC_REQUIRE([AC_PROG_CC]) | |
201 | AC_REQUIRE([AC_PROG_RANLIB]) | |
202 | ||
203 | # Always use our own libtool. | |
204 | LIBTOOL='$(top_builddir)/libtool' | |
205 | AC_SUBST(LIBTOOL) | |
206 | ||
207 | dnl Allow the --disable-shared flag to stop us from building shared libs. | |
208 | AC_ARG_ENABLE(shared, | |
209 | [ --enable-shared build shared libraries [default=yes]], | |
210 | test "$enableval" = no && libtool_shared=" --disable-shared", | |
211 | libtool_shared=) | |
212 | ||
213 | libtool_flags="$libtool_shared" | |
214 | test "$silent" = yes && libtool_flags="$libtool_flags --silent" | |
215 | test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" | |
216 | ||
1dc9c5b0 JB |
217 | [case "$host" in |
218 | *-*-irix6*) | |
219 | # For IRIX 6, ld needs -n32 if cc uses it. | |
220 | if echo " $CC $CFLAGS " | egrep -e '[ ]-n32[ ]' > /dev/null; then | |
221 | LD="${LD-ld} -n32" | |
222 | fi | |
223 | ;; | |
224 | ||
225 | *-*-sco3.2v5*) | |
226 | # On SCO OpenServer 5, we need -belf to get full-featured binaries. | |
227 | CFLAGS="$CFLAGS -belf" | |
228 | ;; | |
229 | esac] | |
230 | ||
1bb9f4db MV |
231 | # Actually configure libtool. ac_aux_dir is where install-sh is found. |
232 | CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LD="$LD" RANLIB="$RANLIB" \ | |
1dc9c5b0 JB |
233 | ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ |
234 | $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ | |
1bb9f4db MV |
235 | || AC_MSG_ERROR([libtool configure failed]) |
236 | ]) | |
237 | ||
733943b9 TT |
238 | dnl |
239 | dnl CY_AC_WITH_THREADS determines which thread library the user intends | |
240 | dnl to put underneath guile. Pass it the path to find the guile top-level | |
241 | dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix. | |
242 | dnl | |
243 | ||
244 | AC_DEFUN([CY_AC_WITH_THREADS],[ | |
245 | AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[ | |
246 | AC_CACHE_VAL(cy_cv_threads_cflags,[ | |
247 | AC_CACHE_VAL(cy_cv_threads_libs,[ | |
248 | use_threads=no; | |
249 | AC_ARG_WITH(threads,[ --with-threads thread interface], | |
250 | use_threads=$withval, use_threads=no) | |
251 | test -n "$use_threads" || use_threads=qt | |
252 | threads_package=unknown | |
253 | if test "$use_threads" != no; then | |
254 | dnl | |
255 | dnl Test for the qt threads package - used for cooperative threads | |
256 | dnl This may not necessarily be built yet - so just check for the | |
257 | dnl header files. | |
258 | dnl | |
259 | if test "$use_threads" = yes || test "$use_threads" = qt; then | |
260 | # Look for qt in source directory. This is a hack: we look in | |
261 | # "./qt" because this check might be run at the top level. | |
262 | if test -f $srcdir/../qt/qt.c || test -f $srcdir/qt/qt.c; then | |
263 | threads_package=COOP | |
264 | cy_cv_threads_cflags="-I$srcdir/../qt -I../qt" | |
265 | cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a" | |
266 | fi | |
267 | else | |
268 | if test -f $use_threads/qt.c; then | |
269 | # FIXME seems as though we should try to use an installed qt here. | |
270 | threads_package=COOP | |
271 | cy_cv_threads_cflags="-I$use_threads -I../qt" | |
272 | cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a" | |
273 | fi | |
274 | fi | |
275 | if test "$use_threads" = pthreads; then | |
276 | # Look for pthreads in srcdir. See above to understand why | |
277 | # we always set threads_package. | |
278 | if test -f $srcdir/../../pthreads/pthreads/queue.c \ | |
279 | || test -f $srcdir/../pthreads/pthreads/queue.c; then | |
280 | threads_package=MIT | |
281 | cy_cv_threads_cflags="-I$srcdir/../../pthreads/include" | |
282 | cy_cv_threads_libs="-L../../pthreads/lib -lpthread" | |
283 | fi | |
284 | fi | |
285 | saved_CPP="$CPPFLAGS" | |
286 | saved_LD="$LDFLAGS" | |
287 | saved_LIBS="$LIBS" | |
288 | if test "$threads_package" = unknown; then | |
289 | dnl | |
290 | dnl Test for the FSU threads package | |
291 | dnl | |
292 | CPPFLAGS="-I$use_threads/include" | |
293 | LDFLAGS="-L$use_threads/lib" | |
294 | LIBS="-lgthreads -lmalloc" | |
295 | AC_TRY_LINK([#include <pthread.h>],[ | |
296 | pthread_equal(NULL,NULL); | |
297 | ], threads_package=FSU) | |
298 | fi | |
299 | if test "$threads_package" = unknown; then | |
300 | dnl | |
301 | dnl Test for the MIT threads package | |
302 | dnl | |
303 | LIBS="-lpthread" | |
304 | AC_TRY_LINK([#include <pthread.h>],[ | |
305 | pthread_equal(NULL,NULL); | |
306 | ], threads_package=MIT) | |
307 | fi | |
308 | if test "$threads_package" = unknown; then | |
309 | dnl | |
310 | dnl Test for the PCthreads package | |
311 | dnl | |
312 | LIBS="-lpthreads" | |
313 | AC_TRY_LINK([#include <pthread.h>],[ | |
314 | pthread_equal(NULL,NULL); | |
315 | ], threads_package=PCthreads) | |
316 | fi | |
317 | dnl | |
318 | dnl Set the appropriate flags! | |
319 | dnl | |
320 | cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags" | |
321 | cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs" | |
322 | cy_cv_threads_package=$threads_package | |
323 | CPPFLAGS="$saved_CPP" | |
324 | LDFLAGS="$saved_LD" | |
325 | LIBS="$saved_LIBS" | |
326 | if test "$threads_package" = unknown; then | |
327 | AC_MSG_ERROR("cannot find thread library installation") | |
328 | fi | |
329 | fi | |
330 | ]) | |
331 | ]) | |
332 | ], | |
333 | dnl | |
334 | dnl Set flags according to what is cached. | |
335 | dnl | |
336 | CPPFLAGS="$cy_cv_threads_cflags" | |
337 | LIBS="$cy_cv_threads_libs" | |
338 | ) | |
339 | ]) | |
340 |