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]))
8 AC_INIT([Wine],WINE_VERSION,[wine-devel@winehq.org])
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(WIN16_FILES,"\$(WIN16_FILES)")
24 AC_SUBST(WIN16_INSTALL,"\$(WIN16_INSTALL)")
25 if test "x$enable_win16" = "xno"
30 if test "x$enable_debug" = "xno"
32 AC_DEFINE(NO_DEBUG_MSGS,1,[Define to disable all debug messages.])
34 if test "x$enable_trace" = "xno" -o "x$enable_debug" = "xno"
36 AC_DEFINE(NO_TRACE_MSGS,1,[Define to disable trace messages.])
39 dnl **** Check for some programs ****
45 dnl We can't use AC_PROG_CPP for winegcc, it uses by default $(CC) -E
46 AC_CHECK_TOOL(CPPBIN,cpp,cpp)
48 AC_CACHE_CHECK([for the directory containing the Wine tools], wine_cv_toolsdir,
49 [if test -z "$with_wine_tools"; then
50 if test "$cross_compiling" = "yes"; then
51 AC_MSG_ERROR([you must use the --with-wine-tools option when cross-compiling.])
53 wine_cv_toolsdir="\$(TOPOBJDIR)"
55 elif test -d "$with_wine_tools/tools/winebuild"; then
56 case $with_wine_tools in
57 /*) wine_cv_toolsdir="$with_wine_tools" ;;
58 *) wine_cv_toolsdir="\$(TOPOBJDIR)/$with_wine_tools" ;;
61 AC_MSG_ERROR([could not find Wine tools in $with_wine_tools.])
63 AC_SUBST(TOOLSDIR,$wine_cv_toolsdir)
68 dnl **** Just additional warning checks, since AC_PROG just sets 'lex' even
69 dnl **** without one present.
70 AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
71 if test "$XLEX" = "none"
73 AC_MSG_ERROR([no suitable lex found. Please install the 'flex' package.])
77 AC_CHECK_PROGS(BISON,bison,none)
78 if test "$BISON" = "none"
80 AC_MSG_ERROR([no suitable bison found. Please install the 'bison' package.])
83 AC_CHECK_TOOLS(AS,[gas as],as)
84 AC_CHECK_TOOL(LD,ld,ld)
85 AC_CHECK_TOOL(AR,ar,ar)
87 AC_CHECK_TOOL(STRIP,strip,strip)
88 AC_CHECK_TOOL(WINDRES,windres,false)
92 AC_PATH_PROG(LDCONFIG, ldconfig, true, [/sbin /usr/sbin $PATH])
94 dnl Prepend src dir to install path dir if it's a relative path
96 [[\\/$]]* | ?:[[\\/]]* ) ;;
97 *) INSTALL="\\\$(TOPSRCDIR)/$INSTALL" ;;
101 AC_CHECK_PROGS(LINT, lclint lint)
102 if test "$LINT" = "lint"
104 LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
105 dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
110 dnl Check for various programs
111 AC_CHECK_PROGS(DB2HTML, docbook2html db2html, false)
112 AC_CHECK_PROGS(DB2PDF, docbook2pdf db2pdf, false)
113 AC_CHECK_PROGS(DB2PS, docbook2ps db2ps, false)
114 AC_CHECK_PROGS(DB2TXT, docbook2txt db2txt, false)
115 AC_CHECK_PROGS(FONTFORGE, fontforge, false)
117 dnl **** Check for some libraries ****
119 dnl Check for -li386 for NetBSD and OpenBSD
120 AC_CHECK_LIB(i386,i386_set_ldt)
121 dnl Check for -lossaudio for NetBSD
122 AC_CHECK_LIB(ossaudio,_oss_ioctl)
123 dnl Check for -lw for Solaris
124 AC_CHECK_FUNCS(iswalnum,,AC_CHECK_LIB(w,iswalnum))
125 dnl Check for -lnsl for Solaris
126 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
127 dnl Check for -lsocket for Solaris
128 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
129 dnl Check for -lresolv for Solaris
130 AC_CHECK_FUNCS(inet_aton,,AC_CHECK_LIB(resolv,inet_aton))
131 dnl Check for -lxpg4 for FreeBSD
132 AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
133 dnl Check for -lpoll for Mac OS X/Darwin
134 AC_CHECK_LIB(poll,poll)
135 dnl Check for -lresolv for Mac OS X/Darwin
136 AC_CHECK_LIB(resolv,res_9_init)
137 dnl Check for -lpthread
138 AC_CHECK_LIB(pthread,pthread_create,AC_SUBST(LIBPTHREAD,"-lpthread"))
143 AC_SUBST(OPENGLFILES)
147 AC_SUBST(OPENGL_LIBS)
149 if test "$have_x" = "yes"
152 ac_save_CPPFLAGS="$CPPFLAGS"
153 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
155 dnl *** All of the following tests require X11/Xlib.h
156 AC_CHECK_HEADERS(X11/Xlib.h,
158 AC_CHECK_HEADERS([X11/XKBlib.h \
160 X11/extensions/shape.h \
161 X11/extensions/XInput.h \
162 X11/extensions/XShm.h \
163 X11/extensions/Xrandr.h \
164 X11/extensions/Xrender.h \
165 X11/extensions/Xvlib.h \
166 X11/extensions/xf86dga.h \
167 X11/extensions/xf86vmode.h],,,
168 [#include <X11/Xlib.h>
169 #ifdef HAVE_X11_XUTIL_H
170 # include <X11/Xutil.h>
173 dnl *** Check for X keyboard extension
174 if test "$ac_cv_header_X11_XKBlib_h" = "yes"
176 AC_CHECK_LIB(X11, XkbQueryExtension,
177 AC_DEFINE(HAVE_XKB, 1, [Define if you have the XKB extension]),,
178 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
181 dnl *** Check for X Shm extension
182 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes"
184 AC_CHECK_LIB(Xext, XShmQueryExtension,
185 AC_DEFINE(HAVE_LIBXXSHM, 1, [Define if you have the X Shm extension]),,
186 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
189 dnl *** Check for X shape extension
190 if test "$ac_cv_header_X11_extensions_shape_h" = "yes"
192 AC_CHECK_LIB(Xext,XShapeQueryExtension,
193 AC_DEFINE(HAVE_LIBXSHAPE, 1, [Define if you have the X Shape extension]),,
194 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
197 dnl *** Check for XFree86 DGA / DGA 2.0 extension
198 if test "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
200 AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
201 [ dnl *** If found...
202 AC_DEFINE(HAVE_LIBXXF86DGA2, 1,
203 [Define if you have the Xxf86dga library version 2])
204 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
206 [ dnl *** If not found, look for XF86DGAQueryExtension()
207 dnl *** instead (DGA 2.0 not found)...
208 AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
209 [ AC_DEFINE(HAVE_LIBXXF86DGA, 1,
210 [Define if you have the Xxf86dga library version 1])
211 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
213 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
216 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
219 dnl *** Check for XFree86 VMODE extension
220 if test "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
222 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
223 [ AC_DEFINE(HAVE_LIBXXF86VM, 1, [Define if you have the Xxf86vm library])
224 X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
226 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
229 dnl *** Check for X RandR extension
230 if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes"
232 AC_TRY_COMPILE([#include <X11/Xlib.h>
233 #include <X11/extensions/Xrandr.h>],[static typeof(XRRSetScreenConfigAndRate) * func;],
234 [AC_DEFINE(HAVE_LIBXRANDR, 1, [Define if you have the Xrandr library])])
237 dnl *** Check for XVideo extension supporting XvImages
238 if test "$ac_cv_header_X11_extensions_Xvlib_h" = "yes"
240 AC_CHECK_LIB(Xv, XvShmCreateImage,
241 [ AC_DEFINE(HAVE_XVIDEO, 1, [Define if the X libraries support XVideo])
242 X_PRE_LIBS="$X_PRE_LIBS -lXv"
244 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
247 ) dnl *** End of X11/Xlib.h check
249 dnl Check for the presence of OpenGL
250 if test "x$with_opengl" != "xno"
252 if test -f /usr/X11R6/lib/libGL.a -a ! -f /usr/X11R6/lib/libGL.so
254 AC_MSG_ERROR([/usr/X11R6/lib/libGL.a is present on your system.
255 This prevents linking to OpenGL. Delete the file and restart configure.])
258 AC_CHECK_HEADERS(GL/gl.h GL/glx.h)
259 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
261 AC_CHECK_HEADERS(GL/glext.h,,,[#include <GL/glx.h>])
262 dnl Check for some problems due to old Mesa versions
263 AC_CACHE_CHECK([for up-to-date OpenGL version], wine_cv_opengl_version_OK,
265 [#include <GL/gl.h>],
266 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
267 [wine_cv_opengl_version_OK="yes"],
268 [wine_cv_opengl_version_OK="no"]
272 if test "$wine_cv_opengl_version_OK" = "yes"
274 dnl Check for the presence of the library
275 AC_CHECK_LIB(GL,glXCreateContext,
278 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
280 if test "$ac_cv_lib_GL_glXCreateContext" = "yes"
282 OPENGLFILES='$(OPENGLFILES)'
283 AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is present on the system])
285 AC_CHECK_LIB(GL,glXGetProcAddressARB,
286 AC_DEFINE(HAVE_GLX_GETPROCADDRESS, 1,
287 [Define if the OpenGL library supports the glXGetProcAddressARB call]),,
288 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
290 if test "$ac_cv_lib_GL_glXGetProcAddressARB" = "yes"
292 AC_CACHE_CHECK([for OpenGL extension functions prototypes], wine_cv_extension_prototypes,
293 [AC_TRY_COMPILE([#include <GL/gl.h>
294 #ifdef HAVE_GL_GLEXT_H
295 # include <GL/glext.h>
298 [PFNGLCOLORTABLEEXTPROC test_proc;],
299 [wine_cv_extension_prototypes="yes"],
300 [wine_cv_extension_prototypes="no"]
303 if test "$wine_cv_extension_prototypes" = "yes"
305 AC_DEFINE(HAVE_GLEXT_PROTOTYPES, 1,
306 [Define if the OpenGL headers define extension typedefs])
311 dnl Check for GLU32 library.
312 AC_CHECK_LIB(GLU,gluLookAt,
313 [OPENGL_LIBS="$OPENGL_LIBS -lGLU"
314 GLU32FILES='$(GLU32FILES)']
316 $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
320 dnl Check for glut32 library.
321 AC_CHECK_LIB(glut,glutMainLoop,
322 [AC_SUBST(GLUT_LIBS,"-lglut -lXmu -lXi")
323 AC_SUBST(GLUT32FILES,'$(GLUT32FILES)')],,
324 $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXmu -lXi -lX11 $X_EXTRA_LIBS)
328 dnl **** Check for NAS ****
330 AC_CHECK_HEADERS(audio/audiolib.h,
331 [AC_CHECK_HEADERS(audio/soundlib.h,,,[#include <audio/audiolib.h>])
332 AC_CHECK_LIB(audio,AuCreateFlow,
333 [AC_DEFINE(HAVE_NAS,1,[Define if you have NAS including devel headers])
334 NASLIBS="-laudio -lXt $X_LIBS -lXext -lX11 $X_EXTRA_LIBS"],,
335 [-lXt $X_LIBS -lXext -lX11 $X_EXTRA_LIBS])])
337 CPPFLAGS="$ac_save_CPPFLAGS"
345 dnl **** Check which curses lib to use ***
347 if test "x$with_curses" != "xno"
349 AC_CHECK_HEADERS(ncurses.h,
350 [AC_CHECK_LIB(ncurses,waddch,
351 [AC_DEFINE(HAVE_LIBNCURSES, 1, [Define if you have the ncurses library (-lncurses)])
352 CURSESLIBS="-lncurses"],
353 [AC_CHECK_HEADERS(curses.h,
354 [AC_CHECK_LIB(curses,waddch,
355 [AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have the curses library (-lcurses)])
356 CURSESLIBS="-lcurses"])])])])
358 LIBS="$CURSESLIBS $LIBS"
359 AC_CHECK_FUNCS(getbkgd resizeterm)
364 dnl **** Check for SANE ****
365 AC_CHECK_PROG(sane_devel,sane-config,sane-config,no)
366 if test "$sane_devel" = "no"
371 SANELIBS="`$sane_devel --libs`"
372 SANEINCL="`$sane_devel --cflags`"
373 ac_save_CPPFLAGS="$CPPFLAGS"
375 CPPFLAGS="$CPPFLAGS $SANEINCL"
376 LIBS="$LIBS $SANELIBS"
377 AC_CHECK_HEADER(sane/sane.h,
378 [AC_CHECK_LIB(sane,sane_open,
379 [AC_DEFINE(HAVE_SANE, 1, [Define if we have SANE development environment])],
385 CPPFLAGS="$ac_save_CPPFLAGS"
390 dnl **** Check for the ICU library ****
391 AC_CHECK_HEADERS(unicode/ubidi.h)
392 if test "$ac_cv_header_unicode_ubidi_h" = "yes"
395 ICU_LIB_DIR="${ICU_LIB_DIR-/usr/lib}"
396 ICUUC_LIB="${ICUUC_LIB-$ICU_LIB_DIR/libsicuuc.a}"
397 ICUDATA_LIB="${ICUDATA_LIB-$ICU_LIB_DIR/libsicudata.a}"
398 AC_MSG_CHECKING(whether can link with ICU libraries $ICUUC_LIB and $ICUDATA_LIB)
399 LIBS="$LIBS $ICUUC_LIB $ICUDATA_LIB -lstdc++ -lgcc_s"
400 AC_TRY_LINK([#include <unicode/ubidi.h>],[ubidi_open()],
401 [AC_DEFINE(HAVE_ICU,1,[Define to 1 if the ICU libraries are installed])
402 AC_SUBST(ICULIBS,"$ICUUC_LIB $ICUDATA_LIB -lstdc++ -lgcc_s")
408 dnl **** Check for FreeType 2 ****
409 AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$X_LIBS)
410 if test "$ft_lib" = "no"
414 wine_cv_msg_freetype=no
416 AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
417 if test "$ft_devel" = "no"
419 AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
420 if test "$ft_devel2" = "freetype2-config"
425 if test "$ft_devel" = "no"
429 wine_cv_msg_freetype=yes
431 FREETYPELIBS=`$ft_devel --libs`
432 FREETYPEINCL=`$ft_devel --cflags`
433 ac_save_CPPFLAGS="$CPPFLAGS"
434 CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
435 AC_CHECK_HEADERS(ft2build.h \
436 freetype/freetype.h \
438 freetype/tttables.h \
440 freetype/ftsnames.h \
441 freetype/ttnameid.h \
443 freetype/ftwinfnt.h \
444 freetype/internal/sfnt.h,,,
446 #include <ft2build.h>
448 AC_TRY_CPP([#include <ft2build.h>
449 #include <freetype/fttrigon.h>],
450 [AC_DEFINE(HAVE_FREETYPE_FTTRIGON_H, 1,
451 [Define if you have the <freetype/fttrigon.h> header file.])
452 wine_cv_fttrigon=yes],
454 CPPFLAGS="$ac_save_CPPFLAGS"
455 dnl Check that we have at least freetype/freetype.h
456 if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
458 AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
459 wine_cv_msg_freetype=no
463 wine_cv_msg_freetype=yes
467 AC_SUBST(FREETYPELIBS)
468 AC_SUBST(FREETYPEINCL)
470 dnl Only build the fonts dir if we have both freetype and fontforge
471 if test "$FONTFORGE" != "false" -a -n "$FREETYPELIBS"
473 AC_SUBST(FONTSSUBDIRS,"fonts")
476 dnl **** Check for parport (currently Linux only) ****
477 AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
479 [#include <linux/ppdev.h>],
480 [ioctl (1,PPCLAIM,0)],
481 [ac_cv_c_ppdev="yes"],
482 [ac_cv_c_ppdev="no"])
484 if test "$ac_cv_c_ppdev" = "yes"
486 AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev.h for parallel port access])
489 dnl **** Check for va_copy ****
490 AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy,
492 [#include <stdarg.h>],
496 [ac_cv_c_va_copy="yes"],
497 [ac_cv_c_va_copy="no"])
499 if test "$ac_cv_c_va_copy" = "yes"
501 AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
503 AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy,
505 [#include <stdarg.h>],
509 [ac_cv_c___va_copy="yes"],
510 [ac_cv_c___va_copy="no"])
512 if test "$ac_cv_c___va_copy" = "yes"
514 AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
517 dnl **** Check for sigsetjmp ****
518 AC_CACHE_CHECK([for sigsetjmp], ac_cv_c_sigsetjmp,
520 [#include <setjmp.h>],
523 siglongjmp( buf, 1 );],
524 [ac_cv_c_sigsetjmp="yes"],
525 [ac_cv_c_sigsetjmp="no"])
527 if test "$ac_cv_c_sigsetjmp" = "yes"
529 AC_DEFINE(HAVE_SIGSETJMP, 1, [Define to 1 if you have the sigsetjmp (and siglongjmp) function])
532 dnl **** Check for pthread_rwlock_t ****
533 AC_CHECK_TYPES([pthread_rwlock_t, pthread_rwlockattr_t],,,[#define _GNU_SOURCE
534 #include <pthread.h>])
536 dnl **** Check for pthread functions ****
538 LIBS="$LIBS $LIBPTHREAD"
541 pthread_get_stackaddr_np \
542 pthread_get_stacksize_np \
546 dnl **** Check for Open Sound System ****
547 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
549 AC_CACHE_CHECK([for Open Sound System],
550 ac_cv_c_opensoundsystem,
552 #if defined(HAVE_SYS_SOUNDCARD_H)
553 #include <sys/soundcard.h>
554 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
555 #include <machine/soundcard.h>
556 #elif defined(HAVE_SOUNDCARD_H)
557 #include <soundcard.h>
561 /* check for one of the Open Sound System specific SNDCTL_ defines */
562 #if !defined(SNDCTL_DSP_STEREO)
563 #error No open sound system
565 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
567 if test "$ac_cv_c_opensoundsystem" = "yes"
569 AC_DEFINE(HAVE_OSS, 1, [Define if you have the Open Sound system])
572 AC_CACHE_CHECK([for Open Sound System/MIDI interface],
573 ac_cv_c_opensoundsystem_midi,
575 #if defined(HAVE_SYS_SOUNDCARD_H)
576 #include <sys/soundcard.h>
577 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
578 #include <machine/soundcard.h>
579 #elif defined(HAVE_SOUNDCARD_H)
580 #include <soundcard.h>
584 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
585 #if !defined(SNDCTL_SEQ_SYNC)
586 #error No open sound system MIDI interface
588 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
590 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
592 AC_DEFINE(HAVE_OSS_MIDI, 1, [Define if you have the Open Sound system (MIDI interface)])
595 dnl **** Check for aRts Sound Server ****
596 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
597 if test x$ARTSCCONFIG != x -a x$ARTSCCONFIG != x'"$ARTSCCONFIG"';
600 for i in `$ARTSCCONFIG --cflags`
603 -I*) ARTSC_CFLAGS="$ARTSC_CFLAGS $i";;
606 ARTSC_LIBS=`$ARTSCCONFIG --libs`
607 save_CFLAGS="$CFLAGS"
608 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
609 AC_TRY_COMPILE([#include <artsc.h>],[arts_stream_t stream;],
610 [AC_SUBST(ARTSLIBS, $ARTSC_LIBS)
611 AC_SUBST(ARTSINCL, $ARTSC_CFLAGS)
612 AC_DEFINE(HAVE_ARTS, 1, [Define if you have ARTS sound server])])
613 CFLAGS="$save_CFLAGS"
616 dnl **** Check for ALSA ****
617 AC_SUBST(ALSALIBS,"")
618 AC_CHECK_HEADERS(alsa/asoundlib.h sys/asoundlib.h, break)
619 if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes"
621 AC_CHECK_LIB(asound,snd_pcm_open,
622 AC_DEFINE(HAVE_ALSA,1,[Define if you have ALSA including devel headers])
626 dnl **** Check for libaudioio (which can be used to get solaris audio support) ****
628 AC_SUBST(AUDIOIOLIBS,"")
629 AC_CHECK_HEADERS(libaudioio.h,
630 [AC_CHECK_LIB(audioio,AudioIOGetVersion,
631 [AUDIOIOLIBS="-laudioio"
632 AC_DEFINE(HAVE_LIBAUDIOIO, 1, [Define if you have libaudioIO])])])
634 dnl **** Check for lcms ****
636 AC_CHECK_HEADERS(lcms.h,
637 [AC_CHECK_LIB(lcms,cmsOpenProfileFromFile,
638 [AC_DEFINE(HAVE_LCMS,1,[Define if you have lcms libs and headers])
639 AC_SUBST(LCMSLIBS,"-llcms")
643 dnl **** Check for capi4linux ****
645 AC_CHECK_HEADERS(capi20.h,[
646 AC_CHECK_HEADERS(linux/capi.h,[
647 AC_CHECK_LIB(capi20,capi20_register,[
648 AC_DEFINE(HAVE_CAPI4LINUX,1,[Define if you have capi4linux libs and headers])
649 AC_SUBST(CAPI4LINUXLIBS,"-lcapi20")
654 dnl **** Check for broken glibc mmap64 ****
656 AC_CACHE_CHECK( [whether mmap64 works defined as mmap], ac_cv_mmap64_works,
658 #define _FILE_OFFSET_BITS 64
662 #include <sys/mman.h>
665 int main(int argc,char **argv) {
666 int fd = open("conftest.map",O_CREAT|O_RDWR,0600);
667 if (fd == -1) exit(1);
669 unlink("conftest.map");
673 if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) &&
679 fprintf(stderr,"success!\n");
684 ac_cv_mmap64_works="yes",
685 ac_cv_mmap64_works="no",
686 ac_cv_mmap64_works="no") )
688 if test "$ac_cv_mmap64_works" = "yes"
690 AC_DEFINE(_FILE_OFFSET_BITS, 64, [Set this to 64 to enable 64-bit file support on Linux])
693 dnl **** Check for gcc specific options ****
695 AC_SUBST(EXTRACFLAGS,"")
696 if test "x${GCC}" = "xyes"
698 EXTRACFLAGS="-Wall -pipe"
700 dnl Check for strength-reduce bug
701 AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug,
703 int L[[4]] = {0,1,2,3};
705 static int Array[[3]];
708 for(i=0; i<B; i++) Array[[i]] = i - 3;
709 for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
712 exit( Array[[1]] != -2 || L[[2]] != 3);
714 ac_cv_c_gcc_strength_bug="no",
715 ac_cv_c_gcc_strength_bug="yes",
716 ac_cv_c_gcc_strength_bug="yes") )
717 if test "$ac_cv_c_gcc_strength_bug" = "yes"
719 EXTRACFLAGS="$EXTRACFLAGS -fno-strength-reduce"
722 dnl Check for -fshort-wchar
723 AC_CACHE_CHECK([for gcc -fshort-wchar support], ac_cv_c_gcc_fshort_wchar,
724 [WINE_TRY_CFLAGS([-fshort-wchar],
725 ac_cv_c_gcc_fshort_wchar="yes",ac_cv_c_gcc_fshort_wchar="no")])
726 if test "$ac_cv_c_gcc_fshort_wchar" = "yes"
728 AC_DEFINE(CC_FLAG_SHORT_WCHAR, "-fshort-wchar", [Specifies the compiler flag that forces a short wchar_t])
731 dnl Check for -mpreferred-stack-boundary
732 AC_CACHE_CHECK([for gcc -mpreferred-stack-boundary=2 support], ac_cv_c_gcc_stack_boundary,
733 [WINE_TRY_CFLAGS([-mpreferred-stack-boundary=2],
734 ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")])
735 if test "$ac_cv_c_gcc_stack_boundary" = "yes"
737 EXTRACFLAGS="$EXTRACFLAGS -mpreferred-stack-boundary=2"
740 dnl Check for -fno-strict-aliasing
741 AC_CACHE_CHECK([for gcc -fno-strict-aliasing support], ac_cv_c_gcc_no_strict_aliasing,
742 [WINE_TRY_CFLAGS([-fno-strict-aliasing],
743 ac_cv_c_gcc_no_strict_aliasing="yes",ac_cv_c_gcc_no_strict_aliasing="no")])
744 if test "$ac_cv_c_gcc_no_strict_aliasing" = "yes"
746 EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing"
749 dnl Check for -gstabs+ option
750 AC_CACHE_CHECK([for gcc -gstabs+ support], ac_cv_c_gcc_gstabs,
751 [WINE_TRY_CFLAGS([-gstabs+],ac_cv_c_gcc_gstabs="yes", ac_cv_c_gcc_gstabs="no")])
752 if test "$ac_cv_c_gcc_gstabs" = "yes"
754 EXTRACFLAGS="$EXTRACFLAGS -gstabs+"
757 dnl Check for noisy string.h
758 saved_CFLAGS="$CFLAGS"
759 CFLAGS="$CFLAGS -Wpointer-arith -Werror"
760 AC_CACHE_CHECK([for broken string.h that generates warnings], ac_cv_c_string_h_warnings,
761 AC_TRY_COMPILE([#include <string.h>],[],
762 [ac_cv_c_string_h_warnings=no],[ac_cv_c_string_h_warnings=yes]))
763 CFLAGS="$saved_CFLAGS"
764 if test "$ac_cv_c_string_h_warnings" = "no"
766 EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith"
770 dnl **** Check how to define a function in assembly code ****
772 AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,
774 ["\t.globl _ac_test\n\t.def _ac_test; .scl 2; .type 32; .endef\n_ac_test:\t.long 0"],,,
775 ac_cv_asm_func_def=".def",
776 [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,@function\n_ac_test:\t.long 0"],,,
777 ac_cv_asm_func_def=".type @function",
778 [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,2\n_ac_test:\t.long 0"],,,
779 ac_cv_asm_func_def=".type 2",
780 ac_cv_asm_func_def="unknown")])]))
782 AH_TEMPLATE(__ASM_FUNC,[Define to a macro to generate an assembly function directive])
783 case "$ac_cv_asm_func_def" in
785 AC_DEFINE([__ASM_FUNC(name)], [".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"]) ;;
787 AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",@function"]) ;;
789 AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",2"]) ;;
791 AC_DEFINE([__ASM_FUNC(name)], [""]) ;;
794 dnl **** Check for underscore on external symbols ****
796 AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_extern_prefix,
797 WINE_TRY_ASM_LINK([".globl _ac_test\n_ac_test:\t.long 0"],
798 [extern int ac_test;],
799 [if (ac_test) return 1],
800 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no"))
802 AH_TEMPLATE(__ASM_NAME,[Define to a macro to generate an assembly name from a C symbol])
803 if test "$ac_cv_c_extern_prefix" = "yes"
805 AC_DEFINE([__ASM_NAME(name)], ["_" name])
807 AC_DEFINE([__ASM_NAME(name)], [name])
810 dnl **** Check how to do strings in assembler ****
812 AC_CACHE_CHECK([for assembler keyword for ASCII strings], ac_cv_c_asm_string,
813 WINE_TRY_ASM_LINK([".data\\n\\t.string \\"test\\"\\n\\t.text"],,,ac_cv_c_asm_string=".string",
814 WINE_TRY_ASM_LINK([".data\\n\\t.asciz \\"test\\"\\n\\t.text"],,,ac_cv_c_asm_string=".asciz",
815 WINE_TRY_ASM_LINK([".data\\n\\t.ascii \\"test\\"\\n\\t.text"],,,ac_cv_c_asm_string=".ascii",
816 AC_MSG_ERROR([could not discover how to produce C strings with assembler.])))))
818 AC_DEFINE_UNQUOTED(__ASM_STRING, ["$ac_cv_c_asm_string"],
819 [Define to the assembler keyword used to specify an ASCII string])
821 dnl **** Check for .short in assembler ****
823 AC_CACHE_CHECK([for assembler keyword for word values], ac_cv_c_asm_short,
824 WINE_TRY_ASM_LINK([".data\\n\\t.short 1\\n\\t.text"],,,ac_cv_c_asm_short=".short",
825 WINE_TRY_ASM_LINK([".data\\n\\t.half 1\\n\\t.text"],,,ac_cv_c_asm_short=".half",
826 AC_MSG_ERROR([could not discover how to specify word values with assembler.]))))
828 AC_DEFINE_UNQUOTED(__ASM_SHORT, ["$ac_cv_c_asm_short"],
829 [Define to the assembler keyword used to specify a word value])
831 dnl **** Check for .size in assembler ****
833 AC_CACHE_CHECK([for .size in assembler], ac_cv_c_asm_size,
834 WINE_TRY_ASM_LINK([".globl _ac_test\n.size _ac_test, . - _ac_test"],,,
835 ac_cv_c_asm_size="yes",ac_cv_c_asm_size="no"))
837 if test "$ac_cv_c_asm_size" = "yes"
839 AC_DEFINE(HAVE_ASM_DOT_SIZE, 1, [Define if the assembler keyword .size is accepted])
842 dnl **** Check for working dll ****
845 AC_SUBST(DLLFLAGS,"-D_REENTRANT")
847 AC_SUBST(LDSHARED,"")
848 AC_SUBST(LDDLLFLAGS,"")
849 AC_SUBST(LIBEXT,"so")
850 AC_SUBST(IMPLIBEXT,"def")
854 AC_CHECK_TOOL(DLLTOOL,dlltool,false)
855 AC_CHECK_TOOL(DLLWRAP,dllwrap,false)
856 if test "$DLLWRAP" = "false"; then
859 dnl FIXME - check whether dllwrap works correctly...
863 dnl We can't build 16-bit NE dlls
868 AC_CHECK_HEADERS(dlfcn.h,
869 [AC_CHECK_FUNCS(dlopen,,
870 [AC_CHECK_LIB(dl,dlopen,
871 [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
876 if test "$LIBEXT" = "so"
878 DLLFLAGS="$DLLFLAGS -fPIC"
880 AC_CACHE_CHECK([whether we can build a GNU style ELF dll], ac_cv_c_dll_gnuelf,
881 [WINE_TRY_SHLIB_FLAGS([-fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic],
882 ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")])
883 if test "$ac_cv_c_dll_gnuelf" = "yes"
885 LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
886 LDDLLFLAGS="-shared -Wl,-Bsymbolic"
887 AC_CACHE_CHECK([whether the linker accepts -z defs], ac_cv_c_dll_zdefs,
888 [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs],
889 ac_cv_c_dll_zdefs="yes",ac_cv_c_dll_zdefs="no")])
890 if test "$ac_cv_c_dll_zdefs" = "yes"
892 LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
895 AC_CACHE_CHECK([whether the linker accepts -init and -fini], ac_cv_c_dll_init_fini,
896 [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini],
897 ac_cv_c_dll_init_fini="yes",ac_cv_c_dll_init_fini="no")])
898 if test "$ac_cv_c_dll_init_fini" = "yes"
900 LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"
903 AC_CACHE_CHECK([whether the linker accepts version scripts], ac_cv_c_ld_version_scripts,
904 [echo '{ global: *; };' >conftest.map
905 WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map],
906 ac_cv_c_ld_version_scripts="yes",ac_cv_c_ld_version_scripts="no")
908 if test "$ac_cv_c_ld_version_scripts" = "yes"
910 LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"
913 AC_CACHE_CHECK([whether the linker accepts --export-dynamic], ac_cv_c_export_dynamic,
914 [WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
915 ac_cv_c_export_dynamic="yes",ac_cv_c_export_dynamic="no")])
916 if test "$ac_cv_c_export_dynamic" = "yes"
918 AC_SUBST(LDEXECFLAGS,["-Wl,--export-dynamic"])
923 AC_CACHE_CHECK([whether we can relocate the executable to 0x77f00000], ac_cv_ld_reloc_exec,
924 [WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x77f00400],
925 ac_cv_ld_reloc_exec="yes", ac_cv_ld_reloc_exec="no")])
926 if test "$ac_cv_ld_reloc_exec" = "yes"
928 LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x77f00400"
934 AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll, ac_cv_c_dll_unixware,
935 [WINE_TRY_SHLIB_FLAGS([-fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic],
936 ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")])
937 if test "$ac_cv_c_dll_unixware" = "yes"
939 LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
940 LDDLLFLAGS="-Wl,-G,-B,symbolic"
943 AC_CACHE_CHECK(whether we can build a Mach-O (Mac OS X/Darwin) dll, ac_cv_c_dll_macho,
944 [WINE_TRY_SHLIB_FLAGS([-bundle], ac_cv_c_dll_macho="yes", ac_cv_c_dll_macho="no")])
945 if test "$ac_cv_c_dll_macho" = "yes"
948 LDDLLFLAGS="-bundle -flat_namespace -undefined suppress"
949 LDSHARED="\$(CC) -dynamiclib"
950 CFLAGS="$CFLAGS -ffixed-r13 -no-cpp-precomp"
952 dnl Relocate wine executable
953 AC_SUBST(LDEXECFLAGS,"-seg1addr 0x120000")
954 dnl Relocate libwine.dyld too
955 AC_SUBST(LDLIBWINEFLAGS,"-seg1addr 0x140000")
956 dnl declare needed frameworks
957 AC_SUBST(COREFOUNDATIONLIB,"-framework CoreFoundation")
958 AC_SUBST(IOKITLIB,"-framework IOKit")
959 dnl using IOKit imply we use CoreFoundation too
960 IOKITLIB = "$IOKITLIB $COREFOUNDATIONLIB"
962 AC_CACHE_CHECK(whether we can build an HP-UX dll, ac_cv_c_dll_hpux,
963 [WINE_TRY_SHLIB_FLAGS([-shared], ac_cv_c_dll_hpux="yes", ac_cv_c_dll_hpux="no")])
964 if test "$ac_cv_c_dll_hpux" = "yes"
968 LDSHARED="\$(CC) -shared"
975 dnl Check for cross compiler to build test programs
976 AC_SUBST(CROSSTEST,"")
977 if test "$cross_compiling" = "no"
979 AC_CHECK_PROGS(CROSSCC,i586-mingw32msvc-gcc i386-mingw32msvc-gcc i386-mingw32-gcc mingw-gcc,false)
980 AC_CHECK_PROGS(DLLTOOL,i586-mingw32msvc-dlltool i386-mingw32msvc-dlltool i386-mingw32-dlltool mingw-dlltool,false)
981 AC_CHECK_PROGS(CROSSWINDRES,i586-mingw32msvc-windres i386-mingw32msvc-windres i386-mingw32-windres mingw-windres,false)
982 if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi
987 if test "$LIBEXT" = "a"; then
989 [could not find a way to build shared libraries.
990 It is currently not possible to build Wine without shared library
991 (.so) support to allow transparent switch between .so and .dll files.
992 If you are using Linux, you will need a newer binutils.]
998 AC_SUBST(LDPATH,"PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$PATH\"") ;;
1000 AC_SUBST(LDPATH,"DYLD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$DYLD_LIBRARY_PATH\"") ;;
1002 AC_SUBST(LDPATH,"LD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$LD_LIBRARY_PATH\"") ;;
1005 dnl Mingw needs explicit msvcrt for linking libwine and winsock for wininet
1008 AC_SUBST(CRTLIBS,"-lmsvcrt")
1009 AC_SUBST(SOCKETLIBS,"-lws2_32")
1015 AC_SUBST(WINE_BINARIES,"wine-glibc wine-kthread wine-pthread wine-preloader")
1016 AC_SUBST(MAIN_BINARY,"wine-glibc")
1019 AC_SUBST(WINE_BINARIES,"wine-pthread")
1020 AC_SUBST(MAIN_BINARY,"wine-pthread")
1023 AC_SUBST(WINE_BINARIES,"wine-kthread")
1024 AC_SUBST(MAIN_BINARY,"wine-kthread")
1028 dnl **** Get the soname for libraries that we load dynamically ****
1030 if test "$LIBEXT" = "so" -o "$LIBEXT" = "dylib"
1032 WINE_GET_SONAME(X11,XCreateWindow,[$X_LIBS $X_EXTRA_LIBS])
1033 WINE_GET_SONAME(Xext,XextCreateExtension,[$X_LIBS -lX11 $X_EXTRA_LIBS])
1034 WINE_GET_SONAME(Xi,XOpenDevice,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1035 WINE_GET_SONAME(Xrender,XRenderQueryExtension,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1036 WINE_GET_SONAME(Xrandr,XRRQueryExtension,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1037 WINE_GET_SONAME(freetype,FT_Init_FreeType,[$X_LIBS])
1038 WINE_GET_SONAME(GL,glXQueryExtension,[$X_LIBS $X_EXTRA_LIBS])
1039 WINE_GET_SONAME(txc_dxtn,fetch_2d_texel_rgba_dxt1)
1040 WINE_GET_SONAME(cups,cupsGetDefault)
1041 WINE_GET_SONAME(jack,jack_client_new)
1042 WINE_GET_SONAME(fontconfig,FcInit)
1043 WINE_GET_SONAME(ssl,SSL_library_init)
1044 WINE_GET_SONAME(crypto,BIO_new_socket)
1045 WINE_GET_SONAME(ncurses,waddch)
1046 WINE_GET_SONAME(curses,waddch)
1047 WINE_GET_SONAME(jpeg,jpeg_start_decompress)
1048 WINE_GET_SONAME(ungif,DGifOpen)
1049 WINE_GET_SONAME(gif,DGifOpen)
1053 dnl **** Check for functions ****
1117 dnl **** Check for header files ****
1126 fontconfig/fontconfig.h \
1150 netinet/in_systm.h \
1212 dnl **** Checks for headers that depend on other ones ****
1214 AC_CHECK_HEADERS(sys/mount.h sys/user.h,,,
1215 [#include <sys/types.h>
1216 #if HAVE_SYS_PARAM_H
1217 # include <sys/param.h>
1220 AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h net/route.h],,,
1221 [#include <sys/types.h>
1222 #if HAVE_SYS_SOCKET_H
1223 # include <sys/socket.h>
1226 AC_CHECK_HEADERS([resolv.h],,,
1227 [#include <sys/types.h>
1228 #if HAVE_SYS_SOCKET_H
1229 # include <sys/socket.h>
1231 #if HAVE_NETINET_IN_H
1232 # include <netinet/in.h>
1234 #if HAVE_ARPA_NAMESER_H
1235 # include <arpa/nameser.h>
1238 AC_CHECK_HEADERS(netinet/ip.h,,,
1239 [#include <sys/types.h>
1240 #if HAVE_SYS_SOCKET_H
1241 # include <sys/socket.h>
1243 #if HAVE_NETINET_IN_SYSTM_H
1244 # include <netinet/in_systm.h>
1247 AC_CHECK_HEADERS(ucontext.h,,,[#include <signal.h>])
1249 dnl **** Check for IPX headers (currently Linux only) ****
1251 AC_CACHE_CHECK([for GNU style IPX support], ac_cv_c_ipx_gnu,
1253 [#include <sys/types.h>
1254 #ifdef HAVE_SYS_SOCKET_H
1255 # include <sys/socket.h>
1257 #include <netipx/ipx.h>],
1258 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
1259 [ac_cv_c_ipx_gnu="yes"],
1260 [ac_cv_c_ipx_gnu="no"])
1262 if test "$ac_cv_c_ipx_gnu" = "yes"
1264 AC_DEFINE(HAVE_IPX_GNU, 1, [Define if IPX should use netipx/ipx.h from libc])
1267 if test "$ac_cv_c_ipx_gnu" = "no"
1269 AC_CACHE_CHECK([for linux style IPX support], ac_cv_c_ipx_linux,
1271 [#include <sys/types.h>
1272 #ifdef HAVE_SYS_SOCKET_H
1273 # include <sys/socket.h>
1275 #include <asm/types.h>
1276 #include <linux/ipx.h>],
1277 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
1278 [ac_cv_c_ipx_linux="yes"],
1279 [ac_cv_c_ipx_linux="no"])
1281 if test "$ac_cv_c_ipx_linux" = "yes"
1283 AC_DEFINE(HAVE_IPX_LINUX, 1, [Define if IPX includes are taken from Linux kernel])
1287 dnl **** Check for types ****
1291 AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t, long long, fsblkcnt_t, fsfilcnt_t])
1293 AC_CACHE_CHECK([whether linux/input.h is for real],
1294 wine_cv_linux_input_h,
1296 #include <linux/input.h>
1298 int foo = EVIOCGBIT(EV_ABS,42);
1299 int bar = BTN_PINKIE;
1302 wine_cv_linux_input_h=yes,
1303 wine_cv_linux_input_h=no,
1307 if test "$wine_cv_linux_input_h" = "yes"
1309 AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H, 1,
1310 [Define if we have linux/input.h AND it contains the INPUT event API])
1314 AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
1315 wine_cv_linux_gethostbyname_r_6,
1321 struct hostent *result;
1328 res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
1329 res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
1331 wine_cv_linux_gethostbyname_r_6=yes,
1332 wine_cv_linux_gethostbyname_r_6=no
1335 if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
1337 AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6, 1,
1338 [Define if Linux-style gethostbyname_r and gethostbyaddr_r are available])
1341 if test "$ac_cv_header_linux_joystick_h" = "yes"
1343 AC_CACHE_CHECK([whether linux/joystick.h uses the Linux 2.2+ API],
1344 wine_cv_linux_joystick_22_api,
1346 #include <sys/ioctl.h>
1347 #include <linux/joystick.h>
1349 struct js_event blub;
1350 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
1351 #error "no 2.2 header"
1354 wine_cv_linux_joystick_22_api=yes,
1355 wine_cv_linux_joystick_22_api=no,
1356 wine_cv_linux_joystick_22_api=no
1359 if test "$wine_cv_linux_joystick_22_api" = "yes"
1361 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API, 1,
1362 [Define if <linux/joystick.h> defines the Linux 2.2 joystick API])
1366 dnl **** statfs checks ****
1368 if test "$ac_cv_header_sys_vfs_h" = "yes"
1370 AC_CACHE_CHECK( [whether sys/vfs.h defines statfs],
1371 wine_cv_sys_vfs_has_statfs,
1373 #include <sys/types.h>
1374 #ifdef HAVE_SYS_PARAM_H
1375 # include <sys/param.h>
1377 #include <sys/vfs.h>
1381 memset(&stfs,0,sizeof(stfs));
1382 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
1385 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
1387 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS, 1,
1388 [Define if the struct statfs is defined by <sys/vfs.h>])
1392 if test "$ac_cv_header_sys_statfs_h" = "yes"
1394 AC_CACHE_CHECK( [whether sys/statfs.h defines statfs],
1395 wine_cv_sys_statfs_has_statfs,
1397 #include <sys/types.h>
1398 #ifdef HAVE_SYS_PARAM_H
1399 # include <sys/param.h>
1401 #include <sys/statfs.h>
1404 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
1407 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
1409 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS, 1,
1410 [Define if the struct statfs is defined by <sys/statfs.h>])
1414 if test "$ac_cv_header_sys_mount_h" = "yes"
1416 AC_CACHE_CHECK( [whether sys/mount.h defines statfs],
1417 wine_cv_sys_mount_has_statfs,
1419 #include <sys/types.h>
1420 #ifdef HAVE_SYS_PARAM_H
1421 # include <sys/param.h>
1423 #include <sys/mount.h>
1426 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
1429 if test "$wine_cv_sys_mount_has_statfs" = "yes"
1431 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT, 1,
1432 [Define if the struct statfs is defined by <sys/mount.h>])
1436 dnl **** FIXME: what about mixed cases, where we need two of them? ***
1438 dnl Check for statfs members
1439 AC_CHECK_MEMBERS([struct statfs.f_bfree, struct statfs.f_bavail, struct statfs.f_frsize, struct statfs.f_ffree, struct statfs.f_favail, struct statfs.f_namelen],,,
1440 [#include <sys/types.h>
1441 #ifdef HAVE_SYS_PARAM_H
1442 # include <sys/param.h>
1444 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1445 # include <sys/mount.h>
1447 # ifdef STATFS_DEFINED_BY_SYS_VFS
1448 # include <sys/vfs.h>
1450 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1451 # include <sys/statfs.h>
1456 AC_CHECK_MEMBERS([struct statvfs.f_blocks],,,
1457 [#ifdef HAVE_SYS_STATVFS_H
1458 #include <sys/statvfs.h>
1461 dnl Check for socket structure members
1462 AC_CHECK_MEMBERS([struct msghdr.msg_accrights, struct sockaddr.sa_len, struct sockaddr_un.sun_len],,,
1463 [#include <sys/types.h>
1464 #ifdef HAVE_SYS_SOCKET_H
1465 # include <sys/socket.h>
1467 #ifdef HAVE_SYS_UN_H
1468 # include <sys/un.h>
1471 dnl Check for siginfo_t members
1472 AC_CHECK_MEMBERS([siginfo_t.si_fd],,,[#include <signal.h>])
1474 dnl Check for struct option
1475 AC_CHECK_MEMBERS([struct option.name],,,
1476 [#ifdef HAVE_GETOPT_H
1480 dnl Check for stat.st_blocks
1481 AC_CHECK_MEMBERS([struct stat.st_blocks])
1483 dnl *** check for the need to define platform-specific symbols
1486 *i[[3456789]]86*) WINE_CHECK_DEFINE([__i386__]) ;;
1487 *alpha*) WINE_CHECK_DEFINE([__ALPHA__]) ;;
1488 *sparc*) WINE_CHECK_DEFINE([__sparc__]) ;;
1489 *powerpc*) WINE_CHECK_DEFINE([__powerpc__]) ;;
1492 case $host_vendor in
1493 *sun*) WINE_CHECK_DEFINE([__sun__]) ;;
1496 dnl **** Generate output files ****
1498 AH_TOP([#define __WINE_CONFIG_H])
1500 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/d3ddevice)
1501 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dclipper)
1502 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/ddraw)
1503 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/direct3d)
1504 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dpalette)
1505 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dsurface)
1506 WINE_CONFIG_EXTRA_DIR(dlls/gdi/enhmfdrv)
1507 WINE_CONFIG_EXTRA_DIR(dlls/gdi/mfdrv)
1508 WINE_CONFIG_EXTRA_DIR(dlls/kernel/messages)
1509 WINE_CONFIG_EXTRA_DIR(dlls/user/dde)
1510 WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
1511 WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
1512 WINE_CONFIG_EXTRA_DIR(include/wine)
1513 WINE_CONFIG_EXTRA_DIR(misc)
1514 WINE_CONFIG_EXTRA_DIR(programs/regedit/tests)
1515 WINE_CONFIG_EXTRA_DIR(windows)
1517 MAKE_RULES=Make.rules
1518 AC_SUBST_FILE(MAKE_RULES)
1520 MAKE_DLL_RULES=dlls/Makedll.rules
1521 AC_SUBST_FILE(MAKE_DLL_RULES)
1523 MAKE_TEST_RULES=dlls/Maketest.rules
1524 AC_SUBST_FILE(MAKE_TEST_RULES)
1526 MAKE_LIB_RULES=libs/Makelib.rules
1527 AC_SUBST_FILE(MAKE_LIB_RULES)
1529 MAKE_PROG_RULES=programs/Makeprog.rules
1530 AC_SUBST_FILE(MAKE_PROG_RULES)
1537 programs/Makeprog.rules
1540 dlls/advapi32/Makefile
1541 dlls/advapi32/tests/Makefile
1542 dlls/amstream/Makefile
1544 dlls/avicap32/Makefile
1545 dlls/avifil32/Makefile
1546 dlls/cabinet/Makefile
1547 dlls/capi2032/Makefile
1549 dlls/cfgmgr32/Makefile
1550 dlls/comcat/Makefile
1551 dlls/comctl32/Makefile
1552 dlls/comctl32/tests/Makefile
1553 dlls/commdlg/Makefile
1554 dlls/crtdll/Makefile
1555 dlls/crypt32/Makefile
1562 dlls/d3dxof/Makefile
1563 dlls/dbghelp/Makefile
1564 dlls/dciman32/Makefile
1566 dlls/ddraw/tests/Makefile
1567 dlls/devenum/Makefile
1568 dlls/dinput/Makefile
1569 dlls/dinput8/Makefile
1570 dlls/dmband/Makefile
1571 dlls/dmcompos/Makefile
1573 dlls/dmloader/Makefile
1574 dlls/dmscript/Makefile
1575 dlls/dmstyle/Makefile
1576 dlls/dmsynth/Makefile
1577 dlls/dmusic/Makefile
1578 dlls/dmusic32/Makefile
1580 dlls/dplayx/Makefile
1582 dlls/dpnhpast/Makefile
1583 dlls/dsound/Makefile
1584 dlls/dsound/tests/Makefile
1585 dlls/dswave/Makefile
1586 dlls/dxdiagn/Makefile
1587 dlls/dxerr8/Makefile
1588 dlls/dxerr9/Makefile
1589 dlls/dxguid/Makefile
1591 dlls/gdi/tests/Makefile
1593 dlls/glut32/Makefile
1594 dlls/hhctrl.ocx/Makefile
1595 dlls/iccvid/Makefile
1597 dlls/ifsmgr.vxd/Makefile
1598 dlls/imagehlp/Makefile
1600 dlls/iphlpapi/Makefile
1601 dlls/iphlpapi/tests/Makefile
1603 dlls/kernel/Makefile
1604 dlls/kernel/tests/Makefile
1605 dlls/lzexpand/Makefile
1606 dlls/mapi32/Makefile
1607 dlls/mapi32/tests/Makefile
1609 dlls/mlang/tests/Makefile
1610 dlls/mmdevldr.vxd/Makefile
1611 dlls/monodebg.vxd/Makefile
1614 dlls/msacm/imaadp32/Makefile
1615 dlls/msacm/msadp32/Makefile
1616 dlls/msacm/msg711/Makefile
1617 dlls/msacm/winemp3/Makefile
1618 dlls/msacm/tests/Makefile
1621 dlls/mshtml/Makefile
1623 dlls/msimg32/Makefile
1624 dlls/msisys/Makefile
1625 dlls/msnet32/Makefile
1626 dlls/msrle32/Makefile
1627 dlls/msvcrt/Makefile
1628 dlls/msvcrt/tests/Makefile
1629 dlls/msvcrt20/Makefile
1630 dlls/msvcrt40/Makefile
1631 dlls/msvcrtd/Makefile
1632 dlls/msvcrtd/tests/Makefile
1633 dlls/msvidc32/Makefile
1634 dlls/msvideo/Makefile
1635 dlls/mswsock/Makefile
1636 dlls/netapi32/Makefile
1637 dlls/netapi32/tests/Makefile
1638 dlls/newdev/Makefile
1640 dlls/ntdll/tests/Makefile
1641 dlls/odbc32/Makefile
1643 dlls/ole32/tests/Makefile
1644 dlls/oleacc/Makefile
1645 dlls/oleaut32/Makefile
1646 dlls/oleaut32/tests/Makefile
1647 dlls/olecli/Makefile
1648 dlls/oledlg/Makefile
1649 dlls/olepro32/Makefile
1650 dlls/olesvr/Makefile
1651 dlls/opengl32/Makefile
1653 dlls/psapi/tests/Makefile
1655 dlls/quartz/Makefile
1656 dlls/quartz/tests/Makefile
1657 dlls/rasapi32/Makefile
1658 dlls/richedit/Makefile
1659 dlls/rpcrt4/Makefile
1660 dlls/rpcrt4/tests/Makefile
1661 dlls/rsabase/Makefile
1662 dlls/rsabase/tests/Makefile
1663 dlls/secur32/Makefile
1664 dlls/serialui/Makefile
1665 dlls/setupapi/Makefile
1666 dlls/shdocvw/Makefile
1667 dlls/shell32/Makefile
1668 dlls/shell32/tests/Makefile
1669 dlls/shfolder/Makefile
1670 dlls/shlwapi/Makefile
1671 dlls/shlwapi/tests/Makefile
1672 dlls/snmpapi/Makefile
1674 dlls/strmiids/Makefile
1675 dlls/tapi32/Makefile
1676 dlls/ttydrv/Makefile
1678 dlls/unicows/Makefile
1680 dlls/urlmon/Makefile
1681 dlls/urlmon/tests/Makefile
1683 dlls/user/tests/Makefile
1685 dlls/uxtheme/Makefile
1686 dlls/vdhcp.vxd/Makefile
1687 dlls/vdmdbg/Makefile
1688 dlls/version/Makefile
1689 dlls/version/tests/Makefile
1690 dlls/vmm.vxd/Makefile
1691 dlls/vnbt.vxd/Makefile
1692 dlls/vnetbios.vxd/Makefile
1693 dlls/vtdapi.vxd/Makefile
1694 dlls/vwin32.vxd/Makefile
1695 dlls/win32s/Makefile
1696 dlls/winaspi/Makefile
1697 dlls/wined3d/Makefile
1698 dlls/winedos/Makefile
1699 dlls/wineps/Makefile
1700 dlls/wininet/Makefile
1701 dlls/wininet/tests/Makefile
1703 dlls/winmm/joystick/Makefile
1704 dlls/winmm/mcianim/Makefile
1705 dlls/winmm/mciavi/Makefile
1706 dlls/winmm/mcicda/Makefile
1707 dlls/winmm/mciseq/Makefile
1708 dlls/winmm/mciwave/Makefile
1709 dlls/winmm/midimap/Makefile
1710 dlls/winmm/tests/Makefile
1711 dlls/winmm/wavemap/Makefile
1712 dlls/winmm/winealsa/Makefile
1713 dlls/winmm/winearts/Makefile
1714 dlls/winmm/wineaudioio/Makefile
1715 dlls/winmm/winejack/Makefile
1716 dlls/winmm/winenas/Makefile
1717 dlls/winmm/wineoss/Makefile
1718 dlls/winnls/Makefile
1719 dlls/winsock/Makefile
1720 dlls/winsock/tests/Makefile
1721 dlls/winspool/Makefile
1722 dlls/winspool/tests/Makefile
1723 dlls/wintab32/Makefile
1724 dlls/wintrust/Makefile
1726 dlls/wsock32/Makefile
1727 dlls/x11drv/Makefile
1728 documentation/Makefile
1733 libs/unicode/Makefile
1738 programs/avitools/Makefile
1739 programs/clock/Makefile
1740 programs/cmdlgtst/Makefile
1741 programs/control/Makefile
1742 programs/expand/Makefile
1743 programs/msiexec/Makefile
1744 programs/notepad/Makefile
1745 programs/progman/Makefile
1746 programs/regedit/Makefile
1747 programs/regsvr32/Makefile
1748 programs/rpcss/Makefile
1749 programs/rundll32/Makefile
1750 programs/start/Makefile
1751 programs/taskmgr/Makefile
1752 programs/uninstaller/Makefile
1753 programs/view/Makefile
1754 programs/wcmd/Makefile
1755 programs/wineboot/Makefile
1756 programs/winebrowser/Makefile
1757 programs/winecfg/Makefile
1758 programs/wineconsole/Makefile
1759 programs/winedbg/Makefile
1760 programs/winefile/Makefile
1761 programs/winemenubuilder/Makefile
1762 programs/winemine/Makefile
1763 programs/winepath/Makefile
1764 programs/winetest/Makefile
1765 programs/winevdm/Makefile
1766 programs/winhelp/Makefile
1767 programs/winver/Makefile
1771 tools/winapi/Makefile
1772 tools/winebuild/Makefile
1773 tools/winedump/Makefile
1774 tools/winegcc/Makefile
1776 tools/wrc/Makefile])
1780 if test "$have_x" = "no"
1783 echo "*** Warning: X development files not found. Wine will be built without"
1784 echo "*** X support, which currently does not work, and would probably not be"
1785 echo "*** what you want anyway. You will need to install devel packages of"
1786 echo "*** Xlib/Xfree86 at the very least."
1789 if test "$wine_cv_opengl_version_OK" = "no"
1792 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1793 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1796 if test "$wine_cv_msg_freetype" = "yes"
1799 echo "*** Note: Your system appears to have the FreeType 2 runtime libraries"
1800 echo "*** installed, but 'freetype-config' is not in your PATH. Install the"
1801 echo "*** freetype-devel package (or its equivalent on your distribution) to"
1802 echo "*** enable Wine to use TrueType fonts."
1806 echo "Configure finished. Do '${ac_make} depend && ${ac_make}' to compile Wine."
1809 dnl Local Variables:
1810 dnl comment-start: "dnl "
1812 dnl comment-start-skip: "\\bdnl\\b\\s *"
1813 dnl compile-command: "autoconf"