Add a stub for GlobalMasterHandle.
[wine.git] / configure.in
blob092a4be154a9009d2c9a942ba700087580fdd06d
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 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 dnl AC_ARG_WITH(ipc,
35 dnl [  --enable-ipc            use inter-process communication for DDE],
36 dnl [if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
38 AC_ARG_ENABLE(debug,
39 [  --disable-debug         compile out all debugging messages],
40 [if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
42 AC_ARG_ENABLE(trace,
43 [  --disable-trace         compile out TRACE messages],
44 [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
46 AC_ARG_WITH(reentrant-x,
47 [  --without-reentrant-x   compile for use with non-reentrant X libraries])
49 AC_SUBST(MAIN_TARGET)
50 AC_SUBST(LIB_TARGET)
51 AC_SUBST(ALT_LINK)
52 AC_SUBST(OPTIONS)
54 if test "$DEBUG_MSGS" = "no"
55 then
56     AC_DEFINE(NO_DEBUG_MSGS)
57     AC_DEFINE(NO_TRACE_MSGS)
58 else
59     if test "$TRACE_MSGS" = "no"
60     then
61         AC_DEFINE(NO_TRACE_MSGS)
62     fi
65 dnl **** Check for some programs ****
67 AC_PROG_MAKE_SET
68 AC_PROG_CC
69 AC_PROG_CPP
70 AC_PATH_XTRA
71 AC_PROG_YACC
72 AC_PROG_LEX
73 AC_PROG_RANLIB
74 AC_PROG_INSTALL
75 AC_PROG_LN_S
76 AC_CHECK_PROG(C2MAN,c2man,c2man,true)
78 dnl **** Check for some libraries ****
80 dnl Check for -li386 for NetBSD and OpenBSD
81 AC_CHECK_LIB(i386,i386_set_ldt)
82 dnl Check for -lossaudio for NetBSD
83 AC_CHECK_LIB(ossaudio,_oss_ioctl)
84 dnl Check for -lw for Solaris
85 AC_CHECK_LIB(w,iswalnum)
86 dnl Check for -lnsl for Solaris
87 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
88 dnl Check for -lsocket for Solaris
89 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
90 dnl Check for -lxpg4 for FreeBSD
91 AC_CHECK_LIB(xpg4,setrunelocale)
93 AC_CHECK_HEADERS(dlfcn.h,
94         AC_CHECK_FUNCS(dlopen,
95                 AC_DEFINE(HAVE_DL_API),
96                 AC_CHECK_LIB(dl,dlopen,
97                         AC_DEFINE(HAVE_DL_API)
98                         LIBS="$LIBS -ldl"
99                 )
100         )
102 AC_SUBST(XLIB)
103 if test "$have_x" = "yes"
104 then
105     XLIB="-lXext -lX11"
106     ac_save_CPPFLAGS="$CPPFLAGS"
107     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
109     dnl Check for -lXpm
110     AC_CHECK_HEADERS(X11/xpm.h)
111     if test "$ac_cv_header_X11_xpm_h" = "yes"
112     then 
113         AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
114     fi
116     dnl Check for X Shm extension
117     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/XShm.h)
118     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_XShm_h" = "yes"
119     then 
120         AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
121     fi
122     dnl Check for XFree86 DGA extension
123     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86dga.h)
124     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
125     then 
126          AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
127     fi
129     dnl Check for XFree86 VMODE extension
130     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86vmode.h)
131     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
132     then 
133         AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
134     fi
136     dnl Check for the presence of Mesa
137     AC_CHECK_HEADERS(GL/gl.h GL/osmesa.h)
138     if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_osmesa_h" = "yes"
139     then
140         dnl Check for some problems due to old Mesa versions
141         AC_CACHE_CHECK("for up-to-date Mesa version", wine_cv_mesa_version_OK,
142           AC_TRY_COMPILE(
143             [#include <GL/gl.h>],
144             [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
145             [wine_cv_mesa_version_OK="yes"],
146             [wine_cv_mesa_version_OK="no"]
147           )
148         )
150         if test "$wine_cv_mesa_version_OK" = "yes"
151         then
152             dnl Check for the presense of the library
153             AC_CHECK_LIB(MesaGL,OSMesaCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm)
154         fi
155     fi
157     CPPFLAGS="$ac_save_CPPFLAGS"
158 else
159     XLIB=""
160     X_CFLAGS=""
161     X_LIBS=""
164 dnl **** Check which curses lib to use ***
165 AC_CHECK_HEADERS(ncurses.h)
166 if test "$ac_cv_header_ncurses_h" = "yes"
167 then 
168     AC_CHECK_LIB(ncurses,waddch)
170 if test "$ac_cv_lib_ncurses_waddch" = "yes"
171 then
172     AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
173     AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
174 else
175     AC_CHECK_HEADERS(curses.h)
176     if test "$ac_cv_header_curses_h" = "yes"
177     then    
178        AC_CHECK_LIB(curses,waddch)
179        AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
180        AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
181     fi
184 dnl **** Check for IPX (currently Linux only) ****
185 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
186  AC_TRY_COMPILE(
187    [#include <sys/socket.h>
188     #include <netipx/ipx.h>],
189    [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
190    [AC_DEFINE(HAVE_IPX_GNU)
191     ac_cv_c_ipx_gnu="yes"],
192    [ac_cv_c_ipx_gnu="no"])
195 if test "$ac_cv_c_ipx_gnu" = "no"
196 then
197  AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
198   AC_TRY_COMPILE(
199     [#include <sys/socket.h>
200      #include <asm/types.h>
201      #include <linux/ipx.h>],
202     [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
203     [AC_DEFINE(HAVE_IPX_LINUX)
204      ac_cv_c_ipx_linux="yes"],
205     [ac_cv_c_ipx_linux="no"])
206   )
209 dnl **** Check for Open Sound System ****
210 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
212 AC_CACHE_CHECK("for Open Sound System",
213         ac_cv_c_opensoundsystem,
214         AC_TRY_COMPILE([
215         #if defined(HAVE_SYS_SOUNDCARD_H)
216                 #include <sys/soundcard.h>
217         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
218                 #include <machine/soundcard.h>
219         #elif defined(HAVE_SOUNDCARD_H)
220                 #include <soundcard.h>
221         #endif
222         ],[
224 /* check for one of the Open Sound System specific SNDCTL_ defines */
225 #if !defined(SNDCTL_DSP_STEREO)
226 #error No open sound system
227 #endif
228 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
230 if test "$ac_cv_c_opensoundsystem" = "yes"
231 then
232     AC_DEFINE(HAVE_OSS)
235 dnl **** If ln -s doesn't work, use cp instead ****
236 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
238 dnl **** Check for gcc strength-reduce bug ****
240 if test "x${GCC}" = "xyes"
241 then
242   CFLAGS="$CFLAGS -Wall"
243   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
244                   AC_TRY_RUN([
245 int main(void) {
246   static int Array[[3]];
247   unsigned int B = 3;
248   int i;
249   for(i=0; i<B; i++) Array[[i]] = i - 3;
250   exit( Array[[1]] != -2 );
252     ac_cv_c_gcc_strength_bug="no",
253     ac_cv_c_gcc_strength_bug="yes",
254     ac_cv_c_gcc_strength_bug="yes") )
255   if test "$ac_cv_c_gcc_strength_bug" = "yes"
256   then
257     CFLAGS="$CFLAGS -fno-strength-reduce"
258   fi
261 dnl **** Check for underscore on external symbols ****
263 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
264                ac_cv_c_extern_prefix,
265 [saved_libs=$LIBS
266 LIBS="conftest_asm.s $LIBS"
267 cat > conftest_asm.s <<EOF
268         .globl _ac_test
269 _ac_test:
270         .long 0
272 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
273             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
274 LIBS=$saved_libs])
275 if test "$ac_cv_c_extern_prefix" = "yes"
276 then
277   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
280 dnl **** Check for .string in assembler ****
282 AC_CACHE_CHECK("whether assembler accepts .string",
283                ac_cv_c_asm_string,
284 [saved_libs=$LIBS
285 LIBS="conftest_asm.s $LIBS"
286 cat > conftest_asm.s <<EOF
287         .string "test"
289 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
290 LIBS=$saved_libs])
291 if test "$ac_cv_c_asm_string" = "yes"
292 then
293   AC_DEFINE(HAVE_ASM_STRING)
296 dnl **** Check for working dll ****
298 DLLFLAGS=""
299 LDSHARED=""
300 if test "$LIB_TARGET" = "libwine.so.1.0"
301 then
302   AC_CACHE_CHECK("whether we can build a Linux dll",
303                  ac_cv_c_dll_linux,
304   [saved_cflags=$CFLAGS
305   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
306   AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
307   CFLAGS=$saved_cflags
308   ])
309   if test "$ac_cv_c_dll_linux" = "yes"
310   then
311     DLLFLAGS="-fPIC"
312     LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
313   else
314     AC_CACHE_CHECK("whether we can build a NetBSD dll",
315                    ac_cv_c_dll_netbsd,
316     [saved_cflags=$CFLAGS
317     CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
318     AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
319     CFLAGS=$saved_cflags
320     ])
321     if test "$ac_cv_c_dll_netbsd" = "yes"
322     then
323       DLLFLAGS="-fPIC"
324       LDSHARED="ld -Bshareable -Bforcearchive"
325     fi
326   fi
327   if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
328   then
329     LIB_TARGET="libwine.a"
330   fi
332 AC_SUBST(DLLFLAGS)
333 AC_SUBST(LDSHARED)
335 dnl **** Check for reentrant libc ****
337 dnl For cross-compiling we blindly assume that libc is reentrant. This is
338 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
340 wine_cv_libc_reentrant=no 
341 dnl 
342 dnl Linux style errno location
343 dnl 
344 AC_CACHE_CHECK("for reentrant libc: __errno_location", wine_cv_libc_r__errno_location,
345   [AC_TRY_RUN([int myerrno = 0;
346 char buf[256];
347 int *__errno_location(){return &myerrno;}
348 main(){connect(0,buf,255); exit(!myerrno);}],
349   wine_cv_libc_r__errno_location=yes, wine_cv_libc_r__errno_location=no,
350   wine_cv_libc_r__errno_location=yes )
352 if test "$wine_cv_libc_r__errno_location" = "yes"
353 then
354     AC_DEFINE(HAVE__ERRNO_LOCATION)
355     wine_cv_libc_reentrant=__errno_location 
358 dnl FreeBSD style errno location
359 dnl 
360 AC_CACHE_CHECK("for reentrant libc: __error", wine_cv_libc_r__error,
361   [AC_TRY_RUN([int myerrno = 0;
362 char buf[256];
363 int *__error(){return &myerrno;}
364 main(){connect(0,buf,255); exit(!myerrno);}],
365     wine_cv_libc_r__error=yes, wine_cv_libc_r__error=no,
366     wine_cv_libc_r__error=yes )
368 if test "$wine_cv_libc_r__error" = "yes"
369 then
370     AC_DEFINE(HAVE__ERROR)
371     wine_cv_libc_reentrant=__error 
374 dnl Solaris style errno location
375 dnl 
376 AC_CACHE_CHECK("for reentrant libc: ___errno", wine_cv_libc_r___errno,
377   [AC_TRY_RUN([int myerrno = 0;
378 char buf[256];
379 int *___errno(){return &myerrno;}
380 main(){connect(0,buf,255); exit(!myerrno);}],
381     wine_cv_libc_r___errno=yes, wine_cv_libc_r___errno=no,
382     wine_cv_libc_r___errno=yes )
384 if test "$wine_cv_libc_r___errno" = "yes"
385 then
386     AC_DEFINE(HAVE___ERRNO)
387     wine_cv_libc_reentrant=___errno 
389 if test "$wine_cv_libc_reentrant" = "no" 
390 then
391   AC_DEFINE(NO_REENTRANT_LIBC)
394 dnl **** Check for reentrant X libraries ****
396 dnl This may fail to determine whether X libraries are reentrant if
397 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
398 dnl is possible with the --without-reentrant-x option.
400 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
401 then
402 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
403   [ if test "x$with_reentrant_x" = "xno" 
404     then
405         wine_cv_x_reentrant=no
406     else
407         libX11_check=none
408         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
409             if test -r $dir/libX11.so; then
410                 libX11_check="-D $dir/libX11.so"
411                 break 1
412             fi
413             if test -r $dir/libX11.a; then
414                 libX11_check="$dir/libX11.a"
415                 break 1
416             fi
417         done
418         if test "$libX11_check" != "none"; then
419             if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
420             then
421                 wine_cv_x_reentrant=yes
422             else
423                 wine_cv_x_reentrant=no
424             fi
425         else
426             wine_cv_x_reentrant=unknown
427         fi
428     fi ] )
429 else
430     wine_cv_x_reentrant=no
432 if test "$wine_cv_x_reentrant" = "no"
433 then
434   AC_DEFINE(NO_REENTRANT_X11)
437 dnl **** Check for functions ****
439 AC_CHECK_FUNCS(\
440         _lwp_create \
441         clone \
442         getpagesize \
443         memmove \
444         rfork \
445         sendmsg \
446         sigaltstack \
447         strerror \
448         stricmp \
449         tcgetattr \
450         timegm \
451         usleep \
452         vfscanf \
453         wait4 \
454         waitpid \
457 dnl **** Check for header files ****
459 AC_CHECK_HEADERS(\
460         arpa/nameser.h \
461         curses.h \
462         elf.h \
463         float.h \
464         libio.h \
465         linux/cdrom.h \
466         linux/ucdrom.h \
467         ncurses.h \
468         net/if.h \
469         netinet/in.h \
470         resolv.h \
471         strings.h \
472         sys/cdio.h \
473         sys/file.h \
474         sys/filio.h \
475         sys/lwp.h \
476         sys/modem.h \
477         sys/mount.h \
478         sys/param.h \
479         sys/sockio.h \
480         sys/statfs.h \
481         sys/strtio.h \
482         sys/syscall.h \
483         sys/vfs.h \
484         syscall.h \
485         ucontext.h \
486         unistd.h \
487         wctype.h \
489 AC_HEADER_STAT()
491 dnl **** Check for types ****
493 AC_C_CONST()
494 AC_TYPE_SIZE_T()
495 AC_CHECK_SIZEOF(long long,0)
497 dnl **** statfs checks ****
499 if test "$ac_cv_header_sys_vfs_h" = "yes"
500 then
501     AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
502                     wine_cv_sys_vfs_has_statfs,
503         AC_TRY_COMPILE([
504         #include <sys/types.h>
505         #ifdef HAVE_SYS_PARAM_H
506         # include <sys/param.h>
507         #endif
508         #include <sys/vfs.h>
509         ],[
510                 struct statfs stfs;
512                 memset(&stfs,0,sizeof(stfs));
513         ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
514         )
515     )
516     if test "$wine_cv_sys_vfs_has_statfs" = "yes"
517     then
518       AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
519     fi
522 if test "$ac_cv_header_sys_statfs_h" = "yes"
523 then
524     AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
525                     wine_cv_sys_statfs_has_statfs,
526         AC_TRY_COMPILE([
527         #include <sys/types.h>
528         #ifdef HAVE_SYS_PARAM_H
529         # include <sys/param.h>
530         #endif
531         #include <sys/statfs.h>
532         ],[
533                 struct statfs stfs;
534         ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
535         )
536     )
537     if test "$wine_cv_sys_statfs_has_statfs" = "yes"
538     then
539       AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
540     fi
543 if test "$ac_cv_header_sys_mount_h" = "yes"
544 then
545     AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
546                     wine_cv_sys_mount_has_statfs,
547         AC_TRY_COMPILE([
548         #include <sys/types.h>
549         #ifdef HAVE_SYS_PARAM_H
550         # include <sys/param.h>
551         #endif
552         #include <sys/mount.h>
553         ],[
554                 struct statfs stfs;
555         ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
556         )
557     )
558     if test "$wine_cv_sys_mount_has_statfs" = "yes"
559     then
560       AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
561     fi
564 dnl **** FIXME: what about mixed cases, where we need two of them? ***
566 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
567   [ if test "x$statfs_bfree" = "xno"
568     then
569         wine_cv_statfs_bfree=no
570     else
571         AC_TRY_COMPILE([
572         #include <sys/types.h>
573         #ifdef HAVE_SYS_PARAM_H
574         # include <sys/param.h>
575         #endif
576         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
577         # include <sys/mount.h>
578         #else
579         # ifdef STATFS_DEFINED_BY_SYS_VFS
580         #  include <sys/vfs.h>
581         # else
582         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
583         #   include <sys/statfs.h>
584         #  endif
585         # endif
586         #endif
587         ],[
588                 struct statfs stfs;
590                 stfs.f_bfree++;
591         ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
592         )
593     fi ] )
594 if test "$wine_cv_statfs_bfree" = "yes"
595 then
596   AC_DEFINE(STATFS_HAS_BFREE)
599 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
600   [ if test "x$statfs_bavail" = "xno"
601     then
602         wine_cv_statfs_bavail=no
603     else
604         AC_TRY_COMPILE([
605         #include <sys/types.h>
606         #ifdef HAVE_SYS_PARAM_H
607         # include <sys/param.h>
608         #endif
609         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
610         # include <sys/mount.h>
611         #else
612         # ifdef STATFS_DEFINED_BY_SYS_VFS
613         #  include <sys/vfs.h>
614         # else
615         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
616         #   include <sys/statfs.h>
617         #  endif
618         # endif
619         #endif
620         ],[
621                 struct statfs stfs;
623                 stfs.f_bavail++;
624         ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
625         )
626     fi ] )
627 if test "$wine_cv_statfs_bavail" = "yes"
628 then
629   AC_DEFINE(STATFS_HAS_BAVAIL)
632 dnl *** check for working sigaltstack
633 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
635 AC_CACHE_CHECK("for working sigaltstack",
636         ac_cv_c_working_sigaltstack,
637         AC_TRY_RUN([
638         #include <stdio.h>
639         #include <time.h> /* <sys/time.h> ? bad magic without end */
640         #include <sys/types.h>
641         #include <sys/signal.h>
642         #ifdef HAVE_SYS_PARAM_H
643         # include <sys/param.h>
644         #endif
645         #ifdef HAVE_SYSCALL_H
646         # include <syscall.h>
647         #else
648         # ifdef HAVE_SYS_SYSCALL_H
649         #  include <sys/syscall.h>
650         # endif
651         #endif
652         
653         unsigned char *xaltstack;
655         int
656         main(int argc,char **argv) {
657             struct sigaltstack  ss;
659             xaltstack = malloc(16384);
660             ss.ss_sp    = xaltstack;
661             ss.ss_size  = 16384;
662             ss.ss_flags = 0;
663             if (sigaltstack(&ss, NULL) < 0) {
664                 /* this catches the glibc case */
665                 perror("sigaltstack");
666                 return (1); /* aka exit(1) aka fail */
667             }
668             /* assume it works. */
669             return 0; /* OK */
670         }
671         ],
672         ac_cv_c_working_sigaltstack="yes",
673         ac_cv_c_working_sigaltstack="no",
674         ac_cv_c_working_sigaltstack="no"
677 if test "$ac_cv_c_working_sigaltstack" = "yes"
678 then
679     AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
683 dnl *** check for file descriptor passing with msg_accrights
685 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
686  AC_TRY_COMPILE([#include <sys/types.h>
687 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
688                 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
689 if test "$ac_cv_c_msg_accrights" = "yes"
690 then
691     AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
694 dnl $GCC is set by autoconf
695 GCC_NO_BUILTIN=""
696 if test "$GCC" = "yes"
697 then
698     GCC_NO_BUILTIN="-fno-builtin"
700 AC_SUBST(GCC_NO_BUILTIN)
702 dnl **** Generate output files ****
704 MAKE_RULES=Make.rules
705 AC_SUBST_FILE(MAKE_RULES)
707 AC_OUTPUT([
708 Make.rules
709 Makefile
710 console/Makefile
711 controls/Makefile
712 debugger/Makefile
713 dlls/Makefile
714 dlls/advapi32/Makefile
715 dlls/avifil32/Makefile
716 dlls/comctl32/Makefile
717 dlls/commdlg/Makefile
718 dlls/imagehlp/Makefile
719 dlls/msacm/Makefile
720 dlls/msacm32/Makefile
721 dlls/ntdll/Makefile
722 dlls/psapi/Makefile
723 dlls/rasapi32/Makefile
724 dlls/shell32/Makefile
725 dlls/tapi32/Makefile
726 dlls/ver/Makefile
727 dlls/version/Makefile
728 dlls/winaspi/Makefile
729 dlls/wnaspi32/Makefile
730 documentation/Makefile
731 files/Makefile
732 graphics/Makefile
733 graphics/metafiledrv/Makefile
734 graphics/psdrv/Makefile
735 graphics/ttydrv/Makefile
736 graphics/win16drv/Makefile
737 graphics/x11drv/Makefile
738 if1632/Makefile
739 include/Makefile
740 ipc/Makefile
741 library/Makefile
742 libtest/Makefile
743 loader/Makefile
744 loader/ne/Makefile
745 loader/dos/Makefile
746 memory/Makefile
747 misc/Makefile
748 miscemu/Makefile
749 msdos/Makefile
750 multimedia/Makefile
751 objects/Makefile
752 ole/Makefile
753 programs/Makefile
754 programs/clock/Makefile
755 programs/cmdlgtst/Makefile
756 programs/control/Makefile
757 programs/avitools/Makefile
758 programs/notepad/Makefile
759 programs/progman/Makefile
760 programs/regtest/Makefile
761 programs/regapi/Makefile
762 programs/view/Makefile
763 programs/winhelp/Makefile
764 programs/winver/Makefile
765 rc/Makefile
766 relay32/Makefile
767 resources/Makefile
768 scheduler/Makefile
769 server/Makefile
770 tools/Makefile
771 tools/wrc/Makefile
772 tsx11/Makefile
773 win32/Makefile
774 windows/Makefile
775 windows/ttydrv/Makefile
776 windows/x11drv/Makefile ])
778 if test "$have_x" = "no"
779 then
780   echo
781   echo "*** Warning: X development files not found. Wine will be built without"
782   echo "*** X support, which currently does not work, and would probably not be"
783   echo "*** what you want anyway. You will need to install devel packages of"
784   echo "*** Xlib/Xfree86 and Xpm at the very least."
785 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
786 then
787   echo
788   echo "*** Warning: Xpm development files not found. Wine will be built without"
789   echo "*** Xpm support, which currently does not work. You will need to install"
790   echo "*** devel packages of Xpm."
793 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
794 then
795   echo
796   echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
797   echo "*** terminal resize support. Consider upgrading ncurses."
800 if test "$wine_cv_libc_reentrant" = "no" 
801 then
802   echo
803   echo "*** Warning: non-reentrant libc detected. Wine will be build without"
804   echo "*** thread support. Consider upgrading libc to a more recent"
805   echo "*** reentrant version of libc."
808 if test "$wine_cv_mesa_version_OK" = "no"
809 then
810   echo
811   echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
812   echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)"
815 echo
816 echo "Configure finished.  Do 'make depend && make' to compile Wine."
817 echo
819 dnl Local Variables:
820 dnl comment-start: "dnl "
821 dnl comment-end: ""
822 dnl comment-start-skip: "\\bdnl\\b\\s *"
823 dnl compile-command: "autoconf"
824 dnl End: