Release 980628
[wine/multimedia.git] / configure.in
blobf33f07f54b40267b8e421f98150b36b7291b891f
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
18 TRACE_MSGS=yes  # the TRACE() macro
19 DEBUG_MSGS=yes  # the TRACE(), WARN(), and FIXME() macros.
21 AC_ARG_ENABLE(emulator,
22 [  --disable-emulator      build only the Wine library, not the emulator],
23 [if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi])
25 AC_ARG_ENABLE(dll,
26 [  --enable-dll            build the Wine library as a DLL],
27 [if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi])
29 dnl AC_ARG_WITH(ipc,
30 dnl [  --enable-ipc            use inter-process communication for DDE],
31 dnl [if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
33 AC_ARG_ENABLE(debug,
34 [  --disable-debug         compile out all debugging messages],
35 [if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
37 AC_ARG_ENABLE(trace,
38 [  --disable-trace         compile out TRACE messages],
39 [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
41 AC_ARG_WITH(reentrant-x,
42 [  --without-reentrant-x   Compile for use with non-reentrant X libraries])
44 AC_SUBST(MAIN_TARGET)
45 AC_SUBST(LIB_TARGET)
46 AC_SUBST(OPTIONS)
48 if test "$DEBUG_MSGS" = "no"
49 then
50     AC_DEFINE(NO_DEBUG_MSGS)
51     AC_DEFINE(NO_TRACE_MSGS)
52 else
53     if test "$TRACE_MSGS" = "no"
54     then
55         AC_DEFINE(NO_TRACE_MSGS)
56     fi
59 dnl **** Check for some programs ****
61 AC_PROG_MAKE_SET
62 AC_PROG_CC
63 AC_PROG_CPP
64 AC_PATH_XTRA
65 AC_PROG_YACC
66 AC_PROG_LEX
67 AC_PROG_RANLIB
68 AC_PROG_INSTALL
69 AC_PROG_LN_S
70 AC_CHECK_PROG(C2MAN,c2man,c2man,true)
72 dnl **** Check for some libraries ****
74 dnl Check for -li386 for NetBSD and OpenBSD
75 AC_CHECK_LIB(i386,i386_set_ldt)
76 dnl Check for -lw for Solaris
77 AC_CHECK_LIB(w,iswalnum)
78 dnl Check for XFree86 DGA extension
79 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
81 dnl **** Check for Open Sound System ****
82 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
84 AC_CACHE_CHECK("for Open Sound System",
85         ac_cv_c_opensoundsystem,
86         AC_TRY_COMPILE([
87         #ifdef HAVE_SYS_SOUNDCARD_H
88                 #include <sys/soundcard.h>
89         #endif
90         #ifdef HAVE_MACHINE_SOUNDCARD_H
91                 #include <machine/soundcard.h>
92         #endif
93         ],[
95 /* check for one of the Open Sound System specific SNDCTL_ defines */
96 #if !defined(SNDCTL_DSP_STEREO)
97 #error No open sound system
98 #endif
99 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
101 if test "$ac_cv_c_opensoundsystem" = "yes"
102 then
103     AC_DEFINE(HAVE_OSS)
106 dnl **** Check for union semun ****
108 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
109  AC_TRY_COMPILE([#include <sys/types.h>
110 #include <sys/sem.h>],[union semun foo],
111                 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
112 if test "$ac_cv_c_union_semun" = "yes"
113 then
114     AC_DEFINE(HAVE_UNION_SEMUN)
117 dnl **** If ln -s doesn't work, use cp instead ****
118 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
120 dnl **** Check for gcc strength-reduce bug ****
122 if test "x${GCC}" = "xyes"
123 then
124   CFLAGS="$CFLAGS -Wall"
125   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
126                   AC_TRY_RUN([
127 int main(void) {
128   static int Array[[3]];
129   unsigned int B = 3;
130   int i;
131   for(i=0; i<B; i++) Array[[i]] = i - 3;
132   exit( Array[[1]] != -2 );
134     ac_cv_c_gcc_strength_bug="no",
135     ac_cv_c_gcc_strength_bug="yes",
136     ac_cv_c_gcc_strength_bug="yes") )
137   if test "$ac_cv_c_gcc_strength_bug" = "yes"
138   then
139     CFLAGS="$CFLAGS -fno-strength-reduce"
140   fi
143 dnl **** Check for underscore on external symbols ****
145 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
146                ac_cv_c_extern_prefix,
147 [saved_libs=$LIBS
148 LIBS="conftest_asm.s $LIBS"
149 cat > conftest_asm.s <<EOF
150         .globl _ac_test
151 _ac_test:
152         .long 0
154 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
155             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
156 LIBS=$saved_libs])
157 if test "$ac_cv_c_extern_prefix" = "yes"
158 then
159   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
162 dnl **** Check for .string in assembler ****
164 AC_CACHE_CHECK("whether assembler accepts .string",
165                ac_cv_c_asm_string,
166 [saved_libs=$LIBS
167 LIBS="conftest_asm.s $LIBS"
168 cat > conftest_asm.s <<EOF
169         .string "test"
171 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
172 LIBS=$saved_libs])
173 if test "$ac_cv_c_asm_string" = "yes"
174 then
175   AC_DEFINE(HAVE_ASM_STRING)
178 dnl **** Check for working dll ****
180 DLLFLAGS=""
181 if test "$LIB_TARGET" = "libwine.so.1.0"
182 then
183   AC_CACHE_CHECK("whether we can build a dll",
184                  ac_cv_c_dll,
185   [saved_cflags=$CFLAGS
186   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
187   AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
188   CFLAGS=$saved_cflags
189   ])
190   if test "$ac_cv_c_dll" = "yes"
191   then
192     DLLFLAGS="-fPIC"
193   else
194     LIB_TARGET="libwine.a"
195   fi
197 AC_SUBST(DLLFLAGS)
199 dnl **** Check for reentrant X libraries ****
201 dnl This may fail to determine whether X libraries are reentrant if
202 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
203 dnl is possible with the --without-reentrant-x option.
205 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
206   [ if test "x$with_reentrant_x" = "xno"
207     then
208         wine_cv_x_reentrant=no
209     else
210         libX11_ckeck=none
211         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
212             if test -e $dir/libX11.so; then
213                 libX11_check="-D $dir/libX11.so"
214                 break 1
215             fi
216             if test -e $dir/libX11.a; then
217                 libX11_check="$dir/libX11.a"
218                 break 1
219             fi
220         done
221         if test "$libX11_check" != "none"; then
222             if nm $libX11_check | grep -q __errno_location; then
223                 wine_cv_x_reentrant=yes
224             else
225                 wine_cv_x_reentrant=no
226             fi
227         else
228             wine_cv_x_reentrant=unknown
229         fi
230     fi ] )
231 if test "$wine_cv_x_reentrant" = "no"
232 then
233   AC_DEFINE(NO_REENTRANT_X11)
236 dnl **** Check for functions and header files ****
238 AC_CHECK_FUNCS(clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
239 AC_CHECK_HEADERS(wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h sys/statfs.h float.h linux/cdrom.h sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h)
240 AC_HEADER_STAT()
241 AC_C_CONST()
242 AC_TYPE_SIZE_T()
243 AC_CHECK_SIZEOF(long long,0)
245 dnl **** statfs checks ****
247 if test "$ac_cv_header_sys_vfs_h" = "yes"
248 then
249     AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
250                     wine_cv_sys_vfs_has_statfs,
251         AC_TRY_COMPILE([
252         #include <sys/types.h>
253         #ifdef HAVE_SYS_PARAM_H
254         # include <sys/param.h>
255         #endif
256         #include <sys/vfs.h>
257         ],[
258                 struct statfs stfs;
260                 memset(&stfs,0,sizeof(stfs));
261         ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
262         )
263     )
264     if test "$wine_cv_sys_vfs_has_statfs" = "yes"
265     then
266       AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
267     fi
270 if test "$ac_cv_header_sys_statfs_h" = "yes"
271 then
272     AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
273                     wine_cv_sys_statfs_has_statfs,
274         AC_TRY_COMPILE([
275         #include <sys/types.h>
276         #ifdef HAVE_SYS_PARAM_H
277         # include <sys/param.h>
278         #endif
279         #include <sys/statfs.h>
280         ],[
281                 struct statfs stfs;
282         ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
283         )
284     )
285     if test "$wine_cv_sys_statfs_has_statfs" = "yes"
286     then
287       AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
288     fi
291 if test "$ac_cv_header_sys_mount_h" = "yes"
292 then
293     AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
294                     wine_cv_sys_mount_has_statfs,
295         AC_TRY_COMPILE([
296         #include <sys/types.h>
297         #ifdef HAVE_SYS_PARAM_H
298         # include <sys/param.h>
299         #endif
300         #include <sys/mount.h>
301         ],[
302                 struct statfs stfs;
303         ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
304         )
305     )
306     if test "$wine_cv_sys_mount_has_statfs" = "yes"
307     then
308       AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
309     fi
312 dnl **** FIXME: what about mixed cases, where we need two of them? ***
314 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
315   [ if test "x$statfs_bfree" = "xno"
316     then
317         wine_cv_statfs_bfree=no
318     else
319         AC_TRY_COMPILE([
320         #include <sys/types.h>
321         #ifdef HAVE_SYS_PARAM_H
322         # include <sys/param.h>
323         #endif
324         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
325         # include <sys/mount.h>
326         #else
327         # ifdef STATFS_DEFINED_BY_SYS_VFS
328         #  include <sys/vfs.h>
329         # else
330         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
331         #   include <sys/statfs.h>
332         #  endif
333         # endif
334         #endif
335         ],[
336                 struct statfs stfs;
338                 stfs.f_bfree++;
339         ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
340         )
341     fi ] )
342 if test "$wine_cv_statfs_bfree" = "yes"
343 then
344   AC_DEFINE(STATFS_HAS_BFREE)
347 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
348   [ if test "x$statfs_bavail" = "xno"
349     then
350         wine_cv_statfs_bavail=no
351     else
352         AC_TRY_COMPILE([
353         #include <sys/types.h>
354         #ifdef HAVE_SYS_PARAM_H
355         # include <sys/param.h>
356         #endif
357         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
358         # include <sys/mount.h>
359         #else
360         # ifdef STATFS_DEFINED_BY_SYS_VFS
361         #  include <sys/vfs.h>
362         # else
363         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
364         #   include <sys/statfs.h>
365         #  endif
366         # endif
367         #endif
368         ],[
369                 struct statfs stfs;
371                 stfs.f_bavail++;
372         ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
373         )
374     fi ] )
375 if test "$wine_cv_statfs_bavail" = "yes"
376 then
377   AC_DEFINE(STATFS_HAS_BAVAIL)
380 dnl *** check for working sigaltstack
381 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
383 AC_CACHE_CHECK("for working sigaltstack",
384         ac_cv_c_working_sigaltstack,
385         AC_TRY_RUN([
386         #include <stdio.h>
387         #include <time.h> /* <sys/time.h> ? bad magic without end */
388         #include <sys/types.h>
389         #include <sys/signal.h>
390         #ifdef HAVE_SYS_PARAM_H
391         # include <sys/param.h>
392         #endif
393         #ifdef HAVE_SYSCALL_H
394         # include <syscall.h>
395         #else
396         # ifdef HAVE_SYS_SYSCALL_H
397         #  include <sys/syscall.h>
398         # endif
399         #endif
400         
401         unsigned char *xaltstack;
403         int
404         main(int argc,char **argv) {
405             struct sigaltstack  ss;
407             xaltstack = malloc(16384);
408             ss.ss_sp    = xaltstack;
409             ss.ss_size  = 16384;
410             ss.ss_flags = 0;
411             if (sigaltstack(&ss, NULL) < 0) {
412                 /* this catches the glibc case */
413                 perror("sigaltstack");
414                 return (1); /* aka exit(1) aka fail */
415             }
416             /* assume it works. */
417             return 0; /* OK */
418         }
419         ],
420         ac_cv_c_working_sigaltstack="yes",
421         ac_cv_c_working_sigaltstack="no",
422         ac_cv_c_working_sigaltstack="no"
425 if test "$ac_cv_c_working_sigaltstack" = "yes"
426 then
427     AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
431 dnl **** Generate output files ****
433 MAKE_RULES=Make.rules
434 AC_SUBST_FILE(MAKE_RULES)
436 AC_OUTPUT([
437 Make.rules
438 Makefile
439 controls/Makefile
440 debugger/Makefile
441 documentation/Makefile
442 files/Makefile
443 graphics/Makefile
444 graphics/metafiledrv/Makefile
445 graphics/psdrv/Makefile
446 graphics/win16drv/Makefile
447 graphics/x11drv/Makefile
448 if1632/Makefile
449 ipc/Makefile
450 library/Makefile
451 libtest/Makefile
452 loader/Makefile
453 loader/ne/Makefile
454 memory/Makefile
455 misc/Makefile
456 miscemu/Makefile
457 msdos/Makefile
458 multimedia/Makefile
459 objects/Makefile
460 ole/Makefile
461 programs/Makefile
462 programs/clock/Makefile
463 programs/notepad/Makefile
464 programs/progman/Makefile
465 programs/regtest/Makefile
466 programs/view/Makefile
467 programs/winhelp/Makefile
468 programs/winver/Makefile
469 rc/Makefile
470 relay32/Makefile
471 resources/Makefile
472 scheduler/Makefile
473 tools/Makefile
474 tools/wrc/Makefile
475 tsx11/Makefile
476 win32/Makefile
477 windows/Makefile ])
479 echo
480 echo "Configure finished.  Do 'make depend; make' to compile Wine."
481 echo
483 dnl Local Variables:
484 dnl comment-start: "dnl "
485 dnl comment-end: ""
486 dnl comment-start-skip: "\\bdnl\\b\\s *"
487 dnl compile-command: "autoconf"
488 dnl End: