Progress.
[sbcl/autoconf.git] / configure.ac
blob0acb0ca31ea45d1f3c96a0e82b33e39f55522f4e
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 the compiler
10 AC_PROG_CC
11 AC_PROG_NM
12 AC_PROG_GREP
13 AC_PROG_LN_S
15 # Detect the shared-library settings
16 AC_PROG_LIBTOOL
18 dnl libs to check for
19 # -lc -ldl -lm -lnsl -lsocket -lrt
20 # -lthr (preferred on BSD?) or -lpthread
21 # -lSystem (Darwin)
23 # Don't actually do much for now; just wrap the existing mechanism.
25 #Goals
26 # --prefix=
28 # Cross-compilation -- identify the $build and $host systems
29 # (default runs ./build-aux/config.guess)
30 AC_CANONICAL_HOST
32 # Auto-detect a lisp to compile with
33 AC_ARG_WITH([lisp],
34         AS_HELP_STRING([--with-lisp=path], [Name of or absolute path to the lisp \
35 which should bootstrap SBCL. @<:@default=search for sbcl, cmucl, lisp@:>@]),
36         [LISP=$val],
37         [LISP=])
39 # make dist
40 # ...
43 dnl c.f. make-config.sh
45 # Do we need to bring in undefineds.c?
46 port_incomplete=no
49 ## OS
50 case $host_os in
51 freebsd*)
52         os=bsd
53         ;;
54 netbsd* | openbsd*)
55         os=bsd
56         port_incomplete=yes
57         ;;
59 darwin*)
60         os=darwin
61         ;;
63 linux*)
64         os=linux
65         ;;
67 osf1*)
68         os=osf1
69         port_incomplete=yes
70         ;;
72 sunos* | solaris*)
73         os=sunos
74         ;;
76 cygwin* | mingw* | win*)
77         os=windows
78         port_incomplete=yes
79         ;;
82         AC_MSG_ERROR([unknown OS $host_os])
83         ;;
84 esac
85 AM_CONDITIONAL([COND_OS_BSD], [test $os = bsd])
86 AM_CONDITIONAL([COND_OS_DARWIN], [test $os = darwin])
87 AM_CONDITIONAL([COND_OS_LINUX], [test $os = linux])
88 AM_CONDITIONAL([COND_OS_OSF1], [test $os = osf1])
89 AM_CONDITIONAL([COND_OS_SUNOS], [test $os = sunos])
90 AM_CONDITIONAL([COND_OS_WINDOWS], [test $os = windows])
94 ## CPU
95 case $host_cpu in
96 alpha*)
97         cpu=alpha
98         ;;
99 hppa)
100         cpu=hppa
101         port_incomplete=yes
102         ;;
103 mips)
104         cpu=mips
105         ;;
106 powerpc* | ppc*)
107         cpu=ppc
108         ;;
109 sparc)
110         cpu=sparc
111         #port_incomplete=yes
112         ;;
113 i?86)
114         cpu=x86
115         ;;
116 x86_64 | amd64)
117         cpu=x86_64
118         ;;
120         AC_MSG_ERROR([unknown CPU $host_cpu])
121         ;;
122 esac
123 AM_CONDITIONAL([COND_CPU_ALPHA], [test $cpu = alpha])
124 AM_CONDITIONAL([COND_CPU_HPPA], [test $cpu = hppa])
125 AM_CONDITIONAL([COND_CPU_MIPS], [test $cpu = mips])
126 AM_CONDITIONAL([COND_CPU_PPC], [test $cpu = ppc])
127 AM_CONDITIONAL([COND_CPU_SPARC], [test $cpu = sparc])
128 AM_CONDITIONAL([COND_CPU_X86], [test $cpu = x86])
129 AM_CONDITIONAL([COND_CPU_X86_64], [test $cpu = x86_64])
131 AM_CONDITIONAL([COND_PORT_INCOMPLETE], [test $port_incomplete = yes])
134 ## Detect threading
135 AC_ARG_ENABLE([threading],
136         AS_HELP_STRING([--disable-threading], [Threading is enabled by default.]),
137         [ENABLE_THREADING=$enableval],
138         [ENABLE_THREADING=yes])
139 AC_ARG_WITH([thread-lib],
140         AS_HELP_STRING([--with-thread-lib=@<:@lib@:>@],
141                 [Specify a threading library to use. @<:@lib=pthread or thr; \
142 default is autodetect@:>@]),
143         [case $withval in
144         yes)
145                 WITH_THREAD_LIB=
146                 ;;
147         no)
148                 if test $ENABLE_THREADING = yes
149                 then
150                         AC_MSG_ERROR([threading was enabled, but --with-thread-lib=no])
151                 fi
152                 ;;
153         *)
154                 WITH_THREAD_LIB=$withval
155                 ;;
156         esac],
157         [WITH_THREAD_LIB=])
160 SET_LISP_FEATURES($os, $cpu)
162 AC_CONFIG_FILES([Makefile src/runtime/Makefile])
164 AC_OUTPUT