Fix problem with EN_UPDATE notification sent by edit control.
[wine/multimedia.git] / configure.in
blob8ae78ea704c60f6b2e117e3ca123d7d65f8d0ffd
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.
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 ALT_LINK="-L\$(TOPOBJDIR) -lwine"
19 TRACE_MSGS=yes  # the TRACE() macro
20 DEBUG_MSGS=yes  # the TRACE(), WARN(), and FIXME() macros.
22 AC_ARG_ENABLE(emulator,
23 [  --disable-emulator      build only the Wine library, not the emulator],
24 [if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi])
26 AC_ARG_ENABLE(dll,
27 [  --enable-dll            build the Wine library as a DLL],
28 [if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi])
30 AC_ARG_ENABLE(lib,
31 [  --disable-lib           build the Wine without building libwine.a],
32 [if test "$enableval" = "no"; then ALT_LINK="\$(LIBOBJS) \$(X11OBJS)"; LIB_TARGET=""; fi])
34 AC_ARG_ENABLE(debug,
35 [  --disable-debug         compile out all debugging messages],
36 [if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
38 AC_ARG_ENABLE(trace,
39 [  --disable-trace         compile out TRACE messages],
40 [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
42 AC_ARG_WITH(reentrant-x,
43 [  --without-reentrant-x   compile for use with non-reentrant X libraries])
45 AC_SUBST(MAIN_TARGET)
46 AC_SUBST(LIB_TARGET)
47 AC_SUBST(ALT_LINK)
48 AC_SUBST(OPTIONS)
50 if test "$DEBUG_MSGS" = "no"
51 then
52     AC_DEFINE(NO_DEBUG_MSGS)
53     AC_DEFINE(NO_TRACE_MSGS)
54 else
55     if test "$TRACE_MSGS" = "no"
56     then
57         AC_DEFINE(NO_TRACE_MSGS)
58     fi
61 dnl **** Check for some programs ****
63 AC_PROG_MAKE_SET
64 AC_PROG_CC
65 AC_PROG_CPP
66 AC_PATH_XTRA
67 AC_PROG_YACC
68 AC_PROG_LEX
69 AC_PROG_RANLIB
70 AC_PROG_INSTALL
71 AC_PROG_LN_S
72 AC_CHECK_PROG(C2MAN,c2man,c2man,true)
73 AC_PATH_PROG(LDCONFIG, ldconfig, false, /sbin:/usr/sbin:$PATH)
75 dnl Check for lint
76 AC_CHECK_PROGS(LINT, lclint lint)
77 if test "$LINT" = "lint"
78 then
79   LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
80   dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
82 AC_SUBST(LINT)
83 AC_SUBST(LINTFLAGS)
85 dnl **** Check for some libraries ****
87 dnl Check for -lm for BeOS
88 AC_CHECK_LIB(m,sqrt)
89 dnl Check for -li386 for NetBSD and OpenBSD
90 AC_CHECK_LIB(i386,i386_set_ldt)
91 dnl Check for -lossaudio for NetBSD
92 AC_CHECK_LIB(ossaudio,_oss_ioctl)
93 dnl Check for -lw for Solaris
94 AC_CHECK_LIB(w,iswalnum)
95 dnl Check for -lnsl for Solaris
96 AC_CHECK_FUNCS(gethostbyname,, AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl", AC_CHECK_LIB(socket, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl", , -lnsl), -lsocket))
97 dnl Check for -lsocket for Solaris
98 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
99 dnl Check for -lxpg4 for FreeBSD
100 AC_CHECK_LIB(xpg4,setrunelocale)
101 dnl Check for -lmmap for OS/2
102 AC_CHECK_LIB(mmap,mmap)
103 dnl Check for openpty
104 AC_CHECK_FUNCS(openpty,,
105         AC_CHECK_LIB(util,openpty,
106                 AC_DEFINE(HAVE_OPENPTY)
107                 LIBS="$LIBS -lutil"
108         ))
110 AC_CHECK_HEADERS(dlfcn.h,
111         AC_CHECK_FUNCS(dlopen,
112                 AC_DEFINE(HAVE_DL_API),
113                 AC_CHECK_LIB(dl,dlopen,
114                         AC_DEFINE(HAVE_DL_API)
115                         LIBS="$LIBS -ldl"
116                 )
117         )
119 AC_SUBST(XLIB)
120 if test "$have_x" = "yes"
121 then
122     XLIB="-lXext -lX11"
123     ac_save_CPPFLAGS="$CPPFLAGS"
124     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
126     dnl Check for -lXpm
127     AC_CHECK_HEADERS(X11/xpm.h)
128     if test "$ac_cv_header_X11_xpm_h" = "yes"
129     then 
130         AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
131     fi
133     dnl Check for X Shm extension
134     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/XShm.h)
135     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_XShm_h" = "yes"
136     then 
137         AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
138     fi
139     dnl Check for XFree86 DGA / DGA 2.0 extension
140     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86dga.h)
141     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
142     then 
143          AC_CHECK_LIB(Xxf86dga,XDGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA2) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
144          AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
145     fi
147     dnl Check for XFree86 VMODE extension
148     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86vmode.h)
149     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
150     then 
151         AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
152     fi
154     dnl Check for the presence of Mesa
155     AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/osmesa.h)
156     if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
157     then
158         dnl Check for some problems due to old Mesa versions
159         AC_CACHE_CHECK("for up-to-date Mesa version", wine_cv_mesa_version_OK,
160           AC_TRY_COMPILE(
161             [#include <GL/gl.h>],
162             [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
163             [wine_cv_mesa_version_OK="yes"],
164             [wine_cv_mesa_version_OK="no"]
165           )
166         )
168         if test "$wine_cv_mesa_version_OK" = "yes"
169         then
170             dnl Check for the presense of the library
171             AC_CHECK_LIB(GL,glXCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lGL",,$X_LIBS -lXext -lX11 -lm)
172             if test "$ac_cv_lib_GL_glXCreateContext" = "no"
173             then
174                 AC_CHECK_LIB(MesaGL,glXCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm)
175             fi
176         fi
177     fi
179     CPPFLAGS="$ac_save_CPPFLAGS"
180 else
181     XLIB=""
182     X_CFLAGS=""
183     X_LIBS=""
186 dnl **** Check which curses lib to use ***
187 AC_CHECK_HEADERS(ncurses.h)
188 if test "$ac_cv_header_ncurses_h" = "yes"
189 then 
190     AC_CHECK_LIB(ncurses,waddch)
192 if test "$ac_cv_lib_ncurses_waddch" = "yes"
193 then
194     AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
195     AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
196 else
197     AC_CHECK_HEADERS(curses.h)
198     if test "$ac_cv_header_curses_h" = "yes"
199     then    
200        AC_CHECK_LIB(curses,waddch)
201        AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
202        AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
203     fi
206 dnl **** Check for IPX (currently Linux only) ****
207 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
208  AC_TRY_COMPILE(
209    [#include <sys/socket.h>
210     #include <netipx/ipx.h>],
211    [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
212    [AC_DEFINE(HAVE_IPX_GNU)
213     ac_cv_c_ipx_gnu="yes"],
214    [ac_cv_c_ipx_gnu="no"])
217 if test "$ac_cv_c_ipx_gnu" = "no"
218 then
219  AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
220   AC_TRY_COMPILE(
221     [#include <sys/socket.h>
222      #include <asm/types.h>
223      #include <linux/ipx.h>],
224     [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
225     [AC_DEFINE(HAVE_IPX_LINUX)
226      ac_cv_c_ipx_linux="yes"],
227     [ac_cv_c_ipx_linux="no"])
228   )
231 dnl **** Check for Open Sound System ****
232 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
234 AC_CACHE_CHECK("for Open Sound System",
235         ac_cv_c_opensoundsystem,
236         AC_TRY_COMPILE([
237         #if defined(HAVE_SYS_SOUNDCARD_H)
238                 #include <sys/soundcard.h>
239         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
240                 #include <machine/soundcard.h>
241         #elif defined(HAVE_SOUNDCARD_H)
242                 #include <soundcard.h>
243         #endif
244         ],[
246 /* check for one of the Open Sound System specific SNDCTL_ defines */
247 #if !defined(SNDCTL_DSP_STEREO)
248 #error No open sound system
249 #endif
250 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
252 if test "$ac_cv_c_opensoundsystem" = "yes"
253 then
254     AC_DEFINE(HAVE_OSS)
257 AC_CACHE_CHECK("for Open Sound System/MIDI interface",
258         ac_cv_c_opensoundsystem_midi,
259         AC_TRY_COMPILE([
260         #if defined(HAVE_SYS_SOUNDCARD_H)
261                 #include <sys/soundcard.h>
262         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
263                 #include <machine/soundcard.h>
264         #elif defined(HAVE_SOUNDCARD_H)
265                 #include <soundcard.h>
266         #endif
267         ],[
269 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
270 #if !defined(SNDCTL_SEQ_SYNC)
271 #error No open sound system MIDI interface
272 #endif
273 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
275 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
276 then
277     AC_DEFINE(HAVE_OSS_MIDI)
280 dnl **** If ln -s doesn't work, use cp instead ****
281 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
283 dnl **** Check for gcc strength-reduce bug ****
285 if test "x${GCC}" = "xyes"
286 then
287   CFLAGS="$CFLAGS -Wall"
288   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
289                   AC_TRY_RUN([
290 int main(void) {
291   static int Array[[3]];
292   unsigned int B = 3;
293   int i;
294   for(i=0; i<B; i++) Array[[i]] = i - 3;
295   exit( Array[[1]] != -2 );
297     ac_cv_c_gcc_strength_bug="no",
298     ac_cv_c_gcc_strength_bug="yes",
299     ac_cv_c_gcc_strength_bug="yes") )
300   if test "$ac_cv_c_gcc_strength_bug" = "yes"
301   then
302     CFLAGS="$CFLAGS -fno-strength-reduce"
303   fi
306 dnl **** Check for underscore on external symbols ****
308 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
309                ac_cv_c_extern_prefix,
310 [saved_libs=$LIBS
311 LIBS="conftest_asm.s $LIBS"
312 cat > conftest_asm.s <<EOF
313         .globl _ac_test
314 _ac_test:
315         .long 0
317 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
318             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
319 LIBS=$saved_libs])
320 if test "$ac_cv_c_extern_prefix" = "yes"
321 then
322   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
325 dnl **** Check for .string in assembler ****
327 AC_CACHE_CHECK("whether assembler accepts .string",
328                ac_cv_c_asm_string,
329 [saved_libs=$LIBS
330 LIBS="conftest_asm.s $LIBS"
331 cat > conftest_asm.s <<EOF
332         .string "test"
334 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
335 LIBS=$saved_libs])
336 if test "$ac_cv_c_asm_string" = "yes"
337 then
338   AC_DEFINE(HAVE_ASM_STRING)
341 dnl **** Check for working dll ****
343 DLLFLAGS=""
344 BUILDFLAGS=""
345 LDSHARED=""
346 if test "$LIB_TARGET" = "libwine.so.1.0"
347 then
348   AC_CACHE_CHECK("whether we can build a Linux dll",
349                  ac_cv_c_dll_linux,
350   [saved_cflags=$CFLAGS
351   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
352   AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
353   CFLAGS=$saved_cflags
354   ])
355   if test "$ac_cv_c_dll_linux" = "yes"
356   then
357     BUILDFLAGS="-pic"
358     DLLFLAGS="-fPIC"
359     LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
360   else
361     AC_CACHE_CHECK("whether we can build a UnixWare dll",
362                  ac_cv_c_dll_unixware,
363     [saved_cflags=$CFLAGS
364     CFLAGS="$CFLAGS -fPIC -Wl,-G,conftest.so.1.0"
365     AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
366     CFLAGS=$saved_cflags
367     ])
368     if test "$ac_cv_c_dll_unixware" = "yes"
369     then
370       BUILDFLAGS="-pic"
371       DLLFLAGS="-fPIC"
372       LDSHARED="\$(CC) -Wl,-G,-h,/usr/local/lib/libwine.so"
373     else
374       AC_CACHE_CHECK("whether we can build a NetBSD dll",
375                    ac_cv_c_dll_netbsd,
376       [saved_cflags=$CFLAGS
377       CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
378       AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
379       CFLAGS=$saved_cflags
380       ])
381       if test "$ac_cv_c_dll_netbsd" = "yes"
382       then
383         BUILDFLAGS="-pic"
384         DLLFLAGS="-fPIC"
385         LDSHARED="ld -Bshareable -Bforcearchive"
386       fi
387     fi
388   fi
389   if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_unixware" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
390   then
391     LIB_TARGET="libwine.a"
392   fi
394 AC_SUBST(BUILDFLAGS)
395 AC_SUBST(DLLFLAGS)
396 AC_SUBST(LDSHARED)
398 dnl **** Check for reentrant libc ****
400 dnl For cross-compiling we blindly assume that libc is reentrant. This is
401 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
403 wine_cv_libc_reentrant=no 
404 dnl 
405 dnl Linux style errno location
406 dnl 
407 AC_CACHE_CHECK("for reentrant libc: __errno_location", wine_cv_libc_r__errno_location,
408   [AC_TRY_RUN([int myerrno = 0;
409 char buf[256];
410 int *__errno_location(){return &myerrno;}
411 main(){connect(0,buf,255); exit(!myerrno);}],
412   wine_cv_libc_r__errno_location=yes, wine_cv_libc_r__errno_location=no,
413   wine_cv_libc_r__errno_location=yes )
415 if test "$wine_cv_libc_r__errno_location" = "yes"
416 then
417     AC_DEFINE(HAVE__ERRNO_LOCATION)
418     wine_cv_libc_reentrant=__errno_location 
421 dnl FreeBSD style errno location
422 dnl 
423 AC_CACHE_CHECK("for reentrant libc: __error", wine_cv_libc_r__error,
424   [AC_TRY_RUN([int myerrno = 0;
425 char buf[256];
426 int *__error(){return &myerrno;}
427 main(){connect(0,buf,255); exit(!myerrno);}],
428     wine_cv_libc_r__error=yes, wine_cv_libc_r__error=no,
429     wine_cv_libc_r__error=yes )
431 if test "$wine_cv_libc_r__error" = "yes"
432 then
433     AC_DEFINE(HAVE__ERROR)
434     wine_cv_libc_reentrant=__error 
437 dnl Solaris style errno location
438 dnl 
439 AC_CACHE_CHECK("for reentrant libc: ___errno", wine_cv_libc_r___errno,
440   [AC_TRY_RUN([int myerrno = 0;
441 char buf[256];
442 int *___errno(){return &myerrno;}
443 main(){connect(0,buf,255); exit(!myerrno);}],
444     wine_cv_libc_r___errno=yes, wine_cv_libc_r___errno=no,
445     wine_cv_libc_r___errno=yes )
447 if test "$wine_cv_libc_r___errno" = "yes"
448 then
449     AC_DEFINE(HAVE___ERRNO)
450     wine_cv_libc_reentrant=___errno 
453 dnl UnixWare style errno location
454 dnl 
455 AC_CACHE_CHECK("for reentrant libc: __thr_errno", wine_cv_libc_r__thr_errno,
456   [AC_TRY_RUN([int myerrno = 0;
457 char buf[256];
458 int *__thr_errno(){return &myerrno;}
459 main(){connect(0,buf,255); exit(!myerrno);}],
460     wine_cv_libc_r__thr_errno=yes, wine_cv_libc_r__thr_errno=no,
461     wine_cv_libc_r__thr_errno=yes )
463 if test "$wine_cv_libc_r__thr_errno" = "yes"
464 then
465     AC_DEFINE(HAVE__THR_ERRNO)
466     wine_cv_libc_reentrant=__thr_errno 
468 if test "$wine_cv_libc_reentrant" = "no" 
469 then
470   AC_DEFINE(NO_REENTRANT_LIBC)
473 dnl **** Check for reentrant X libraries ****
475 dnl This may fail to determine whether X libraries are reentrant if
476 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
477 dnl is possible with the --without-reentrant-x option.
479 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
480 then
481 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
482   [ if test "x$with_reentrant_x" = "xno" 
483     then
484         wine_cv_x_reentrant=no
485     else
486         libX11_check=none
487         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
488             if test -r $dir/libX11.so; then
489                 libX11_check="-D $dir/libX11.so"
490                 break 1
491             fi
492             if test -r $dir/libX11.a; then
493                 libX11_check="$dir/libX11.a"
494                 break 1
495             fi
496         done
497         if test "$libX11_check" != "none"; then
498             if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
499             then
500                 wine_cv_x_reentrant=yes
501             else
502                 wine_cv_x_reentrant=no
503             fi
504         else
505             wine_cv_x_reentrant=unknown
506         fi
507     fi ] )
508 else
509     wine_cv_x_reentrant=no
511 if test "$wine_cv_x_reentrant" = "no"
512 then
513   AC_DEFINE(NO_REENTRANT_X11)
516 dnl **** Check for endianness ****
518 AC_C_BIGENDIAN
520 dnl **** Check for functions ****
522 AC_FUNC_ALLOCA()
523 AC_CHECK_FUNCS(\
524         _lwp_create \
525         clone \
526         getnetbyaddr \
527         getnetbyname \
528         getpagesize \
529         getprotobyname \
530         getprotobynumber \
531         getservbyport \
532         getsockopt \
533         inet_network \
534         memmove \
535         rfork \
536         select \
537         sendmsg \
538         settimeofday \
539         sigaltstack \
540         statfs \
541         strcasecmp \
542         strerror \
543         strncasecmp \
544         tcgetattr \
545         timegm \
546         usleep \
547         vfscanf \
548         wait4 \
549         waitpid \
552 dnl **** Check for header files ****
554 AC_CHECK_HEADERS(\
555         a.out.h \
556         a_out.h \
557         arpa/inet.h \
558         arpa/nameser.h \
559         curses.h \
560         elf.h \
561         float.h \
562         libio.h \
563         link.h \
564         linux/cdrom.h \
565         linux/joystick.h \
566         linux/ucdrom.h \
567         ncurses.h \
568         net/if.h \
569         netinet/in.h \
570         netinet/tcp.h \
571         pty.h \
572         resolv.h \
573         sched.h \
574         socket.h \
575         strings.h \
576         sys/cdio.h \
577         sys/errno.h \
578         sys/file.h \
579         sys/filio.h \
580         sys/ipc.h \
581         sys/lwp.h \
582         sys/mman.h \
583         sys/modem.h \
584         sys/mount.h \
585         sys/msg.h \
586         sys/param.h \
587         sys/signal.h \
588         sys/shm.h \
589         sys/socket.h \
590         sys/sockio.h \
591         sys/statfs.h \
592         sys/strtio.h \
593         sys/syscall.h \
594         sys/wait.h \
595         sys/v86.h \
596         sys/v86intr.h \
597         sys/vfs.h \
598         sys/vm86.h \
599         syscall.h \
600         ucontext.h \
601         wctype.h \
603 AC_HEADER_STAT()
605 dnl **** Check for types ****
607 AC_C_CONST()
608 AC_C_INLINE()
609 AC_TYPE_SIZE_T()
610 AC_CHECK_SIZEOF(long long,0)
612 if test "$ac_cv_header_linux_joystick_h" = "yes"
613 then
614    AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
615         wine_cv_linux_joystick_22_api,
616         AC_TRY_COMPILE([
617         #include <sys/ioctl.h>
618         #include <linux/joystick.h>
620         struct js_event blub;
621         #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
622         #error "no 2.2 header"
623         #endif
624         ],/*empty*/,
625         wine_cv_linux_joystick_22_api=yes,
626         wine_cv_linux_joystick_22_api=no,
627         wine_cv_linux_joystick_22_api=no
628         )
629    )
630    if test "$wine_cv_linux_joystick_22_api"
631    then
632       AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API)
633    fi
636 dnl **** statfs checks ****
638 if test "$ac_cv_header_sys_vfs_h" = "yes"
639 then
640     AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
641                     wine_cv_sys_vfs_has_statfs,
642         AC_TRY_COMPILE([
643         #include <sys/types.h>
644         #ifdef HAVE_SYS_PARAM_H
645         # include <sys/param.h>
646         #endif
647         #include <sys/vfs.h>
648         ],[
649                 struct statfs stfs;
651                 memset(&stfs,0,sizeof(stfs));
652         ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
653         )
654     )
655     if test "$wine_cv_sys_vfs_has_statfs" = "yes"
656     then
657       AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
658     fi
661 if test "$ac_cv_header_sys_statfs_h" = "yes"
662 then
663     AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
664                     wine_cv_sys_statfs_has_statfs,
665         AC_TRY_COMPILE([
666         #include <sys/types.h>
667         #ifdef HAVE_SYS_PARAM_H
668         # include <sys/param.h>
669         #endif
670         #include <sys/statfs.h>
671         ],[
672                 struct statfs stfs;
673         ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
674         )
675     )
676     if test "$wine_cv_sys_statfs_has_statfs" = "yes"
677     then
678       AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
679     fi
682 if test "$ac_cv_header_sys_mount_h" = "yes"
683 then
684     AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
685                     wine_cv_sys_mount_has_statfs,
686         AC_TRY_COMPILE([
687         #include <sys/types.h>
688         #ifdef HAVE_SYS_PARAM_H
689         # include <sys/param.h>
690         #endif
691         #include <sys/mount.h>
692         ],[
693                 struct statfs stfs;
694         ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
695         )
696     )
697     if test "$wine_cv_sys_mount_has_statfs" = "yes"
698     then
699       AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
700     fi
703 dnl **** FIXME: what about mixed cases, where we need two of them? ***
705 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
706   [ if test "x$statfs_bfree" = "xno"
707     then
708         wine_cv_statfs_bfree=no
709     else
710         AC_TRY_COMPILE([
711         #include <sys/types.h>
712         #ifdef HAVE_SYS_PARAM_H
713         # include <sys/param.h>
714         #endif
715         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
716         # include <sys/mount.h>
717         #else
718         # ifdef STATFS_DEFINED_BY_SYS_VFS
719         #  include <sys/vfs.h>
720         # else
721         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
722         #   include <sys/statfs.h>
723         #  endif
724         # endif
725         #endif
726         ],[
727                 struct statfs stfs;
729                 stfs.f_bfree++;
730         ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
731         )
732     fi ] )
733 if test "$wine_cv_statfs_bfree" = "yes"
734 then
735   AC_DEFINE(STATFS_HAS_BFREE)
738 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
739   [ if test "x$statfs_bavail" = "xno"
740     then
741         wine_cv_statfs_bavail=no
742     else
743         AC_TRY_COMPILE([
744         #include <sys/types.h>
745         #ifdef HAVE_SYS_PARAM_H
746         # include <sys/param.h>
747         #endif
748         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
749         # include <sys/mount.h>
750         #else
751         # ifdef STATFS_DEFINED_BY_SYS_VFS
752         #  include <sys/vfs.h>
753         # else
754         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
755         #   include <sys/statfs.h>
756         #  endif
757         # endif
758         #endif
759         ],[
760                 struct statfs stfs;
762                 stfs.f_bavail++;
763         ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
764         )
765     fi ] )
766 if test "$wine_cv_statfs_bavail" = "yes"
767 then
768   AC_DEFINE(STATFS_HAS_BAVAIL)
771 dnl *** check for working sigaltstack
772 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
774 AC_CACHE_CHECK("for working sigaltstack",
775         ac_cv_c_working_sigaltstack,
776         AC_TRY_RUN([
777         #include <stdio.h>
778         #include <time.h> /* <sys/time.h> ? bad magic without end */
779         #include <sys/types.h>
780         #include <sys/signal.h>
781         #ifdef HAVE_SYS_PARAM_H
782         # include <sys/param.h>
783         #endif
784         #ifdef HAVE_SYSCALL_H
785         # include <syscall.h>
786         #else
787         # ifdef HAVE_SYS_SYSCALL_H
788         #  include <sys/syscall.h>
789         # endif
790         #endif
791         
792         unsigned char *xaltstack;
794         int
795         main(int argc,char **argv) {
796             struct sigaltstack  ss;
798             xaltstack = malloc(16384);
799             ss.ss_sp    = xaltstack;
800             ss.ss_size  = 16384;
801             ss.ss_flags = 0;
802             if (sigaltstack(&ss, NULL) < 0) {
803                 /* this catches the glibc case */
804                 perror("sigaltstack");
805                 return (1); /* aka exit(1) aka fail */
806             }
807             /* assume it works. */
808             return 0; /* OK */
809         }
810         ],
811         ac_cv_c_working_sigaltstack="yes",
812         ac_cv_c_working_sigaltstack="no",
813         ac_cv_c_working_sigaltstack="no"
816 if test "$ac_cv_c_working_sigaltstack" = "yes"
817 then
818     AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
822 dnl *** check for file descriptor passing with msg_accrights
824 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
825  AC_TRY_COMPILE([#include <sys/types.h>
826 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
827                 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
828 if test "$ac_cv_c_msg_accrights" = "yes"
829 then
830     AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
833 dnl *** check for the need to define __i386__
835 AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
836  AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
838 #endif],
839  ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
840 if test "$ac_cv_cpp_def_i386" = "yes"
841 then
842     CFLAGS="$CFLAGS -D__i386__"
843     LINTFLAGS="$LINTFLAGS -D__i386__"
846 dnl $GCC is set by autoconf
847 GCC_NO_BUILTIN=""
848 if test "$GCC" = "yes"
849 then
850     GCC_NO_BUILTIN="-fno-builtin"
852 AC_SUBST(GCC_NO_BUILTIN)
854 dnl **** Generate output files ****
856 MAKE_RULES=Make.rules
857 AC_SUBST_FILE(MAKE_RULES)
859 AC_OUTPUT([
860 Make.rules
861 Makefile
862 console/Makefile
863 controls/Makefile
864 debugger/Makefile
865 dlls/Makefile
866 dlls/advapi32/Makefile
867 dlls/avifil32/Makefile
868 dlls/comctl32/Makefile
869 dlls/commdlg/Makefile
870 dlls/crtdll/Makefile
871 dlls/dciman32/Makefile
872 dlls/display/Makefile
873 dlls/dplayx/Makefile
874 dlls/dsound/Makefile
875 dlls/icmp/Makefile
876 dlls/imagehlp/Makefile
877 dlls/imm32/Makefile
878 dlls/lzexpand/Makefile
879 dlls/mouse/Makefile
880 dlls/mpr/Makefile
881 dlls/msacm/Makefile
882 dlls/msacm32/Makefile
883 dlls/msnet32/Makefile
884 dlls/msvideo/Makefile
885 dlls/ntdll/Makefile
886 dlls/ole32/Makefile
887 dlls/oleaut32/Makefile
888 dlls/olecli/Makefile
889 dlls/oledlg/Makefile
890 dlls/olesvr/Makefile
891 dlls/psapi/Makefile
892 dlls/rasapi32/Makefile
893 dlls/shell32/Makefile
894 dlls/sound/Makefile
895 dlls/stress/Makefile
896 dlls/tapi32/Makefile
897 dlls/ver/Makefile
898 dlls/version/Makefile
899 dlls/win32s/Makefile
900 dlls/win87em/Makefile
901 dlls/winaspi/Makefile
902 dlls/windebug/Makefile
903 dlls/wing/Makefile
904 dlls/winmm/Makefile
905 dlls/winmm/mcianim/Makefile
906 dlls/winmm/mciavi/Makefile
907 dlls/winmm/mcicda/Makefile
908 dlls/winmm/mciseq/Makefile
909 dlls/winmm/mciwave/Makefile
910 dlls/winmm/midimap/Makefile
911 dlls/winmm/wavemap/Makefile
912 dlls/winmm/wineoss/Makefile
913 dlls/winspool/Makefile
914 dlls/wnaspi32/Makefile
915 documentation/Makefile
916 documentation/wine.conf.man
917 documentation/wine.man
918 files/Makefile
919 graphics/Makefile
920 graphics/enhmetafiledrv/Makefile
921 graphics/metafiledrv/Makefile
922 graphics/psdrv/Makefile
923 graphics/ttydrv/Makefile
924 graphics/win16drv/Makefile
925 graphics/x11drv/Makefile
926 if1632/Makefile
927 include/Makefile
928 library/Makefile
929 libtest/Makefile
930 loader/Makefile
931 loader/ne/Makefile
932 loader/dos/Makefile
933 memory/Makefile
934 misc/Makefile
935 miscemu/Makefile
936 msdos/Makefile
937 objects/Makefile
938 ole/Makefile
939 programs/Makefile
940 programs/clock/Makefile
941 programs/cmdlgtst/Makefile
942 programs/control/Makefile
943 programs/avitools/Makefile
944 programs/osversioncheck/Makefile
945 programs/notepad/Makefile
946 programs/progman/Makefile
947 programs/regtest/Makefile
948 programs/regapi/Makefile
949 programs/view/Makefile
950 programs/wcmd/Makefile
951 programs/winhelp/Makefile
952 programs/winver/Makefile
953 rc/Makefile
954 relay32/Makefile
955 resources/Makefile
956 scheduler/Makefile
957 server/Makefile
958 tools/Makefile
959 tools/wrc/Makefile
960 tsx11/Makefile
961 win32/Makefile
962 windows/Makefile
963 windows/ttydrv/Makefile
964 windows/x11drv/Makefile ])
966 if test "$have_x" = "no"
967 then
968   echo
969   echo "*** Warning: X development files not found. Wine will be built without"
970   echo "*** X support, which currently does not work, and would probably not be"
971   echo "*** what you want anyway. You will need to install devel packages of"
972   echo "*** Xlib/Xfree86 and Xpm at the very least."
973 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
974 then
975   echo
976   echo "*** Warning: Xpm development files not found. Wine will be built without"
977   echo "*** Xpm support, which currently does not work. You will need to install"
978   echo "*** devel packages of Xpm."
981 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
982 then
983   echo
984   echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
985   echo "*** terminal resize support. Consider upgrading ncurses."
988 if test "$wine_cv_libc_reentrant" = "no" 
989 then
990   echo
991   echo "*** Warning: non-reentrant libc detected. Wine will be build without"
992   echo "*** thread support. Consider upgrading libc to a more recent"
993   echo "*** reentrant version of libc."
996 if test "$wine_cv_mesa_version_OK" = "no"
997 then
998   echo
999   echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1000   echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)"
1003 echo
1004 echo "Configure finished.  Do 'make depend && make' to compile Wine."
1005 echo
1007 dnl Local Variables:
1008 dnl comment-start: "dnl "
1009 dnl comment-end: ""
1010 dnl comment-start-skip: "\\bdnl\\b\\s *"
1011 dnl compile-command: "autoconf"
1012 dnl End: