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],
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)
74 AC_CHECK_PROGS(LINT, lclint lint)
75 if test "$LINT" = "lint"
77 LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
78 dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
83 if test "$CYGWIN" = "yes"
85 LDCOMBINE="ld -r --enable-stdcall-fixup"
91 dnl **** Check for some libraries ****
93 dnl Check for -lm for BeOS
95 dnl Check for -li386 for NetBSD and OpenBSD
96 AC_CHECK_LIB(i386,i386_set_ldt)
97 dnl Check for -lossaudio for NetBSD
98 AC_CHECK_LIB(ossaudio,_oss_ioctl)
99 dnl Check for -lw for Solaris
100 AC_CHECK_LIB(w,iswalnum)
101 dnl Check for -lnsl for Solaris
102 AC_CHECK_FUNCS(gethostbyname,, AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl", AC_CHECK_LIB(socket, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl", , -lnsl), -lsocket))
103 dnl Check for -lsocket for Solaris
104 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
105 dnl Check for -lxpg4 for FreeBSD
106 AC_CHECK_LIB(xpg4,setrunelocale)
107 dnl Check for -lmmap for OS/2
108 AC_CHECK_LIB(mmap,mmap)
109 dnl Check for openpty
110 AC_CHECK_FUNCS(openpty,,
111 AC_CHECK_LIB(util,openpty,
112 AC_DEFINE(HAVE_OPENPTY)
116 AC_CHECK_HEADERS(dlfcn.h,
117 AC_CHECK_FUNCS(dlopen,
118 AC_DEFINE(HAVE_DL_API),
119 AC_CHECK_LIB(dl,dlopen,
120 AC_DEFINE(HAVE_DL_API)
132 AC_SUBST(OPENGLFILES)
134 AC_SUBST(OPENGL32_DLL)
142 if test "$have_x" = "yes"
145 ac_save_CPPFLAGS="$CPPFLAGS"
146 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
148 dnl *** Check for -lXpm
149 AC_CHECK_HEADERS(X11/xpm.h,
150 [ dnl *** If X11/xpm.h exists...
151 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
152 [ AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
153 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
156 [ dnl *** If X11/xpm.h does not exist...
157 dnl NOTE: autoconf does not allow commas inside the third
158 dnl parameter to AC_CHECK_HEADERS, due to some quoting
160 echo "Redhat : xpm xpm-devel"
161 echo "Caldera OpenLinux : xpm xpm-devel xpm-devel-static"
163 echo "Debian/Corel Linux: xpm4g xpm4g-dev"
165 echo "Or get the sources from ftp.x.org and all its mirror sites from "
166 echo "the directory /contrib/libraries."
172 dnl *** All three of the following tests require X11/Xlib.h
173 AC_CHECK_HEADERS(X11/Xlib.h,
175 dnl *** Check for X Shm extension
176 AC_CHECK_HEADERS(X11/extensions/XShm.h,
177 [ dnl *** If X11/extensions/XShm.h exists...
178 AC_CHECK_LIB(Xext, XShmQueryExtension,
179 AC_DEFINE(HAVE_LIBXXSHM),,
180 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
182 AC_MSG_WARN([Xshm extension not found!!])
185 dnl *** Check for X shape extension
186 AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/shape.h,
187 [ dnl *** If X11/extensions/shape.h exists...
188 AC_CHECK_LIB(Xext,XShapeQueryExtension,
189 AC_DEFINE(HAVE_LIBXSHAPE),,
190 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
192 AC_MSG_WARN([XShape extension found!!])
195 dnl *** Check for XFree86 DGA / DGA 2.0 extension
196 AC_CHECK_HEADERS(X11/extensions/xf86dga.h,
197 [ dnl *** If X11/extensions/xf86dga.h exists, check
198 dnl *** for XDGAQueryExtension()...
199 AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
200 [ dnl *** If found...
201 AC_DEFINE(HAVE_LIBXXF86DGA2)
202 AC_DEFINE(HAVE_LIBXXF86DGA)
203 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
204 DGA_SRCS='$(DGA_SRCS)'
205 DGA2_SRCS='$(DGA2_SRCS)'
207 [ dnl *** If not found, look for XF86DGAQueryExtension()
208 dnl *** instead (DGA 2.0 not found)...
209 AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
210 [ AC_DEFINE(HAVE_LIBXXF86DGA)
211 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
212 DGA_SRCS='$(DGA_SRCS)'
214 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
217 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
220 AC_MSG_WARN([DGA extension not found!!])
223 dnl *** Check for XFree86 VMODE extension
224 AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
225 [ dnl *** If X11/extensions/xf86vmode.h exists...
226 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
227 [ AC_DEFINE(HAVE_LIBXXF86VM)
228 X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
230 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
233 AC_MSG_WARN([XFree86 VMODE extension not found!!])
236 dnl *** Check for XVideo extension supporting XvImages
237 AC_CHECK_HEADERS(X11/extensions/Xvlib.h,
238 [ dnl *** If X11/extensions/Xvlib.h exists...
239 AC_CHECK_LIB(Xv, XvShmCreateImage,
240 [ AC_DEFINE(HAVE_XVIDEO)
241 X_PRE_LIBS="$X_PRE_LIBS -lXv"
243 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
246 AC_MSG_WARN([XVideo extension not found !!])
250 ) dnl *** End of X11/Xlib.h check
252 dnl Check for the presence of OpenGL
253 if test $OPENGL = "yes" -o $OPENGL = "normal"
255 AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h)
256 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
258 dnl Check for some problems due to old Mesa versions
259 AC_CACHE_CHECK("for up-to-date OpenGL version", wine_cv_opengl_version_OK,
261 [#include <GL/gl.h>],
262 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
263 [wine_cv_opengl_version_OK="yes"],
264 [wine_cv_opengl_version_OK="no"]
268 dnl Check for the thread-safety of the OpenGL library
269 AC_CACHE_CHECK("for thread-safe OpenGL version",
270 wine_cv_opengl_version_threadsafe,
273 AC_TRY_LINK([],[pthread_getspecific();],
274 [wine_cv_opengl_version_threadsafe="yes"],
275 [wine_cv_opengl_version_threadsafe="no"])
279 if test "$wine_cv_opengl_version_OK" = "yes" -a \( "$wine_cv_opengl_version_threadsafe" = "no" -o $OPENGL = "yes" \)
281 dnl Check for the presence of the library
282 AC_CHECK_LIB(GL,glXCreateContext,
283 X_PRE_LIBS="$X_PRE_LIBS -lGL"
284 MESA_SRCS='$(MESA_SRCS)'
286 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
288 if test $ac_cv_lib_GL_glXCreateContext = "yes"
291 OPENGLFILES='$(OPENGLFILES)'
292 AC_DEFINE(HAVE_OPENGL)
294 AC_CHECK_LIB(GL,glXGetProcAddressARB,AC_DEFINE(HAVE_GLX_GETPROCADDRESS),,$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
296 if test $ac_cv_lib_GL_glXGetProcAddressARB = "yes"
298 AC_CACHE_CHECK("for OpenGL extension functions prototypes", wine_cv_extension_prototypes,
299 AC_TRY_COMPILE([#include <GL/gl.h>
300 #ifdef HAVE_GL_GLEXT_H
301 # include <GL/glext.h>
304 [PFNGLCOLORTABLEEXTPROC test_proc;],
305 [wine_cv_extension_prototypes="yes"],
306 [wine_cv_extension_prototypes="no"]
309 if test $wine_cv_extension_prototypes = "yes"
311 AC_DEFINE(HAVE_GLEXT_PROTOTYPES)
314 OPENGL32_DLL=opengl32
321 CPPFLAGS="$ac_save_CPPFLAGS"
330 dnl **** Check which curses lib to use ***
331 if test "$CURSES" = "yes"
333 AC_CHECK_HEADERS(ncurses.h)
334 if test "$ac_cv_header_ncurses_h" = "yes"
336 AC_CHECK_LIB(ncurses,waddch)
338 if test "$ac_cv_lib_ncurses_waddch" = "yes"
340 AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
341 AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
343 AC_CHECK_HEADERS(curses.h)
344 if test "$ac_cv_header_curses_h" = "yes"
346 AC_CHECK_LIB(curses,waddch)
347 if test "$ac_cv_lib_curses_waddch" = "yes"
349 AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
350 AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
356 dnl **** Check for IPX (currently Linux only) ****
357 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
359 [#include <sys/socket.h>
360 #include <netipx/ipx.h>],
361 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
362 [ac_cv_c_ipx_gnu="yes"],
363 [ac_cv_c_ipx_gnu="no"])
365 if test "$ac_cv_c_ipx_gnu" = "yes"
367 AC_DEFINE(HAVE_IPX_GNU)
370 if test "$ac_cv_c_ipx_gnu" = "no"
372 AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
374 [#include <sys/socket.h>
375 #include <asm/types.h>
376 #include <linux/ipx.h>],
377 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
378 [ac_cv_c_ipx_linux="yes"],
379 [ac_cv_c_ipx_linux="no"])
381 if test "$ac_cv_c_ipx_linux" = "yes"
383 AC_DEFINE(HAVE_IPX_LINUX)
387 dnl **** Check for Open Sound System ****
388 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
390 AC_CACHE_CHECK("for Open Sound System",
391 ac_cv_c_opensoundsystem,
393 #if defined(HAVE_SYS_SOUNDCARD_H)
394 #include <sys/soundcard.h>
395 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
396 #include <machine/soundcard.h>
397 #elif defined(HAVE_SOUNDCARD_H)
398 #include <soundcard.h>
402 /* check for one of the Open Sound System specific SNDCTL_ defines */
403 #if !defined(SNDCTL_DSP_STEREO)
404 #error No open sound system
406 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
408 if test "$ac_cv_c_opensoundsystem" = "yes"
413 AC_CACHE_CHECK("for Open Sound System/MIDI interface",
414 ac_cv_c_opensoundsystem_midi,
416 #if defined(HAVE_SYS_SOUNDCARD_H)
417 #include <sys/soundcard.h>
418 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
419 #include <machine/soundcard.h>
420 #elif defined(HAVE_SOUNDCARD_H)
421 #include <soundcard.h>
425 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
426 #if !defined(SNDCTL_SEQ_SYNC)
427 #error No open sound system MIDI interface
429 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
431 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
433 AC_DEFINE(HAVE_OSS_MIDI)
436 dnl **** If ln -s doesn't work, use cp instead ****
437 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
439 dnl **** Check for gcc strength-reduce bug ****
441 if test "x${GCC}" = "xyes"
443 CFLAGS="$CFLAGS -Wall"
444 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
446 int L[[4]] = {0,1,2,3};
448 static int Array[[3]];
451 for(i=0; i<B; i++) Array[[i]] = i - 3;
452 for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
455 exit( Array[[1]] != -2 || L[[2]] != 3);
457 ac_cv_c_gcc_strength_bug="no",
458 ac_cv_c_gcc_strength_bug="yes",
459 ac_cv_c_gcc_strength_bug="yes") )
460 if test "$ac_cv_c_gcc_strength_bug" = "yes"
462 CFLAGS="$CFLAGS -fno-strength-reduce"
465 dnl Check for -mpreferred-stack-boundary
466 AC_CACHE_CHECK("for gcc -mpreferred-stack-boundary=2 support",
467 ac_cv_c_gcc_stack_boundary,
468 [saved_cflags=$CFLAGS
469 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
470 AC_TRY_COMPILE(,[return 0],ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")
473 if test "$ac_cv_c_gcc_stack_boundary" = "yes"
475 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
479 dnl **** Check if we need to place .type inside a .def directive ****
481 AC_CACHE_CHECK("whether .type must sit inside a .def directive",
484 LIBS="conftest_asm.s $LIBS"
485 cat > conftest_asm.s <<EOF
487 .def _ac_test; .scl 2; .type 32; .endef
491 AC_TRY_LINK(,,ac_cv_c_type_in_def="yes",ac_cv_c_type_in_def="no")
493 if test "$ac_cv_c_type_in_def" = "yes"
495 AC_DEFINE(NEED_TYPE_IN_DEF)
498 dnl **** Check for underscore on external symbols ****
500 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
501 ac_cv_c_extern_prefix,
503 LIBS="conftest_asm.s $LIBS"
504 cat > conftest_asm.s <<EOF
509 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
510 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
512 if test "$ac_cv_c_extern_prefix" = "yes"
514 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
517 dnl **** Check for .string in assembler ****
519 AC_CACHE_CHECK("whether assembler accepts .string",
522 LIBS="conftest_asm.s $LIBS"
523 cat > conftest_asm.s <<EOF
526 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
528 if test "$ac_cv_c_asm_string" = "yes"
530 AC_DEFINE(HAVE_ASM_STRING)
533 dnl **** Check for working dll ****
537 if test "$LIBEXT" = "so"
539 AC_CACHE_CHECK("whether we can build a Linux dll",
541 [saved_cflags=$CFLAGS
542 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
543 AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
546 if test "$ac_cv_c_dll_linux" = "yes"
548 LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%) -Wl,-rpath,\$(libdir)"
549 LDDLLFLAGS="-Wl,-Bsymbolic"
551 AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
552 ac_cv_c_dll_unixware,
553 [saved_cflags=$CFLAGS
554 CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
555 AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
558 if test "$ac_cv_c_dll_unixware" = "yes"
560 LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,h,\$(libdir)/%)"
561 LDDLLFLAGS="-Wl,-B,symbolic"
563 AC_CACHE_CHECK("whether we can build a NetBSD dll",
565 [saved_cflags=$CFLAGS
566 CFLAGS="$CFLAGS -fPIC -Wl,-Bshareable,-Bforcearchive"
567 AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
570 if test "$ac_cv_c_dll_netbsd" = "yes"
572 LDSHARED="\$(CC) -Wl,-Bshareable,-Bforcearchive"
577 if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_unixware" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
579 echo "*** It is currently not possible to build WINE without shared"
580 echo "*** library (.so) support to allow transparent switch between .so"
581 echo "*** and .dll files."
582 echo "*** If you are using Linux, you will need a newer binutils."
589 if test "$LIBEXT" = "so"; then
591 DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
593 DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) \$(LIBWINE) \$(LIBUNICODE) \$(X_LIBS) \$(XLIB)"
594 AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)],
595 ac_cv_c_whole_archive,
596 [saved_cflags=$CFLAGS
597 CFLAGS="$CFLAGS -Wl,--whole-archive -Wl,--no-whole-archive"
598 AC_TRY_LINK(,[return 1],ac_cv_c_whole_archive="yes",ac_cv_c_whole_archive="no")
601 if test "$ac_cv_c_whole_archive" = "yes"
603 DLL_LINK="-Wl,--whole-archive $DLL_LINK -Wl,--no-whole-archive"
605 AC_CACHE_CHECK([whether the linker supports -z {all,default}extract (Linux)],
607 [saved_cflags=$CFLAGS
608 CFLAGS="$CFLAGS -Wl,-z,allextract -Wl,-z,defaultextract"
609 AC_TRY_LINK(,[return 1],ac_cv_c_allextract="yes",ac_cv_c_allextract="no")
612 if test "$ac_cv_c_allextract" = "yes"
614 DLL_LINK="-Wl,-z,allextract $DLL_LINK -Wl,-z,defaultextract"
625 dnl **** Check for reentrant libc ****
627 dnl For cross-compiling we blindly assume that libc is reentrant. This is
628 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
630 wine_cv_libc_reentrant=no
632 dnl Linux style errno location
634 AC_CACHE_CHECK("for reentrant libc: __errno_location", wine_cv_libc_r__errno_location,
635 [AC_TRY_RUN([int myerrno = 0;
637 int *__errno_location(){return &myerrno;}
638 main(){connect(0,buf,255); exit(!myerrno);}],
639 wine_cv_libc_r__errno_location=yes, wine_cv_libc_r__errno_location=no,
640 wine_cv_libc_r__errno_location=yes )
642 if test "$wine_cv_libc_r__errno_location" = "yes"
644 AC_DEFINE(HAVE__ERRNO_LOCATION)
645 wine_cv_libc_reentrant=__errno_location
648 dnl FreeBSD style errno location
650 AC_CACHE_CHECK("for reentrant libc: __error", wine_cv_libc_r__error,
651 [AC_TRY_RUN([int myerrno = 0;
653 int *__error(){return &myerrno;}
654 main(){connect(0,buf,255); exit(!myerrno);}],
655 wine_cv_libc_r__error=yes, wine_cv_libc_r__error=no,
656 wine_cv_libc_r__error=yes )
658 if test "$wine_cv_libc_r__error" = "yes"
660 AC_DEFINE(HAVE__ERROR)
661 wine_cv_libc_reentrant=__error
664 dnl Solaris style errno location
666 AC_CACHE_CHECK("for reentrant libc: ___errno", wine_cv_libc_r___errno,
667 [AC_TRY_RUN([int myerrno = 0;
669 int *___errno(){return &myerrno;}
670 main(){connect(0,buf,255); exit(!myerrno);}],
671 wine_cv_libc_r___errno=yes, wine_cv_libc_r___errno=no,
672 wine_cv_libc_r___errno=yes )
674 if test "$wine_cv_libc_r___errno" = "yes"
676 AC_DEFINE(HAVE___ERRNO)
677 wine_cv_libc_reentrant=___errno
680 dnl UnixWare style errno location
682 AC_CACHE_CHECK("for reentrant libc: __thr_errno", wine_cv_libc_r__thr_errno,
683 [AC_TRY_RUN([int myerrno = 0;
685 int *__thr_errno(){return &myerrno;}
686 main(){connect(0,buf,255); exit(!myerrno);}],
687 wine_cv_libc_r__thr_errno=yes, wine_cv_libc_r__thr_errno=no,
688 wine_cv_libc_r__thr_errno=yes )
690 if test "$wine_cv_libc_r__thr_errno" = "yes"
692 AC_DEFINE(HAVE__THR_ERRNO)
693 wine_cv_libc_reentrant=__thr_errno
695 if test "$wine_cv_libc_reentrant" = "no"
697 AC_DEFINE(NO_REENTRANT_LIBC)
700 dnl **** Check for reentrant X libraries ****
702 dnl This may fail to determine whether X libraries are reentrant if
703 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
704 dnl is possible with the --without-reentrant-x option.
706 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
708 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
709 [ if test "x$with_reentrant_x" = "xno"
711 wine_cv_x_reentrant=no
714 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
715 if test -r $dir/libX11.so; then
716 libX11_check="-D $dir/libX11.so"
719 if test -r $dir/libX11.a; then
720 libX11_check="$dir/libX11.a"
724 if test "$libX11_check" != "none"; then
725 if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
727 wine_cv_x_reentrant=yes
729 wine_cv_x_reentrant=no
732 wine_cv_x_reentrant=unknown
736 wine_cv_x_reentrant=no
738 if test "$wine_cv_x_reentrant" = "no"
740 AC_DEFINE(NO_REENTRANT_X11)
743 dnl **** Check for endianness ****
747 dnl **** Check for functions ****
785 dnl **** Check for header files ****
841 dnl **** Check for types ****
846 AC_CHECK_SIZEOF(long long,0)
849 AC_CACHE_CHECK("whether we can use re-entrant gethostbyname_r Linux style",
850 wine_cv_linux_gethostbyname_r_6,
856 struct hostent *result;
863 res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
864 res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
866 wine_cv_linux_gethostbyname_r_6=yes,
867 wine_cv_linux_gethostbyname_r_6=no
870 if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
872 AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6)
875 if test "$ac_cv_header_linux_joystick_h" = "yes"
877 AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
878 wine_cv_linux_joystick_22_api,
880 #include <sys/ioctl.h>
881 #include <linux/joystick.h>
883 struct js_event blub;
884 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
885 #error "no 2.2 header"
888 wine_cv_linux_joystick_22_api=yes,
889 wine_cv_linux_joystick_22_api=no,
890 wine_cv_linux_joystick_22_api=no
893 if test "$wine_cv_linux_joystick_22_api" = "yes"
895 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API)
899 dnl **** statfs checks ****
901 if test "$ac_cv_header_sys_vfs_h" = "yes"
903 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
904 wine_cv_sys_vfs_has_statfs,
906 #include <sys/types.h>
907 #ifdef HAVE_SYS_PARAM_H
908 # include <sys/param.h>
914 memset(&stfs,0,sizeof(stfs));
915 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
918 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
920 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
924 if test "$ac_cv_header_sys_statfs_h" = "yes"
926 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
927 wine_cv_sys_statfs_has_statfs,
929 #include <sys/types.h>
930 #ifdef HAVE_SYS_PARAM_H
931 # include <sys/param.h>
933 #include <sys/statfs.h>
936 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
939 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
941 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
945 if test "$ac_cv_header_sys_mount_h" = "yes"
947 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
948 wine_cv_sys_mount_has_statfs,
950 #include <sys/types.h>
951 #ifdef HAVE_SYS_PARAM_H
952 # include <sys/param.h>
954 #include <sys/mount.h>
957 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
960 if test "$wine_cv_sys_mount_has_statfs" = "yes"
962 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
966 dnl **** FIXME: what about mixed cases, where we need two of them? ***
968 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
969 [ if test "x$statfs_bfree" = "xno"
971 wine_cv_statfs_bfree=no
974 #include <sys/types.h>
975 #ifdef HAVE_SYS_PARAM_H
976 # include <sys/param.h>
978 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
979 # include <sys/mount.h>
981 # ifdef STATFS_DEFINED_BY_SYS_VFS
982 # include <sys/vfs.h>
984 # ifdef STATFS_DEFINED_BY_SYS_STATFS
985 # include <sys/statfs.h>
993 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
996 if test "$wine_cv_statfs_bfree" = "yes"
998 AC_DEFINE(STATFS_HAS_BFREE)
1001 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
1002 [ if test "x$statfs_bavail" = "xno"
1004 wine_cv_statfs_bavail=no
1007 #include <sys/types.h>
1008 #ifdef HAVE_SYS_PARAM_H
1009 # include <sys/param.h>
1011 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1012 # include <sys/mount.h>
1014 # ifdef STATFS_DEFINED_BY_SYS_VFS
1015 # include <sys/vfs.h>
1017 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1018 # include <sys/statfs.h>
1026 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
1029 if test "$wine_cv_statfs_bavail" = "yes"
1031 AC_DEFINE(STATFS_HAS_BAVAIL)
1034 dnl *** check for file descriptor passing with msg_accrights
1036 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
1037 AC_TRY_COMPILE([#include <sys/types.h>
1038 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
1039 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
1040 if test "$ac_cv_c_msg_accrights" = "yes"
1042 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
1045 dnl *** Check for the sun_len member in struct sockaddr_un
1047 AC_CACHE_CHECK("for sun_len in struct sockaddr_un", ac_cv_c_sun_len,
1048 AC_TRY_COMPILE([#include <sys/types.h>
1049 #include <sys/socket.h>
1050 #include <sys/un.h>], [static struct sockaddr_un addr; addr.sun_len = 1],
1051 ac_cv_c_sun_len="yes", ac_cv_c_sun_len="no"))
1052 if test "$ac_cv_c_sun_len" = "yes"
1054 AC_DEFINE(HAVE_SOCKADDR_SUN_LEN)
1057 dnl *** check for the need to define __i386__
1059 AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
1060 AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
1063 ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
1064 if test "$ac_cv_cpp_def_i386" = "yes"
1066 CFLAGS="$CFLAGS -D__i386__"
1067 LINTFLAGS="$LINTFLAGS -D__i386__"
1070 dnl $GCC is set by autoconf
1072 if test "$GCC" = "yes"
1074 GCC_NO_BUILTIN="-fno-builtin"
1076 AC_SUBST(GCC_NO_BUILTIN)
1078 dnl **** Generate output files ****
1080 AC_OUTPUT_COMMANDS([
1082 dlls/ddraw/d3ddevice \
1083 dlls/ddraw/dclipper \
1085 dlls/ddraw/direct3d \
1086 dlls/ddraw/dpalette \
1087 dlls/ddraw/dsurface \
1088 dlls/dinput/joystick \
1089 dlls/dinput/keyboard \
1091 dlls/kernel/messages \
1092 dlls/user/resources \
1094 for i in $extra_subdirs; do [ -d $i ] || (echo "creating $i" && mkdir $i); done ])
1096 MAKE_RULES=Make.rules
1097 AC_SUBST_FILE(MAKE_RULES)
1099 MAKE_DLL_RULES=dlls/Makedll.rules
1100 AC_SUBST_FILE(MAKE_DLL_RULES)
1102 MAKE_PROG_RULES=programs/Makeprog.rules
1103 AC_SUBST_FILE(MAKE_PROG_RULES)
1108 programs/Makeprog.rules
1114 dlls/advapi32/Makefile
1115 dlls/avifil32/Makefile
1116 dlls/comctl32/Makefile
1117 dlls/commdlg/Makefile
1118 dlls/crtdll/Makefile
1119 dlls/dciman32/Makefile
1121 dlls/dinput/Makefile
1123 dlls/dplayx/Makefile
1124 dlls/dsound/Makefile
1127 dlls/imagehlp/Makefile
1129 dlls/kernel/Makefile
1130 dlls/lzexpand/Makefile
1133 dlls/msnet32/Makefile
1134 dlls/msvideo/Makefile
1136 dlls/odbc32/Makefile
1138 dlls/oleaut32/Makefile
1139 dlls/olecli/Makefile
1140 dlls/oledlg/Makefile
1141 dlls/olepro32/Makefile
1142 dlls/olesvr/Makefile
1143 dlls/opengl32/Makefile
1145 dlls/rasapi32/Makefile
1146 dlls/richedit/Makefile
1147 dlls/rpcrt4/Makefile
1148 dlls/serialui/Makefile
1149 dlls/setupapi/Makefile
1150 dlls/shell32/Makefile
1151 dlls/shfolder/Makefile
1152 dlls/shlwapi/Makefile
1153 dlls/tapi32/Makefile
1154 dlls/ttydrv/Makefile
1155 dlls/urlmon/Makefile
1157 dlls/version/Makefile
1158 dlls/win32s/Makefile
1159 dlls/winaspi/Makefile
1160 dlls/wineps/Makefile
1161 dlls/wininet/Makefile
1163 dlls/winmm/joystick/Makefile
1164 dlls/winmm/mcianim/Makefile
1165 dlls/winmm/mciavi/Makefile
1166 dlls/winmm/mcicda/Makefile
1167 dlls/winmm/mciseq/Makefile
1168 dlls/winmm/mciwave/Makefile
1169 dlls/winmm/midimap/Makefile
1170 dlls/winmm/wavemap/Makefile
1171 dlls/winmm/wineoss/Makefile
1172 dlls/winnls/Makefile
1173 dlls/winsock/Makefile
1174 dlls/winspool/Makefile
1176 dlls/wsock32/Makefile
1177 dlls/x11drv/Makefile
1178 documentation/Makefile
1179 documentation/wine.conf.man
1180 documentation/wine.man
1183 graphics/enhmetafiledrv/Makefile
1184 graphics/metafiledrv/Makefile
1185 graphics/win16drv/Makefile
1186 graphics/x11drv/Makefile
1201 programs/avitools/Makefile
1202 programs/clock/Makefile
1203 programs/cmdlgtst/Makefile
1204 programs/control/Makefile
1205 programs/notepad/Makefile
1206 programs/osversioncheck/Makefile
1207 programs/progman/Makefile
1208 programs/regapi/Makefile
1209 programs/regtest/Makefile
1210 programs/uninstaller/Makefile
1211 programs/view/Makefile
1212 programs/wcmd/Makefile
1213 programs/winemine/Makefile
1214 programs/winhelp/Makefile
1215 programs/winver/Makefile
1220 tools/cvdump/Makefile
1221 tools/winebuild/Makefile
1229 windows/x11drv/Makefile ])
1231 if test "$have_x" = "no"
1234 echo "*** Warning: X development files not found. Wine will be built without"
1235 echo "*** X support, which currently does not work, and would probably not be"
1236 echo "*** what you want anyway. You will need to install devel packages of"
1237 echo "*** Xlib/Xfree86 and Xpm at the very least."
1238 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
1241 echo "*** Warning: Xpm development files not found. Wine will be built without"
1242 echo "*** Xpm support, which currently does not work. You will need to install"
1243 echo "*** devel packages of Xpm."
1246 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
1249 echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
1250 echo "*** terminal resize support. Consider upgrading ncurses."
1253 if test "$wine_cv_libc_reentrant" = "no"
1256 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
1257 echo "*** thread support. Consider upgrading libc to a more recent"
1258 echo "*** reentrant version of libc."
1261 if test "$wine_cv_opengl_version_OK" = "no"
1264 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1265 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1268 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "normal"
1271 echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
1272 echo "*** thread-safety. To prevent crashes, OpenGL support has been removed."
1273 echo "*** A fix for glibc 2.1.3 that seem to work is included in this version of Wine,"
1274 echo "*** start configure with '--enable-opengl' to force OpenGL support."
1277 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "yes"
1280 echo "*** Warning: you explicitely linked in a thread-safe OpenGL version. If you"
1281 echo "*** experience unusual crashes on DirectDraw games, try first to disable OpenGL"
1282 echo "*** support before reporting bugs."
1287 echo "Configure finished. Do 'make depend && make' to compile Wine."
1290 dnl Local Variables:
1291 dnl comment-start: "dnl "
1293 dnl comment-start-skip: "\\bdnl\\b\\s *"
1294 dnl compile-command: "autoconf"