Commit | Line | Data |
---|---|---|
733943b9 TT |
1 | dnl aclocal.m4 generated automatically by aclocal 1.1i |
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 | ||
138 | dnl | |
139 | dnl CY_AC_WITH_THREADS determines which thread library the user intends | |
140 | dnl to put underneath guile. Pass it the path to find the guile top-level | |
141 | dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix. | |
142 | dnl | |
143 | ||
144 | AC_DEFUN([CY_AC_WITH_THREADS],[ | |
145 | AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[ | |
146 | AC_CACHE_VAL(cy_cv_threads_cflags,[ | |
147 | AC_CACHE_VAL(cy_cv_threads_libs,[ | |
148 | use_threads=no; | |
149 | AC_ARG_WITH(threads,[ --with-threads thread interface], | |
150 | use_threads=$withval, use_threads=no) | |
151 | test -n "$use_threads" || use_threads=qt | |
152 | threads_package=unknown | |
153 | if test "$use_threads" != no; then | |
154 | dnl | |
155 | dnl Test for the qt threads package - used for cooperative threads | |
156 | dnl This may not necessarily be built yet - so just check for the | |
157 | dnl header files. | |
158 | dnl | |
159 | if test "$use_threads" = yes || test "$use_threads" = qt; then | |
160 | # Look for qt in source directory. This is a hack: we look in | |
161 | # "./qt" because this check might be run at the top level. | |
162 | if test -f $srcdir/../qt/qt.c || test -f $srcdir/qt/qt.c; then | |
163 | threads_package=COOP | |
164 | cy_cv_threads_cflags="-I$srcdir/../qt -I../qt" | |
165 | cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a" | |
166 | fi | |
167 | else | |
168 | if test -f $use_threads/qt.c; then | |
169 | # FIXME seems as though we should try to use an installed qt here. | |
170 | threads_package=COOP | |
171 | cy_cv_threads_cflags="-I$use_threads -I../qt" | |
172 | cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a" | |
173 | fi | |
174 | fi | |
175 | if test "$use_threads" = pthreads; then | |
176 | # Look for pthreads in srcdir. See above to understand why | |
177 | # we always set threads_package. | |
178 | if test -f $srcdir/../../pthreads/pthreads/queue.c \ | |
179 | || test -f $srcdir/../pthreads/pthreads/queue.c; then | |
180 | threads_package=MIT | |
181 | cy_cv_threads_cflags="-I$srcdir/../../pthreads/include" | |
182 | cy_cv_threads_libs="-L../../pthreads/lib -lpthread" | |
183 | fi | |
184 | fi | |
185 | saved_CPP="$CPPFLAGS" | |
186 | saved_LD="$LDFLAGS" | |
187 | saved_LIBS="$LIBS" | |
188 | if test "$threads_package" = unknown; then | |
189 | dnl | |
190 | dnl Test for the FSU threads package | |
191 | dnl | |
192 | CPPFLAGS="-I$use_threads/include" | |
193 | LDFLAGS="-L$use_threads/lib" | |
194 | LIBS="-lgthreads -lmalloc" | |
195 | AC_TRY_LINK([#include <pthread.h>],[ | |
196 | pthread_equal(NULL,NULL); | |
197 | ], threads_package=FSU) | |
198 | fi | |
199 | if test "$threads_package" = unknown; then | |
200 | dnl | |
201 | dnl Test for the MIT threads package | |
202 | dnl | |
203 | LIBS="-lpthread" | |
204 | AC_TRY_LINK([#include <pthread.h>],[ | |
205 | pthread_equal(NULL,NULL); | |
206 | ], threads_package=MIT) | |
207 | fi | |
208 | if test "$threads_package" = unknown; then | |
209 | dnl | |
210 | dnl Test for the PCthreads package | |
211 | dnl | |
212 | LIBS="-lpthreads" | |
213 | AC_TRY_LINK([#include <pthread.h>],[ | |
214 | pthread_equal(NULL,NULL); | |
215 | ], threads_package=PCthreads) | |
216 | fi | |
217 | dnl | |
218 | dnl Set the appropriate flags! | |
219 | dnl | |
220 | cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags" | |
221 | cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs" | |
222 | cy_cv_threads_package=$threads_package | |
223 | CPPFLAGS="$saved_CPP" | |
224 | LDFLAGS="$saved_LD" | |
225 | LIBS="$saved_LIBS" | |
226 | if test "$threads_package" = unknown; then | |
227 | AC_MSG_ERROR("cannot find thread library installation") | |
228 | fi | |
229 | fi | |
230 | ]) | |
231 | ]) | |
232 | ], | |
233 | dnl | |
234 | dnl Set flags according to what is cached. | |
235 | dnl | |
236 | CPPFLAGS="$cy_cv_threads_cflags" | |
237 | LIBS="$cy_cv_threads_libs" | |
238 | ) | |
239 | ]) | |
240 |