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