Added env ptr to new_process request
[wine/wine-kai.git] / configure.in
blobe30ef872e111a11baa0256c48d5db5a04e32f15e
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)
88 if test "$ac_cv_func_gethostbyname" = "no"
89 then
90     AC_CHECK_LIB(nsl,gethostbyname)
92 dnl Check for -lsocket for Solaris
93 AC_CHECK_FUNCS(connect)
94 if test "$ac_cv_func_connect" = "no"
95 then
96     AC_CHECK_LIB(socket,connect)
98 dnl Check for -lxpg4 for FreeBSD
99 AC_CHECK_LIB(xpg4,setrunelocale)
100 dnl Check for -ldl
101 AC_CHECK_LIB(dl,dlopen)
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 **** Check for union semun ****
237 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
238  AC_TRY_COMPILE([#include <sys/types.h>
239 #include <sys/sem.h>],[union semun foo],
240                 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
241 if test "$ac_cv_c_union_semun" = "yes"
242 then
243     AC_DEFINE(HAVE_UNION_SEMUN)
246 dnl **** If ln -s doesn't work, use cp instead ****
247 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
249 dnl **** Check for gcc strength-reduce bug ****
251 if test "x${GCC}" = "xyes"
252 then
253   CFLAGS="$CFLAGS -Wall"
254   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
255                   AC_TRY_RUN([
256 int main(void) {
257   static int Array[[3]];
258   unsigned int B = 3;
259   int i;
260   for(i=0; i<B; i++) Array[[i]] = i - 3;
261   exit( Array[[1]] != -2 );
263     ac_cv_c_gcc_strength_bug="no",
264     ac_cv_c_gcc_strength_bug="yes",
265     ac_cv_c_gcc_strength_bug="yes") )
266   if test "$ac_cv_c_gcc_strength_bug" = "yes"
267   then
268     CFLAGS="$CFLAGS -fno-strength-reduce"
269   fi
272 dnl **** Check for underscore on external symbols ****
274 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
275                ac_cv_c_extern_prefix,
276 [saved_libs=$LIBS
277 LIBS="conftest_asm.s $LIBS"
278 cat > conftest_asm.s <<EOF
279         .globl _ac_test
280 _ac_test:
281         .long 0
283 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
284             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
285 LIBS=$saved_libs])
286 if test "$ac_cv_c_extern_prefix" = "yes"
287 then
288   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
291 dnl **** Check for .string in assembler ****
293 AC_CACHE_CHECK("whether assembler accepts .string",
294                ac_cv_c_asm_string,
295 [saved_libs=$LIBS
296 LIBS="conftest_asm.s $LIBS"
297 cat > conftest_asm.s <<EOF
298         .string "test"
300 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
301 LIBS=$saved_libs])
302 if test "$ac_cv_c_asm_string" = "yes"
303 then
304   AC_DEFINE(HAVE_ASM_STRING)
307 dnl **** Check for working dll ****
309 DLLFLAGS=""
310 LDSHARED=""
311 if test "$LIB_TARGET" = "libwine.so.1.0"
312 then
313   AC_CACHE_CHECK("whether we can build a Linux dll",
314                  ac_cv_c_dll_linux,
315   [saved_cflags=$CFLAGS
316   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
317   AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
318   CFLAGS=$saved_cflags
319   ])
320   if test "$ac_cv_c_dll_linux" = "yes"
321   then
322     DLLFLAGS="-fPIC"
323     LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
324   else
325     AC_CACHE_CHECK("whether we can build a NetBSD dll",
326                    ac_cv_c_dll_netbsd,
327     [saved_cflags=$CFLAGS
328     CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
329     AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
330     CFLAGS=$saved_cflags
331     ])
332     if test "$ac_cv_c_dll_netbsd" = "yes"
333     then
334       DLLFLAGS="-fPIC"
335       LDSHARED="ld -Bshareable -Bforcearchive"
336     fi
337   fi
338   if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
339   then
340     LIB_TARGET="libwine.a"
341   fi
343 AC_SUBST(DLLFLAGS)
344 AC_SUBST(LDSHARED)
346 dnl **** Check for reentrant libc ****
348 dnl For cross-compiling we blindly assume that libc is reentrant. This is
349 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
351 wine_cv_libc_reentrant=no 
352 dnl 
353 dnl Linux style errno location
354 dnl 
355 AC_CACHE_CHECK("for reentrant libc: __errno_location", wine_cv_libc_r__errno_location,
356   [AC_TRY_RUN([int myerrno = 0;
357 char buf[256];
358 int *__errno_location(){return &myerrno;}
359 main(){connect(0,buf,255); exit(!myerrno);}],
360   wine_cv_libc_r__errno_location=yes, wine_cv_libc_r__errno_location=no,
361   wine_cv_libc_r__errno_location=yes )
363 if test "$wine_cv_libc_r__errno_location" = "yes"
364 then
365     AC_DEFINE(HAVE__ERRNO_LOCATION)
366     wine_cv_libc_reentrant=__errno_location 
369 dnl FreeBSD style errno location
370 dnl 
371 AC_CACHE_CHECK("for reentrant libc: __error", wine_cv_libc_r__error,
372   [AC_TRY_RUN([int myerrno = 0;
373 char buf[256];
374 int *__error(){return &myerrno;}
375 main(){connect(0,buf,255); exit(!myerrno);}],
376     wine_cv_libc_r__error=yes, wine_cv_libc_r__error=no,
377     wine_cv_libc_r__error=yes )
379 if test "$wine_cv_libc_r__error" = "yes"
380 then
381     AC_DEFINE(HAVE__ERROR)
382     wine_cv_libc_reentrant=__error 
385 dnl Solaris style errno location
386 dnl 
387 AC_CACHE_CHECK("for reentrant libc: ___errno", wine_cv_libc_r___errno,
388   [AC_TRY_RUN([int myerrno = 0;
389 char buf[256];
390 int *___errno(){return &myerrno;}
391 main(){connect(0,buf,255); exit(!myerrno);}],
392     wine_cv_libc_r___errno=yes, wine_cv_libc_r___errno=no,
393     wine_cv_libc_r___errno=yes )
395 if test "$wine_cv_libc_r___errno" = "yes"
396 then
397     AC_DEFINE(HAVE___ERRNO)
398     wine_cv_libc_reentrant=___errno 
400 if test "$wine_cv_libc_reentrant" = "no" 
401 then
402   AC_DEFINE(NO_REENTRANT_LIBC)
405 dnl **** Check for reentrant X libraries ****
407 dnl This may fail to determine whether X libraries are reentrant if
408 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
409 dnl is possible with the --without-reentrant-x option.
411 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
412 then
413 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
414   [ if test "x$with_reentrant_x" = "xno" 
415     then
416         wine_cv_x_reentrant=no
417     else
418         libX11_check=none
419         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
420             if test -r $dir/libX11.so; then
421                 libX11_check="-D $dir/libX11.so"
422                 break 1
423             fi
424             if test -r $dir/libX11.a; then
425                 libX11_check="$dir/libX11.a"
426                 break 1
427             fi
428         done
429         if test "$libX11_check" != "none"; then
430             if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
431             then
432                 wine_cv_x_reentrant=yes
433             else
434                 wine_cv_x_reentrant=no
435             fi
436         else
437             wine_cv_x_reentrant=unknown
438         fi
439     fi ] )
440 else
441     wine_cv_x_reentrant=no
443 if test "$wine_cv_x_reentrant" = "no"
444 then
445   AC_DEFINE(NO_REENTRANT_X11)
448 dnl **** Check for functions and header files ****
450 AC_CHECK_FUNCS(rfork clone _lwp_create getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
451 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 linux/ucdrom.h sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h dlfcn.h unistd.h sys/sockio.h net/if.h netinet/in.h sys/file.h libio.h curses.h ncurses.h elf.h arpa/nameser.h resolv.h sys/lwp.h ucontext.h)
452 AC_HEADER_STAT()
453 AC_C_CONST()
454 AC_TYPE_SIZE_T()
455 AC_CHECK_SIZEOF(long long,0)
457 dnl **** Check for sendmsg in -lsocket if not found above ****
459 if test $ac_cv_func_sendmsg = no; then
460     AC_CHECK_LIB(socket,sendmsg)
463 dnl **** statfs checks ****
465 if test "$ac_cv_header_sys_vfs_h" = "yes"
466 then
467     AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
468                     wine_cv_sys_vfs_has_statfs,
469         AC_TRY_COMPILE([
470         #include <sys/types.h>
471         #ifdef HAVE_SYS_PARAM_H
472         # include <sys/param.h>
473         #endif
474         #include <sys/vfs.h>
475         ],[
476                 struct statfs stfs;
478                 memset(&stfs,0,sizeof(stfs));
479         ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
480         )
481     )
482     if test "$wine_cv_sys_vfs_has_statfs" = "yes"
483     then
484       AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
485     fi
488 if test "$ac_cv_header_sys_statfs_h" = "yes"
489 then
490     AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
491                     wine_cv_sys_statfs_has_statfs,
492         AC_TRY_COMPILE([
493         #include <sys/types.h>
494         #ifdef HAVE_SYS_PARAM_H
495         # include <sys/param.h>
496         #endif
497         #include <sys/statfs.h>
498         ],[
499                 struct statfs stfs;
500         ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
501         )
502     )
503     if test "$wine_cv_sys_statfs_has_statfs" = "yes"
504     then
505       AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
506     fi
509 if test "$ac_cv_header_sys_mount_h" = "yes"
510 then
511     AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
512                     wine_cv_sys_mount_has_statfs,
513         AC_TRY_COMPILE([
514         #include <sys/types.h>
515         #ifdef HAVE_SYS_PARAM_H
516         # include <sys/param.h>
517         #endif
518         #include <sys/mount.h>
519         ],[
520                 struct statfs stfs;
521         ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
522         )
523     )
524     if test "$wine_cv_sys_mount_has_statfs" = "yes"
525     then
526       AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
527     fi
530 dnl **** FIXME: what about mixed cases, where we need two of them? ***
532 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
533   [ if test "x$statfs_bfree" = "xno"
534     then
535         wine_cv_statfs_bfree=no
536     else
537         AC_TRY_COMPILE([
538         #include <sys/types.h>
539         #ifdef HAVE_SYS_PARAM_H
540         # include <sys/param.h>
541         #endif
542         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
543         # include <sys/mount.h>
544         #else
545         # ifdef STATFS_DEFINED_BY_SYS_VFS
546         #  include <sys/vfs.h>
547         # else
548         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
549         #   include <sys/statfs.h>
550         #  endif
551         # endif
552         #endif
553         ],[
554                 struct statfs stfs;
556                 stfs.f_bfree++;
557         ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
558         )
559     fi ] )
560 if test "$wine_cv_statfs_bfree" = "yes"
561 then
562   AC_DEFINE(STATFS_HAS_BFREE)
565 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
566   [ if test "x$statfs_bavail" = "xno"
567     then
568         wine_cv_statfs_bavail=no
569     else
570         AC_TRY_COMPILE([
571         #include <sys/types.h>
572         #ifdef HAVE_SYS_PARAM_H
573         # include <sys/param.h>
574         #endif
575         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
576         # include <sys/mount.h>
577         #else
578         # ifdef STATFS_DEFINED_BY_SYS_VFS
579         #  include <sys/vfs.h>
580         # else
581         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
582         #   include <sys/statfs.h>
583         #  endif
584         # endif
585         #endif
586         ],[
587                 struct statfs stfs;
589                 stfs.f_bavail++;
590         ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
591         )
592     fi ] )
593 if test "$wine_cv_statfs_bavail" = "yes"
594 then
595   AC_DEFINE(STATFS_HAS_BAVAIL)
598 dnl *** check for working sigaltstack
599 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
601 AC_CACHE_CHECK("for working sigaltstack",
602         ac_cv_c_working_sigaltstack,
603         AC_TRY_RUN([
604         #include <stdio.h>
605         #include <time.h> /* <sys/time.h> ? bad magic without end */
606         #include <sys/types.h>
607         #include <sys/signal.h>
608         #ifdef HAVE_SYS_PARAM_H
609         # include <sys/param.h>
610         #endif
611         #ifdef HAVE_SYSCALL_H
612         # include <syscall.h>
613         #else
614         # ifdef HAVE_SYS_SYSCALL_H
615         #  include <sys/syscall.h>
616         # endif
617         #endif
618         
619         unsigned char *xaltstack;
621         int
622         main(int argc,char **argv) {
623             struct sigaltstack  ss;
625             xaltstack = malloc(16384);
626             ss.ss_sp    = xaltstack;
627             ss.ss_size  = 16384;
628             ss.ss_flags = 0;
629             if (sigaltstack(&ss, NULL) < 0) {
630                 /* this catches the glibc case */
631                 perror("sigaltstack");
632                 return (1); /* aka exit(1) aka fail */
633             }
634             /* assume it works. */
635             return 0; /* OK */
636         }
637         ],
638         ac_cv_c_working_sigaltstack="yes",
639         ac_cv_c_working_sigaltstack="no",
640         ac_cv_c_working_sigaltstack="no"
643 if test "$ac_cv_c_working_sigaltstack" = "yes"
644 then
645     AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
649 dnl *** check for file descriptor passing with msg_accrights
651 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
652  AC_TRY_COMPILE([#include <sys/types.h>
653 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
654                 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
655 if test "$ac_cv_c_msg_accrights" = "yes"
656 then
657     AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
660 dnl $GCC is set by autoconf
661 GCC_NO_BUILTIN=""
662 if test "$GCC" = "yes"
663 then
664     GCC_NO_BUILTIN="-fno-builtin"
666 AC_SUBST(GCC_NO_BUILTIN)
668 dnl **** Generate output files ****
670 MAKE_RULES=Make.rules
671 AC_SUBST_FILE(MAKE_RULES)
673 AC_OUTPUT([
674 Make.rules
675 Makefile
676 console/Makefile
677 controls/Makefile
678 debugger/Makefile
679 dlls/Makefile
680 dlls/advapi32/Makefile
681 dlls/avifil32/Makefile
682 dlls/comctl32/Makefile
683 dlls/commdlg/Makefile
684 dlls/imagehlp/Makefile
685 dlls/msacm/Makefile
686 dlls/msacm32/Makefile
687 dlls/ntdll/Makefile
688 dlls/psapi/Makefile
689 dlls/rasapi32/Makefile
690 dlls/shell32/Makefile
691 dlls/tapi32/Makefile
692 dlls/ver/Makefile
693 dlls/version/Makefile
694 dlls/winaspi/Makefile
695 dlls/wnaspi32/Makefile
696 documentation/Makefile
697 files/Makefile
698 graphics/Makefile
699 graphics/metafiledrv/Makefile
700 graphics/psdrv/Makefile
701 graphics/ttydrv/Makefile
702 graphics/win16drv/Makefile
703 graphics/x11drv/Makefile
704 if1632/Makefile
705 include/Makefile
706 ipc/Makefile
707 library/Makefile
708 libtest/Makefile
709 loader/Makefile
710 loader/ne/Makefile
711 loader/dos/Makefile
712 memory/Makefile
713 misc/Makefile
714 miscemu/Makefile
715 msdos/Makefile
716 multimedia/Makefile
717 objects/Makefile
718 ole/Makefile
719 programs/Makefile
720 programs/clock/Makefile
721 programs/cmdlgtst/Makefile
722 programs/control/Makefile
723 programs/avitools/Makefile
724 programs/notepad/Makefile
725 programs/progman/Makefile
726 programs/regtest/Makefile
727 programs/regapi/Makefile
728 programs/view/Makefile
729 programs/winhelp/Makefile
730 programs/winver/Makefile
731 rc/Makefile
732 relay32/Makefile
733 resources/Makefile
734 scheduler/Makefile
735 server/Makefile
736 tools/Makefile
737 tools/wrc/Makefile
738 tsx11/Makefile
739 win32/Makefile
740 windows/Makefile
741 windows/ttydrv/Makefile
742 windows/x11drv/Makefile ])
744 if test "$have_x" = "no"
745 then
746   echo
747   echo "*** Warning: X development files not found. Wine will be built without"
748   echo "*** X support, which currently does not work, and would probably not be"
749   echo "*** what you want anyway. You will need to install devel packages of"
750   echo "*** Xlib/Xfree86 and Xpm at the very least."
751 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
752 then
753   echo
754   echo "*** Warning: Xpm development files not found. Wine will be built without"
755   echo "*** Xpm support, which currently does not work. You will need to install"
756   echo "*** devel packages of Xpm."
759 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
760 then
761   echo
762   echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
763   echo "*** terminal resize support. Consider upgrading ncurses."
766 if test "$wine_cv_libc_reentrant" = "no" 
767 then
768   echo
769   echo "*** Warning: non-reentrant libc detected. Wine will be build without"
770   echo "*** thread support. Consider upgrading libc to a more recent"
771   echo "*** reentrant version of libc."
774 if test "$wine_cv_mesa_version_OK" = "no"
775 then
776   echo
777   echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
778   echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)"
781 echo
782 echo "Configure finished.  Do 'make depend && make' to compile Wine."
783 echo
785 dnl Local Variables:
786 dnl comment-start: "dnl "
787 dnl comment-end: ""
788 dnl comment-start-skip: "\\bdnl\\b\\s *"
789 dnl compile-command: "autoconf"
790 dnl End: