Autodetect Lisp on the build platform.
[sbcl/autoconf.git] / configure.ac
blob3e457f8b429d35689f94c5d2f010cf6cf9d86516
1 AC_INIT(sbcl, 1.0.12.17, dherring@at.tentpost.dot.com)
2 # change out my email to www.sbcl.org if/when this becomes official
4 # Reduce top-level clutter
5 AC_CONFIG_AUX_DIR([build-aux])
7 AM_INIT_AUTOMAKE([dist-bzip2 foreign no-define nostdinc])
9 FIND_LISP
11 # Find the compiler
12 AC_PROG_CC
13 AC_PROG_NM
14 AC_PROG_GREP
15 AC_PROG_LN_S
17 # Detect the shared-library settings
18 AC_PROG_LIBTOOL
20 ## Grovel after libtool has found its standard headers...
21 GROVEL_HEADERS(sysincludes)
22 AC_DEFUN([GROVELDS], [GROVELD([$1], [$sysincludes], m4_default([$2], [no]))])
23 AC_DEFUN([GROVELITS], [GROVELIT([$1], [$sysincludes])])
24 GROVEL_VALUES
26 dnl libs to check for
27 # -lc -ldl -lm -lnsl -lsocket -lrt
28 # -lthr (preferred on BSD?) or -lpthread
29 # -lSystem (Darwin)
31 # Don't actually do much for now; just wrap the existing mechanism.
33 #Goals
34 # --prefix=
36 # Cross-compilation -- identify the $build and $host systems
37 # (default runs ./build-aux/config.guess)
38 AC_CANONICAL_HOST
40 # make dist
41 # ...
44 dnl c.f. make-config.sh
46 # Do we need to bring in undefineds.c?
47 port_incomplete=no
50 ## OS
51 case $host_os in
52 freebsd*)
53         os=bsd
54         ;;
55 netbsd* | openbsd*)
56         os=bsd
57         port_incomplete=yes
58         ;;
60 darwin*)
61         os=darwin
62         ;;
64 linux*)
65         os=linux
66         ;;
68 osf1*)
69         os=osf1
70         port_incomplete=yes
71         ;;
73 sunos* | solaris*)
74         os=sunos
75         ;;
77 cygwin* | mingw* | win*)
78         os=windows
79         port_incomplete=yes
80         ;;
83         AC_MSG_ERROR([unknown OS $host_os])
84         ;;
85 esac
86 AM_CONDITIONAL([COND_OS_BSD], [test $os = bsd])
87 AM_CONDITIONAL([COND_OS_DARWIN], [test $os = darwin])
88 AM_CONDITIONAL([COND_OS_LINUX], [test $os = linux])
89 AM_CONDITIONAL([COND_OS_OSF1], [test $os = osf1])
90 AM_CONDITIONAL([COND_OS_SUNOS], [test $os = sunos])
91 AM_CONDITIONAL([COND_OS_WINDOWS], [test $os = windows])
95 ## CPU
96 case $host_cpu in
97 alpha*)
98         cpu=alpha
99         ;;
100 hppa)
101         cpu=hppa
102         port_incomplete=yes
103         ;;
104 mips)
105         cpu=mips
106         ;;
107 powerpc* | ppc*)
108         cpu=ppc
109         ;;
110 sparc)
111         cpu=sparc
112         #port_incomplete=yes
113         ;;
114 i?86)
115         cpu=x86
116         ;;
117 x86_64 | amd64)
118         cpu=x86_64
119         ;;
121         AC_MSG_ERROR([unknown CPU $host_cpu])
122         ;;
123 esac
124 AM_CONDITIONAL([COND_CPU_ALPHA], [test $cpu = alpha])
125 AM_CONDITIONAL([COND_CPU_HPPA], [test $cpu = hppa])
126 AM_CONDITIONAL([COND_CPU_MIPS], [test $cpu = mips])
127 AM_CONDITIONAL([COND_CPU_PPC], [test $cpu = ppc])
128 AM_CONDITIONAL([COND_CPU_SPARC], [test $cpu = sparc])
129 AM_CONDITIONAL([COND_CPU_X86], [test $cpu = x86])
130 AM_CONDITIONAL([COND_CPU_X86_64], [test $cpu = x86_64])
132 AM_CONDITIONAL([COND_PORT_INCOMPLETE], [test $port_incomplete = yes])
135 ## Detect threading
136 AC_ARG_ENABLE([threading],
137         AS_HELP_STRING([--disable-threading], [Threading is enabled by default.]),
138         [ENABLE_THREADING=$enableval],
139         [ENABLE_THREADING=yes])
140 AC_ARG_WITH([thread-lib],
141         AS_HELP_STRING([--with-thread-lib=@<:@lib@:>@],
142                 [Specify a threading library to use. @<:@lib=pthread or thr; \
143 default is autodetect@:>@]),
144         [case $withval in
145         yes)
146                 WITH_THREAD_LIB=
147                 ;;
148         no)
149                 if test $ENABLE_THREADING = yes
150                 then
151                         AC_MSG_ERROR([threading was enabled, but --with-thread-lib=no])
152                 fi
153                 ;;
154         *)
155                 WITH_THREAD_LIB=$withval
156                 ;;
157         esac],
158         [WITH_THREAD_LIB=])
161 SET_LISP_FEATURES($os, $cpu)
163 AC_CONFIG_FILES([Makefile src/runtime/Makefile])
165 AC_OUTPUT