Added assembly wrapper for calling window procedures.
[wine.git] / configure.in
blobe7266c619a8ee99e9c53b9894a6c2f7ae0039719
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 dnl **** Command-line arguments ****
11 dnl Default values
12 LIBEXT=so       # library type .so or .a
13 TRACE_MSGS=yes  # the TRACE() macro
14 DEBUG_MSGS=yes  # the TRACE(), WARN(), and FIXME() macros.
15 CURSES=yes
16 OPENGL=normal
18 AC_ARG_ENABLE(dll,
19 [  --disable-dll           build static libraries instead of DLLs],
20 [if test "$enableval" = "no"; then LIBEXT="a"; fi])
22 AC_ARG_ENABLE(debug,
23 [  --disable-debug         compile out all debugging messages],
24 [if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
26 AC_ARG_ENABLE(opengl,
27 [  --enable-opengl         force usage of OpenGL even if the latter is thread-safe],
28 [if test "$enableval" = "no"; then OPENGL="no"; elif test "$enableval" = "yes"; then OPENGL="yes"; fi])
30 AC_ARG_ENABLE(trace,
31 [  --disable-trace         compile out TRACE messages],
32 [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
34 AC_ARG_WITH(curses,
35 [  --without-curses        do not use curses],
36 [if test "$withval" = "no"; then CURSES="no"; fi])
38 AC_ARG_WITH(reentrant-x,
39 [  --without-reentrant-x   compile for use with non-reentrant X libraries])
41 AC_SUBST(OPTIONS)
43 if test "$DEBUG_MSGS" = "no"
44 then
45     AC_DEFINE(NO_DEBUG_MSGS)
46     AC_DEFINE(NO_TRACE_MSGS)
47 else
48     if test "$TRACE_MSGS" = "no"
49     then
50         AC_DEFINE(NO_TRACE_MSGS)
51     fi
54 dnl **** Check for some programs ****
56 AC_PROG_MAKE_SET
57 AC_PROG_CC
58 AC_PROG_CPP
59 AC_PATH_XTRA
60 AC_PROG_YACC
61 AC_PROG_LEX
62 AC_PROG_RANLIB
63 AC_PROG_INSTALL
64 AC_PROG_LN_S
65 AC_CHECK_PROG(C2MAN,c2man,c2man,true)
66 AC_PATH_PROG(LDCONFIG, ldconfig, true, /sbin:/usr/sbin:$PATH)
68 dnl Check for lint
69 AC_CHECK_PROGS(LINT, lclint lint)
70 if test "$LINT" = "lint"
71 then
72   LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
73   dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
75 AC_SUBST(LINT)
76 AC_SUBST(LINTFLAGS)
78 dnl **** Check for some libraries ****
80 dnl Check for -lm for BeOS
81 AC_CHECK_LIB(m,sqrt)
82 dnl Check for -li386 for NetBSD and OpenBSD
83 AC_CHECK_LIB(i386,i386_set_ldt)
84 dnl Check for -lossaudio for NetBSD
85 AC_CHECK_LIB(ossaudio,_oss_ioctl)
86 dnl Check for -lw for Solaris
87 AC_CHECK_LIB(w,iswalnum)
88 dnl Check for -lnsl for Solaris
89 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))
90 dnl Check for -lsocket for Solaris
91 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
92 dnl Check for -lxpg4 for FreeBSD
93 AC_CHECK_LIB(xpg4,setrunelocale)
94 dnl Check for -lmmap for OS/2
95 AC_CHECK_LIB(mmap,mmap)
96 dnl Check for openpty
97 AC_CHECK_FUNCS(openpty,,
98         AC_CHECK_LIB(util,openpty,
99                 AC_DEFINE(HAVE_OPENPTY)
100                 LIBS="$LIBS -lutil"
101         ))
103 AC_CHECK_HEADERS(dlfcn.h,
104         AC_CHECK_FUNCS(dlopen,
105                 AC_DEFINE(HAVE_DL_API),
106                 AC_CHECK_LIB(dl,dlopen,
107                         AC_DEFINE(HAVE_DL_API)
108                         LIBS="$LIBS -ldl",
109                         LIBEXT="a"
110                 )
111         ),
112         LIBEXT="a"
114 AC_SUBST(XLIB)
115 AC_SUBST(X_DLLS)
116 X_DLLS=""
117 AC_SUBST(XFILES)
118 XFILES=""
119 AC_SUBST(OPENGLFILES)
120 OPENGLFILES=""
121 AC_SUBST(OPENGL32_DLL)
122 OPENGL32_DLL=""
123 AC_SUBST(DGA_SRCS)
124 DGA_SRCS=""
125 AC_SUBST(DGA2_SRCS)
126 DGA2_SRCS=""
127 AC_SUBST(MESA_SRCS)
128 MESA_SRCS=""
129 if test "$have_x" = "yes"
130 then
131     XLIB="-lXext -lX11"
132     ac_save_CPPFLAGS="$CPPFLAGS"
133     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
135     dnl *** Check for -lXpm
136     AC_CHECK_HEADERS(X11/xpm.h,
137       [ dnl *** If X11/xpm.h exists...
138         AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
139           [ AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
140           $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
141         )
142       ],
143       [ dnl *** If X11/xpm.h does not exist...
144         dnl NOTE: autoconf does not allow commas inside the third 
145         dnl       parameter to AC_CHECK_HEADERS, due to some quoting
146         dnl       magic it does.
147         echo "Redhat            :       xpm xpm-devel"
148         echo "Caldera OpenLinux :       xpm xpm-devel xpm-devel-static"
149         echo "SuSE              :       xpm"
150         echo "Debian/Corel Linux:       xpm4g xpm4g-dev"
151         echo
152         echo "Or get the sources from ftp.x.org and all its mirror sites from "
153         echo "the directory /contrib/libraries."
154         echo
155         exit 1
156       ]
157     )
159     dnl *** All three of the following tests require X11/Xlib.h
160     AC_CHECK_HEADERS(X11/Xlib.h,
161       [
162         dnl *** Check for X Shm extension
163         AC_CHECK_HEADERS(X11/extensions/XShm.h,
164             [ dnl *** If X11/extensions/XShm.h exists...
165               AC_CHECK_LIB(Xext, XShmQueryExtension,
166               AC_DEFINE(HAVE_LIBXXSHM),,
167               $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
168             ],
169             AC_MSG_WARN([Xshm extension not found!!])
170         )
172         dnl *** Check for XFree86 DGA / DGA 2.0 extension
173         AC_CHECK_HEADERS(X11/extensions/xf86dga.h,
174             [ dnl *** If X11/extensions/xf86dga.h exists, check 
175               dnl *** for XDGAQueryExtension()...
176               AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
177                 [ dnl *** If found...
178                   AC_DEFINE(HAVE_LIBXXF86DGA2)
179                   AC_DEFINE(HAVE_LIBXXF86DGA)
180                   X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
181                   DGA_SRCS='$(DGA_SRCS)'
182                   DGA2_SRCS='$(DGA2_SRCS)'
183                ],
184                 [ dnl *** If not found, look for XF86DGAQueryExtension()
185                   dnl *** instead (DGA 2.0 not found)...
186                   AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
187                     [ AC_DEFINE(HAVE_LIBXXF86DGA)
188                       X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
189                       DGA_SRCS='$(DGA_SRCS)'
190                     ],,
191                     $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
192                   )
193                 ],
194                 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
195               )
196             ],
197             AC_MSG_WARN([DGA extension not found!!])
198         )
200         dnl *** Check for XFree86 VMODE extension
201         AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
202             [ dnl *** If X11/extensions/xf86vmode.h exists...
203                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
204                   [ AC_DEFINE(HAVE_LIBXXF86VM)
205                      X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
206                   ],,
207                   $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
208                 )
209             ],
210             AC_MSG_WARN([XFree86 VMODE extension not found!!])
211         )
212       ]
213     ) dnl *** End of X11/Xlib.h check
215     dnl Check for the presence of OpenGL
216     if test $OPENGL = "yes" -o $OPENGL = "normal"
217     then
218         AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h)
219         if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes" -a "$ac_cv_header_GL_glext_h" = "yes"
220         then
221             dnl Check for some problems due to old Mesa versions
222             AC_CACHE_CHECK("for up-to-date OpenGL version", wine_cv_opengl_version_OK,
223               AC_TRY_COMPILE(
224                 [#include <GL/gl.h>],
225                 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
226                 [wine_cv_opengl_version_OK="yes"],
227                 [wine_cv_opengl_version_OK="no"]
228               )
229             )
231             dnl Check for the thread-safety of the OpenGL library
232             AC_CACHE_CHECK("for thread-safe OpenGL version", 
233                            wine_cv_opengl_version_threadsafe,
234               [saved_libs=$LIBS
235                LIBS="$X_LIBS -lGL"
236                AC_TRY_LINK([],[pthread_getspecific();],
237                               [wine_cv_opengl_version_threadsafe="yes"],
238                               [wine_cv_opengl_version_threadsafe="no"])
239                LIBS=$saved_libs]
240             )
242             if test "$wine_cv_opengl_version_OK" = "yes" -a \( "$wine_cv_opengl_version_threadsafe" = "no" -o $OPENGL = "yes" \)
243             then
244                 dnl Check for the presense of the library
245                 AC_CHECK_LIB(GL,glXCreateContext,
246                              X_PRE_LIBS="$X_PRE_LIBS -lGL"
247                              MESA_SRCS='$(MESA_SRCS)'
248                              ,,
249                              $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
251                 if test $ac_cv_lib_GL_glXCreateContext = "yes"
252                 then
253                         AC_CHECK_LIB(GL,glXGetProcAddressARB,AC_DEFINE(HAVE_GLX_GETPROCADDRESS),,$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
255                         if test $ac_cv_lib_GL_glXGetProcAddressARB = "yes"
256                         then
257                                 AC_DEFINE(HAVE_OPENGL)
258                                 OPENGL32_DLL=opengl32
259                                 OPENGLFILES='$(OPENGLFILES)'
260                         fi
261                 fi
262              fi
263          fi
264     fi
266     CPPFLAGS="$ac_save_CPPFLAGS"
267     X_DLLS='$(X_DLLS)'
268     XFILES='$(XFILES)'
269 else
270     XLIB=""
271     X_CFLAGS=""
272     X_LIBS=""
275 dnl **** Check which curses lib to use ***
276 if test "$CURSES" = "yes"
277 then
278     AC_CHECK_HEADERS(ncurses.h)
279     if test "$ac_cv_header_ncurses_h" = "yes"
280     then 
281         AC_CHECK_LIB(ncurses,waddch)
282     fi
283     if test "$ac_cv_lib_ncurses_waddch" = "yes"
284     then
285         AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
286         AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
287     else
288         AC_CHECK_HEADERS(curses.h)
289         if test "$ac_cv_header_curses_h" = "yes"
290         then    
291             AC_CHECK_LIB(curses,waddch)
292             if test "$ac_cv_lib_curses_waddch" = "yes"
293             then
294                 AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
295                 AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
296             fi
297         fi
298     fi
301 dnl **** Check for IPX (currently Linux only) ****
302 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
303  AC_TRY_COMPILE(
304    [#include <sys/socket.h>
305     #include <netipx/ipx.h>],
306    [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
307    [ac_cv_c_ipx_gnu="yes"],
308    [ac_cv_c_ipx_gnu="no"])
310 if test "$ac_cv_c_ipx_gnu" = "yes"
311 then
312     AC_DEFINE(HAVE_IPX_GNU)
315 if test "$ac_cv_c_ipx_gnu" = "no"
316 then
317  AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
318   AC_TRY_COMPILE(
319     [#include <sys/socket.h>
320      #include <asm/types.h>
321      #include <linux/ipx.h>],
322     [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
323     [ac_cv_c_ipx_linux="yes"],
324     [ac_cv_c_ipx_linux="no"])
325   )
326   if test "$ac_cv_c_ipx_linux" = "yes"
327   then
328       AC_DEFINE(HAVE_IPX_LINUX)
329   fi
332 dnl **** Check for Open Sound System ****
333 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
335 AC_CACHE_CHECK("for Open Sound System",
336         ac_cv_c_opensoundsystem,
337         AC_TRY_COMPILE([
338         #if defined(HAVE_SYS_SOUNDCARD_H)
339                 #include <sys/soundcard.h>
340         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
341                 #include <machine/soundcard.h>
342         #elif defined(HAVE_SOUNDCARD_H)
343                 #include <soundcard.h>
344         #endif
345         ],[
347 /* check for one of the Open Sound System specific SNDCTL_ defines */
348 #if !defined(SNDCTL_DSP_STEREO)
349 #error No open sound system
350 #endif
351 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
353 if test "$ac_cv_c_opensoundsystem" = "yes"
354 then
355     AC_DEFINE(HAVE_OSS)
358 AC_CACHE_CHECK("for Open Sound System/MIDI interface",
359         ac_cv_c_opensoundsystem_midi,
360         AC_TRY_COMPILE([
361         #if defined(HAVE_SYS_SOUNDCARD_H)
362                 #include <sys/soundcard.h>
363         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
364                 #include <machine/soundcard.h>
365         #elif defined(HAVE_SOUNDCARD_H)
366                 #include <soundcard.h>
367         #endif
368         ],[
370 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
371 #if !defined(SNDCTL_SEQ_SYNC)
372 #error No open sound system MIDI interface
373 #endif
374 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
376 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
377 then
378     AC_DEFINE(HAVE_OSS_MIDI)
381 dnl **** If ln -s doesn't work, use cp instead ****
382 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
384 dnl **** Check for gcc strength-reduce bug ****
386 if test "x${GCC}" = "xyes"
387 then
388   CFLAGS="$CFLAGS -Wall"
389   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
390                   AC_TRY_RUN([
391 int main(void) {
392   static int Array[[3]];
393   unsigned int B = 3;
394   int i;
395   for(i=0; i<B; i++) Array[[i]] = i - 3;
396   exit( Array[[1]] != -2 );
398     ac_cv_c_gcc_strength_bug="no",
399     ac_cv_c_gcc_strength_bug="yes",
400     ac_cv_c_gcc_strength_bug="yes") )
401   if test "$ac_cv_c_gcc_strength_bug" = "yes"
402   then
403     CFLAGS="$CFLAGS -fno-strength-reduce"
404   fi
407 dnl **** Check for underscore on external symbols ****
409 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
410                ac_cv_c_extern_prefix,
411 [saved_libs=$LIBS
412 LIBS="conftest_asm.s $LIBS"
413 cat > conftest_asm.s <<EOF
414         .globl _ac_test
415 _ac_test:
416         .long 0
418 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
419             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
420 LIBS=$saved_libs])
421 if test "$ac_cv_c_extern_prefix" = "yes"
422 then
423   AC_DEFINE(NEED_UNDERSCORE_PREFIX)
426 dnl **** Check for .string in assembler ****
428 AC_CACHE_CHECK("whether assembler accepts .string",
429                ac_cv_c_asm_string,
430 [saved_libs=$LIBS
431 LIBS="conftest_asm.s $LIBS"
432 cat > conftest_asm.s <<EOF
433         .string "test"
435 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
436 LIBS=$saved_libs])
437 if test "$ac_cv_c_asm_string" = "yes"
438 then
439   AC_DEFINE(HAVE_ASM_STRING)
442 dnl **** Check for working dll ****
444 LDSHARED=""
445 if test "$LIBEXT" = "so"
446 then
447   AC_CACHE_CHECK("whether we can build a Linux dll",
448                  ac_cv_c_dll_linux,
449   [saved_cflags=$CFLAGS
450   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
451   AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
452   CFLAGS=$saved_cflags
453   ])
454   if test "$ac_cv_c_dll_linux" = "yes"
455   then
456     LDSHARED="\$(CC) -shared -Wl,-soname,\$(SONAME),-rpath,\$(libdir)"
457   else
458     AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
459                  ac_cv_c_dll_unixware,
460     [saved_cflags=$CFLAGS
461     CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0"
462     AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
463     CFLAGS=$saved_cflags
464     ])
465     if test "$ac_cv_c_dll_unixware" = "yes"
466     then
467       LDSHARED="\$(CC) -Wl,-G,-h,\$(libdir)/\$(SONAME)"
468     else
469       AC_CACHE_CHECK("whether we can build a NetBSD dll",
470                    ac_cv_c_dll_netbsd,
471       [saved_cflags=$CFLAGS
472       CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
473       AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
474       CFLAGS=$saved_cflags
475       ])
476       if test "$ac_cv_c_dll_netbsd" = "yes"
477       then
478         LDSHARED="ld -Bshareable -Bforcearchive"
479       fi
480     fi
481   fi
482   if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_unixware" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
483   then
484     LIBEXT="a"
485   fi
488 DLLFLAGS=""
490 if test "$LIBEXT" = "so"; then
491     DLLFLAGS="-fPIC"
492     DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine"
493 else
494     DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine \$(X_LIBS) \$(XLIB)"
495     AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)],
496                    ac_cv_c_whole_archive,
497             [saved_cflags=$CFLAGS
498             CFLAGS="$CFLAGS -Wl,--whole-archive -Wl,--no-whole-archive"
499             AC_TRY_LINK(,[return 1],ac_cv_c_whole_archive="yes",ac_cv_c_whole_archive="no")
500             CFLAGS=$saved_cflags
501             ])
502     if test "$ac_cv_c_whole_archive" = "yes"
503     then
504         DLL_LINK="-Wl,--whole-archive $DLL_LINK -Wl,--no-whole-archive"
505     else
506         AC_CACHE_CHECK([whether the linker supports -z {all,default}extract (Linux)],
507                        ac_cv_c_allextract,
508                 [saved_cflags=$CFLAGS
509                 CFLAGS="$CFLAGS -Wl,-z,allextract -Wl,-z,defaultextract"
510                 AC_TRY_LINK(,[return 1],ac_cv_c_allextract="yes",ac_cv_c_allextract="no")
511                 CFLAGS=$saved_cflags
512                 ])
513         if test "$ac_cv_c_allextract" = "yes"
514         then
515             DLL_LINK="-Wl,-z,allextract $DLL_LINK -Wl,-z,defaultextract"
516         fi
517     fi
520 AC_SUBST(DLL_LINK)
521 AC_SUBST(DLLFLAGS)
522 AC_SUBST(LDSHARED)
523 AC_SUBST(LIBEXT)
525 dnl **** Check for reentrant libc ****
527 dnl For cross-compiling we blindly assume that libc is reentrant. This is
528 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
530 wine_cv_libc_reentrant=no 
531 dnl 
532 dnl Linux style errno location
533 dnl 
534 AC_CACHE_CHECK("for reentrant libc: __errno_location", wine_cv_libc_r__errno_location,
535   [AC_TRY_RUN([int myerrno = 0;
536 char buf[256];
537 int *__errno_location(){return &myerrno;}
538 main(){connect(0,buf,255); exit(!myerrno);}],
539   wine_cv_libc_r__errno_location=yes, wine_cv_libc_r__errno_location=no,
540   wine_cv_libc_r__errno_location=yes )
542 if test "$wine_cv_libc_r__errno_location" = "yes"
543 then
544     AC_DEFINE(HAVE__ERRNO_LOCATION)
545     wine_cv_libc_reentrant=__errno_location 
548 dnl FreeBSD style errno location
549 dnl 
550 AC_CACHE_CHECK("for reentrant libc: __error", wine_cv_libc_r__error,
551   [AC_TRY_RUN([int myerrno = 0;
552 char buf[256];
553 int *__error(){return &myerrno;}
554 main(){connect(0,buf,255); exit(!myerrno);}],
555     wine_cv_libc_r__error=yes, wine_cv_libc_r__error=no,
556     wine_cv_libc_r__error=yes )
558 if test "$wine_cv_libc_r__error" = "yes"
559 then
560     AC_DEFINE(HAVE__ERROR)
561     wine_cv_libc_reentrant=__error 
564 dnl Solaris style errno location
565 dnl 
566 AC_CACHE_CHECK("for reentrant libc: ___errno", wine_cv_libc_r___errno,
567   [AC_TRY_RUN([int myerrno = 0;
568 char buf[256];
569 int *___errno(){return &myerrno;}
570 main(){connect(0,buf,255); exit(!myerrno);}],
571     wine_cv_libc_r___errno=yes, wine_cv_libc_r___errno=no,
572     wine_cv_libc_r___errno=yes )
574 if test "$wine_cv_libc_r___errno" = "yes"
575 then
576     AC_DEFINE(HAVE___ERRNO)
577     wine_cv_libc_reentrant=___errno 
580 dnl UnixWare style errno location
581 dnl 
582 AC_CACHE_CHECK("for reentrant libc: __thr_errno", wine_cv_libc_r__thr_errno,
583   [AC_TRY_RUN([int myerrno = 0;
584 char buf[256];
585 int *__thr_errno(){return &myerrno;}
586 main(){connect(0,buf,255); exit(!myerrno);}],
587     wine_cv_libc_r__thr_errno=yes, wine_cv_libc_r__thr_errno=no,
588     wine_cv_libc_r__thr_errno=yes )
590 if test "$wine_cv_libc_r__thr_errno" = "yes"
591 then
592     AC_DEFINE(HAVE__THR_ERRNO)
593     wine_cv_libc_reentrant=__thr_errno 
595 if test "$wine_cv_libc_reentrant" = "no" 
596 then
597   AC_DEFINE(NO_REENTRANT_LIBC)
600 dnl **** Check for reentrant X libraries ****
602 dnl This may fail to determine whether X libraries are reentrant if
603 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
604 dnl is possible with the --without-reentrant-x option.
606 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
607 then
608 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
609   [ if test "x$with_reentrant_x" = "xno" 
610     then
611         wine_cv_x_reentrant=no
612     else
613         libX11_check=none
614         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
615             if test -r $dir/libX11.so; then
616                 libX11_check="-D $dir/libX11.so"
617                 break 1
618             fi
619             if test -r $dir/libX11.a; then
620                 libX11_check="$dir/libX11.a"
621                 break 1
622             fi
623         done
624         if test "$libX11_check" != "none"; then
625             if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
626             then
627                 wine_cv_x_reentrant=yes
628             else
629                 wine_cv_x_reentrant=no
630             fi
631         else
632             wine_cv_x_reentrant=unknown
633         fi
634     fi ] )
635 else
636     wine_cv_x_reentrant=no
638 if test "$wine_cv_x_reentrant" = "no"
639 then
640   AC_DEFINE(NO_REENTRANT_X11)
643 dnl **** Check for endianness ****
645 AC_C_BIGENDIAN
647 dnl **** Check for functions ****
649 AC_FUNC_ALLOCA()
650 AC_CHECK_FUNCS(\
651         __libc_fork \
652         _lwp_create \
653         clone \
654         getnetbyaddr \
655         getnetbyname \
656         getpagesize \
657         getprotobyname \
658         getprotobynumber \
659         getservbyport \
660         getsockopt \
661         inet_network \
662         memmove \
663         rfork \
664         select \
665         sendmsg \
666         settimeofday \
667         sigaltstack \
668         statfs \
669         strcasecmp \
670         strerror \
671         strncasecmp \
672         tcgetattr \
673         timegm \
674         usleep \
675         vfscanf \
676         wait4 \
677         waitpid \
680 dnl **** Check for header files ****
682 AC_CHECK_HEADERS(\
683         a.out.h \
684         a_out.h \
685         arpa/inet.h \
686         arpa/nameser.h \
687         elf.h \
688         float.h \
689         libio.h \
690         libutil.h \
691         link.h \
692         linux/cdrom.h \
693         linux/joystick.h \
694         linux/ucdrom.h \
695         net/if.h \
696         netinet/in.h \
697         netinet/tcp.h \
698         pty.h \
699         resolv.h \
700         sched.h \
701         socket.h \
702         strings.h \
703         sys/cdio.h \
704         sys/errno.h \
705         sys/file.h \
706         sys/filio.h \
707         sys/ipc.h \
708         sys/lwp.h \
709         sys/mman.h \
710         sys/modem.h \
711         sys/mount.h \
712         sys/msg.h \
713         sys/param.h \
714         sys/reg.h \
715         sys/signal.h \
716         sys/shm.h \
717         sys/socket.h \
718         sys/sockio.h \
719         sys/statfs.h \
720         sys/strtio.h \
721         sys/syscall.h \
722         sys/wait.h \
723         sys/v86.h \
724         sys/v86intr.h \
725         sys/vfs.h \
726         sys/vm86.h \
727         syscall.h \
728         ucontext.h \
729         wctype.h \
731 AC_HEADER_STAT()
733 dnl **** Check for types ****
735 AC_C_CONST()
736 AC_C_INLINE()
737 AC_TYPE_SIZE_T()
738 AC_CHECK_SIZEOF(long long,0)
740 if test "$ac_cv_header_linux_joystick_h" = "yes"
741 then
742    AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
743         wine_cv_linux_joystick_22_api,
744         AC_TRY_COMPILE([
745         #include <sys/ioctl.h>
746         #include <linux/joystick.h>
748         struct js_event blub;
749         #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
750         #error "no 2.2 header"
751         #endif
752         ],/*empty*/,
753         wine_cv_linux_joystick_22_api=yes,
754         wine_cv_linux_joystick_22_api=no,
755         wine_cv_linux_joystick_22_api=no
756         )
757    )
758    if test "$wine_cv_linux_joystick_22_api" = "yes"
759    then
760       AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API)
761    fi
764 dnl **** statfs checks ****
766 if test "$ac_cv_header_sys_vfs_h" = "yes"
767 then
768     AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
769                     wine_cv_sys_vfs_has_statfs,
770         AC_TRY_COMPILE([
771         #include <sys/types.h>
772         #ifdef HAVE_SYS_PARAM_H
773         # include <sys/param.h>
774         #endif
775         #include <sys/vfs.h>
776         ],[
777                 struct statfs stfs;
779                 memset(&stfs,0,sizeof(stfs));
780         ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
781         )
782     )
783     if test "$wine_cv_sys_vfs_has_statfs" = "yes"
784     then
785       AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
786     fi
789 if test "$ac_cv_header_sys_statfs_h" = "yes"
790 then
791     AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
792                     wine_cv_sys_statfs_has_statfs,
793         AC_TRY_COMPILE([
794         #include <sys/types.h>
795         #ifdef HAVE_SYS_PARAM_H
796         # include <sys/param.h>
797         #endif
798         #include <sys/statfs.h>
799         ],[
800                 struct statfs stfs;
801         ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
802         )
803     )
804     if test "$wine_cv_sys_statfs_has_statfs" = "yes"
805     then
806       AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
807     fi
810 if test "$ac_cv_header_sys_mount_h" = "yes"
811 then
812     AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
813                     wine_cv_sys_mount_has_statfs,
814         AC_TRY_COMPILE([
815         #include <sys/types.h>
816         #ifdef HAVE_SYS_PARAM_H
817         # include <sys/param.h>
818         #endif
819         #include <sys/mount.h>
820         ],[
821                 struct statfs stfs;
822         ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
823         )
824     )
825     if test "$wine_cv_sys_mount_has_statfs" = "yes"
826     then
827       AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
828     fi
831 dnl **** FIXME: what about mixed cases, where we need two of them? ***
833 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
834   [ if test "x$statfs_bfree" = "xno"
835     then
836         wine_cv_statfs_bfree=no
837     else
838         AC_TRY_COMPILE([
839         #include <sys/types.h>
840         #ifdef HAVE_SYS_PARAM_H
841         # include <sys/param.h>
842         #endif
843         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
844         # include <sys/mount.h>
845         #else
846         # ifdef STATFS_DEFINED_BY_SYS_VFS
847         #  include <sys/vfs.h>
848         # else
849         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
850         #   include <sys/statfs.h>
851         #  endif
852         # endif
853         #endif
854         ],[
855                 struct statfs stfs;
857                 stfs.f_bfree++;
858         ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
859         )
860     fi ] )
861 if test "$wine_cv_statfs_bfree" = "yes"
862 then
863   AC_DEFINE(STATFS_HAS_BFREE)
866 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
867   [ if test "x$statfs_bavail" = "xno"
868     then
869         wine_cv_statfs_bavail=no
870     else
871         AC_TRY_COMPILE([
872         #include <sys/types.h>
873         #ifdef HAVE_SYS_PARAM_H
874         # include <sys/param.h>
875         #endif
876         #ifdef STATFS_DEFINED_BY_SYS_MOUNT
877         # include <sys/mount.h>
878         #else
879         # ifdef STATFS_DEFINED_BY_SYS_VFS
880         #  include <sys/vfs.h>
881         # else
882         #  ifdef STATFS_DEFINED_BY_SYS_STATFS
883         #   include <sys/statfs.h>
884         #  endif
885         # endif
886         #endif
887         ],[
888                 struct statfs stfs;
890                 stfs.f_bavail++;
891         ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
892         )
893     fi ] )
894 if test "$wine_cv_statfs_bavail" = "yes"
895 then
896   AC_DEFINE(STATFS_HAS_BAVAIL)
899 dnl *** check for file descriptor passing with msg_accrights
901 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
902  AC_TRY_COMPILE([#include <sys/types.h>
903 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
904                 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
905 if test "$ac_cv_c_msg_accrights" = "yes"
906 then
907     AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
910 dnl *** Check for the sun_len member in struct sockaddr_un
912 AC_CACHE_CHECK("for sun_len in struct sockaddr_un", ac_cv_c_sun_len,
913  AC_TRY_COMPILE([#include <sys/types.h>
914 #include <sys/socket.h>
915 #include <sys/un.h>], [static struct sockaddr_un addr; addr.sun_len = 1],
916                 ac_cv_c_sun_len="yes", ac_cv_c_sun_len="no"))
917 if test "$ac_cv_c_sun_len" = "yes"
918 then
919     AC_DEFINE(HAVE_SOCKADDR_SUN_LEN)
922 dnl *** check for the need to define __i386__
924 AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
925  AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
927 #endif],
928  ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
929 if test "$ac_cv_cpp_def_i386" = "yes"
930 then
931     CFLAGS="$CFLAGS -D__i386__"
932     LINTFLAGS="$LINTFLAGS -D__i386__"
935 dnl $GCC is set by autoconf
936 GCC_NO_BUILTIN=""
937 if test "$GCC" = "yes"
938 then
939     GCC_NO_BUILTIN="-fno-builtin"
941 AC_SUBST(GCC_NO_BUILTIN)
943 dnl **** Generate output files ****
945 AC_OUTPUT_COMMANDS([
946 extra_subdirs="\
947 dlls/ddraw/d3ddevice \
948 dlls/ddraw/dclipper \
949 dlls/ddraw/ddraw \
950 dlls/ddraw/direct3d \
951 dlls/ddraw/dpalette \
952 dlls/ddraw/dsurface \
954 for i in $extra_subdirs; do [ -d $i ] || (echo "creating $i" && mkdir $i); done ])
956 MAKE_RULES=Make.rules
957 AC_SUBST_FILE(MAKE_RULES)
959 MAKE_DLL_RULES=dlls/Makedll.rules
960 AC_SUBST_FILE(MAKE_DLL_RULES)
962 AC_OUTPUT([
963 Make.rules
964 Makefile
965 console/Makefile
966 controls/Makefile
967 debugger/Makefile
968 dlls/Makedll.rules
969 dlls/Makefile
970 dlls/advapi32/Makefile
971 dlls/avifil32/Makefile
972 dlls/comctl32/Makefile
973 dlls/commdlg/Makefile
974 dlls/crtdll/Makefile
975 dlls/dciman32/Makefile
976 dlls/ddraw/Makefile
977 dlls/dinput/Makefile
978 dlls/dplay/Makefile
979 dlls/dplayx/Makefile
980 dlls/dsound/Makefile
981 dlls/gdi/Makefile
982 dlls/icmp/Makefile
983 dlls/imagehlp/Makefile
984 dlls/imm32/Makefile
985 dlls/kernel/Makefile
986 dlls/lzexpand/Makefile
987 dlls/mpr/Makefile
988 dlls/msacm/Makefile
989 dlls/msacm32/Makefile
990 dlls/msnet32/Makefile
991 dlls/msvideo/Makefile
992 dlls/ntdll/Makefile
993 dlls/odbc32/Makefile
994 dlls/ole32/Makefile
995 dlls/oleaut32/Makefile
996 dlls/olecli/Makefile
997 dlls/oledlg/Makefile
998 dlls/olepro32/Makefile
999 dlls/olesvr/Makefile
1000 dlls/opengl32/Makefile
1001 dlls/psapi/Makefile
1002 dlls/rasapi32/Makefile
1003 dlls/richedit/Makefile
1004 dlls/rpcrt4/Makefile
1005 dlls/serialui/Makefile
1006 dlls/setupapi/Makefile
1007 dlls/setupx/Makefile
1008 dlls/shell32/Makefile
1009 dlls/shfolder/Makefile
1010 dlls/shlwapi/Makefile
1011 dlls/sound/Makefile
1012 dlls/stress/Makefile
1013 dlls/tapi32/Makefile
1014 dlls/ttydrv/Makefile
1015 dlls/ttydrv/Makefile
1016 dlls/urlmon/Makefile
1017 dlls/user/Makefile
1018 dlls/version/Makefile
1019 dlls/win32s/Makefile
1020 dlls/win87em/Makefile
1021 dlls/winaspi/Makefile
1022 dlls/windebug/Makefile
1023 dlls/wineps/Makefile
1024 dlls/wing/Makefile
1025 dlls/wininet/Makefile
1026 dlls/winmm/Makefile
1027 dlls/winmm/joystick/Makefile
1028 dlls/winmm/mcianim/Makefile
1029 dlls/winmm/mciavi/Makefile
1030 dlls/winmm/mcicda/Makefile
1031 dlls/winmm/mciseq/Makefile
1032 dlls/winmm/mciwave/Makefile
1033 dlls/winmm/midimap/Makefile
1034 dlls/winmm/wavemap/Makefile
1035 dlls/winmm/wineoss/Makefile
1036 dlls/winsock/Makefile
1037 dlls/winspool/Makefile
1038 dlls/wow32/Makefile
1039 dlls/wsock32/Makefile
1040 dlls/x11drv/Makefile
1041 documentation/Makefile
1042 documentation/wine.conf.man
1043 documentation/wine.man
1044 files/Makefile
1045 graphics/Makefile
1046 graphics/enhmetafiledrv/Makefile
1047 graphics/metafiledrv/Makefile
1048 graphics/ttydrv/Makefile
1049 graphics/win16drv/Makefile
1050 graphics/x11drv/Makefile
1051 if1632/Makefile
1052 include/Makefile
1053 library/Makefile
1054 libtest/Makefile
1055 loader/Makefile
1056 loader/ne/Makefile
1057 loader/dos/Makefile
1058 memory/Makefile
1059 misc/Makefile
1060 miscemu/Makefile
1061 msdos/Makefile
1062 objects/Makefile
1063 ole/Makefile
1064 programs/Makefile
1065 programs/clock/Makefile
1066 programs/cmdlgtst/Makefile
1067 programs/control/Makefile
1068 programs/avitools/Makefile
1069 programs/osversioncheck/Makefile
1070 programs/notepad/Makefile
1071 programs/progman/Makefile
1072 programs/regtest/Makefile
1073 programs/regapi/Makefile
1074 programs/view/Makefile
1075 programs/wcmd/Makefile
1076 programs/winemine/Makefile
1077 programs/winhelp/Makefile
1078 programs/winver/Makefile
1079 relay32/Makefile
1080 resources/Makefile
1081 scheduler/Makefile
1082 server/Makefile
1083 tools/Makefile
1084 tools/cvdump/Makefile
1085 tools/winebuild/Makefile
1086 tools/wrc/Makefile
1087 tools/wmc/Makefile
1088 tsx11/Makefile
1089 unicode/Makefile
1090 win32/Makefile
1091 windows/Makefile
1092 windows/ttydrv/Makefile
1093 windows/x11drv/Makefile ])
1095 if test "$have_x" = "no"
1096 then
1097   echo
1098   echo "*** Warning: X development files not found. Wine will be built without"
1099   echo "*** X support, which currently does not work, and would probably not be"
1100   echo "*** what you want anyway. You will need to install devel packages of"
1101   echo "*** Xlib/Xfree86 and Xpm at the very least."
1102 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
1103 then
1104   echo
1105   echo "*** Warning: Xpm development files not found. Wine will be built without"
1106   echo "*** Xpm support, which currently does not work. You will need to install"
1107   echo "*** devel packages of Xpm."
1110 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
1111 then
1112   echo
1113   echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
1114   echo "*** terminal resize support. Consider upgrading ncurses."
1117 if test "$wine_cv_libc_reentrant" = "no" 
1118 then
1119   echo
1120   echo "*** Warning: non-reentrant libc detected. Wine will be build without"
1121   echo "*** thread support. Consider upgrading libc to a more recent"
1122   echo "*** reentrant version of libc."
1125 if test "$wine_cv_opengl_version_OK" = "no"
1126 then
1127   echo
1128   echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1129   echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1132 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "normal"
1133 then
1134   echo
1135   echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
1136   echo "*** thread-safety. To prevent crashes, OpenGL support has been removed."
1137   echo "*** A fix for glibc 2.1.3 that seem to work is included in this version of Wine,"
1138   echo "*** start configure with '--enable-opengl' to force OpenGL support."
1141 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "yes"
1142 then
1143   echo
1144   echo "*** Warning: you explicitely linked in a thread-safe OpenGL version. If you"
1145   echo "*** experience unusual crashes on DirectDraw games, try first to disable OpenGL"
1146   echo "*** support before reporting bugs."
1150 echo
1151 echo "Configure finished.  Do 'make depend && make' to compile Wine."
1152 echo
1154 dnl Local Variables:
1155 dnl comment-start: "dnl "
1156 dnl comment-end: ""
1157 dnl comment-start-skip: "\\bdnl\\b\\s *"
1158 dnl compile-command: "autoconf"
1159 dnl End: