ReleaseCapture() is supposed to return a BOOL value.
[wine] / configure.in
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)
8
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)
12
13 dnl **** Command-line arguments ****
14
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.
21
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])
25
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])
29
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])
33
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])
37
38 AC_ARG_ENABLE(debug,
39 [  --disable-debug         compile out all debugging messages],
40 [if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
41
42 AC_ARG_ENABLE(trace,
43 [  --disable-trace         compile out TRACE messages],
44 [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
45
46 AC_ARG_WITH(reentrant-x,
47 [  --without-reentrant-x   compile for use with non-reentrant X libraries])
48
49 AC_SUBST(MAIN_TARGET)
50 AC_SUBST(LIB_TARGET)
51 AC_SUBST(ALT_LINK)
52 AC_SUBST(OPTIONS)
53
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
63 fi
64
65 dnl **** Check for some programs ****
66
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)
77
78 dnl **** Check for some libraries ****
79
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)
91 fi
92 dnl Check for -lxpg4 for FreeBSD
93 AC_CHECK_LIB(xpg4,setrunelocale)
94 dnl Check for -ldl
95 AC_CHECK_LIB(dl,dlopen)
96 AC_SUBST(XLIB)
97 if test "$have_x" = "yes"
98 then
99     XLIB="-lXext -lX11"
100     ac_save_CPPFLAGS="$CPPFLAGS"
101     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
102
103     dnl Check for -lXpm
104     AC_CHECK_HEADERS(X11/xpm.h)
105     if test "$ac_cv_header_X11_xpm_h" = "yes"
106     then 
107         AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
108     fi
109
110     dnl Check for X Shm extension
111     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/XShm.h)
112     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_XShm_h" = "yes"
113     then 
114         AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
115     fi
116     dnl Check for XFree86 DGA extension
117     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86dga.h)
118     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
119     then 
120          AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
121     fi
122
123     dnl Check for XFree86 VMODE extension
124     AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86vmode.h)
125     if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
126     then 
127         AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
128     fi
129
130     dnl Check for the presence of Mesa
131     AC_CHECK_HEADERS(GL/gl.h GL/osmesa.h)
132     if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_osmesa_h" = "yes"
133     then
134         dnl Check for some problems due to old Mesa versions
135         AC_CACHE_CHECK("for up-to-date Mesa version", wine_cv_mesa_version_OK,
136           AC_TRY_COMPILE(
137             [#include <GL/gl.h>],
138             [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
139             [wine_cv_mesa_version_OK="yes"],
140             [wine_cv_mesa_version_OK="no"]
141           )
142         )
143
144         if test "$wine_cv_mesa_version_OK" = "yes"
145         then
146             dnl Check for the presense of the library
147             AC_CHECK_LIB(MesaGL,OSMesaCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm)
148         fi
149     fi
150
151     CPPFLAGS="$ac_save_CPPFLAGS"
152 else
153     XLIB=""
154     X_CFLAGS=""
155     X_LIBS=""
156 fi
157
158 dnl **** Check which curses lib to use ***
159 AC_CHECK_HEADERS(ncurses.h)
160 if test "$ac_cv_header_ncurses_h" = "yes"
161 then 
162     AC_CHECK_LIB(ncurses,waddch)
163 fi
164 if test "$ac_cv_lib_ncurses_waddch" = "yes"
165 then
166     AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
167     AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
168 else
169     AC_CHECK_HEADERS(curses.h)
170     if test "$ac_cv_header_curses_h" = "yes"
171     then    
172        AC_CHECK_LIB(curses,waddch)
173        AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
174        AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
175     fi
176 fi
177
178 dnl **** Check for IPX (currently Linux only) ****
179 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
180  AC_TRY_COMPILE(
181    [#include <sys/socket.h>
182     #include <netipx/ipx.h>],
183    [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
184    [AC_DEFINE(HAVE_IPX_GNU)
185     ac_cv_c_ipx_gnu="yes"],
186    [ac_cv_c_ipx_gnu="no"])
187  )
188
189 if test "$ac_cv_c_ipx_gnu" = "no"
190 then
191  AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
192   AC_TRY_COMPILE(
193     [#include <sys/socket.h>
194      #include <asm/types.h>
195      #include <linux/ipx.h>],
196     [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
197     [AC_DEFINE(HAVE_IPX_LINUX)
198      ac_cv_c_ipx_linux="yes"],
199     [ac_cv_c_ipx_linux="no"])
200   )
201 fi
202
203 dnl **** Check for Open Sound System ****
204 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
205
206 AC_CACHE_CHECK("for Open Sound System",
207         ac_cv_c_opensoundsystem,
208         AC_TRY_COMPILE([
209         #if defined(HAVE_SYS_SOUNDCARD_H)
210                 #include <sys/soundcard.h>
211         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
212                 #include <machine/soundcard.h>
213         #elif defined(HAVE_SOUNDCARD_H)
214                 #include <soundcard.h>
215         #endif
216         ],[
217
218 /* check for one of the Open Sound System specific SNDCTL_ defines */
219 #if !defined(SNDCTL_DSP_STEREO)
220 #error No open sound system
221 #endif
222 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
223
224 if test "$ac_cv_c_opensoundsystem" = "yes"
225 then
226     AC_DEFINE(HAVE_OSS)
227 fi
228
229 dnl **** Check for union semun ****
230
231 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
232  AC_TRY_COMPILE([#include <sys/types.h>
233 #include <sys/sem.h>],[union semun foo],
234                 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
235 if test "$ac_cv_c_union_semun" = "yes"
236 then
237     AC_DEFINE(HAVE_UNION_SEMUN)
238 fi
239
240 dnl **** If ln -s doesn't work, use cp instead ****
241 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
242
243 dnl **** Check for gcc strength-reduce bug ****
244
245 if test "x${GCC}" = "xyes"
246 then
247   CFLAGS="$CFLAGS -Wall"
248   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
249                   AC_TRY_RUN([
250 int main(void) {
251   static int Array[[3]];
252   unsigned int B = 3;
253   int i;
254   for(i=0; i<B; i++) Array[[i]] = i - 3;
255   exit( Array[[1]] != -2 );
256 }],
257     ac_cv_c_gcc_strength_bug="no",
258     ac_cv_c_gcc_strength_bug="yes",
259     ac_cv_c_gcc_strength_bug="yes") )
260   if test "$ac_cv_c_gcc_strength_bug" = "yes"
261   then
262     CFLAGS="$CFLAGS -fno-strength-reduce"
263   fi
264 fi
265
266 dnl **** Check for underscore on external symbols ****
267
268 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
269                ac_cv_c_extern_prefix,
270 [saved_libs=$LIBS
271 LIBS="conftest_asm.s $LIBS"
272 cat > conftest_asm.s <<EOF
273         .globl _ac_test
274 _ac_test:
275         .long 0
276 EOF
277 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
278             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
279 LIBS=$saved_libs])
280 if test "$ac_cv_c_extern_prefix" = "yes"
281 then
282   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
283 fi
284
285 dnl **** Check for .string in assembler ****
286
287 AC_CACHE_CHECK("whether assembler accepts .string",
288                ac_cv_c_asm_string,
289 [saved_libs=$LIBS
290 LIBS="conftest_asm.s $LIBS"
291 cat > conftest_asm.s <<EOF
292         .string "test"
293 EOF
294 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
295 LIBS=$saved_libs])
296 if test "$ac_cv_c_asm_string" = "yes"
297 then
298   AC_DEFINE(HAVE_ASM_STRING)
299 fi
300
301 dnl **** Check for working dll ****
302
303 DLLFLAGS=""
304 LDSHARED=""
305 if test "$LIB_TARGET" = "libwine.so.1.0"
306 then
307   AC_CACHE_CHECK("whether we can build a Linux dll",
308                  ac_cv_c_dll_linux,
309   [saved_cflags=$CFLAGS
310   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
311   AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
312   CFLAGS=$saved_cflags
313   ])
314   if test "$ac_cv_c_dll_linux" = "yes"
315   then
316     DLLFLAGS="-fPIC"
317     LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
318   else
319     AC_CACHE_CHECK("whether we can build a NetBSD dll",
320                    ac_cv_c_dll_netbsd,
321     [saved_cflags=$CFLAGS
322     CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
323     AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
324     CFLAGS=$saved_cflags
325     ])
326     if test "$ac_cv_c_dll_netbsd" = "yes"
327     then
328       DLLFLAGS="-fPIC"
329       LDSHARED="ld -Bshareable -Bforcearchive"
330     fi
331   fi
332   if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
333   then
334     LIB_TARGET="libwine.a"
335   fi
336 fi
337 AC_SUBST(DLLFLAGS)
338 AC_SUBST(LDSHARED)
339
340 dnl **** Check for reentrant libc ****
341 dnl
342 dnl For cross-compiling we blindly assume that libc is reentrant. This is
343 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
344
345 dnl 
346 dnl Linux style errno location
347 dnl 
348 AC_CACHE_CHECK("for reentrant libc", wine_cv_libc_reentrant,
349   [AC_TRY_RUN([int myerrno = 0;
350 char buf[256];
351 int *__errno_location(){return &myerrno;}
352 main(){connect(0,buf,255); exit(!myerrno);}],
353   wine_cv_libc_reentrant=yes, wine_cv_libc_reentrant=no,
354   wine_cv_libc_reentrant=yes )
355 dnl
356 dnl FreeBSD style errno location
357 dnl 
358   if test "$wine_cv_libc_reentrant" = "no" 
359   then
360     AC_TRY_RUN([int myerrno = 0;
361 char buf[256];
362 int *__error(){return &myerrno;}
363 main(){connect(0,buf,255); exit(!myerrno);}],
364     wine_cv_libc_reentrant=yes, wine_cv_libc_reentrant=no,
365     wine_cv_libc_reentrant=yes )
366   fi
367 ])
368 if test "$wine_cv_libc_reentrant" = "no" 
369 then
370   AC_DEFINE(NO_REENTRANT_LIBC)
371 fi
372
373 dnl **** Check for reentrant X libraries ****
374 dnl
375 dnl This may fail to determine whether X libraries are reentrant if
376 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
377 dnl is possible with the --without-reentrant-x option.
378
379 if test "$have_x" = "yes"
380 then
381 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
382   [ if test "x$with_reentrant_x" = "xno"
383     then
384         wine_cv_x_reentrant=no
385     else
386         libX11_ckeck=none
387         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
388             if test -r $dir/libX11.so; then
389                 libX11_check="-D $dir/libX11.so"
390                 break 1
391             fi
392             if test -r $dir/libX11.a; then
393                 libX11_check="$dir/libX11.a"
394                 break 1
395             fi
396         done
397         if test "$libX11_check" != "none"; then
398             if nm $libX11_check | grep __errno_location >/dev/null 2>&1
399             then
400                 wine_cv_x_reentrant=yes
401             else
402                 wine_cv_x_reentrant=no
403             fi
404         else
405             wine_cv_x_reentrant=unknown
406         fi
407     fi ] )
408 else
409     wine_cv_x_reentrant=no
410 fi
411 if test "$wine_cv_x_reentrant" = "no"
412 then
413   AC_DEFINE(NO_REENTRANT_X11)
414 fi
415
416 dnl **** Check for functions and header files ****
417
418 AC_CHECK_FUNCS(rfork clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
419 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)
420 AC_HEADER_STAT()
421 AC_C_CONST()
422 AC_TYPE_SIZE_T()
423 AC_CHECK_SIZEOF(long long,0)
424
425 dnl **** Check for sendmsg in -lsocket if not found above ****
426
427 if test $ac_cv_func_sendmsg = no; then
428     AC_CHECK_LIB(socket,sendmsg)
429 fi
430
431 dnl **** statfs checks ****
432
433 if test "$ac_cv_header_sys_vfs_h" = "yes"
434 then
435     AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
436                     wine_cv_sys_vfs_has_statfs,
437         AC_TRY_COMPILE([
438         #include <sys/types.h>
439         #ifdef HAVE_SYS_PARAM_H
440         # include <sys/param.h>
441         #endif
442         #include <sys/vfs.h>
443         ],[
444                 struct statfs stfs;
445
446                 memset(&stfs,0,sizeof(stfs));
447         ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
448         )
449     )
450     if test "$wine_cv_sys_vfs_has_statfs" = "yes"
451     then
452       AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
453     fi
454 fi
455
456 if test "$ac_cv_header_sys_statfs_h" = "yes"
457 then
458     AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
459                     wine_cv_sys_statfs_has_statfs,
460         AC_TRY_COMPILE([
461         #include <sys/types.h>
462         #ifdef HAVE_SYS_PARAM_H
463         # include <sys/param.h>
464         #endif
465         #include <sys/statfs.h>
466         ],[
467                 struct statfs stfs;
468         ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
469         )
470     )
471     if test "$wine_cv_sys_statfs_has_statfs" = "yes"
472     then
473       AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
474     fi
475 fi
476
477 if test "$ac_cv_header_sys_mount_h" = "yes"
478 then
479     AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
480                     wine_cv_sys_mount_has_statfs,
481         AC_TRY_COMPILE([
482         #include <sys/types.h>
483         #ifdef HAVE_SYS_PARAM_H
484         # include <sys/param.h>
485         #endif
486         #include <sys/mount.h>
487         ],[
488                 struct statfs stfs;
489         ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
490         )
491     )
492     if test "$wine_cv_sys_mount_has_statfs" = "yes"
493     then
494       AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
495     fi
496 fi
497
498 dnl **** FIXME: what about mixed cases, where we need two of them? ***
499
500 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
501   [ if test "x$statfs_bfree" = "xno"
502     then
503         wine_cv_statfs_bfree=no
504     else
505         AC_TRY_COMPILE([
506         #include <sys/types.h>
507         #ifdef HAVE_SYS_PARAM_H
508         # include <sys/param.h>
509         #endif
510         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
511         # include <sys/mount.h>
512         #else
513         # ifdef STATFS_DEFINED_BY_SYS_VFS
514         #  include <sys/vfs.h>
515         # else
516         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
517         #   include <sys/statfs.h>
518         #  endif
519         # endif
520         #endif
521         ],[
522                 struct statfs stfs;
523
524                 stfs.f_bfree++;
525         ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
526         )
527     fi ] )
528 if test "$wine_cv_statfs_bfree" = "yes"
529 then
530   AC_DEFINE(STATFS_HAS_BFREE)
531 fi
532
533 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
534   [ if test "x$statfs_bavail" = "xno"
535     then
536         wine_cv_statfs_bavail=no
537     else
538         AC_TRY_COMPILE([
539         #include <sys/types.h>
540         #ifdef HAVE_SYS_PARAM_H
541         # include <sys/param.h>
542         #endif
543         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
544         # include <sys/mount.h>
545         #else
546         # ifdef STATFS_DEFINED_BY_SYS_VFS
547         #  include <sys/vfs.h>
548         # else
549         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
550         #   include <sys/statfs.h>
551         #  endif
552         # endif
553         #endif
554         ],[
555                 struct statfs stfs;
556
557                 stfs.f_bavail++;
558         ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
559         )
560     fi ] )
561 if test "$wine_cv_statfs_bavail" = "yes"
562 then
563   AC_DEFINE(STATFS_HAS_BAVAIL)
564 fi
565
566 dnl *** check for working sigaltstack
567 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
568
569 AC_CACHE_CHECK("for working sigaltstack",
570         ac_cv_c_working_sigaltstack,
571         AC_TRY_RUN([
572         #include <stdio.h>
573         #include <time.h> /* <sys/time.h> ? bad magic without end */
574         #include <sys/types.h>
575         #include <sys/signal.h>
576         #ifdef HAVE_SYS_PARAM_H
577         # include <sys/param.h>
578         #endif
579         #ifdef HAVE_SYSCALL_H
580         # include <syscall.h>
581         #else
582         # ifdef HAVE_SYS_SYSCALL_H
583         #  include <sys/syscall.h>
584         # endif
585         #endif
586         
587         unsigned char *xaltstack;
588
589         int
590         main(int argc,char **argv) {
591             struct sigaltstack  ss;
592
593             xaltstack = malloc(16384);
594             ss.ss_sp    = xaltstack;
595             ss.ss_size  = 16384;
596             ss.ss_flags = 0;
597             if (sigaltstack(&ss, NULL) < 0) {
598                 /* this catches the glibc case */
599                 perror("sigaltstack");
600                 return (1); /* aka exit(1) aka fail */
601             }
602             /* assume it works. */
603             return 0; /* OK */
604         }
605         ],
606         ac_cv_c_working_sigaltstack="yes",
607         ac_cv_c_working_sigaltstack="no",
608         ac_cv_c_working_sigaltstack="no"
609 ))
610
611 if test "$ac_cv_c_working_sigaltstack" = "yes"
612 then
613     AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
614 fi
615
616
617 dnl *** check for file descriptor passing with msg_accrights
618
619 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
620  AC_TRY_COMPILE([#include <sys/types.h>
621 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
622                 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
623 if test "$ac_cv_c_msg_accrights" = "yes"
624 then
625     AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
626 fi
627
628 dnl **** Generate output files ****
629
630 MAKE_RULES=Make.rules
631 AC_SUBST_FILE(MAKE_RULES)
632
633 AC_OUTPUT([
634 Make.rules
635 Makefile
636 console/Makefile
637 controls/Makefile
638 debugger/Makefile
639 dlls/Makefile
640 dlls/advapi32/Makefile
641 dlls/avifil32/Makefile
642 dlls/comctl32/Makefile
643 dlls/commdlg/Makefile
644 dlls/imagehlp/Makefile
645 dlls/msacm/Makefile
646 dlls/msacm32/Makefile
647 dlls/ntdll/Makefile
648 dlls/psapi/Makefile
649 dlls/rasapi32/Makefile
650 dlls/shell32/Makefile
651 dlls/tapi32/Makefile
652 dlls/ver/Makefile
653 dlls/version/Makefile
654 dlls/winaspi/Makefile
655 dlls/wnaspi32/Makefile
656 documentation/Makefile
657 files/Makefile
658 graphics/Makefile
659 graphics/metafiledrv/Makefile
660 graphics/psdrv/Makefile
661 graphics/ttydrv/Makefile
662 graphics/win16drv/Makefile
663 graphics/x11drv/Makefile
664 if1632/Makefile
665 include/Makefile
666 ipc/Makefile
667 library/Makefile
668 libtest/Makefile
669 loader/Makefile
670 loader/ne/Makefile
671 loader/dos/Makefile
672 memory/Makefile
673 misc/Makefile
674 miscemu/Makefile
675 msdos/Makefile
676 multimedia/Makefile
677 objects/Makefile
678 ole/Makefile
679 programs/Makefile
680 programs/clock/Makefile
681 programs/cmdlgtst/Makefile
682 programs/control/Makefile
683 programs/avitools/Makefile
684 programs/notepad/Makefile
685 programs/progman/Makefile
686 programs/regtest/Makefile
687 programs/regapi/Makefile
688 programs/view/Makefile
689 programs/winhelp/Makefile
690 programs/winver/Makefile
691 rc/Makefile
692 relay32/Makefile
693 resources/Makefile
694 scheduler/Makefile
695 server/Makefile
696 tools/Makefile
697 tools/wrc/Makefile
698 tsx11/Makefile
699 win32/Makefile
700 windows/Makefile
701 windows/ttydrv/Makefile
702 windows/x11drv/Makefile ])
703
704 if test "$have_x" = "no"
705 then
706   echo
707   echo "*** Warning: X development files not found. Wine will be built without"
708   echo "*** X support, which currently does not work, and would probably not be"
709   echo "*** what you want anyway. You will need to install devel packages of"
710   echo "*** Xlib/Xfree86 and Xpm at the very least."
711 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
712 then
713   echo
714   echo "*** Warning: Xpm development files not found. Wine will be built without"
715   echo "*** Xpm support, which currently does not work. You will need to install"
716   echo "*** devel packages of Xpm."
717 fi
718
719 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
720 then
721   echo
722   echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
723   echo "*** terminal resize support. Consider upgrading ncurses."
724 fi
725
726 if test "$wine_cv_libc_reentrant" = "no" 
727 then
728   echo
729   echo "*** Warning: non-reentrant libc detected. Wine will be build without"
730   echo "*** thread support. Consider upgrading libc to a more recent"
731   echo "*** reentrant version of libc."
732 fi
733
734 if test "$wine_cv_mesa_version_OK" = "no"
735 then
736   echo
737   echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
738   echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)"
739 fi
740
741 echo
742 echo "Configure finished.  Do 'make depend && make' to compile Wine."
743 echo
744
745 dnl Local Variables:
746 dnl comment-start: "dnl "
747 dnl comment-end: ""
748 dnl comment-start-skip: "\\bdnl\\b\\s *"
749 dnl compile-command: "autoconf"
750 dnl End: