Commit | Line | Data |
---|---|---|
1dc9c5b0 | 1 | dnl aclocal.m4 generated automatically by aclocal 1.1n |
733943b9 TT |
2 | |
3 | ||
4 | dnl Usage: AM_INIT_GUILE_MODULE(module-name) | |
5 | dnl This macro will automatically get the guile version from the | |
6 | dnl top-level srcdir, and will initialize automake. It also | |
7 | dnl defines the `module' variable. | |
8 | AC_DEFUN([AM_INIT_GUILE_MODULE],[ | |
9 | . $srcdir/../GUILE-VERSION | |
1dc9c5b0 JB |
10 | AM_INIT_AUTOMAKE($PACKAGE, $VERSION) |
11 | AC_CONFIG_AUX_DIR(..) | |
12 | module=[$1] | |
13 | AC_SUBST(module)]) | |
14 | ||
15 | # Do all the work for Automake. This macro actually does too much -- | |
16 | # some checks are only needed if your package does certain things. | |
17 | # But this isn't really a big deal. | |
18 | ||
19 | # serial 1 | |
20 | ||
21 | dnl Usage: | |
22 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
23 | ||
24 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
25 | [AC_REQUIRE([AM_PROG_INSTALL]) | |
26 | PACKAGE=[$1] | |
733943b9 | 27 | AC_SUBST(PACKAGE) |
1dc9c5b0 | 28 | VERSION=[$2] |
733943b9 | 29 | AC_SUBST(VERSION) |
1dc9c5b0 JB |
30 | ifelse([$3],, |
31 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") | |
32 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) | |
733943b9 TT |
33 | AM_SANITY_CHECK |
34 | AC_ARG_PROGRAM | |
1dc9c5b0 JB |
35 | dnl FIXME This is truly gross. |
36 | missing_dir=`cd $ac_aux_dir && pwd` | |
37 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
38 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
39 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
40 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
41 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
42 | AC_PROG_MAKE_SET]) | |
733943b9 TT |
43 | |
44 | ||
45 | # serial 1 | |
46 | ||
47 | AC_DEFUN(AM_PROG_INSTALL, | |
48 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
49 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
50 | AC_SUBST(INSTALL_SCRIPT)dnl | |
51 | ]) | |
52 | ||
53 | # | |
54 | # Check to make sure that the build environment is sane. | |
55 | # | |
56 | ||
57 | AC_DEFUN(AM_SANITY_CHECK, | |
58 | [AC_MSG_CHECKING([whether build environment is sane]) | |
1dc9c5b0 JB |
59 | # Just in case |
60 | sleep 1 | |
733943b9 | 61 | echo timestamp > conftestfile |
1dc9c5b0 JB |
62 | # Do `set' in a subshell so we don't clobber the current shell's |
63 | # arguments. Must try -L first in case configure is actually a | |
64 | # symlink; some systems play weird games with the mod time of symlinks | |
65 | # (eg FreeBSD returns the mod time of the symlink's containing | |
66 | # directory). | |
67 | if ( | |
68 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
69 | if test "$@" = "X"; then | |
70 | # -L didn't work. | |
71 | set X `ls -t $srcdir/configure conftestfile` | |
72 | fi | |
73 | test "[$]2" = conftestfile | |
74 | ) | |
733943b9 TT |
75 | then |
76 | # Ok. | |
77 | : | |
78 | else | |
79 | AC_MSG_ERROR([newly created file is older than distributed files! | |
80 | Check your system clock]) | |
81 | fi | |
82 | rm -f conftest* | |
83 | AC_MSG_RESULT(yes)]) | |
84 | ||
1dc9c5b0 JB |
85 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) |
86 | dnl The program must properly implement --version. | |
87 | AC_DEFUN(AM_MISSING_PROG, | |
88 | [AC_MSG_CHECKING(for working $2) | |
89 | # Run test in a subshell; some versions of sh will print an error if | |
90 | # an executable is not found, even if stderr is redirected. | |
91 | if ($2 --version) > /dev/null 2>&1; then | |
92 | $1=$2 | |
93 | AC_MSG_RESULT(found) | |
94 | else | |
95 | $1="$3/missing $2" | |
96 | AC_MSG_RESULT(missing) | |
97 | fi | |
98 | AC_SUBST($1)]) | |
99 | ||
15ae1bee MD |
100 | # Add --enable-maintainer-mode option to configure. |
101 | # From Jim Meyering | |
102 | ||
103 | # serial 1 | |
104 | ||
105 | AC_DEFUN(AM_MAINTAINER_MODE, | |
106 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) | |
107 | dnl maintainer-mode is disabled by default | |
108 | AC_ARG_ENABLE(maintainer-mode, | |
109 | [ --enable-maintainer-mode enable make rules and dependencies not useful | |
110 | (and sometimes confusing) to the casual installer], | |
111 | USE_MAINTAINER_MODE=$enableval, | |
112 | USE_MAINTAINER_MODE=no) | |
113 | AC_MSG_RESULT($USE_MAINTAINER_MODE) | |
114 | if test $USE_MAINTAINER_MODE = yes; then | |
115 | MAINT= | |
116 | else | |
117 | MAINT='#M#' | |
118 | fi | |
119 | AC_SUBST(MAINT)dnl | |
120 | ] | |
121 | ) | |
122 | ||
733943b9 TT |
123 | dnl |
124 | dnl CY_AC_WITH_THREADS determines which thread library the user intends | |
125 | dnl to put underneath guile. Pass it the path to find the guile top-level | |
126 | dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix. | |
127 | dnl | |
128 | ||
129 | AC_DEFUN([CY_AC_WITH_THREADS],[ | |
130 | AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[ | |
131 | AC_CACHE_VAL(cy_cv_threads_cflags,[ | |
132 | AC_CACHE_VAL(cy_cv_threads_libs,[ | |
133 | use_threads=no; | |
134 | AC_ARG_WITH(threads,[ --with-threads thread interface], | |
135 | use_threads=$withval, use_threads=no) | |
136 | test -n "$use_threads" || use_threads=qt | |
137 | threads_package=unknown | |
138 | if test "$use_threads" != no; then | |
139 | dnl | |
140 | dnl Test for the qt threads package - used for cooperative threads | |
141 | dnl This may not necessarily be built yet - so just check for the | |
142 | dnl header files. | |
143 | dnl | |
144 | if test "$use_threads" = yes || test "$use_threads" = qt; then | |
145 | # Look for qt in source directory. This is a hack: we look in | |
146 | # "./qt" because this check might be run at the top level. | |
147 | if test -f $srcdir/../qt/qt.c || test -f $srcdir/qt/qt.c; then | |
148 | threads_package=COOP | |
149 | cy_cv_threads_cflags="-I$srcdir/../qt -I../qt" | |
150 | cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a" | |
151 | fi | |
152 | else | |
153 | if test -f $use_threads/qt.c; then | |
154 | # FIXME seems as though we should try to use an installed qt here. | |
155 | threads_package=COOP | |
156 | cy_cv_threads_cflags="-I$use_threads -I../qt" | |
157 | cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a" | |
158 | fi | |
159 | fi | |
160 | if test "$use_threads" = pthreads; then | |
161 | # Look for pthreads in srcdir. See above to understand why | |
162 | # we always set threads_package. | |
163 | if test -f $srcdir/../../pthreads/pthreads/queue.c \ | |
164 | || test -f $srcdir/../pthreads/pthreads/queue.c; then | |
165 | threads_package=MIT | |
166 | cy_cv_threads_cflags="-I$srcdir/../../pthreads/include" | |
167 | cy_cv_threads_libs="-L../../pthreads/lib -lpthread" | |
168 | fi | |
169 | fi | |
170 | saved_CPP="$CPPFLAGS" | |
171 | saved_LD="$LDFLAGS" | |
172 | saved_LIBS="$LIBS" | |
173 | if test "$threads_package" = unknown; then | |
174 | dnl | |
175 | dnl Test for the FSU threads package | |
176 | dnl | |
177 | CPPFLAGS="-I$use_threads/include" | |
178 | LDFLAGS="-L$use_threads/lib" | |
179 | LIBS="-lgthreads -lmalloc" | |
180 | AC_TRY_LINK([#include <pthread.h>],[ | |
181 | pthread_equal(NULL,NULL); | |
182 | ], threads_package=FSU) | |
183 | fi | |
184 | if test "$threads_package" = unknown; then | |
185 | dnl | |
186 | dnl Test for the MIT threads package | |
187 | dnl | |
188 | LIBS="-lpthread" | |
189 | AC_TRY_LINK([#include <pthread.h>],[ | |
190 | pthread_equal(NULL,NULL); | |
191 | ], threads_package=MIT) | |
192 | fi | |
193 | if test "$threads_package" = unknown; then | |
194 | dnl | |
195 | dnl Test for the PCthreads package | |
196 | dnl | |
197 | LIBS="-lpthreads" | |
198 | AC_TRY_LINK([#include <pthread.h>],[ | |
199 | pthread_equal(NULL,NULL); | |
200 | ], threads_package=PCthreads) | |
201 | fi | |
202 | dnl | |
203 | dnl Set the appropriate flags! | |
204 | dnl | |
205 | cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags" | |
206 | cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs" | |
207 | cy_cv_threads_package=$threads_package | |
208 | CPPFLAGS="$saved_CPP" | |
209 | LDFLAGS="$saved_LD" | |
210 | LIBS="$saved_LIBS" | |
211 | if test "$threads_package" = unknown; then | |
212 | AC_MSG_ERROR("cannot find thread library installation") | |
213 | fi | |
214 | fi | |
215 | ]) | |
216 | ]) | |
217 | ], | |
218 | dnl | |
219 | dnl Set flags according to what is cached. | |
220 | dnl | |
221 | CPPFLAGS="$cy_cv_threads_cflags" | |
222 | LIBS="$cy_cv_threads_libs" | |
223 | ) | |
224 | ]) | |
225 |