mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
Clean up thread configuration.
* qthreads.m4: New file, which knows how to configure the qthreads library. * configure.in: Replace all thread package selection code. Do the --with-threads argument processing here. Enable the appropriate thread interface files in libguile. Remove all qthreads configuration code; call QTHREADS_CONFIGURE instead. Set GUILE_LIBS using the info provided by QTHREADS_CONFIGURE. * threads.m4: Removed; not used any more. * Makefile.am (aclocal_DATA): Mention qthreads.m4, not threads.m4. * Makefile.in, aclocal.m4, configure: Rgnrtd. (Sv th vwls!) Note that these were regenerated with the tools available from Cygnus's source tree, which have patches not available to the general public. I'm not sure this was a good idea; feel free to revert them to the latest released versions of the tools.
This commit is contained in:
parent
c789ad32a7
commit
539c89a1ca
7 changed files with 975 additions and 774 deletions
|
@ -5,7 +5,7 @@ SUBDIRS = ice-9 qt libguile build
|
|||
## FIXME: in the future there will be direct automake support for
|
||||
## doing this. When that happens, switch over.
|
||||
aclocaldir = $(datadir)/aclocal
|
||||
aclocal_DATA = guile.m4 threads.m4
|
||||
aclocal_DATA = guile.m4 qthreads.m4
|
||||
|
||||
EXTRA_DIST = $(aclocal_DATA) ltconfig ltmain.sh acconfig.h \
|
||||
HACKING GUILE-VERSION
|
||||
|
|
17
Makefile.in
17
Makefile.in
|
@ -11,7 +11,7 @@
|
|||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
@ -59,9 +59,11 @@ PRE_UNINSTALL = :
|
|||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GUILE_LIBS = @GUILE_LIBS@
|
||||
GUILE_MAJOR_VERSION = @GUILE_MAJOR_VERSION@
|
||||
GUILE_MINOR_VERSION = @GUILE_MINOR_VERSION@
|
||||
|
@ -76,21 +78,22 @@ MAKEINFO = @MAKEINFO@
|
|||
NM = @NM@
|
||||
PACKAGE = @PACKAGE@
|
||||
PROG_HOSTNAME = @PROG_HOSTNAME@
|
||||
QTHREAD_LTLIBS = @QTHREAD_LTLIBS@
|
||||
RANLIB = @RANLIB@
|
||||
THREAD_LIBS = @THREAD_LIBS@
|
||||
THREAD_CPPFLAGS = @THREAD_CPPFLAGS@
|
||||
THREAD_LIBS_INSTALLED = @THREAD_LIBS_INSTALLED@
|
||||
THREAD_LIBS_LOCAL = @THREAD_LIBS_LOCAL@
|
||||
THREAD_PACKAGE = @THREAD_PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
qtdmdb_s = @qtdmdb_s@
|
||||
qtmd_h = @qtmd_h@
|
||||
qtmdb_s = @qtmdb_s@
|
||||
qtmdc_c = @qtmdc_c@
|
||||
qtmdc_o = @qtmdc_o@
|
||||
qtmds_o = @qtmds_o@
|
||||
qtmds_s = @qtmds_s@
|
||||
target_libs = @target_libs@
|
||||
|
||||
SUBDIRS = ice-9 qt libguile build
|
||||
|
||||
aclocaldir = $(datadir)/aclocal
|
||||
aclocal_DATA = guile.m4 threads.m4
|
||||
aclocal_DATA = guile.m4 qthreads.m4
|
||||
|
||||
EXTRA_DIST = $(aclocal_DATA) ltconfig ltmain.sh acconfig.h \
|
||||
HACKING GUILE-VERSION
|
||||
|
|
253
aclocal.m4
vendored
253
aclocal.m4
vendored
|
@ -302,11 +302,12 @@ done<<>>dnl>>)
|
|||
changequote([,]))])
|
||||
|
||||
|
||||
# serial 24 AM_PROG_LIBTOOL
|
||||
# serial 25 AM_PROG_LIBTOOL
|
||||
AC_DEFUN(AM_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AM_ENABLE_SHARED])dnl
|
||||
AC_REQUIRE([AM_ENABLE_STATIC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AM_PROG_LD])dnl
|
||||
|
@ -351,14 +352,24 @@ case "$host" in
|
|||
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
||||
CFLAGS="$CFLAGS -belf"
|
||||
;;
|
||||
|
||||
*-*-cygwin32*)
|
||||
AM_SYS_LIBTOOL_CYGWIN32
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
|
||||
DLLTOOL="$DLLTOOL" AS="$AS" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
|
||||
# Redirect the config.log output again, so that the ltconfig log is not
|
||||
# clobbered by the next message.
|
||||
exec 5>>./config.log
|
||||
])
|
||||
|
||||
# AM_ENABLE_SHARED - implement the --enable-shared flag
|
||||
|
@ -369,10 +380,8 @@ AC_DEFUN(AM_ENABLE_SHARED,
|
|||
[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(shared,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
|
||||
<< --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[ --enable-shared=PKGS only build shared libraries if the current package
|
||||
appears as an element in the PKGS list],
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_shared=yes ;;
|
||||
|
@ -408,10 +417,8 @@ AC_DEFUN(AM_ENABLE_STATIC,
|
|||
[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(static,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
|
||||
<< --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[ --enable-static=PKGS only build shared libraries if the current package
|
||||
appears as an element in the PKGS list],
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_static=yes ;;
|
||||
|
@ -445,7 +452,9 @@ if test "$ac_cv_prog_gcc" = yes; then
|
|||
ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
||||
case "$ac_prog" in
|
||||
# Accept absolute paths.
|
||||
changequote(,)dnl
|
||||
/* | [A-Za-z]:\\*)
|
||||
changequote([,])dnl
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
|
@ -508,11 +517,10 @@ fi])
|
|||
AC_DEFUN(AM_PROG_NM,
|
||||
[AC_MSG_CHECKING([for BSD-compatible nm])
|
||||
AC_CACHE_VAL(ac_cv_path_NM,
|
||||
[case "$NM" in
|
||||
/* | [A-Za-z]:\\*)
|
||||
ac_cv_path_NM="$NM" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
[if test -n "$NM"; then
|
||||
# Let the user override the test.
|
||||
ac_cv_path_NM="$NM"
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
|
@ -532,112 +540,137 @@ AC_CACHE_VAL(ac_cv_path_NM,
|
|||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
||||
;;
|
||||
esac])
|
||||
fi])
|
||||
NM="$ac_cv_path_NM"
|
||||
AC_MSG_RESULT([$NM])
|
||||
AC_SUBST(NM)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl CY_AC_WITH_THREADS determines which thread library the user intends
|
||||
dnl to put underneath guile. Pass it the path to find the guile top-level
|
||||
dnl source directory. Eg CY_AC_WITH_THREADS(../..) for tcl/unix.
|
||||
dnl
|
||||
# AM_SYS_LIBTOOL_CYGWIN32 - find tools needed on cygwin32
|
||||
AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN32,
|
||||
[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
])
|
||||
|
||||
AC_DEFUN([CY_AC_WITH_THREADS],[
|
||||
AC_CACHE_CHECK("threads package type",cy_cv_threads_package,[
|
||||
AC_CACHE_VAL(cy_cv_threads_cflags,[
|
||||
AC_CACHE_VAL(cy_cv_threads_libs,[
|
||||
use_threads=no;
|
||||
AC_ARG_WITH(threads,[ --with-threads thread interface],
|
||||
use_threads=$withval, use_threads=no)
|
||||
test -n "$use_threads" || use_threads=qt
|
||||
threads_package=unknown
|
||||
if test "$use_threads" != no; then
|
||||
dnl Autoconf macros for configuring the QuickThreads package
|
||||
|
||||
dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT
|
||||
dnl sources should be in $srcdir/qt. If configuration succeeds, this
|
||||
dnl macro creates the appropriate symlinks in the qt object directory,
|
||||
dnl and sets the following variables, used in building libqthreads.a:
|
||||
dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration
|
||||
dnl succeeds, or the empty string if configuration fails.
|
||||
dnl qtmd_h --- the name of the machine-dependent header file.
|
||||
dnl
|
||||
dnl Test for the qt threads package - used for cooperative threads
|
||||
dnl This may not necessarily be built yet - so just check for the
|
||||
dnl header files.
|
||||
dnl It also sets the following variables, which describe how clients
|
||||
dnl can link against libqthreads.a:
|
||||
dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or
|
||||
dnl the empty string if configuration fails.
|
||||
dnl THREAD_CPPFLAGS --- set to `-I' flags for thread header files
|
||||
dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree
|
||||
dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
|
||||
dnl is installed
|
||||
dnl It would be nice if all thread configuration packages for Guile
|
||||
dnl followed the same conventions.
|
||||
dnl
|
||||
if test "$use_threads" = yes || test "$use_threads" = qt; then
|
||||
# Look for qt in source directory.
|
||||
if test -f $srcdir/qt/qt.c; then
|
||||
dnl All of the above variables will be substituted into Makefiles in
|
||||
dnl the usual autoconf fashion.
|
||||
dnl
|
||||
dnl We distinguish between THREAD_LIBS_LOCAL and
|
||||
dnl THREAD_LIBS_INSTALLED because the thread library might be in
|
||||
dnl this tree, and be built using libtool. This means that:
|
||||
dnl 1) when building other executables in this tree, one must
|
||||
dnl pass the relative path to the ../libfoo.la file, but
|
||||
dnl 2) once the whole package has been installed, users should
|
||||
dnl link using -lfoo.
|
||||
dnl Normally, we only care about the first case, but since the
|
||||
dnl build-guile script needs to give users all the flags they need
|
||||
dnl to link programs against guile, the GUILE_WITH_THREADS macro
|
||||
dnl needs to supply the second piece of information as well.
|
||||
dnl
|
||||
dnl This whole thing is a little confused about what ought to be
|
||||
dnl done in the top-level configure script, and what ought to be
|
||||
dnl taken care of in the subdirectory. For example, qtmdc_lo and
|
||||
dnl friends really ought not to be even mentioned in the top-level
|
||||
dnl configure script, but here they are.
|
||||
|
||||
AC_DEFUN([QTHREADS_CONFIGURE],[
|
||||
|
||||
# For some reason, AC_REQUIRE doesn't seem to work with the aclocal
|
||||
# program. So we'll just do this runtime check.
|
||||
if test "${LN_S}" = ""; then
|
||||
f=''
|
||||
AC_MSG_ERROR(The QTHREADS${f}_CONFIGURE macro requires A${f}C_PROG_LN_S)
|
||||
fi
|
||||
|
||||
# How can we refer to the qt source directory from within the qt build
|
||||
# directory? For headers, we can rely on the fact that the qt src
|
||||
# directory appears in the #include path.
|
||||
qtsrcdir="`(cd $srcdir; pwd)`/qt"
|
||||
threads_package=COOP
|
||||
cy_cv_threads_cflags="-I$qtsrcdir -I../qt"
|
||||
cy_cv_threads_libs="../qt/libqthreads.a"
|
||||
|
||||
changequote(,)dnl We use [ and ] in a regexp in the case
|
||||
|
||||
THREAD_PACKAGE=QT
|
||||
case "$host" in
|
||||
i[3456]86-*-*)
|
||||
qtmd_h=md/i386.h
|
||||
qtmds_s=md/i386.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=
|
||||
;;
|
||||
mips-sgi-irix[56]*)
|
||||
qtmd_h=md/mips.h
|
||||
qtmds_s=md/mips-irix5.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=md/mips_b.s
|
||||
;;
|
||||
mips-*-*)
|
||||
qtmd_h=md/mips.h
|
||||
qtmds_s=md/mips.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=md/mips_b.s
|
||||
;;
|
||||
sparc-*-sunos*)
|
||||
qtmd_h=md/sparc.h
|
||||
qtmds_s=md/_sparc.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=md/_sparc_b.s
|
||||
;;
|
||||
sparc-*-*)
|
||||
qtmd_h=md/sparc.h
|
||||
qtmds_s=md/sparc.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=md/sparc_b.s
|
||||
;;
|
||||
alpha-*-*)
|
||||
qtmd_h=md/axp.h
|
||||
qtmds_s=md/axp.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=md/axp_b.s
|
||||
;;
|
||||
*)
|
||||
echo "Unknown configuration; threads package disabled"
|
||||
THREAD_PACKAGE=""
|
||||
;;
|
||||
esac
|
||||
changequote([, ])
|
||||
|
||||
# Did configuration succeed?
|
||||
if test -n "$THREAD_PACKAGE"; then
|
||||
QTHREAD_LTLIBS=libqthreads.la
|
||||
THREAD_CPPFLAGS="-I$qtsrcdir -I../qt"
|
||||
THREAD_LIBS_LOCAL="../qt/libqthreads.la"
|
||||
THREAD_LIBS_INSTALLED="-lqthreads"
|
||||
fi
|
||||
else
|
||||
if test -f $use_threads/qt.c; then
|
||||
# FIXME seems as though we should try to use an installed qt here.
|
||||
threads_package=COOP
|
||||
cy_cv_threads_cflags="-I$use_threads -I../qt"
|
||||
cy_cv_threads_libs="../qt/libqthreads.a"
|
||||
fi
|
||||
fi
|
||||
if test "$use_threads" = pthreads; then
|
||||
# Look for pthreads in srcdir. See above to understand why
|
||||
# we always set threads_package.
|
||||
if test -f $srcdir/../../pthreads/pthreads/queue.c \
|
||||
|| test -f $srcdir/../pthreads/pthreads/queue.c; then
|
||||
threads_package=MIT
|
||||
cy_cv_threads_cflags="-I$srcdir/../../pthreads/include"
|
||||
cy_cv_threads_libs="-L../../pthreads/lib -lpthread"
|
||||
fi
|
||||
fi
|
||||
saved_CPP="$CPPFLAGS"
|
||||
saved_LD="$LDFLAGS"
|
||||
saved_LIBS="$LIBS"
|
||||
if test "$threads_package" = unknown; then
|
||||
dnl
|
||||
dnl Test for the FSU threads package
|
||||
dnl
|
||||
CPPFLAGS="-I$use_threads/include"
|
||||
LDFLAGS="-L$use_threads/lib"
|
||||
LIBS="-lgthreads -lmalloc"
|
||||
AC_TRY_LINK([#include <pthread.h>],[
|
||||
pthread_equal(NULL,NULL);
|
||||
], threads_package=FSU)
|
||||
fi
|
||||
if test "$threads_package" = unknown; then
|
||||
dnl
|
||||
dnl Test for the MIT threads package
|
||||
dnl
|
||||
LIBS="-lpthread"
|
||||
AC_TRY_LINK([#include <pthread.h>],[
|
||||
pthread_equal(NULL,NULL);
|
||||
], threads_package=MIT)
|
||||
fi
|
||||
if test "$threads_package" = unknown; then
|
||||
dnl
|
||||
dnl Test for the PCthreads package
|
||||
dnl
|
||||
LIBS="-lpthreads"
|
||||
AC_TRY_LINK([#include <pthread.h>],[
|
||||
pthread_equal(NULL,NULL);
|
||||
], threads_package=PCthreads)
|
||||
fi
|
||||
dnl
|
||||
dnl Set the appropriate flags!
|
||||
dnl
|
||||
cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags"
|
||||
cy_cv_threads_package=$threads_package
|
||||
CPPFLAGS="$saved_CPP"
|
||||
LDFLAGS="$saved_LD"
|
||||
LIBS="$saved_LIBS"
|
||||
if test "$threads_package" = unknown; then
|
||||
AC_MSG_ERROR("cannot find thread library installation")
|
||||
fi
|
||||
fi
|
||||
])
|
||||
])
|
||||
],
|
||||
dnl
|
||||
dnl Set flags according to what is cached.
|
||||
dnl
|
||||
CPPFLAGS="$cy_cv_threads_cflags"
|
||||
LIBS="$cy_cv_threads_libs"
|
||||
)
|
||||
|
||||
AC_SUBST(QTHREAD_LTLIBS)
|
||||
AC_SUBST(qtmd_h)
|
||||
AC_SUBST(qtmds_s)
|
||||
AC_SUBST(qtmdc_c)
|
||||
AC_SUBST(qtdmdb_s)
|
||||
AC_SUBST(THREAD_PACKAGE)
|
||||
AC_SUBST(THREAD_CPPFLAGS)
|
||||
AC_SUBST(THREAD_LIBS_LOCAL)
|
||||
AC_SUBST(THREAD_LIBS_INSTALLED)
|
||||
])
|
||||
|
||||
|
|
162
configure.in
162
configure.in
|
@ -328,46 +328,58 @@ fi
|
|||
#
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
CY_AC_WITH_THREADS
|
||||
CFLAGS="$CFLAGS $cy_cv_threads_cflags"
|
||||
THREAD_LIBS="$cy_cv_threads_libs"
|
||||
AC_SUBST(THREAD_LIBS)
|
||||
### What thread package has the user asked for?
|
||||
AC_ARG_WITH(threads, [ --with-threads thread interface],
|
||||
, with_threads=no)
|
||||
|
||||
dnl
|
||||
dnl Set the appropriate flags!
|
||||
dnl
|
||||
if test "$cy_cv_threads_package" = FSU; then
|
||||
AC_DEFINE(USE_FSU_PTHREADS, 1)
|
||||
else if test "$cy_cv_threads_package" = COOP; then
|
||||
AC_DEFINE(USE_COOP_THREADS, 1)
|
||||
else if test "$cy_cv_threads_package" = MIT; then
|
||||
AC_DEFINE(USE_MIT_PTHREADS, 1)
|
||||
else if test "$cy_cv_threads_package" = PCthreads; then
|
||||
AC_DEFINE(USE_PCTHREADS_PTHREADS, 1)
|
||||
else if test "$cy_cv_threads_package" = unknown; then
|
||||
AC_MSG_ERROR("cannot find threads installation")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
### Turn $with_threads into either the name of a threads package, like
|
||||
### `qt', or `no', meaning that threads should not be supported.
|
||||
case "$with_threads" in
|
||||
"yes" | "qt" | "coop" | "")
|
||||
with_threads=qt
|
||||
;;
|
||||
"no" )
|
||||
;;
|
||||
* )
|
||||
AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$cy_cv_threads_package" != ""; then
|
||||
AC_DEFINE(USE_THREADS)
|
||||
## Make sure the threads package we've chosen is actually supported on
|
||||
## the present platform.
|
||||
case "${with_threads}" in
|
||||
"qt" )
|
||||
## This configures the QuickThreads package, and sets or clears
|
||||
## the THREAD_PACKAGE variable if qthreads don't configure
|
||||
## correctly.
|
||||
QTHREADS_CONFIGURE
|
||||
;;
|
||||
esac
|
||||
|
||||
## If we're using threads, bring in some other parts of Guile which
|
||||
## work with them.
|
||||
if test "${THREAD_PACKAGE}" != "" ; then
|
||||
AC_DEFINE(USE_THREADS, 1)
|
||||
|
||||
## Include the Guile thread interface in the library...
|
||||
LIBOBJS="$LIBOBJS threads.o"
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
#
|
||||
# scm_internal_select
|
||||
#
|
||||
#--------------------------------------------------------------------
|
||||
## ... and tell it which package to talk to.
|
||||
case "${THREAD_PACKAGE}" in
|
||||
"QT" )
|
||||
AC_DEFINE(USE_COOP_THREADS, 1)
|
||||
;;
|
||||
* )
|
||||
AC_MSG_ERROR(invalid value for THREAD_PACKAGE: ${THREAD_PACKAGE})
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$cy_cv_threads_package" != "" &&
|
||||
test $ac_cv_func_gettimeofday = yes &&
|
||||
## Bring in scm_internal_select, if appropriate.
|
||||
if test $ac_cv_func_gettimeofday = yes &&
|
||||
test $ac_cv_func_select = yes; then
|
||||
AC_DEFINE(GUILE_ISELECT, 1)
|
||||
LIBOBJS="$LIBOBJS iselect.o"
|
||||
AC_DEFINE(GUILE_ISELECT, 1)
|
||||
fi
|
||||
fi
|
||||
|
||||
## If we're using GCC, ask for aggressive warnings.
|
||||
|
@ -385,7 +397,9 @@ LIBLOBJS="`echo ${LIBOBJS} | sed 's/\.o/.lo/g'`"
|
|||
AC_SUBST(GUILE_MAJOR_VERSION)
|
||||
AC_SUBST(GUILE_MINOR_VERSION)
|
||||
AC_SUBST(GUILE_VERSION)
|
||||
GUILE_LIBS="$LDFLAGS $THREAD_LIBS $LIBS"
|
||||
|
||||
dnl Tell build-guile what flags guile users should link against.
|
||||
GUILE_LIBS="$LDFLAGS $THREAD_LIBS_INSTALLED $LIBS"
|
||||
AC_SUBST(GUILE_LIBS)
|
||||
|
||||
dnl timestamping the interpreter and scheme libraries:
|
||||
|
@ -402,86 +416,6 @@ AC_SUBST(GUILE_STAMP)
|
|||
AC_SUBST(AWK)
|
||||
AC_SUBST(LIBLOBJS)
|
||||
|
||||
|
||||
dnl ======================================================================
|
||||
dnl configuration for the Qt package
|
||||
dnl ======================================================================
|
||||
|
||||
threads_enabled=false
|
||||
if test "$cy_cv_threads_package" = COOP; then
|
||||
threads_enabled=true
|
||||
fi
|
||||
|
||||
# How can we refer to the qt source directory from within the qt build
|
||||
# directory? For headers, we can rely on the fact that the qt src
|
||||
# directory appears in the #include path.
|
||||
|
||||
qtsrcdir="`(cd $srcdir; pwd)`/qt"
|
||||
|
||||
changequote(,)dnl We use [ and ] in a regexp in the case
|
||||
case "$host" in
|
||||
i[3456]86-*-*)
|
||||
qtmds_s=$qtsrcdir/md/i386.s
|
||||
qtmd_h=md/i386.h
|
||||
qtmdc_c=$qtsrcdir/md/null.c
|
||||
;;
|
||||
mips-sgi-irix[56]*)
|
||||
qtmds_s=$qtsrcdir/md/mips-irix5.s
|
||||
qtmd_h=md/mips.h
|
||||
qtmdc_c=$qtsrcdir/md/null.c
|
||||
qtdmdb_s=$qtsrcdir/md/mips_b.s
|
||||
;;
|
||||
mips-*-*)
|
||||
qtmds_s=$qtsrcdir/md/mips.s
|
||||
qtmd_h=md/mips.h
|
||||
qtmdc_c=$qtsrcdir/md/null.c
|
||||
qtdmdb_s=$qtsrcdir/md/mips_b.s
|
||||
;;
|
||||
sparc-*-sunos*)
|
||||
qtmd_h=md/sparc.h
|
||||
qtmdc_c=$qtsrcdir/md/null.c
|
||||
qtmds_s=$qtsrcdir/md/_sparc.s
|
||||
qtdmdb_s=$qtsrcdir/md/_sparc_b.s
|
||||
;;
|
||||
sparc-*-*)
|
||||
qtmd_h=md/sparc.h
|
||||
qtmdc_c=$qtsrcdir/md/null.c
|
||||
qtmds_s=$qtsrcdir/md/sparc.s
|
||||
qtdmdb_s=$qtsrcdir/md/sparc_b.s
|
||||
;;
|
||||
alpha-*-*)
|
||||
qtmd_h=md/axp.h
|
||||
qtmdc_c=$qtsrcdir/md/null.c
|
||||
qtmds_s=$qtsrcdir/md/axp.s
|
||||
qtdmdb_s=$qtsrcdir/md/axp_b.s
|
||||
;;
|
||||
*)
|
||||
echo "Unknown configuration; threads package disabled"
|
||||
threads_enabled=false
|
||||
;;
|
||||
esac
|
||||
changequote([, ])
|
||||
|
||||
|
||||
if $threads_enabled; then
|
||||
target_libs=libqthreads.a
|
||||
else
|
||||
target_libs=
|
||||
fi
|
||||
|
||||
# Give the Makefile the names of the object files that will be
|
||||
# generated by compiling $qtmdc_c and $qtmds_s.
|
||||
qtmdc_o="`echo ${qtmdc_c} | sed -e 's:^.*/::' | sed -e 's:\.c$:\.o:'`"
|
||||
qtmds_o="`echo ${qtmds_s} | sed -e 's:^.*/::' | sed -e 's:\.s$:\.o:'`"
|
||||
|
||||
AC_SUBST(target_libs)
|
||||
AC_SUBST(qtmd_h)
|
||||
AC_SUBST(qtmdc_c)
|
||||
AC_SUBST(qtmdc_o)
|
||||
AC_SUBST(qtmds_s)
|
||||
AC_SUBST(qtmds_o)
|
||||
AC_SUBST(qtmdb_s)
|
||||
|
||||
AC_OUTPUT([Makefile libguile/Makefile libguile/guile-snarf ice-9/Makefile ice-9/version.scm qt/Makefile qt/qt.h qt/md/Makefile qt/time/Makefile build/Makefile], [chmod +x libguile/guile-snarf])
|
||||
|
||||
dnl Local Variables:
|
||||
|
|
121
qthreads.m4
Normal file
121
qthreads.m4
Normal file
|
@ -0,0 +1,121 @@
|
|||
dnl Autoconf macros for configuring the QuickThreads package
|
||||
|
||||
dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT
|
||||
dnl sources should be in $srcdir/qt. If configuration succeeds, this
|
||||
dnl macro creates the appropriate symlinks in the qt object directory,
|
||||
dnl and sets the following variables, used in building libqthreads.a:
|
||||
dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration
|
||||
dnl succeeds, or the empty string if configuration fails.
|
||||
dnl qtmd_h --- the name of the machine-dependent header file.
|
||||
dnl
|
||||
dnl It also sets the following variables, which describe how clients
|
||||
dnl can link against libqthreads.a:
|
||||
dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or
|
||||
dnl the empty string if configuration fails.
|
||||
dnl THREAD_CPPFLAGS --- set to `-I' flags for thread header files
|
||||
dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree
|
||||
dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
|
||||
dnl is installed
|
||||
dnl It would be nice if all thread configuration packages for Guile
|
||||
dnl followed the same conventions.
|
||||
dnl
|
||||
dnl All of the above variables will be substituted into Makefiles in
|
||||
dnl the usual autoconf fashion.
|
||||
dnl
|
||||
dnl We distinguish between THREAD_LIBS_LOCAL and
|
||||
dnl THREAD_LIBS_INSTALLED because the thread library might be in
|
||||
dnl this tree, and be built using libtool. This means that:
|
||||
dnl 1) when building other executables in this tree, one must
|
||||
dnl pass the relative path to the ../libfoo.la file, but
|
||||
dnl 2) once the whole package has been installed, users should
|
||||
dnl link using -lfoo.
|
||||
dnl Normally, we only care about the first case, but since the
|
||||
dnl build-guile script needs to give users all the flags they need
|
||||
dnl to link programs against guile, the GUILE_WITH_THREADS macro
|
||||
dnl needs to supply the second piece of information as well.
|
||||
dnl
|
||||
dnl This whole thing is a little confused about what ought to be
|
||||
dnl done in the top-level configure script, and what ought to be
|
||||
dnl taken care of in the subdirectory. For example, qtmdc_lo and
|
||||
dnl friends really ought not to be even mentioned in the top-level
|
||||
dnl configure script, but here they are.
|
||||
|
||||
AC_DEFUN([QTHREADS_CONFIGURE],[
|
||||
|
||||
# For some reason, AC_REQUIRE doesn't seem to work with the aclocal
|
||||
# program. So we'll just do this runtime check.
|
||||
if test "${LN_S}" = ""; then
|
||||
f=''
|
||||
AC_MSG_ERROR(The QTHREADS${f}_CONFIGURE macro requires A${f}C_PROG_LN_S)
|
||||
fi
|
||||
|
||||
# How can we refer to the qt source directory from within the qt build
|
||||
# directory? For headers, we can rely on the fact that the qt src
|
||||
# directory appears in the #include path.
|
||||
qtsrcdir="`(cd $srcdir; pwd)`/qt"
|
||||
|
||||
changequote(,)dnl We use [ and ] in a regexp in the case
|
||||
|
||||
THREAD_PACKAGE=QT
|
||||
case "$host" in
|
||||
i[3456]86-*-*)
|
||||
qtmd_h=md/i386.h
|
||||
qtmds_s=md/i386.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=
|
||||
;;
|
||||
mips-sgi-irix[56]*)
|
||||
qtmd_h=md/mips.h
|
||||
qtmds_s=md/mips-irix5.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=md/mips_b.s
|
||||
;;
|
||||
mips-*-*)
|
||||
qtmd_h=md/mips.h
|
||||
qtmds_s=md/mips.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=md/mips_b.s
|
||||
;;
|
||||
sparc-*-sunos*)
|
||||
qtmd_h=md/sparc.h
|
||||
qtmds_s=md/_sparc.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=md/_sparc_b.s
|
||||
;;
|
||||
sparc-*-*)
|
||||
qtmd_h=md/sparc.h
|
||||
qtmds_s=md/sparc.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=md/sparc_b.s
|
||||
;;
|
||||
alpha-*-*)
|
||||
qtmd_h=md/axp.h
|
||||
qtmds_s=md/axp.s
|
||||
qtmdc_c=md/null.c
|
||||
qtdmdb_s=md/axp_b.s
|
||||
;;
|
||||
*)
|
||||
echo "Unknown configuration; threads package disabled"
|
||||
THREAD_PACKAGE=""
|
||||
;;
|
||||
esac
|
||||
changequote([, ])
|
||||
|
||||
# Did configuration succeed?
|
||||
if test -n "$THREAD_PACKAGE"; then
|
||||
QTHREAD_LTLIBS=libqthreads.la
|
||||
THREAD_CPPFLAGS="-I$qtsrcdir -I../qt"
|
||||
THREAD_LIBS_LOCAL="../qt/libqthreads.la"
|
||||
THREAD_LIBS_INSTALLED="-lqthreads"
|
||||
fi
|
||||
|
||||
AC_SUBST(QTHREAD_LTLIBS)
|
||||
AC_SUBST(qtmd_h)
|
||||
AC_SUBST(qtmds_s)
|
||||
AC_SUBST(qtmdc_c)
|
||||
AC_SUBST(qtdmdb_s)
|
||||
AC_SUBST(THREAD_PACKAGE)
|
||||
AC_SUBST(THREAD_CPPFLAGS)
|
||||
AC_SUBST(THREAD_LIBS_LOCAL)
|
||||
AC_SUBST(THREAD_LIBS_INSTALLED)
|
||||
])
|
Loading…
Add table
Add a link
Reference in a new issue