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