Authors: James Juran <jrj120@psu.edu>, Andreas Mohr <cipam895@cip1.ind.uni-stuttgart.de>
[wine/multimedia.git] / configure.in
blob28cefc4fdfb47775c786a00e60d243af024503de
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 some libraries ****
77 dnl Check for -lm for BeOS
78 AC_CHECK_LIB(m,sqrt)
79 dnl Check for -li386 for NetBSD and OpenBSD
80 AC_CHECK_LIB(i386,i386_set_ldt)
81 dnl Check for -lossaudio for NetBSD
82 AC_CHECK_LIB(ossaudio,_oss_ioctl)
83 dnl Check for -lw for Solaris
84 AC_CHECK_LIB(w,iswalnum)
85 dnl Check for -lnsl for Solaris
86 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
87 dnl Check for -lsocket for Solaris
88 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
89 dnl Check for -lxpg4 for FreeBSD
90 AC_CHECK_LIB(xpg4,setrunelocale)
91 dnl Check for -lmmap for OS/2
92 AC_CHECK_LIB(mmap,mmap)
94 AC_CHECK_HEADERS(dlfcn.h,
95         AC_CHECK_FUNCS(dlopen,
96                 AC_DEFINE(HAVE_DL_API),
97                 AC_CHECK_LIB(dl,dlopen,
98                         AC_DEFINE(HAVE_DL_API)
99                         LIBS="$LIBS -ldl"
100                 )
101         )
103 AC_SUBST(XLIB)
104 if test "$have_x" = "yes"
105 then
106     XLIB="-lXext -lX11"
107     ac_save_CPPFLAGS="$CPPFLAGS"
108     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
110     dnl Check for -lXpm
111     AC_CHECK_HEADERS(X11/xpm.h)
112     if test "$ac_cv_header_X11_xpm_h" = "yes"
113     then 
114         AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
115     fi
117     dnl Check for X Shm extension
118     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/XShm.h)
119     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_XShm_h" = "yes"
120     then 
121         AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
122     fi
123     dnl Check for XFree86 DGA extension
124     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86dga.h)
125     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
126     then 
127          AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
128     fi
130     dnl Check for XFree86 VMODE extension
131     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86vmode.h)
132     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
133     then 
134         AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
135     fi
137     dnl Check for the presence of Mesa
138     AC_CHECK_HEADERS(GL/gl.h GL/osmesa.h)
139     if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_osmesa_h" = "yes"
140     then
141         dnl Check for some problems due to old Mesa versions
142         AC_CACHE_CHECK("for up-to-date Mesa version", wine_cv_mesa_version_OK,
143           AC_TRY_COMPILE(
144             [#include <GL/gl.h>],
145             [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
146             [wine_cv_mesa_version_OK="yes"],
147             [wine_cv_mesa_version_OK="no"]
148           )
149         )
151         if test "$wine_cv_mesa_version_OK" = "yes"
152         then
153             dnl Check for the presense of the library
154             AC_CHECK_LIB(MesaGL,OSMesaCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm)
155         fi
156     fi
158     CPPFLAGS="$ac_save_CPPFLAGS"
159 else
160     XLIB=""
161     X_CFLAGS=""
162     X_LIBS=""
165 dnl **** Check which curses lib to use ***
166 AC_CHECK_HEADERS(ncurses.h)
167 if test "$ac_cv_header_ncurses_h" = "yes"
168 then 
169     AC_CHECK_LIB(ncurses,waddch)
171 if test "$ac_cv_lib_ncurses_waddch" = "yes"
172 then
173     AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
174     AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
175 else
176     AC_CHECK_HEADERS(curses.h)
177     if test "$ac_cv_header_curses_h" = "yes"
178     then    
179        AC_CHECK_LIB(curses,waddch)
180        AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
181        AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
182     fi
185 dnl **** Check for IPX (currently Linux only) ****
186 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
187  AC_TRY_COMPILE(
188    [#include <sys/socket.h>
189     #include <netipx/ipx.h>],
190    [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
191    [AC_DEFINE(HAVE_IPX_GNU)
192     ac_cv_c_ipx_gnu="yes"],
193    [ac_cv_c_ipx_gnu="no"])
196 if test "$ac_cv_c_ipx_gnu" = "no"
197 then
198  AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
199   AC_TRY_COMPILE(
200     [#include <sys/socket.h>
201      #include <asm/types.h>
202      #include <linux/ipx.h>],
203     [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
204     [AC_DEFINE(HAVE_IPX_LINUX)
205      ac_cv_c_ipx_linux="yes"],
206     [ac_cv_c_ipx_linux="no"])
207   )
210 dnl **** Check for Open Sound System ****
211 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
213 AC_CACHE_CHECK("for Open Sound System",
214         ac_cv_c_opensoundsystem,
215         AC_TRY_COMPILE([
216         #if defined(HAVE_SYS_SOUNDCARD_H)
217                 #include <sys/soundcard.h>
218         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
219                 #include <machine/soundcard.h>
220         #elif defined(HAVE_SOUNDCARD_H)
221                 #include <soundcard.h>
222         #endif
223         ],[
225 /* check for one of the Open Sound System specific SNDCTL_ defines */
226 #if !defined(SNDCTL_DSP_STEREO)
227 #error No open sound system
228 #endif
229 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
231 if test "$ac_cv_c_opensoundsystem" = "yes"
232 then
233     AC_DEFINE(HAVE_OSS)
236 AC_CACHE_CHECK("for Open Sound System/MIDI interface",
237         ac_cv_c_opensoundsystem_midi,
238         AC_TRY_COMPILE([
239         #if defined(HAVE_SYS_SOUNDCARD_H)
240                 #include <sys/soundcard.h>
241         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
242                 #include <machine/soundcard.h>
243         #elif defined(HAVE_SOUNDCARD_H)
244                 #include <soundcard.h>
245         #endif
246         ],[
248 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
249 #if !defined(SNDCTL_SEQ_SYNC)
250 #error No open sound system MIDI interface
251 #endif
252 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
254 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
255 then
256     AC_DEFINE(HAVE_OSS_MIDI)
259 dnl **** If ln -s doesn't work, use cp instead ****
260 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
262 dnl **** Check for gcc strength-reduce bug ****
264 if test "x${GCC}" = "xyes"
265 then
266   CFLAGS="$CFLAGS -Wall"
267   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
268                   AC_TRY_RUN([
269 int main(void) {
270   static int Array[[3]];
271   unsigned int B = 3;
272   int i;
273   for(i=0; i<B; i++) Array[[i]] = i - 3;
274   exit( Array[[1]] != -2 );
276     ac_cv_c_gcc_strength_bug="no",
277     ac_cv_c_gcc_strength_bug="yes",
278     ac_cv_c_gcc_strength_bug="yes") )
279   if test "$ac_cv_c_gcc_strength_bug" = "yes"
280   then
281     CFLAGS="$CFLAGS -fno-strength-reduce"
282   fi
285 dnl **** Check for underscore on external symbols ****
287 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
288                ac_cv_c_extern_prefix,
289 [saved_libs=$LIBS
290 LIBS="conftest_asm.s $LIBS"
291 cat > conftest_asm.s <<EOF
292         .globl _ac_test
293 _ac_test:
294         .long 0
296 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
297             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
298 LIBS=$saved_libs])
299 if test "$ac_cv_c_extern_prefix" = "yes"
300 then
301   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
304 dnl **** Check for .string in assembler ****
306 AC_CACHE_CHECK("whether assembler accepts .string",
307                ac_cv_c_asm_string,
308 [saved_libs=$LIBS
309 LIBS="conftest_asm.s $LIBS"
310 cat > conftest_asm.s <<EOF
311         .string "test"
313 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
314 LIBS=$saved_libs])
315 if test "$ac_cv_c_asm_string" = "yes"
316 then
317   AC_DEFINE(HAVE_ASM_STRING)
320 dnl **** Check for working dll ****
322 DLLFLAGS=""
323 BUILDFLAGS=""
324 LDSHARED=""
325 if test "$LIB_TARGET" = "libwine.so.1.0"
326 then
327   AC_CACHE_CHECK("whether we can build a Linux dll",
328                  ac_cv_c_dll_linux,
329   [saved_cflags=$CFLAGS
330   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
331   AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
332   CFLAGS=$saved_cflags
333   ])
334   if test "$ac_cv_c_dll_linux" = "yes"
335   then
336     BUILDFLAGS="-pic"
337     DLLFLAGS="-fPIC"
338     LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
339   else
340     AC_CACHE_CHECK("whether we can build a NetBSD dll",
341                    ac_cv_c_dll_netbsd,
342     [saved_cflags=$CFLAGS
343     CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
344     AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
345     CFLAGS=$saved_cflags
346     ])
347     if test "$ac_cv_c_dll_netbsd" = "yes"
348     then
349       BUILDFLAGS="-pic"
350       DLLFLAGS="-fPIC"
351       LDSHARED="ld -Bshareable -Bforcearchive"
352     fi
353   fi
354   if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
355   then
356     LIB_TARGET="libwine.a"
357   fi
359 AC_SUBST(BUILDFLAGS)
360 AC_SUBST(DLLFLAGS)
361 AC_SUBST(LDSHARED)
363 dnl **** Check for reentrant libc ****
365 dnl For cross-compiling we blindly assume that libc is reentrant. This is
366 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
368 wine_cv_libc_reentrant=no 
369 dnl 
370 dnl Linux style errno location
371 dnl 
372 AC_CACHE_CHECK("for reentrant libc: __errno_location", wine_cv_libc_r__errno_location,
373   [AC_TRY_RUN([int myerrno = 0;
374 char buf[256];
375 int *__errno_location(){return &myerrno;}
376 main(){connect(0,buf,255); exit(!myerrno);}],
377   wine_cv_libc_r__errno_location=yes, wine_cv_libc_r__errno_location=no,
378   wine_cv_libc_r__errno_location=yes )
380 if test "$wine_cv_libc_r__errno_location" = "yes"
381 then
382     AC_DEFINE(HAVE__ERRNO_LOCATION)
383     wine_cv_libc_reentrant=__errno_location 
386 dnl FreeBSD style errno location
387 dnl 
388 AC_CACHE_CHECK("for reentrant libc: __error", wine_cv_libc_r__error,
389   [AC_TRY_RUN([int myerrno = 0;
390 char buf[256];
391 int *__error(){return &myerrno;}
392 main(){connect(0,buf,255); exit(!myerrno);}],
393     wine_cv_libc_r__error=yes, wine_cv_libc_r__error=no,
394     wine_cv_libc_r__error=yes )
396 if test "$wine_cv_libc_r__error" = "yes"
397 then
398     AC_DEFINE(HAVE__ERROR)
399     wine_cv_libc_reentrant=__error 
402 dnl Solaris style errno location
403 dnl 
404 AC_CACHE_CHECK("for reentrant libc: ___errno", wine_cv_libc_r___errno,
405   [AC_TRY_RUN([int myerrno = 0;
406 char buf[256];
407 int *___errno(){return &myerrno;}
408 main(){connect(0,buf,255); exit(!myerrno);}],
409     wine_cv_libc_r___errno=yes, wine_cv_libc_r___errno=no,
410     wine_cv_libc_r___errno=yes )
412 if test "$wine_cv_libc_r___errno" = "yes"
413 then
414     AC_DEFINE(HAVE___ERRNO)
415     wine_cv_libc_reentrant=___errno 
417 if test "$wine_cv_libc_reentrant" = "no" 
418 then
419   AC_DEFINE(NO_REENTRANT_LIBC)
422 dnl **** Check for reentrant X libraries ****
424 dnl This may fail to determine whether X libraries are reentrant if
425 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
426 dnl is possible with the --without-reentrant-x option.
428 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
429 then
430 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
431   [ if test "x$with_reentrant_x" = "xno" 
432     then
433         wine_cv_x_reentrant=no
434     else
435         libX11_check=none
436         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
437             if test -r $dir/libX11.so; then
438                 libX11_check="-D $dir/libX11.so"
439                 break 1
440             fi
441             if test -r $dir/libX11.a; then
442                 libX11_check="$dir/libX11.a"
443                 break 1
444             fi
445         done
446         if test "$libX11_check" != "none"; then
447             if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
448             then
449                 wine_cv_x_reentrant=yes
450             else
451                 wine_cv_x_reentrant=no
452             fi
453         else
454             wine_cv_x_reentrant=unknown
455         fi
456     fi ] )
457 else
458     wine_cv_x_reentrant=no
460 if test "$wine_cv_x_reentrant" = "no"
461 then
462   AC_DEFINE(NO_REENTRANT_X11)
465 dnl **** Check for functions ****
467 AC_FUNC_ALLOCA()
468 AC_CHECK_FUNCS(\
469         _lwp_create \
470         clone \
471         getpagesize \
472         memmove \
473         rfork \
474         sendmsg \
475         sigaltstack \
476         strerror \
477         stricmp \
478         tcgetattr \
479         timegm \
480         usleep \
481         vfscanf \
482         wait4 \
483         waitpid \
486 dnl **** Check for header files ****
488 AC_CHECK_HEADERS(\
489         arpa/nameser.h \
490         curses.h \
491         elf.h \
492         float.h \
493         libio.h \
494         linux/cdrom.h \
495         linux/ucdrom.h \
496         ncurses.h \
497         net/if.h \
498         netinet/in.h \
499         resolv.h \
500         strings.h \
501         sys/cdio.h \
502         sys/errno.h \
503         sys/file.h \
504         sys/filio.h \
505         sys/lwp.h \
506         sys/mman.h \
507         sys/modem.h \
508         sys/mount.h \
509         sys/param.h \
510         sys/signal.h \
511         sys/sockio.h \
512         sys/statfs.h \
513         sys/strtio.h \
514         sys/syscall.h \
515         sys/vfs.h \
516         syscall.h \
517         ucontext.h \
518         unistd.h \
519         wctype.h \
521 AC_HEADER_STAT()
523 dnl **** Check for types ****
525 AC_C_CONST()
526 AC_C_INLINE()
527 AC_TYPE_SIZE_T()
528 AC_CHECK_SIZEOF(long long,0)
530 dnl **** statfs checks ****
532 if test "$ac_cv_header_sys_vfs_h" = "yes"
533 then
534     AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
535                     wine_cv_sys_vfs_has_statfs,
536         AC_TRY_COMPILE([
537         #include <sys/types.h>
538         #ifdef HAVE_SYS_PARAM_H
539         # include <sys/param.h>
540         #endif
541         #include <sys/vfs.h>
542         ],[
543                 struct statfs stfs;
545                 memset(&stfs,0,sizeof(stfs));
546         ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
547         )
548     )
549     if test "$wine_cv_sys_vfs_has_statfs" = "yes"
550     then
551       AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
552     fi
555 if test "$ac_cv_header_sys_statfs_h" = "yes"
556 then
557     AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
558                     wine_cv_sys_statfs_has_statfs,
559         AC_TRY_COMPILE([
560         #include <sys/types.h>
561         #ifdef HAVE_SYS_PARAM_H
562         # include <sys/param.h>
563         #endif
564         #include <sys/statfs.h>
565         ],[
566                 struct statfs stfs;
567         ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
568         )
569     )
570     if test "$wine_cv_sys_statfs_has_statfs" = "yes"
571     then
572       AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
573     fi
576 if test "$ac_cv_header_sys_mount_h" = "yes"
577 then
578     AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
579                     wine_cv_sys_mount_has_statfs,
580         AC_TRY_COMPILE([
581         #include <sys/types.h>
582         #ifdef HAVE_SYS_PARAM_H
583         # include <sys/param.h>
584         #endif
585         #include <sys/mount.h>
586         ],[
587                 struct statfs stfs;
588         ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
589         )
590     )
591     if test "$wine_cv_sys_mount_has_statfs" = "yes"
592     then
593       AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
594     fi
597 dnl **** FIXME: what about mixed cases, where we need two of them? ***
599 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
600   [ if test "x$statfs_bfree" = "xno"
601     then
602         wine_cv_statfs_bfree=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_bfree++;
624         ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
625         )
626     fi ] )
627 if test "$wine_cv_statfs_bfree" = "yes"
628 then
629   AC_DEFINE(STATFS_HAS_BFREE)
632 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
633   [ if test "x$statfs_bavail" = "xno"
634     then
635         wine_cv_statfs_bavail=no
636     else
637         AC_TRY_COMPILE([
638         #include <sys/types.h>
639         #ifdef HAVE_SYS_PARAM_H
640         # include <sys/param.h>
641         #endif
642         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
643         # include <sys/mount.h>
644         #else
645         # ifdef STATFS_DEFINED_BY_SYS_VFS
646         #  include <sys/vfs.h>
647         # else
648         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
649         #   include <sys/statfs.h>
650         #  endif
651         # endif
652         #endif
653         ],[
654                 struct statfs stfs;
656                 stfs.f_bavail++;
657         ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
658         )
659     fi ] )
660 if test "$wine_cv_statfs_bavail" = "yes"
661 then
662   AC_DEFINE(STATFS_HAS_BAVAIL)
665 dnl *** check for working sigaltstack
666 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
668 AC_CACHE_CHECK("for working sigaltstack",
669         ac_cv_c_working_sigaltstack,
670         AC_TRY_RUN([
671         #include <stdio.h>
672         #include <time.h> /* <sys/time.h> ? bad magic without end */
673         #include <sys/types.h>
674         #include <sys/signal.h>
675         #ifdef HAVE_SYS_PARAM_H
676         # include <sys/param.h>
677         #endif
678         #ifdef HAVE_SYSCALL_H
679         # include <syscall.h>
680         #else
681         # ifdef HAVE_SYS_SYSCALL_H
682         #  include <sys/syscall.h>
683         # endif
684         #endif
685         
686         unsigned char *xaltstack;
688         int
689         main(int argc,char **argv) {
690             struct sigaltstack  ss;
692             xaltstack = malloc(16384);
693             ss.ss_sp    = xaltstack;
694             ss.ss_size  = 16384;
695             ss.ss_flags = 0;
696             if (sigaltstack(&ss, NULL) < 0) {
697                 /* this catches the glibc case */
698                 perror("sigaltstack");
699                 return (1); /* aka exit(1) aka fail */
700             }
701             /* assume it works. */
702             return 0; /* OK */
703         }
704         ],
705         ac_cv_c_working_sigaltstack="yes",
706         ac_cv_c_working_sigaltstack="no",
707         ac_cv_c_working_sigaltstack="no"
710 if test "$ac_cv_c_working_sigaltstack" = "yes"
711 then
712     AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
716 dnl *** check for file descriptor passing with msg_accrights
718 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
719  AC_TRY_COMPILE([#include <sys/types.h>
720 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
721                 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
722 if test "$ac_cv_c_msg_accrights" = "yes"
723 then
724     AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
727 dnl *** check for the need to define __i386__
729 AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
730  AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
732 #endif],
733  ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
734 if test "$ac_cv_cpp_def_i386" = "yes"
735 then
736     CFLAGS="$CFLAGS -D__i386__"
739 dnl $GCC is set by autoconf
740 GCC_NO_BUILTIN=""
741 if test "$GCC" = "yes"
742 then
743     GCC_NO_BUILTIN="-fno-builtin"
745 AC_SUBST(GCC_NO_BUILTIN)
747 dnl **** Generate output files ****
749 MAKE_RULES=Make.rules
750 AC_SUBST_FILE(MAKE_RULES)
752 AC_OUTPUT([
753 Make.rules
754 Makefile
755 console/Makefile
756 controls/Makefile
757 debugger/Makefile
758 dlls/Makefile
759 dlls/advapi32/Makefile
760 dlls/avifil32/Makefile
761 dlls/comctl32/Makefile
762 dlls/commdlg/Makefile
763 dlls/imagehlp/Makefile
764 dlls/msacm/Makefile
765 dlls/msacm32/Makefile
766 dlls/ntdll/Makefile
767 dlls/psapi/Makefile
768 dlls/rasapi32/Makefile
769 dlls/shell32/Makefile
770 dlls/tapi32/Makefile
771 dlls/ver/Makefile
772 dlls/version/Makefile
773 dlls/win87em/Makefile
774 dlls/winaspi/Makefile
775 dlls/winspool/Makefile
776 dlls/wnaspi32/Makefile
777 documentation/Makefile
778 documentation/wine.conf.man
779 documentation/wine.man
780 files/Makefile
781 graphics/Makefile
782 graphics/enhmetafiledrv/Makefile
783 graphics/metafiledrv/Makefile
784 graphics/psdrv/Makefile
785 graphics/ttydrv/Makefile
786 graphics/win16drv/Makefile
787 graphics/x11drv/Makefile
788 if1632/Makefile
789 include/Makefile
790 library/Makefile
791 libtest/Makefile
792 loader/Makefile
793 loader/ne/Makefile
794 loader/dos/Makefile
795 memory/Makefile
796 misc/Makefile
797 miscemu/Makefile
798 msdos/Makefile
799 multimedia/Makefile
800 objects/Makefile
801 ole/Makefile
802 programs/Makefile
803 programs/clock/Makefile
804 programs/cmdlgtst/Makefile
805 programs/control/Makefile
806 programs/avitools/Makefile
807 programs/notepad/Makefile
808 programs/progman/Makefile
809 programs/regtest/Makefile
810 programs/regapi/Makefile
811 programs/view/Makefile
812 programs/wcmd/Makefile
813 programs/winhelp/Makefile
814 programs/winver/Makefile
815 rc/Makefile
816 relay32/Makefile
817 resources/Makefile
818 scheduler/Makefile
819 server/Makefile
820 tools/Makefile
821 tools/wrc/Makefile
822 tsx11/Makefile
823 win32/Makefile
824 windows/Makefile
825 windows/ttydrv/Makefile
826 windows/x11drv/Makefile ])
828 if test "$have_x" = "no"
829 then
830   echo
831   echo "*** Warning: X development files not found. Wine will be built without"
832   echo "*** X support, which currently does not work, and would probably not be"
833   echo "*** what you want anyway. You will need to install devel packages of"
834   echo "*** Xlib/Xfree86 and Xpm at the very least."
835 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
836 then
837   echo
838   echo "*** Warning: Xpm development files not found. Wine will be built without"
839   echo "*** Xpm support, which currently does not work. You will need to install"
840   echo "*** devel packages of Xpm."
843 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
844 then
845   echo
846   echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
847   echo "*** terminal resize support. Consider upgrading ncurses."
850 if test "$wine_cv_libc_reentrant" = "no" 
851 then
852   echo
853   echo "*** Warning: non-reentrant libc detected. Wine will be build without"
854   echo "*** thread support. Consider upgrading libc to a more recent"
855   echo "*** reentrant version of libc."
858 if test "$wine_cv_mesa_version_OK" = "no"
859 then
860   echo
861   echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
862   echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)"
865 echo
866 echo "Configure finished.  Do 'make depend && make' to compile Wine."
867 echo
869 dnl Local Variables:
870 dnl comment-start: "dnl "
871 dnl comment-end: ""
872 dnl comment-start-skip: "\\bdnl\\b\\s *"
873 dnl compile-command: "autoconf"
874 dnl End: