Commit | Line | Data |
---|---|---|
f9d81b6b | 1 | dnl aclocal.m4 generated automatically by aclocal 1.1l |
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 | |
73 | test -z "<<$>>CONFIG_HEADER" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl | |
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 | |
83 | AM_INIT_AUTOMAKE($PACKAGE, $VERSION) | |
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) | |
96 | ||
97 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
98 | [AC_REQUIRE([AM_PROG_INSTALL]) | |
99 | PACKAGE=[$1] | |
100 | AC_SUBST(PACKAGE) | |
101 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") | |
102 | VERSION=[$2] | |
103 | AC_SUBST(VERSION) | |
104 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") | |
105 | AM_SANITY_CHECK | |
106 | AC_ARG_PROGRAM | |
107 | AC_PROG_MAKE_SET]) | |
108 | ||
109 | ||
110 | # serial 1 | |
111 | ||
112 | AC_DEFUN(AM_PROG_INSTALL, | |
113 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
114 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
115 | AC_SUBST(INSTALL_SCRIPT)dnl | |
116 | ]) | |
117 | ||
118 | # | |
119 | # Check to make sure that the build environment is sane. | |
120 | # | |
121 | ||
122 | AC_DEFUN(AM_SANITY_CHECK, | |
123 | [AC_MSG_CHECKING([whether build environment is sane]) | |
124 | echo timestamp > conftestfile | |
125 | # Do this in a subshell so we don't clobber the current shell's | |
126 | # arguments. FIXME: maybe try `-L' hack like GETLOADAVG test? | |
127 | if (set X `ls -t $srcdir/configure conftestfile`; test "[$]2" = conftestfile) | |
128 | then | |
129 | # Ok. | |
130 | : | |
131 | else | |
132 | AC_MSG_ERROR([newly created file is older than distributed files! | |
133 | Check your system clock]) | |
134 | fi | |
135 | rm -f conftest* | |
136 | AC_MSG_RESULT(yes)]) | |
137 | ||
1bb9f4db MV |
138 | # serial 1 AM_PROG_LIBTOOL |
139 | AC_DEFUN(AM_PROG_LIBTOOL, | |
140 | [AC_REQUIRE([AC_CANONICAL_HOST]) | |
141 | AC_REQUIRE([AC_PROG_CC]) | |
142 | AC_REQUIRE([AC_PROG_RANLIB]) | |
143 | ||
144 | # Always use our own libtool. | |
145 | LIBTOOL='$(top_builddir)/libtool' | |
146 | AC_SUBST(LIBTOOL) | |
147 | ||
148 | dnl Allow the --disable-shared flag to stop us from building shared libs. | |
149 | AC_ARG_ENABLE(shared, | |
150 | [ --enable-shared build shared libraries [default=yes]], | |
151 | test "$enableval" = no && libtool_shared=" --disable-shared", | |
152 | libtool_shared=) | |
153 | ||
154 | libtool_flags="$libtool_shared" | |
155 | test "$silent" = yes && libtool_flags="$libtool_flags --silent" | |
156 | test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" | |
157 | ||
158 | # Actually configure libtool. ac_aux_dir is where install-sh is found. | |
159 | CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LD="$LD" RANLIB="$RANLIB" \ | |
160 | $ac_aux_dir/ltconfig $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ | |
161 | || AC_MSG_ERROR([libtool configure failed]) | |
162 | ]) | |
163 | ||
733943b9 TT |
164 | dnl |
165 | dnl CY_AC_WITH_THREADS determines which thread library the user intends | |
166 | dnl to put underneath guile. Pass it the path to find the guile top-level | |
167 | dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix. | |
168 | dnl | |
169 | ||
170 | AC_DEFUN([CY_AC_WITH_THREADS],[ | |
171 | AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[ | |
172 | AC_CACHE_VAL(cy_cv_threads_cflags,[ | |
173 | AC_CACHE_VAL(cy_cv_threads_libs,[ | |
174 | use_threads=no; | |
175 | AC_ARG_WITH(threads,[ --with-threads thread interface], | |
176 | use_threads=$withval, use_threads=no) | |
177 | test -n "$use_threads" || use_threads=qt | |
178 | threads_package=unknown | |
179 | if test "$use_threads" != no; then | |
180 | dnl | |
181 | dnl Test for the qt threads package - used for cooperative threads | |
182 | dnl This may not necessarily be built yet - so just check for the | |
183 | dnl header files. | |
184 | dnl | |
185 | if test "$use_threads" = yes || test "$use_threads" = qt; then | |
186 | # Look for qt in source directory. This is a hack: we look in | |
187 | # "./qt" because this check might be run at the top level. | |
188 | if test -f $srcdir/../qt/qt.c || test -f $srcdir/qt/qt.c; then | |
189 | threads_package=COOP | |
190 | cy_cv_threads_cflags="-I$srcdir/../qt -I../qt" | |
191 | cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a" | |
192 | fi | |
193 | else | |
194 | if test -f $use_threads/qt.c; then | |
195 | # FIXME seems as though we should try to use an installed qt here. | |
196 | threads_package=COOP | |
197 | cy_cv_threads_cflags="-I$use_threads -I../qt" | |
198 | cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a" | |
199 | fi | |
200 | fi | |
201 | if test "$use_threads" = pthreads; then | |
202 | # Look for pthreads in srcdir. See above to understand why | |
203 | # we always set threads_package. | |
204 | if test -f $srcdir/../../pthreads/pthreads/queue.c \ | |
205 | || test -f $srcdir/../pthreads/pthreads/queue.c; then | |
206 | threads_package=MIT | |
207 | cy_cv_threads_cflags="-I$srcdir/../../pthreads/include" | |
208 | cy_cv_threads_libs="-L../../pthreads/lib -lpthread" | |
209 | fi | |
210 | fi | |
211 | saved_CPP="$CPPFLAGS" | |
212 | saved_LD="$LDFLAGS" | |
213 | saved_LIBS="$LIBS" | |
214 | if test "$threads_package" = unknown; then | |
215 | dnl | |
216 | dnl Test for the FSU threads package | |
217 | dnl | |
218 | CPPFLAGS="-I$use_threads/include" | |
219 | LDFLAGS="-L$use_threads/lib" | |
220 | LIBS="-lgthreads -lmalloc" | |
221 | AC_TRY_LINK([#include <pthread.h>],[ | |
222 | pthread_equal(NULL,NULL); | |
223 | ], threads_package=FSU) | |
224 | fi | |
225 | if test "$threads_package" = unknown; then | |
226 | dnl | |
227 | dnl Test for the MIT threads package | |
228 | dnl | |
229 | LIBS="-lpthread" | |
230 | AC_TRY_LINK([#include <pthread.h>],[ | |
231 | pthread_equal(NULL,NULL); | |
232 | ], threads_package=MIT) | |
233 | fi | |
234 | if test "$threads_package" = unknown; then | |
235 | dnl | |
236 | dnl Test for the PCthreads package | |
237 | dnl | |
238 | LIBS="-lpthreads" | |
239 | AC_TRY_LINK([#include <pthread.h>],[ | |
240 | pthread_equal(NULL,NULL); | |
241 | ], threads_package=PCthreads) | |
242 | fi | |
243 | dnl | |
244 | dnl Set the appropriate flags! | |
245 | dnl | |
246 | cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags" | |
247 | cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs" | |
248 | cy_cv_threads_package=$threads_package | |
249 | CPPFLAGS="$saved_CPP" | |
250 | LDFLAGS="$saved_LD" | |
251 | LIBS="$saved_LIBS" | |
252 | if test "$threads_package" = unknown; then | |
253 | AC_MSG_ERROR("cannot find thread library installation") | |
254 | fi | |
255 | fi | |
256 | ]) | |
257 | ]) | |
258 | ], | |
259 | dnl | |
260 | dnl Set flags according to what is cached. | |
261 | dnl | |
262 | CPPFLAGS="$cy_cv_threads_cflags" | |
263 | LIBS="$cy_cv_threads_libs" | |
264 | ) | |
265 | ]) | |
266 |