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