The FSF has a new address.
[bpt/guile.git] / guile-config / qthreads.m4
CommitLineData
63355c80
MV
1dnl Autoconf macros for configuring the QuickThreads package
2dnl Jim Blandy <jimb@red-bean.com> --- July 1998
3dnl
4dnl Copyright (C) 1998, 1999 Free Software Foundation, Inc.
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
92205699
MV
20dnl to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21dnl Floor, Boston, MA 02110-1301 USA
63355c80
MV
22
23
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.
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.
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_LIBS_LOCAL --- linker options for use in this source tree
41dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
42dnl is installed
43dnl It would be nice if all thread configuration packages for Guile
44dnl followed the same conventions.
45dnl
46dnl All of the above variables will be substituted into Makefiles in
47dnl the usual autoconf fashion.
48dnl
49dnl We distinguish between THREAD_LIBS_LOCAL and
50dnl THREAD_LIBS_INSTALLED because the thread library might be in
51dnl this tree, and be built using libtool. This means that:
52dnl 1) when building other executables in this tree, one must
53dnl pass the relative path to the ../libfoo.la file, but
54dnl 2) once the whole package has been installed, users should
55dnl link using -lfoo.
56dnl Normally, we only care about the first case, but since the
57dnl guile-config script needs to give users all the flags they need
58dnl to link programs against guile, the GUILE_WITH_THREADS macro
59dnl needs to supply the second piece of information as well.
60dnl
61dnl This whole thing is a little confused about what ought to be
62dnl done in the top-level configure script, and what ought to be
63dnl taken care of in the subdirectory. For example, qtmds_s and
64dnl friends really ought not to be even mentioned in the top-level
65dnl configure script, but here they are.
66
67AC_DEFUN([QTHREADS_CONFIGURE],[
68 AC_REQUIRE([AC_PROG_LN_S])
69
70 AC_MSG_CHECKING(QuickThreads configuration)
71
72 changequote(,)dnl We use [ and ] in a regexp in the case
73
74 THREAD_PACKAGE=QT
75 qthread_asflags=''
76 case "$host" in
77 i[3456]86-*-*)
78 port_name=i386
79 qtmd_h=md/i386.h
80 qtmds_s=md/i386.s
81 qtmdc_c=md/null.c
82 qtdmdb_s=
83 case "$host" in
84 *-*-netbsd* )
85 ## NetBSD needs to be told to pass the assembly code through
86 ## the C preprocessor. Other GCC installations seem to do
87 ## this by default, but NetBSD's doesn't. We could get the
88 ## same effect by giving the file a name ending with .S
89 ## instead of .s, but I don't see how to tell automake to do
90 ## that.
91 qthread_asflags='-x assembler-with-cpp'
92 ;;
93 esac
94 ;;
95 mips-sgi-irix[56]*)
96 port_name=irix
97 qtmd_h=md/mips.h
98 qtmds_s=md/mips-irix5.s
99 qtmdc_c=md/null.c
100 qtdmdb_s=md/mips_b.s
101 ;;
102 mips-*-*)
103 port_name=mips
104 qtmd_h=md/mips.h
105 qtmds_s=md/mips.s
106 qtmdc_c=md/null.c
107 qtdmdb_s=md/mips_b.s
108 ;;
109 sparc-*-sunos*)
110 port_name=sparc-sunos
111 qtmd_h=md/sparc.h
112 qtmds_s=md/_sparc.s
113 qtmdc_c=md/null.c
114 qtdmdb_s=md/_sparc_b.s
115 ;;
116 sparc*-*-*)
117 port_name=sparc
118 qtmd_h=md/sparc.h
119 qtmds_s=md/sparc.s
120 qtmdc_c=md/null.c
121 qtdmdb_s=md/sparc_b.s
122 ;;
123 alpha*-*-*)
124 port_name=alpha
125 qtmd_h=md/axp.h
126 qtmds_s=md/axp.s
127 qtmdc_c=md/null.c
128 qtdmdb_s=md/axp_b.s
129 ;;
4923bb18
MV
130 arm*-*-*)
131 port_name=arm
132 qtmd_h=md/arm.h
133 qtmds_s=md/arm.s
134 qtmdc_c=md/null.c
135 qtdmdb_s=
136 ;;
63355c80
MV
137 *)
138 echo "Unknown configuration; threads package disabled"
139 THREAD_PACKAGE=""
140 ;;
141 esac
142 changequote([, ])
143
144 # Did configuration succeed?
145 if test -n "$THREAD_PACKAGE"; then
146 AC_MSG_RESULT($port_name)
147 QTHREAD_LTLIBS=libqthreads.la
148 THREAD_LIBS_LOCAL="../qt/libqthreads.la"
149 THREAD_LIBS_INSTALLED="-lqthreads"
150 else
151 AC_MSG_RESULT(none; disabled)
152 fi
153
154 AC_SUBST(QTHREAD_LTLIBS)
155 AC_SUBST(qtmd_h)
156 AC_SUBST(qtmds_s)
157 AC_SUBST(qtmdc_c)
158 AC_SUBST(qtdmdb_s)
159 AC_SUBST(qthread_asflags)
160 AC_SUBST(THREAD_PACKAGE)
161 AC_SUBST(THREAD_LIBS_LOCAL)
162 AC_SUBST(THREAD_LIBS_INSTALLED)
163])
164
165dnl qthreads.m4 ends here