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 \
266 dnl **** Check for X11 ****
268 if test "$have_x" = "yes"
271 ac_save_CPPFLAGS="$CPPFLAGS"
272 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
274 dnl *** All of the following tests require X11/Xlib.h
275 AC_CHECK_HEADERS(X11/Xlib.h,
277 AC_CHECK_HEADERS([X11/XKBlib.h \
279 X11/extensions/shape.h \
280 X11/extensions/XInput.h \
281 X11/extensions/XShm.h \
282 X11/extensions/Xrandr.h \
283 X11/extensions/Xrender.h \
284 X11/extensions/Xvlib.h \
285 X11/extensions/xf86dga.h \
286 X11/extensions/xf86vmode.h],,,
287 [#include <X11/Xlib.h>
288 #ifdef HAVE_X11_XUTIL_H
289 # include <X11/Xutil.h>
292 dnl *** Check for X keyboard extension
293 if test "$ac_cv_header_X11_XKBlib_h" = "yes"
295 AC_CHECK_LIB(X11, XkbQueryExtension,
296 AC_DEFINE(HAVE_XKB, 1, [Define if you have the XKB extension]),,
297 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
300 dnl *** Check for X Shm extension
301 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes"
303 AC_CHECK_LIB(Xext, XShmQueryExtension,
304 AC_DEFINE(HAVE_LIBXXSHM, 1, [Define if you have the X Shm extension]),,
305 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
308 dnl *** Check for X shape extension
309 if test "$ac_cv_header_X11_extensions_shape_h" = "yes"
311 AC_CHECK_LIB(Xext,XShapeQueryExtension,
312 AC_DEFINE(HAVE_LIBXSHAPE, 1, [Define if you have the X Shape extension]),,
313 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
316 dnl *** Check for XFree86 DGA / DGA 2.0 extension
317 if test "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
319 AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
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 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
327 dnl *** Check for XFree86 VMODE extension
328 if test "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
330 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
331 [ AC_DEFINE(HAVE_LIBXXF86VM, 1, [Define if you have the Xxf86vm library])
332 X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
334 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
337 dnl *** Check for X RandR extension
338 if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes"
340 AC_TRY_COMPILE([#include <X11/Xlib.h>
341 #include <X11/extensions/Xrandr.h>],[static typeof(XRRSetScreenConfigAndRate) * func;],
342 [AC_DEFINE(HAVE_LIBXRANDR, 1, [Define if you have the Xrandr library])])
345 dnl *** Check for XVideo extension supporting XvImages
346 if test "$ac_cv_header_X11_extensions_Xvlib_h" = "yes"
348 AC_CHECK_LIB(Xv, XvShmCreateImage,
349 [ AC_DEFINE(HAVE_XVIDEO, 1, [Define if the X libraries support XVideo])
350 X_PRE_LIBS="$X_PRE_LIBS -lXv"
352 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
355 dnl *** Check for Transform functions in Xrender
356 if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes"
358 AC_CHECK_LIB(Xrender, XRenderSetPictureTransform,
359 [AC_DEFINE(HAVE_XRENDERSETPICTURETRANSFORM, 1,
360 [Define if Xrender has the XRenderSetPictureTransform function])],,
361 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
364 ) dnl *** End of X11/Xlib.h check
366 dnl Check for the presence of OpenGL
367 if test "x$with_opengl" != "xno"
369 if test -f /usr/X11R6/lib/libGL.a -a ! -f /usr/X11R6/lib/libGL.so
371 AC_MSG_ERROR([/usr/X11R6/lib/libGL.a is present on your system.
372 This prevents linking to OpenGL. Delete the file and restart configure.])
375 AC_CHECK_HEADERS(GL/gl.h GL/glx.h)
376 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
378 AC_CHECK_HEADERS(GL/glext.h,,,[#include <GL/glx.h>])
379 dnl Check for some problems due to old Mesa versions
380 AC_CACHE_CHECK([for up-to-date OpenGL version], wine_cv_opengl_version_OK,
382 [#include <GL/gl.h>],
383 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
384 [wine_cv_opengl_version_OK="yes"],
385 [wine_cv_opengl_version_OK="no"]
389 if test "$wine_cv_opengl_version_OK" = "yes"
391 dnl Check for the presence of the library
392 AC_CHECK_LIB(GL,glXCreateContext,
395 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
397 if test "$ac_cv_lib_GL_glXCreateContext" = "yes"
399 OPENGLFILES='$(OPENGLFILES)'
400 AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is present on the system])
402 AC_CHECK_LIB(GL,glXGetProcAddressARB,
403 AC_DEFINE(HAVE_GLX_GETPROCADDRESS, 1,
404 [Define if the OpenGL library supports the glXGetProcAddressARB call]),,
405 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
407 if test "$ac_cv_lib_GL_glXGetProcAddressARB" = "yes"
409 AC_CACHE_CHECK([for OpenGL extension functions prototypes], wine_cv_extension_prototypes,
410 [AC_TRY_COMPILE([#include <GL/gl.h>
411 #ifdef HAVE_GL_GLEXT_H
412 # include <GL/glext.h>
415 [PFNGLCOLORTABLEEXTPROC test_proc;],
416 [wine_cv_extension_prototypes="yes"],
417 [wine_cv_extension_prototypes="no"]
420 if test "$wine_cv_extension_prototypes" = "yes"
422 AC_DEFINE(HAVE_GLEXT_PROTOTYPES, 1,
423 [Define if the OpenGL headers define extension typedefs])
428 dnl Check for GLU32 library.
429 AC_CHECK_LIB(GLU,gluLookAt,
430 [OPENGL_LIBS="$OPENGL_LIBS -lGLU"
431 GLU32FILES='$(GLU32FILES)']
433 $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
437 dnl Check for glut32 library.
438 AC_CHECK_LIB(glut,glutMainLoop,
439 [AC_SUBST(GLUT_LIBS,"-lglut -lXmu -lXi")
440 AC_SUBST(GLUT32FILES,'$(GLUT32FILES)')],,
441 $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXmu -lXi -lX11 $X_EXTRA_LIBS)
445 dnl **** Check for NAS ****
447 AC_CHECK_HEADERS(audio/audiolib.h,
448 [AC_CHECK_HEADERS(audio/soundlib.h,,,[#include <audio/audiolib.h>])
449 AC_CHECK_LIB(audio,AuCreateFlow,
450 [AC_DEFINE(HAVE_NAS,1,[Define if you have NAS including devel headers])
451 NASLIBS="-laudio -lXt $X_LIBS -lXext -lX11 $X_EXTRA_LIBS"],,
452 [-lXt $X_LIBS -lXext -lX11 $X_EXTRA_LIBS])])
454 CPPFLAGS="$ac_save_CPPFLAGS"
462 dnl **** Check which curses lib to use ***
464 if test "x$with_curses" != "xno"
466 AC_CHECK_HEADERS(ncurses.h,
467 [AC_CHECK_LIB(ncurses,waddch,
468 [AC_DEFINE(HAVE_LIBNCURSES, 1, [Define if you have the ncurses library (-lncurses)])
469 CURSESLIBS="-lncurses"],
470 [AC_CHECK_HEADERS(curses.h,
471 [AC_CHECK_LIB(curses,waddch,
472 [AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have the curses library (-lcurses)])
473 CURSESLIBS="-lcurses"])])])])
475 LIBS="$CURSESLIBS $LIBS"
476 AC_CHECK_FUNCS(getbkgd resizeterm)
481 dnl **** Check for SANE ****
482 AC_CHECK_PROG(sane_devel,sane-config,sane-config,no)
483 if test "$sane_devel" = "no"
488 SANELIBS="`$sane_devel --libs`"
489 SANEINCL="`$sane_devel --cflags`"
490 ac_save_CPPFLAGS="$CPPFLAGS"
492 CPPFLAGS="$CPPFLAGS $SANEINCL"
493 LIBS="$LIBS $SANELIBS"
494 AC_CHECK_HEADER(sane/sane.h,
495 [AC_CHECK_LIB(sane,sane_open,
496 [AC_DEFINE(HAVE_SANE, 1, [Define if we have SANE development environment])],
502 CPPFLAGS="$ac_save_CPPFLAGS"
507 dnl **** Check for the ICU library ****
508 AC_CHECK_HEADERS(unicode/ubidi.h)
509 if test "$ac_cv_header_unicode_ubidi_h" = "yes"
512 ICU_LIB_DIR="${ICU_LIB_DIR-/usr/lib}"
513 ICUUC_LIB="${ICUUC_LIB-$ICU_LIB_DIR/libsicuuc.a}"
514 ICUDATA_LIB="${ICUDATA_LIB-$ICU_LIB_DIR/libsicudata.a}"
515 AC_MSG_CHECKING(whether can link with ICU libraries $ICUUC_LIB and $ICUDATA_LIB)
516 LIBS="$LIBS $ICUUC_LIB $ICUDATA_LIB -lstdc++ -lgcc_s"
517 AC_TRY_LINK([#include <unicode/ubidi.h>],[ubidi_open()],
518 [AC_DEFINE(HAVE_ICU,1,[Define to 1 if the ICU libraries are installed])
519 AC_SUBST(ICULIBS,"$ICUUC_LIB $ICUDATA_LIB -lstdc++ -lgcc_s")
525 dnl **** Check for FreeType 2 ****
526 AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$X_LIBS)
527 if test "$ft_lib" = "no"
531 wine_cv_msg_freetype=no
533 AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
534 if test "$ft_devel" = "no"
536 AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
537 if test "$ft_devel2" = "freetype2-config"
542 if test "$ft_devel" = "no"
546 wine_cv_msg_freetype=yes
548 FREETYPELIBS=`$ft_devel --libs`
549 FREETYPEINCL=`$ft_devel --cflags`
550 ac_save_CPPFLAGS="$CPPFLAGS"
551 CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
552 AC_CHECK_HEADERS(ft2build.h \
553 freetype/freetype.h \
555 freetype/tttables.h \
557 freetype/ftsnames.h \
558 freetype/ttnameid.h \
560 freetype/ftwinfnt.h \
561 freetype/internal/sfnt.h,,,
563 #include <ft2build.h>
565 AC_TRY_CPP([#include <ft2build.h>
566 #include <freetype/fttrigon.h>],
567 [AC_DEFINE(HAVE_FREETYPE_FTTRIGON_H, 1,
568 [Define if you have the <freetype/fttrigon.h> header file.])
569 wine_cv_fttrigon=yes],
571 CPPFLAGS="$ac_save_CPPFLAGS"
572 dnl Check that we have at least freetype/freetype.h
573 if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
575 AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
576 wine_cv_msg_freetype=no
580 wine_cv_msg_freetype=yes
584 AC_SUBST(FREETYPELIBS)
585 AC_SUBST(FREETYPEINCL)
587 dnl Only build the fonts dir if we have both freetype and fontforge
588 if test "$FONTFORGE" != "false" -a -n "$FREETYPELIBS"
590 AC_SUBST(FONTSSUBDIRS,"fonts")
593 dnl **** Check for parport (currently Linux only) ****
594 AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
596 [#include <linux/ppdev.h>],
597 [ioctl (1,PPCLAIM,0)],
598 [ac_cv_c_ppdev="yes"],
599 [ac_cv_c_ppdev="no"])
601 if test "$ac_cv_c_ppdev" = "yes"
603 AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev.h for parallel port access])
606 dnl **** Check for va_copy ****
607 AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy,
609 [#include <stdarg.h>],
613 [ac_cv_c_va_copy="yes"],
614 [ac_cv_c_va_copy="no"])
616 if test "$ac_cv_c_va_copy" = "yes"
618 AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
620 AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy,
622 [#include <stdarg.h>],
626 [ac_cv_c___va_copy="yes"],
627 [ac_cv_c___va_copy="no"])
629 if test "$ac_cv_c___va_copy" = "yes"
631 AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
634 dnl **** Check for sigsetjmp ****
635 AC_CACHE_CHECK([for sigsetjmp], ac_cv_c_sigsetjmp,
637 [#include <setjmp.h>],
640 siglongjmp( buf, 1 );],
641 [ac_cv_c_sigsetjmp="yes"],
642 [ac_cv_c_sigsetjmp="no"])
644 if test "$ac_cv_c_sigsetjmp" = "yes"
646 AC_DEFINE(HAVE_SIGSETJMP, 1, [Define to 1 if you have the sigsetjmp (and siglongjmp) function])
649 dnl **** Check for pthread_rwlock_t ****
650 AC_CHECK_TYPES([pthread_rwlock_t, pthread_rwlockattr_t],,,[#define _GNU_SOURCE
651 #include <pthread.h>])
653 dnl **** Check for pthread functions ****
655 LIBS="$LIBS $LIBPTHREAD"
658 pthread_get_stackaddr_np \
659 pthread_get_stacksize_np \
663 dnl **** Check for Open Sound System ****
664 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
666 AC_CACHE_CHECK([for Open Sound System],
667 ac_cv_c_opensoundsystem,
669 #if defined(HAVE_SYS_SOUNDCARD_H)
670 #include <sys/soundcard.h>
671 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
672 #include <machine/soundcard.h>
673 #elif defined(HAVE_SOUNDCARD_H)
674 #include <soundcard.h>
678 /* check for one of the Open Sound System specific SNDCTL_ defines */
679 #if !defined(SNDCTL_DSP_STEREO)
680 #error No open sound system
682 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
684 if test "$ac_cv_c_opensoundsystem" = "yes"
686 AC_DEFINE(HAVE_OSS, 1, [Define if you have the Open Sound system])
689 AC_CACHE_CHECK([for Open Sound System/MIDI interface],
690 ac_cv_c_opensoundsystem_midi,
692 #if defined(HAVE_SYS_SOUNDCARD_H)
693 #include <sys/soundcard.h>
694 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
695 #include <machine/soundcard.h>
696 #elif defined(HAVE_SOUNDCARD_H)
697 #include <soundcard.h>
701 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
702 #if !defined(SNDCTL_SEQ_SYNC)
703 #error No open sound system MIDI interface
705 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
707 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
709 AC_DEFINE(HAVE_OSS_MIDI, 1, [Define if you have the Open Sound system (MIDI interface)])
712 dnl **** Check for aRts Sound Server ****
713 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
714 if test x$ARTSCCONFIG != x -a x$ARTSCCONFIG != x'"$ARTSCCONFIG"';
717 for i in `$ARTSCCONFIG --cflags`
720 -I*) ARTSC_CFLAGS="$ARTSC_CFLAGS $i";;
723 ARTSC_LIBS=`$ARTSCCONFIG --libs`
724 save_CFLAGS="$CFLAGS"
725 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
726 AC_TRY_COMPILE([#include <artsc.h>],[arts_stream_t stream;],
727 [AC_SUBST(ARTSLIBS, $ARTSC_LIBS)
728 AC_SUBST(ARTSINCL, $ARTSC_CFLAGS)
729 AC_DEFINE(HAVE_ARTS, 1, [Define if you have ARTS sound server])])
730 CFLAGS="$save_CFLAGS"
733 dnl **** Check for ALSA ****
734 AC_SUBST(ALSALIBS,"")
735 AC_CHECK_HEADERS(alsa/asoundlib.h sys/asoundlib.h, break)
736 if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes"
738 AC_CHECK_LIB(asound,snd_pcm_open,
739 AC_DEFINE(HAVE_ALSA,1,[Define if you have ALSA including devel headers])
743 dnl **** Check for libaudioio (which can be used to get solaris audio support) ****
745 AC_SUBST(AUDIOIOLIBS,"")
746 AC_CHECK_HEADERS(libaudioio.h,
747 [AC_CHECK_LIB(audioio,AudioIOGetVersion,
748 [AUDIOIOLIBS="-laudioio"
749 AC_DEFINE(HAVE_LIBAUDIOIO, 1, [Define if you have libaudioIO])])])
751 dnl **** Check for capi4linux ****
753 AC_CHECK_HEADERS(capi20.h,[
754 AC_CHECK_HEADERS(linux/capi.h,[
755 AC_CHECK_LIB(capi20,capi20_register,[
756 AC_DEFINE(HAVE_CAPI4LINUX,1,[Define if you have capi4linux libs and headers])
757 AC_SUBST(CAPI4LINUXLIBS,"-lcapi20")
762 dnl **** Check for broken glibc mmap64 ****
764 AC_CACHE_CHECK( [whether mmap64 works defined as mmap], ac_cv_mmap64_works,
766 #define _FILE_OFFSET_BITS 64
770 #include <sys/mman.h>
773 int main(int argc,char **argv) {
774 int fd = open("conftest.map",O_CREAT|O_RDWR,0600);
775 if (fd == -1) exit(1);
777 unlink("conftest.map");
781 if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) &&
787 fprintf(stderr,"success!\n");
792 ac_cv_mmap64_works="yes",
793 ac_cv_mmap64_works="no",
794 ac_cv_mmap64_works="no") )
796 if test "$ac_cv_mmap64_works" = "yes"
798 AC_DEFINE(_FILE_OFFSET_BITS, 64, [Set this to 64 to enable 64-bit file support on Linux])
801 dnl **** Check for gcc specific options ****
803 AC_SUBST(EXTRACFLAGS,"")
804 if test "x${GCC}" = "xyes"
806 EXTRACFLAGS="-Wall -pipe"
808 dnl Check for strength-reduce bug
809 AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug,
811 int L[[4]] = {0,1,2,3};
813 static int Array[[3]];
816 for(i=0; i<B; i++) Array[[i]] = i - 3;
817 for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
820 exit( Array[[1]] != -2 || L[[2]] != 3);
822 ac_cv_c_gcc_strength_bug="no",
823 ac_cv_c_gcc_strength_bug="yes",
824 ac_cv_c_gcc_strength_bug="yes") )
825 if test "$ac_cv_c_gcc_strength_bug" = "yes"
827 EXTRACFLAGS="$EXTRACFLAGS -fno-strength-reduce"
830 dnl Check for -fshort-wchar
831 AC_CACHE_CHECK([for gcc -fshort-wchar support], ac_cv_c_gcc_fshort_wchar,
832 [WINE_TRY_CFLAGS([-fshort-wchar],
833 ac_cv_c_gcc_fshort_wchar="yes",ac_cv_c_gcc_fshort_wchar="no")])
834 if test "$ac_cv_c_gcc_fshort_wchar" = "yes"
836 AC_DEFINE(CC_FLAG_SHORT_WCHAR, "-fshort-wchar", [Specifies the compiler flag that forces a short wchar_t])
839 dnl Check for -mpreferred-stack-boundary
840 AC_CACHE_CHECK([for gcc -mpreferred-stack-boundary=2 support], ac_cv_c_gcc_stack_boundary,
841 [WINE_TRY_CFLAGS([-mpreferred-stack-boundary=2],
842 ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")])
843 if test "$ac_cv_c_gcc_stack_boundary" = "yes"
845 EXTRACFLAGS="$EXTRACFLAGS -mpreferred-stack-boundary=2"
848 dnl Check for -fno-strict-aliasing
849 AC_CACHE_CHECK([for gcc -fno-strict-aliasing support], ac_cv_c_gcc_no_strict_aliasing,
850 [WINE_TRY_CFLAGS([-fno-strict-aliasing],
851 ac_cv_c_gcc_no_strict_aliasing="yes",ac_cv_c_gcc_no_strict_aliasing="no")])
852 if test "$ac_cv_c_gcc_no_strict_aliasing" = "yes"
854 EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing"
857 dnl Check for -gstabs+ option
858 AC_CACHE_CHECK([for gcc -gstabs+ support], ac_cv_c_gcc_gstabs,
859 [WINE_TRY_CFLAGS([-gstabs+],ac_cv_c_gcc_gstabs="yes", ac_cv_c_gcc_gstabs="no")])
860 if test "$ac_cv_c_gcc_gstabs" = "yes"
862 EXTRACFLAGS="$EXTRACFLAGS -gstabs+"
865 dnl Check for noisy string.h
866 saved_CFLAGS="$CFLAGS"
867 CFLAGS="$CFLAGS -Wpointer-arith -Werror"
868 AC_CACHE_CHECK([for broken string.h that generates warnings], ac_cv_c_string_h_warnings,
869 AC_TRY_COMPILE([#include <string.h>],[],
870 [ac_cv_c_string_h_warnings=no],[ac_cv_c_string_h_warnings=yes]))
871 CFLAGS="$saved_CFLAGS"
872 if test "$ac_cv_c_string_h_warnings" = "no"
874 EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith"
878 dnl **** Check how to define a function in assembly code ****
880 AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,
882 ["\t.globl _ac_test\n\t.def _ac_test; .scl 2; .type 32; .endef\n_ac_test:\t.long 0"],,,
883 ac_cv_asm_func_def=".def",
884 [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,@function\n_ac_test:\t.long 0"],,,
885 ac_cv_asm_func_def=".type @function",
886 [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,2\n_ac_test:\t.long 0"],,,
887 ac_cv_asm_func_def=".type 2",
888 ac_cv_asm_func_def="unknown")])]))
890 AH_TEMPLATE(__ASM_FUNC,[Define to a macro to generate an assembly function directive])
891 case "$ac_cv_asm_func_def" in
893 AC_DEFINE([__ASM_FUNC(name)], [".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"]) ;;
895 AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",@function"]) ;;
897 AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",2"]) ;;
899 AC_DEFINE([__ASM_FUNC(name)], [""]) ;;
902 dnl **** Check for underscore on external symbols ****
904 AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_extern_prefix,
905 WINE_TRY_ASM_LINK([".globl _ac_test\n_ac_test:\t.long 0"],
906 [extern int ac_test;],
907 [if (ac_test) return 1],
908 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no"))
910 AH_TEMPLATE(__ASM_NAME,[Define to a macro to generate an assembly name from a C symbol])
911 if test "$ac_cv_c_extern_prefix" = "yes"
913 AC_DEFINE([__ASM_NAME(name)], ["_" name])
915 AC_DEFINE([__ASM_NAME(name)], [name])
918 dnl **** Check how to do strings in assembler ****
920 AC_CACHE_CHECK([for assembler keyword for ASCII strings], ac_cv_c_asm_string,
921 WINE_TRY_ASM_LINK([".data\\n\\t.string \\"test\\"\\n\\t.text"],,,ac_cv_c_asm_string=".string",
922 WINE_TRY_ASM_LINK([".data\\n\\t.asciz \\"test\\"\\n\\t.text"],,,ac_cv_c_asm_string=".asciz",
923 WINE_TRY_ASM_LINK([".data\\n\\t.ascii \\"test\\"\\n\\t.text"],,,ac_cv_c_asm_string=".ascii",
924 AC_MSG_ERROR([could not discover how to produce C strings with assembler.])))))
926 AC_DEFINE_UNQUOTED(__ASM_STRING, ["$ac_cv_c_asm_string"],
927 [Define to the assembler keyword used to specify an ASCII string])
929 dnl **** Check for .short in assembler ****
931 AC_CACHE_CHECK([for assembler keyword for word values], ac_cv_c_asm_short,
932 WINE_TRY_ASM_LINK([".data\\n\\t.short 1\\n\\t.text"],,,ac_cv_c_asm_short=".short",
933 WINE_TRY_ASM_LINK([".data\\n\\t.half 1\\n\\t.text"],,,ac_cv_c_asm_short=".half",
934 AC_MSG_ERROR([could not discover how to specify word values with assembler.]))))
936 AC_DEFINE_UNQUOTED(__ASM_SHORT, ["$ac_cv_c_asm_short"],
937 [Define to the assembler keyword used to specify a word value])
939 dnl **** Check for .size in assembler ****
941 AC_CACHE_CHECK([for .size in assembler], ac_cv_c_asm_size,
942 WINE_TRY_ASM_LINK([".globl _ac_test\n.size _ac_test, . - _ac_test"],,,
943 ac_cv_c_asm_size="yes",ac_cv_c_asm_size="no"))
945 if test "$ac_cv_c_asm_size" = "yes"
947 AC_DEFINE(HAVE_ASM_DOT_SIZE, 1, [Define if the assembler keyword .size is accepted])
950 dnl **** Check for working dll ****
953 AC_SUBST(DLLFLAGS,"-D_REENTRANT")
955 AC_SUBST(LDSHARED,"")
956 AC_SUBST(LDDLLFLAGS,"")
957 AC_SUBST(LIBEXT,"so")
958 AC_SUBST(IMPLIBEXT,"def")
962 AC_CHECK_TOOL(DLLTOOL,dlltool,false)
963 AC_CHECK_TOOL(DLLWRAP,dllwrap,false)
964 if test "$DLLWRAP" = "false"; then
967 dnl FIXME - check whether dllwrap works correctly...
971 dnl We can't build 16-bit NE dlls
976 AC_CHECK_HEADERS(dlfcn.h,
977 [AC_CHECK_FUNCS(dlopen,,
978 [AC_CHECK_LIB(dl,dlopen,
979 [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
984 if test "$LIBEXT" = "so"
986 DLLFLAGS="$DLLFLAGS -fPIC"
988 AC_CACHE_CHECK([whether we can build a GNU style ELF dll], ac_cv_c_dll_gnuelf,
989 [WINE_TRY_SHLIB_FLAGS([-fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic],
990 ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")])
991 if test "$ac_cv_c_dll_gnuelf" = "yes"
993 LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
994 LDDLLFLAGS="-shared -Wl,-Bsymbolic"
995 AC_CACHE_CHECK([whether the linker accepts -z defs], ac_cv_c_dll_zdefs,
996 [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs],
997 ac_cv_c_dll_zdefs="yes",ac_cv_c_dll_zdefs="no")])
998 if test "$ac_cv_c_dll_zdefs" = "yes"
1000 LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
1003 AC_CACHE_CHECK([whether the linker accepts -init and -fini], ac_cv_c_dll_init_fini,
1004 [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini],
1005 ac_cv_c_dll_init_fini="yes",ac_cv_c_dll_init_fini="no")])
1006 if test "$ac_cv_c_dll_init_fini" = "yes"
1008 LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"
1011 AC_CACHE_CHECK([whether the linker accepts version scripts], ac_cv_c_ld_version_scripts,
1012 [echo '{ global: *; };' >conftest.map
1013 WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map],
1014 ac_cv_c_ld_version_scripts="yes",ac_cv_c_ld_version_scripts="no")
1015 rm -f conftest.map])
1016 if test "$ac_cv_c_ld_version_scripts" = "yes"
1018 LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"
1021 AC_CACHE_CHECK([whether the linker accepts --export-dynamic], ac_cv_c_export_dynamic,
1022 [WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
1023 ac_cv_c_export_dynamic="yes",ac_cv_c_export_dynamic="no")])
1024 if test "$ac_cv_c_export_dynamic" = "yes"
1026 AC_SUBST(LDEXECFLAGS,["-Wl,--export-dynamic"])
1031 AC_CACHE_CHECK([whether we can relocate the executable to 0x77f00000], ac_cv_ld_reloc_exec,
1032 [WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x77f00400],
1033 ac_cv_ld_reloc_exec="yes", ac_cv_ld_reloc_exec="no")])
1034 if test "$ac_cv_ld_reloc_exec" = "yes"
1036 LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x77f00400"
1042 AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll, ac_cv_c_dll_unixware,
1043 [WINE_TRY_SHLIB_FLAGS([-fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic],
1044 ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")])
1045 if test "$ac_cv_c_dll_unixware" = "yes"
1047 LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
1048 LDDLLFLAGS="-Wl,-G,-B,symbolic"
1051 AC_CACHE_CHECK(whether we can build a Mach-O (Mac OS X/Darwin) dll, ac_cv_c_dll_macho,
1052 [WINE_TRY_SHLIB_FLAGS([-bundle], ac_cv_c_dll_macho="yes", ac_cv_c_dll_macho="no")])
1053 if test "$ac_cv_c_dll_macho" = "yes"
1056 LDDLLFLAGS="-bundle -flat_namespace -undefined suppress"
1057 LDSHARED="\$(CC) -dynamiclib"
1058 CFLAGS="$CFLAGS -ffixed-r13 -no-cpp-precomp"
1059 STRIP="$STRIP -u -r"
1060 dnl Relocate wine executable
1061 AC_SUBST(LDEXECFLAGS,"-seg1addr 0x120000")
1062 dnl Relocate libwine.dyld too
1063 AC_SUBST(LDLIBWINEFLAGS,"-seg1addr 0x140000")
1064 dnl declare needed frameworks
1065 AC_SUBST(COREFOUNDATIONLIB,"-framework CoreFoundation")
1066 AC_SUBST(IOKITLIB,"-framework IOKit")
1067 dnl using IOKit imply we use CoreFoundation too
1068 IOKITLIB = "$IOKITLIB $COREFOUNDATIONLIB"
1070 AC_CACHE_CHECK(whether we can build an HP-UX dll, ac_cv_c_dll_hpux,
1071 [WINE_TRY_SHLIB_FLAGS([-shared], ac_cv_c_dll_hpux="yes", ac_cv_c_dll_hpux="no")])
1072 if test "$ac_cv_c_dll_hpux" = "yes"
1076 LDDLLFLAGS="-shared -fPIC"
1077 LDSHARED="\$(CC) -shared"
1084 dnl Check for cross compiler to build test programs
1085 AC_SUBST(CROSSTEST,"")
1086 if test "$cross_compiling" = "no"
1088 AC_CHECK_PROGS(CROSSCC,i586-mingw32msvc-gcc i386-mingw32msvc-gcc i386-mingw32-gcc mingw-gcc,false)
1089 AC_CHECK_PROGS(DLLTOOL,i586-mingw32msvc-dlltool i386-mingw32msvc-dlltool i386-mingw32-dlltool mingw-dlltool,false)
1090 AC_CHECK_PROGS(CROSSWINDRES,i586-mingw32msvc-windres i386-mingw32msvc-windres i386-mingw32-windres mingw-windres,false)
1091 if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi
1096 if test "$LIBEXT" = "a"; then
1098 [could not find a way to build shared libraries.
1099 It is currently not possible to build Wine without shared library
1100 (.so) support to allow transparent switch between .so and .dll files.
1101 If you are using Linux, you will need a newer binutils.]
1107 AC_SUBST(LDPATH,"PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$PATH\"") ;;
1109 AC_SUBST(LDPATH,"DYLD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$DYLD_LIBRARY_PATH\"") ;;
1111 AC_SUBST(LDPATH,"LD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$LD_LIBRARY_PATH\"") ;;
1114 dnl Mingw needs explicit msvcrt for linking libwine and winsock for wininet
1117 AC_SUBST(CRTLIBS,"-lmsvcrt")
1118 AC_SUBST(SOCKETLIBS,"-lws2_32")
1125 *i[[3456789]]86*) AC_SUBST(WINE_BINARIES,"wine-glibc wine-kthread wine-pthread wine-preloader") ;;
1126 *) AC_SUBST(WINE_BINARIES,"wine-glibc wine-kthread wine-pthread") ;;
1128 AC_SUBST(MAIN_BINARY,"wine-glibc")
1131 AC_SUBST(WINE_BINARIES,"wine-pthread")
1132 AC_SUBST(MAIN_BINARY,"wine-pthread")
1135 AC_SUBST(WINE_BINARIES,"wine-kthread")
1136 AC_SUBST(MAIN_BINARY,"wine-kthread")
1140 dnl **** Get the soname for libraries that we load dynamically ****
1142 if test "$LIBEXT" = "so" -o "$LIBEXT" = "dylib"
1144 WINE_GET_SONAME(X11,XCreateWindow,[$X_LIBS $X_EXTRA_LIBS])
1145 WINE_GET_SONAME(Xext,XextCreateExtension,[$X_LIBS -lX11 $X_EXTRA_LIBS])
1146 WINE_GET_SONAME(Xi,XOpenDevice,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1147 WINE_GET_SONAME(Xrender,XRenderQueryExtension,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1148 WINE_GET_SONAME(Xrandr,XRRQueryExtension,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1149 WINE_GET_SONAME(freetype,FT_Init_FreeType,[$X_LIBS])
1150 WINE_GET_SONAME(GL,glXQueryExtension,[$X_LIBS $X_EXTRA_LIBS])
1151 WINE_GET_SONAME(txc_dxtn,fetch_2d_texel_rgba_dxt1)
1152 WINE_GET_SONAME(cups,cupsGetDefault)
1153 WINE_GET_SONAME(jack,jack_client_new)
1154 WINE_GET_SONAME(fontconfig,FcInit)
1155 WINE_GET_SONAME(ssl,SSL_library_init)
1156 WINE_GET_SONAME(crypto,BIO_new_socket)
1157 WINE_GET_SONAME(ncurses,waddch)
1158 WINE_GET_SONAME(curses,waddch)
1159 WINE_GET_SONAME(jpeg,jpeg_start_decompress)
1160 WINE_GET_SONAME(ungif,DGifOpen)
1161 WINE_GET_SONAME(gif,DGifOpen)
1162 WINE_GET_SONAME(lcms,cmsOpenProfileFromFile)
1166 dnl **** Check for functions ****
1234 dnl **** Checks for headers that depend on other ones ****
1236 AC_CHECK_HEADERS(sys/mount.h sys/user.h,,,
1237 [#include <sys/types.h>
1238 #if HAVE_SYS_PARAM_H
1239 # include <sys/param.h>
1242 AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h net/route.h],,,
1243 [#include <sys/types.h>
1244 #if HAVE_SYS_SOCKET_H
1245 # include <sys/socket.h>
1248 AC_CHECK_HEADERS([resolv.h],,,
1249 [#include <sys/types.h>
1250 #if HAVE_SYS_SOCKET_H
1251 # include <sys/socket.h>
1253 #if HAVE_NETINET_IN_H
1254 # include <netinet/in.h>
1256 #if HAVE_ARPA_NAMESER_H
1257 # include <arpa/nameser.h>
1260 AC_CHECK_HEADERS(netinet/ip.h,,,
1261 [#include <sys/types.h>
1262 #if HAVE_SYS_SOCKET_H
1263 # include <sys/socket.h>
1265 #if HAVE_NETINET_IN_SYSTM_H
1266 # include <netinet/in_systm.h>
1269 AC_CHECK_HEADERS(ucontext.h,,,[#include <signal.h>])
1271 dnl **** Check for IPX headers (currently Linux only) ****
1273 AC_CACHE_CHECK([for GNU style IPX support], ac_cv_c_ipx_gnu,
1275 [#include <sys/types.h>
1276 #ifdef HAVE_SYS_SOCKET_H
1277 # include <sys/socket.h>
1279 #include <netipx/ipx.h>],
1280 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
1281 [ac_cv_c_ipx_gnu="yes"],
1282 [ac_cv_c_ipx_gnu="no"])
1284 if test "$ac_cv_c_ipx_gnu" = "yes"
1286 AC_DEFINE(HAVE_IPX_GNU, 1, [Define if IPX should use netipx/ipx.h from libc])
1289 if test "$ac_cv_c_ipx_gnu" = "no"
1291 AC_CACHE_CHECK([for linux style IPX support], ac_cv_c_ipx_linux,
1293 [#include <sys/types.h>
1294 #ifdef HAVE_SYS_SOCKET_H
1295 # include <sys/socket.h>
1297 #include <asm/types.h>
1298 #include <linux/ipx.h>],
1299 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
1300 [ac_cv_c_ipx_linux="yes"],
1301 [ac_cv_c_ipx_linux="no"])
1303 if test "$ac_cv_c_ipx_linux" = "yes"
1305 AC_DEFINE(HAVE_IPX_LINUX, 1, [Define if IPX includes are taken from Linux kernel])
1309 dnl **** Check for types ****
1313 AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t, long long, fsblkcnt_t, fsfilcnt_t])
1315 AC_CACHE_CHECK([whether linux/input.h is for real],
1316 wine_cv_linux_input_h,
1318 #include <linux/input.h>
1320 int foo = EVIOCGBIT(EV_ABS,42);
1321 int bar = BTN_PINKIE;
1324 wine_cv_linux_input_h=yes,
1325 wine_cv_linux_input_h=no,
1329 if test "$wine_cv_linux_input_h" = "yes"
1331 AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H, 1,
1332 [Define if we have linux/input.h AND it contains the INPUT event API])
1336 AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
1337 wine_cv_linux_gethostbyname_r_6,
1343 struct hostent *result;
1350 res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
1351 res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
1353 wine_cv_linux_gethostbyname_r_6=yes,
1354 wine_cv_linux_gethostbyname_r_6=no
1357 if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
1359 AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6, 1,
1360 [Define if Linux-style gethostbyname_r and gethostbyaddr_r are available])
1363 if test "$ac_cv_header_linux_joystick_h" = "yes"
1365 AC_CACHE_CHECK([whether linux/joystick.h uses the Linux 2.2+ API],
1366 wine_cv_linux_joystick_22_api,
1368 #include <sys/ioctl.h>
1369 #include <linux/joystick.h>
1371 struct js_event blub;
1372 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
1373 #error "no 2.2 header"
1376 wine_cv_linux_joystick_22_api=yes,
1377 wine_cv_linux_joystick_22_api=no,
1378 wine_cv_linux_joystick_22_api=no
1381 if test "$wine_cv_linux_joystick_22_api" = "yes"
1383 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API, 1,
1384 [Define if <linux/joystick.h> defines the Linux 2.2 joystick API])
1388 dnl **** statfs checks ****
1390 if test "$ac_cv_header_sys_vfs_h" = "yes"
1392 AC_CACHE_CHECK( [whether sys/vfs.h defines statfs],
1393 wine_cv_sys_vfs_has_statfs,
1395 #include <sys/types.h>
1396 #ifdef HAVE_SYS_PARAM_H
1397 # include <sys/param.h>
1399 #include <sys/vfs.h>
1403 memset(&stfs,0,sizeof(stfs));
1404 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
1407 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
1409 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS, 1,
1410 [Define if the struct statfs is defined by <sys/vfs.h>])
1414 if test "$ac_cv_header_sys_statfs_h" = "yes"
1416 AC_CACHE_CHECK( [whether sys/statfs.h defines statfs],
1417 wine_cv_sys_statfs_has_statfs,
1419 #include <sys/types.h>
1420 #ifdef HAVE_SYS_PARAM_H
1421 # include <sys/param.h>
1423 #include <sys/statfs.h>
1426 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
1429 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
1431 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS, 1,
1432 [Define if the struct statfs is defined by <sys/statfs.h>])
1436 if test "$ac_cv_header_sys_mount_h" = "yes"
1438 AC_CACHE_CHECK( [whether sys/mount.h defines statfs],
1439 wine_cv_sys_mount_has_statfs,
1441 #include <sys/types.h>
1442 #ifdef HAVE_SYS_PARAM_H
1443 # include <sys/param.h>
1445 #include <sys/mount.h>
1448 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
1451 if test "$wine_cv_sys_mount_has_statfs" = "yes"
1453 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT, 1,
1454 [Define if the struct statfs is defined by <sys/mount.h>])
1458 dnl **** FIXME: what about mixed cases, where we need two of them? ***
1460 dnl Check for statfs members
1461 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],,,
1462 [#include <sys/types.h>
1463 #ifdef HAVE_SYS_PARAM_H
1464 # include <sys/param.h>
1466 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1467 # include <sys/mount.h>
1469 # ifdef STATFS_DEFINED_BY_SYS_VFS
1470 # include <sys/vfs.h>
1472 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1473 # include <sys/statfs.h>
1478 AC_CHECK_MEMBERS([struct statvfs.f_blocks],,,
1479 [#ifdef HAVE_SYS_STATVFS_H
1480 #include <sys/statvfs.h>
1483 dnl Check for socket structure members
1484 AC_CHECK_MEMBERS([struct msghdr.msg_accrights, struct sockaddr.sa_len, struct sockaddr_un.sun_len],,,
1485 [#include <sys/types.h>
1486 #ifdef HAVE_SYS_SOCKET_H
1487 # include <sys/socket.h>
1489 #ifdef HAVE_SYS_UN_H
1490 # include <sys/un.h>
1493 dnl Check for siginfo_t members
1494 AC_CHECK_MEMBERS([siginfo_t.si_fd],,,[#include <signal.h>])
1496 dnl Check for struct option
1497 AC_CHECK_MEMBERS([struct option.name],,,
1498 [#ifdef HAVE_GETOPT_H
1502 dnl Check for stat.st_blocks
1503 AC_CHECK_MEMBERS([struct stat.st_blocks])
1505 dnl *** check for the need to define platform-specific symbols
1508 *i[[3456789]]86*) WINE_CHECK_DEFINE([__i386__]) ;;
1509 *alpha*) WINE_CHECK_DEFINE([__ALPHA__]) ;;
1510 *sparc*) WINE_CHECK_DEFINE([__sparc__]) ;;
1511 *powerpc*) WINE_CHECK_DEFINE([__powerpc__]) ;;
1514 case $host_vendor in
1515 *sun*) WINE_CHECK_DEFINE([__sun__]) ;;
1518 dnl **** Generate output files ****
1520 AH_TOP([#define __WINE_CONFIG_H])
1522 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/d3ddevice)
1523 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dclipper)
1524 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/ddraw)
1525 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/direct3d)
1526 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dpalette)
1527 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dsurface)
1528 WINE_CONFIG_EXTRA_DIR(dlls/gdi/enhmfdrv)
1529 WINE_CONFIG_EXTRA_DIR(dlls/gdi/mfdrv)
1530 WINE_CONFIG_EXTRA_DIR(dlls/kernel/messages)
1531 WINE_CONFIG_EXTRA_DIR(dlls/user/dde)
1532 WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
1533 WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
1534 WINE_CONFIG_EXTRA_DIR(include/wine)
1535 WINE_CONFIG_EXTRA_DIR(misc)
1536 WINE_CONFIG_EXTRA_DIR(programs/regedit/tests)
1537 WINE_CONFIG_EXTRA_DIR(windows)
1539 MAKE_RULES=Make.rules
1540 AC_SUBST_FILE(MAKE_RULES)
1542 MAKE_DLL_RULES=dlls/Makedll.rules
1543 AC_SUBST_FILE(MAKE_DLL_RULES)
1545 MAKE_TEST_RULES=dlls/Maketest.rules
1546 AC_SUBST_FILE(MAKE_TEST_RULES)
1548 MAKE_LIB_RULES=libs/Makelib.rules
1549 AC_SUBST_FILE(MAKE_LIB_RULES)
1551 MAKE_PROG_RULES=programs/Makeprog.rules
1552 AC_SUBST_FILE(MAKE_PROG_RULES)
1559 programs/Makeprog.rules
1562 dlls/advapi32/Makefile
1563 dlls/advapi32/tests/Makefile
1564 dlls/advpack/Makefile
1565 dlls/amstream/Makefile
1567 dlls/avicap32/Makefile
1568 dlls/avifil32/Makefile
1569 dlls/cabinet/Makefile
1570 dlls/capi2032/Makefile
1572 dlls/cfgmgr32/Makefile
1573 dlls/comcat/Makefile
1574 dlls/comctl32/Makefile
1575 dlls/comctl32/tests/Makefile
1576 dlls/commdlg/Makefile
1577 dlls/crtdll/Makefile
1578 dlls/crypt32/Makefile
1585 dlls/d3dxof/Makefile
1586 dlls/dbghelp/Makefile
1587 dlls/dciman32/Makefile
1589 dlls/ddraw/tests/Makefile
1590 dlls/devenum/Makefile
1591 dlls/dinput/Makefile
1592 dlls/dinput8/Makefile
1593 dlls/dmband/Makefile
1594 dlls/dmcompos/Makefile
1596 dlls/dmloader/Makefile
1597 dlls/dmscript/Makefile
1598 dlls/dmstyle/Makefile
1599 dlls/dmsynth/Makefile
1600 dlls/dmusic/Makefile
1601 dlls/dmusic32/Makefile
1603 dlls/dplayx/Makefile
1605 dlls/dpnhpast/Makefile
1606 dlls/dsound/Makefile
1607 dlls/dsound/tests/Makefile
1608 dlls/dswave/Makefile
1609 dlls/dxdiagn/Makefile
1610 dlls/dxerr8/Makefile
1611 dlls/dxerr9/Makefile
1612 dlls/dxguid/Makefile
1614 dlls/gdi/tests/Makefile
1616 dlls/glut32/Makefile
1617 dlls/hhctrl.ocx/Makefile
1618 dlls/iccvid/Makefile
1620 dlls/ifsmgr.vxd/Makefile
1621 dlls/imagehlp/Makefile
1623 dlls/iphlpapi/Makefile
1624 dlls/iphlpapi/tests/Makefile
1626 dlls/kernel/Makefile
1627 dlls/kernel/tests/Makefile
1628 dlls/lzexpand/Makefile
1629 dlls/lzexpand/tests/Makefile
1630 dlls/mapi32/Makefile
1631 dlls/mapi32/tests/Makefile
1633 dlls/mlang/tests/Makefile
1634 dlls/mmdevldr.vxd/Makefile
1635 dlls/monodebg.vxd/Makefile
1638 dlls/msacm/imaadp32/Makefile
1639 dlls/msacm/msadp32/Makefile
1640 dlls/msacm/msg711/Makefile
1641 dlls/msacm/winemp3/Makefile
1642 dlls/msacm/tests/Makefile
1644 dlls/mscms/tests/Makefile
1646 dlls/mshtml/Makefile
1648 dlls/msimg32/Makefile
1649 dlls/msisys/Makefile
1650 dlls/msnet32/Makefile
1651 dlls/msrle32/Makefile
1652 dlls/msvcrt/Makefile
1653 dlls/msvcrt/tests/Makefile
1654 dlls/msvcrt20/Makefile
1655 dlls/msvcrt40/Makefile
1656 dlls/msvcrtd/Makefile
1657 dlls/msvcrtd/tests/Makefile
1658 dlls/msvidc32/Makefile
1659 dlls/msvideo/Makefile
1660 dlls/mswsock/Makefile
1661 dlls/netapi32/Makefile
1662 dlls/netapi32/tests/Makefile
1663 dlls/newdev/Makefile
1665 dlls/ntdll/tests/Makefile
1666 dlls/odbc32/Makefile
1668 dlls/ole32/tests/Makefile
1669 dlls/oleacc/Makefile
1670 dlls/oleaut32/Makefile
1671 dlls/oleaut32/tests/Makefile
1672 dlls/olecli/Makefile
1673 dlls/oledlg/Makefile
1674 dlls/olepro32/Makefile
1675 dlls/olesvr/Makefile
1676 dlls/opengl32/Makefile
1678 dlls/psapi/tests/Makefile
1680 dlls/quartz/Makefile
1681 dlls/quartz/tests/Makefile
1682 dlls/rasapi32/Makefile
1683 dlls/richedit/Makefile
1684 dlls/rpcrt4/Makefile
1685 dlls/rpcrt4/tests/Makefile
1686 dlls/rsabase/Makefile
1687 dlls/rsabase/tests/Makefile
1688 dlls/rsaenh/Makefile
1689 dlls/rsaenh/tests/Makefile
1690 dlls/secur32/Makefile
1691 dlls/serialui/Makefile
1692 dlls/setupapi/Makefile
1693 dlls/shdocvw/Makefile
1694 dlls/shell32/Makefile
1695 dlls/shell32/tests/Makefile
1696 dlls/shfolder/Makefile
1697 dlls/shlwapi/Makefile
1698 dlls/shlwapi/tests/Makefile
1699 dlls/snmpapi/Makefile
1701 dlls/strmiids/Makefile
1702 dlls/tapi32/Makefile
1703 dlls/ttydrv/Makefile
1705 dlls/unicows/Makefile
1707 dlls/urlmon/Makefile
1708 dlls/urlmon/tests/Makefile
1710 dlls/user/tests/Makefile
1712 dlls/uxtheme/Makefile
1713 dlls/vdhcp.vxd/Makefile
1714 dlls/vdmdbg/Makefile
1715 dlls/version/Makefile
1716 dlls/version/tests/Makefile
1717 dlls/vmm.vxd/Makefile
1718 dlls/vnbt.vxd/Makefile
1719 dlls/vnetbios.vxd/Makefile
1720 dlls/vtdapi.vxd/Makefile
1721 dlls/vwin32.vxd/Makefile
1722 dlls/win32s/Makefile
1723 dlls/winaspi/Makefile
1724 dlls/wined3d/Makefile
1725 dlls/winedos/Makefile
1726 dlls/wineps/Makefile
1727 dlls/wininet/Makefile
1728 dlls/wininet/tests/Makefile
1730 dlls/winmm/joystick/Makefile
1731 dlls/winmm/mcianim/Makefile
1732 dlls/winmm/mciavi/Makefile
1733 dlls/winmm/mcicda/Makefile
1734 dlls/winmm/mciseq/Makefile
1735 dlls/winmm/mciwave/Makefile
1736 dlls/winmm/midimap/Makefile
1737 dlls/winmm/tests/Makefile
1738 dlls/winmm/wavemap/Makefile
1739 dlls/winmm/winealsa/Makefile
1740 dlls/winmm/winearts/Makefile
1741 dlls/winmm/wineaudioio/Makefile
1742 dlls/winmm/winejack/Makefile
1743 dlls/winmm/winenas/Makefile
1744 dlls/winmm/wineoss/Makefile
1745 dlls/winnls/Makefile
1746 dlls/winsock/Makefile
1747 dlls/winsock/tests/Makefile
1748 dlls/winspool/Makefile
1749 dlls/winspool/tests/Makefile
1750 dlls/wintab32/Makefile
1751 dlls/wintrust/Makefile
1753 dlls/wsock32/Makefile
1754 dlls/x11drv/Makefile
1755 documentation/Makefile
1760 libs/unicode/Makefile
1765 programs/avitools/Makefile
1766 programs/clock/Makefile
1767 programs/cmdlgtst/Makefile
1768 programs/control/Makefile
1769 programs/expand/Makefile
1770 programs/msiexec/Makefile
1771 programs/notepad/Makefile
1772 programs/progman/Makefile
1773 programs/regedit/Makefile
1774 programs/regsvr32/Makefile
1775 programs/rpcss/Makefile
1776 programs/rundll32/Makefile
1777 programs/start/Makefile
1778 programs/taskmgr/Makefile
1779 programs/uninstaller/Makefile
1780 programs/view/Makefile
1781 programs/wcmd/Makefile
1782 programs/wineboot/Makefile
1783 programs/winebrowser/Makefile
1784 programs/winecfg/Makefile
1785 programs/wineconsole/Makefile
1786 programs/winedbg/Makefile
1787 programs/winefile/Makefile
1788 programs/winemenubuilder/Makefile
1789 programs/winemine/Makefile
1790 programs/winepath/Makefile
1791 programs/winetest/Makefile
1792 programs/winevdm/Makefile
1793 programs/winhelp/Makefile
1794 programs/winver/Makefile
1798 tools/winapi/Makefile
1799 tools/winebuild/Makefile
1800 tools/winedump/Makefile
1801 tools/winegcc/Makefile
1803 tools/wrc/Makefile])
1807 if test "$have_x" = "no"
1810 echo "*** Warning: X development files not found. Wine will be built without"
1811 echo "*** X support, which currently does not work, and would probably not be"
1812 echo "*** what you want anyway. You will need to install devel packages of"
1813 echo "*** Xlib/Xfree86 at the very least."
1816 if test "$wine_cv_opengl_version_OK" = "no"
1819 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1820 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1823 if test "$wine_cv_msg_freetype" = "yes"
1826 echo "*** Note: Your system appears to have the FreeType 2 runtime libraries"
1827 echo "*** installed, but 'freetype-config' is not in your PATH. Install the"
1828 echo "*** freetype-devel package (or its equivalent on your distribution) to"
1829 echo "*** enable Wine to use TrueType fonts."
1833 echo "Configure finished. Do '${ac_make} depend && ${ac_make}' to compile Wine."
1836 dnl Local Variables:
1837 dnl comment-start: "dnl "
1839 dnl comment-start-skip: "\\bdnl\\b\\s *"
1840 dnl compile-command: "autoconf"