Added better missing function emulation.
[wine/hacks.git] / configure.in
blob95ed29fc7ae30c9a68d879c3eae08a1810e3137f
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)
104 AC_CHECK_HEADERS(dlfcn.h,
105         AC_CHECK_FUNCS(dlopen,
106                 AC_DEFINE(HAVE_DL_API),
107                 AC_CHECK_LIB(dl,dlopen,
108                         AC_DEFINE(HAVE_DL_API)
109                         LIBS="$LIBS -ldl"
110                 )
111         )
113 AC_SUBST(XLIB)
114 if test "$have_x" = "yes"
115 then
116     XLIB="-lXext -lX11"
117     ac_save_CPPFLAGS="$CPPFLAGS"
118     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
120     dnl Check for -lXpm
121     AC_CHECK_HEADERS(X11/xpm.h)
122     if test "$ac_cv_header_X11_xpm_h" = "yes"
123     then 
124         AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
125     fi
127     dnl Check for X Shm extension
128     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/XShm.h)
129     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_XShm_h" = "yes"
130     then 
131         AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
132     fi
133     dnl Check for XFree86 DGA / DGA 2.0 extension
134     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86dga.h)
135     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
136     then 
137          AC_CHECK_LIB(Xxf86dga,XDGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA2) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
138          AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
139     fi
141     dnl Check for XFree86 VMODE extension
142     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86vmode.h)
143     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
144     then 
145         AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
146     fi
148     dnl Check for the presence of Mesa
149     AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/osmesa.h)
150     if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
151     then
152         dnl Check for some problems due to old Mesa versions
153         AC_CACHE_CHECK("for up-to-date Mesa version", wine_cv_mesa_version_OK,
154           AC_TRY_COMPILE(
155             [#include <GL/gl.h>],
156             [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
157             [wine_cv_mesa_version_OK="yes"],
158             [wine_cv_mesa_version_OK="no"]
159           )
160         )
162         if test "$wine_cv_mesa_version_OK" = "yes"
163         then
164             dnl Check for the presense of the library
165             AC_CHECK_LIB(GL,glXCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lGL",,$X_LIBS -lXext -lX11 -lm)
166             if test "$ac_cv_lib_GL_glXCreateContext" = "no"
167             then
168                 AC_CHECK_LIB(MesaGL,glXCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm)
169             fi
170         fi
171     fi
173     CPPFLAGS="$ac_save_CPPFLAGS"
174 else
175     XLIB=""
176     X_CFLAGS=""
177     X_LIBS=""
180 dnl **** Check which curses lib to use ***
181 AC_CHECK_HEADERS(ncurses.h)
182 if test "$ac_cv_header_ncurses_h" = "yes"
183 then 
184     AC_CHECK_LIB(ncurses,waddch)
186 if test "$ac_cv_lib_ncurses_waddch" = "yes"
187 then
188     AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
189     AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
190 else
191     AC_CHECK_HEADERS(curses.h)
192     if test "$ac_cv_header_curses_h" = "yes"
193     then    
194        AC_CHECK_LIB(curses,waddch)
195        AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
196        AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
197     fi
200 dnl **** Check for IPX (currently Linux only) ****
201 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
202  AC_TRY_COMPILE(
203    [#include <sys/socket.h>
204     #include <netipx/ipx.h>],
205    [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
206    [AC_DEFINE(HAVE_IPX_GNU)
207     ac_cv_c_ipx_gnu="yes"],
208    [ac_cv_c_ipx_gnu="no"])
211 if test "$ac_cv_c_ipx_gnu" = "no"
212 then
213  AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
214   AC_TRY_COMPILE(
215     [#include <sys/socket.h>
216      #include <asm/types.h>
217      #include <linux/ipx.h>],
218     [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
219     [AC_DEFINE(HAVE_IPX_LINUX)
220      ac_cv_c_ipx_linux="yes"],
221     [ac_cv_c_ipx_linux="no"])
222   )
225 dnl **** Check for Open Sound System ****
226 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
228 AC_CACHE_CHECK("for Open Sound System",
229         ac_cv_c_opensoundsystem,
230         AC_TRY_COMPILE([
231         #if defined(HAVE_SYS_SOUNDCARD_H)
232                 #include <sys/soundcard.h>
233         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
234                 #include <machine/soundcard.h>
235         #elif defined(HAVE_SOUNDCARD_H)
236                 #include <soundcard.h>
237         #endif
238         ],[
240 /* check for one of the Open Sound System specific SNDCTL_ defines */
241 #if !defined(SNDCTL_DSP_STEREO)
242 #error No open sound system
243 #endif
244 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
246 if test "$ac_cv_c_opensoundsystem" = "yes"
247 then
248     AC_DEFINE(HAVE_OSS)
251 AC_CACHE_CHECK("for Open Sound System/MIDI interface",
252         ac_cv_c_opensoundsystem_midi,
253         AC_TRY_COMPILE([
254         #if defined(HAVE_SYS_SOUNDCARD_H)
255                 #include <sys/soundcard.h>
256         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
257                 #include <machine/soundcard.h>
258         #elif defined(HAVE_SOUNDCARD_H)
259                 #include <soundcard.h>
260         #endif
261         ],[
263 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
264 #if !defined(SNDCTL_SEQ_SYNC)
265 #error No open sound system MIDI interface
266 #endif
267 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
269 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
270 then
271     AC_DEFINE(HAVE_OSS_MIDI)
274 dnl **** If ln -s doesn't work, use cp instead ****
275 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
277 dnl **** Check for gcc strength-reduce bug ****
279 if test "x${GCC}" = "xyes"
280 then
281   CFLAGS="$CFLAGS -Wall"
282   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
283                   AC_TRY_RUN([
284 int main(void) {
285   static int Array[[3]];
286   unsigned int B = 3;
287   int i;
288   for(i=0; i<B; i++) Array[[i]] = i - 3;
289   exit( Array[[1]] != -2 );
291     ac_cv_c_gcc_strength_bug="no",
292     ac_cv_c_gcc_strength_bug="yes",
293     ac_cv_c_gcc_strength_bug="yes") )
294   if test "$ac_cv_c_gcc_strength_bug" = "yes"
295   then
296     CFLAGS="$CFLAGS -fno-strength-reduce"
297   fi
300 dnl **** Check for underscore on external symbols ****
302 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
303                ac_cv_c_extern_prefix,
304 [saved_libs=$LIBS
305 LIBS="conftest_asm.s $LIBS"
306 cat > conftest_asm.s <<EOF
307         .globl _ac_test
308 _ac_test:
309         .long 0
311 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
312             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
313 LIBS=$saved_libs])
314 if test "$ac_cv_c_extern_prefix" = "yes"
315 then
316   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
319 dnl **** Check for .string in assembler ****
321 AC_CACHE_CHECK("whether assembler accepts .string",
322                ac_cv_c_asm_string,
323 [saved_libs=$LIBS
324 LIBS="conftest_asm.s $LIBS"
325 cat > conftest_asm.s <<EOF
326         .string "test"
328 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
329 LIBS=$saved_libs])
330 if test "$ac_cv_c_asm_string" = "yes"
331 then
332   AC_DEFINE(HAVE_ASM_STRING)
335 dnl **** Check for working dll ****
337 DLLFLAGS=""
338 BUILDFLAGS=""
339 LDSHARED=""
340 if test "$LIB_TARGET" = "libwine.so.1.0"
341 then
342   AC_CACHE_CHECK("whether we can build a Linux dll",
343                  ac_cv_c_dll_linux,
344   [saved_cflags=$CFLAGS
345   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
346   AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
347   CFLAGS=$saved_cflags
348   ])
349   if test "$ac_cv_c_dll_linux" = "yes"
350   then
351     BUILDFLAGS="-pic"
352     DLLFLAGS="-fPIC"
353     LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
354   else
355     AC_CACHE_CHECK("whether we can build a UnixWare dll",
356                  ac_cv_c_dll_unixware,
357     [saved_cflags=$CFLAGS
358     CFLAGS="$CFLAGS -fPIC -Wl,-G,conftest.so.1.0"
359     AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
360     CFLAGS=$saved_cflags
361     ])
362     if test "$ac_cv_c_dll_unixware" = "yes"
363     then
364       BUILDFLAGS="-pic"
365       DLLFLAGS="-fPIC"
366       LDSHARED="\$(CC) -Wl,-G,-h,/usr/local/lib/libwine.so"
367     else
368       AC_CACHE_CHECK("whether we can build a NetBSD dll",
369                    ac_cv_c_dll_netbsd,
370       [saved_cflags=$CFLAGS
371       CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
372       AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
373       CFLAGS=$saved_cflags
374       ])
375       if test "$ac_cv_c_dll_netbsd" = "yes"
376       then
377         BUILDFLAGS="-pic"
378         DLLFLAGS="-fPIC"
379         LDSHARED="ld -Bshareable -Bforcearchive"
380       fi
381     fi
382   fi
383   if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_unixware" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
384   then
385     LIB_TARGET="libwine.a"
386   fi
388 AC_SUBST(BUILDFLAGS)
389 AC_SUBST(DLLFLAGS)
390 AC_SUBST(LDSHARED)
392 dnl **** Check for reentrant libc ****
394 dnl For cross-compiling we blindly assume that libc is reentrant. This is
395 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
397 wine_cv_libc_reentrant=no 
398 dnl 
399 dnl Linux style errno location
400 dnl 
401 AC_CACHE_CHECK("for reentrant libc: __errno_location", wine_cv_libc_r__errno_location,
402   [AC_TRY_RUN([int myerrno = 0;
403 char buf[256];
404 int *__errno_location(){return &myerrno;}
405 main(){connect(0,buf,255); exit(!myerrno);}],
406   wine_cv_libc_r__errno_location=yes, wine_cv_libc_r__errno_location=no,
407   wine_cv_libc_r__errno_location=yes )
409 if test "$wine_cv_libc_r__errno_location" = "yes"
410 then
411     AC_DEFINE(HAVE__ERRNO_LOCATION)
412     wine_cv_libc_reentrant=__errno_location 
415 dnl FreeBSD style errno location
416 dnl 
417 AC_CACHE_CHECK("for reentrant libc: __error", wine_cv_libc_r__error,
418   [AC_TRY_RUN([int myerrno = 0;
419 char buf[256];
420 int *__error(){return &myerrno;}
421 main(){connect(0,buf,255); exit(!myerrno);}],
422     wine_cv_libc_r__error=yes, wine_cv_libc_r__error=no,
423     wine_cv_libc_r__error=yes )
425 if test "$wine_cv_libc_r__error" = "yes"
426 then
427     AC_DEFINE(HAVE__ERROR)
428     wine_cv_libc_reentrant=__error 
431 dnl Solaris style errno location
432 dnl 
433 AC_CACHE_CHECK("for reentrant libc: ___errno", wine_cv_libc_r___errno,
434   [AC_TRY_RUN([int myerrno = 0;
435 char buf[256];
436 int *___errno(){return &myerrno;}
437 main(){connect(0,buf,255); exit(!myerrno);}],
438     wine_cv_libc_r___errno=yes, wine_cv_libc_r___errno=no,
439     wine_cv_libc_r___errno=yes )
441 if test "$wine_cv_libc_r___errno" = "yes"
442 then
443     AC_DEFINE(HAVE___ERRNO)
444     wine_cv_libc_reentrant=___errno 
447 dnl UnixWare style errno location
448 dnl 
449 AC_CACHE_CHECK("for reentrant libc: __thr_errno", wine_cv_libc_r__thr_errno,
450   [AC_TRY_RUN([int myerrno = 0;
451 char buf[256];
452 int *__thr_errno(){return &myerrno;}
453 main(){connect(0,buf,255); exit(!myerrno);}],
454     wine_cv_libc_r__thr_errno=yes, wine_cv_libc_r__thr_errno=no,
455     wine_cv_libc_r__thr_errno=yes )
457 if test "$wine_cv_libc_r__thr_errno" = "yes"
458 then
459     AC_DEFINE(HAVE__THR_ERRNO)
460     wine_cv_libc_reentrant=__thr_errno 
462 if test "$wine_cv_libc_reentrant" = "no" 
463 then
464   AC_DEFINE(NO_REENTRANT_LIBC)
467 dnl **** Check for reentrant X libraries ****
469 dnl This may fail to determine whether X libraries are reentrant if
470 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
471 dnl is possible with the --without-reentrant-x option.
473 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
474 then
475 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
476   [ if test "x$with_reentrant_x" = "xno" 
477     then
478         wine_cv_x_reentrant=no
479     else
480         libX11_check=none
481         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
482             if test -r $dir/libX11.so; then
483                 libX11_check="-D $dir/libX11.so"
484                 break 1
485             fi
486             if test -r $dir/libX11.a; then
487                 libX11_check="$dir/libX11.a"
488                 break 1
489             fi
490         done
491         if test "$libX11_check" != "none"; then
492             if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
493             then
494                 wine_cv_x_reentrant=yes
495             else
496                 wine_cv_x_reentrant=no
497             fi
498         else
499             wine_cv_x_reentrant=unknown
500         fi
501     fi ] )
502 else
503     wine_cv_x_reentrant=no
505 if test "$wine_cv_x_reentrant" = "no"
506 then
507   AC_DEFINE(NO_REENTRANT_X11)
510 dnl **** Check for functions ****
512 AC_FUNC_ALLOCA()
513 AC_CHECK_FUNCS(\
514         _lwp_create \
515         clone \
516         getnetbyaddr \
517         getnetbyname \
518         getpagesize \
519         getprotobyname \
520         getprotobynumber \
521         getservbyport \
522         getsockopt \
523         inet_network \
524         memmove \
525         rfork \
526         select \
527         sendmsg \
528         settimeofday \
529         sigaltstack \
530         statfs \
531         strcasecmp \
532         strerror \
533         strncasecmp \
534         tcgetattr \
535         timegm \
536         usleep \
537         vfscanf \
538         wait4 \
539         waitpid \
542 dnl **** Check for header files ****
544 AC_CHECK_HEADERS(\
545         a.out.h \
546         a_out.h \
547         arpa/inet.h \
548         arpa/nameser.h \
549         curses.h \
550         elf.h \
551         float.h \
552         libio.h \
553         link.h \
554         linux/cdrom.h \
555         linux/joystick.h \
556         linux/ucdrom.h \
557         ncurses.h \
558         net/if.h \
559         netinet/in.h \
560         netinet/tcp.h \
561         resolv.h \
562         sched.h \
563         socket.h \
564         strings.h \
565         sys/cdio.h \
566         sys/errno.h \
567         sys/file.h \
568         sys/filio.h \
569         sys/ipc.h \
570         sys/lwp.h \
571         sys/mman.h \
572         sys/modem.h \
573         sys/mount.h \
574         sys/msg.h \
575         sys/param.h \
576         sys/signal.h \
577         sys/shm.h \
578         sys/socket.h \
579         sys/sockio.h \
580         sys/statfs.h \
581         sys/strtio.h \
582         sys/syscall.h \
583         sys/wait.h \
584         sys/v86.h \
585         sys/v86intr.h \
586         sys/vfs.h \
587         sys/vm86.h \
588         syscall.h \
589         ucontext.h \
590         wctype.h \
592 AC_HEADER_STAT()
594 dnl **** Check for types ****
596 AC_C_CONST()
597 AC_C_INLINE()
598 AC_TYPE_SIZE_T()
599 AC_CHECK_SIZEOF(long long,0)
601 if test "$ac_cv_header_linux_joystick_h" = "yes"
602 then
603    AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
604         wine_cv_linux_joystick_22_api,
605         AC_TRY_COMPILE([
606         #include <sys/ioctl.h>
607         #include <linux/joystick.h>
609         struct js_event blub;
610         #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
611         #error "no 2.2 header"
612         #endif
613         ],/*empty*/,
614         wine_cv_linux_joystick_22_api=yes,
615         wine_cv_linux_joystick_22_api=no,
616         wine_cv_linux_joystick_22_api=no
617         )
618    )
619    if test "$wine_cv_linux_joystick_22_api"
620    then
621       AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API)
622    fi
625 dnl **** statfs checks ****
627 if test "$ac_cv_header_sys_vfs_h" = "yes"
628 then
629     AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
630                     wine_cv_sys_vfs_has_statfs,
631         AC_TRY_COMPILE([
632         #include <sys/types.h>
633         #ifdef HAVE_SYS_PARAM_H
634         # include <sys/param.h>
635         #endif
636         #include <sys/vfs.h>
637         ],[
638                 struct statfs stfs;
640                 memset(&stfs,0,sizeof(stfs));
641         ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
642         )
643     )
644     if test "$wine_cv_sys_vfs_has_statfs" = "yes"
645     then
646       AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
647     fi
650 if test "$ac_cv_header_sys_statfs_h" = "yes"
651 then
652     AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
653                     wine_cv_sys_statfs_has_statfs,
654         AC_TRY_COMPILE([
655         #include <sys/types.h>
656         #ifdef HAVE_SYS_PARAM_H
657         # include <sys/param.h>
658         #endif
659         #include <sys/statfs.h>
660         ],[
661                 struct statfs stfs;
662         ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
663         )
664     )
665     if test "$wine_cv_sys_statfs_has_statfs" = "yes"
666     then
667       AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
668     fi
671 if test "$ac_cv_header_sys_mount_h" = "yes"
672 then
673     AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
674                     wine_cv_sys_mount_has_statfs,
675         AC_TRY_COMPILE([
676         #include <sys/types.h>
677         #ifdef HAVE_SYS_PARAM_H
678         # include <sys/param.h>
679         #endif
680         #include <sys/mount.h>
681         ],[
682                 struct statfs stfs;
683         ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
684         )
685     )
686     if test "$wine_cv_sys_mount_has_statfs" = "yes"
687     then
688       AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
689     fi
692 dnl **** FIXME: what about mixed cases, where we need two of them? ***
694 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
695   [ if test "x$statfs_bfree" = "xno"
696     then
697         wine_cv_statfs_bfree=no
698     else
699         AC_TRY_COMPILE([
700         #include <sys/types.h>
701         #ifdef HAVE_SYS_PARAM_H
702         # include <sys/param.h>
703         #endif
704         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
705         # include <sys/mount.h>
706         #else
707         # ifdef STATFS_DEFINED_BY_SYS_VFS
708         #  include <sys/vfs.h>
709         # else
710         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
711         #   include <sys/statfs.h>
712         #  endif
713         # endif
714         #endif
715         ],[
716                 struct statfs stfs;
718                 stfs.f_bfree++;
719         ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
720         )
721     fi ] )
722 if test "$wine_cv_statfs_bfree" = "yes"
723 then
724   AC_DEFINE(STATFS_HAS_BFREE)
727 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
728   [ if test "x$statfs_bavail" = "xno"
729     then
730         wine_cv_statfs_bavail=no
731     else
732         AC_TRY_COMPILE([
733         #include <sys/types.h>
734         #ifdef HAVE_SYS_PARAM_H
735         # include <sys/param.h>
736         #endif
737         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
738         # include <sys/mount.h>
739         #else
740         # ifdef STATFS_DEFINED_BY_SYS_VFS
741         #  include <sys/vfs.h>
742         # else
743         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
744         #   include <sys/statfs.h>
745         #  endif
746         # endif
747         #endif
748         ],[
749                 struct statfs stfs;
751                 stfs.f_bavail++;
752         ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
753         )
754     fi ] )
755 if test "$wine_cv_statfs_bavail" = "yes"
756 then
757   AC_DEFINE(STATFS_HAS_BAVAIL)
760 dnl *** check for working sigaltstack
761 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
763 AC_CACHE_CHECK("for working sigaltstack",
764         ac_cv_c_working_sigaltstack,
765         AC_TRY_RUN([
766         #include <stdio.h>
767         #include <time.h> /* <sys/time.h> ? bad magic without end */
768         #include <sys/types.h>
769         #include <sys/signal.h>
770         #ifdef HAVE_SYS_PARAM_H
771         # include <sys/param.h>
772         #endif
773         #ifdef HAVE_SYSCALL_H
774         # include <syscall.h>
775         #else
776         # ifdef HAVE_SYS_SYSCALL_H
777         #  include <sys/syscall.h>
778         # endif
779         #endif
780         
781         unsigned char *xaltstack;
783         int
784         main(int argc,char **argv) {
785             struct sigaltstack  ss;
787             xaltstack = malloc(16384);
788             ss.ss_sp    = xaltstack;
789             ss.ss_size  = 16384;
790             ss.ss_flags = 0;
791             if (sigaltstack(&ss, NULL) < 0) {
792                 /* this catches the glibc case */
793                 perror("sigaltstack");
794                 return (1); /* aka exit(1) aka fail */
795             }
796             /* assume it works. */
797             return 0; /* OK */
798         }
799         ],
800         ac_cv_c_working_sigaltstack="yes",
801         ac_cv_c_working_sigaltstack="no",
802         ac_cv_c_working_sigaltstack="no"
805 if test "$ac_cv_c_working_sigaltstack" = "yes"
806 then
807     AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
811 dnl *** check for file descriptor passing with msg_accrights
813 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
814  AC_TRY_COMPILE([#include <sys/types.h>
815 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
816                 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
817 if test "$ac_cv_c_msg_accrights" = "yes"
818 then
819     AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
822 dnl *** check for the need to define __i386__
824 AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
825  AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
827 #endif],
828  ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
829 if test "$ac_cv_cpp_def_i386" = "yes"
830 then
831     CFLAGS="$CFLAGS -D__i386__"
832     LINTFLAGS="$LINTFLAGS -D__i386__"
835 dnl $GCC is set by autoconf
836 GCC_NO_BUILTIN=""
837 if test "$GCC" = "yes"
838 then
839     GCC_NO_BUILTIN="-fno-builtin"
841 AC_SUBST(GCC_NO_BUILTIN)
843 dnl **** Generate output files ****
845 MAKE_RULES=Make.rules
846 AC_SUBST_FILE(MAKE_RULES)
848 AC_OUTPUT([
849 Make.rules
850 Makefile
851 console/Makefile
852 controls/Makefile
853 debugger/Makefile
854 dlls/Makefile
855 dlls/advapi32/Makefile
856 dlls/avifil32/Makefile
857 dlls/comctl32/Makefile
858 dlls/commdlg/Makefile
859 dlls/crtdll/Makefile
860 dlls/dciman32/Makefile
861 dlls/dplayx/Makefile
862 dlls/dsound/Makefile
863 dlls/icmp/Makefile
864 dlls/imagehlp/Makefile
865 dlls/imm32/Makefile
866 dlls/lzexpand/Makefile
867 dlls/mpr/Makefile
868 dlls/msacm/Makefile
869 dlls/msacm32/Makefile
870 dlls/msnet32/Makefile
871 dlls/msvideo/Makefile
872 dlls/ntdll/Makefile
873 dlls/ole32/Makefile
874 dlls/oleaut32/Makefile
875 dlls/olecli/Makefile
876 dlls/oledlg/Makefile
877 dlls/olesvr/Makefile
878 dlls/psapi/Makefile
879 dlls/rasapi32/Makefile
880 dlls/shell32/Makefile
881 dlls/sound/Makefile
882 dlls/stress/Makefile
883 dlls/tapi32/Makefile
884 dlls/ver/Makefile
885 dlls/version/Makefile
886 dlls/win32s/Makefile
887 dlls/win87em/Makefile
888 dlls/winaspi/Makefile
889 dlls/windebug/Makefile
890 dlls/wing/Makefile
891 dlls/winmm/Makefile
892 dlls/winmm/mcianim/Makefile
893 dlls/winmm/mciavi/Makefile
894 dlls/winmm/mcicda/Makefile
895 dlls/winmm/mciseq/Makefile
896 dlls/winmm/mciwave/Makefile
897 dlls/winmm/midimap/Makefile
898 dlls/winmm/wavemap/Makefile
899 dlls/winmm/wineoss/Makefile
900 dlls/winspool/Makefile
901 dlls/wnaspi32/Makefile
902 documentation/Makefile
903 documentation/wine.conf.man
904 documentation/wine.man
905 files/Makefile
906 graphics/Makefile
907 graphics/enhmetafiledrv/Makefile
908 graphics/metafiledrv/Makefile
909 graphics/psdrv/Makefile
910 graphics/ttydrv/Makefile
911 graphics/win16drv/Makefile
912 graphics/x11drv/Makefile
913 if1632/Makefile
914 include/Makefile
915 library/Makefile
916 libtest/Makefile
917 loader/Makefile
918 loader/ne/Makefile
919 loader/dos/Makefile
920 memory/Makefile
921 misc/Makefile
922 miscemu/Makefile
923 msdos/Makefile
924 objects/Makefile
925 ole/Makefile
926 programs/Makefile
927 programs/clock/Makefile
928 programs/cmdlgtst/Makefile
929 programs/control/Makefile
930 programs/avitools/Makefile
931 programs/osversioncheck/Makefile
932 programs/notepad/Makefile
933 programs/progman/Makefile
934 programs/regtest/Makefile
935 programs/regapi/Makefile
936 programs/view/Makefile
937 programs/wcmd/Makefile
938 programs/winhelp/Makefile
939 programs/winver/Makefile
940 rc/Makefile
941 relay32/Makefile
942 resources/Makefile
943 scheduler/Makefile
944 server/Makefile
945 tools/Makefile
946 tools/wrc/Makefile
947 tsx11/Makefile
948 win32/Makefile
949 windows/Makefile
950 windows/ttydrv/Makefile
951 windows/x11drv/Makefile ])
953 if test "$have_x" = "no"
954 then
955   echo
956   echo "*** Warning: X development files not found. Wine will be built without"
957   echo "*** X support, which currently does not work, and would probably not be"
958   echo "*** what you want anyway. You will need to install devel packages of"
959   echo "*** Xlib/Xfree86 and Xpm at the very least."
960 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
961 then
962   echo
963   echo "*** Warning: Xpm development files not found. Wine will be built without"
964   echo "*** Xpm support, which currently does not work. You will need to install"
965   echo "*** devel packages of Xpm."
968 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
969 then
970   echo
971   echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
972   echo "*** terminal resize support. Consider upgrading ncurses."
975 if test "$wine_cv_libc_reentrant" = "no" 
976 then
977   echo
978   echo "*** Warning: non-reentrant libc detected. Wine will be build without"
979   echo "*** thread support. Consider upgrading libc to a more recent"
980   echo "*** reentrant version of libc."
983 if test "$wine_cv_mesa_version_OK" = "no"
984 then
985   echo
986   echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
987   echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)"
990 echo
991 echo "Configure finished.  Do 'make depend && make' to compile Wine."
992 echo
994 dnl Local Variables:
995 dnl comment-start: "dnl "
996 dnl comment-end: ""
997 dnl comment-start-skip: "\\bdnl\\b\\s *"
998 dnl compile-command: "autoconf"
999 dnl End: