Commit | Line | Data |
---|---|---|
85e02c55 | 1 | dnl aclocal.m4 generated automatically by aclocal 1.1l |
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 | |
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) | |
23 | ||
24 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
25 | [AC_REQUIRE([AM_PROG_INSTALL]) | |
26 | PACKAGE=[$1] | |
27 | AC_SUBST(PACKAGE) | |
28 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") | |
29 | VERSION=[$2] | |
30 | AC_SUBST(VERSION) | |
31 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") | |
32 | AM_SANITY_CHECK | |
33 | AC_ARG_PROGRAM | |
34 | AC_PROG_MAKE_SET]) | |
35 | ||
36 | ||
37 | # serial 1 | |
38 | ||
39 | AC_DEFUN(AM_PROG_INSTALL, | |
40 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
41 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
42 | AC_SUBST(INSTALL_SCRIPT)dnl | |
43 | ]) | |
44 | ||
45 | # | |
46 | # Check to make sure that the build environment is sane. | |
47 | # | |
48 | ||
49 | AC_DEFUN(AM_SANITY_CHECK, | |
50 | [AC_MSG_CHECKING([whether build environment is sane]) | |
51 | echo timestamp > conftestfile | |
52 | # Do this in a subshell so we don't clobber the current shell's | |
53 | # arguments. FIXME: maybe try `-L' hack like GETLOADAVG test? | |
54 | if (set X `ls -t $srcdir/configure conftestfile`; test "[$]2" = conftestfile) | |
55 | then | |
56 | # Ok. | |
57 | : | |
58 | else | |
59 | AC_MSG_ERROR([newly created file is older than distributed files! | |
60 | Check your system clock]) | |
61 | fi | |
62 | rm -f conftest* | |
63 | AC_MSG_RESULT(yes)]) | |
64 | ||
65 | dnl | |
66 | dnl CY_AC_WITH_THREADS determines which thread library the user intends | |
67 | dnl to put underneath guile. Pass it the path to find the guile top-level | |
68 | dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix. | |
69 | dnl | |
70 | ||
71 | AC_DEFUN([CY_AC_WITH_THREADS],[ | |
72 | AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[ | |
73 | AC_CACHE_VAL(cy_cv_threads_cflags,[ | |
74 | AC_CACHE_VAL(cy_cv_threads_libs,[ | |
75 | use_threads=no; | |
76 | AC_ARG_WITH(threads,[ --with-threads thread interface], | |
77 | use_threads=$withval, use_threads=no) | |
78 | test -n "$use_threads" || use_threads=qt | |
79 | threads_package=unknown | |
80 | if test "$use_threads" != no; then | |
81 | dnl | |
82 | dnl Test for the qt threads package - used for cooperative threads | |
83 | dnl This may not necessarily be built yet - so just check for the | |
84 | dnl header files. | |
85 | dnl | |
86 | if test "$use_threads" = yes || test "$use_threads" = qt; then | |
87 | # Look for qt in source directory. This is a hack: we look in | |
88 | # "./qt" because this check might be run at the top level. | |
89 | if test -f $srcdir/../qt/qt.c || test -f $srcdir/qt/qt.c; then | |
90 | threads_package=COOP | |
91 | cy_cv_threads_cflags="-I$srcdir/../qt -I../qt" | |
92 | cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a" | |
93 | fi | |
94 | else | |
95 | if test -f $use_threads/qt.c; then | |
96 | # FIXME seems as though we should try to use an installed qt here. | |
97 | threads_package=COOP | |
98 | cy_cv_threads_cflags="-I$use_threads -I../qt" | |
99 | cy_cv_threads_libs="../threads/libthreads.a ../qt/libqt.a" | |
100 | fi | |
101 | fi | |
102 | if test "$use_threads" = pthreads; then | |
103 | # Look for pthreads in srcdir. See above to understand why | |
104 | # we always set threads_package. | |
105 | if test -f $srcdir/../../pthreads/pthreads/queue.c \ | |
106 | || test -f $srcdir/../pthreads/pthreads/queue.c; then | |
107 | threads_package=MIT | |
108 | cy_cv_threads_cflags="-I$srcdir/../../pthreads/include" | |
109 | cy_cv_threads_libs="-L../../pthreads/lib -lpthread" | |
110 | fi | |
111 | fi | |
112 | saved_CPP="$CPPFLAGS" | |
113 | saved_LD="$LDFLAGS" | |
114 | saved_LIBS="$LIBS" | |
115 | if test "$threads_package" = unknown; then | |
116 | dnl | |
117 | dnl Test for the FSU threads package | |
118 | dnl | |
119 | CPPFLAGS="-I$use_threads/include" | |
120 | LDFLAGS="-L$use_threads/lib" | |
121 | LIBS="-lgthreads -lmalloc" | |
122 | AC_TRY_LINK([#include <pthread.h>],[ | |
123 | pthread_equal(NULL,NULL); | |
124 | ], threads_package=FSU) | |
125 | fi | |
126 | if test "$threads_package" = unknown; then | |
127 | dnl | |
128 | dnl Test for the MIT threads package | |
129 | dnl | |
130 | LIBS="-lpthread" | |
131 | AC_TRY_LINK([#include <pthread.h>],[ | |
132 | pthread_equal(NULL,NULL); | |
133 | ], threads_package=MIT) | |
134 | fi | |
135 | if test "$threads_package" = unknown; then | |
136 | dnl | |
137 | dnl Test for the PCthreads package | |
138 | dnl | |
139 | LIBS="-lpthreads" | |
140 | AC_TRY_LINK([#include <pthread.h>],[ | |
141 | pthread_equal(NULL,NULL); | |
142 | ], threads_package=PCthreads) | |
143 | fi | |
144 | dnl | |
145 | dnl Set the appropriate flags! | |
146 | dnl | |
147 | cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags" | |
148 | cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs" | |
149 | cy_cv_threads_package=$threads_package | |
150 | CPPFLAGS="$saved_CPP" | |
151 | LDFLAGS="$saved_LD" | |
152 | LIBS="$saved_LIBS" | |
153 | if test "$threads_package" = unknown; then | |
154 | AC_MSG_ERROR("cannot find thread library installation") | |
155 | fi | |
156 | fi | |
157 | ]) | |
158 | ]) | |
159 | ], | |
160 | dnl | |
161 | dnl Set flags according to what is cached. | |
162 | dnl | |
163 | CPPFLAGS="$cy_cv_threads_cflags" | |
164 | LIBS="$cy_cv_threads_libs" | |
165 | ) | |
166 | ]) | |
167 |