* expect.scm (expect-regexec): define 'eof-next?'. I don't
[bpt/guile.git] / aclocal.m4
CommitLineData
9bd368c0 1dnl aclocal.m4 generated automatically by aclocal 1.4
5aadf8c1 2
9bd368c0
MD
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5aadf8c1
MG
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
ebf50833 12
3a629497
JB
13dnl On the NeXT, #including <utime.h> doesn't give you a definition for
14dnl struct utime, unless you #define _POSIX_SOURCE.
15
16AC_DEFUN(GUILE_STRUCT_UTIMBUF, [
17 AC_CACHE_CHECK([whether we need POSIX to get struct utimbuf],
18 guile_cv_struct_utimbuf_needs_posix,
19 [AC_TRY_CPP([
20#ifdef __EMX__
21#include <sys/utime.h>
22#else
23#include <utime.h>
24#endif
25struct utime blah;
26],
27 guile_cv_struct_utimbuf_needs_posix=no,
28 guile_cv_struct_utimbuf_needs_posix=yes)])
29 if test "$guile_cv_struct_utimbuf_needs_posix" = yes; then
30 AC_DEFINE(UTIMBUF_NEEDS_POSIX)
31 fi])
32
33
34
35
36dnl
37dnl Apparently, at CMU they have a weird version of libc.h that is
38dnl installed in /usr/local/include and conflicts with unistd.h.
39dnl In these situations, we should not #include libc.h.
40dnl This test arranges to #define LIBC_H_WITH_UNISTD_H iff libc.h is
41dnl present on the system, and is safe to #include.
42dnl
43AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD],
44 [
45 AC_CHECK_HEADERS(libc.h unistd.h)
46 AC_CACHE_CHECK(
47 "whether libc.h and unistd.h can be included together",
48 guile_cv_header_libc_with_unistd,
49 [
50 if test "$ac_cv_header_libc_h" = "no"; then
51 guile_cv_header_libc_with_unistd="no"
52 elif test "$ac_cv_header_unistd.h" = "no"; then
53 guile_cv_header_libc_with_unistd="yes"
54 else
55 AC_TRY_COMPILE(
56 [
57# include <libc.h>
58# include <unistd.h>
59 ],
60 [],
61 [guile_cv_header_libc_with_unistd=yes],
62 [guile_cv_header_libc_with_unistd=no]
63 )
64 fi
65 ]
66 )
67 if test "$guile_cv_header_libc_with_unistd" = yes; then
68 AC_DEFINE(LIBC_H_WITH_UNISTD_H)
69 fi
70 ]
71)
72
0b89e78e
MD
73
74
75dnl This is needed when we want to check for the same function repeatedly
76dnl with other parameters, such as libraries, varying.
77dnl
78dnl GUILE_NAMED_CHECK_FUNC(FUNCTION, TESTNAME,
79dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
80AC_DEFUN(GUILE_NAMED_CHECK_FUNC,
81[AC_MSG_CHECKING([for $1])
82AC_CACHE_VAL(ac_cv_func_$1_$2,
83[AC_TRY_LINK(
84dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
85dnl which includes <sys/select.h> which contains a prototype for
86dnl select. Similarly for bzero.
87[/* System header to define __stub macros and hopefully few prototypes,
88 which can conflict with char $1(); below. */
89#include <assert.h>
90/* Override any gcc2 internal prototype to avoid an error. */
91]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
92extern "C"
93#endif
94])dnl
95[/* We use char because int might match the return type of a gcc2
96 builtin and then its argument prototype would still apply. */
97char $1();
98], [
99/* The GNU C library defines this for functions which it implements
100 to always fail with ENOSYS. Some functions are actually named
101 something starting with __ and the normal name is an alias. */
102#if defined (__stub_$1) || defined (__stub___$1)
103choke me
104#else
105$1();
106#endif
107], eval "ac_cv_func_$1_$2=yes", eval "ac_cv_func_$1_$2=no")])
108if eval "test \"`echo '$ac_cv_func_'$1'_'$2`\" = yes"; then
109 AC_MSG_RESULT(yes)
110 ifelse([$3], , :, [$3])
111else
112 AC_MSG_RESULT(no)
113ifelse([$4], , , [$4
114])dnl
115fi
116])
117
db1e65d5
TP
118
119
120dnl Check checks whether dlsym (if present) requires a leading underscore.
121dnl Written by Dan Hagerty <hag@ai.mit.edu> for scsh-0.5.0.
122AC_DEFUN(GUILE_DLSYM_USCORE, [
123 AC_MSG_CHECKING(for underscore before symbols)
124 AC_CACHE_VAL(guile_cv_uscore,[
125 echo "main(){int i=1;}
126 fnord(){int i=23; int ltuae=42;}" > conftest.c
127 ${CC} conftest.c > /dev/null
128 if (nm a.out | grep _fnord) > /dev/null; then
129 guile_cv_uscore=yes
130 else
131 guile_cv_uscore=no
132 fi])
133 AC_MSG_RESULT($guile_cv_uscore)
134 rm -f conftest.c a.out
135
136 if test $guile_cv_uscore = yes; then
137 AC_DEFINE(USCORE)
138
139 if test $ac_cv_func_dlopen = yes -o $ac_cv_lib_dl_dlopen = yes ; then
140 AC_MSG_CHECKING(whether dlsym always adds an underscore for us)
141 AC_CACHE_VAL(guile_cv_dlsym_adds_uscore,AC_TRY_RUN( [
142#include <dlfcn.h>
143#include <stdio.h>
144fnord() { int i=42;}
145main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
146 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
147 if(ptr1 && !ptr2) exit(0); } exit(1); }
148], [guile_cv_dlsym_adds_uscore=yes
5aadf8c1
MG
149 AC_DEFINE(DLSYM_ADDS_USCORE) ], guile_cv_dlsym_adds_uscore=no,
150 guile_cv_dlsym_adds_uscore=no))
db1e65d5
TP
151
152 AC_MSG_RESULT($guile_cv_dlsym_adds_uscore)
153 fi
154 fi
155])
156
733943b9
TT
157# Do all the work for Automake. This macro actually does too much --
158# some checks are only needed if your package does certain things.
159# But this isn't really a big deal.
160
161# serial 1
162
163dnl Usage:
1dc9c5b0 164dnl AM_INIT_AUTOMAKE(package,version, [no-define])
733943b9
TT
165
166AC_DEFUN(AM_INIT_AUTOMAKE,
9bd368c0 167[AC_REQUIRE([AC_PROG_INSTALL])
733943b9
TT
168PACKAGE=[$1]
169AC_SUBST(PACKAGE)
733943b9
TT
170VERSION=[$2]
171AC_SUBST(VERSION)
c7b6463e
JB
172dnl test to see if srcdir already configured
173if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
174 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
175fi
1dc9c5b0 176ifelse([$3],,
9bd368c0
MD
177AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
178AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
341eaef0
GH
179AC_REQUIRE([AM_SANITY_CHECK])
180AC_REQUIRE([AC_ARG_PROGRAM])
1dc9c5b0
JB
181dnl FIXME This is truly gross.
182missing_dir=`cd $ac_aux_dir && pwd`
183AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
184AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
185AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
186AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
187AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
341eaef0 188AC_REQUIRE([AC_PROG_MAKE_SET])])
733943b9 189
733943b9
TT
190#
191# Check to make sure that the build environment is sane.
192#
193
194AC_DEFUN(AM_SANITY_CHECK,
195[AC_MSG_CHECKING([whether build environment is sane])
1dc9c5b0
JB
196# Just in case
197sleep 1
733943b9 198echo timestamp > conftestfile
1dc9c5b0
JB
199# Do `set' in a subshell so we don't clobber the current shell's
200# arguments. Must try -L first in case configure is actually a
201# symlink; some systems play weird games with the mod time of symlinks
202# (eg FreeBSD returns the mod time of the symlink's containing
203# directory).
204if (
205 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
5aadf8c1 206 if test "[$]*" = "X"; then
1dc9c5b0
JB
207 # -L didn't work.
208 set X `ls -t $srcdir/configure conftestfile`
209 fi
341eaef0
GH
210 if test "[$]*" != "X $srcdir/configure conftestfile" \
211 && test "[$]*" != "X conftestfile $srcdir/configure"; then
212
213 # If neither matched, then we have a broken ls. This can happen
214 # if, for instance, CONFIG_SHELL is bash and it inherits a
215 # broken ls alias from the environment. This has actually
216 # happened. Such a system could not be considered "sane".
217 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
218alias in your environment])
219 fi
220
1dc9c5b0
JB
221 test "[$]2" = conftestfile
222 )
733943b9
TT
223then
224 # Ok.
225 :
226else
227 AC_MSG_ERROR([newly created file is older than distributed files!
228Check your system clock])
229fi
230rm -f conftest*
231AC_MSG_RESULT(yes)])
232
1dc9c5b0
JB
233dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
234dnl The program must properly implement --version.
235AC_DEFUN(AM_MISSING_PROG,
236[AC_MSG_CHECKING(for working $2)
237# Run test in a subshell; some versions of sh will print an error if
238# an executable is not found, even if stderr is redirected.
c7b6463e
JB
239# Redirect stdin to placate older versions of autoconf. Sigh.
240if ($2 --version) < /dev/null > /dev/null 2>&1; then
1dc9c5b0
JB
241 $1=$2
242 AC_MSG_RESULT(found)
243else
244 $1="$3/missing $2"
245 AC_MSG_RESULT(missing)
246fi
247AC_SUBST($1)])
248
15ae1bee
MD
249# Add --enable-maintainer-mode option to configure.
250# From Jim Meyering
251
252# serial 1
253
254AC_DEFUN(AM_MAINTAINER_MODE,
255[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
256 dnl maintainer-mode is disabled by default
257 AC_ARG_ENABLE(maintainer-mode,
258[ --enable-maintainer-mode enable make rules and dependencies not useful
259 (and sometimes confusing) to the casual installer],
260 USE_MAINTAINER_MODE=$enableval,
261 USE_MAINTAINER_MODE=no)
262 AC_MSG_RESULT($USE_MAINTAINER_MODE)
9bd368c0
MD
263 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
264 MAINT=$MAINTAINER_MODE_TRUE
15ae1bee
MD
265 AC_SUBST(MAINT)dnl
266]
267)
268
9bd368c0
MD
269# Define a conditional.
270
271AC_DEFUN(AM_CONDITIONAL,
272[AC_SUBST($1_TRUE)
273AC_SUBST($1_FALSE)
274if $2; then
275 $1_TRUE=
276 $1_FALSE='#'
277else
278 $1_TRUE='#'
279 $1_FALSE=
280fi])
281
3a629497
JB
282# Like AC_CONFIG_HEADER, but automatically create stamp file.
283
284AC_DEFUN(AM_CONFIG_HEADER,
285[AC_PREREQ([2.12])
286AC_CONFIG_HEADER([$1])
287dnl When config.status generates a header, we must update the stamp-h file.
288dnl This file resides in the same directory as the config header
289dnl that is generated. We must strip everything past the first ":",
290dnl and everything past the last "/".
291AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
c7b6463e
JB
292ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
293<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
294<<am_indx=1
295for am_file in <<$1>>; do
296 case " <<$>>CONFIG_HEADERS " in
297 *" <<$>>am_file "*<<)>>
298 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
299 ;;
300 esac
301 am_indx=`expr "<<$>>am_indx" + 1`
302done<<>>dnl>>)
3a629497
JB
303changequote([,]))])
304
5aadf8c1 305
3668b8c7
MD
306# serial 35 AC_PROG_LIBTOOL
307AC_DEFUN(AC_PROG_LIBTOOL,
308[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
309
310# Save cache, so that ltconfig can load it
311AC_CACHE_SAVE
312
313# Actually configure libtool. ac_aux_dir is where install-sh is found.
314CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
315LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
316DLLTOOL="$DLLTOOL" AS="$AS" \
317${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
318$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
319|| AC_MSG_ERROR([libtool configure failed])
320
321# Reload cache, that may have been modified by ltconfig
322AC_CACHE_LOAD
323
324# This can be used to rebuild libtool when needed
325LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
326
327# Always use our own libtool.
328LIBTOOL='$(SHELL) $(top_builddir)/libtool'
329AC_SUBST(LIBTOOL)dnl
330
331# Redirect the config.log output again, so that the ltconfig log is not
332# clobbered by the next message.
333exec 5>>./config.log
334])
335
336AC_DEFUN(AC_LIBTOOL_SETUP,
337[AC_PREREQ(2.13)dnl
338AC_REQUIRE([AC_ENABLE_SHARED])dnl
339AC_REQUIRE([AC_ENABLE_STATIC])dnl
340AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
5798fd97 341AC_REQUIRE([AC_CANONICAL_HOST])dnl
3668b8c7 342AC_REQUIRE([AC_CANONICAL_BUILD])dnl
5798fd97
MD
343AC_REQUIRE([AC_PROG_RANLIB])dnl
344AC_REQUIRE([AC_PROG_CC])dnl
3668b8c7
MD
345AC_REQUIRE([AC_PROG_LD])dnl
346AC_REQUIRE([AC_PROG_NM])dnl
347AC_REQUIRE([AC_SYS_NM_PARSE])dnl
348AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
5798fd97
MD
349AC_REQUIRE([AC_PROG_LN_S])dnl
350dnl
5aadf8c1 351
5798fd97 352# Check for any special flags to pass to ltconfig.
3668b8c7 353libtool_flags="--cache-file=$cache_file"
5798fd97
MD
354test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
355test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3668b8c7
MD
356test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
357test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
5aadf8c1
MG
358test "$silent" = yes && libtool_flags="$libtool_flags --silent"
359test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
360test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
361
362# Some flags need to be propagated to the compiler or linker for good
363# libtool support.
5798fd97 364case "$host" in
5aadf8c1 365*-*-irix6*)
5798fd97
MD
366 # Find out which ABI we are using.
367 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
368 if AC_TRY_EVAL(ac_compile); then
369 case "`/usr/bin/file conftest.o`" in
370 *32-bit*)
371 LD="${LD-ld} -32"
372 ;;
373 *N32*)
374 LD="${LD-ld} -n32"
375 ;;
376 *64-bit*)
377 LD="${LD-ld} -64"
378 ;;
379 esac
380 fi
381 rm -rf conftest*
5aadf8c1
MG
382 ;;
383
384*-*-sco3.2v5*)
385 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3668b8c7 386 SAVE_CFLAGS="$CFLAGS"
5aadf8c1 387 CFLAGS="$CFLAGS -belf"
3668b8c7
MD
388 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
389 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
390 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
391 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
392 CFLAGS="$SAVE_CFLAGS"
393 fi
5aadf8c1 394 ;;
3668b8c7
MD
395
396*-*-cygwin*)
397 AC_SYS_LIBTOOL_CYGWIN
398 ;;
399
5798fd97 400esac
5aadf8c1 401
3668b8c7
MD
402# enable the --disable-libtool-lock switch
403
404AC_ARG_ENABLE(libtool-lock,
405[ --disable-libtool-lock force libtool not to do file locking],
406need_locks=$enableval,
407need_locks=yes)
408
409if test x"$need_locks" = xno; then
410 libtool_flags="$libtool_flags --disable-lock"
411fi
5aadf8c1
MG
412])
413
3668b8c7
MD
414# AC_LIBTOOL_DLOPEN - check for dlopen support
415AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
416
417# AC_ENABLE_SHARED - implement the --enable-shared flag
418# Usage: AC_ENABLE_SHARED[(DEFAULT)]
5798fd97
MD
419# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
420# `yes'.
3668b8c7
MD
421AC_DEFUN(AC_ENABLE_SHARED,
422[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
5798fd97
MD
423AC_ARG_ENABLE(shared,
424changequote(<<, >>)dnl
3668b8c7 425<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
5798fd97 426changequote([, ])dnl
5798fd97
MD
427[p=${PACKAGE-default}
428case "$enableval" in
429yes) enable_shared=yes ;;
430no) enable_shared=no ;;
431*)
432 enable_shared=no
433 # Look at the argument we got. We use all the common list separators.
434 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
435 for pkg in $enableval; do
436 if test "X$pkg" = "X$p"; then
437 enable_shared=yes
438 fi
439 done
440 IFS="$ac_save_ifs"
441 ;;
442esac],
3668b8c7 443enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
5798fd97
MD
444])
445
3668b8c7
MD
446# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
447AC_DEFUN(AC_DISABLE_SHARED,
448[AC_ENABLE_SHARED(no)])
5798fd97 449
3668b8c7
MD
450# AC_ENABLE_STATIC - implement the --enable-static flag
451# Usage: AC_ENABLE_STATIC[(DEFAULT)]
5798fd97
MD
452# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
453# `yes'.
3668b8c7
MD
454AC_DEFUN(AC_ENABLE_STATIC,
455[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
5798fd97
MD
456AC_ARG_ENABLE(static,
457changequote(<<, >>)dnl
3668b8c7 458<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
5798fd97 459changequote([, ])dnl
5798fd97
MD
460[p=${PACKAGE-default}
461case "$enableval" in
462yes) enable_static=yes ;;
463no) enable_static=no ;;
464*)
465 enable_static=no
466 # Look at the argument we got. We use all the common list separators.
467 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
468 for pkg in $enableval; do
469 if test "X$pkg" = "X$p"; then
470 enable_static=yes
471 fi
472 done
473 IFS="$ac_save_ifs"
474 ;;
475esac],
3668b8c7 476enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
5798fd97
MD
477])
478
3668b8c7
MD
479# AC_DISABLE_STATIC - set the default static flag to --disable-static
480AC_DEFUN(AC_DISABLE_STATIC,
481[AC_ENABLE_STATIC(no)])
482
5798fd97 483
3668b8c7
MD
484# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
485# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
486# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
487# `yes'.
488AC_DEFUN(AC_ENABLE_FAST_INSTALL,
489[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
490AC_ARG_ENABLE(fast-install,
491changequote(<<, >>)dnl
492<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
493changequote([, ])dnl
494[p=${PACKAGE-default}
495case "$enableval" in
496yes) enable_fast_install=yes ;;
497no) enable_fast_install=no ;;
498*)
499 enable_fast_install=no
500 # Look at the argument we got. We use all the common list separators.
501 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
502 for pkg in $enableval; do
503 if test "X$pkg" = "X$p"; then
504 enable_fast_install=yes
505 fi
506 done
507 IFS="$ac_save_ifs"
508 ;;
509esac],
510enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
511])
512
513# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
514AC_DEFUN(AC_DISABLE_FAST_INSTALL,
515[AC_ENABLE_FAST_INSTALL(no)])
516
517
518# AC_PROG_LD - find the path to the GNU or non-GNU linker
519AC_DEFUN(AC_PROG_LD,
5aadf8c1
MG
520[AC_ARG_WITH(gnu-ld,
521[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
522test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
3668b8c7
MD
523AC_REQUIRE([AC_PROG_CC])dnl
524AC_REQUIRE([AC_CANONICAL_HOST])dnl
525AC_REQUIRE([AC_CANONICAL_BUILD])dnl
5aadf8c1
MG
526ac_prog=ld
527if test "$ac_cv_prog_gcc" = yes; then
528 # Check if gcc -print-prog-name=ld gives a path.
529 AC_MSG_CHECKING([for ld used by GCC])
530 ac_prog=`($CC -print-prog-name=ld) 2>&5`
531 case "$ac_prog" in
3668b8c7
MD
532 # Accept absolute paths.
533changequote(,)dnl
534 /* | [A-Za-z]:[\\/]*)
535 re_direlt='/[^/][^/]*/\.\./'
536changequote([,])dnl
537 # Canonicalize the path of ld
538 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
539 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
540 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
541 done
542 test -z "$LD" && LD="$ac_prog"
543 ;;
5aadf8c1
MG
544 "")
545 # If it fails, then pretend we aren't using GCC.
546 ac_prog=ld
547 ;;
548 *)
549 # If it is relative, then search for the first ld in PATH.
550 with_gnu_ld=unknown
551 ;;
552 esac
553elif test "$with_gnu_ld" = yes; then
554 AC_MSG_CHECKING([for GNU ld])
555else
556 AC_MSG_CHECKING([for non-GNU ld])
557fi
558AC_CACHE_VAL(ac_cv_path_LD,
559[if test -z "$LD"; then
560 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
561 for ac_dir in $PATH; do
562 test -z "$ac_dir" && ac_dir=.
563 if test -f "$ac_dir/$ac_prog"; then
564 ac_cv_path_LD="$ac_dir/$ac_prog"
565 # Check to see if the program is GNU ld. I'd rather use --version,
566 # but apparently some GNU ld's only accept -v.
567 # Break only if it was the GNU/non-GNU ld that we prefer.
568 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
569 test "$with_gnu_ld" != no && break
570 else
3668b8c7 571 test "$with_gnu_ld" != yes && break
5aadf8c1
MG
572 fi
573 fi
574 done
575 IFS="$ac_save_ifs"
576else
577 ac_cv_path_LD="$LD" # Let the user override the test with a path.
578fi])
579LD="$ac_cv_path_LD"
580if test -n "$LD"; then
581 AC_MSG_RESULT($LD)
582else
583 AC_MSG_RESULT(no)
584fi
585test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
586AC_SUBST(LD)
3668b8c7 587AC_PROG_LD_GNU
5aadf8c1
MG
588])
589
3668b8c7 590AC_DEFUN(AC_PROG_LD_GNU,
5aadf8c1
MG
591[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
592[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
593if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
594 ac_cv_prog_gnu_ld=yes
595else
596 ac_cv_prog_gnu_ld=no
597fi])
598])
599
3668b8c7
MD
600# AC_PROG_NM - find the path to a BSD-compatible name lister
601AC_DEFUN(AC_PROG_NM,
5aadf8c1
MG
602[AC_MSG_CHECKING([for BSD-compatible nm])
603AC_CACHE_VAL(ac_cv_path_NM,
3668b8c7
MD
604[if test -n "$NM"; then
605 # Let the user override the test.
606 ac_cv_path_NM="$NM"
607else
5aadf8c1 608 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3668b8c7 609 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
5798fd97 610 test -z "$ac_dir" && ac_dir=.
5aadf8c1
MG
611 if test -f $ac_dir/nm; then
612 # Check to see if the nm accepts a BSD-compat flag.
5798fd97
MD
613 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
614 # nm: unknown option "B" ignored
615 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3668b8c7
MD
616 ac_cv_path_NM="$ac_dir/nm -B"
617 break
5798fd97 618 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3668b8c7
MD
619 ac_cv_path_NM="$ac_dir/nm -p"
620 break
5aadf8c1 621 else
3668b8c7
MD
622 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
623 continue # so that we can try to find one that supports BSD flags
5aadf8c1 624 fi
5aadf8c1
MG
625 fi
626 done
627 IFS="$ac_save_ifs"
628 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3668b8c7 629fi])
5aadf8c1
MG
630NM="$ac_cv_path_NM"
631AC_MSG_RESULT([$NM])
632AC_SUBST(NM)
633])
634
3668b8c7
MD
635# AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
636# by C symbol name from nm.
637AC_DEFUN(AC_SYS_NM_PARSE,
638[AC_REQUIRE([AC_CANONICAL_HOST])dnl
639AC_REQUIRE([AC_PROG_NM])dnl
640# Check for command to grab the raw symbol name followed by C symbol from nm.
641AC_MSG_CHECKING([command to parse $NM output])
642AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
643[# These are sane defaults that work on at least a few old systems.
644# {They come from Ultrix. What could be older than Ultrix?!! ;)}
645
646changequote(,)dnl
647# Character class describing NM global symbol codes.
648ac_symcode='[BCDEGRST]'
649
650# Regexp to match symbols that can be accessed directly from C.
651ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
652
653# Transform the above into a raw symbol and a C symbol.
654ac_symxfrm='\1 \2\3 \3'
655
656# Transform an extracted symbol line into a proper C declaration
657ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
658
659# Define system-specific variables.
660case "$host_os" in
661aix*)
662 ac_symcode='[BCDT]'
663 ;;
664cygwin* | mingw*)
665 ac_symcode='[ABCDGISTW]'
666 ;;
667hpux*)
668 ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
669 ;;
670irix*)
671 ac_symcode='[BCDEGRST]'
672 ;;
673solaris*)
674 ac_symcode='[BDT]'
675 ;;
676esac
677
678# If we're using GNU nm, then use its standard symbol codes.
679if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
680 ac_symcode='[ABCDGISTW]'
681fi
682changequote([,])dnl
683
684# Try without a prefix undercore, then with it.
685for ac_symprfx in "" "_"; do
686
687 ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
688
689 # Check to see that the pipe works correctly.
690 ac_pipe_works=no
691 rm -f conftest.$ac_ext
692 cat > conftest.$ac_ext <<EOF
693#ifdef __cplusplus
694extern "C" {
695#endif
696char nm_test_var;
697void nm_test_func(){}
698#ifdef __cplusplus
699}
700#endif
701int main(){nm_test_var='a';nm_test_func;return 0;}
702EOF
703
704 if AC_TRY_EVAL(ac_compile); then
705 # Now try to grab the symbols.
706 ac_nlist=conftest.nm
707
708 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
709
710 # Try sorting and uniquifying the output.
711 if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
712 mv -f "$ac_nlist"T "$ac_nlist"
713 else
714 rm -f "$ac_nlist"T
715 fi
716
717 # Make sure that we snagged all the symbols we need.
718 if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
719 if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
720 cat <<EOF > conftest.c
721#ifdef __cplusplus
722extern "C" {
723#endif
724
725EOF
726 # Now generate the symbol file.
727 eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
728
729 cat <<EOF >> conftest.c
730#if defined (__STDC__) && __STDC__
731# define lt_ptr_t void *
732#else
733# define lt_ptr_t char *
734# define const
735#endif
736
737/* The mapping between symbol names and symbols. */
738const struct {
739 const char *name;
740 lt_ptr_t address;
741}
742changequote(,)dnl
743lt_preloaded_symbols[] =
744changequote([,])dnl
745{
746EOF
747 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
748 cat <<\EOF >> conftest.c
749 {0, (lt_ptr_t) 0}
750};
751
752#ifdef __cplusplus
753}
754#endif
755EOF
756 # Now try linking the two files.
757 mv conftest.$ac_objext conftestm.$ac_objext
758 ac_save_LIBS="$LIBS"
759 ac_save_CFLAGS="$CFLAGS"
760 LIBS="conftestm.$ac_objext"
761 CFLAGS="$CFLAGS$no_builtin_flag"
762 if AC_TRY_EVAL(ac_link) && test -s conftest; then
763 ac_pipe_works=yes
764 else
765 echo "configure: failed program was:" >&AC_FD_CC
766 cat conftest.c >&AC_FD_CC
767 fi
768 LIBS="$ac_save_LIBS"
769 CFLAGS="$ac_save_CFLAGS"
770 else
771 echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
772 fi
773 else
774 echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
775 fi
776 else
777 echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
778 fi
779 else
780 echo "$progname: failed program was:" >&AC_FD_CC
781 cat conftest.c >&AC_FD_CC
782 fi
783 rm -rf conftest*
784
785 # Do not use the global_symbol_pipe unless it works.
786 if test "$ac_pipe_works" = yes; then
787 if test x"$ac_symprfx" = x"_"; then
788 ac_cv_sys_symbol_underscore=yes
789 else
790 ac_cv_sys_symbol_underscore=no
791 fi
792 break
793 else
794 ac_cv_sys_global_symbol_pipe=
795 fi
796done
797])
798
799ac_result=yes
800if test -z "$ac_cv_sys_global_symbol_pipe"; then
801 ac_result=no
802fi
803AC_MSG_RESULT($ac_result)
804])
805
806# AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
807AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
808[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
809AC_CHECK_TOOL(AS, as, false)
810])
811
812# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
813# with an underscore?
814AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
815[AC_REQUIRE([AC_PROG_NM])dnl
816AC_REQUIRE([AC_SYS_NM_PARSE])dnl
817AC_MSG_CHECKING([for _ prefix in compiled symbols])
818AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
819[ac_cv_sys_symbol_underscore=no
820cat > conftest.$ac_ext <<EOF
821void nm_test_func(){}
822int main(){nm_test_func;return 0;}
823EOF
824if AC_TRY_EVAL(ac_compile); then
825 # Now try to grab the symbols.
826 ac_nlist=conftest.nm
827 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
828 # See whether the symbols have a leading underscore.
829 if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
830 ac_cv_sys_symbol_underscore=yes
831 else
832 if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
833 :
834 else
835 echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
836 fi
837 fi
838 else
839 echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
840 fi
841else
842 echo "configure: failed program was:" >&AC_FD_CC
843 cat conftest.c >&AC_FD_CC
844fi
845rm -rf conftest*
846])
847AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
848USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
849AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
850])
851
852# AC_CHECK_LIBM - check for math library
853AC_DEFUN(AC_CHECK_LIBM, [
854AC_CHECK_LIB(mw, _mwvalidcheckl)
855AC_CHECK_LIB(m, cos)
856])
857
858# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
859# the libltdl convenience library, adds --enable-ltdl-convenience to
860# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
861# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
862# to be `${top_builddir}/libltdl'. Make sure you start DIR with
863# '${top_builddir}/' (note the single quotes!) if your package is not
864# flat, and, if you're not using automake, define top_builddir as
865# appropriate in the Makefiles.
866AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
867 case "$enable_ltdl_convenience" in
868 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
869 "") enable_ltdl_convenience=yes
870 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
871 esac
872 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
873])
874
875# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
876# the libltdl installable library, and adds --enable-ltdl-install to
877# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
878# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
879# to be `${top_builddir}/libltdl'. Make sure you start DIR with
880# '${top_builddir}/' (note the single quotes!) if your package is not
881# flat, and, if you're not using automake, define top_builddir as
882# appropriate in the Makefiles.
883# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
884AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
885 AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
886 case "$enable_ltdl_install" in
887 no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
888 "") enable_ltdl_install=yes
889 ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
890 esac
891 ])
892 if test x"$enable_ltdl_install" != x"no"; then
893 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
894 fi
895])
896
897dnl old names
898AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
899AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
900AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
901AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
902AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
903AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
904AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
905AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
906AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
907AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
908
e40ffcb6
JB
909
910# serial 1
911
912# @defmac AC_PROG_CC_STDC
913# @maindex PROG_CC_STDC
914# @ovindex CC
915# If the C compiler in not in ANSI C mode by default, try to add an option
916# to output variable @code{CC} to make it so. This macro tries various
917# options that select ANSI C on some system or another. It considers the
918# compiler to be in ANSI C mode if it handles function prototypes correctly.
919#
920# If you use this macro, you should check after calling it whether the C
921# compiler has been set to accept ANSI C; if not, the shell variable
922# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
923# code in ANSI C, you can make an un-ANSIfied copy of it by using the
924# program @code{ansi2knr}, which comes with Ghostscript.
925# @end defmac
926
927AC_DEFUN(AM_PROG_CC_STDC,
928[AC_REQUIRE([AC_PROG_CC])
929AC_BEFORE([$0], [AC_C_INLINE])
930AC_BEFORE([$0], [AC_C_CONST])
931dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
932dnl a magic option to avoid problems with ANSI preprocessor commands
933dnl like #elif.
934dnl FIXME: can't do this because then AC_AIX won't work due to a
935dnl circular dependency.
936dnl AC_BEFORE([$0], [AC_PROG_CPP])
937AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
938AC_CACHE_VAL(am_cv_prog_cc_stdc,
939[am_cv_prog_cc_stdc=no
940ac_save_CC="$CC"
941# Don't try gcc -ansi; that turns off useful extensions and
942# breaks some systems' header files.
943# AIX -qlanglvl=ansi
944# Ultrix and OSF/1 -std1
945# HP-UX -Aa -D_HPUX_SOURCE
946# SVR4 -Xc -D__EXTENSIONS__
947for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
948do
949 CC="$ac_save_CC $ac_arg"
950 AC_TRY_COMPILE(
951[#include <stdarg.h>
952#include <stdio.h>
953#include <sys/types.h>
954#include <sys/stat.h>
955/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
956struct buf { int x; };
957FILE * (*rcsopen) (struct buf *, struct stat *, int);
958static char *e (p, i)
959 char **p;
960 int i;
961{
962 return p[i];
963}
964static char *f (char * (*g) (char **, int), char **p, ...)
965{
966 char *s;
967 va_list v;
968 va_start (v,p);
969 s = g (p, va_arg (v,int));
970 va_end (v);
971 return s;
972}
973int test (int i, double x);
974struct s1 {int (*f) (int a);};
975struct s2 {int (*f) (double a);};
976int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
977int argc;
978char **argv;
979], [
980return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
981],
982[am_cv_prog_cc_stdc="$ac_arg"; break])
983done
984CC="$ac_save_CC"
985])
986if test -z "$am_cv_prog_cc_stdc"; then
987 AC_MSG_RESULT([none needed])
988else
989 AC_MSG_RESULT($am_cv_prog_cc_stdc)
990fi
991case "x$am_cv_prog_cc_stdc" in
992 x|xno) ;;
993 *) CC="$CC $am_cv_prog_cc_stdc" ;;
994esac
995])
996
539c89a1 997dnl Autoconf macros for configuring the QuickThreads package
3668b8c7
MD
998dnl Jim Blandy <jimb@red-bean.com> --- July 1998
999dnl
1000dnl Copyright (C) 1998 Free Software Foundation, Inc.
1001dnl
1002dnl This file is part of GUILE.
1003dnl
1004dnl GUILE is free software; you can redistribute it and/or modify
1005dnl it under the terms of the GNU General Public License as
1006dnl published by the Free Software Foundation; either version 2, or
1007dnl (at your option) any later version.
1008dnl
1009dnl GUILE is distributed in the hope that it will be useful, but
1010dnl WITHOUT ANY WARRANTY; without even the implied warranty of
1011dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1012dnl GNU General Public License for more details.
1013dnl
1014dnl You should have received a copy of the GNU General Public
1015dnl License along with GUILE; see the file COPYING. If not, write
1016dnl to the Free Software Foundation, Inc., 59 Temple Place, Suite
1017dnl 330, Boston, MA 02111-1307 USA
1018
1019
539c89a1
JB
1020
1021dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT
1022dnl sources should be in $srcdir/qt. If configuration succeeds, this
1023dnl macro creates the appropriate symlinks in the qt object directory,
1024dnl and sets the following variables, used in building libqthreads.a:
1025dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration
1026dnl succeeds, or the empty string if configuration fails.
47521807
JB
1027dnl qtmd_h, qtmds_s, qtmdc_c, qtdmdb_s --- the names of the machine-
1028dnl dependent source files.
1029dnl qthread_asflags --- flags to pass to the compiler when processing
1030dnl assembly-language files.
3a629497 1031dnl
539c89a1
JB
1032dnl It also sets the following variables, which describe how clients
1033dnl can link against libqthreads.a:
1034dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or
1035dnl the empty string if configuration fails.
1036dnl THREAD_CPPFLAGS --- set to `-I' flags for thread header files
1037dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree
1038dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
1039dnl is installed
1040dnl It would be nice if all thread configuration packages for Guile
1041dnl followed the same conventions.
3a629497 1042dnl
539c89a1
JB
1043dnl All of the above variables will be substituted into Makefiles in
1044dnl the usual autoconf fashion.
3a629497 1045dnl
539c89a1
JB
1046dnl We distinguish between THREAD_LIBS_LOCAL and
1047dnl THREAD_LIBS_INSTALLED because the thread library might be in
1048dnl this tree, and be built using libtool. This means that:
1049dnl 1) when building other executables in this tree, one must
1050dnl pass the relative path to the ../libfoo.la file, but
1051dnl 2) once the whole package has been installed, users should
1052dnl link using -lfoo.
1053dnl Normally, we only care about the first case, but since the
bcc695e3 1054dnl guile-config script needs to give users all the flags they need
539c89a1
JB
1055dnl to link programs against guile, the GUILE_WITH_THREADS macro
1056dnl needs to supply the second piece of information as well.
3a629497 1057dnl
539c89a1
JB
1058dnl This whole thing is a little confused about what ought to be
1059dnl done in the top-level configure script, and what ought to be
47521807 1060dnl taken care of in the subdirectory. For example, qtmds_s and
539c89a1
JB
1061dnl friends really ought not to be even mentioned in the top-level
1062dnl configure script, but here they are.
1063
1064AC_DEFUN([QTHREADS_CONFIGURE],[
7bc24529 1065 AC_REQUIRE([AC_PROG_LN_S])
539c89a1 1066
b8f08e26 1067 AC_MSG_CHECKING(QuickThreads configuration)
539c89a1
JB
1068 # How can we refer to the qt source directory from within the qt build
1069 # directory? For headers, we can rely on the fact that the qt src
1070 # directory appears in the #include path.
1071 qtsrcdir="`(cd $srcdir; pwd)`/qt"
1072
1073 changequote(,)dnl We use [ and ] in a regexp in the case
1074
1075 THREAD_PACKAGE=QT
47521807 1076 qthread_asflags=''
539c89a1
JB
1077 case "$host" in
1078 i[3456]86-*-*)
b8f08e26 1079 port_name=i386
539c89a1
JB
1080 qtmd_h=md/i386.h
1081 qtmds_s=md/i386.s
1082 qtmdc_c=md/null.c
1083 qtdmdb_s=
47521807
JB
1084 case "$host" in
1085 *-*-netbsd* )
1086 ## NetBSD needs to be told to pass the assembly code through
1087 ## the C preprocessor. Other GCC installations seem to do
1088 ## this by default, but NetBSD's doesn't. We could get the
1089 ## same effect by giving the file a name ending with .S
1090 ## instead of .s, but I don't see how to tell automake to do
1091 ## that.
1092 qthread_asflags='-x assembler-with-cpp'
1093 ;;
1094 esac
539c89a1
JB
1095 ;;
1096 mips-sgi-irix[56]*)
b8f08e26 1097 port_name=irix
539c89a1
JB
1098 qtmd_h=md/mips.h
1099 qtmds_s=md/mips-irix5.s
1100 qtmdc_c=md/null.c
1101 qtdmdb_s=md/mips_b.s
1102 ;;
1103 mips-*-*)
b8f08e26 1104 port_name=mips
539c89a1
JB
1105 qtmd_h=md/mips.h
1106 qtmds_s=md/mips.s
1107 qtmdc_c=md/null.c
1108 qtdmdb_s=md/mips_b.s
1109 ;;
1110 sparc-*-sunos*)
b8f08e26 1111 port_name=sparc-sunos
539c89a1
JB
1112 qtmd_h=md/sparc.h
1113 qtmds_s=md/_sparc.s
1114 qtmdc_c=md/null.c
1115 qtdmdb_s=md/_sparc_b.s
1116 ;;
1117 sparc-*-*)
b8f08e26 1118 port_name=sparc
539c89a1
JB
1119 qtmd_h=md/sparc.h
1120 qtmds_s=md/sparc.s
1121 qtmdc_c=md/null.c
1122 qtdmdb_s=md/sparc_b.s
1123 ;;
1124 alpha-*-*)
b8f08e26 1125 port_name=alpha
539c89a1
JB
1126 qtmd_h=md/axp.h
1127 qtmds_s=md/axp.s
1128 qtmdc_c=md/null.c
1129 qtdmdb_s=md/axp_b.s
1130 ;;
1131 *)
1132 echo "Unknown configuration; threads package disabled"
1133 THREAD_PACKAGE=""
1134 ;;
1135 esac
1136 changequote([, ])
1137
1138 # Did configuration succeed?
1139 if test -n "$THREAD_PACKAGE"; then
b8f08e26 1140 AC_MSG_RESULT($port_name)
539c89a1
JB
1141 QTHREAD_LTLIBS=libqthreads.la
1142 THREAD_CPPFLAGS="-I$qtsrcdir -I../qt"
1143 THREAD_LIBS_LOCAL="../qt/libqthreads.la"
1144 THREAD_LIBS_INSTALLED="-lqthreads"
b8f08e26
MD
1145 else
1146 AC_MSG_RESULT(none; disabled)
3a629497 1147 fi
539c89a1
JB
1148
1149 AC_SUBST(QTHREAD_LTLIBS)
1150 AC_SUBST(qtmd_h)
1151 AC_SUBST(qtmds_s)
1152 AC_SUBST(qtmdc_c)
1153 AC_SUBST(qtdmdb_s)
47521807 1154 AC_SUBST(qthread_asflags)
539c89a1
JB
1155 AC_SUBST(THREAD_PACKAGE)
1156 AC_SUBST(THREAD_CPPFLAGS)
1157 AC_SUBST(THREAD_LIBS_LOCAL)
1158 AC_SUBST(THREAD_LIBS_INSTALLED)
3a629497
JB
1159])
1160