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)
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 ****
16 LIBEXT=so # library type .so or .a
18 AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug],[compile out all debugging messages]))
19 AC_ARG_ENABLE(trace, AC_HELP_STRING([--disable-trace],[compile out TRACE messages]))
20 AC_ARG_ENABLE(opengl,AC_HELP_STRING([--enable-opengl],[force usage of OpenGL even if the latter is thread-safe via pthread]))
21 AC_ARG_WITH(curses, AC_HELP_STRING([--without-curses],[do not use curses]))
24 if test "x$enable_debug" = "xno"
26 AC_DEFINE(NO_DEBUG_MSGS,1,[Define to disable all debug messages.])
28 if test "x$enable_trace" = "xno" -o "x$enable_debug" = "xno"
30 AC_DEFINE(NO_TRACE_MSGS,1,[Define to disable trace messages.])
33 dnl **** Check for some programs ****
43 dnl **** Just additional warning checks, since AC_PROG just sets 'yacc' even
44 dnl **** without one present.
45 AC_CHECK_PROGS(XYACC,$YACC bison yacc,none)
46 if test "$XYACC" = "none"
48 AC_MSG_ERROR([no suitable bison/yacc found. Please install the 'bison' package.])
50 AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
51 if test "$XLEX" = "none"
53 AC_MSG_ERROR([no suitable lex found. Please install the 'flex' package.])
58 AC_CHECK_PROG(C2MAN,c2man,c2man,\$(TOPSRCDIR)/tools/c2man.pl)
59 AC_PATH_PROG(LDCONFIG, ldconfig, true, [/sbin /usr/sbin $PATH])
62 AC_CHECK_PROGS(LINT, lclint lint)
63 if test "$LINT" = "lint"
65 LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
66 dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
72 *cygwin*) LDCOMBINE="ld -r --enable-stdcall-fixup" ;;
73 *) LDCOMBINE="ld -r" ;;
77 dnl **** Check for some libraries ****
81 dnl Check for -li386 for NetBSD and OpenBSD
82 AC_CHECK_LIB(i386,i386_set_ldt)
83 dnl Check for -lossaudio for NetBSD
84 AC_CHECK_LIB(ossaudio,_oss_ioctl)
85 dnl Check for -lw for Solaris
86 AC_CHECK_FUNCS(iswalnum,,AC_CHECK_LIB(w,iswalnum))
87 dnl Check for -lnsl for Solaris
88 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
89 dnl Check for -lsocket for Solaris
90 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
91 dnl Check for -lresolv for Solaris
92 AC_CHECK_FUNCS(inet_aton,,AC_CHECK_LIB(resolv,inet_aton))
93 dnl Check for -lxpg4 for FreeBSD
94 AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
95 dnl Check for -lmmap for OS/2
96 AC_CHECK_LIB(mmap,mmap)
100 AC_CHECK_HEADERS(jpeglib.h,
101 AC_CHECK_LIB(jpeg,jpeg_start_decompress,
102 AC_DEFINE(HAVE_LIBJPEG,1,[Define if you have libjpeg including devel headers])
111 AC_SUBST(OPENGLFILES)
115 if test "$have_x" = "yes"
118 ac_save_CPPFLAGS="$CPPFLAGS"
119 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
121 dnl *** All of the following tests require X11/Xlib.h
122 AC_CHECK_HEADERS(X11/Xlib.h,
124 dnl *** Check for X keyboard extension
125 AC_CHECK_HEADERS(X11/XKBlib.h,
126 [ dnl *** If X11/XKBlib.h exists...
127 AC_CHECK_LIB(X11, XkbQueryExtension,
128 AC_DEFINE(HAVE_XKB, 1, [Define if you have the XKB extension]),,
129 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
131 AC_MSG_WARN([[Xkb extension not found, Wine will be built without it]])
134 dnl *** Check for X Shm extension
135 AC_CHECK_HEADERS(X11/extensions/XShm.h,
136 [ dnl *** If X11/extensions/XShm.h exists...
137 AC_CHECK_LIB(Xext, XShmQueryExtension,
138 AC_DEFINE(HAVE_LIBXXSHM, 1, [Define if you have the X Shm extension]),,
139 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
141 AC_MSG_WARN([[XShm extension not found, Wine will be built without it]]),
142 [#include <X11/Xlib.h>])
144 dnl *** Check for X shape extension
145 AC_CHECK_HEADERS(X11/extensions/shape.h,
146 [ dnl *** If X11/extensions/shape.h exists...
147 AC_CHECK_LIB(Xext,XShapeQueryExtension,
148 AC_DEFINE(HAVE_LIBXSHAPE, 1, [Define if you have the X Shape extension]),,
149 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
151 AC_MSG_WARN([[XShape extension not found, Wine will be built without it]]),
152 [#include <X11/Xlib.h>])
154 dnl *** Check for XFree86 DGA / DGA 2.0 extension
155 AC_CHECK_HEADERS(X11/extensions/xf86dga.h,
156 [ dnl *** If X11/extensions/xf86dga.h exists, check
157 dnl *** for XDGAQueryExtension()...
158 AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
159 [ dnl *** If found...
160 AC_DEFINE(HAVE_LIBXXF86DGA2, 1,
161 [Define if you have the Xxf86dga library version 2])
162 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
164 [ dnl *** If not found, look for XF86DGAQueryExtension()
165 dnl *** instead (DGA 2.0 not found)...
166 AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
167 [ AC_DEFINE(HAVE_LIBXXF86DGA, 1,
168 [Define if you have the Xxf86dga library version 1])
169 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
171 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
174 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
177 AC_MSG_WARN([[DGA extension not found, Wine will be built without it]]),
178 [#include <X11/Xlib.h>])
180 dnl *** Check for XFree86 VMODE extension
181 AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
182 [ dnl *** If X11/extensions/xf86vmode.h exists...
183 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
184 [ AC_DEFINE(HAVE_LIBXXF86VM, 1, [Define if you have the Xxf86vm library])
185 X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
187 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
190 AC_MSG_WARN([[XFree86 VMODE extension not found, Wine will be built without it]]),
191 [#include <X11/Xlib.h>])
193 dnl *** Check for XVideo extension supporting XvImages
194 AC_CHECK_HEADERS(X11/extensions/Xvlib.h,
195 [ dnl *** If X11/extensions/Xvlib.h exists...
196 AC_CHECK_LIB(Xv, XvShmCreateImage,
197 [ AC_DEFINE(HAVE_XVIDEO, 1, [Define if the X libraries support XVideo])
198 X_PRE_LIBS="$X_PRE_LIBS -lXv"
200 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
203 AC_MSG_WARN([[XVideo extension not found, Wine will be built without it]]),
204 [#include <X11/Xlib.h>])
206 dnl *** Check for XRender include file
207 AC_CHECK_HEADERS(X11/extensions/Xrender.h,,,[#include <X11/Xlib.h>])
209 ) dnl *** End of X11/Xlib.h check
211 dnl Check for the presence of OpenGL
212 if test "x$enable_opengl" != "xno"
214 if test -f /usr/X11R6/lib/libGL.a -a ! -f /usr/X11R6/lib/libGL.so
216 AC_MSG_ERROR([/usr/X11R6/lib/libGL.a is present on your system.
217 This prevents linking to OpenGL. Delete the file and restart configure.])
220 AC_CHECK_HEADERS(GL/gl.h GL/glx.h)
221 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
223 AC_CHECK_HEADERS(GL/glext.h,,,[#include <GL/glx.h>])
224 dnl Check for some problems due to old Mesa versions
225 AC_CACHE_CHECK([for up-to-date OpenGL version], wine_cv_opengl_version_OK,
227 [#include <GL/gl.h>],
228 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
229 [wine_cv_opengl_version_OK="yes"],
230 [wine_cv_opengl_version_OK="no"]
234 dnl Check for the thread-safety of the OpenGL library
235 AC_CACHE_CHECK([for thread-safe OpenGL version],
236 wine_cv_opengl_version_threadsafe,
239 AC_TRY_LINK([],[pthread_getspecific();],
240 [wine_cv_opengl_version_threadsafe="yes"],
241 [wine_cv_opengl_version_threadsafe="no"])
245 if test "$wine_cv_opengl_version_OK" = "yes" -a \( "$wine_cv_opengl_version_threadsafe" = "no" -o "x$enable_opengl" = "xyes" \)
247 dnl Check for the presence of the library
248 AC_CHECK_LIB(GL,glXCreateContext,
249 X_PRE_LIBS="$X_PRE_LIBS -lGL"
251 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
253 if test "$ac_cv_lib_GL_glXCreateContext" = "yes"
255 OPENGLFILES='$(OPENGLFILES)'
256 AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is present on the system])
258 AC_CHECK_LIB(GL,glXGetProcAddressARB,
259 AC_DEFINE(HAVE_GLX_GETPROCADDRESS, 1,
260 [Define if the OpenGL library supports the glXGetProcAddressARB call]),,
261 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
263 if test "$ac_cv_lib_GL_glXGetProcAddressARB" = "yes"
265 AC_CACHE_CHECK([for OpenGL extension functions prototypes], wine_cv_extension_prototypes,
266 [AC_TRY_COMPILE([#include <GL/gl.h>
267 #ifdef HAVE_GL_GLEXT_H
268 # include <GL/glext.h>
271 [PFNGLCOLORTABLEEXTPROC test_proc;],
272 [wine_cv_extension_prototypes="yes"],
273 [wine_cv_extension_prototypes="no"]
276 if test "$wine_cv_extension_prototypes" = "yes"
278 AC_DEFINE(HAVE_GLEXT_PROTOTYPES, 1,
279 [Define if the OpenGL headers define extension typedefs])
284 dnl Check for GLU32 library.
285 AC_CHECK_LIB(GLU,gluLookAt,
286 [X_PRE_LIBS="$X_PRE_LIBS -lGLU"
287 GLU32FILES='$(GLU32FILES)']
289 $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
295 CPPFLAGS="$ac_save_CPPFLAGS"
303 dnl **** Check which curses lib to use ***
305 if test "x$with_curses" != "xno"
307 AC_CHECK_HEADERS(ncurses.h,
308 [AC_CHECK_LIB(ncurses,waddch,
309 [AC_DEFINE(HAVE_LIBNCURSES, 1, [Define if you have the ncurses library (-lncurses)])
310 CURSESLIBS="-lncurses"],
311 [AC_CHECK_HEADERS(curses.h,
312 [AC_CHECK_LIB(curses,waddch,
313 [AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have the curses library (-lcurses)])
314 CURSESLIBS="-lcurses"])])])])
316 LIBS="$CURSESLIBS $LIBS"
317 AC_CHECK_FUNCS(getbkgd resizeterm)
323 dnl **** Check for CUPS ****
324 wine_cv_warn_cups_h=no
325 AC_CHECK_LIB(cups,cupsGetPPD,
326 [AC_CHECK_HEADER(cups/cups.h,
327 [AC_DEFINE(HAVE_CUPS, 1, [Define if we have CUPS])
329 wine_cv_warn_cups_h=yes)]
333 dnl **** Check for SANE ****
334 AC_CHECK_PROG(sane_devel,sane-config,sane-config,no)
335 if test "$sane_devel" = "no"
340 SANELIBS="`$sane_devel --libs`"
341 SANEINCL="`$sane_devel --cflags`"
342 ac_save_CPPFLAGS="$CPPFLAGS"
344 CPPFLAGS="$CPPFLAGS $SANEINCL"
345 LIBS="$LIBS $SANELIBS"
346 AC_CHECK_HEADER(sane/sane.h,
347 [AC_CHECK_LIB(sane,sane_open,
348 [AC_DEFINE(HAVE_SANE, 1, [Define if we have SANE development environment])],
354 CPPFLAGS="$ac_save_CPPFLAGS"
359 dnl **** Check for FreeType 2 ****
360 AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$X_LIBS)
361 if test "$ft_lib" = "no"
364 wine_cv_msg_freetype=no
366 AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
367 if test "$ft_devel" = "no"
369 AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
370 if test "$ft_devel2" = "freetype2-config"
375 if test "$ft_devel" = "no"
378 wine_cv_msg_freetype=yes
380 FREETYPEINCL=`$ft_devel --cflags`
381 ac_save_CPPFLAGS="$CPPFLAGS"
382 CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
383 AC_CHECK_HEADERS(freetype/freetype.h \
385 freetype/tttables.h \
387 freetype/ftsnames.h \
388 freetype/ttnameid.h \
390 freetype/internal/sfnt.h)
391 AC_TRY_CPP([#include <ft2build.h>
392 #include <freetype/fttrigon.h>],
393 [AC_DEFINE(HAVE_FREETYPE_FTTRIGON_H, 1,
394 [Define if you have the <freetype/fttrigon.h> header file.])
395 wine_cv_fttrigon=yes],
397 CPPFLAGS="$ac_save_CPPFLAGS"
398 dnl Check that we have at least freetype/freetype.h
399 if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
401 AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
402 wine_cv_msg_freetype=no
405 wine_cv_msg_freetype=yes
409 AC_SUBST(FREETYPEINCL)
411 dnl **** Check for parport (currently Linux only) ****
412 AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
414 [#include <linux/ppdev.h>],
415 [ioctl (1,PPCLAIM,0)],
416 [ac_cv_c_ppdev="yes"],
417 [ac_cv_c_ppdev="no"])
419 if test "$ac_cv_c_ppdev" = "yes"
421 AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev.h for parallel port access])
424 dnl **** Check for IPX (currently Linux only) ****
425 AC_CACHE_CHECK([for GNU style IPX support], ac_cv_c_ipx_gnu,
427 [#include <sys/socket.h>
428 #include <netipx/ipx.h>],
429 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
430 [ac_cv_c_ipx_gnu="yes"],
431 [ac_cv_c_ipx_gnu="no"])
433 if test "$ac_cv_c_ipx_gnu" = "yes"
435 AC_DEFINE(HAVE_IPX_GNU, 1, [Define if IPX should use netipx/ipx.h from libc])
438 if test "$ac_cv_c_ipx_gnu" = "no"
440 AC_CACHE_CHECK([for linux style IPX support], ac_cv_c_ipx_linux,
442 [#include <sys/socket.h>
443 #include <asm/types.h>
444 #include <linux/ipx.h>],
445 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
446 [ac_cv_c_ipx_linux="yes"],
447 [ac_cv_c_ipx_linux="no"])
449 if test "$ac_cv_c_ipx_linux" = "yes"
451 AC_DEFINE(HAVE_IPX_LINUX, 1, [Define if IPX includes are taken from Linux kernel])
455 dnl **** Check for Open Sound System ****
456 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
458 AC_CACHE_CHECK([for Open Sound System],
459 ac_cv_c_opensoundsystem,
461 #if defined(HAVE_SYS_SOUNDCARD_H)
462 #include <sys/soundcard.h>
463 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
464 #include <machine/soundcard.h>
465 #elif defined(HAVE_SOUNDCARD_H)
466 #include <soundcard.h>
470 /* check for one of the Open Sound System specific SNDCTL_ defines */
471 #if !defined(SNDCTL_DSP_STEREO)
472 #error No open sound system
474 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
476 if test "$ac_cv_c_opensoundsystem" = "yes"
478 AC_DEFINE(HAVE_OSS, 1, [Define if you have the Open Sound system])
481 AC_CACHE_CHECK([for Open Sound System/MIDI interface],
482 ac_cv_c_opensoundsystem_midi,
484 #if defined(HAVE_SYS_SOUNDCARD_H)
485 #include <sys/soundcard.h>
486 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
487 #include <machine/soundcard.h>
488 #elif defined(HAVE_SOUNDCARD_H)
489 #include <soundcard.h>
493 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
494 #if !defined(SNDCTL_SEQ_SYNC)
495 #error No open sound system MIDI interface
497 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
499 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
501 AC_DEFINE(HAVE_OSS_MIDI, 1, [Define if you have the Open Sound system (MIDI interface)])
504 dnl **** Check for aRts Sound Server ****
505 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
506 AC_CACHE_CHECK([for aRts Sound server],
508 if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"';
510 ac_cv_c_artsserver=no
512 ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
513 ARTSC_LIBS=`$ARTSCCONFIG --libs`
514 ac_cv_c_artsserver=no
515 save_CFLAGS="$CFLAGS"
516 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
520 arts_stream_t stream;
522 ac_cv_c_artsserver=yes
524 CFLAGS="$save_CFLAGS"
527 if test "$ac_cv_c_artsserver" = "yes"
529 AC_SUBST(ARTSLIBS, $ARTSC_LIBS)
530 AC_SUBST(ARTSINCL, $ARTSC_CFLAGS)
532 AC_DEFINE(HAVE_ARTS, 1, [Define if you have ARTS sound server])
535 dnl **** Check for broken glibc mmap64 ****
537 AC_CACHE_CHECK( [whether mmap64 works defined as mmap], ac_cv_mmap64_works,
539 #define _FILE_OFFSET_BITS 64
543 #include <sys/mman.h>
546 int main(int argc,char **argv) {
547 int fd = open("conftest.map",O_CREAT|O_RDWR,0600);
548 if (fd == -1) exit(1);
550 unlink("conftest.map");
554 if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) &&
560 fprintf(stderr,"success!\n");
565 ac_cv_mmap64_works="yes",
566 ac_cv_mmap64_works="no",
567 ac_cv_mmap64_works="no") )
569 if test "$ac_cv_mmap64_works" = "yes"
571 AC_DEFINE(_FILE_OFFSET_BITS, 64, [Set this to 64 to enable 64-bit file support on Linux])
574 dnl **** Check for gcc strength-reduce bug ****
576 if test "x${GCC}" = "xyes"
578 CFLAGS="$CFLAGS -Wall"
579 AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug,
581 int L[[4]] = {0,1,2,3};
583 static int Array[[3]];
586 for(i=0; i<B; i++) Array[[i]] = i - 3;
587 for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
590 exit( Array[[1]] != -2 || L[[2]] != 3);
592 ac_cv_c_gcc_strength_bug="no",
593 ac_cv_c_gcc_strength_bug="yes",
594 ac_cv_c_gcc_strength_bug="yes") )
595 if test "$ac_cv_c_gcc_strength_bug" = "yes"
597 CFLAGS="$CFLAGS -fno-strength-reduce"
600 dnl Check for -mpreferred-stack-boundary
601 AC_CACHE_CHECK([for gcc -mpreferred-stack-boundary=2 support],
602 ac_cv_c_gcc_stack_boundary,
603 [saved_cflags=$CFLAGS
604 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
605 AC_TRY_COMPILE(,[return 0],ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")
608 if test "$ac_cv_c_gcc_stack_boundary" = "yes"
610 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
614 dnl **** Check if we need to place .type inside a .def directive ****
616 AC_CACHE_CHECK([whether .type must sit inside a .def directive],
619 LIBS="conftest_asm.s $LIBS"
620 cat > conftest_asm.s <<EOF
622 .def _ac_test; .scl 2; .type 32; .endef
626 AC_TRY_LINK(,,ac_cv_c_type_in_def="yes",ac_cv_c_type_in_def="no")
628 if test "$ac_cv_c_type_in_def" = "yes"
630 AC_DEFINE(NEED_TYPE_IN_DEF, 1, [Define if .type asm directive must be inside a .def directive])
633 dnl **** Check for underscore on external symbols ****
635 AC_CACHE_CHECK([whether external symbols need an underscore prefix],
636 ac_cv_c_extern_prefix,
638 LIBS="conftest_asm.s $LIBS"
639 cat > conftest_asm.s <<EOF
644 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
645 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
647 if test "$ac_cv_c_extern_prefix" = "yes"
649 AC_DEFINE(NEED_UNDERSCORE_PREFIX, 1,
650 [Define if symbols declared in assembly code need an underscore prefix])
653 dnl **** Check whether stdcall symbols need to be decorated ****
655 AC_CACHE_CHECK([whether stdcall symbols need to be decorated],
656 ac_cv_c_stdcall_decoration,
658 LIBS="conftest_asm.s $LIBS"
659 if test "$ac_cv_c_extern_prefix" = "yes"
661 cat > conftest_asm.s <<EOF
666 cat > conftest_asm.s <<EOF
671 AC_TRY_LINK([extern void __attribute__((__stdcall__)) ac_test(void);],
672 [ac_test(); return 0],
673 ac_cv_c_stdcall_decoration="yes",ac_cv_c_stdcall_decoration="no")
675 if test "$ac_cv_c_stdcall_decoration" = "yes"
677 AC_DEFINE(NEED_STDCALL_DECORATION, 1,
678 [Define if stdcall symbols need to be decorated])
681 dnl **** Check for .string in assembler ****
683 AC_CACHE_CHECK([whether assembler accepts .string],
686 LIBS="conftest_asm.s $LIBS"
687 cat > conftest_asm.s <<EOF
690 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
692 if test "$ac_cv_c_asm_string" = "yes"
694 AC_DEFINE(HAVE_ASM_STRING, 1, [Define to use .string instead of .ascii])
697 dnl **** Check for working dll ****
705 AC_CHECK_PROG(DLLWRAP,dllwrap,dllwrap,false)
706 if test "$DLLWRAP" = "dllwrap"; then
707 dnl FIXME - check whether dllwrap works correctly...
714 AC_CHECK_HEADERS(dlfcn.h,
715 [AC_CHECK_FUNCS(dlopen,,
716 [AC_CHECK_LIB(dl,dlopen,
717 [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
722 if test "$LIBEXT" = "so"
724 AC_CACHE_CHECK([whether we can build a GNU style ELF dll],ac_cv_c_dll_gnuelf,
725 [saved_cflags=$CFLAGS
726 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
727 AC_TRY_LINK(,[return 1],ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")
730 if test "$ac_cv_c_dll_gnuelf" = "yes"
732 LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
733 LDDLLFLAGS="-Wl,-Bsymbolic"
735 AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
736 ac_cv_c_dll_unixware,
737 [saved_cflags=$CFLAGS
738 CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
739 AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
742 if test "$ac_cv_c_dll_unixware" = "yes"
744 LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
745 LDDLLFLAGS="-Wl,-B,symbolic"
752 if test "$LIBEXT" = "a"; then
754 [could not find a way to build shared libraries.
755 It is currently not possible to build Wine without shared library
756 (.so) support to allow transparent switch between .so and .dll files.
757 If you are using Linux, you will need a newer binutils.]
764 if test "$LIBEXT" = "so"; then
767 LDPATH="LD_LIBRARY_PATH=\"\$(TOPOBJDIR)/library:\$(TOPOBJDIR)/unicode:\$\$LD_LIBRARY_PATH\""
768 elif test "$LIBEXT" = "dll"; then
769 #DLLFLAGS="-fPIC" # -fPIC doesn't work(at least in cygwin-b20) - FIXME
771 LDPATH="PATH=\"\$(TOPOBJDIR)/library:\$(TOPOBJDIR)/unicode:\$\$PATH\""
782 dnl **** Check for reentrant libc ****
784 dnl For cross-compiling we blindly assume that libc is reentrant. This is
785 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
787 AC_DEFUN([WINE_CHECK_ERRNO],
789 AC_CACHE_CHECK(for reentrant libc: $1, wine_cv_libc_r_$1,
790 [AC_TRY_RUN([int myerrno = 0;
792 int *$1(){return &myerrno;}
793 main(){connect(0,buf,255); exit(!myerrno);}],
794 wine_cv_libc_r_$1=yes, wine_cv_libc_r_$1=no,
795 wine_cv_libc_r_$1=yes )
797 if test "$wine_cv_libc_r_$1" = "yes"
799 wine_cv_libc_reentrant=$1
803 wine_cv_libc_reentrant=no
804 dnl Linux style errno location
805 WINE_CHECK_ERRNO(__errno_location)
806 dnl FreeBSD style errno location
807 WINE_CHECK_ERRNO(__error)
808 dnl Solaris style errno location
809 WINE_CHECK_ERRNO(___errno)
810 dnl UnixWare style errno location
811 WINE_CHECK_ERRNO(__thr_errno)
812 dnl NetBSD style errno location
813 WINE_CHECK_ERRNO(__errno)
815 if test "$wine_cv_libc_reentrant" != "no"
817 AC_DEFINE_UNQUOTED(ERRNO_LOCATION,$wine_cv_libc_reentrant,
818 [Define to the name of the function returning errno for reentrant libc])
821 dnl **** Check for reentrant X libraries ****
823 dnl This may fail to determine whether X libraries are reentrant if
824 dnl AC_PATH_XTRA does not set x_libraries.
826 if test "$have_x" = "yes"
828 AC_CACHE_CHECK( [for reentrant X libraries], wine_cv_x_reentrant,
830 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
831 if test -r $dir/libX11.so; then
832 libX11_check="-D $dir/libX11.so"
835 if test -r $dir/libX11.a; then
836 libX11_check="$dir/libX11.a"
840 if test "$libX11_check" != "none"; then
841 if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
843 wine_cv_x_reentrant=yes
845 wine_cv_x_reentrant=no
848 wine_cv_x_reentrant=unknown
852 dnl **** Check for functions ****
902 dnl **** Check for header files ****
972 dnl **** Check for types ****
976 AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t])
977 AC_CHECK_SIZEOF(long long,0)
979 AC_CACHE_CHECK([whether linux/input.h is for real],
980 wine_cv_linux_input_h,
982 #include <linux/input.h>
984 int foo = EVIOCGBIT(EV_ABS,42);
985 int bar = BTN_PINKIE;
988 wine_cv_linux_input_h=yes,
989 wine_cv_linux_input_h=no,
993 if test "$wine_cv_linux_input_h" = "yes"
995 AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H, 1,
996 [Define if we have linux/input.h AND it contains the INPUT event API])
1000 AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
1001 wine_cv_linux_gethostbyname_r_6,
1007 struct hostent *result;
1014 res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
1015 res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
1017 wine_cv_linux_gethostbyname_r_6=yes,
1018 wine_cv_linux_gethostbyname_r_6=no
1021 if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
1023 AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6, 1,
1024 [Define if Linux-style gethostbyname_r and gethostbyaddr_r are available])
1027 if test "$ac_cv_header_linux_joystick_h" = "yes"
1029 AC_CACHE_CHECK([whether linux/joystick.h uses the Linux 2.2+ API],
1030 wine_cv_linux_joystick_22_api,
1032 #include <sys/ioctl.h>
1033 #include <linux/joystick.h>
1035 struct js_event blub;
1036 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
1037 #error "no 2.2 header"
1040 wine_cv_linux_joystick_22_api=yes,
1041 wine_cv_linux_joystick_22_api=no,
1042 wine_cv_linux_joystick_22_api=no
1045 if test "$wine_cv_linux_joystick_22_api" = "yes"
1047 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API, 1,
1048 [Define if <linux/joystick.h> defines the Linux 2.2 joystick API])
1052 dnl **** statfs checks ****
1054 if test "$ac_cv_header_sys_vfs_h" = "yes"
1056 AC_CACHE_CHECK( [whether sys/vfs.h defines statfs],
1057 wine_cv_sys_vfs_has_statfs,
1059 #include <sys/types.h>
1060 #ifdef HAVE_SYS_PARAM_H
1061 # include <sys/param.h>
1063 #include <sys/vfs.h>
1067 memset(&stfs,0,sizeof(stfs));
1068 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
1071 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
1073 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS, 1,
1074 [Define if the struct statfs is defined by <sys/vfs.h>])
1078 if test "$ac_cv_header_sys_statfs_h" = "yes"
1080 AC_CACHE_CHECK( [whether sys/statfs.h defines statfs],
1081 wine_cv_sys_statfs_has_statfs,
1083 #include <sys/types.h>
1084 #ifdef HAVE_SYS_PARAM_H
1085 # include <sys/param.h>
1087 #include <sys/statfs.h>
1090 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
1093 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
1095 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS, 1,
1096 [Define if the struct statfs is defined by <sys/statfs.h>])
1100 if test "$ac_cv_header_sys_mount_h" = "yes"
1102 AC_CACHE_CHECK( [whether sys/mount.h defines statfs],
1103 wine_cv_sys_mount_has_statfs,
1105 #include <sys/types.h>
1106 #ifdef HAVE_SYS_PARAM_H
1107 # include <sys/param.h>
1109 #include <sys/mount.h>
1112 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
1115 if test "$wine_cv_sys_mount_has_statfs" = "yes"
1117 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT, 1,
1118 [Define if the struct statfs is defined by <sys/mount.h>])
1122 dnl *** Check for some structure members
1124 dnl Macro to check if a structure contains a specified member
1125 dnl Usage: WINE_CHECK_STRUCT_MEMBER(struct,member,[includes,[action-if-found,[action-if-not-found]]])
1127 AC_DEFUN([WINE_CHECK_STRUCT_MEMBER],
1128 [AC_CACHE_CHECK([for $2 in struct $1], ac_cv_c_$1_$2,
1129 AC_TRY_COMPILE([$3],[struct $1 s; s.$2 = 0],ac_cv_c_$1_$2="yes",ac_cv_c_$1_$2="no"))
1130 AS_IF([ test "x$ac_cv_c_$1_$2" = "xyes"],[$4],[$5])
1133 dnl **** FIXME: what about mixed cases, where we need two of them? ***
1135 WINE_CHECK_STRUCT_MEMBER(statfs,f_bfree,
1136 [#include <sys/types.h>
1137 #ifdef HAVE_SYS_PARAM_H
1138 # include <sys/param.h>
1140 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1141 # include <sys/mount.h>
1143 # ifdef STATFS_DEFINED_BY_SYS_VFS
1144 # include <sys/vfs.h>
1146 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1147 # include <sys/statfs.h>
1151 [AC_DEFINE(STATFS_HAS_BFREE, 1, [Define if the struct statfs has the member bfree])])
1153 WINE_CHECK_STRUCT_MEMBER(statfs,f_bavail,
1154 [#include <sys/types.h>
1155 #ifdef HAVE_SYS_PARAM_H
1156 # include <sys/param.h>
1158 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1159 # include <sys/mount.h>
1161 # ifdef STATFS_DEFINED_BY_SYS_VFS
1162 # include <sys/vfs.h>
1164 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1165 # include <sys/statfs.h>
1169 [AC_DEFINE(STATFS_HAS_BAVAIL, 1, [Define if the struct statfs has the member bavail])])
1171 dnl Check for file descriptor passing with msg_accrights
1172 WINE_CHECK_STRUCT_MEMBER(msghdr,msg_accrights,
1173 [#include <sys/types.h>
1174 #include <sys/socket.h>],
1175 [AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS, 1, [Define if struct msghdr contains msg_accrights])])
1177 dnl Check for the sa_len member in struct sockaddr
1178 WINE_CHECK_STRUCT_MEMBER(sockaddr,sa_len,
1179 [#include <sys/types.h>
1180 #include <sys/socket.h>],
1181 [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if struct sockaddr contains sa_len])])
1183 dnl Check for the sun_len member in struct sockaddr_un
1184 WINE_CHECK_STRUCT_MEMBER(sockaddr_un,sun_len,
1185 [#include <sys/types.h>
1186 #include <sys/socket.h>
1187 #include <sys/un.h>],
1188 [AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un contains sun_len])])
1190 dnl *** check for the need to define __i386__
1194 AC_CACHE_CHECK([whether we need to define __i386__],ac_cv_cpp_def_i386,
1195 AC_EGREP_CPP(yes,[#ifndef __i386__
1198 ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
1201 if test "$ac_cv_cpp_def_i386" = "yes"
1203 CFLAGS="$CFLAGS -D__i386__"
1204 LINTFLAGS="$LINTFLAGS -D__i386__"
1207 dnl **** Generate output files ****
1209 dnl Macro to create non-existent directories from config.status
1210 dnl Usage: WINE_CONFIG_EXTRA_DIR(dirname)
1211 AC_DEFUN([WINE_CONFIG_EXTRA_DIR],
1212 [AC_CONFIG_COMMANDS([$1],[test -d "$1" || (AC_MSG_NOTICE([creating $1]) && mkdir "$1")])])
1214 AH_TOP([#define __WINE_CONFIG_H])
1216 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/d3ddevice)
1217 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dclipper)
1218 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/ddraw)
1219 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/direct3d)
1220 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dpalette)
1221 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dsurface)
1222 WINE_CONFIG_EXTRA_DIR(dlls/dinput/joystick)
1223 WINE_CONFIG_EXTRA_DIR(dlls/dinput/keyboard)
1224 WINE_CONFIG_EXTRA_DIR(dlls/dinput/mouse)
1225 WINE_CONFIG_EXTRA_DIR(dlls/gdi/enhmfdrv)
1226 WINE_CONFIG_EXTRA_DIR(dlls/gdi/mfdrv)
1227 WINE_CONFIG_EXTRA_DIR(dlls/gdi/win16drv)
1228 WINE_CONFIG_EXTRA_DIR(dlls/kernel/messages)
1229 WINE_CONFIG_EXTRA_DIR(dlls/kernel/tests)
1230 WINE_CONFIG_EXTRA_DIR(dlls/oleaut32/tests)
1231 WINE_CONFIG_EXTRA_DIR(dlls/user/dde)
1232 WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
1233 WINE_CONFIG_EXTRA_DIR(dlls/user/tests)
1234 WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
1235 WINE_CONFIG_EXTRA_DIR(dlls/winsock/tests)
1236 WINE_CONFIG_EXTRA_DIR(include/wine)
1237 WINE_CONFIG_EXTRA_DIR(programs/regapi/tests)
1238 WINE_CONFIG_EXTRA_DIR(programs/winetest/tests)
1240 MAKE_RULES=Make.rules
1241 AC_SUBST_FILE(MAKE_RULES)
1243 MAKE_DLL_RULES=dlls/Makedll.rules
1244 AC_SUBST_FILE(MAKE_DLL_RULES)
1246 MAKE_PROG_RULES=programs/Makeprog.rules
1247 AC_SUBST_FILE(MAKE_PROG_RULES)
1252 programs/Makeprog.rules
1257 dlls/advapi32/Makefile
1258 dlls/avicap32/Makefile
1259 dlls/avifil32/Makefile
1260 dlls/comctl32/Makefile
1261 dlls/commdlg/Makefile
1262 dlls/crtdll/Makefile
1263 dlls/crypt32/Makefile
1264 dlls/dciman32/Makefile
1266 dlls/devenum/Makefile
1267 dlls/dinput/Makefile
1269 dlls/dplayx/Makefile
1270 dlls/dsound/Makefile
1274 dlls/imagehlp/Makefile
1276 dlls/kernel/Makefile
1277 dlls/lzexpand/Makefile
1278 dlls/mapi32/Makefile
1281 dlls/msacm/imaadp32/Makefile
1282 dlls/msacm/msg711/Makefile
1284 dlls/msimg32/Makefile
1285 dlls/msisys/Makefile
1286 dlls/msnet32/Makefile
1287 dlls/msrle32/Makefile
1288 dlls/msvcrt/Makefile
1289 dlls/msvcrt20/Makefile
1290 dlls/msvideo/Makefile
1291 dlls/netapi32/Makefile
1293 dlls/odbc32/Makefile
1295 dlls/oleaut32/Makefile
1296 dlls/olecli/Makefile
1297 dlls/oledlg/Makefile
1298 dlls/olepro32/Makefile
1299 dlls/olesvr/Makefile
1300 dlls/opengl32/Makefile
1303 dlls/quartz/Makefile
1304 dlls/rasapi32/Makefile
1305 dlls/richedit/Makefile
1306 dlls/rpcrt4/Makefile
1307 dlls/serialui/Makefile
1308 dlls/setupapi/Makefile
1309 dlls/shdocvw/Makefile
1310 dlls/shell32/Makefile
1311 dlls/shfolder/Makefile
1312 dlls/shlwapi/Makefile
1313 dlls/snmpapi/Makefile
1315 dlls/tapi32/Makefile
1316 dlls/ttydrv/Makefile
1319 dlls/urlmon/Makefile
1321 dlls/version/Makefile
1322 dlls/win32s/Makefile
1323 dlls/winaspi/Makefile
1324 dlls/winedos/Makefile
1325 dlls/wineps/Makefile
1326 dlls/wininet/Makefile
1328 dlls/winmm/joystick/Makefile
1329 dlls/winmm/mcianim/Makefile
1330 dlls/winmm/mciavi/Makefile
1331 dlls/winmm/mcicda/Makefile
1332 dlls/winmm/mciseq/Makefile
1333 dlls/winmm/mciwave/Makefile
1334 dlls/winmm/midimap/Makefile
1335 dlls/winmm/wavemap/Makefile
1336 dlls/winmm/winearts/Makefile
1337 dlls/winmm/wineoss/Makefile
1338 dlls/winnls/Makefile
1339 dlls/winsock/Makefile
1340 dlls/winspool/Makefile
1341 dlls/wintrust/Makefile
1343 dlls/wsock32/Makefile
1344 dlls/x11drv/Makefile
1345 documentation/Makefile
1348 graphics/x11drv/Makefile
1362 programs/avitools/Makefile
1363 programs/clock/Makefile
1364 programs/cmdlgtst/Makefile
1365 programs/control/Makefile
1366 programs/notepad/Makefile
1367 programs/osversioncheck/Makefile
1368 programs/progman/Makefile
1369 programs/regapi/Makefile
1370 programs/regedit/Makefile
1371 programs/regsvr32/Makefile
1372 programs/regtest/Makefile
1373 programs/uninstaller/Makefile
1374 programs/view/Makefile
1375 programs/wcmd/Makefile
1376 programs/wineconsole/Makefile
1377 programs/winemine/Makefile
1378 programs/winepath/Makefile
1379 programs/winetest/Makefile
1380 programs/winhelp/Makefile
1381 programs/winver/Makefile
1386 tools/winapi/Makefile
1387 tools/winebuild/Makefile
1388 tools/winedump/Makefile
1398 if test "$have_x" = "no"
1401 echo "*** Warning: X development files not found. Wine will be built without"
1402 echo "*** X support, which currently does not work, and would probably not be"
1403 echo "*** what you want anyway. You will need to install devel packages of"
1404 echo "*** Xlib/Xfree86 at the very least."
1407 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
1410 echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
1411 echo "*** terminal resize support. Consider upgrading ncurses."
1414 if test "$wine_cv_libc_reentrant" = "no"
1417 echo "*** Warning: non-reentrant libc detected. Wine will be built without"
1418 echo "*** threading support. Consider upgrading libc to a more recent"
1419 echo "*** reentrant version of libc."
1422 if test "$have_x" = "yes" -a "$wine_cv_x_reentrant" != "yes"
1425 echo "*** Warning: non-reentrant X11 library detected. Multi-threaded"
1426 echo "*** applications won't work properly. You should upgrade your X11 library."
1429 if test "$wine_cv_opengl_version_OK" = "no"
1432 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1433 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1436 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "x"
1439 echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
1440 echo "*** thread-safety. To prevent crashes, OpenGL support has been removed."
1441 echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine,"
1442 echo "*** start configure with '--enable-opengl' to force OpenGL support."
1445 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "xyes"
1448 echo "*** Warning: you explicitly linked in a thread-safe OpenGL version. If you"
1449 echo "*** experience unusual crashes on DirectDraw games, try first to disable OpenGL"
1450 echo "*** support before reporting bugs."
1453 if test "$wine_cv_warn_cups_h" = "yes"
1456 echo "*** Note: You have cups runtime libraries, but no development"
1457 echo "*** libraries. Install the cups-devel package or whichever package"
1458 echo "*** contains cups.h to enable CUPS support in Wine."
1461 if test "$wine_cv_msg_freetype" = "yes"
1464 echo "*** Note: Your system appears to have the FreeType 2 runtime libraries"
1465 echo "*** installed, but 'freetype-config' is not in your PATH. Install the"
1466 echo "*** freetype-devel package (or its equivalent on your distribution) to"
1467 echo "*** enable Wine to use TrueType fonts."
1471 echo "Configure finished. Do 'make depend && make' to compile Wine."
1474 dnl Local Variables:
1475 dnl comment-start: "dnl "
1477 dnl comment-start-skip: "\\bdnl\\b\\s *"
1478 dnl compile-command: "autoconf"