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-dll build static libraries instead of DLLs],
20 [if test "$enableval" = "no"; then LIBEXT="a"; fi])
23 [ --disable-debug compile out all debugging messages],
24 [if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
27 [ --enable-opengl force usage of OpenGL even if the latter is thread-safe],
28 [if test "$enableval" = "no"; then OPENGL="no"; elif test "$enableval" = "yes"; then OPENGL="yes"; fi])
31 [ --disable-trace compile out TRACE messages],
32 [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
35 [ --without-curses do not use curses],
36 [if test "$withval" = "no"; then CURSES="no"; fi])
38 AC_ARG_WITH(reentrant-x,
39 [ --without-reentrant-x compile for use with non-reentrant X libraries])
43 if test "$DEBUG_MSGS" = "no"
45 AC_DEFINE(NO_DEBUG_MSGS)
46 AC_DEFINE(NO_TRACE_MSGS)
48 if test "$TRACE_MSGS" = "no"
50 AC_DEFINE(NO_TRACE_MSGS)
54 dnl **** Check for some programs ****
62 AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
63 if test "$XLEX" = "none"
65 echo "*** Error: No suitable lex found. ***"
66 echo " Please install the 'flex' package."
73 AC_CHECK_PROG(C2MAN,c2man,c2man,\$(TOPSRCDIR)/tools/c2man.pl)
74 AC_PATH_PROG(LDCONFIG, ldconfig, true, /sbin:/usr/sbin:$PATH)
77 AC_CHECK_PROGS(LINT, lclint lint)
78 if test "$LINT" = "lint"
80 LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
81 dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
86 dnl **** Check for some libraries ****
88 dnl Check for -lm for BeOS
90 dnl Check for -li386 for NetBSD and OpenBSD
91 AC_CHECK_LIB(i386,i386_set_ldt)
92 dnl Check for -lossaudio for NetBSD
93 AC_CHECK_LIB(ossaudio,_oss_ioctl)
94 dnl Check for -lw for Solaris
95 AC_CHECK_LIB(w,iswalnum)
96 dnl Check for -lnsl for Solaris
97 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))
98 dnl Check for -lsocket for Solaris
99 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
100 dnl Check for -lxpg4 for FreeBSD
101 AC_CHECK_LIB(xpg4,setrunelocale)
102 dnl Check for -lmmap for OS/2
103 AC_CHECK_LIB(mmap,mmap)
104 dnl Check for openpty
105 AC_CHECK_FUNCS(openpty,,
106 AC_CHECK_LIB(util,openpty,
107 AC_DEFINE(HAVE_OPENPTY)
111 AC_CHECK_HEADERS(dlfcn.h,
112 AC_CHECK_FUNCS(dlopen,
113 AC_DEFINE(HAVE_DL_API),
114 AC_CHECK_LIB(dl,dlopen,
115 AC_DEFINE(HAVE_DL_API)
127 AC_SUBST(OPENGLFILES)
129 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 Shm extension
171 AC_CHECK_HEADERS(X11/extensions/XShm.h,
172 [ dnl *** If X11/extensions/XShm.h exists...
173 AC_CHECK_LIB(Xext, XShmQueryExtension,
174 AC_DEFINE(HAVE_LIBXXSHM),,
175 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
177 AC_MSG_WARN([Xshm extension not found!!])
180 dnl *** Check for X shape extension
181 AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/shape.h,
182 [ dnl *** If X11/extensions/shape.h exists...
183 AC_CHECK_LIB(Xext,XShapeQueryExtension,
184 AC_DEFINE(HAVE_LIBXSHAPE),,
185 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
187 AC_MSG_WARN([XShape extension found!!])
190 dnl *** Check for XFree86 DGA / DGA 2.0 extension
191 AC_CHECK_HEADERS(X11/extensions/xf86dga.h,
192 [ dnl *** If X11/extensions/xf86dga.h exists, check
193 dnl *** for XDGAQueryExtension()...
194 AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
195 [ dnl *** If found...
196 AC_DEFINE(HAVE_LIBXXF86DGA2)
197 AC_DEFINE(HAVE_LIBXXF86DGA)
198 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
199 DGA_SRCS='$(DGA_SRCS)'
200 DGA2_SRCS='$(DGA2_SRCS)'
202 [ dnl *** If not found, look for XF86DGAQueryExtension()
203 dnl *** instead (DGA 2.0 not found)...
204 AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
205 [ AC_DEFINE(HAVE_LIBXXF86DGA)
206 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
207 DGA_SRCS='$(DGA_SRCS)'
209 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
212 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
215 AC_MSG_WARN([DGA extension not found!!])
218 dnl *** Check for XFree86 VMODE extension
219 AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
220 [ dnl *** If X11/extensions/xf86vmode.h exists...
221 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
222 [ AC_DEFINE(HAVE_LIBXXF86VM)
223 X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
225 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
228 AC_MSG_WARN([XFree86 VMODE extension not found!!])
231 ) dnl *** End of X11/Xlib.h check
233 dnl Check for the presence of OpenGL
234 if test $OPENGL = "yes" -o $OPENGL = "normal"
236 AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h)
237 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
239 dnl Check for some problems due to old Mesa versions
240 AC_CACHE_CHECK("for up-to-date OpenGL version", wine_cv_opengl_version_OK,
242 [#include <GL/gl.h>],
243 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
244 [wine_cv_opengl_version_OK="yes"],
245 [wine_cv_opengl_version_OK="no"]
249 dnl Check for the thread-safety of the OpenGL library
250 AC_CACHE_CHECK("for thread-safe OpenGL version",
251 wine_cv_opengl_version_threadsafe,
254 AC_TRY_LINK([],[pthread_getspecific();],
255 [wine_cv_opengl_version_threadsafe="yes"],
256 [wine_cv_opengl_version_threadsafe="no"])
260 if test "$wine_cv_opengl_version_OK" = "yes" -a \( "$wine_cv_opengl_version_threadsafe" = "no" -o $OPENGL = "yes" \)
262 dnl Check for the presence of the library
263 AC_CHECK_LIB(GL,glXCreateContext,
264 X_PRE_LIBS="$X_PRE_LIBS -lGL"
265 MESA_SRCS='$(MESA_SRCS)'
267 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
270 OPENGLFILES='$(OPENGLFILES)'
271 AC_DEFINE(HAVE_OPENGL)
273 if test $ac_cv_lib_GL_glXCreateContext = "yes"
275 AC_CHECK_LIB(GL,glXGetProcAddressARB,AC_DEFINE(HAVE_GLX_GETPROCADDRESS),,$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
277 if test $ac_cv_lib_GL_glXGetProcAddressARB = "yes"
279 AC_CACHE_CHECK("for OpenGL extension functions prototypes", wine_cv_extension_prototypes,
280 AC_TRY_COMPILE([#include <GL/gl.h>
281 #ifdef HAVE_GL_GLEXT_H
282 # include <GL/glext.h>
285 [PFNGLCOLORTABLEEXTPROC test_proc;],
286 [wine_cv_extension_prototypes="yes"],
287 [wine_cv_extension_prototypes="no"]
290 if test $wine_cv_extension_prototypes = "yes"
292 AC_DEFINE(HAVE_GLEXT_PROTOTYPES)
295 OPENGL32_DLL=opengl32
302 CPPFLAGS="$ac_save_CPPFLAGS"
311 dnl **** Check which curses lib to use ***
312 if test "$CURSES" = "yes"
314 AC_CHECK_HEADERS(ncurses.h)
315 if test "$ac_cv_header_ncurses_h" = "yes"
317 AC_CHECK_LIB(ncurses,waddch)
319 if test "$ac_cv_lib_ncurses_waddch" = "yes"
321 AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
322 AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
324 AC_CHECK_HEADERS(curses.h)
325 if test "$ac_cv_header_curses_h" = "yes"
327 AC_CHECK_LIB(curses,waddch)
328 if test "$ac_cv_lib_curses_waddch" = "yes"
330 AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
331 AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
337 dnl **** Check for IPX (currently Linux only) ****
338 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
340 [#include <sys/socket.h>
341 #include <netipx/ipx.h>],
342 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
343 [ac_cv_c_ipx_gnu="yes"],
344 [ac_cv_c_ipx_gnu="no"])
346 if test "$ac_cv_c_ipx_gnu" = "yes"
348 AC_DEFINE(HAVE_IPX_GNU)
351 if test "$ac_cv_c_ipx_gnu" = "no"
353 AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
355 [#include <sys/socket.h>
356 #include <asm/types.h>
357 #include <linux/ipx.h>],
358 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
359 [ac_cv_c_ipx_linux="yes"],
360 [ac_cv_c_ipx_linux="no"])
362 if test "$ac_cv_c_ipx_linux" = "yes"
364 AC_DEFINE(HAVE_IPX_LINUX)
368 dnl **** Check for Open Sound System ****
369 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
371 AC_CACHE_CHECK("for Open Sound System",
372 ac_cv_c_opensoundsystem,
374 #if defined(HAVE_SYS_SOUNDCARD_H)
375 #include <sys/soundcard.h>
376 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
377 #include <machine/soundcard.h>
378 #elif defined(HAVE_SOUNDCARD_H)
379 #include <soundcard.h>
383 /* check for one of the Open Sound System specific SNDCTL_ defines */
384 #if !defined(SNDCTL_DSP_STEREO)
385 #error No open sound system
387 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
389 if test "$ac_cv_c_opensoundsystem" = "yes"
394 AC_CACHE_CHECK("for Open Sound System/MIDI interface",
395 ac_cv_c_opensoundsystem_midi,
397 #if defined(HAVE_SYS_SOUNDCARD_H)
398 #include <sys/soundcard.h>
399 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
400 #include <machine/soundcard.h>
401 #elif defined(HAVE_SOUNDCARD_H)
402 #include <soundcard.h>
406 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
407 #if !defined(SNDCTL_SEQ_SYNC)
408 #error No open sound system MIDI interface
410 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
412 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
414 AC_DEFINE(HAVE_OSS_MIDI)
417 dnl **** If ln -s doesn't work, use cp instead ****
418 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
420 dnl **** Check for gcc strength-reduce bug ****
422 if test "x${GCC}" = "xyes"
424 CFLAGS="$CFLAGS -Wall"
425 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
428 static int Array[[3]];
431 for(i=0; i<B; i++) Array[[i]] = i - 3;
432 exit( Array[[1]] != -2 );
434 ac_cv_c_gcc_strength_bug="no",
435 ac_cv_c_gcc_strength_bug="yes",
436 ac_cv_c_gcc_strength_bug="yes") )
437 if test "$ac_cv_c_gcc_strength_bug" = "yes"
439 CFLAGS="$CFLAGS -fno-strength-reduce"
443 dnl **** Check for underscore on external symbols ****
445 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
446 ac_cv_c_extern_prefix,
448 LIBS="conftest_asm.s $LIBS"
449 cat > conftest_asm.s <<EOF
454 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
455 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
457 if test "$ac_cv_c_extern_prefix" = "yes"
459 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
462 dnl **** Check for .string in assembler ****
464 AC_CACHE_CHECK("whether assembler accepts .string",
467 LIBS="conftest_asm.s $LIBS"
468 cat > conftest_asm.s <<EOF
471 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
473 if test "$ac_cv_c_asm_string" = "yes"
475 AC_DEFINE(HAVE_ASM_STRING)
478 dnl **** Check for working dll ****
481 if test "$LIBEXT" = "so"
483 AC_CACHE_CHECK("whether we can build a Linux dll",
485 [saved_cflags=$CFLAGS
486 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
487 AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
490 if test "$ac_cv_c_dll_linux" = "yes"
492 LDSHARED="\$(CC) -shared -Wl,-soname,\$(SONAME),-rpath,\$(libdir)"
494 AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
495 ac_cv_c_dll_unixware,
496 [saved_cflags=$CFLAGS
497 CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0"
498 AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
501 if test "$ac_cv_c_dll_unixware" = "yes"
503 LDSHARED="\$(CC) -Wl,-G,-h,\$(libdir)/\$(SONAME)"
505 AC_CACHE_CHECK("whether we can build a NetBSD dll",
507 [saved_cflags=$CFLAGS
508 CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
509 AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
512 if test "$ac_cv_c_dll_netbsd" = "yes"
514 LDSHARED="ld -Bshareable -Bforcearchive"
518 if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_unixware" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
526 if test "$LIBEXT" = "so"; then
528 DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode"
530 DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine -lwine_unicode \$(X_LIBS) \$(XLIB)"
531 AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)],
532 ac_cv_c_whole_archive,
533 [saved_cflags=$CFLAGS
534 CFLAGS="$CFLAGS -Wl,--whole-archive -Wl,--no-whole-archive"
535 AC_TRY_LINK(,[return 1],ac_cv_c_whole_archive="yes",ac_cv_c_whole_archive="no")
538 if test "$ac_cv_c_whole_archive" = "yes"
540 DLL_LINK="-Wl,--whole-archive $DLL_LINK -Wl,--no-whole-archive"
542 AC_CACHE_CHECK([whether the linker supports -z {all,default}extract (Linux)],
544 [saved_cflags=$CFLAGS
545 CFLAGS="$CFLAGS -Wl,-z,allextract -Wl,-z,defaultextract"
546 AC_TRY_LINK(,[return 1],ac_cv_c_allextract="yes",ac_cv_c_allextract="no")
549 if test "$ac_cv_c_allextract" = "yes"
551 DLL_LINK="-Wl,-z,allextract $DLL_LINK -Wl,-z,defaultextract"
561 dnl **** Check for reentrant libc ****
563 dnl For cross-compiling we blindly assume that libc is reentrant. This is
564 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
566 wine_cv_libc_reentrant=no
568 dnl Linux style errno location
570 AC_CACHE_CHECK("for reentrant libc: __errno_location", wine_cv_libc_r__errno_location,
571 [AC_TRY_RUN([int myerrno = 0;
573 int *__errno_location(){return &myerrno;}
574 main(){connect(0,buf,255); exit(!myerrno);}],
575 wine_cv_libc_r__errno_location=yes, wine_cv_libc_r__errno_location=no,
576 wine_cv_libc_r__errno_location=yes )
578 if test "$wine_cv_libc_r__errno_location" = "yes"
580 AC_DEFINE(HAVE__ERRNO_LOCATION)
581 wine_cv_libc_reentrant=__errno_location
584 dnl FreeBSD style errno location
586 AC_CACHE_CHECK("for reentrant libc: __error", wine_cv_libc_r__error,
587 [AC_TRY_RUN([int myerrno = 0;
589 int *__error(){return &myerrno;}
590 main(){connect(0,buf,255); exit(!myerrno);}],
591 wine_cv_libc_r__error=yes, wine_cv_libc_r__error=no,
592 wine_cv_libc_r__error=yes )
594 if test "$wine_cv_libc_r__error" = "yes"
596 AC_DEFINE(HAVE__ERROR)
597 wine_cv_libc_reentrant=__error
600 dnl Solaris style errno location
602 AC_CACHE_CHECK("for reentrant libc: ___errno", wine_cv_libc_r___errno,
603 [AC_TRY_RUN([int myerrno = 0;
605 int *___errno(){return &myerrno;}
606 main(){connect(0,buf,255); exit(!myerrno);}],
607 wine_cv_libc_r___errno=yes, wine_cv_libc_r___errno=no,
608 wine_cv_libc_r___errno=yes )
610 if test "$wine_cv_libc_r___errno" = "yes"
612 AC_DEFINE(HAVE___ERRNO)
613 wine_cv_libc_reentrant=___errno
616 dnl UnixWare style errno location
618 AC_CACHE_CHECK("for reentrant libc: __thr_errno", wine_cv_libc_r__thr_errno,
619 [AC_TRY_RUN([int myerrno = 0;
621 int *__thr_errno(){return &myerrno;}
622 main(){connect(0,buf,255); exit(!myerrno);}],
623 wine_cv_libc_r__thr_errno=yes, wine_cv_libc_r__thr_errno=no,
624 wine_cv_libc_r__thr_errno=yes )
626 if test "$wine_cv_libc_r__thr_errno" = "yes"
628 AC_DEFINE(HAVE__THR_ERRNO)
629 wine_cv_libc_reentrant=__thr_errno
631 if test "$wine_cv_libc_reentrant" = "no"
633 AC_DEFINE(NO_REENTRANT_LIBC)
636 dnl **** Check for reentrant X libraries ****
638 dnl This may fail to determine whether X libraries are reentrant if
639 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
640 dnl is possible with the --without-reentrant-x option.
642 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
644 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
645 [ if test "x$with_reentrant_x" = "xno"
647 wine_cv_x_reentrant=no
650 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
651 if test -r $dir/libX11.so; then
652 libX11_check="-D $dir/libX11.so"
655 if test -r $dir/libX11.a; then
656 libX11_check="$dir/libX11.a"
660 if test "$libX11_check" != "none"; then
661 if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
663 wine_cv_x_reentrant=yes
665 wine_cv_x_reentrant=no
668 wine_cv_x_reentrant=unknown
672 wine_cv_x_reentrant=no
674 if test "$wine_cv_x_reentrant" = "no"
676 AC_DEFINE(NO_REENTRANT_X11)
679 dnl **** Check for endianness ****
683 dnl **** Check for functions ****
716 dnl **** Check for header files ****
768 dnl **** Check for types ****
773 AC_CHECK_SIZEOF(long long,0)
775 if test "$ac_cv_header_linux_joystick_h" = "yes"
777 AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
778 wine_cv_linux_joystick_22_api,
780 #include <sys/ioctl.h>
781 #include <linux/joystick.h>
783 struct js_event blub;
784 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
785 #error "no 2.2 header"
788 wine_cv_linux_joystick_22_api=yes,
789 wine_cv_linux_joystick_22_api=no,
790 wine_cv_linux_joystick_22_api=no
793 if test "$wine_cv_linux_joystick_22_api" = "yes"
795 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API)
799 dnl **** statfs checks ****
801 if test "$ac_cv_header_sys_vfs_h" = "yes"
803 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
804 wine_cv_sys_vfs_has_statfs,
806 #include <sys/types.h>
807 #ifdef HAVE_SYS_PARAM_H
808 # include <sys/param.h>
814 memset(&stfs,0,sizeof(stfs));
815 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
818 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
820 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
824 if test "$ac_cv_header_sys_statfs_h" = "yes"
826 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
827 wine_cv_sys_statfs_has_statfs,
829 #include <sys/types.h>
830 #ifdef HAVE_SYS_PARAM_H
831 # include <sys/param.h>
833 #include <sys/statfs.h>
836 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
839 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
841 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
845 if test "$ac_cv_header_sys_mount_h" = "yes"
847 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
848 wine_cv_sys_mount_has_statfs,
850 #include <sys/types.h>
851 #ifdef HAVE_SYS_PARAM_H
852 # include <sys/param.h>
854 #include <sys/mount.h>
857 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
860 if test "$wine_cv_sys_mount_has_statfs" = "yes"
862 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
866 dnl **** FIXME: what about mixed cases, where we need two of them? ***
868 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
869 [ if test "x$statfs_bfree" = "xno"
871 wine_cv_statfs_bfree=no
874 #include <sys/types.h>
875 #ifdef HAVE_SYS_PARAM_H
876 # include <sys/param.h>
878 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
879 # include <sys/mount.h>
881 # ifdef STATFS_DEFINED_BY_SYS_VFS
882 # include <sys/vfs.h>
884 # ifdef STATFS_DEFINED_BY_SYS_STATFS
885 # include <sys/statfs.h>
893 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
896 if test "$wine_cv_statfs_bfree" = "yes"
898 AC_DEFINE(STATFS_HAS_BFREE)
901 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
902 [ if test "x$statfs_bavail" = "xno"
904 wine_cv_statfs_bavail=no
907 #include <sys/types.h>
908 #ifdef HAVE_SYS_PARAM_H
909 # include <sys/param.h>
911 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
912 # include <sys/mount.h>
914 # ifdef STATFS_DEFINED_BY_SYS_VFS
915 # include <sys/vfs.h>
917 # ifdef STATFS_DEFINED_BY_SYS_STATFS
918 # include <sys/statfs.h>
926 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
929 if test "$wine_cv_statfs_bavail" = "yes"
931 AC_DEFINE(STATFS_HAS_BAVAIL)
934 dnl *** check for file descriptor passing with msg_accrights
936 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
937 AC_TRY_COMPILE([#include <sys/types.h>
938 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
939 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
940 if test "$ac_cv_c_msg_accrights" = "yes"
942 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
945 dnl *** Check for the sun_len member in struct sockaddr_un
947 AC_CACHE_CHECK("for sun_len in struct sockaddr_un", ac_cv_c_sun_len,
948 AC_TRY_COMPILE([#include <sys/types.h>
949 #include <sys/socket.h>
950 #include <sys/un.h>], [static struct sockaddr_un addr; addr.sun_len = 1],
951 ac_cv_c_sun_len="yes", ac_cv_c_sun_len="no"))
952 if test "$ac_cv_c_sun_len" = "yes"
954 AC_DEFINE(HAVE_SOCKADDR_SUN_LEN)
957 dnl *** check for the need to define __i386__
959 AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
960 AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
963 ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
964 if test "$ac_cv_cpp_def_i386" = "yes"
966 CFLAGS="$CFLAGS -D__i386__"
967 LINTFLAGS="$LINTFLAGS -D__i386__"
970 dnl $GCC is set by autoconf
972 if test "$GCC" = "yes"
974 GCC_NO_BUILTIN="-fno-builtin"
976 AC_SUBST(GCC_NO_BUILTIN)
978 dnl **** Generate output files ****
982 dlls/ddraw/d3ddevice \
983 dlls/ddraw/dclipper \
985 dlls/ddraw/direct3d \
986 dlls/ddraw/dpalette \
987 dlls/ddraw/dsurface \
988 dlls/kernel/messages \
990 for i in $extra_subdirs; do [ -d $i ] || (echo "creating $i" && mkdir $i); done ])
992 MAKE_RULES=Make.rules
993 AC_SUBST_FILE(MAKE_RULES)
995 MAKE_DLL_RULES=dlls/Makedll.rules
996 AC_SUBST_FILE(MAKE_DLL_RULES)
1006 dlls/advapi32/Makefile
1007 dlls/avifil32/Makefile
1008 dlls/comctl32/Makefile
1009 dlls/commdlg/Makefile
1010 dlls/crtdll/Makefile
1011 dlls/dciman32/Makefile
1013 dlls/dinput/Makefile
1015 dlls/dplayx/Makefile
1016 dlls/dsound/Makefile
1019 dlls/imagehlp/Makefile
1021 dlls/kernel/Makefile
1022 dlls/lzexpand/Makefile
1025 dlls/msnet32/Makefile
1026 dlls/msvideo/Makefile
1028 dlls/odbc32/Makefile
1030 dlls/oleaut32/Makefile
1031 dlls/olecli/Makefile
1032 dlls/oledlg/Makefile
1033 dlls/olepro32/Makefile
1034 dlls/olesvr/Makefile
1035 dlls/opengl32/Makefile
1037 dlls/rasapi32/Makefile
1038 dlls/richedit/Makefile
1039 dlls/rpcrt4/Makefile
1040 dlls/serialui/Makefile
1041 dlls/setupapi/Makefile
1042 dlls/shell32/Makefile
1043 dlls/shfolder/Makefile
1044 dlls/shlwapi/Makefile
1045 dlls/tapi32/Makefile
1046 dlls/ttydrv/Makefile
1047 dlls/urlmon/Makefile
1049 dlls/version/Makefile
1050 dlls/win32s/Makefile
1051 dlls/winaspi/Makefile
1052 dlls/wineps/Makefile
1053 dlls/wininet/Makefile
1055 dlls/winmm/joystick/Makefile
1056 dlls/winmm/mcianim/Makefile
1057 dlls/winmm/mciavi/Makefile
1058 dlls/winmm/mcicda/Makefile
1059 dlls/winmm/mciseq/Makefile
1060 dlls/winmm/mciwave/Makefile
1061 dlls/winmm/midimap/Makefile
1062 dlls/winmm/wavemap/Makefile
1063 dlls/winmm/wineoss/Makefile
1064 dlls/winsock/Makefile
1065 dlls/winspool/Makefile
1067 dlls/wsock32/Makefile
1068 dlls/x11drv/Makefile
1069 documentation/Makefile
1070 documentation/wine.conf.man
1071 documentation/wine.man
1074 graphics/enhmetafiledrv/Makefile
1075 graphics/metafiledrv/Makefile
1076 graphics/win16drv/Makefile
1077 graphics/x11drv/Makefile
1092 programs/avitools/Makefile
1093 programs/clock/Makefile
1094 programs/cmdlgtst/Makefile
1095 programs/control/Makefile
1096 programs/notepad/Makefile
1097 programs/osversioncheck/Makefile
1098 programs/progman/Makefile
1099 programs/regapi/Makefile
1100 programs/regtest/Makefile
1101 programs/uninstaller/Makefile
1102 programs/view/Makefile
1103 programs/wcmd/Makefile
1104 programs/winemine/Makefile
1105 programs/winhelp/Makefile
1106 programs/winver/Makefile
1112 tools/cvdump/Makefile
1113 tools/winebuild/Makefile
1120 windows/x11drv/Makefile ])
1122 if test "$have_x" = "no"
1125 echo "*** Warning: X development files not found. Wine will be built without"
1126 echo "*** X support, which currently does not work, and would probably not be"
1127 echo "*** what you want anyway. You will need to install devel packages of"
1128 echo "*** Xlib/Xfree86 and Xpm at the very least."
1129 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
1132 echo "*** Warning: Xpm development files not found. Wine will be built without"
1133 echo "*** Xpm support, which currently does not work. You will need to install"
1134 echo "*** devel packages of Xpm."
1137 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
1140 echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
1141 echo "*** terminal resize support. Consider upgrading ncurses."
1144 if test "$wine_cv_libc_reentrant" = "no"
1147 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
1148 echo "*** thread support. Consider upgrading libc to a more recent"
1149 echo "*** reentrant version of libc."
1152 if test "$wine_cv_opengl_version_OK" = "no"
1155 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1156 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1159 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "normal"
1162 echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
1163 echo "*** thread-safety. To prevent crashes, OpenGL support has been removed."
1164 echo "*** A fix for glibc 2.1.3 that seem to work is included in this version of Wine,"
1165 echo "*** start configure with '--enable-opengl' to force OpenGL support."
1168 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "yes"
1171 echo "*** Warning: you explicitely linked in a thread-safe OpenGL version. If you"
1172 echo "*** experience unusual crashes on DirectDraw games, try first to disable OpenGL"
1173 echo "*** support before reporting bugs."
1178 echo "Configure finished. Do 'make depend && make' to compile Wine."
1181 dnl Local Variables:
1182 dnl comment-start: "dnl "
1184 dnl comment-start-skip: "\\bdnl\\b\\s *"
1185 dnl compile-command: "autoconf"