Release 980301
[wine.git] / configure.in
blobf02e30c04ad8476028bf540a91346e53960e4cdb
1 dnl Process this file with autoconf to produce a configure script.
2 dnl Author: Michael Patra   <micky@marie.physik.tu-berlin.de>
3 dnl                         <patra@itp1.physik.tu-berlin.de>
4 AC_REVISION([configure.in 1.00])
5 AC_INIT(controls/edit.c)                
6 AC_CONFIG_HEADER(include/config.h)
7 AC_CONFIG_AUX_DIR(tools)
9 # We want these before the checks, so the checks can modify their values.
10 LIBS="$LIBS -lm"
11 test -z "$PROGEXT" && PROGEXT="" AC_SUBST(PROGEXT)
13 dnl **** Command-line arguments ****
15 dnl Default values
16 MAIN_TARGET=emu
17 LIB_TARGET=libwine.a
19 AC_ARG_ENABLE(emulator,
20 [  --disable-emulator      build only the Wine library, not the emulator],
21 [if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi])
23 AC_ARG_ENABLE(dll,
24 [  --enable-dll            build the Wine library as a DLL],
25 [if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi])
27 dnl AC_ARG_WITH(ipc,
28 dnl [  --enable-ipc            use inter-process communication for DDE],
29 dnl [if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
31 AC_ARG_WITH(reentrant-x,
32 [  --without-reentrant-x   Compile for use with non-reentrant X libraries])
34 AC_SUBST(MAIN_TARGET)
35 AC_SUBST(LIB_TARGET)
36 AC_SUBST(OPTIONS)
38 dnl **** Check for some programs ****
40 AC_PROG_MAKE_SET
41 AC_PROG_CC
42 AC_PROG_CPP
43 AC_PATH_XTRA
44 AC_PROG_YACC
45 AC_PROG_LEX
46 AC_PROG_RANLIB
47 AC_PROG_INSTALL
48 AC_PROG_LN_S
50 dnl **** Check for some libraries ****
52 dnl Check for -li386 for NetBSD and OpenBSD
53 AC_CHECK_LIB(i386,i386_set_ldt)
54 dnl Check for -lw for Solaris
55 AC_CHECK_LIB(w,iswalnum)
56 dnl Check for XFree86 DGA extension
57 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
59 dnl **** Check for Open Sound System ****
61 AC_CACHE_CHECK("for Open Sound System",
62         ac_cv_c_opensoundsystem,
63         AC_TRY_COMPILE([#include <sys/soundcard.h>],[
64 /* check for one of the Open Sound System specific SNDCTL_ defines */
65 #if !defined(SNDCTL_DSP_STEREO)
66 #error No open sound system
67 #endif
68 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
70 if test "$ac_cv_c_opensoundsystem" = "yes"
71 then
72     AC_DEFINE(HAVE_OSS)
75 dnl **** Check for union semun ****
77 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
78  AC_TRY_COMPILE([#include <sys/types.h>
79 #include <sys/sem.h>],[union semun foo],
80                 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
81 if test "$ac_cv_c_union_semun" = "yes"
82 then
83     AC_DEFINE(HAVE_UNION_SEMUN)
86 dnl **** If ln -s doesn't work, use cp instead ****
87 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
89 dnl **** Check for gcc strength-reduce bug ****
91 if test "x${GCC}" = "xyes"
92 then
93   CFLAGS="$CFLAGS -Wall"
94   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
95                   AC_TRY_RUN([
96 int main(void) {
97   static int Array[[3]];
98   unsigned int B = 3;
99   int i;
100   for(i=0; i<B; i++) Array[[i]] = i - 3;
101   exit( Array[[1]] != -2 );
103     ac_cv_c_gcc_strength_bug="no",
104     ac_cv_c_gcc_strength_bug="yes",
105     ac_cv_c_gcc_strength_bug="yes") )
106   if test "$ac_cv_c_gcc_strength_bug" = "yes"
107   then
108     CFLAGS="$CFLAGS -fno-strength-reduce"
109   fi
112 dnl **** Check for underscore on external symbols ****
114 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
115                ac_cv_c_extern_prefix,
116 [saved_libs=$LIBS
117 LIBS="conftest_asm.s $LIBS"
118 cat > conftest_asm.s <<EOF
119         .globl _ac_test
120 _ac_test:
121         .long 0
123 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
124             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
125 LIBS=$saved_libs])
126 if test "$ac_cv_c_extern_prefix" = "yes"
127 then
128   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
131 dnl **** Check for .string in assembler ****
133 AC_CACHE_CHECK("whether assembler accepts .string",
134                ac_cv_c_asm_string,
135 [saved_libs=$LIBS
136 LIBS="conftest_asm.s $LIBS"
137 cat > conftest_asm.s <<EOF
138         .string "test"
140 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
141 LIBS=$saved_libs])
142 if test "$ac_cv_c_asm_string" = "yes"
143 then
144   AC_DEFINE(HAVE_ASM_STRING)
147 dnl **** Check for working dll ****
149 DLLFLAGS=""
150 if test "$LIB_TARGET" = "libwine.so.1.0"
151 then
152   AC_CACHE_CHECK("whether we can build a dll",
153                  ac_cv_c_dll,
154   [saved_cflags=$CFLAGS
155   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
156   AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
157   CFLAGS=$saved_cflags
158   ])
159   if test "$ac_cv_c_dll" = "yes"
160   then
161     DLLFLAGS="-fPIC"
162   else
163     LIB_TARGET="libwine.a"
164   fi
166 AC_SUBST(DLLFLAGS)
168 dnl **** Check for reentrant X libraries ****
170 dnl This may fail to determine whether X libraries are reentrant if
171 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
172 dnl is possible with the --without-reentrant-x option.
174 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
175   [ if test "x$with_reentrant_x" = "xno"
176     then
177         wine_cv_x_reentrant=no
178     else
179         libX11_ckeck=none
180         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
181             if test -e $dir/libX11.so; then
182                 libX11_check="-D $dir/libX11.so"
183                 break 1
184             fi
185             if test -e $dir/libX11.a; then
186                 libX11_check="$dir/libX11.a"
187                 break 1
188             fi
189         done
190         if test "$libX11_check" != "none"; then
191             if nm $libX11_check | grep -q __errno_location; then
192                 wine_cv_x_reentrant=yes
193             else
194                 wine_cv_x_reentrant=no
195             fi
196         else
197             wine_cv_x_reentrant=unknown
198         fi
199     fi ] )
200 if test "$wine_cv_x_reentrant" = "no"
201 then
202   AC_DEFINE(NO_REENTRANT_X11)
205 dnl **** Check for functions and header files ****
207 AC_CHECK_FUNCS(clone memmove strerror tcgetattr usleep wait4 waitpid)
208 AC_CHECK_HEADERS(wctype.h)
209 AC_HEADER_STAT()
210 AC_C_CONST()
211 AC_TYPE_SIZE_T()
213 dnl **** Generate output files ****
215 MAKE_RULES=Make.rules
216 AC_SUBST_FILE(MAKE_RULES)
218 AC_OUTPUT([
219 Make.rules
220 Makefile
221 controls/Makefile
222 debugger/Makefile
223 documentation/Makefile
224 files/Makefile
225 graphics/Makefile
226 graphics/metafiledrv/Makefile
227 graphics/win16drv/Makefile
228 graphics/x11drv/Makefile
229 if1632/Makefile
230 ipc/Makefile
231 library/Makefile
232 libtest/Makefile
233 loader/Makefile
234 memory/Makefile
235 misc/Makefile
236 miscemu/Makefile
237 msdos/Makefile
238 multimedia/Makefile
239 objects/Makefile
240 ole/Makefile
241 programs/Makefile
242 programs/clock/Makefile
243 programs/notepad/Makefile
244 programs/progman/Makefile
245 programs/view/Makefile
246 programs/winhelp/Makefile
247 programs/winver/Makefile
248 rc/Makefile
249 relay32/Makefile
250 resources/Makefile
251 scheduler/Makefile
252 tools/Makefile
253 tsx11/Makefile
254 win32/Makefile
255 windows/Makefile ])
257 echo
258 echo "Configure finished.  Do 'make depend; make' to compile Wine."
259 echo
261 dnl Local Variables:
262 dnl comment-start: "dnl "
263 dnl comment-end: ""
264 dnl comment-start-skip: "\\bdnl\\b\\s *"
265 dnl compile-command: "autoconf"
266 dnl End: