Altered WM_MOUSEHOVER so the lParam and wParam fields are set
[wine/multimedia.git] / configure.ac
blobaef636f8e04d878a34f81b009f2daecb4a3772d3
1 dnl Process this file with autoconf to produce a configure script.
2 dnl Original author: Michael Patra
3 dnl See ChangeLog file for detailed change history.
5 m4_define(WINE_VERSION,regexp(m4_include(VERSION),[version \([-.0-9A-Za-z]+\)],[\1]))
7 AC_PREREQ(2.53)
8 AC_INIT([Wine],WINE_VERSION)
9 AC_CONFIG_SRCDIR(server/atom.c)
10 AC_CONFIG_HEADERS(include/config.h)
11 AC_CONFIG_AUX_DIR(tools)
13 dnl **** Command-line arguments ****
15 dnl Library type .so or .a
16 AC_SUBST(LIBEXT,"so")
18 AC_ARG_ENABLE(win16, AC_HELP_STRING([--disable-win16],[do not include Win16 support]))
19 AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug],[compile out all debugging messages]))
20 AC_ARG_ENABLE(trace, AC_HELP_STRING([--disable-trace],[compile out TRACE messages]))
22 AC_ARG_WITH(opengl,    AC_HELP_STRING([--without-opengl],[do not use OpenGL]))
23 AC_ARG_WITH(curses,    AC_HELP_STRING([--without-curses],[do not use curses]))
24 AC_ARG_WITH(wine-tools,AC_HELP_STRING([--with-wine-tools=<dir>],[use Wine tools from directory <dir>]))
26 AC_SUBST(OPTIONS)
27 AC_SUBST(WIN16_FILES,"\$(WIN16_FILES)")
28 AC_SUBST(WIN16_INSTALL,"\$(WIN16_INSTALL)")
29 if test "x$enable_win16" = "xno"
30 then
31   WIN16_FILES=""
32   WIN16_INSTALL=""
34 if test "x$enable_debug" = "xno"
35 then
36     AC_DEFINE(NO_DEBUG_MSGS,1,[Define to disable all debug messages.])
38 if test "x$enable_trace" = "xno" -o "x$enable_debug" = "xno"
39 then
40     AC_DEFINE(NO_TRACE_MSGS,1,[Define to disable trace messages.])
43 dnl **** Check for some programs ****
45 AC_CANONICAL_HOST
46 AC_PROG_MAKE_SET
47 AC_PROG_CC
48 AC_PROG_CPP
50 AC_CACHE_CHECK([for the directory containing the Wine tools], wine_cv_toolsdir,
51   [if test -z "$with_wine_tools"; then
52      if test "$cross_compiling" = "yes"; then
53        AC_MSG_ERROR([you must use the --with-wine-tools option when cross-compiling.])
54      else
55        wine_cv_toolsdir="\$(TOPOBJDIR)"
56      fi
57    elif test -d "$with_wine_tools/tools/winebuild"; then
58      case $with_wine_tools in
59        /*) wine_cv_toolsdir="$with_wine_tools" ;;
60        *)  wine_cv_toolsdir="\$(TOPOBJDIR)/$with_wine_tools" ;;
61      esac
62    else
63      AC_MSG_ERROR([could not find Wine tools in $with_wine_tools.])
64    fi])
65 AC_SUBST(TOOLSDIR,$wine_cv_toolsdir)
67 AC_PATH_XTRA
68 AC_PROG_YACC
69 AC_PROG_LEX
71 dnl **** Just additional warning checks, since AC_PROG just sets 'yacc' even
72 dnl **** without one present.
73 AC_CHECK_PROGS(XYACC,$YACC bison yacc,none)
74 if test "$XYACC" = "none"
75 then
76   AC_MSG_ERROR([no suitable bison/yacc found. Please install the 'bison' package.])
78 AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
79 if test "$XLEX" = "none"
80 then
81   AC_MSG_ERROR([no suitable lex found. Please install the 'flex' package.])
84 AC_CHECK_TOOL(LD,ld,ld)
85 AC_CHECK_TOOL(AR,ar,ar)
86 AC_PROG_RANLIB
87 AC_CHECK_TOOL(STRIP,strip,strip)
88 AC_CHECK_TOOL(WINDRES,windres,false)
89 AC_PROG_INSTALL
90 AC_PROG_LN_S
91 WINE_PROG_LN
92 AC_CHECK_PROG(C2MAN,c2man,c2man,\$(TOPSRCDIR)/tools/c2man.pl)
93 AC_PATH_PROG(LDCONFIG, ldconfig, true, [/sbin /usr/sbin $PATH])
95 dnl Check for lint
96 AC_CHECK_PROGS(LINT, lclint lint)
97 if test "$LINT" = "lint"
98 then
99   LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
100   dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
102 AC_SUBST(LINT)
103 AC_SUBST(LINTFLAGS)
105 dnl **** Check for some libraries ****
107 dnl Check for -lm
108 AC_CHECK_LIB(m,sqrt)
109 dnl Check for -li386 for NetBSD and OpenBSD
110 AC_CHECK_LIB(i386,i386_set_ldt)
111 dnl Check for -lossaudio for NetBSD
112 AC_CHECK_LIB(ossaudio,_oss_ioctl)
113 dnl Check for -lw for Solaris
114 AC_CHECK_FUNCS(iswalnum,,AC_CHECK_LIB(w,iswalnum))
115 dnl Check for -lnsl for Solaris
116 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
117 dnl Check for -lsocket for Solaris
118 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
119 dnl Check for -lresolv for Solaris
120 AC_CHECK_FUNCS(inet_aton,,AC_CHECK_LIB(resolv,inet_aton))
121 dnl Check for -lxpg4 for FreeBSD
122 AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
123 dnl Check for -lmmap for OS/2
124 AC_CHECK_LIB(mmap,mmap)
126 JPEGLIB=""
127 AC_SUBST(JPEGLIB)
128 AC_CHECK_HEADERS(jpeglib.h,
129     AC_CHECK_LIB(jpeg,jpeg_start_decompress,
130         AC_DEFINE(HAVE_LIBJPEG,1,[Define if you have libjpeg including devel headers])
131         JPEGLIB="-ljpeg"
132     )
136 AC_SUBST(XLIB)
137 AC_SUBST(XFILES)
138 XFILES=""
139 AC_SUBST(OPENGLFILES)
140 OPENGLFILES=""
141 AC_SUBST(GLU32FILES)
142 GLU32FILES=""
143 AC_SUBST(OPENGL_LIBS)
144 OPENGL_LIBS=""
145 if test "$have_x" = "yes"
146 then
147     XLIB="-lXext -lX11"
148     ac_save_CPPFLAGS="$CPPFLAGS"
149     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
151     dnl *** All of the following tests require X11/Xlib.h
152     AC_CHECK_HEADERS(X11/Xlib.h,
153       [
154         dnl *** Check for X keyboard extension
155         AC_CHECK_HEADERS(X11/XKBlib.h,
156             [ dnl *** If X11/XKBlib.h exists...
157               AC_CHECK_LIB(X11, XkbQueryExtension,
158               AC_DEFINE(HAVE_XKB, 1, [Define if you have the XKB extension]),,
159               $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
160             ],
161             AC_MSG_WARN([[Xkb extension not found, Wine will be built without it]]),
162             [#include <X11/Xlib.h>])
164         dnl *** Check for X Shm extension
165         AC_CHECK_HEADERS(X11/extensions/XShm.h,
166             [ dnl *** If X11/extensions/XShm.h exists...
167               AC_CHECK_LIB(Xext, XShmQueryExtension,
168               AC_DEFINE(HAVE_LIBXXSHM, 1, [Define if you have the X Shm extension]),,
169               $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
170             ],
171             AC_MSG_WARN([[XShm extension not found, Wine will be built without it]]),
172             [#include <X11/Xlib.h>])
174         dnl *** Check for Xutil
175         AC_CHECK_HEADERS(X11/Xutil.h,,,
176             [#include <X11/Xlib.h>])
178         dnl *** Check for X shape extension
179         AC_CHECK_HEADERS(X11/extensions/shape.h,
180             [ dnl *** If X11/extensions/shape.h exists...
181               AC_CHECK_LIB(Xext,XShapeQueryExtension,
182               AC_DEFINE(HAVE_LIBXSHAPE, 1, [Define if you have the X Shape extension]),,
183               $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
184             ],
185             AC_MSG_WARN([[XShape extension not found, Wine will be built without it]]),
186             [#include <X11/Xlib.h>
187              #ifdef HAVE_X11_XUTIL_H
188              # include <X11/Xutil.h>
189              #endif])
191         dnl *** Check for XFree86 DGA / DGA 2.0 extension
192         AC_CHECK_HEADERS(X11/extensions/xf86dga.h,
193             [ dnl *** If X11/extensions/xf86dga.h exists, check
194               dnl *** for XDGAQueryExtension()...
195               AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
196                 [ dnl *** If found...
197                   AC_DEFINE(HAVE_LIBXXF86DGA2, 1,
198                             [Define if you have the Xxf86dga library version 2])
199                   X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
200                ],
201                 [ dnl *** If not found, look for XF86DGAQueryExtension()
202                   dnl *** instead (DGA 2.0 not found)...
203                   AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
204                     [ AC_DEFINE(HAVE_LIBXXF86DGA, 1,
205                                 [Define if you have the Xxf86dga library version 1])
206                       X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
207                     ],,
208                     $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
209                   )
210                 ],
211                 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
212               )
213             ],
214             AC_MSG_WARN([[DGA extension not found, Wine will be built without it]]),
215             [#include <X11/Xlib.h>])
217         dnl *** Check for XFree86 VMODE extension
218         AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
219             [ dnl *** If X11/extensions/xf86vmode.h exists...
220                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
221                   [ AC_DEFINE(HAVE_LIBXXF86VM, 1, [Define if you have the Xxf86vm library])
222                      X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
223                   ],,
224                   $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
225                 )
226             ],
227             AC_MSG_WARN([[XFree86 VMODE extension not found, Wine will be built without it]]),
228             [#include <X11/Xlib.h>])
230         dnl *** Check for XVideo extension supporting XvImages
231         AC_CHECK_HEADERS(X11/extensions/Xvlib.h,
232             [ dnl *** If X11/extensions/Xvlib.h exists...
233                 AC_CHECK_LIB(Xv, XvShmCreateImage,
234                   [ AC_DEFINE(HAVE_XVIDEO, 1, [Define if the X libraries support XVideo])
235                      X_PRE_LIBS="$X_PRE_LIBS -lXv"
236                   ],,
237                   $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
238                 )
239             ],
240             AC_MSG_WARN([[XVideo extension not found, Wine will be built without it]]),
241             [#include <X11/Xlib.h>])
243         dnl *** Check for XRender include file
244         AC_CHECK_HEADERS(X11/extensions/Xrender.h,,,[#include <X11/Xlib.h>])
245       ]
246     ) dnl *** End of X11/Xlib.h check
248     dnl Check for the presence of OpenGL
249     if test "x$with_opengl" != "xno"
250     then
251         if test -f /usr/X11R6/lib/libGL.a -a ! -f /usr/X11R6/lib/libGL.so
252         then
253             AC_MSG_ERROR([/usr/X11R6/lib/libGL.a is present on your system.
254 This prevents linking to OpenGL. Delete the file and restart configure.])
255         fi
257         AC_CHECK_HEADERS(GL/gl.h GL/glx.h)
258         if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
259         then
260             AC_CHECK_HEADERS(GL/glext.h,,,[#include <GL/glx.h>])
261             dnl Check for some problems due to old Mesa versions
262             AC_CACHE_CHECK([for up-to-date OpenGL version], wine_cv_opengl_version_OK,
263               AC_TRY_COMPILE(
264                 [#include <GL/gl.h>],
265                 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
266                 [wine_cv_opengl_version_OK="yes"],
267                 [wine_cv_opengl_version_OK="no"]
268               )
269             )
271             if test "$wine_cv_opengl_version_OK" = "yes"
272             then
273                 dnl Check for the presence of the library
274                 AC_CHECK_LIB(GL,glXCreateContext,
275                              OPENGL_LIBS="-lGL"
276                              ,,
277                              $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
279                 if test "$ac_cv_lib_GL_glXCreateContext" = "yes"
280                 then
281                         OPENGLFILES='$(OPENGLFILES)'
282                         AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is present on the system])
284                         AC_CHECK_LIB(GL,glXGetProcAddressARB,
285                                      AC_DEFINE(HAVE_GLX_GETPROCADDRESS, 1,
286                                                [Define if the OpenGL library supports the glXGetProcAddressARB call]),,
287                                      $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
289                         if test "$ac_cv_lib_GL_glXGetProcAddressARB" = "yes"
290                         then
291                                AC_CACHE_CHECK([for OpenGL extension functions prototypes], wine_cv_extension_prototypes,
292                                   [AC_TRY_COMPILE([#include <GL/gl.h>
293                                                   #ifdef HAVE_GL_GLEXT_H
294                                                   # include <GL/glext.h>
295                                                   #endif
296                                                   ],
297                                                  [PFNGLCOLORTABLEEXTPROC test_proc;],
298                                                  [wine_cv_extension_prototypes="yes"],
299                                                  [wine_cv_extension_prototypes="no"]
300                                   )]
301                                 )
302                                 if test "$wine_cv_extension_prototypes" = "yes"
303                                 then
304                                     AC_DEFINE(HAVE_GLEXT_PROTOTYPES, 1,
305                                               [Define if the OpenGL headers define extension typedefs])
306                                 fi
307                         fi
309                 fi
310                 dnl Check for GLU32 library.
311                 AC_CHECK_LIB(GLU,gluLookAt,
312                              [OPENGL_LIBS="$OPENGL_LIBS -lGLU"
313                              GLU32FILES='$(GLU32FILES)']
314                              ,,
315                              $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
316                 )
317              fi
318          fi
319     fi
321     dnl **** Check for NAS ****
322     AC_SUBST(NASLIBS,"")
323     AC_CHECK_HEADERS(audio/audiolib.h,
324          [AC_CHECK_HEADERS(audio/soundlib.h,,,[#include <audio/audiolib.h>])
325           AC_CHECK_LIB(audio,AuCreateFlow,
326                        [AC_DEFINE(HAVE_NAS,1,[Define if you have NAS including devel headers])
327                         NASLIBS="-laudio -lXt $X_LIBS -lXext -lX11 $X_EXTRA_LIBS"],,
328                        [-lXt $X_LIBS -lXext -lX11 $X_EXTRA_LIBS])])
330     CPPFLAGS="$ac_save_CPPFLAGS"
331     XFILES='$(XFILES)'
332 else
333     XLIB=""
334     X_CFLAGS=""
335     X_LIBS=""
338 dnl **** Check which curses lib to use ***
339 CURSESLIBS=""
340 if test "x$with_curses" != "xno"
341 then
342     AC_CHECK_HEADERS(ncurses.h,
343         [AC_CHECK_LIB(ncurses,waddch,
344             [AC_DEFINE(HAVE_LIBNCURSES, 1, [Define if you have the ncurses library (-lncurses)])
345              CURSESLIBS="-lncurses"],
346              [AC_CHECK_HEADERS(curses.h,
347                  [AC_CHECK_LIB(curses,waddch,
348                      [AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have the curses library (-lcurses)])
349                       CURSESLIBS="-lcurses"])])])])
350     saved_libs="$LIBS"
351     LIBS="$CURSESLIBS $LIBS"
352     AC_CHECK_FUNCS(getbkgd resizeterm)
353     LIBS="$saved_libs"
355 AC_SUBST(CURSESLIBS)
357 dnl **** Check for SANE ****
358 AC_CHECK_PROG(sane_devel,sane-config,sane-config,no)
359 if test "$sane_devel" = "no"
360 then
361     SANELIBS=""
362     SANEINCL=""
363 else
364     SANELIBS="`$sane_devel --libs`"
365     SANEINCL="`$sane_devel --cflags`"
366     ac_save_CPPFLAGS="$CPPFLAGS"
367     ac_save_LIBS="$LIBS"
368     CPPFLAGS="$CPPFLAGS $SANEINCL"
369     LIBS="$LIBS $SANELIBS"
370     AC_CHECK_HEADER(sane/sane.h,
371                     [AC_CHECK_LIB(sane,sane_open,
372                                   [AC_DEFINE(HAVE_SANE, 1, [Define if we have SANE development environment])],
373                                   [SANELIBS=""
374                                   SANEINCL=""])],
375                     [SANELIBS=""
376                     SANEINCL=""])
377     LIBS="$ac_save_LIBS"
378     CPPFLAGS="$ac_save_CPPFLAGS"
380 AC_SUBST(SANELIBS)
381 AC_SUBST(SANEINCL)
383 dnl **** Check for FreeType 2 ****
384 AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$X_LIBS)
385 if test "$ft_lib" = "no"
386 then
387     FREETYPEINCL=""
388     wine_cv_msg_freetype=no
389 else
390     AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
391     if test "$ft_devel" = "no"
392     then
393         AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
394         if test "$ft_devel2" = "freetype2-config"
395         then
396                 ft_devel=$ft_devel2
397         fi
398     fi
399     if test "$ft_devel" = "no"
400     then
401         FREETYPEINCL=""
402         wine_cv_msg_freetype=yes
403     else
404         FREETYPEINCL=`$ft_devel --cflags`
405         ac_save_CPPFLAGS="$CPPFLAGS"
406         CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
407         AC_CHECK_HEADERS(freetype/freetype.h \
408                          freetype/ftglyph.h \
409                          freetype/tttables.h \
410                          freetype/ftnames.h \
411                          freetype/ftsnames.h \
412                          freetype/ttnameid.h \
413                          freetype/ftoutln.h \
414                          freetype/internal/sfnt.h)
415         AC_TRY_CPP([#include <ft2build.h>
416                     #include <freetype/fttrigon.h>],
417                     [AC_DEFINE(HAVE_FREETYPE_FTTRIGON_H, 1,
418           [Define if you have the <freetype/fttrigon.h> header file.])
419                     wine_cv_fttrigon=yes],
420                     wine_cv_fttrigon=no)
421         CPPFLAGS="$ac_save_CPPFLAGS"
422         dnl Check that we have at least freetype/freetype.h
423         if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
424         then
425             AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
426             wine_cv_msg_freetype=no
427         else
428             FREETYPEINCL=""
429             wine_cv_msg_freetype=yes
430         fi
431     fi
433 AC_SUBST(FREETYPEINCL)
435 dnl **** Check for parport (currently Linux only) ****
436 AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
437  AC_TRY_COMPILE(
438    [#include <linux/ppdev.h>],
439    [ioctl (1,PPCLAIM,0)],
440    [ac_cv_c_ppdev="yes"],
441    [ac_cv_c_ppdev="no"])
443 if test "$ac_cv_c_ppdev" = "yes"
444 then
445     AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev.h for parallel port access])
448 dnl **** Check for va_copy ****
449 AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy,
450  AC_TRY_LINK(
451    [#include <stdarg.h>],
452    [va_list ap1, ap2;
453     va_copy(ap1,ap2);
454    ],
455    [ac_cv_c_va_copy="yes"],
456    [ac_cv_c_va_copy="no"])
458 if test "$ac_cv_c_va_copy" = "yes"
459 then
460     AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
462 AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy,
463  AC_TRY_LINK(
464    [#include <stdarg.h>],
465    [va_list ap1, ap2;
466     __va_copy(ap1,ap2);
467    ],
468    [ac_cv_c___va_copy="yes"],
469    [ac_cv_c___va_copy="no"])
471 if test "$ac_cv_c___va_copy" = "yes"
472 then
473     AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
476 dnl **** Check for IPX (currently Linux only) ****
477 AC_CACHE_CHECK([for GNU style IPX support], ac_cv_c_ipx_gnu,
478  AC_TRY_COMPILE(
479    [#include <sys/types.h>
480     #ifdef HAVE_SYS_SOCKET_H
481     # include <sys/socket.h>
482     #endif
483     #include <netipx/ipx.h>],
484    [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
485    [ac_cv_c_ipx_gnu="yes"],
486    [ac_cv_c_ipx_gnu="no"])
488 if test "$ac_cv_c_ipx_gnu" = "yes"
489 then
490     AC_DEFINE(HAVE_IPX_GNU, 1, [Define if IPX should use netipx/ipx.h from libc])
493 if test "$ac_cv_c_ipx_gnu" = "no"
494 then
495  AC_CACHE_CHECK([for linux style IPX support], ac_cv_c_ipx_linux,
496   AC_TRY_COMPILE(
497     [#include <sys/types.h>
498      #ifdef HAVE_SYS_SOCKET_H
499      # include <sys/socket.h>
500      #endif
501      #include <asm/types.h>
502      #include <linux/ipx.h>],
503     [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
504     [ac_cv_c_ipx_linux="yes"],
505     [ac_cv_c_ipx_linux="no"])
506   )
507   if test "$ac_cv_c_ipx_linux" = "yes"
508   then
509       AC_DEFINE(HAVE_IPX_LINUX, 1, [Define if IPX includes are taken from Linux kernel])
510   fi
513 dnl **** Check for Open Sound System ****
514 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
516 AC_CACHE_CHECK([for Open Sound System],
517         ac_cv_c_opensoundsystem,
518         AC_TRY_COMPILE([
519         #if defined(HAVE_SYS_SOUNDCARD_H)
520                 #include <sys/soundcard.h>
521         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
522                 #include <machine/soundcard.h>
523         #elif defined(HAVE_SOUNDCARD_H)
524                 #include <soundcard.h>
525         #endif
526         ],[
528 /* check for one of the Open Sound System specific SNDCTL_ defines */
529 #if !defined(SNDCTL_DSP_STEREO)
530 #error No open sound system
531 #endif
532 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
534 if test "$ac_cv_c_opensoundsystem" = "yes"
535 then
536     AC_DEFINE(HAVE_OSS, 1, [Define if you have the Open Sound system])
539 AC_CACHE_CHECK([for Open Sound System/MIDI interface],
540         ac_cv_c_opensoundsystem_midi,
541         AC_TRY_COMPILE([
542         #if defined(HAVE_SYS_SOUNDCARD_H)
543                 #include <sys/soundcard.h>
544         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
545                 #include <machine/soundcard.h>
546         #elif defined(HAVE_SOUNDCARD_H)
547                 #include <soundcard.h>
548         #endif
549         ],[
551 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
552 #if !defined(SNDCTL_SEQ_SYNC)
553 #error No open sound system MIDI interface
554 #endif
555 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
557 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
558 then
559     AC_DEFINE(HAVE_OSS_MIDI, 1, [Define if you have the Open Sound system (MIDI interface)])
562 dnl **** Check for aRts Sound Server ****
563 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
564 AC_CACHE_CHECK([for aRts Sound server],
565         ac_cv_c_artsserver,
566         if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"';
567         then
568             ac_cv_c_artsserver=no
569         else
570             ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
571             ARTSC_LIBS=`$ARTSCCONFIG --libs`
572             ac_cv_c_artsserver=no
573             save_CFLAGS="$CFLAGS"
574             CFLAGS="$CFLAGS $ARTSC_CFLAGS"
575             AC_TRY_COMPILE([
576              #include <artsc.h>
577             ],[
578              arts_stream_t stream;
579             ],[
580             ac_cv_c_artsserver=yes
581             ])
582             CFLAGS="$save_CFLAGS"
583         fi)
585 if test "$ac_cv_c_artsserver" = "yes"
586 then
587     AC_SUBST(ARTSLIBS, $ARTSC_LIBS)
588     AC_SUBST(ARTSINCL, $ARTSC_CFLAGS)
590     AC_DEFINE(HAVE_ARTS, 1, [Define if you have ARTS sound server])
593 dnl **** Check for ALSA ****
594 AC_SUBST(ALSALIBS,"")
595 AC_CHECK_HEADERS(alsa/asoundlib.h sys/asoundlib.h, break)
596 if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes"
597 then
598     AC_CHECK_LIB(asound,snd_pcm_open,
599         AC_DEFINE(HAVE_ALSA,1,[Define if you have ALSA including devel headers])
600         ALSALIBS="-lasound")
603 dnl **** Check for libaudioio (which can be used to get solaris audio support) ****
605 AC_SUBST(AUDIOIOLIBS,"")
606 AC_CHECK_HEADERS(libaudioio.h,
607     [AC_CHECK_LIB(audioio,AudioIOGetVersion,
608                   [AUDIOIOLIBS="-laudioio"
609                    AC_DEFINE(HAVE_LIBAUDIOIO, 1, [Define if you have libaudioIO])])])
611 dnl **** Check for broken glibc mmap64 ****
613 AC_CACHE_CHECK( [whether mmap64 works defined as mmap], ac_cv_mmap64_works,
614         AC_TRY_RUN([
615                 #define _FILE_OFFSET_BITS 64
616                 #include <stdio.h>
617                 #include <unistd.h>
618                 #include <fcntl.h>
619                 #include <sys/mman.h>
620                 #include <errno.h>
622                 int main(int argc,char **argv) {
623                         int fd = open("conftest.map",O_CREAT|O_RDWR,0600);
624                         if (fd == -1) exit(1);
626                         unlink("conftest.map");
628                         write(fd,"test",4);
630                         if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) &&
631                             (errno == EINVAL)
632                         ) {
633                                 exit(1);
634                         }
635                         close(fd);
636                         fprintf(stderr,"success!\n");
637                         exit(0);
638                 }
640         ],
641     ac_cv_mmap64_works="yes",
642     ac_cv_mmap64_works="no",
643     ac_cv_mmap64_works="no") )
645 if test "$ac_cv_mmap64_works" = "yes"
646 then
647     AC_DEFINE(_FILE_OFFSET_BITS, 64, [Set this to 64 to enable 64-bit file support on Linux])
650 dnl **** Check for gcc strength-reduce bug ****
652 if test "x${GCC}" = "xyes"
653 then
654   CFLAGS="$CFLAGS -Wall"
655   AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug,
656                   AC_TRY_RUN([
657 int     L[[4]] = {0,1,2,3};
658 int main(void) {
659   static int Array[[3]];
660   unsigned int B = 3;
661   int i;
662   for(i=0; i<B; i++) Array[[i]] = i - 3;
663   for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
664   L[[i]] = 4;
666   exit( Array[[1]] != -2 || L[[2]] != 3);
668     ac_cv_c_gcc_strength_bug="no",
669     ac_cv_c_gcc_strength_bug="yes",
670     ac_cv_c_gcc_strength_bug="yes") )
671   if test "$ac_cv_c_gcc_strength_bug" = "yes"
672   then
673     CFLAGS="$CFLAGS -fno-strength-reduce"
674   fi
676   dnl Check for -mpreferred-stack-boundary
677   AC_CACHE_CHECK([for gcc -mpreferred-stack-boundary=2 support], ac_cv_c_gcc_stack_boundary,
678       [WINE_TRY_CFLAGS([-mpreferred-stack-boundary=2],
679                       ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")])
680   if test "$ac_cv_c_gcc_stack_boundary" = "yes"
681   then
682     CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
683   fi
686 dnl **** Check how to define a function in assembly code ****
688 AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,
689   WINE_TRY_ASM_LINK(
690       ["\t.globl _ac_test\n\t.def _ac_test; .scl 2; .type 32; .endef\n_ac_test:\t.long 0"],,,
691       ac_cv_asm_func_def=".def",
692     [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,@function\n_ac_test:\t.long 0"],,,
693       ac_cv_asm_func_def=".type @function",
694     [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,2\n_ac_test:\t.long 0"],,,
695       ac_cv_asm_func_def=".type 2",
696       ac_cv_asm_func_def="unknown")])]))
698 AH_TEMPLATE(__ASM_FUNC,[Define to a macro to generate an assembly function directive])
699 case "$ac_cv_asm_func_def" in
700   ".def")
701      AC_DEFINE([__ASM_FUNC(name)], [".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"]) ;;
702   ".type @function")
703      AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",@function"]) ;;
704   ".type 2")
705      AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",2"]) ;;
706   *)
707      AC_DEFINE([__ASM_FUNC(name)], [""]) ;;
708 esac
710 dnl **** Check for underscore on external symbols ****
712 AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_extern_prefix,
713     WINE_TRY_ASM_LINK([".globl _ac_test\n_ac_test:\t.long 0"],
714                       [extern int ac_test;],
715                       [if (ac_test) return 1],
716                       ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no"))
718 AH_TEMPLATE(__ASM_NAME,[Define to a macro to generate an assembly name from a C symbol])
719 if test "$ac_cv_c_extern_prefix" = "yes"
720 then
721   AC_DEFINE([__ASM_NAME(name)], ["_" name])
722 else
723   AC_DEFINE([__ASM_NAME(name)], [name])
726 dnl **** Check whether stdcall symbols need to be decorated ****
728 AC_CACHE_CHECK([whether stdcall symbols need to be decorated], ac_cv_c_stdcall_decoration,
729     WINE_TRY_ASM_LINK(["\t.globl _ac_test@0\n_ac_test@0:\n\t.globl ac_test@0\nac_test@0:"],
730                       [extern void __attribute__((__stdcall__)) ac_test(void);],
731                       [ac_test()],
732                       ac_cv_c_stdcall_decoration="yes",ac_cv_c_stdcall_decoration="no"))
733 if test "$ac_cv_c_stdcall_decoration" = "yes"
734 then
735   AC_DEFINE(NEED_STDCALL_DECORATION, 1, [Define if stdcall symbols need to be decorated])
738 dnl **** Check for .string in assembler ****
740 AC_CACHE_CHECK([whether assembler accepts .string], ac_cv_c_asm_string,
741     WINE_TRY_ASM_LINK([".data\n\t.string \"test\"\n\t.text"],,,
742                       ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no"))
743 if test "$ac_cv_c_asm_string" = "yes"
744 then
745   AC_DEFINE(HAVE_ASM_STRING, 1, [Define to use .string instead of .ascii])
748 dnl **** Check for working dll ****
750 AC_SUBST(DLLEXT,"")
751 AC_SUBST(DLLFLAGS,"")
752 AC_SUBST(DLLIBS,"")
753 AC_SUBST(LDDLLFLAGS,"")
754 AC_SUBST(LDSHARED,"")
756 case $host_os in
757   cygwin*|mingw32*)
758     AC_CHECK_TOOL(DLLWRAP,dllwrap,false)
759     if test "$DLLWRAP" = "false"; then
760       LIBEXT="a"
761     else
762       dnl FIXME - check whether dllwrap works correctly...
763       LIBEXT="dll"
764     fi
765     ;;
766   *)
767     AC_CHECK_HEADERS(dlfcn.h,
768         [AC_CHECK_FUNCS(dlopen,,
769             [AC_CHECK_LIB(dl,dlopen,
770                          [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
771                           DLLIBS="-ldl"],
772                          [LIBEXT="a"])])],
773         [LIBEXT="a"])
775     if test "$LIBEXT" = "so"
776     then
777       DLLFLAGS="-fPIC"
778       DLLEXT=".so"
779       AC_CACHE_CHECK([whether we can build a GNU style ELF dll], ac_cv_c_dll_gnuelf,
780           [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic],
781                            ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")])
782       if test "$ac_cv_c_dll_gnuelf" = "yes"
783       then
784         LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
785         LDDLLFLAGS="-Wl,-Bsymbolic"
786         AC_CACHE_CHECK([whether the linker accepts -z defs], ac_cv_c_dll_zdefs,
787           [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs],
788                            ac_cv_c_dll_zdefs="yes",ac_cv_c_dll_zdefs="no")])
789         if test "$ac_cv_c_dll_zdefs" = "yes"
790         then
791           LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
792         fi
793       else
794         AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll, ac_cv_c_dll_unixware,
795             [WINE_TRY_CFLAGS([-fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic],
796                              ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")])
797         if test "$ac_cv_c_dll_unixware" = "yes"
798         then
799           LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
800           LDDLLFLAGS="-Wl,-B,symbolic"
801         fi
802       fi
803     fi
805     dnl Check for cross compiler to build test programs
806     AC_SUBST(CROSSTEST,"")
807     if test "$cross_compiling" = "no"
808     then
809       AC_CHECK_PROGS(CROSSCC,i586-mingw32msvc-gcc,false)
810       AC_CHECK_PROGS(DLLTOOL,i586-mingw32msvc-dlltool,false)
811       if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi
812     fi
813     ;;
814 esac
816 if test "$LIBEXT" = "a"; then
817   AC_MSG_ERROR(
818 [could not find a way to build shared libraries.
819 It is currently not possible to build Wine without shared library
820 (.so) support to allow transparent switch between .so and .dll files.
821 If you are using Linux, you will need a newer binutils.]
825 case $build_os in
826   cygwin*|mingw32*)
827     AC_SUBST(LDPATH,"PATH=\"\$(TOOLSDIR)/library:\$(TOOLSDIR)/unicode:\$\$PATH\"") ;;
828   *)
829     AC_SUBST(LDPATH,"LD_LIBRARY_PATH=\"\$(TOOLSDIR)/library:\$(TOOLSDIR)/unicode:\$\$LD_LIBRARY_PATH\"") ;;
830 esac
832 dnl Mingw needs explicit msvcrt for linking libwine
833 AC_SUBST(CRTLIBS,"")
834 case $host_os in
835   mingw32*)
836     CRTLIBS="-lmsvcrt" ;;
837 esac
839 dnl **** Get the soname for libraries that we load dynamically ****
841 if test "$LIBEXT" = "so"
842 then
843   WINE_GET_SONAME(X11,XCreateWindow,[$X_LIBS $X_EXTRA_LIBS])
844   WINE_GET_SONAME(Xext,XextCreateExtension,[$X_LIBS -lX11 $X_EXTRA_LIBS])
845   WINE_GET_SONAME(Xrender,XRenderQueryExtension,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
846   WINE_GET_SONAME(freetype,FT_Init_FreeType,[$X_LIBS])
847   WINE_GET_SONAME(GL,glXQueryExtension,[$X_LIBS $X_EXTRA_LIBS])
848   WINE_GET_SONAME(cups,cupsGetDefault)
852 dnl **** Check for reentrant libc ****
854 wine_cv_libc_reentrant=no
855 dnl Linux style errno location
856 WINE_CHECK_ERRNO([__errno_location], [wine_cv_libc_reentrant=__errno_location],
857   dnl FreeBSD style errno location
858   WINE_CHECK_ERRNO([__error], [wine_cv_libc_reentrant=__error],
859     dnl Solaris style errno location
860     WINE_CHECK_ERRNO([___errno], [wine_cv_libc_reentrant=___errno],
861       dnl UnixWare style errno location
862       WINE_CHECK_ERRNO([__thr_errno], [wine_cv_libc_reentrant=__thr_errno],
863         dnl NetBSD style errno location
864         WINE_CHECK_ERRNO([__errno], [wine_cv_libc_reentrant=__errno])
865 ))))
867 if test "$wine_cv_libc_reentrant" != "no"
868 then
869   AC_DEFINE_UNQUOTED(ERRNO_LOCATION,$wine_cv_libc_reentrant,
870                      [Define to the name of the function returning errno for reentrant libc])
873 dnl **** Check for reentrant X libraries ****
875 dnl This may fail to determine whether X libraries are reentrant if
876 dnl AC_PATH_XTRA does not set x_libraries.
878 if test "$have_x" = "yes"
879 then
880 AC_CACHE_CHECK( [for reentrant X libraries], wine_cv_x_reentrant,
881     [libX11_check=none
882     for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
883         if test -r $dir/libX11.so; then
884             libX11_check="-D $dir/libX11.so"
885             break
886         fi
887         if test -r $dir/libX11.a; then
888             libX11_check="$dir/libX11.a"
889             break
890         fi
891     done
892     if test "$libX11_check" != "none"; then
893         if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
894         then
895             wine_cv_x_reentrant=yes
896         else
897             wine_cv_x_reentrant=no
898         fi
899     else
900         wine_cv_x_reentrant=unknown
901     fi])
904 dnl **** Check for functions ****
906 AC_FUNC_ALLOCA()
907 AC_CHECK_FUNCS(\
908         _lwp_create \
909         _pclose \
910         _popen \
911         _snprintf \
912         _stricmp \
913         _strnicmp \
914         chsize \
915         clone \
916         ecvt \
917         finite \
918         fpclass \
919         ftruncate \
920         ftruncate64 \
921         getnetbyaddr \
922         getnetbyname \
923         getpagesize \
924         getprotobyname \
925         getprotobynumber \
926         getpwuid \
927         getservbyport \
928         getsockopt \
929         inet_network \
930         lseek64 \
931         lstat \
932         memmove \
933         mkstemp \
934         mmap \
935         pclose \
936         popen \
937         pread \
938         pwrite \
939         rfork \
940         select \
941         sendmsg \
942         settimeofday \
943         sigaltstack \
944         snprintf \
945         statfs \
946         strcasecmp \
947         strerror \
948         strncasecmp \
949         tcgetattr \
950         timegm \
951         usleep \
952         vfscanf \
953         wait4 \
954         waitpid \
957 dnl **** Check for header files ****
959 AC_CHECK_HEADERS(\
960         arpa/inet.h \
961         arpa/nameser.h \
962         cups/cups.h \
963         direct.h \
964         elf.h \
965         float.h \
966         ieeefp.h \
967         io.h \
968         libio.h \
969         libutil.h \
970         link.h \
971         linux/cdrom.h \
972         linux/hdreg.h \
973         linux/input.h \
974         linux/joystick.h \
975         linux/major.h \
976         linux/param.h \
977         linux/serial.h \
978         linux/ucdrom.h \
979         netdb.h \
980         netinet/in.h \
981         netinet/in_systm.h \
982         netinet/tcp.h \
983         pty.h \
984         pwd.h \
985         sched.h \
986         scsi/sg.h \
987         socket.h \
988         stdint.h \
989         strings.h \
990         sys/cdio.h \
991         sys/errno.h \
992         sys/file.h \
993         sys/filio.h \
994         sys/inttypes.h \
995         sys/ioctl.h \
996         sys/ipc.h \
997         sys/link.h \
998         sys/lwp.h \
999         sys/mman.h \
1000         sys/modem.h \
1001         sys/msg.h \
1002         sys/param.h \
1003         sys/poll.h \
1004         sys/ptrace.h \
1005         sys/reg.h \
1006         sys/shm.h \
1007         sys/signal.h \
1008         sys/socket.h \
1009         sys/sockio.h \
1010         sys/statfs.h \
1011         sys/strtio.h \
1012         sys/syscall.h \
1013         sys/sysctl.h \
1014         sys/time.h \
1015         sys/times.h \
1016         sys/uio.h \
1017         sys/un.h \
1018         sys/v86.h \
1019         sys/v86intr.h \
1020         sys/vfs.h \
1021         sys/vm86.h \
1022         sys/wait.h \
1023         syscall.h \
1024         termios.h \
1025         unistd.h \
1026         utime.h \
1028 AC_HEADER_STAT()
1030 dnl **** Checks for headers that depend on other ones ****
1032 AC_CHECK_HEADERS(sys/mount.h sys/user.h,,,
1033     [#include <sys/types.h>
1034      #if HAVE_SYS_PARAM_H
1035      # include <sys/param.h>
1036      #endif])
1038 AC_CHECK_HEADERS(net/if.h,,,
1039     [#include <sys/types.h>
1040      #if HAVE_SYS_SOCKET_H
1041      # include <sys/socket.h>
1042      #endif])
1044 AC_CHECK_HEADERS(netinet/ip.h,,,
1045     [#include <sys/types.h>
1046      #if HAVE_SYS_SOCKET_H
1047      # include <sys/socket.h>
1048      #endif
1049      #if HAVE_NETINET_IN_SYSTM_H
1050      # include <netinet/in_systm.h>
1051      #endif])
1053 AC_CHECK_HEADERS(resolv.h,,,
1054     [#include <sys/types.h>
1055      #if HAVE_SYS_SOCKET_H
1056      # include <sys/socket.h>
1057      #endif])
1059 AC_CHECK_HEADERS(ucontext.h,,,[#include <signal.h>])
1061 dnl **** Check for types ****
1063 AC_C_CONST
1064 AC_C_INLINE
1065 AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t])
1066 AC_CHECK_SIZEOF(long long,0)
1068 AC_CACHE_CHECK([whether linux/input.h is for real],
1069         wine_cv_linux_input_h,
1070         AC_TRY_COMPILE([
1071             #include <linux/input.h>
1072         ] , [
1073             int foo = EVIOCGBIT(EV_ABS,42);
1074             int bar = BTN_PINKIE;
1075             int fortytwo = 42;
1076         ],
1077         wine_cv_linux_input_h=yes,
1078         wine_cv_linux_input_h=no,
1079         no
1080         )
1081     )
1082     if test "$wine_cv_linux_input_h" = "yes"
1083     then
1084         AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H, 1,
1085                   [Define if we have linux/input.h AND it contains the INPUT event API])
1086     fi
1089 AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
1090         wine_cv_linux_gethostbyname_r_6,
1091         AC_TRY_COMPILE([
1092 #include <netdb.h>
1093         ], [
1094     char *name=NULL;
1095     struct hostent he;
1096     struct hostent *result;
1097     char *buf=NULL;
1098     int bufsize=0;
1099     int res,errnr;
1100     char *addr=NULL;
1101     int addrlen=0;
1102     int addrtype=0;
1103     res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
1104     res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
1105     ],
1106         wine_cv_linux_gethostbyname_r_6=yes,
1107         wine_cv_linux_gethostbyname_r_6=no
1108         )
1109    )
1110    if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
1111    then
1112       AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6, 1,
1113                 [Define if Linux-style gethostbyname_r and gethostbyaddr_r are available])
1114    fi
1116 if test "$ac_cv_header_linux_joystick_h" = "yes"
1117 then
1118    AC_CACHE_CHECK([whether linux/joystick.h uses the Linux 2.2+ API],
1119         wine_cv_linux_joystick_22_api,
1120         AC_TRY_COMPILE([
1121         #include <sys/ioctl.h>
1122         #include <linux/joystick.h>
1124         struct js_event blub;
1125         #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
1126         #error "no 2.2 header"
1127         #endif
1128         ],/*empty*/,
1129         wine_cv_linux_joystick_22_api=yes,
1130         wine_cv_linux_joystick_22_api=no,
1131         wine_cv_linux_joystick_22_api=no
1132         )
1133    )
1134    if test "$wine_cv_linux_joystick_22_api" = "yes"
1135    then
1136       AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API, 1,
1137                 [Define if <linux/joystick.h> defines the Linux 2.2 joystick API])
1138    fi
1141 dnl **** statfs checks ****
1143 if test "$ac_cv_header_sys_vfs_h" = "yes"
1144 then
1145     AC_CACHE_CHECK( [whether sys/vfs.h defines statfs],
1146                     wine_cv_sys_vfs_has_statfs,
1147         AC_TRY_COMPILE([
1148         #include <sys/types.h>
1149         #ifdef HAVE_SYS_PARAM_H
1150         # include <sys/param.h>
1151         #endif
1152         #include <sys/vfs.h>
1153         ],[
1154                 struct statfs stfs;
1156                 memset(&stfs,0,sizeof(stfs));
1157         ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
1158         )
1159     )
1160     if test "$wine_cv_sys_vfs_has_statfs" = "yes"
1161     then
1162       AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS, 1,
1163                 [Define if the struct statfs is defined by <sys/vfs.h>])
1164     fi
1167 if test "$ac_cv_header_sys_statfs_h" = "yes"
1168 then
1169     AC_CACHE_CHECK( [whether sys/statfs.h defines statfs],
1170                     wine_cv_sys_statfs_has_statfs,
1171         AC_TRY_COMPILE([
1172         #include <sys/types.h>
1173         #ifdef HAVE_SYS_PARAM_H
1174         # include <sys/param.h>
1175         #endif
1176         #include <sys/statfs.h>
1177         ],[
1178                 struct statfs stfs;
1179         ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
1180         )
1181     )
1182     if test "$wine_cv_sys_statfs_has_statfs" = "yes"
1183     then
1184       AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS, 1,
1185                 [Define if the struct statfs is defined by <sys/statfs.h>])
1186     fi
1189 if test "$ac_cv_header_sys_mount_h" = "yes"
1190 then
1191     AC_CACHE_CHECK( [whether sys/mount.h defines statfs],
1192                     wine_cv_sys_mount_has_statfs,
1193         AC_TRY_COMPILE([
1194         #include <sys/types.h>
1195         #ifdef HAVE_SYS_PARAM_H
1196         # include <sys/param.h>
1197         #endif
1198         #include <sys/mount.h>
1199         ],[
1200                 struct statfs stfs;
1201         ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
1202         )
1203     )
1204     if test "$wine_cv_sys_mount_has_statfs" = "yes"
1205     then
1206       AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT, 1,
1207                 [Define if the struct statfs is defined by <sys/mount.h>])
1208     fi
1211 dnl **** FIXME: what about mixed cases, where we need two of them? ***
1213 WINE_CHECK_STRUCT_MEMBER(statfs,f_bfree,
1214 [#include <sys/types.h>
1215 #ifdef HAVE_SYS_PARAM_H
1216 # include <sys/param.h>
1217 #endif
1218 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1219 # include <sys/mount.h>
1220 #else
1221 # ifdef STATFS_DEFINED_BY_SYS_VFS
1222 #  include <sys/vfs.h>
1223 # else
1224 #  ifdef STATFS_DEFINED_BY_SYS_STATFS
1225 #   include <sys/statfs.h>
1226 #  endif
1227 # endif
1228 #endif],
1229     [AC_DEFINE(STATFS_HAS_BFREE, 1, [Define if the struct statfs has the member bfree])])
1231 WINE_CHECK_STRUCT_MEMBER(statfs,f_bavail,
1232 [#include <sys/types.h>
1233 #ifdef HAVE_SYS_PARAM_H
1234 # include <sys/param.h>
1235 #endif
1236 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1237 # include <sys/mount.h>
1238 #else
1239 # ifdef STATFS_DEFINED_BY_SYS_VFS
1240 #  include <sys/vfs.h>
1241 # else
1242 #  ifdef STATFS_DEFINED_BY_SYS_STATFS
1243 #   include <sys/statfs.h>
1244 #  endif
1245 # endif
1246 #endif],
1247     [AC_DEFINE(STATFS_HAS_BAVAIL, 1, [Define if the struct statfs has the member bavail])])
1249 dnl Check for file descriptor passing with msg_accrights
1250 WINE_CHECK_STRUCT_MEMBER(msghdr,msg_accrights,
1251 [#include <sys/types.h>
1252 #ifdef HAVE_SYS_SOCKET_H
1253 # include <sys/socket.h>
1254 #endif],
1255     [AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS, 1, [Define if struct msghdr contains msg_accrights])])
1257 dnl Check for the sa_len member in struct sockaddr
1258 WINE_CHECK_STRUCT_MEMBER(sockaddr,sa_len,
1259 [#include <sys/types.h>
1260 #ifdef HAVE_SYS_SOCKET_H
1261 # include <sys/socket.h>
1262 #endif],
1263     [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if struct sockaddr contains sa_len])])
1265 dnl Check for the sun_len member in struct sockaddr_un
1266 WINE_CHECK_STRUCT_MEMBER(sockaddr_un,sun_len,
1267 [#include <sys/types.h>
1268 #ifdef HAVE_SYS_SOCKET_H
1269 # include <sys/socket.h>
1270 #endif
1271 #ifdef HAVE_SYS_UN_H
1272 # include <sys/un.h>
1273 #endif],
1274     [AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un contains sun_len])])
1276 dnl *** check for the need to define __i386__
1278 case $host_cpu in
1279   *i[3456789]86* )
1280     AC_CACHE_CHECK([whether we need to define __i386__],ac_cv_cpp_def_i386,
1281       AC_EGREP_CPP(yes,[#ifndef __i386__
1283 #endif],
1284  ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
1285     ;;
1286 esac
1287 if test "$ac_cv_cpp_def_i386" = "yes"
1288 then
1289     CFLAGS="$CFLAGS -D__i386__"
1290     LINTFLAGS="$LINTFLAGS -D__i386__"
1293 dnl *** check for the need to define __sparc__
1295 case $host_cpu in
1296   *sparc* )
1297     AC_CACHE_CHECK([whether we need to define __sparc__],ac_cv_cpp_def_sparc,
1298       AC_EGREP_CPP(yes,[#ifndef __sparc__
1300 #endif],
1301  ac_cv_cpp_def_sparc="yes", ac_cv_cpp_def_sparc="no"))
1302     ;;
1303 esac
1304 if test "$ac_cv_cpp_def_sparc" = "yes"
1305 then
1306     CFLAGS="$CFLAGS -D__sparc__"
1307     LINTFLAGS="$LINTFLAGS -D__sparc__"
1310 dnl *** check for the need to define __sun__
1312 case $host_vendor in
1313   *sun* )
1314     AC_CACHE_CHECK([whether we need to define __sun__],ac_cv_cpp_def_sun,
1315       AC_EGREP_CPP(yes,[#ifndef __sun__
1317 #endif],
1318  ac_cv_cpp_def_sun="yes", ac_cv_cpp_def_sun="no"))
1319     ;;
1320 esac
1321 if test "$ac_cv_cpp_def_sun" = "yes"
1322 then
1323     CFLAGS="$CFLAGS -D__sun__"
1324     LINTFLAGS="$LINTFLAGS -D__sun__"
1327 dnl **** Generate output files ****
1329 AH_TOP([#define __WINE_CONFIG_H])
1331 WINE_CONFIG_EXTRA_DIR(controls)
1332 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/d3ddevice)
1333 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dclipper)
1334 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/ddraw)
1335 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/direct3d)
1336 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dpalette)
1337 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dsurface)
1338 WINE_CONFIG_EXTRA_DIR(dlls/dinput/joystick)
1339 WINE_CONFIG_EXTRA_DIR(dlls/dinput/keyboard)
1340 WINE_CONFIG_EXTRA_DIR(dlls/dinput/mouse)
1341 WINE_CONFIG_EXTRA_DIR(dlls/gdi/enhmfdrv)
1342 WINE_CONFIG_EXTRA_DIR(dlls/gdi/mfdrv)
1343 WINE_CONFIG_EXTRA_DIR(dlls/gdi/win16drv)
1344 WINE_CONFIG_EXTRA_DIR(dlls/kernel/messages)
1345 WINE_CONFIG_EXTRA_DIR(dlls/user/dde)
1346 WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
1347 WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
1348 WINE_CONFIG_EXTRA_DIR(files)
1349 WINE_CONFIG_EXTRA_DIR(graphics)
1350 WINE_CONFIG_EXTRA_DIR(graphics/x11drv)
1351 WINE_CONFIG_EXTRA_DIR(if1632)
1352 WINE_CONFIG_EXTRA_DIR(include/wine)
1353 WINE_CONFIG_EXTRA_DIR(loader)
1354 WINE_CONFIG_EXTRA_DIR(loader/ne)
1355 WINE_CONFIG_EXTRA_DIR(memory)
1356 WINE_CONFIG_EXTRA_DIR(misc)
1357 WINE_CONFIG_EXTRA_DIR(msdos)
1358 WINE_CONFIG_EXTRA_DIR(objects)
1359 WINE_CONFIG_EXTRA_DIR(programs/regapi/tests)
1360 WINE_CONFIG_EXTRA_DIR(programs/regedit/tests)
1361 WINE_CONFIG_EXTRA_DIR(relay32)
1362 WINE_CONFIG_EXTRA_DIR(scheduler)
1363 WINE_CONFIG_EXTRA_DIR(win32)
1364 WINE_CONFIG_EXTRA_DIR(windows)
1366 MAKE_RULES=Make.rules
1367 AC_SUBST_FILE(MAKE_RULES)
1369 MAKE_DLL_RULES=dlls/Makedll.rules
1370 AC_SUBST_FILE(MAKE_DLL_RULES)
1372 MAKE_TEST_RULES=dlls/Maketest.rules
1373 AC_SUBST_FILE(MAKE_TEST_RULES)
1375 MAKE_PROG_RULES=programs/Makeprog.rules
1376 AC_SUBST_FILE(MAKE_PROG_RULES)
1378 AC_CONFIG_FILES([
1379 Make.rules
1380 dlls/Makedll.rules
1381 dlls/Maketest.rules
1382 programs/Makeprog.rules
1383 Makefile
1384 dlls/Makefile
1385 dlls/advapi32/Makefile
1386 dlls/advapi32/tests/Makefile
1387 dlls/avicap32/Makefile
1388 dlls/avifil32/Makefile
1389 dlls/cabinet/Makefile
1390 dlls/comcat/Makefile
1391 dlls/comctl32/Makefile
1392 dlls/commdlg/Makefile
1393 dlls/crtdll/Makefile
1394 dlls/crypt32/Makefile
1395 dlls/d3d8/Makefile
1396 dlls/dciman32/Makefile
1397 dlls/ddraw/Makefile
1398 dlls/devenum/Makefile
1399 dlls/dinput/Makefile
1400 dlls/dinput8/Makefile
1401 dlls/dplay/Makefile
1402 dlls/dplayx/Makefile
1403 dlls/dsound/Makefile
1404 dlls/gdi/Makefile
1405 dlls/gdi/tests/Makefile
1406 dlls/glu32/Makefile
1407 dlls/icmp/Makefile
1408 dlls/imagehlp/Makefile
1409 dlls/imm32/Makefile
1410 dlls/kernel/Makefile
1411 dlls/kernel/tests/Makefile
1412 dlls/lzexpand/Makefile
1413 dlls/mapi32/Makefile
1414 dlls/mpr/Makefile
1415 dlls/msacm/Makefile
1416 dlls/msacm/imaadp32/Makefile
1417 dlls/msacm/msadp32/Makefile
1418 dlls/msacm/msg711/Makefile
1419 dlls/msacm/winemp3/Makefile
1420 dlls/msdmo/Makefile
1421 dlls/msimg32/Makefile
1422 dlls/msisys/Makefile
1423 dlls/msnet32/Makefile
1424 dlls/msvcrt/Makefile
1425 dlls/msvcrt/tests/Makefile
1426 dlls/msvcrt20/Makefile
1427 dlls/msvideo/Makefile
1428 dlls/msvideo/msrle32/Makefile
1429 dlls/netapi32/Makefile
1430 dlls/netapi32/tests/Makefile
1431 dlls/ntdll/Makefile
1432 dlls/ntdll/tests/Makefile
1433 dlls/odbc32/Makefile
1434 dlls/ole32/Makefile
1435 dlls/oleaut32/Makefile
1436 dlls/oleaut32/tests/Makefile
1437 dlls/olecli/Makefile
1438 dlls/oledlg/Makefile
1439 dlls/olepro32/Makefile
1440 dlls/olesvr/Makefile
1441 dlls/opengl32/Makefile
1442 dlls/psapi/Makefile
1443 dlls/qcap/Makefile
1444 dlls/quartz/Makefile
1445 dlls/rasapi32/Makefile
1446 dlls/richedit/Makefile
1447 dlls/rpcrt4/Makefile
1448 dlls/rpcrt4/tests/Makefile
1449 dlls/serialui/Makefile
1450 dlls/setupapi/Makefile
1451 dlls/shdocvw/Makefile
1452 dlls/shell32/Makefile
1453 dlls/shell32/tests/Makefile
1454 dlls/shfolder/Makefile
1455 dlls/shlwapi/Makefile
1456 dlls/shlwapi/tests/Makefile
1457 dlls/snmpapi/Makefile
1458 dlls/sti/Makefile
1459 dlls/tapi32/Makefile
1460 dlls/ttydrv/Makefile
1461 dlls/twain/Makefile
1462 dlls/url/Makefile
1463 dlls/urlmon/Makefile
1464 dlls/urlmon/tests/Makefile
1465 dlls/user/Makefile
1466 dlls/user/tests/Makefile
1467 dlls/version/Makefile
1468 dlls/win32s/Makefile
1469 dlls/winaspi/Makefile
1470 dlls/winedos/Makefile
1471 dlls/wineps/Makefile
1472 dlls/wininet/Makefile
1473 dlls/wininet/tests/Makefile
1474 dlls/winmm/Makefile
1475 dlls/winmm/joystick/Makefile
1476 dlls/winmm/mcianim/Makefile
1477 dlls/winmm/mciavi/Makefile
1478 dlls/winmm/mcicda/Makefile
1479 dlls/winmm/mciseq/Makefile
1480 dlls/winmm/mciwave/Makefile
1481 dlls/winmm/midimap/Makefile
1482 dlls/winmm/tests/Makefile
1483 dlls/winmm/wavemap/Makefile
1484 dlls/winmm/winealsa/Makefile
1485 dlls/winmm/winearts/Makefile
1486 dlls/winmm/wineaudioio/Makefile
1487 dlls/winmm/winenas/Makefile
1488 dlls/winmm/wineoss/Makefile
1489 dlls/winnls/Makefile
1490 dlls/winsock/Makefile
1491 dlls/winsock/tests/Makefile
1492 dlls/winspool/Makefile
1493 dlls/wintrust/Makefile
1494 dlls/wow32/Makefile
1495 dlls/wsock32/Makefile
1496 dlls/x11drv/Makefile
1497 documentation/Makefile
1498 include/Makefile
1499 library/Makefile
1500 miscemu/Makefile
1501 ole/Makefile
1502 programs/Makefile
1503 programs/avitools/Makefile
1504 programs/clock/Makefile
1505 programs/cmdlgtst/Makefile
1506 programs/control/Makefile
1507 programs/expand/Makefile
1508 programs/notepad/Makefile
1509 programs/osversioncheck/Makefile
1510 programs/progman/Makefile
1511 programs/regapi/Makefile
1512 programs/regedit/Makefile
1513 programs/regsvr32/Makefile
1514 programs/regtest/Makefile
1515 programs/rundll32/Makefile
1516 programs/uninstaller/Makefile
1517 programs/view/Makefile
1518 programs/wcmd/Makefile
1519 programs/wineconsole/Makefile
1520 programs/winedbg/Makefile
1521 programs/winefile/Makefile
1522 programs/winemine/Makefile
1523 programs/winepath/Makefile
1524 programs/winhelp/Makefile
1525 programs/winver/Makefile
1526 server/Makefile
1527 tools/Makefile
1528 tools/widl/Makefile
1529 tools/winapi/Makefile
1530 tools/winebuild/Makefile
1531 tools/winedump/Makefile
1532 tools/wmc/Makefile
1533 tools/wpp/Makefile
1534 tools/wrc/Makefile
1535 unicode/Makefile])
1537 AC_OUTPUT
1539 if test "$have_x" = "no"
1540 then
1541   echo
1542   echo "*** Warning: X development files not found. Wine will be built without"
1543   echo "*** X support, which currently does not work, and would probably not be"
1544   echo "*** what you want anyway. You will need to install devel packages of"
1545   echo "*** Xlib/Xfree86 at the very least."
1548 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
1549 then
1550   echo
1551   echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
1552   echo "*** terminal resize support. Consider upgrading ncurses."
1555 if test "$wine_cv_libc_reentrant" = "no"
1556 then
1557   echo
1558   echo "*** Warning: non-reentrant libc detected. Wine will be built without"
1559   echo "*** threading support. Consider upgrading libc to a more recent"
1560   echo "*** reentrant version of libc."
1563 if test "$have_x" = "yes" -a "$wine_cv_x_reentrant" != "yes"
1564 then
1565   echo
1566   echo "*** Warning: non-reentrant X11 library detected. Multi-threaded"
1567   echo "*** applications won't work properly. You should upgrade your X11 library."
1570 if test "$wine_cv_opengl_version_OK" = "no"
1571 then
1572   echo
1573   echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1574   echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1577 if test "$wine_cv_msg_freetype" = "yes"
1578 then
1579   echo
1580   echo "*** Note: Your system appears to have the FreeType 2 runtime libraries"
1581   echo "*** installed, but 'freetype-config' is not in your PATH. Install the"
1582   echo "*** freetype-devel package (or its equivalent on your distribution) to"
1583   echo "*** enable Wine to use TrueType fonts."
1586 echo
1587 echo "Configure finished.  Do 'make depend && make' to compile Wine."
1588 echo
1590 dnl Local Variables:
1591 dnl comment-start: "dnl "
1592 dnl comment-end: ""
1593 dnl comment-start-skip: "\\bdnl\\b\\s *"
1594 dnl compile-command: "autoconf"
1595 dnl End: