1 dnl Process this file with autoconf to produce a configure script.
2 dnl Author: Michael Patra <micky@marie.physik.tu-berlin.de>
3 dnl <patra@itp1.physik.tu-berlin.de>
4 AC_REVISION([configure.in 1.00])
5 AC_INIT(controls/edit.c)
6 AC_CONFIG_HEADER(include/config.h)
7 AC_CONFIG_AUX_DIR(tools)
9 dnl **** Command-line arguments ****
12 LIBEXT=so # library type .so or .a
13 TRACE_MSGS=yes # the TRACE() macro
14 DEBUG_MSGS=yes # the TRACE(), WARN(), and FIXME() macros.
19 [ --disable-debug compile out all debugging messages],
20 [if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
23 [ --enable-opengl force usage of OpenGL even if the latter is thread-safe via pthread],
24 [if test "$enableval" = "no"; then OPENGL="no"; elif test "$enableval" = "yes"; then OPENGL="yes"; fi])
27 [ --disable-trace compile out TRACE messages],
28 [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
31 [ --without-curses do not use curses],
32 [if test "$withval" = "no"; then CURSES="no"; fi])
34 AC_ARG_WITH(reentrant-x,
35 [ --without-reentrant-x compile for use with non-reentrant X libraries])
39 if test "$DEBUG_MSGS" = "no"
41 AC_DEFINE(NO_DEBUG_MSGS)
42 AC_DEFINE(NO_TRACE_MSGS)
44 if test "$TRACE_MSGS" = "no"
46 AC_DEFINE(NO_TRACE_MSGS)
50 dnl **** Check for some programs ****
58 AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
59 if test "$XLEX" = "none"
61 echo "*** Error: No suitable lex found. ***"
62 echo " Please install the 'flex' package."
69 AC_CHECK_PROG(C2MAN,c2man,c2man,\$(TOPSRCDIR)/tools/c2man.pl)
70 AC_PATH_PROG(LDCONFIG, ldconfig, true, /sbin:/usr/sbin:$PATH)
72 AC_CHECK_PROG(DLLWRAP,dllwrap,dllwrap,false)
75 AC_CHECK_PROGS(LINT, lclint lint)
76 if test "$LINT" = "lint"
78 LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
79 dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
84 if test "$CYGWIN" = "yes"
86 LDCOMBINE="ld -r --enable-stdcall-fixup"
92 dnl **** Check for some libraries ****
94 dnl Check for -lm for BeOS
96 dnl Check for -li386 for NetBSD and OpenBSD
97 AC_CHECK_LIB(i386,i386_set_ldt)
98 dnl Check for -lossaudio for NetBSD
99 AC_CHECK_LIB(ossaudio,_oss_ioctl)
100 dnl Check for -lw for Solaris
101 AC_CHECK_FUNCS(iswalnum,,AC_CHECK_LIB(w,iswalnum))
102 dnl Check for -lnsl for Solaris
103 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
104 dnl Check for -lsocket for Solaris
105 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
106 dnl Check for -lxpg4 for FreeBSD
107 AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
108 dnl Check for -lmmap for OS/2
109 AC_CHECK_LIB(mmap,mmap)
110 dnl Check for openpty
111 AC_CHECK_FUNCS(openpty,,
112 AC_CHECK_LIB(util,openpty,
113 AC_DEFINE(HAVE_OPENPTY)
117 AC_CHECK_HEADERS(dlfcn.h,
118 AC_CHECK_FUNCS(dlopen,
119 AC_DEFINE(HAVE_DL_API),
120 AC_CHECK_LIB(dl,dlopen,
121 AC_DEFINE(HAVE_DL_API)
133 AC_SUBST(OPENGLFILES)
135 AC_SUBST(OPENGL32_DLL)
137 if test "$have_x" = "yes"
140 ac_save_CPPFLAGS="$CPPFLAGS"
141 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
143 dnl *** Check for -lXpm
144 AC_CHECK_HEADERS(X11/xpm.h,
145 [ dnl *** If X11/xpm.h exists...
146 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
147 [ AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
148 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
151 [ dnl *** If X11/xpm.h does not exist...
152 dnl NOTE: autoconf does not allow commas inside the third
153 dnl parameter to AC_CHECK_HEADERS, due to some quoting
155 echo "Redhat : xpm xpm-devel"
156 echo "Caldera OpenLinux : xpm xpm-devel xpm-devel-static"
158 echo "Debian/Corel Linux: xpm4g xpm4g-dev"
160 echo "Or get the sources from ftp.x.org and all its mirror sites from "
161 echo "the directory /contrib/libraries."
167 dnl *** All three of the following tests require X11/Xlib.h
168 AC_CHECK_HEADERS(X11/Xlib.h,
170 dnl *** Check for X keyboard extension
171 AC_CHECK_HEADERS(X11/XKBlib.h,
172 [ dnl *** If X11/XKBlib.h exists...
173 AC_CHECK_LIB(X11, XkbQueryExtension,
174 AC_DEFINE(HAVE_XKB),,
175 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
177 AC_MSG_WARN([XKB extension not found!!])
180 dnl *** Check for X Shm extension
181 AC_CHECK_HEADERS(X11/extensions/XShm.h,
182 [ dnl *** If X11/extensions/XShm.h exists...
183 AC_CHECK_LIB(Xext, XShmQueryExtension,
184 AC_DEFINE(HAVE_LIBXXSHM),,
185 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
187 AC_MSG_WARN([Xshm extension not found!!])
190 dnl *** Check for X shape extension
191 AC_CHECK_HEADERS(X11/extensions/shape.h,
192 [ dnl *** If X11/extensions/shape.h exists...
193 AC_CHECK_LIB(Xext,XShapeQueryExtension,
194 AC_DEFINE(HAVE_LIBXSHAPE),,
195 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
197 AC_MSG_WARN([XShape extension not found!!])
200 dnl *** Check for XFree86 DGA / DGA 2.0 extension
201 AC_CHECK_HEADERS(X11/extensions/xf86dga.h,
202 [ dnl *** If X11/extensions/xf86dga.h exists, check
203 dnl *** for XDGAQueryExtension()...
204 AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
205 [ dnl *** If found...
206 AC_DEFINE(HAVE_LIBXXF86DGA2)
207 AC_DEFINE(HAVE_LIBXXF86DGA)
208 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
210 [ dnl *** If not found, look for XF86DGAQueryExtension()
211 dnl *** instead (DGA 2.0 not found)...
212 AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
213 [ AC_DEFINE(HAVE_LIBXXF86DGA)
214 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
216 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
219 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
222 AC_MSG_WARN([DGA extension not found!!])
225 dnl *** Check for XFree86 VMODE extension
226 AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
227 [ dnl *** If X11/extensions/xf86vmode.h exists...
228 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
229 [ AC_DEFINE(HAVE_LIBXXF86VM)
230 X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
232 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
235 AC_MSG_WARN([XFree86 VMODE extension not found!!])
238 dnl *** Check for XVideo extension supporting XvImages
239 AC_CHECK_HEADERS(X11/extensions/Xvlib.h,
240 [ dnl *** If X11/extensions/Xvlib.h exists...
241 AC_CHECK_LIB(Xv, XvShmCreateImage,
242 [ AC_DEFINE(HAVE_XVIDEO)
243 X_PRE_LIBS="$X_PRE_LIBS -lXv"
245 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
248 AC_MSG_WARN([XVideo extension not found !!])
252 ) dnl *** End of X11/Xlib.h check
254 dnl Check for the presence of OpenGL
255 if test $OPENGL = "yes" -o $OPENGL = "normal"
257 AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h)
258 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
260 dnl Check for some problems due to old Mesa versions
261 AC_CACHE_CHECK("for up-to-date OpenGL version", wine_cv_opengl_version_OK,
263 [#include <GL/gl.h>],
264 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
265 [wine_cv_opengl_version_OK="yes"],
266 [wine_cv_opengl_version_OK="no"]
270 dnl Check for the thread-safety of the OpenGL library
271 AC_CACHE_CHECK("for thread-safe OpenGL version",
272 wine_cv_opengl_version_threadsafe,
275 AC_TRY_LINK([],[pthread_getspecific();],
276 [wine_cv_opengl_version_threadsafe="yes"],
277 [wine_cv_opengl_version_threadsafe="no"])
281 if test "$wine_cv_opengl_version_OK" = "yes" -a \( "$wine_cv_opengl_version_threadsafe" = "no" -o $OPENGL = "yes" \)
283 dnl Check for the presence of the library
284 AC_CHECK_LIB(GL,glXCreateContext,
285 X_PRE_LIBS="$X_PRE_LIBS -lGL"
287 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
289 if test $ac_cv_lib_GL_glXCreateContext = "yes"
292 OPENGLFILES='$(OPENGLFILES)'
293 AC_DEFINE(HAVE_OPENGL)
295 AC_CHECK_LIB(GL,glXGetProcAddressARB,AC_DEFINE(HAVE_GLX_GETPROCADDRESS),,$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
297 if test $ac_cv_lib_GL_glXGetProcAddressARB = "yes"
299 AC_CACHE_CHECK("for OpenGL extension functions prototypes", wine_cv_extension_prototypes,
300 AC_TRY_COMPILE([#include <GL/gl.h>
301 #ifdef HAVE_GL_GLEXT_H
302 # include <GL/glext.h>
305 [PFNGLCOLORTABLEEXTPROC test_proc;],
306 [wine_cv_extension_prototypes="yes"],
307 [wine_cv_extension_prototypes="no"]
310 if test $wine_cv_extension_prototypes = "yes"
312 AC_DEFINE(HAVE_GLEXT_PROTOTYPES)
315 OPENGL32_DLL=opengl32
318 AC_CHECK_HEADERS(GL/osmesa.h,
319 [ dnl *** If GL/osmesa.h exists...
320 AC_CHECK_LIB(GL, OSMesaCreateContext,
321 AC_DEFINE(HAVE_OSMESA),
322 AC_CHECK_LIB(OSMesa, OSMesaCreateContext,
323 [ AC_DEFINE(HAVE_OSMESA)
324 X_PRE_LIBS="$X_PRE_LIBS -lOSMesa"
326 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
329 AC_MSG_WARN([OSMesa not found!!])
336 CPPFLAGS="$ac_save_CPPFLAGS"
345 dnl **** Check which curses lib to use ***
346 if test "$CURSES" = "yes"
348 AC_CHECK_HEADERS(ncurses.h)
349 if test "$ac_cv_header_ncurses_h" = "yes"
351 AC_CHECK_LIB(ncurses,waddch)
353 if test "$ac_cv_lib_ncurses_waddch" = "yes"
355 AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
356 AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
358 AC_CHECK_HEADERS(curses.h)
359 if test "$ac_cv_header_curses_h" = "yes"
361 AC_CHECK_LIB(curses,waddch)
362 if test "$ac_cv_lib_curses_waddch" = "yes"
364 AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
365 AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
372 dnl **** Check for CUPS ****
373 wine_cv_warn_cups_h=no
374 AC_CHECK_LIB(cups,cupsGetPPD,
375 AC_CHECK_HEADER(cups/cups.h,
378 wine_cv_warn_cups_h=yes)
382 dnl **** Check for IPX (currently Linux only) ****
383 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
385 [#include <sys/socket.h>
386 #include <netipx/ipx.h>],
387 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
388 [ac_cv_c_ipx_gnu="yes"],
389 [ac_cv_c_ipx_gnu="no"])
391 if test "$ac_cv_c_ipx_gnu" = "yes"
393 AC_DEFINE(HAVE_IPX_GNU)
396 if test "$ac_cv_c_ipx_gnu" = "no"
398 AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
400 [#include <sys/socket.h>
401 #include <asm/types.h>
402 #include <linux/ipx.h>],
403 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
404 [ac_cv_c_ipx_linux="yes"],
405 [ac_cv_c_ipx_linux="no"])
407 if test "$ac_cv_c_ipx_linux" = "yes"
409 AC_DEFINE(HAVE_IPX_LINUX)
413 dnl **** Check for Open Sound System ****
414 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
416 AC_CACHE_CHECK("for Open Sound System",
417 ac_cv_c_opensoundsystem,
419 #if defined(HAVE_SYS_SOUNDCARD_H)
420 #include <sys/soundcard.h>
421 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
422 #include <machine/soundcard.h>
423 #elif defined(HAVE_SOUNDCARD_H)
424 #include <soundcard.h>
428 /* check for one of the Open Sound System specific SNDCTL_ defines */
429 #if !defined(SNDCTL_DSP_STEREO)
430 #error No open sound system
432 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
434 if test "$ac_cv_c_opensoundsystem" = "yes"
439 AC_CACHE_CHECK("for Open Sound System/MIDI interface",
440 ac_cv_c_opensoundsystem_midi,
442 #if defined(HAVE_SYS_SOUNDCARD_H)
443 #include <sys/soundcard.h>
444 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
445 #include <machine/soundcard.h>
446 #elif defined(HAVE_SOUNDCARD_H)
447 #include <soundcard.h>
451 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
452 #if !defined(SNDCTL_SEQ_SYNC)
453 #error No open sound system MIDI interface
455 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
457 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
459 AC_DEFINE(HAVE_OSS_MIDI)
462 dnl **** If ln -s doesn't work, use cp instead ****
463 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
465 dnl **** Check for gcc strength-reduce bug ****
467 if test "x${GCC}" = "xyes"
469 CFLAGS="$CFLAGS -Wall"
470 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
472 int L[[4]] = {0,1,2,3};
474 static int Array[[3]];
477 for(i=0; i<B; i++) Array[[i]] = i - 3;
478 for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
481 exit( Array[[1]] != -2 || L[[2]] != 3);
483 ac_cv_c_gcc_strength_bug="no",
484 ac_cv_c_gcc_strength_bug="yes",
485 ac_cv_c_gcc_strength_bug="yes") )
486 if test "$ac_cv_c_gcc_strength_bug" = "yes"
488 CFLAGS="$CFLAGS -fno-strength-reduce"
491 dnl Check for -mpreferred-stack-boundary
492 AC_CACHE_CHECK("for gcc -mpreferred-stack-boundary=2 support",
493 ac_cv_c_gcc_stack_boundary,
494 [saved_cflags=$CFLAGS
495 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
496 AC_TRY_COMPILE(,[return 0],ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")
499 if test "$ac_cv_c_gcc_stack_boundary" = "yes"
501 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
505 dnl **** Check if we need to place .type inside a .def directive ****
507 AC_CACHE_CHECK("whether .type must sit inside a .def directive",
510 LIBS="conftest_asm.s $LIBS"
511 cat > conftest_asm.s <<EOF
513 .def _ac_test; .scl 2; .type 32; .endef
517 AC_TRY_LINK(,,ac_cv_c_type_in_def="yes",ac_cv_c_type_in_def="no")
519 if test "$ac_cv_c_type_in_def" = "yes"
521 AC_DEFINE(NEED_TYPE_IN_DEF)
524 dnl **** Check for underscore on external symbols ****
526 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
527 ac_cv_c_extern_prefix,
529 LIBS="conftest_asm.s $LIBS"
530 cat > conftest_asm.s <<EOF
535 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
536 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
538 if test "$ac_cv_c_extern_prefix" = "yes"
540 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
543 dnl **** Check for .string in assembler ****
545 AC_CACHE_CHECK("whether assembler accepts .string",
548 LIBS="conftest_asm.s $LIBS"
549 cat > conftest_asm.s <<EOF
552 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
554 if test "$ac_cv_c_asm_string" = "yes"
556 AC_DEFINE(HAVE_ASM_STRING)
559 dnl **** Check for working dll ****
563 if test "$LIBEXT" = "so"
565 AC_CACHE_CHECK("whether we can build a Linux dll",
567 [saved_cflags=$CFLAGS
568 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
569 AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
572 if test "$ac_cv_c_dll_linux" = "yes"
574 LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%) -Wl,-rpath,\$(libdir)"
575 LDDLLFLAGS="-Wl,-Bsymbolic"
577 AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
578 ac_cv_c_dll_unixware,
579 [saved_cflags=$CFLAGS
580 CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
581 AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
584 if test "$ac_cv_c_dll_unixware" = "yes"
586 LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,\$(libdir)/%)"
587 LDDLLFLAGS="-Wl,-B,symbolic"
589 AC_CACHE_CHECK("whether we can build a NetBSD dll",
591 [saved_cflags=$CFLAGS
592 CFLAGS="$CFLAGS -fPIC -Wl,-Bshareable,-Bforcearchive"
593 AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
596 if test "$ac_cv_c_dll_netbsd" = "yes"
598 LDSHARED="\$(CC) -Wl,-Bshareable,-Bforcearchive"
603 if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_unixware" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
606 if test "$DLLWRAP" = "dllwrap"; then
607 dnl FIXME - check whether dllwrap works correctly...
608 if test "$CYGWIN" = "yes"; then
609 echo "*** use dllwrap for building shared library."
616 if test "$LIBEXT" = "a"; then
617 echo "*** It is currently not possible to build WINE without shared"
618 echo "*** library (.so) support to allow transparent switch between .so"
619 echo "*** and .dll files."
620 echo "*** If you are using Linux, you will need a newer binutils."
627 if test "$LIBEXT" = "so"; then
629 DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
630 LDPATH="LD_LIBRARY_PATH=\"\$(TOPOBJDIR)/unicode:\$\$LD_LIBRARY_PATH\""
631 elif test "$LIBEXT" = "dll"; then
632 #DLLFLAGS="-fPIC" # -fPIC doesn't work(at least in cygwin-b20) - FIXME
633 DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
634 LDPATH="PATH=\"\$(TOPOBJDIR)/unicode:\$\$PATH\""
636 DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) \$(LIBWINE) \$(LIBUNICODE) \$(X_LIBS) \$(XLIB)"
637 AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)],
638 ac_cv_c_whole_archive,
639 [saved_cflags=$CFLAGS
640 CFLAGS="$CFLAGS -Wl,--whole-archive -Wl,--no-whole-archive"
641 AC_TRY_LINK(,[return 1],ac_cv_c_whole_archive="yes",ac_cv_c_whole_archive="no")
644 if test "$ac_cv_c_whole_archive" = "yes"
646 DLL_LINK="-Wl,--whole-archive $DLL_LINK -Wl,--no-whole-archive"
648 AC_CACHE_CHECK([whether the linker supports -z {all,default}extract (Linux)],
650 [saved_cflags=$CFLAGS
651 CFLAGS="$CFLAGS -Wl,-z,allextract -Wl,-z,defaultextract"
652 AC_TRY_LINK(,[return 1],ac_cv_c_allextract="yes",ac_cv_c_allextract="no")
655 if test "$ac_cv_c_allextract" = "yes"
657 DLL_LINK="-Wl,-z,allextract $DLL_LINK -Wl,-z,defaultextract"
669 dnl **** Check for reentrant libc ****
671 dnl For cross-compiling we blindly assume that libc is reentrant. This is
672 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
674 AC_DEFUN(WINE_CHECK_ERRNO,
676 AC_CACHE_CHECK(for reentrant libc: $1, wine_cv_libc_r_$1,
677 [AC_TRY_RUN([int myerrno = 0;
679 int *$1(){return &myerrno;}
680 main(){connect(0,buf,255); exit(!myerrno);}],
681 wine_cv_libc_r_$1=yes, wine_cv_libc_r_$1=no,
682 wine_cv_libc_r_$1=yes )
684 if test "$wine_cv_libc_r_$1" = "yes"
686 wine_cv_libc_reentrant=$1
690 wine_cv_libc_reentrant=no
691 dnl Linux style errno location
692 WINE_CHECK_ERRNO(__errno_location)
693 dnl FreeBSD style errno location
694 WINE_CHECK_ERRNO(__error)
695 dnl Solaris style errno location
696 WINE_CHECK_ERRNO(___errno)
697 dnl UnixWare style errno location
698 WINE_CHECK_ERRNO(__thr_errno)
700 if test "$wine_cv_libc_reentrant" != "no"
702 AC_DEFINE_UNQUOTED(ERRNO_LOCATION,$wine_cv_libc_reentrant)
705 dnl **** Check for reentrant X libraries ****
707 dnl This may fail to determine whether X libraries are reentrant if
708 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
709 dnl is possible with the --without-reentrant-x option.
711 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
713 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
714 [ if test "x$with_reentrant_x" = "xno"
716 wine_cv_x_reentrant=no
719 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
720 if test -r $dir/libX11.so; then
721 libX11_check="-D $dir/libX11.so"
724 if test -r $dir/libX11.a; then
725 libX11_check="$dir/libX11.a"
729 if test "$libX11_check" != "none"; then
730 if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
732 wine_cv_x_reentrant=yes
734 wine_cv_x_reentrant=no
737 wine_cv_x_reentrant=unknown
741 wine_cv_x_reentrant=no
743 if test "$wine_cv_x_reentrant" = "no"
745 AC_DEFINE(NO_REENTRANT_X11)
749 dnl **** Check for functions ****
788 dnl **** Check for header files ****
845 dnl **** Check for types ****
850 AC_CHECK_SIZEOF(long long,0)
852 AC_CACHE_CHECK("whether linux/input.h is for real",
853 wine_cv_linux_input_h,
855 #include <linux/input.h>
857 int foo = EVIOCGBIT(EV_ABS,42);
858 int bar = BTN_PINKIE;
861 wine_cv_linux_input_h=yes,
862 wine_cv_linux_input_h=no,
866 if test "$wine_cv_linux_input_h" = "yes"
868 AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H)
872 AC_CACHE_CHECK("whether we can use re-entrant gethostbyname_r Linux style",
873 wine_cv_linux_gethostbyname_r_6,
879 struct hostent *result;
886 res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
887 res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
889 wine_cv_linux_gethostbyname_r_6=yes,
890 wine_cv_linux_gethostbyname_r_6=no
893 if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
895 AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6)
898 if test "$ac_cv_header_linux_joystick_h" = "yes"
900 AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
901 wine_cv_linux_joystick_22_api,
903 #include <sys/ioctl.h>
904 #include <linux/joystick.h>
906 struct js_event blub;
907 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
908 #error "no 2.2 header"
911 wine_cv_linux_joystick_22_api=yes,
912 wine_cv_linux_joystick_22_api=no,
913 wine_cv_linux_joystick_22_api=no
916 if test "$wine_cv_linux_joystick_22_api" = "yes"
918 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API)
922 dnl **** statfs checks ****
924 if test "$ac_cv_header_sys_vfs_h" = "yes"
926 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
927 wine_cv_sys_vfs_has_statfs,
929 #include <sys/types.h>
930 #ifdef HAVE_SYS_PARAM_H
931 # include <sys/param.h>
937 memset(&stfs,0,sizeof(stfs));
938 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
941 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
943 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
947 if test "$ac_cv_header_sys_statfs_h" = "yes"
949 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
950 wine_cv_sys_statfs_has_statfs,
952 #include <sys/types.h>
953 #ifdef HAVE_SYS_PARAM_H
954 # include <sys/param.h>
956 #include <sys/statfs.h>
959 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
962 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
964 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
968 if test "$ac_cv_header_sys_mount_h" = "yes"
970 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
971 wine_cv_sys_mount_has_statfs,
973 #include <sys/types.h>
974 #ifdef HAVE_SYS_PARAM_H
975 # include <sys/param.h>
977 #include <sys/mount.h>
980 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
983 if test "$wine_cv_sys_mount_has_statfs" = "yes"
985 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
989 dnl **** FIXME: what about mixed cases, where we need two of them? ***
991 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
992 [ if test "x$statfs_bfree" = "xno"
994 wine_cv_statfs_bfree=no
997 #include <sys/types.h>
998 #ifdef HAVE_SYS_PARAM_H
999 # include <sys/param.h>
1001 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1002 # include <sys/mount.h>
1004 # ifdef STATFS_DEFINED_BY_SYS_VFS
1005 # include <sys/vfs.h>
1007 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1008 # include <sys/statfs.h>
1016 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
1019 if test "$wine_cv_statfs_bfree" = "yes"
1021 AC_DEFINE(STATFS_HAS_BFREE)
1024 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
1025 [ if test "x$statfs_bavail" = "xno"
1027 wine_cv_statfs_bavail=no
1030 #include <sys/types.h>
1031 #ifdef HAVE_SYS_PARAM_H
1032 # include <sys/param.h>
1034 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1035 # include <sys/mount.h>
1037 # ifdef STATFS_DEFINED_BY_SYS_VFS
1038 # include <sys/vfs.h>
1040 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1041 # include <sys/statfs.h>
1049 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
1052 if test "$wine_cv_statfs_bavail" = "yes"
1054 AC_DEFINE(STATFS_HAS_BAVAIL)
1057 dnl *** check for file descriptor passing with msg_accrights
1059 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
1060 AC_TRY_COMPILE([#include <sys/types.h>
1061 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
1062 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
1063 if test "$ac_cv_c_msg_accrights" = "yes"
1065 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
1068 dnl *** Check for the sun_len member in struct sockaddr_un
1070 AC_CACHE_CHECK("for sun_len in struct sockaddr_un", ac_cv_c_sun_len,
1071 AC_TRY_COMPILE([#include <sys/types.h>
1072 #include <sys/socket.h>
1073 #include <sys/un.h>], [static struct sockaddr_un addr; addr.sun_len = 1],
1074 ac_cv_c_sun_len="yes", ac_cv_c_sun_len="no"))
1075 if test "$ac_cv_c_sun_len" = "yes"
1077 AC_DEFINE(HAVE_SOCKADDR_SUN_LEN)
1080 dnl *** check for the need to define __i386__
1082 AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
1083 AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
1086 ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
1087 if test "$ac_cv_cpp_def_i386" = "yes"
1089 CFLAGS="$CFLAGS -D__i386__"
1090 LINTFLAGS="$LINTFLAGS -D__i386__"
1093 dnl $GCC is set by autoconf
1095 if test "$GCC" = "yes"
1097 GCC_NO_BUILTIN="-fno-builtin"
1099 AC_SUBST(GCC_NO_BUILTIN)
1101 dnl **** Generate output files ****
1103 AC_OUTPUT_COMMANDS([
1105 dlls/ddraw/d3ddevice \
1106 dlls/ddraw/dclipper \
1108 dlls/ddraw/direct3d \
1109 dlls/ddraw/dpalette \
1110 dlls/ddraw/dsurface \
1111 dlls/dinput/joystick \
1112 dlls/dinput/keyboard \
1114 dlls/kernel/messages \
1115 dlls/user/resources \
1117 for i in $extra_subdirs; do [ -d $i ] || (echo "creating $i" && mkdir $i); done ])
1119 MAKE_RULES=Make.rules
1120 AC_SUBST_FILE(MAKE_RULES)
1122 MAKE_DLL_RULES=dlls/Makedll.rules
1123 AC_SUBST_FILE(MAKE_DLL_RULES)
1125 MAKE_PROG_RULES=programs/Makeprog.rules
1126 AC_SUBST_FILE(MAKE_PROG_RULES)
1131 programs/Makeprog.rules
1137 dlls/advapi32/Makefile
1138 dlls/avifil32/Makefile
1139 dlls/comctl32/Makefile
1140 dlls/commdlg/Makefile
1141 dlls/crtdll/Makefile
1142 dlls/dciman32/Makefile
1144 dlls/dinput/Makefile
1146 dlls/dplayx/Makefile
1147 dlls/dsound/Makefile
1150 dlls/imagehlp/Makefile
1152 dlls/kernel/Makefile
1153 dlls/lzexpand/Makefile
1156 dlls/msnet32/Makefile
1157 dlls/msvcrt/Makefile
1158 dlls/msvideo/Makefile
1160 dlls/odbc32/Makefile
1162 dlls/oleaut32/Makefile
1163 dlls/olecli/Makefile
1164 dlls/oledlg/Makefile
1165 dlls/olepro32/Makefile
1166 dlls/olesvr/Makefile
1167 dlls/opengl32/Makefile
1169 dlls/rasapi32/Makefile
1170 dlls/richedit/Makefile
1171 dlls/rpcrt4/Makefile
1172 dlls/serialui/Makefile
1173 dlls/setupapi/Makefile
1174 dlls/shdocvw/Makefile
1175 dlls/shell32/Makefile
1176 dlls/shfolder/Makefile
1177 dlls/shlwapi/Makefile
1178 dlls/tapi32/Makefile
1179 dlls/ttydrv/Makefile
1180 dlls/urlmon/Makefile
1182 dlls/version/Makefile
1183 dlls/win32s/Makefile
1184 dlls/winaspi/Makefile
1185 dlls/winedos/Makefile
1186 dlls/wineps/Makefile
1187 dlls/wininet/Makefile
1189 dlls/winmm/joystick/Makefile
1190 dlls/winmm/mcianim/Makefile
1191 dlls/winmm/mciavi/Makefile
1192 dlls/winmm/mcicda/Makefile
1193 dlls/winmm/mciseq/Makefile
1194 dlls/winmm/mciwave/Makefile
1195 dlls/winmm/midimap/Makefile
1196 dlls/winmm/wavemap/Makefile
1197 dlls/winmm/wineoss/Makefile
1198 dlls/winnls/Makefile
1199 dlls/winsock/Makefile
1200 dlls/winspool/Makefile
1201 dlls/wintrust/Makefile
1203 dlls/wsock32/Makefile
1204 dlls/x11drv/Makefile
1205 documentation/Makefile
1206 documentation/wine.conf.man
1207 documentation/wine.man
1210 graphics/enhmetafiledrv/Makefile
1211 graphics/metafiledrv/Makefile
1212 graphics/win16drv/Makefile
1213 graphics/x11drv/Makefile
1228 programs/avitools/Makefile
1229 programs/clock/Makefile
1230 programs/cmdlgtst/Makefile
1231 programs/control/Makefile
1232 programs/notepad/Makefile
1233 programs/osversioncheck/Makefile
1234 programs/progman/Makefile
1235 programs/regapi/Makefile
1236 programs/regtest/Makefile
1237 programs/uninstaller/Makefile
1238 programs/view/Makefile
1239 programs/wcmd/Makefile
1240 programs/winemine/Makefile
1241 programs/winetest/Makefile
1242 programs/winhelp/Makefile
1243 programs/winver/Makefile
1248 tools/cvdump/Makefile
1249 tools/specmaker/Makefile
1250 tools/winebuild/Makefile
1258 windows/x11drv/Makefile ])
1260 if test "$have_x" = "no"
1263 echo "*** Warning: X development files not found. Wine will be built without"
1264 echo "*** X support, which currently does not work, and would probably not be"
1265 echo "*** what you want anyway. You will need to install devel packages of"
1266 echo "*** Xlib/Xfree86 and Xpm at the very least."
1267 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
1270 echo "*** Warning: Xpm development files not found. Wine will be built without"
1271 echo "*** Xpm support, which currently does not work. You will need to install"
1272 echo "*** devel packages of Xpm."
1275 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
1278 echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
1279 echo "*** terminal resize support. Consider upgrading ncurses."
1282 if test "$wine_cv_libc_reentrant" = "no"
1285 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
1286 echo "*** thread support. Consider upgrading libc to a more recent"
1287 echo "*** reentrant version of libc."
1290 if test "$wine_cv_opengl_version_OK" = "no"
1293 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1294 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1297 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "normal"
1300 echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
1301 echo "*** thread-safety. To prevent crashes, OpenGL support has been removed."
1302 echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine,"
1303 echo "*** start configure with '--enable-opengl' to force OpenGL support."
1306 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "yes"
1309 echo "*** Warning: you explicitly linked in a thread-safe OpenGL version. If you"
1310 echo "*** experience unusual crashes on DirectDraw games, try first to disable OpenGL"
1311 echo "*** support before reporting bugs."
1314 if test "$wine_cv_warn_cups_h" = "yes"
1317 echo "*** Note: You have cups runtime libraries, but no development"
1318 echo "*** libraries. Install the cups-devel package or whichever package"
1319 echo "*** contains cups.h to enable CUPS support in WINE."
1323 echo "Configure finished. Do 'make depend && make' to compile Wine."
1326 dnl Local Variables:
1327 dnl comment-start: "dnl "
1329 dnl comment-start-skip: "\\bdnl\\b\\s *"
1330 dnl compile-command: "autoconf"