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]))
18 AC_ARG_ENABLE(win64, AC_HELP_STRING([--enable-win64], [build a Win64 emulator on AMD64 (won't run Win32 binaries)]))
20 AC_ARG_WITH(opengl, AC_HELP_STRING([--without-opengl],[do not use OpenGL]))
21 AC_ARG_WITH(curses, AC_HELP_STRING([--without-curses],[do not use curses]))
22 AC_ARG_WITH(wine-tools,AC_HELP_STRING([--with-wine-tools=<dir>],[use Wine tools from directory <dir>]))
24 AC_SUBST(WIN16_FILES,"\$(WIN16_FILES)")
25 AC_SUBST(WIN16_INSTALL,"\$(WIN16_INSTALL)")
26 if test "x$enable_win16" = "xno"
33 if test "x$enable_debug" = "xno"
35 DLLDEFS="$DLLDEFS -DWINE_NO_DEBUG_MSGS"
37 if test "x$enable_trace" = "xno" -o "x$enable_debug" = "xno"
39 DLLDEFS="$DLLDEFS -DWINE_NO_TRACE_MSGS"
42 dnl **** Check for some programs ****
47 if test "x$enable_win64" != "xyes"
49 test -n "$CC" || CC="gcc -m32"
50 test -n "$LD" || LD="ld -m elf_i386"
51 test -n "$AS" || AS="as --32"
59 dnl We can't use AC_PROG_CPP for winegcc, it uses by default $(CC) -E
60 AC_CHECK_TOOL(CPPBIN,cpp,cpp)
62 AC_CACHE_CHECK([for the directory containing the Wine tools], wine_cv_toolsdir,
63 [if test -z "$with_wine_tools"; then
64 if test "$cross_compiling" = "yes"; then
65 AC_MSG_ERROR([you must use the --with-wine-tools option when cross-compiling.])
67 wine_cv_toolsdir="\$(TOPOBJDIR)"
69 elif test -d "$with_wine_tools/tools/winebuild"; then
70 case $with_wine_tools in
71 /*) wine_cv_toolsdir="$with_wine_tools" ;;
72 *) wine_cv_toolsdir="\$(TOPOBJDIR)/$with_wine_tools" ;;
75 AC_MSG_ERROR([could not find Wine tools in $with_wine_tools.])
77 AC_SUBST(TOOLSDIR,$wine_cv_toolsdir)
82 dnl **** Just additional warning checks, since AC_PROG just sets 'lex' even
83 dnl **** without one present.
84 AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
85 if test "$XLEX" = "none"
87 AC_MSG_ERROR([no suitable lex found. Please install the 'flex' package.])
91 AC_CHECK_PROGS(BISON,bison,none)
92 if test "$BISON" = "none"
94 AC_MSG_ERROR([no suitable bison found. Please install the 'bison' package.])
97 AC_CHECK_TOOLS(AS,[gas as],as)
98 AC_CHECK_TOOL(LD,ld,ld)
99 AC_CHECK_TOOL(AR,ar,ar)
101 AC_CHECK_TOOL(STRIP,strip,strip)
102 AC_CHECK_TOOL(WINDRES,windres,false)
106 AC_PATH_PROG(LDCONFIG, ldconfig, true, [/sbin /usr/sbin $PATH])
108 dnl Prepend src dir to install path dir if it's a relative path
110 [[\\/$]]* | ?:[[\\/]]* ) ;;
111 *) INSTALL="\\\$(TOPSRCDIR)/$INSTALL" ;;
115 AC_CHECK_PROGS(LINT, lclint lint)
116 if test "$LINT" = "lint"
118 LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
119 dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
124 dnl Check for various programs
125 AC_CHECK_PROGS(DB2HTML, docbook2html db2html, false)
126 AC_CHECK_PROGS(DB2PDF, docbook2pdf db2pdf, false)
127 AC_CHECK_PROGS(DB2PS, docbook2ps db2ps, false)
128 AC_CHECK_PROGS(DB2TXT, docbook2txt db2txt, false)
129 AC_CHECK_PROGS(FONTFORGE, fontforge, false)
131 dnl **** Check for some libraries ****
133 dnl Check for -li386 for NetBSD and OpenBSD
134 AC_CHECK_LIB(i386,i386_set_ldt)
135 dnl Check for -lossaudio for NetBSD
136 AC_CHECK_LIB(ossaudio,_oss_ioctl)
137 dnl Check for -lw for Solaris
138 AC_CHECK_FUNCS(iswalnum,,AC_CHECK_LIB(w,iswalnum))
139 dnl Check for -lnsl for Solaris
140 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
141 dnl Check for -lsocket for Solaris
142 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
143 dnl Check for -lresolv for Solaris
144 AC_CHECK_FUNCS(inet_aton,,AC_CHECK_LIB(resolv,inet_aton))
145 dnl Check for -lxpg4 for FreeBSD
146 AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
147 dnl Check for -lpoll for Mac OS X/Darwin
148 AC_CHECK_LIB(poll,poll)
149 dnl Check for -lresolv for Mac OS X/Darwin
150 AC_CHECK_LIB(resolv,res_9_init)
151 dnl Check for -lpthread
152 AC_CHECK_LIB(pthread,pthread_create,AC_SUBST(LIBPTHREAD,"-lpthread"))
157 AC_SUBST(OPENGLFILES)
161 AC_SUBST(OPENGL_LIBS)
164 dnl **** Check for header files ****
173 fontconfig/fontconfig.h \
265 dnl **** Check for X11 ****
267 if test "$have_x" = "yes"
270 ac_save_CPPFLAGS="$CPPFLAGS"
271 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
273 dnl *** All of the following tests require X11/Xlib.h
274 AC_CHECK_HEADERS(X11/Xlib.h,
276 AC_CHECK_HEADERS([X11/XKBlib.h \
278 X11/extensions/shape.h \
279 X11/extensions/XInput.h \
280 X11/extensions/XShm.h \
281 X11/extensions/Xrandr.h \
282 X11/extensions/Xrender.h \
283 X11/extensions/Xvlib.h \
284 X11/extensions/xf86dga.h \
285 X11/extensions/xf86vmode.h],,,
286 [#include <X11/Xlib.h>
287 #ifdef HAVE_X11_XUTIL_H
288 # include <X11/Xutil.h>
291 dnl *** Check for X keyboard extension
292 if test "$ac_cv_header_X11_XKBlib_h" = "yes"
294 AC_CHECK_LIB(X11, XkbQueryExtension,
295 AC_DEFINE(HAVE_XKB, 1, [Define if you have the XKB extension]),,
296 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
299 dnl *** Check for X Shm extension
300 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes"
302 AC_CHECK_LIB(Xext, XShmQueryExtension,
303 AC_DEFINE(HAVE_LIBXXSHM, 1, [Define if you have the X Shm extension]),,
304 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
307 dnl *** Check for X shape extension
308 if test "$ac_cv_header_X11_extensions_shape_h" = "yes"
310 AC_CHECK_LIB(Xext,XShapeQueryExtension,
311 AC_DEFINE(HAVE_LIBXSHAPE, 1, [Define if you have the X Shape extension]),,
312 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
315 dnl *** Check for XFree86 DGA / DGA 2.0 extension
316 if test "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
318 AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
319 [ dnl *** If found...
320 AC_DEFINE(HAVE_LIBXXF86DGA2, 1,
321 [Define if you have the Xxf86dga library version 2])
322 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
324 [ dnl *** If not found, look for XF86DGAQueryExtension()
325 dnl *** instead (DGA 2.0 not found)...
326 AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
327 [ AC_DEFINE(HAVE_LIBXXF86DGA, 1,
328 [Define if you have the Xxf86dga library version 1])
329 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
331 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
334 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
337 dnl *** Check for XFree86 VMODE extension
338 if test "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
340 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
341 [ AC_DEFINE(HAVE_LIBXXF86VM, 1, [Define if you have the Xxf86vm library])
342 X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
344 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
347 dnl *** Check for X RandR extension
348 if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes"
350 AC_TRY_COMPILE([#include <X11/Xlib.h>
351 #include <X11/extensions/Xrandr.h>],[static typeof(XRRSetScreenConfigAndRate) * func;],
352 [AC_DEFINE(HAVE_LIBXRANDR, 1, [Define if you have the Xrandr library])])
355 dnl *** Check for XVideo extension supporting XvImages
356 if test "$ac_cv_header_X11_extensions_Xvlib_h" = "yes"
358 AC_CHECK_LIB(Xv, XvShmCreateImage,
359 [ AC_DEFINE(HAVE_XVIDEO, 1, [Define if the X libraries support XVideo])
360 X_PRE_LIBS="$X_PRE_LIBS -lXv"
362 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
365 dnl *** Check for Transform functions in Xrender
366 if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes"
368 AC_CHECK_LIB(Xrender, XRenderSetPictureTransform,
369 [AC_DEFINE(HAVE_XRENDERSETPICTURETRANSFORM, 1,
370 [Define if Xrender has the XRenderSetPictureTransform function])],,
371 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
374 ) dnl *** End of X11/Xlib.h check
376 dnl Check for the presence of OpenGL
377 if test "x$with_opengl" != "xno"
379 if test -f /usr/X11R6/lib/libGL.a -a ! -f /usr/X11R6/lib/libGL.so
381 AC_MSG_ERROR([/usr/X11R6/lib/libGL.a is present on your system.
382 This prevents linking to OpenGL. Delete the file and restart configure.])
385 AC_CHECK_HEADERS(GL/gl.h GL/glx.h)
386 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
388 AC_CHECK_HEADERS(GL/glext.h,,,[#include <GL/glx.h>])
389 dnl Check for some problems due to old Mesa versions
390 AC_CACHE_CHECK([for up-to-date OpenGL version], wine_cv_opengl_version_OK,
392 [#include <GL/gl.h>],
393 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
394 [wine_cv_opengl_version_OK="yes"],
395 [wine_cv_opengl_version_OK="no"]
399 if test "$wine_cv_opengl_version_OK" = "yes"
401 dnl Check for the presence of the library
402 AC_CHECK_LIB(GL,glXCreateContext,
405 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
407 if test "$ac_cv_lib_GL_glXCreateContext" = "yes"
409 OPENGLFILES='$(OPENGLFILES)'
410 AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is present on the system])
412 AC_CHECK_LIB(GL,glXGetProcAddressARB,
413 AC_DEFINE(HAVE_GLX_GETPROCADDRESS, 1,
414 [Define if the OpenGL library supports the glXGetProcAddressARB call]),,
415 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
417 if test "$ac_cv_lib_GL_glXGetProcAddressARB" = "yes"
419 AC_CACHE_CHECK([for OpenGL extension functions prototypes], wine_cv_extension_prototypes,
420 [AC_TRY_COMPILE([#include <GL/gl.h>
421 #ifdef HAVE_GL_GLEXT_H
422 # include <GL/glext.h>
425 [PFNGLCOLORTABLEEXTPROC test_proc;],
426 [wine_cv_extension_prototypes="yes"],
427 [wine_cv_extension_prototypes="no"]
430 if test "$wine_cv_extension_prototypes" = "yes"
432 AC_DEFINE(HAVE_GLEXT_PROTOTYPES, 1,
433 [Define if the OpenGL headers define extension typedefs])
438 dnl Check for GLU32 library.
439 AC_CHECK_LIB(GLU,gluLookAt,
440 [OPENGL_LIBS="$OPENGL_LIBS -lGLU"
441 GLU32FILES='$(GLU32FILES)']
443 $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
447 dnl Check for glut32 library.
448 AC_CHECK_LIB(glut,glutMainLoop,
449 [AC_SUBST(GLUT_LIBS,"-lglut -lXmu -lXi")
450 AC_SUBST(GLUT32FILES,'$(GLUT32FILES)')],,
451 $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXmu -lXi -lX11 $X_EXTRA_LIBS)
455 dnl **** Check for NAS ****
457 AC_CHECK_HEADERS(audio/audiolib.h,
458 [AC_CHECK_HEADERS(audio/soundlib.h,,,[#include <audio/audiolib.h>])
459 AC_CHECK_LIB(audio,AuCreateFlow,
460 [AC_DEFINE(HAVE_NAS,1,[Define if you have NAS including devel headers])
461 NASLIBS="-laudio -lXt $X_LIBS -lXext -lX11 $X_EXTRA_LIBS"],,
462 [-lXt $X_LIBS -lXext -lX11 $X_EXTRA_LIBS])])
464 CPPFLAGS="$ac_save_CPPFLAGS"
472 dnl **** Check which curses lib to use ***
474 if test "x$with_curses" != "xno"
476 AC_CHECK_HEADERS(ncurses.h,
477 [AC_CHECK_LIB(ncurses,waddch,
478 [AC_DEFINE(HAVE_LIBNCURSES, 1, [Define if you have the ncurses library (-lncurses)])
479 CURSESLIBS="-lncurses"],
480 [AC_CHECK_HEADERS(curses.h,
481 [AC_CHECK_LIB(curses,waddch,
482 [AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have the curses library (-lcurses)])
483 CURSESLIBS="-lcurses"])])])])
485 LIBS="$CURSESLIBS $LIBS"
486 AC_CHECK_FUNCS(getbkgd resizeterm)
491 dnl **** Check for SANE ****
492 AC_CHECK_PROG(sane_devel,sane-config,sane-config,no)
493 if test "$sane_devel" = "no"
498 SANELIBS="`$sane_devel --libs`"
499 SANEINCL="`$sane_devel --cflags`"
500 ac_save_CPPFLAGS="$CPPFLAGS"
502 CPPFLAGS="$CPPFLAGS $SANEINCL"
503 LIBS="$LIBS $SANELIBS"
504 AC_CHECK_HEADER(sane/sane.h,
505 [AC_CHECK_LIB(sane,sane_open,
506 [AC_DEFINE(HAVE_SANE, 1, [Define if we have SANE development environment])],
512 CPPFLAGS="$ac_save_CPPFLAGS"
517 dnl **** Check for the ICU library ****
518 AC_CHECK_HEADERS(unicode/ubidi.h)
519 if test "$ac_cv_header_unicode_ubidi_h" = "yes"
522 ICU_LIB_DIR="${ICU_LIB_DIR-/usr/lib}"
523 ICUUC_LIB="${ICUUC_LIB-$ICU_LIB_DIR/libsicuuc.a}"
524 ICUDATA_LIB="${ICUDATA_LIB-$ICU_LIB_DIR/libsicudata.a}"
525 AC_MSG_CHECKING(whether can link with ICU libraries $ICUUC_LIB and $ICUDATA_LIB)
526 LIBS="$LIBS $ICUUC_LIB $ICUDATA_LIB -lstdc++ -lgcc_s"
527 AC_TRY_LINK([#include <unicode/ubidi.h>],[ubidi_open()],
528 [AC_DEFINE(HAVE_ICU,1,[Define to 1 if the ICU libraries are installed])
529 AC_SUBST(ICULIBS,"$ICUUC_LIB $ICUDATA_LIB -lstdc++ -lgcc_s")
535 dnl **** Check for FreeType 2 ****
536 AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$X_LIBS)
537 if test "$ft_lib" = "no"
541 wine_cv_msg_freetype=no
543 AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
544 if test "$ft_devel" = "no"
546 AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
547 if test "$ft_devel2" = "freetype2-config"
552 if test "$ft_devel" = "no"
556 wine_cv_msg_freetype=yes
558 FREETYPELIBS=`$ft_devel --libs`
559 FREETYPEINCL=`$ft_devel --cflags`
560 ac_save_CPPFLAGS="$CPPFLAGS"
561 CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
562 AC_CHECK_HEADERS(ft2build.h \
563 freetype/freetype.h \
565 freetype/tttables.h \
567 freetype/ftsnames.h \
568 freetype/ttnameid.h \
570 freetype/ftwinfnt.h \
571 freetype/internal/sfnt.h,,,
573 #include <ft2build.h>
575 AC_TRY_CPP([#include <ft2build.h>
576 #include <freetype/fttrigon.h>],
577 [AC_DEFINE(HAVE_FREETYPE_FTTRIGON_H, 1,
578 [Define if you have the <freetype/fttrigon.h> header file.])
579 wine_cv_fttrigon=yes],
581 CPPFLAGS="$ac_save_CPPFLAGS"
582 dnl Check that we have at least freetype/freetype.h
583 if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
585 AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
586 wine_cv_msg_freetype=no
590 wine_cv_msg_freetype=yes
594 AC_SUBST(FREETYPELIBS)
595 AC_SUBST(FREETYPEINCL)
597 dnl Only build the fonts dir if we have both freetype and fontforge
598 if test "$FONTFORGE" != "false" -a -n "$FREETYPELIBS"
600 AC_SUBST(FONTSSUBDIRS,"fonts")
603 dnl **** Check for parport (currently Linux only) ****
604 AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
606 [#include <linux/ppdev.h>],
607 [ioctl (1,PPCLAIM,0)],
608 [ac_cv_c_ppdev="yes"],
609 [ac_cv_c_ppdev="no"])
611 if test "$ac_cv_c_ppdev" = "yes"
613 AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev.h for parallel port access])
616 dnl **** Check for va_copy ****
617 AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy,
619 [#include <stdarg.h>],
623 [ac_cv_c_va_copy="yes"],
624 [ac_cv_c_va_copy="no"])
626 if test "$ac_cv_c_va_copy" = "yes"
628 AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
630 AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy,
632 [#include <stdarg.h>],
636 [ac_cv_c___va_copy="yes"],
637 [ac_cv_c___va_copy="no"])
639 if test "$ac_cv_c___va_copy" = "yes"
641 AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
644 dnl **** Check for sigsetjmp ****
645 AC_CACHE_CHECK([for sigsetjmp], ac_cv_c_sigsetjmp,
647 [#include <setjmp.h>],
650 siglongjmp( buf, 1 );],
651 [ac_cv_c_sigsetjmp="yes"],
652 [ac_cv_c_sigsetjmp="no"])
654 if test "$ac_cv_c_sigsetjmp" = "yes"
656 AC_DEFINE(HAVE_SIGSETJMP, 1, [Define to 1 if you have the sigsetjmp (and siglongjmp) function])
659 dnl **** Check for pthread_rwlock_t ****
660 AC_CHECK_TYPES([pthread_rwlock_t, pthread_rwlockattr_t],,,[#define _GNU_SOURCE
661 #include <pthread.h>])
663 dnl **** Check for pthread functions ****
665 LIBS="$LIBS $LIBPTHREAD"
668 pthread_get_stackaddr_np \
669 pthread_get_stacksize_np \
673 dnl **** Check for Open Sound System ****
674 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
676 AC_CACHE_CHECK([for Open Sound System],
677 ac_cv_c_opensoundsystem,
679 #if defined(HAVE_SYS_SOUNDCARD_H)
680 #include <sys/soundcard.h>
681 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
682 #include <machine/soundcard.h>
683 #elif defined(HAVE_SOUNDCARD_H)
684 #include <soundcard.h>
688 /* check for one of the Open Sound System specific SNDCTL_ defines */
689 #if !defined(SNDCTL_DSP_STEREO)
690 #error No open sound system
692 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
694 if test "$ac_cv_c_opensoundsystem" = "yes"
696 AC_DEFINE(HAVE_OSS, 1, [Define if you have the Open Sound system])
699 AC_CACHE_CHECK([for Open Sound System/MIDI interface],
700 ac_cv_c_opensoundsystem_midi,
702 #if defined(HAVE_SYS_SOUNDCARD_H)
703 #include <sys/soundcard.h>
704 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
705 #include <machine/soundcard.h>
706 #elif defined(HAVE_SOUNDCARD_H)
707 #include <soundcard.h>
711 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
712 #if !defined(SNDCTL_SEQ_SYNC)
713 #error No open sound system MIDI interface
715 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
717 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
719 AC_DEFINE(HAVE_OSS_MIDI, 1, [Define if you have the Open Sound system (MIDI interface)])
722 dnl **** Check for aRts Sound Server ****
723 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
724 if test x$ARTSCCONFIG != x -a x$ARTSCCONFIG != x'"$ARTSCCONFIG"';
727 for i in `$ARTSCCONFIG --cflags`
730 -I*) ARTSC_CFLAGS="$ARTSC_CFLAGS $i";;
733 ARTSC_LIBS=`$ARTSCCONFIG --libs`
734 save_CFLAGS="$CFLAGS"
735 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
736 AC_TRY_COMPILE([#include <artsc.h>],[arts_stream_t stream;],
737 [AC_SUBST(ARTSLIBS, $ARTSC_LIBS)
738 AC_SUBST(ARTSINCL, $ARTSC_CFLAGS)
739 AC_DEFINE(HAVE_ARTS, 1, [Define if you have ARTS sound server])])
740 CFLAGS="$save_CFLAGS"
743 dnl **** Check for ALSA ****
744 AC_SUBST(ALSALIBS,"")
745 AC_CHECK_HEADERS(alsa/asoundlib.h sys/asoundlib.h, break)
746 if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes"
748 AC_CHECK_LIB(asound,snd_pcm_open,
749 AC_DEFINE(HAVE_ALSA,1,[Define if you have ALSA including devel headers])
753 dnl **** Check for libaudioio (which can be used to get solaris audio support) ****
755 AC_SUBST(AUDIOIOLIBS,"")
756 AC_CHECK_HEADERS(libaudioio.h,
757 [AC_CHECK_LIB(audioio,AudioIOGetVersion,
758 [AUDIOIOLIBS="-laudioio"
759 AC_DEFINE(HAVE_LIBAUDIOIO, 1, [Define if you have libaudioIO])])])
761 dnl **** Check for capi4linux ****
763 AC_CHECK_HEADERS(capi20.h,[
764 AC_CHECK_HEADERS(linux/capi.h,[
765 AC_CHECK_LIB(capi20,capi20_register,[
766 AC_DEFINE(HAVE_CAPI4LINUX,1,[Define if you have capi4linux libs and headers])
767 AC_SUBST(CAPI4LINUXLIBS,"-lcapi20")
772 dnl **** Check for broken glibc mmap64 ****
774 AC_CACHE_CHECK( [whether mmap64 works defined as mmap], ac_cv_mmap64_works,
776 #define _FILE_OFFSET_BITS 64
780 #include <sys/mman.h>
783 int main(int argc,char **argv) {
784 int fd = open("conftest.map",O_CREAT|O_RDWR,0600);
785 if (fd == -1) exit(1);
787 unlink("conftest.map");
791 if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) &&
797 fprintf(stderr,"success!\n");
802 ac_cv_mmap64_works="yes",
803 ac_cv_mmap64_works="no",
804 ac_cv_mmap64_works="no") )
806 if test "$ac_cv_mmap64_works" = "yes"
808 AC_DEFINE(_FILE_OFFSET_BITS, 64, [Set this to 64 to enable 64-bit file support on Linux])
811 dnl **** Check for gcc specific options ****
813 AC_SUBST(EXTRACFLAGS,"")
814 if test "x${GCC}" = "xyes"
816 EXTRACFLAGS="-Wall -pipe"
818 dnl Check for strength-reduce bug
819 AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug,
821 int L[[4]] = {0,1,2,3};
823 static int Array[[3]];
826 for(i=0; i<B; i++) Array[[i]] = i - 3;
827 for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
830 exit( Array[[1]] != -2 || L[[2]] != 3);
832 ac_cv_c_gcc_strength_bug="no",
833 ac_cv_c_gcc_strength_bug="yes",
834 ac_cv_c_gcc_strength_bug="yes") )
835 if test "$ac_cv_c_gcc_strength_bug" = "yes"
837 EXTRACFLAGS="$EXTRACFLAGS -fno-strength-reduce"
840 dnl Check for -fshort-wchar
841 AC_CACHE_CHECK([for gcc -fshort-wchar support], ac_cv_c_gcc_fshort_wchar,
842 [WINE_TRY_CFLAGS([-fshort-wchar],
843 ac_cv_c_gcc_fshort_wchar="yes",ac_cv_c_gcc_fshort_wchar="no")])
844 if test "$ac_cv_c_gcc_fshort_wchar" = "yes"
846 AC_DEFINE(CC_FLAG_SHORT_WCHAR, "-fshort-wchar", [Specifies the compiler flag that forces a short wchar_t])
849 dnl Check for -mpreferred-stack-boundary
850 AC_CACHE_CHECK([for gcc -mpreferred-stack-boundary=2 support], ac_cv_c_gcc_stack_boundary,
851 [WINE_TRY_CFLAGS([-mpreferred-stack-boundary=2],
852 ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")])
853 if test "$ac_cv_c_gcc_stack_boundary" = "yes"
855 EXTRACFLAGS="$EXTRACFLAGS -mpreferred-stack-boundary=2"
858 dnl Check for -fno-strict-aliasing
859 AC_CACHE_CHECK([for gcc -fno-strict-aliasing support], ac_cv_c_gcc_no_strict_aliasing,
860 [WINE_TRY_CFLAGS([-fno-strict-aliasing],
861 ac_cv_c_gcc_no_strict_aliasing="yes",ac_cv_c_gcc_no_strict_aliasing="no")])
862 if test "$ac_cv_c_gcc_no_strict_aliasing" = "yes"
864 EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing"
867 dnl Check for -gstabs+ option
868 AC_CACHE_CHECK([for gcc -gstabs+ support], ac_cv_c_gcc_gstabs,
869 [WINE_TRY_CFLAGS([-gstabs+],ac_cv_c_gcc_gstabs="yes", ac_cv_c_gcc_gstabs="no")])
870 if test "$ac_cv_c_gcc_gstabs" = "yes"
872 EXTRACFLAGS="$EXTRACFLAGS -gstabs+"
875 dnl Check for noisy string.h
876 saved_CFLAGS="$CFLAGS"
877 CFLAGS="$CFLAGS -Wpointer-arith -Werror"
878 AC_CACHE_CHECK([for broken string.h that generates warnings], ac_cv_c_string_h_warnings,
879 AC_TRY_COMPILE([#include <string.h>],[],
880 [ac_cv_c_string_h_warnings=no],[ac_cv_c_string_h_warnings=yes]))
881 CFLAGS="$saved_CFLAGS"
882 if test "$ac_cv_c_string_h_warnings" = "no"
884 EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith"
888 dnl **** Check how to define a function in assembly code ****
890 AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,
892 ["\t.globl _ac_test\n\t.def _ac_test; .scl 2; .type 32; .endef\n_ac_test:\t.long 0"],,,
893 ac_cv_asm_func_def=".def",
894 [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,@function\n_ac_test:\t.long 0"],,,
895 ac_cv_asm_func_def=".type @function",
896 [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,2\n_ac_test:\t.long 0"],,,
897 ac_cv_asm_func_def=".type 2",
898 ac_cv_asm_func_def="unknown")])]))
900 AH_TEMPLATE(__ASM_FUNC,[Define to a macro to generate an assembly function directive])
901 case "$ac_cv_asm_func_def" in
903 AC_DEFINE([__ASM_FUNC(name)], [".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"]) ;;
905 AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",@function"]) ;;
907 AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",2"]) ;;
909 AC_DEFINE([__ASM_FUNC(name)], [""]) ;;
912 dnl **** Check for underscore on external symbols ****
914 AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_extern_prefix,
915 WINE_TRY_ASM_LINK([".globl _ac_test\n_ac_test:\t.long 0"],
916 [extern int ac_test;],
917 [if (ac_test) return 1],
918 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no"))
920 AH_TEMPLATE(__ASM_NAME,[Define to a macro to generate an assembly name from a C symbol])
921 if test "$ac_cv_c_extern_prefix" = "yes"
923 AC_DEFINE([__ASM_NAME(name)], ["_" name])
925 AC_DEFINE([__ASM_NAME(name)], [name])
928 dnl **** Check how to do strings in assembler ****
930 AC_CACHE_CHECK([for assembler keyword for ASCII strings], ac_cv_c_asm_string,
931 WINE_TRY_ASM_LINK([".data\\n\\t.string \\"test\\"\\n\\t.text"],,,ac_cv_c_asm_string=".string",
932 WINE_TRY_ASM_LINK([".data\\n\\t.asciz \\"test\\"\\n\\t.text"],,,ac_cv_c_asm_string=".asciz",
933 WINE_TRY_ASM_LINK([".data\\n\\t.ascii \\"test\\"\\n\\t.text"],,,ac_cv_c_asm_string=".ascii",
934 AC_MSG_ERROR([could not discover how to produce C strings with assembler.])))))
936 AC_DEFINE_UNQUOTED(__ASM_STRING, ["$ac_cv_c_asm_string"],
937 [Define to the assembler keyword used to specify an ASCII string])
939 dnl **** Check for .short in assembler ****
941 AC_CACHE_CHECK([for assembler keyword for word values], ac_cv_c_asm_short,
942 WINE_TRY_ASM_LINK([".data\\n\\t.short 1\\n\\t.text"],,,ac_cv_c_asm_short=".short",
943 WINE_TRY_ASM_LINK([".data\\n\\t.half 1\\n\\t.text"],,,ac_cv_c_asm_short=".half",
944 AC_MSG_ERROR([could not discover how to specify word values with assembler.]))))
946 AC_DEFINE_UNQUOTED(__ASM_SHORT, ["$ac_cv_c_asm_short"],
947 [Define to the assembler keyword used to specify a word value])
949 dnl **** Check for .size in assembler ****
951 AC_CACHE_CHECK([for .size in assembler], ac_cv_c_asm_size,
952 WINE_TRY_ASM_LINK([".globl _ac_test\n.size _ac_test, . - _ac_test"],,,
953 ac_cv_c_asm_size="yes",ac_cv_c_asm_size="no"))
955 if test "$ac_cv_c_asm_size" = "yes"
957 AC_DEFINE(HAVE_ASM_DOT_SIZE, 1, [Define if the assembler keyword .size is accepted])
960 dnl **** Check for working dll ****
963 AC_SUBST(DLLFLAGS,"-D_REENTRANT")
965 AC_SUBST(LDSHARED,"")
966 AC_SUBST(LDDLLFLAGS,"")
967 AC_SUBST(LIBEXT,"so")
968 AC_SUBST(IMPLIBEXT,"def")
972 AC_CHECK_TOOL(DLLTOOL,dlltool,false)
973 AC_CHECK_TOOL(DLLWRAP,dllwrap,false)
974 if test "$DLLWRAP" = "false"; then
977 dnl FIXME - check whether dllwrap works correctly...
981 dnl We can't build 16-bit NE dlls
986 AC_CHECK_HEADERS(dlfcn.h,
987 [AC_CHECK_FUNCS(dlopen,,
988 [AC_CHECK_LIB(dl,dlopen,
989 [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
994 if test "$LIBEXT" = "so"
996 DLLFLAGS="$DLLFLAGS -fPIC"
998 AC_CACHE_CHECK([whether we can build a GNU style ELF dll], ac_cv_c_dll_gnuelf,
999 [WINE_TRY_SHLIB_FLAGS([-fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic],
1000 ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")])
1001 if test "$ac_cv_c_dll_gnuelf" = "yes"
1003 LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
1004 LDDLLFLAGS="-shared -Wl,-Bsymbolic"
1005 AC_CACHE_CHECK([whether the linker accepts -z defs], ac_cv_c_dll_zdefs,
1006 [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs],
1007 ac_cv_c_dll_zdefs="yes",ac_cv_c_dll_zdefs="no")])
1008 if test "$ac_cv_c_dll_zdefs" = "yes"
1010 LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
1013 AC_CACHE_CHECK([whether the linker accepts -init and -fini], ac_cv_c_dll_init_fini,
1014 [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini],
1015 ac_cv_c_dll_init_fini="yes",ac_cv_c_dll_init_fini="no")])
1016 if test "$ac_cv_c_dll_init_fini" = "yes"
1018 LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"
1021 AC_CACHE_CHECK([whether the linker accepts version scripts], ac_cv_c_ld_version_scripts,
1022 [echo '{ global: *; };' >conftest.map
1023 WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map],
1024 ac_cv_c_ld_version_scripts="yes",ac_cv_c_ld_version_scripts="no")
1025 rm -f conftest.map])
1026 if test "$ac_cv_c_ld_version_scripts" = "yes"
1028 LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"
1031 AC_CACHE_CHECK([whether the linker accepts --export-dynamic], ac_cv_c_export_dynamic,
1032 [WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
1033 ac_cv_c_export_dynamic="yes",ac_cv_c_export_dynamic="no")])
1034 if test "$ac_cv_c_export_dynamic" = "yes"
1036 AC_SUBST(LDEXECFLAGS,["-Wl,--export-dynamic"])
1041 AC_CACHE_CHECK([whether we can relocate the executable to 0x77f00000], ac_cv_ld_reloc_exec,
1042 [WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x77f00400],
1043 ac_cv_ld_reloc_exec="yes", ac_cv_ld_reloc_exec="no")])
1044 if test "$ac_cv_ld_reloc_exec" = "yes"
1046 LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x77f00400"
1052 AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll, ac_cv_c_dll_unixware,
1053 [WINE_TRY_SHLIB_FLAGS([-fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic],
1054 ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")])
1055 if test "$ac_cv_c_dll_unixware" = "yes"
1057 LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
1058 LDDLLFLAGS="-Wl,-G,-B,symbolic"
1061 AC_CACHE_CHECK(whether we can build a Mach-O (Mac OS X/Darwin) dll, ac_cv_c_dll_macho,
1062 [WINE_TRY_SHLIB_FLAGS([-bundle], ac_cv_c_dll_macho="yes", ac_cv_c_dll_macho="no")])
1063 if test "$ac_cv_c_dll_macho" = "yes"
1066 LDDLLFLAGS="-bundle -flat_namespace -undefined suppress"
1067 LDSHARED="\$(CC) -dynamiclib"
1068 CFLAGS="$CFLAGS -ffixed-r13 -no-cpp-precomp"
1069 STRIP="$STRIP -u -r"
1070 dnl Relocate wine executable
1071 AC_SUBST(LDEXECFLAGS,"-seg1addr 0x120000")
1072 dnl Relocate libwine.dyld too
1073 AC_SUBST(LDLIBWINEFLAGS,"-seg1addr 0x140000")
1074 dnl declare needed frameworks
1075 AC_SUBST(COREFOUNDATIONLIB,"-framework CoreFoundation")
1076 AC_SUBST(IOKITLIB,"-framework IOKit")
1077 dnl using IOKit imply we use CoreFoundation too
1078 IOKITLIB = "$IOKITLIB $COREFOUNDATIONLIB"
1080 AC_CACHE_CHECK(whether we can build an HP-UX dll, ac_cv_c_dll_hpux,
1081 [WINE_TRY_SHLIB_FLAGS([-shared], ac_cv_c_dll_hpux="yes", ac_cv_c_dll_hpux="no")])
1082 if test "$ac_cv_c_dll_hpux" = "yes"
1086 LDDLLFLAGS="-shared -fPIC"
1087 LDSHARED="\$(CC) -shared"
1094 dnl Check for cross compiler to build test programs
1095 AC_SUBST(CROSSTEST,"")
1096 if test "$cross_compiling" = "no"
1098 AC_CHECK_PROGS(CROSSCC,i586-mingw32msvc-gcc i386-mingw32msvc-gcc i386-mingw32-gcc mingw-gcc,false)
1099 AC_CHECK_PROGS(DLLTOOL,i586-mingw32msvc-dlltool i386-mingw32msvc-dlltool i386-mingw32-dlltool mingw-dlltool,false)
1100 AC_CHECK_PROGS(CROSSWINDRES,i586-mingw32msvc-windres i386-mingw32msvc-windres i386-mingw32-windres mingw-windres,false)
1101 if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi
1106 if test "$LIBEXT" = "a"; then
1108 [could not find a way to build shared libraries.
1109 It is currently not possible to build Wine without shared library
1110 (.so) support to allow transparent switch between .so and .dll files.
1111 If you are using Linux, you will need a newer binutils.]
1117 AC_SUBST(LDPATH,"PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$PATH\"") ;;
1119 AC_SUBST(LDPATH,"DYLD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$DYLD_LIBRARY_PATH\"") ;;
1121 AC_SUBST(LDPATH,"LD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$LD_LIBRARY_PATH\"") ;;
1124 dnl Mingw needs explicit msvcrt for linking libwine and winsock for wininet
1127 AC_SUBST(CRTLIBS,"-lmsvcrt")
1128 AC_SUBST(SOCKETLIBS,"-lws2_32")
1135 *i[[3456789]]86*) AC_SUBST(WINE_BINARIES,"wine-glibc wine-kthread wine-pthread wine-preloader") ;;
1136 *) AC_SUBST(WINE_BINARIES,"wine-glibc wine-kthread wine-pthread") ;;
1138 AC_SUBST(MAIN_BINARY,"wine-glibc")
1141 AC_SUBST(WINE_BINARIES,"wine-pthread")
1142 AC_SUBST(MAIN_BINARY,"wine-pthread")
1145 AC_SUBST(WINE_BINARIES,"wine-kthread")
1146 AC_SUBST(MAIN_BINARY,"wine-kthread")
1150 dnl **** Get the soname for libraries that we load dynamically ****
1152 if test "$LIBEXT" = "so" -o "$LIBEXT" = "dylib"
1154 WINE_GET_SONAME(X11,XCreateWindow,[$X_LIBS $X_EXTRA_LIBS])
1155 WINE_GET_SONAME(Xext,XextCreateExtension,[$X_LIBS -lX11 $X_EXTRA_LIBS])
1156 WINE_GET_SONAME(Xi,XOpenDevice,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1157 WINE_GET_SONAME(Xrender,XRenderQueryExtension,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1158 WINE_GET_SONAME(Xrandr,XRRQueryExtension,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1159 WINE_GET_SONAME(freetype,FT_Init_FreeType,[$X_LIBS])
1160 WINE_GET_SONAME(GL,glXQueryExtension,[$X_LIBS $X_EXTRA_LIBS])
1161 WINE_GET_SONAME(txc_dxtn,fetch_2d_texel_rgba_dxt1)
1162 WINE_GET_SONAME(cups,cupsGetDefault)
1163 WINE_GET_SONAME(jack,jack_client_new)
1164 WINE_GET_SONAME(fontconfig,FcInit)
1165 WINE_GET_SONAME(ssl,SSL_library_init)
1166 WINE_GET_SONAME(crypto,BIO_new_socket)
1167 WINE_GET_SONAME(ncurses,waddch)
1168 WINE_GET_SONAME(curses,waddch)
1169 WINE_GET_SONAME(jpeg,jpeg_start_decompress)
1170 WINE_GET_SONAME(ungif,DGifOpen)
1171 WINE_GET_SONAME(gif,DGifOpen)
1172 WINE_GET_SONAME(lcms,cmsOpenProfileFromFile)
1176 dnl **** Check for functions ****
1244 dnl **** Checks for headers that depend on other ones ****
1246 AC_CHECK_HEADERS(sys/mount.h sys/user.h,,,
1247 [#include <sys/types.h>
1248 #if HAVE_SYS_PARAM_H
1249 # include <sys/param.h>
1252 AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h net/route.h],,,
1253 [#include <sys/types.h>
1254 #if HAVE_SYS_SOCKET_H
1255 # include <sys/socket.h>
1258 AC_CHECK_HEADERS([resolv.h],,,
1259 [#include <sys/types.h>
1260 #if HAVE_SYS_SOCKET_H
1261 # include <sys/socket.h>
1263 #if HAVE_NETINET_IN_H
1264 # include <netinet/in.h>
1266 #if HAVE_ARPA_NAMESER_H
1267 # include <arpa/nameser.h>
1270 AC_CHECK_HEADERS(netinet/ip.h,,,
1271 [#include <sys/types.h>
1272 #if HAVE_SYS_SOCKET_H
1273 # include <sys/socket.h>
1275 #if HAVE_NETINET_IN_SYSTM_H
1276 # include <netinet/in_systm.h>
1279 AC_CHECK_HEADERS(ucontext.h,,,[#include <signal.h>])
1281 dnl **** Check for IPX headers (currently Linux only) ****
1283 AC_CACHE_CHECK([for GNU style IPX support], ac_cv_c_ipx_gnu,
1285 [#include <sys/types.h>
1286 #ifdef HAVE_SYS_SOCKET_H
1287 # include <sys/socket.h>
1289 #include <netipx/ipx.h>],
1290 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
1291 [ac_cv_c_ipx_gnu="yes"],
1292 [ac_cv_c_ipx_gnu="no"])
1294 if test "$ac_cv_c_ipx_gnu" = "yes"
1296 AC_DEFINE(HAVE_IPX_GNU, 1, [Define if IPX should use netipx/ipx.h from libc])
1299 if test "$ac_cv_c_ipx_gnu" = "no"
1301 AC_CACHE_CHECK([for linux style IPX support], ac_cv_c_ipx_linux,
1303 [#include <sys/types.h>
1304 #ifdef HAVE_SYS_SOCKET_H
1305 # include <sys/socket.h>
1307 #include <asm/types.h>
1308 #include <linux/ipx.h>],
1309 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
1310 [ac_cv_c_ipx_linux="yes"],
1311 [ac_cv_c_ipx_linux="no"])
1313 if test "$ac_cv_c_ipx_linux" = "yes"
1315 AC_DEFINE(HAVE_IPX_LINUX, 1, [Define if IPX includes are taken from Linux kernel])
1319 dnl **** Check for types ****
1323 AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t, long long, fsblkcnt_t, fsfilcnt_t])
1325 AC_CACHE_CHECK([whether linux/input.h is for real],
1326 wine_cv_linux_input_h,
1328 #include <linux/input.h>
1330 int foo = EVIOCGBIT(EV_ABS,42);
1331 int bar = BTN_PINKIE;
1334 wine_cv_linux_input_h=yes,
1335 wine_cv_linux_input_h=no,
1339 if test "$wine_cv_linux_input_h" = "yes"
1341 AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H, 1,
1342 [Define if we have linux/input.h AND it contains the INPUT event API])
1346 AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
1347 wine_cv_linux_gethostbyname_r_6,
1353 struct hostent *result;
1360 res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
1361 res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
1363 wine_cv_linux_gethostbyname_r_6=yes,
1364 wine_cv_linux_gethostbyname_r_6=no
1367 if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
1369 AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6, 1,
1370 [Define if Linux-style gethostbyname_r and gethostbyaddr_r are available])
1373 if test "$ac_cv_header_linux_joystick_h" = "yes"
1375 AC_CACHE_CHECK([whether linux/joystick.h uses the Linux 2.2+ API],
1376 wine_cv_linux_joystick_22_api,
1378 #include <sys/ioctl.h>
1379 #include <linux/joystick.h>
1381 struct js_event blub;
1382 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
1383 #error "no 2.2 header"
1386 wine_cv_linux_joystick_22_api=yes,
1387 wine_cv_linux_joystick_22_api=no,
1388 wine_cv_linux_joystick_22_api=no
1391 if test "$wine_cv_linux_joystick_22_api" = "yes"
1393 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API, 1,
1394 [Define if <linux/joystick.h> defines the Linux 2.2 joystick API])
1398 dnl **** statfs checks ****
1400 if test "$ac_cv_header_sys_vfs_h" = "yes"
1402 AC_CACHE_CHECK( [whether sys/vfs.h defines statfs],
1403 wine_cv_sys_vfs_has_statfs,
1405 #include <sys/types.h>
1406 #ifdef HAVE_SYS_PARAM_H
1407 # include <sys/param.h>
1409 #include <sys/vfs.h>
1413 memset(&stfs,0,sizeof(stfs));
1414 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
1417 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
1419 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS, 1,
1420 [Define if the struct statfs is defined by <sys/vfs.h>])
1424 if test "$ac_cv_header_sys_statfs_h" = "yes"
1426 AC_CACHE_CHECK( [whether sys/statfs.h defines statfs],
1427 wine_cv_sys_statfs_has_statfs,
1429 #include <sys/types.h>
1430 #ifdef HAVE_SYS_PARAM_H
1431 # include <sys/param.h>
1433 #include <sys/statfs.h>
1436 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
1439 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
1441 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS, 1,
1442 [Define if the struct statfs is defined by <sys/statfs.h>])
1446 if test "$ac_cv_header_sys_mount_h" = "yes"
1448 AC_CACHE_CHECK( [whether sys/mount.h defines statfs],
1449 wine_cv_sys_mount_has_statfs,
1451 #include <sys/types.h>
1452 #ifdef HAVE_SYS_PARAM_H
1453 # include <sys/param.h>
1455 #include <sys/mount.h>
1458 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
1461 if test "$wine_cv_sys_mount_has_statfs" = "yes"
1463 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT, 1,
1464 [Define if the struct statfs is defined by <sys/mount.h>])
1468 dnl **** FIXME: what about mixed cases, where we need two of them? ***
1470 dnl Check for statfs members
1471 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],,,
1472 [#include <sys/types.h>
1473 #ifdef HAVE_SYS_PARAM_H
1474 # include <sys/param.h>
1476 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1477 # include <sys/mount.h>
1479 # ifdef STATFS_DEFINED_BY_SYS_VFS
1480 # include <sys/vfs.h>
1482 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1483 # include <sys/statfs.h>
1488 AC_CHECK_MEMBERS([struct statvfs.f_blocks],,,
1489 [#ifdef HAVE_SYS_STATVFS_H
1490 #include <sys/statvfs.h>
1493 dnl Check for socket structure members
1494 AC_CHECK_MEMBERS([struct msghdr.msg_accrights, struct sockaddr.sa_len, struct sockaddr_un.sun_len],,,
1495 [#include <sys/types.h>
1496 #ifdef HAVE_SYS_SOCKET_H
1497 # include <sys/socket.h>
1499 #ifdef HAVE_SYS_UN_H
1500 # include <sys/un.h>
1503 dnl Check for siginfo_t members
1504 AC_CHECK_MEMBERS([siginfo_t.si_fd],,,[#include <signal.h>])
1506 dnl Check for struct option
1507 AC_CHECK_MEMBERS([struct option.name],,,
1508 [#ifdef HAVE_GETOPT_H
1512 dnl Check for stat.st_blocks
1513 AC_CHECK_MEMBERS([struct stat.st_blocks])
1515 dnl *** check for the need to define platform-specific symbols
1518 *i[[3456789]]86*) WINE_CHECK_DEFINE([__i386__]) ;;
1519 *alpha*) WINE_CHECK_DEFINE([__ALPHA__]) ;;
1520 *sparc*) WINE_CHECK_DEFINE([__sparc__]) ;;
1521 *powerpc*) WINE_CHECK_DEFINE([__powerpc__]) ;;
1524 case $host_vendor in
1525 *sun*) WINE_CHECK_DEFINE([__sun__]) ;;
1528 dnl **** Generate output files ****
1530 AH_TOP([#define __WINE_CONFIG_H])
1532 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/d3ddevice)
1533 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dclipper)
1534 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/ddraw)
1535 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/direct3d)
1536 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dpalette)
1537 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dsurface)
1538 WINE_CONFIG_EXTRA_DIR(dlls/gdi/enhmfdrv)
1539 WINE_CONFIG_EXTRA_DIR(dlls/gdi/mfdrv)
1540 WINE_CONFIG_EXTRA_DIR(dlls/kernel/messages)
1541 WINE_CONFIG_EXTRA_DIR(dlls/user/dde)
1542 WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
1543 WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
1544 WINE_CONFIG_EXTRA_DIR(include/wine)
1545 WINE_CONFIG_EXTRA_DIR(misc)
1546 WINE_CONFIG_EXTRA_DIR(programs/regedit/tests)
1547 WINE_CONFIG_EXTRA_DIR(windows)
1549 MAKE_RULES=Make.rules
1550 AC_SUBST_FILE(MAKE_RULES)
1552 MAKE_DLL_RULES=dlls/Makedll.rules
1553 AC_SUBST_FILE(MAKE_DLL_RULES)
1555 MAKE_TEST_RULES=dlls/Maketest.rules
1556 AC_SUBST_FILE(MAKE_TEST_RULES)
1558 MAKE_LIB_RULES=libs/Makelib.rules
1559 AC_SUBST_FILE(MAKE_LIB_RULES)
1561 MAKE_PROG_RULES=programs/Makeprog.rules
1562 AC_SUBST_FILE(MAKE_PROG_RULES)
1569 programs/Makeprog.rules
1572 dlls/advapi32/Makefile
1573 dlls/advapi32/tests/Makefile
1574 dlls/advpack/Makefile
1575 dlls/amstream/Makefile
1577 dlls/avicap32/Makefile
1578 dlls/avifil32/Makefile
1579 dlls/cabinet/Makefile
1580 dlls/capi2032/Makefile
1582 dlls/cfgmgr32/Makefile
1583 dlls/comcat/Makefile
1584 dlls/comctl32/Makefile
1585 dlls/comctl32/tests/Makefile
1586 dlls/commdlg/Makefile
1587 dlls/crtdll/Makefile
1588 dlls/crypt32/Makefile
1595 dlls/d3dxof/Makefile
1596 dlls/dbghelp/Makefile
1597 dlls/dciman32/Makefile
1599 dlls/ddraw/tests/Makefile
1600 dlls/devenum/Makefile
1601 dlls/dinput/Makefile
1602 dlls/dinput8/Makefile
1603 dlls/dmband/Makefile
1604 dlls/dmcompos/Makefile
1606 dlls/dmloader/Makefile
1607 dlls/dmscript/Makefile
1608 dlls/dmstyle/Makefile
1609 dlls/dmsynth/Makefile
1610 dlls/dmusic/Makefile
1611 dlls/dmusic32/Makefile
1613 dlls/dplayx/Makefile
1615 dlls/dpnhpast/Makefile
1616 dlls/dsound/Makefile
1617 dlls/dsound/tests/Makefile
1618 dlls/dswave/Makefile
1619 dlls/dxdiagn/Makefile
1620 dlls/dxerr8/Makefile
1621 dlls/dxerr9/Makefile
1622 dlls/dxguid/Makefile
1624 dlls/gdi/tests/Makefile
1626 dlls/glut32/Makefile
1627 dlls/hhctrl.ocx/Makefile
1628 dlls/iccvid/Makefile
1630 dlls/ifsmgr.vxd/Makefile
1631 dlls/imagehlp/Makefile
1633 dlls/iphlpapi/Makefile
1634 dlls/iphlpapi/tests/Makefile
1636 dlls/kernel/Makefile
1637 dlls/kernel/tests/Makefile
1638 dlls/lzexpand/Makefile
1639 dlls/mapi32/Makefile
1640 dlls/mapi32/tests/Makefile
1642 dlls/mlang/tests/Makefile
1643 dlls/mmdevldr.vxd/Makefile
1644 dlls/monodebg.vxd/Makefile
1647 dlls/msacm/imaadp32/Makefile
1648 dlls/msacm/msadp32/Makefile
1649 dlls/msacm/msg711/Makefile
1650 dlls/msacm/winemp3/Makefile
1651 dlls/msacm/tests/Makefile
1653 dlls/mscms/tests/Makefile
1655 dlls/mshtml/Makefile
1657 dlls/msimg32/Makefile
1658 dlls/msisys/Makefile
1659 dlls/msnet32/Makefile
1660 dlls/msrle32/Makefile
1661 dlls/msvcrt/Makefile
1662 dlls/msvcrt/tests/Makefile
1663 dlls/msvcrt20/Makefile
1664 dlls/msvcrt40/Makefile
1665 dlls/msvcrtd/Makefile
1666 dlls/msvcrtd/tests/Makefile
1667 dlls/msvidc32/Makefile
1668 dlls/msvideo/Makefile
1669 dlls/mswsock/Makefile
1670 dlls/netapi32/Makefile
1671 dlls/netapi32/tests/Makefile
1672 dlls/newdev/Makefile
1674 dlls/ntdll/tests/Makefile
1675 dlls/odbc32/Makefile
1677 dlls/ole32/tests/Makefile
1678 dlls/oleacc/Makefile
1679 dlls/oleaut32/Makefile
1680 dlls/oleaut32/tests/Makefile
1681 dlls/olecli/Makefile
1682 dlls/oledlg/Makefile
1683 dlls/olepro32/Makefile
1684 dlls/olesvr/Makefile
1685 dlls/opengl32/Makefile
1687 dlls/psapi/tests/Makefile
1689 dlls/quartz/Makefile
1690 dlls/quartz/tests/Makefile
1691 dlls/rasapi32/Makefile
1692 dlls/richedit/Makefile
1693 dlls/rpcrt4/Makefile
1694 dlls/rpcrt4/tests/Makefile
1695 dlls/rsabase/Makefile
1696 dlls/rsabase/tests/Makefile
1697 dlls/rsaenh/Makefile
1698 dlls/rsaenh/tests/Makefile
1699 dlls/secur32/Makefile
1700 dlls/serialui/Makefile
1701 dlls/setupapi/Makefile
1702 dlls/shdocvw/Makefile
1703 dlls/shell32/Makefile
1704 dlls/shell32/tests/Makefile
1705 dlls/shfolder/Makefile
1706 dlls/shlwapi/Makefile
1707 dlls/shlwapi/tests/Makefile
1708 dlls/snmpapi/Makefile
1710 dlls/strmiids/Makefile
1711 dlls/tapi32/Makefile
1712 dlls/ttydrv/Makefile
1714 dlls/unicows/Makefile
1716 dlls/urlmon/Makefile
1717 dlls/urlmon/tests/Makefile
1719 dlls/user/tests/Makefile
1721 dlls/uxtheme/Makefile
1722 dlls/vdhcp.vxd/Makefile
1723 dlls/vdmdbg/Makefile
1724 dlls/version/Makefile
1725 dlls/version/tests/Makefile
1726 dlls/vmm.vxd/Makefile
1727 dlls/vnbt.vxd/Makefile
1728 dlls/vnetbios.vxd/Makefile
1729 dlls/vtdapi.vxd/Makefile
1730 dlls/vwin32.vxd/Makefile
1731 dlls/win32s/Makefile
1732 dlls/winaspi/Makefile
1733 dlls/wined3d/Makefile
1734 dlls/winedos/Makefile
1735 dlls/wineps/Makefile
1736 dlls/wininet/Makefile
1737 dlls/wininet/tests/Makefile
1739 dlls/winmm/joystick/Makefile
1740 dlls/winmm/mcianim/Makefile
1741 dlls/winmm/mciavi/Makefile
1742 dlls/winmm/mcicda/Makefile
1743 dlls/winmm/mciseq/Makefile
1744 dlls/winmm/mciwave/Makefile
1745 dlls/winmm/midimap/Makefile
1746 dlls/winmm/tests/Makefile
1747 dlls/winmm/wavemap/Makefile
1748 dlls/winmm/winealsa/Makefile
1749 dlls/winmm/winearts/Makefile
1750 dlls/winmm/wineaudioio/Makefile
1751 dlls/winmm/winejack/Makefile
1752 dlls/winmm/winenas/Makefile
1753 dlls/winmm/wineoss/Makefile
1754 dlls/winnls/Makefile
1755 dlls/winsock/Makefile
1756 dlls/winsock/tests/Makefile
1757 dlls/winspool/Makefile
1758 dlls/winspool/tests/Makefile
1759 dlls/wintab32/Makefile
1760 dlls/wintrust/Makefile
1762 dlls/wsock32/Makefile
1763 dlls/x11drv/Makefile
1764 documentation/Makefile
1769 libs/unicode/Makefile
1774 programs/avitools/Makefile
1775 programs/clock/Makefile
1776 programs/cmdlgtst/Makefile
1777 programs/control/Makefile
1778 programs/expand/Makefile
1779 programs/msiexec/Makefile
1780 programs/notepad/Makefile
1781 programs/progman/Makefile
1782 programs/regedit/Makefile
1783 programs/regsvr32/Makefile
1784 programs/rpcss/Makefile
1785 programs/rundll32/Makefile
1786 programs/start/Makefile
1787 programs/taskmgr/Makefile
1788 programs/uninstaller/Makefile
1789 programs/view/Makefile
1790 programs/wcmd/Makefile
1791 programs/wineboot/Makefile
1792 programs/winebrowser/Makefile
1793 programs/winecfg/Makefile
1794 programs/wineconsole/Makefile
1795 programs/winedbg/Makefile
1796 programs/winefile/Makefile
1797 programs/winemenubuilder/Makefile
1798 programs/winemine/Makefile
1799 programs/winepath/Makefile
1800 programs/winetest/Makefile
1801 programs/winevdm/Makefile
1802 programs/winhelp/Makefile
1803 programs/winver/Makefile
1807 tools/winapi/Makefile
1808 tools/winebuild/Makefile
1809 tools/winedump/Makefile
1810 tools/winegcc/Makefile
1812 tools/wrc/Makefile])
1816 if test "$have_x" = "no"
1819 echo "*** Warning: X development files not found. Wine will be built without"
1820 echo "*** X support, which currently does not work, and would probably not be"
1821 echo "*** what you want anyway. You will need to install devel packages of"
1822 echo "*** Xlib/Xfree86 at the very least."
1825 if test "$wine_cv_opengl_version_OK" = "no"
1828 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1829 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1832 if test "$wine_cv_msg_freetype" = "yes"
1835 echo "*** Note: Your system appears to have the FreeType 2 runtime libraries"
1836 echo "*** installed, but 'freetype-config' is not in your PATH. Install the"
1837 echo "*** freetype-devel package (or its equivalent on your distribution) to"
1838 echo "*** enable Wine to use TrueType fonts."
1842 echo "Configure finished. Do '${ac_make} depend && ${ac_make}' to compile Wine."
1845 dnl Local Variables:
1846 dnl comment-start: "dnl "
1848 dnl comment-start-skip: "\\bdnl\\b\\s *"
1849 dnl compile-command: "autoconf"