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