1 dnl Autoconf macros for configuring the QuickThreads package
3 dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT
4 dnl sources should be in $srcdir/qt. If configuration succeeds, this
5 dnl macro creates the appropriate symlinks in the qt object directory,
6 dnl and sets the following variables, used in building libqthreads.a:
7 dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration
8 dnl succeeds, or the empty string if configuration fails.
9 dnl qtmd_h, qtmds_s, qtmdc_c, qtdmdb_s --- the names of the machine-
10 dnl dependent source files.
11 dnl qthread_asflags --- flags to pass to the compiler when processing
12 dnl assembly-language files.
14 dnl It also sets the following variables, which describe how clients
15 dnl can link against libqthreads.a:
16 dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or
17 dnl the empty string if configuration fails.
18 dnl THREAD_CPPFLAGS --- set to `-I' flags for thread header files
19 dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree
20 dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
22 dnl It would be nice if all thread configuration packages for Guile
23 dnl followed the same conventions.
25 dnl All of the above variables will be substituted into Makefiles in
26 dnl the usual autoconf fashion.
28 dnl We distinguish between THREAD_LIBS_LOCAL and
29 dnl THREAD_LIBS_INSTALLED because the thread library might be in
30 dnl this tree, and be built using libtool. This means that:
31 dnl 1) when building other executables in this tree, one must
32 dnl pass the relative path to the ../libfoo.la file, but
33 dnl 2) once the whole package has been installed, users should
35 dnl Normally, we only care about the first case, but since the
36 dnl guile-config script needs to give users all the flags they need
37 dnl to link programs against guile, the GUILE_WITH_THREADS macro
38 dnl needs to supply the second piece of information as well.
40 dnl This whole thing is a little confused about what ought to be
41 dnl done in the top-level configure script, and what ought to be
42 dnl taken care of in the subdirectory. For example, qtmds_s and
43 dnl friends really ought not to be even mentioned in the top-level
44 dnl configure script, but here they are.
46 AC_DEFUN([QTHREADS_CONFIGURE],[
47 AC_REQUIRE([AC_PROG_LN_S])
49 AC_MSG_CHECKING(QuickThreads configuration)
50 # How can we refer to the qt source directory from within the qt build
51 # directory? For headers, we can rely on the fact that the qt src
52 # directory appears in the #include path.
53 qtsrcdir="`(cd $srcdir; pwd)`/qt"
55 changequote(,)dnl We use [ and ] in a regexp in the case
68 ## NetBSD needs to be told to pass the assembly code through
69 ## the C preprocessor. Other GCC installations seem to do
70 ## this by default, but NetBSD's doesn't. We could get the
71 ## same effect by giving the file a name ending with .S
72 ## instead of .s, but I don't see how to tell automake to do
74 qthread_asflags='-x assembler-with-cpp'
81 qtmds_s=md/mips-irix5.s
97 qtdmdb_s=md/_sparc_b.s
104 qtdmdb_s=md/sparc_b.s
114 echo "Unknown configuration; threads package disabled"
120 # Did configuration succeed?
121 if test -n "$THREAD_PACKAGE"; then
122 AC_MSG_RESULT($port_name)
123 QTHREAD_LTLIBS=libqthreads.la
124 THREAD_CPPFLAGS="-I$qtsrcdir -I../qt"
125 THREAD_LIBS_LOCAL="../qt/libqthreads.la"
126 THREAD_LIBS_INSTALLED="-lqthreads"
128 AC_MSG_RESULT(none; disabled)
131 AC_SUBST(QTHREAD_LTLIBS)
136 AC_SUBST(qthread_asflags)
137 AC_SUBST(THREAD_PACKAGE)
138 AC_SUBST(THREAD_CPPFLAGS)
139 AC_SUBST(THREAD_LIBS_LOCAL)
140 AC_SUBST(THREAD_LIBS_INSTALLED)