Release 980315
[wine/multimedia.git] / configure.in
blob78a2c9616af26e5a0146dc1a2ff9d5843a903a11
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 AC_CACHE_CHECK("for Open Sound System on *BSD",
71         ac_cv_c_opensoundsystem_bsd,
72         AC_TRY_COMPILE([#include <machine/soundcard.h>],[
73 /* check for one of the Open Sound System specific SNDCTL_ defines */
74 #if !defined(SNDCTL_DSP_STEREO)
75 #error No open sound system
76 #endif
77 ],ac_cv_c_opensoundsystem_bsd="yes",ac_cv_c_opensoundsystem_bsd="no"))
79 if test "$ac_cv_c_opensoundsystem" = "yes" -o "$ac_cv_c_opensoundsystem_bsd" = "yes"
80 then
81     AC_DEFINE(HAVE_OSS)
82     if test "$ac_cv_c_opensoundsystem_bsd" = "yes"
83     then
84         AC_DEFINE(HAVE_MACHINE_SOUNDCARD_H)
85     fi
88 dnl **** Check for union semun ****
90 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
91  AC_TRY_COMPILE([#include <sys/types.h>
92 #include <sys/sem.h>],[union semun foo],
93                 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
94 if test "$ac_cv_c_union_semun" = "yes"
95 then
96     AC_DEFINE(HAVE_UNION_SEMUN)
99 dnl **** If ln -s doesn't work, use cp instead ****
100 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
102 dnl **** Check for gcc strength-reduce bug ****
104 if test "x${GCC}" = "xyes"
105 then
106   CFLAGS="$CFLAGS -Wall"
107   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
108                   AC_TRY_RUN([
109 int main(void) {
110   static int Array[[3]];
111   unsigned int B = 3;
112   int i;
113   for(i=0; i<B; i++) Array[[i]] = i - 3;
114   exit( Array[[1]] != -2 );
116     ac_cv_c_gcc_strength_bug="no",
117     ac_cv_c_gcc_strength_bug="yes",
118     ac_cv_c_gcc_strength_bug="yes") )
119   if test "$ac_cv_c_gcc_strength_bug" = "yes"
120   then
121     CFLAGS="$CFLAGS -fno-strength-reduce"
122   fi
125 dnl **** Check for underscore on external symbols ****
127 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
128                ac_cv_c_extern_prefix,
129 [saved_libs=$LIBS
130 LIBS="conftest_asm.s $LIBS"
131 cat > conftest_asm.s <<EOF
132         .globl _ac_test
133 _ac_test:
134         .long 0
136 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
137             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
138 LIBS=$saved_libs])
139 if test "$ac_cv_c_extern_prefix" = "yes"
140 then
141   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
144 dnl **** Check for .string in assembler ****
146 AC_CACHE_CHECK("whether assembler accepts .string",
147                ac_cv_c_asm_string,
148 [saved_libs=$LIBS
149 LIBS="conftest_asm.s $LIBS"
150 cat > conftest_asm.s <<EOF
151         .string "test"
153 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
154 LIBS=$saved_libs])
155 if test "$ac_cv_c_asm_string" = "yes"
156 then
157   AC_DEFINE(HAVE_ASM_STRING)
160 dnl **** Check for working dll ****
162 DLLFLAGS=""
163 if test "$LIB_TARGET" = "libwine.so.1.0"
164 then
165   AC_CACHE_CHECK("whether we can build a dll",
166                  ac_cv_c_dll,
167   [saved_cflags=$CFLAGS
168   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
169   AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
170   CFLAGS=$saved_cflags
171   ])
172   if test "$ac_cv_c_dll" = "yes"
173   then
174     DLLFLAGS="-fPIC"
175   else
176     LIB_TARGET="libwine.a"
177   fi
179 AC_SUBST(DLLFLAGS)
181 dnl **** Check for reentrant X libraries ****
183 dnl This may fail to determine whether X libraries are reentrant if
184 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
185 dnl is possible with the --without-reentrant-x option.
187 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
188   [ if test "x$with_reentrant_x" = "xno"
189     then
190         wine_cv_x_reentrant=no
191     else
192         libX11_ckeck=none
193         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
194             if test -e $dir/libX11.so; then
195                 libX11_check="-D $dir/libX11.so"
196                 break 1
197             fi
198             if test -e $dir/libX11.a; then
199                 libX11_check="$dir/libX11.a"
200                 break 1
201             fi
202         done
203         if test "$libX11_check" != "none"; then
204             if nm $libX11_check | grep -q __errno_location; then
205                 wine_cv_x_reentrant=yes
206             else
207                 wine_cv_x_reentrant=no
208             fi
209         else
210             wine_cv_x_reentrant=unknown
211         fi
212     fi ] )
213 if test "$wine_cv_x_reentrant" = "no"
214 then
215   AC_DEFINE(NO_REENTRANT_X11)
218 dnl **** Check for functions and header files ****
220 AC_CHECK_FUNCS(clone memmove strerror tcgetattr timegm usleep wait4 waitpid)
221 AC_CHECK_HEADERS(wctype.h)
222 AC_HEADER_STAT()
223 AC_C_CONST()
224 AC_TYPE_SIZE_T()
226 dnl **** Generate output files ****
228 MAKE_RULES=Make.rules
229 AC_SUBST_FILE(MAKE_RULES)
231 AC_OUTPUT([
232 Make.rules
233 Makefile
234 controls/Makefile
235 debugger/Makefile
236 documentation/Makefile
237 files/Makefile
238 graphics/Makefile
239 graphics/metafiledrv/Makefile
240 graphics/win16drv/Makefile
241 graphics/x11drv/Makefile
242 if1632/Makefile
243 ipc/Makefile
244 library/Makefile
245 libtest/Makefile
246 loader/Makefile
247 memory/Makefile
248 misc/Makefile
249 miscemu/Makefile
250 msdos/Makefile
251 multimedia/Makefile
252 objects/Makefile
253 ole/Makefile
254 programs/Makefile
255 programs/clock/Makefile
256 programs/notepad/Makefile
257 programs/progman/Makefile
258 programs/view/Makefile
259 programs/winhelp/Makefile
260 programs/winver/Makefile
261 rc/Makefile
262 relay32/Makefile
263 resources/Makefile
264 scheduler/Makefile
265 tools/Makefile
266 tsx11/Makefile
267 win32/Makefile
268 windows/Makefile ])
270 echo
271 echo "Configure finished.  Do 'make depend; make' to compile Wine."
272 echo
274 dnl Local Variables:
275 dnl comment-start: "dnl "
276 dnl comment-end: ""
277 dnl comment-start-skip: "\\bdnl\\b\\s *"
278 dnl compile-command: "autoconf"
279 dnl End: