Release 980201
[wine.git] / configure.in
blobc70d80cd219e2c786d264519ac5afe6a98b50ddb
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_SUBST(MAIN_TARGET)
32 AC_SUBST(LIB_TARGET)
33 AC_SUBST(OPTIONS)
35 dnl **** Check for some programs ****
37 AC_PROG_MAKE_SET
38 AC_PROG_CC
39 AC_PROG_CPP
40 AC_PATH_XTRA
41 AC_PROG_YACC
42 AC_PROG_LEX
43 AC_PROG_RANLIB
44 AC_PROG_INSTALL
45 AC_PROG_LN_S
47 dnl **** Check for some libraries ****
49 dnl Check for -li386 for NetBSD and OpenBSD
50 AC_CHECK_LIB(i386,i386_set_ldt)
51 dnl Check for -lw for Solaris
52 AC_CHECK_LIB(w,iswalnum)
53 dnl Check for XFree86 DGA extension
54 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
56 dnl **** Check for Open Sound System ****
58 AC_CACHE_CHECK("for Open Sound System",
59         ac_cv_c_opensoundsystem,
60         AC_TRY_COMPILE([#include <sys/soundcard.h>],[
61 /* check for one of the Open Sound System specific SNDCTL_ defines */
62 #if !defined(SNDCTL_DSP_STEREO)
63 #error No open sound system
64 #endif
65 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
67 if test "$ac_cv_c_opensoundsystem" = "yes"
68 then
69     AC_DEFINE(HAVE_OSS)
72 dnl **** Check for union semun ****
74 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
75  AC_TRY_COMPILE([#include <sys/types.h>
76 #include <sys/sem.h>],[union semun foo],
77                 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
78 if test "$ac_cv_c_union_semun" = "yes"
79 then
80     AC_DEFINE(HAVE_UNION_SEMUN)
83 dnl **** If ln -s doesn't work, use cp instead ****
84 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
86 dnl **** Check for gcc strength-reduce bug ****
88 if test "x${GCC}" = "xyes"
89 then
90   CFLAGS="$CFLAGS -Wall"
91   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
92                   AC_TRY_RUN([
93 int main(void) {
94   static int Array[[3]];
95   unsigned int B = 3;
96   int i;
97   for(i=0; i<B; i++) Array[[i]] = i - 3;
98   exit( Array[[1]] != -2 );
99 }],
100     ac_cv_c_gcc_strength_bug="no",
101     ac_cv_c_gcc_strength_bug="yes",
102     ac_cv_c_gcc_strength_bug="yes") )
103   if test "$ac_cv_c_gcc_strength_bug" = "yes"
104   then
105     CFLAGS="$CFLAGS -fno-strength-reduce"
106   fi
109 dnl **** Check for underscore on external symbols ****
111 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
112                ac_cv_c_extern_prefix,
113 [saved_libs=$LIBS
114 LIBS="conftest_asm.s $LIBS"
115 cat > conftest_asm.s <<EOF
116         .globl _ac_test
117 _ac_test:
118         .long 0
120 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
121             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
122 LIBS=$saved_libs])
123 if test "$ac_cv_c_extern_prefix" = "yes"
124 then
125   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
128 dnl **** Check for .string in assembler ****
130 AC_CACHE_CHECK("whether assembler accepts .string",
131                ac_cv_c_asm_string,
132 [saved_libs=$LIBS
133 LIBS="conftest_asm.s $LIBS"
134 cat > conftest_asm.s <<EOF
135         .string "test"
137 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
138 LIBS=$saved_libs])
139 if test "$ac_cv_c_asm_string" = "yes"
140 then
141   AC_DEFINE(HAVE_ASM_STRING)
144 dnl **** Check for working dll ****
146 DLLFLAGS=""
147 if test "$LIB_TARGET" = "libwine.so.1.0"
148 then
149   AC_CACHE_CHECK("whether we can build a dll",
150                  ac_cv_c_dll,
151   [saved_cflags=$CFLAGS
152   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
153   AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
154   CFLAGS=$saved_cflags
155   ])
156   if test "$ac_cv_c_dll" = "yes"
157   then
158     DLLFLAGS="-fPIC"
159   else
160     LIB_TARGET="libwine.a"
161   fi
163 AC_SUBST(DLLFLAGS)
165 dnl **** Check for functions and header files ****
167 AC_CHECK_FUNCS(clone memmove strerror tcgetattr usleep wait4 waitpid)
168 AC_CHECK_HEADERS(wctype.h)
169 AC_HEADER_STAT()
170 AC_C_CONST()
171 AC_TYPE_SIZE_T()
173 dnl **** Generate output files ****
175 MAKE_RULES=Make.rules
176 AC_SUBST_FILE(MAKE_RULES)
178 AC_OUTPUT([
179 Make.rules
180 Makefile
181 controls/Makefile
182 debugger/Makefile
183 documentation/Makefile
184 files/Makefile
185 graphics/Makefile
186 graphics/metafiledrv/Makefile
187 graphics/win16drv/Makefile
188 graphics/x11drv/Makefile
189 if1632/Makefile
190 ipc/Makefile
191 library/Makefile
192 libtest/Makefile
193 loader/Makefile
194 memory/Makefile
195 misc/Makefile
196 miscemu/Makefile
197 msdos/Makefile
198 multimedia/Makefile
199 objects/Makefile
200 ole/Makefile
201 programs/Makefile
202 programs/notepad/Makefile
203 programs/progman/Makefile
204 programs/winhelp/Makefile
205 programs/winver/Makefile
206 rc/Makefile
207 relay32/Makefile
208 resources/Makefile
209 scheduler/Makefile
210 tools/Makefile
211 tsx11/Makefile
212 win32/Makefile
213 windows/Makefile ])
215 echo
216 echo "Configure finished.  Do 'make depend; make' to compile Wine."
217 echo
219 dnl Local Variables:
220 dnl comment-start: "dnl "
221 dnl comment-end: ""
222 dnl comment-start-skip: "\\bdnl\\b\\s *"
223 dnl compile-command: "autoconf"
224 dnl End: