*** empty log message ***
[bpt/guile.git] / qthreads.m4
CommitLineData
539c89a1 1dnl Autoconf macros for configuring the QuickThreads package
50848747
JB
2dnl Jim Blandy <jimb@red-bean.com> --- July 1998
3dnl
1630ea6c 4dnl Copyright (C) 1998, 1999 Free Software Foundation, Inc.
50848747
JB
5dnl
6dnl This file is part of GUILE.
7dnl
8dnl GUILE is free software; you can redistribute it and/or modify
9dnl it under the terms of the GNU General Public License as
10dnl published by the Free Software Foundation; either version 2, or
11dnl (at your option) any later version.
12dnl
13dnl GUILE is distributed in the hope that it will be useful, but
14dnl WITHOUT ANY WARRANTY; without even the implied warranty of
15dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16dnl GNU General Public License for more details.
17dnl
18dnl You should have received a copy of the GNU General Public
19dnl License along with GUILE; see the file COPYING. If not, write
20dnl to the Free Software Foundation, Inc., 59 Temple Place, Suite
21dnl 330, Boston, MA 02111-1307 USA
22
23
539c89a1
JB
24
25dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT
26dnl sources should be in $srcdir/qt. If configuration succeeds, this
27dnl macro creates the appropriate symlinks in the qt object directory,
28dnl and sets the following variables, used in building libqthreads.a:
29dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration
30dnl succeeds, or the empty string if configuration fails.
47521807
JB
31dnl qtmd_h, qtmds_s, qtmdc_c, qtdmdb_s --- the names of the machine-
32dnl dependent source files.
33dnl qthread_asflags --- flags to pass to the compiler when processing
34dnl assembly-language files.
539c89a1
JB
35dnl
36dnl It also sets the following variables, which describe how clients
37dnl can link against libqthreads.a:
38dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or
39dnl the empty string if configuration fails.
40dnl THREAD_CPPFLAGS --- set to `-I' flags for thread header files
41dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree
42dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
43dnl is installed
44dnl It would be nice if all thread configuration packages for Guile
45dnl followed the same conventions.
46dnl
47dnl All of the above variables will be substituted into Makefiles in
48dnl the usual autoconf fashion.
49dnl
50dnl We distinguish between THREAD_LIBS_LOCAL and
51dnl THREAD_LIBS_INSTALLED because the thread library might be in
52dnl this tree, and be built using libtool. This means that:
53dnl 1) when building other executables in this tree, one must
54dnl pass the relative path to the ../libfoo.la file, but
55dnl 2) once the whole package has been installed, users should
56dnl link using -lfoo.
57dnl Normally, we only care about the first case, but since the
bcc695e3 58dnl guile-config script needs to give users all the flags they need
539c89a1
JB
59dnl to link programs against guile, the GUILE_WITH_THREADS macro
60dnl needs to supply the second piece of information as well.
61dnl
62dnl This whole thing is a little confused about what ought to be
63dnl done in the top-level configure script, and what ought to be
47521807 64dnl taken care of in the subdirectory. For example, qtmds_s and
539c89a1
JB
65dnl friends really ought not to be even mentioned in the top-level
66dnl configure script, but here they are.
67
68AC_DEFUN([QTHREADS_CONFIGURE],[
7bc24529 69 AC_REQUIRE([AC_PROG_LN_S])
539c89a1 70
e0f54bcc 71 AC_MSG_CHECKING(QuickThreads configuration)
539c89a1
JB
72 # How can we refer to the qt source directory from within the qt build
73 # directory? For headers, we can rely on the fact that the qt src
74 # directory appears in the #include path.
75 qtsrcdir="`(cd $srcdir; pwd)`/qt"
76
77 changequote(,)dnl We use [ and ] in a regexp in the case
78
79 THREAD_PACKAGE=QT
47521807 80 qthread_asflags=''
539c89a1
JB
81 case "$host" in
82 i[3456]86-*-*)
e0f54bcc 83 port_name=i386
539c89a1
JB
84 qtmd_h=md/i386.h
85 qtmds_s=md/i386.s
86 qtmdc_c=md/null.c
87 qtdmdb_s=
47521807
JB
88 case "$host" in
89 *-*-netbsd* )
90 ## NetBSD needs to be told to pass the assembly code through
91 ## the C preprocessor. Other GCC installations seem to do
92 ## this by default, but NetBSD's doesn't. We could get the
93 ## same effect by giving the file a name ending with .S
94 ## instead of .s, but I don't see how to tell automake to do
95 ## that.
96 qthread_asflags='-x assembler-with-cpp'
97 ;;
98 esac
539c89a1
JB
99 ;;
100 mips-sgi-irix[56]*)
e0f54bcc 101 port_name=irix
539c89a1
JB
102 qtmd_h=md/mips.h
103 qtmds_s=md/mips-irix5.s
104 qtmdc_c=md/null.c
105 qtdmdb_s=md/mips_b.s
106 ;;
107 mips-*-*)
e0f54bcc 108 port_name=mips
539c89a1
JB
109 qtmd_h=md/mips.h
110 qtmds_s=md/mips.s
111 qtmdc_c=md/null.c
112 qtdmdb_s=md/mips_b.s
113 ;;
114 sparc-*-sunos*)
e0f54bcc 115 port_name=sparc-sunos
539c89a1
JB
116 qtmd_h=md/sparc.h
117 qtmds_s=md/_sparc.s
118 qtmdc_c=md/null.c
119 qtdmdb_s=md/_sparc_b.s
120 ;;
121 sparc-*-*)
e0f54bcc 122 port_name=sparc
539c89a1
JB
123 qtmd_h=md/sparc.h
124 qtmds_s=md/sparc.s
125 qtmdc_c=md/null.c
126 qtdmdb_s=md/sparc_b.s
127 ;;
1630ea6c 128 alpha*-*-*)
e0f54bcc 129 port_name=alpha
539c89a1
JB
130 qtmd_h=md/axp.h
131 qtmds_s=md/axp.s
132 qtmdc_c=md/null.c
133 qtdmdb_s=md/axp_b.s
134 ;;
135 *)
136 echo "Unknown configuration; threads package disabled"
137 THREAD_PACKAGE=""
138 ;;
139 esac
140 changequote([, ])
141
142 # Did configuration succeed?
143 if test -n "$THREAD_PACKAGE"; then
e0f54bcc 144 AC_MSG_RESULT($port_name)
539c89a1
JB
145 QTHREAD_LTLIBS=libqthreads.la
146 THREAD_CPPFLAGS="-I$qtsrcdir -I../qt"
147 THREAD_LIBS_LOCAL="../qt/libqthreads.la"
148 THREAD_LIBS_INSTALLED="-lqthreads"
e0f54bcc
JB
149 else
150 AC_MSG_RESULT(none; disabled)
539c89a1
JB
151 fi
152
153 AC_SUBST(QTHREAD_LTLIBS)
154 AC_SUBST(qtmd_h)
155 AC_SUBST(qtmds_s)
156 AC_SUBST(qtmdc_c)
157 AC_SUBST(qtdmdb_s)
47521807 158 AC_SUBST(qthread_asflags)
539c89a1
JB
159 AC_SUBST(THREAD_PACKAGE)
160 AC_SUBST(THREAD_CPPFLAGS)
161 AC_SUBST(THREAD_LIBS_LOCAL)
162 AC_SUBST(THREAD_LIBS_INSTALLED)
163])