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 ****
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)
141 if test "$have_x" = "yes"
144 ac_save_CPPFLAGS="$CPPFLAGS"
145 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
147 dnl *** Check for -lXpm
148 AC_CHECK_HEADERS(X11/xpm.h,
149 [ dnl *** If X11/xpm.h exists...
150 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
151 [ AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
152 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
155 [ dnl *** If X11/xpm.h does not exist...
156 dnl NOTE: autoconf does not allow commas inside the third
157 dnl parameter to AC_CHECK_HEADERS, due to some quoting
159 echo "Redhat : xpm xpm-devel"
160 echo "Caldera OpenLinux : xpm xpm-devel xpm-devel-static"
162 echo "Debian/Corel Linux: xpm4g xpm4g-dev"
164 echo "Or get the sources from ftp.x.org and all its mirror sites from "
165 echo "the directory /contrib/libraries."
171 dnl *** All three of the following tests require X11/Xlib.h
172 AC_CHECK_HEADERS(X11/Xlib.h,
174 dnl *** Check for X keyboard extension
175 AC_CHECK_HEADERS(X11/XKBlib.h,
176 [ dnl *** If X11/XKBlib.h exists...
177 AC_CHECK_LIB(X11, XkbQueryExtension,
178 AC_DEFINE(HAVE_XKB),,
179 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
181 AC_MSG_WARN([XKB extension not found!!])
184 dnl *** Check for X Shm extension
185 AC_CHECK_HEADERS(X11/extensions/XShm.h,
186 [ dnl *** If X11/extensions/XShm.h exists...
187 AC_CHECK_LIB(Xext, XShmQueryExtension,
188 AC_DEFINE(HAVE_LIBXXSHM),,
189 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
191 AC_MSG_WARN([Xshm extension not found!!])
194 dnl *** Check for X shape extension
195 AC_CHECK_HEADERS(X11/extensions/shape.h,
196 [ dnl *** If X11/extensions/shape.h exists...
197 AC_CHECK_LIB(Xext,XShapeQueryExtension,
198 AC_DEFINE(HAVE_LIBXSHAPE),,
199 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
201 AC_MSG_WARN([XShape extension not found!!])
204 dnl *** Check for XFree86 DGA / DGA 2.0 extension
205 AC_CHECK_HEADERS(X11/extensions/xf86dga.h,
206 [ dnl *** If X11/extensions/xf86dga.h exists, check
207 dnl *** for XDGAQueryExtension()...
208 AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
209 [ dnl *** If found...
210 AC_DEFINE(HAVE_LIBXXF86DGA2)
211 AC_DEFINE(HAVE_LIBXXF86DGA)
212 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
214 [ dnl *** If not found, look for XF86DGAQueryExtension()
215 dnl *** instead (DGA 2.0 not found)...
216 AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
217 [ AC_DEFINE(HAVE_LIBXXF86DGA)
218 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
220 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
223 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
226 AC_MSG_WARN([DGA extension not found!!])
229 dnl *** Check for XFree86 VMODE extension
230 AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
231 [ dnl *** If X11/extensions/xf86vmode.h exists...
232 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
233 [ AC_DEFINE(HAVE_LIBXXF86VM)
234 X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
236 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
239 AC_MSG_WARN([XFree86 VMODE extension not found!!])
242 dnl *** Check for XVideo extension supporting XvImages
243 AC_CHECK_HEADERS(X11/extensions/Xvlib.h,
244 [ dnl *** If X11/extensions/Xvlib.h exists...
245 AC_CHECK_LIB(Xv, XvShmCreateImage,
246 [ AC_DEFINE(HAVE_XVIDEO)
247 X_PRE_LIBS="$X_PRE_LIBS -lXv"
249 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
252 AC_MSG_WARN([XVideo extension not found !!])
256 ) dnl *** End of X11/Xlib.h check
258 dnl Check for the presence of OpenGL
259 if test $OPENGL = "yes" -o $OPENGL = "normal"
261 AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h)
262 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
264 dnl Check for some problems due to old Mesa versions
265 AC_CACHE_CHECK("for up-to-date OpenGL version", wine_cv_opengl_version_OK,
267 [#include <GL/gl.h>],
268 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
269 [wine_cv_opengl_version_OK="yes"],
270 [wine_cv_opengl_version_OK="no"]
274 dnl Check for the thread-safety of the OpenGL library
275 AC_CACHE_CHECK("for thread-safe OpenGL version",
276 wine_cv_opengl_version_threadsafe,
279 AC_TRY_LINK([],[pthread_getspecific();],
280 [wine_cv_opengl_version_threadsafe="yes"],
281 [wine_cv_opengl_version_threadsafe="no"])
285 if test "$wine_cv_opengl_version_OK" = "yes" -a \( "$wine_cv_opengl_version_threadsafe" = "no" -o $OPENGL = "yes" \)
287 dnl Check for the presence of the library
288 AC_CHECK_LIB(GL,glXCreateContext,
289 X_PRE_LIBS="$X_PRE_LIBS -lGL"
291 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
293 if test $ac_cv_lib_GL_glXCreateContext = "yes"
296 OPENGLFILES='$(OPENGLFILES)'
297 AC_DEFINE(HAVE_OPENGL)
299 AC_CHECK_LIB(GL,glXGetProcAddressARB,AC_DEFINE(HAVE_GLX_GETPROCADDRESS),,$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
301 if test $ac_cv_lib_GL_glXGetProcAddressARB = "yes"
303 AC_CACHE_CHECK("for OpenGL extension functions prototypes", wine_cv_extension_prototypes,
304 AC_TRY_COMPILE([#include <GL/gl.h>
305 #ifdef HAVE_GL_GLEXT_H
306 # include <GL/glext.h>
309 [PFNGLCOLORTABLEEXTPROC test_proc;],
310 [wine_cv_extension_prototypes="yes"],
311 [wine_cv_extension_prototypes="no"]
314 if test $wine_cv_extension_prototypes = "yes"
316 AC_DEFINE(HAVE_GLEXT_PROTOTYPES)
319 OPENGL32_DLL=opengl32
322 AC_CHECK_HEADERS(GL/osmesa.h,
323 [ dnl *** If GL/osmesa.h exists...
324 AC_CHECK_LIB(GL, OSMesaCreateContext,
325 AC_DEFINE(HAVE_OSMESA),
326 AC_CHECK_LIB(OSMesa, OSMesaCreateContext,
327 [ AC_DEFINE(HAVE_OSMESA)
328 X_PRE_LIBS="$X_PRE_LIBS -lOSMesa"
329 ],,-lGL $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS),
330 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
335 dnl Check for GLU32 library.
336 AC_CHECK_LIB(GLU,glBegin,
337 X_PRE_LIBS="$X_PRE_LIBS -lGLU"
338 GLU32FILES='$(GLU32FILES)'
341 $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
347 CPPFLAGS="$ac_save_CPPFLAGS"
356 dnl **** Check which curses lib to use ***
357 if test "$CURSES" = "yes"
359 AC_CHECK_HEADERS(ncurses.h)
360 if test "$ac_cv_header_ncurses_h" = "yes"
362 AC_CHECK_LIB(ncurses,waddch)
364 if test "$ac_cv_lib_ncurses_waddch" = "yes"
366 AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
367 AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
369 AC_CHECK_HEADERS(curses.h)
370 if test "$ac_cv_header_curses_h" = "yes"
372 AC_CHECK_LIB(curses,waddch)
373 if test "$ac_cv_lib_curses_waddch" = "yes"
375 AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
376 AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
383 dnl **** Check for CUPS ****
384 wine_cv_warn_cups_h=no
385 AC_CHECK_LIB(cups,cupsGetPPD,
386 AC_CHECK_HEADER(cups/cups.h,
389 wine_cv_warn_cups_h=yes)
393 dnl **** Check for FreeType 2 ****
394 AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no)
395 if test "$ft_lib" = "no"
399 wine_cv_msg_freetype=no
401 AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
402 if test "$ft_devel" = "no"
404 AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
405 if test "$ft_devel2" = "freetype2-config"
410 if test "$ft_devel" = "no"
414 wine_cv_msg_freetype=yes
416 AC_DEFINE(HAVE_FREETYPE)
417 FREETYPELIBS=`$ft_devel --libs`
418 FREETYPEINCL=`$ft_devel --cflags`
419 ac_save_CPPFLAGS="$CPPFLAGS"
420 CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
421 AC_CHECK_HEADERS(freetype/freetype.h \
423 freetype/tttables.h \
425 freetype/ftsnames.h \
427 CPPFLAGS="$ac_save_CPPFLAGS"
428 wine_cv_msg_freetype=no
431 AC_SUBST(FREETYPELIBS)
432 AC_SUBST(FREETYPEINCL)
434 dnl **** Check for IPX (currently Linux only) ****
435 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
437 [#include <sys/socket.h>
438 #include <netipx/ipx.h>],
439 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
440 [ac_cv_c_ipx_gnu="yes"],
441 [ac_cv_c_ipx_gnu="no"])
443 if test "$ac_cv_c_ipx_gnu" = "yes"
445 AC_DEFINE(HAVE_IPX_GNU)
448 if test "$ac_cv_c_ipx_gnu" = "no"
450 AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
452 [#include <sys/socket.h>
453 #include <asm/types.h>
454 #include <linux/ipx.h>],
455 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
456 [ac_cv_c_ipx_linux="yes"],
457 [ac_cv_c_ipx_linux="no"])
459 if test "$ac_cv_c_ipx_linux" = "yes"
461 AC_DEFINE(HAVE_IPX_LINUX)
465 dnl **** Check for Open Sound System ****
466 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
468 AC_CACHE_CHECK("for Open Sound System",
469 ac_cv_c_opensoundsystem,
471 #if defined(HAVE_SYS_SOUNDCARD_H)
472 #include <sys/soundcard.h>
473 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
474 #include <machine/soundcard.h>
475 #elif defined(HAVE_SOUNDCARD_H)
476 #include <soundcard.h>
480 /* check for one of the Open Sound System specific SNDCTL_ defines */
481 #if !defined(SNDCTL_DSP_STEREO)
482 #error No open sound system
484 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
486 if test "$ac_cv_c_opensoundsystem" = "yes"
491 AC_CACHE_CHECK("for Open Sound System/MIDI interface",
492 ac_cv_c_opensoundsystem_midi,
494 #if defined(HAVE_SYS_SOUNDCARD_H)
495 #include <sys/soundcard.h>
496 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
497 #include <machine/soundcard.h>
498 #elif defined(HAVE_SOUNDCARD_H)
499 #include <soundcard.h>
503 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
504 #if !defined(SNDCTL_SEQ_SYNC)
505 #error No open sound system MIDI interface
507 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
509 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
511 AC_DEFINE(HAVE_OSS_MIDI)
514 dnl **** If ln -s doesn't work, use cp instead ****
515 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
517 dnl **** Check for broken glibc mmap64 ****
519 AC_CACHE_CHECK( "whether mmap64 works defined as mmap", ac_cv_mmap64_works,
521 #define _FILE_OFFSET_BITS 64
525 #include <sys/mman.h>
528 int main(int argc,char **argv) {
529 int fd = open("conftest.map",O_CREAT|O_RDWR,0600);
530 if (fd == -1) exit(1);
532 unlink("conftest.map");
536 if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) &&
542 fprintf(stderr,"success!\n");
547 ac_cv_mmap64_works="yes",
548 ac_cv_mmap64_works="no",
549 ac_cv_mmap64_works="no") )
551 if test "$ac_cv_mmap64_works" = "yes"
553 AC_DEFINE(_FILE_OFFSET_BITS, 64, [Set this to 64 to enable 64-bit file support on Linux])
556 dnl **** Check for gcc strength-reduce bug ****
558 if test "x${GCC}" = "xyes"
560 CFLAGS="$CFLAGS -Wall"
561 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
563 int L[[4]] = {0,1,2,3};
565 static int Array[[3]];
568 for(i=0; i<B; i++) Array[[i]] = i - 3;
569 for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
572 exit( Array[[1]] != -2 || L[[2]] != 3);
574 ac_cv_c_gcc_strength_bug="no",
575 ac_cv_c_gcc_strength_bug="yes",
576 ac_cv_c_gcc_strength_bug="yes") )
577 if test "$ac_cv_c_gcc_strength_bug" = "yes"
579 CFLAGS="$CFLAGS -fno-strength-reduce"
582 dnl Check for -mpreferred-stack-boundary
583 AC_CACHE_CHECK("for gcc -mpreferred-stack-boundary=2 support",
584 ac_cv_c_gcc_stack_boundary,
585 [saved_cflags=$CFLAGS
586 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
587 AC_TRY_COMPILE(,[return 0],ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")
590 if test "$ac_cv_c_gcc_stack_boundary" = "yes"
592 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
596 dnl **** Check if we need to place .type inside a .def directive ****
598 AC_CACHE_CHECK("whether .type must sit inside a .def directive",
601 LIBS="conftest_asm.s $LIBS"
602 cat > conftest_asm.s <<EOF
604 .def _ac_test; .scl 2; .type 32; .endef
608 AC_TRY_LINK(,,ac_cv_c_type_in_def="yes",ac_cv_c_type_in_def="no")
610 if test "$ac_cv_c_type_in_def" = "yes"
612 AC_DEFINE(NEED_TYPE_IN_DEF)
615 dnl **** Check for underscore on external symbols ****
617 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
618 ac_cv_c_extern_prefix,
620 LIBS="conftest_asm.s $LIBS"
621 cat > conftest_asm.s <<EOF
626 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
627 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
629 if test "$ac_cv_c_extern_prefix" = "yes"
631 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
634 dnl **** Check for .string in assembler ****
636 AC_CACHE_CHECK("whether assembler accepts .string",
639 LIBS="conftest_asm.s $LIBS"
640 cat > conftest_asm.s <<EOF
643 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
645 if test "$ac_cv_c_asm_string" = "yes"
647 AC_DEFINE(HAVE_ASM_STRING)
650 dnl **** Check for working dll ****
654 if test "$LIBEXT" = "so"
656 AC_CACHE_CHECK("whether we can build a GNU style ELF dll",
658 [saved_cflags=$CFLAGS
659 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
660 AC_TRY_LINK(,[return 1],ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")
663 if test "$ac_cv_c_dll_gnuelf" = "yes"
665 LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%) -Wl,-rpath,\$(libdir)"
666 LDDLLFLAGS="-Wl,-Bsymbolic"
668 AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
669 ac_cv_c_dll_unixware,
670 [saved_cflags=$CFLAGS
671 CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
672 AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
675 if test "$ac_cv_c_dll_unixware" = "yes"
677 LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,\$(libdir)/%)"
678 LDDLLFLAGS="-Wl,-B,symbolic"
681 if test "$ac_cv_c_dll_gnuelf" = "no" -a "$ac_cv_c_dll_unixware" = "no"
684 if test "$DLLWRAP" = "dllwrap"; then
685 dnl FIXME - check whether dllwrap works correctly...
686 if test "$CYGWIN" = "yes"; then
687 echo "*** use dllwrap for building shared library."
694 if test "$LIBEXT" = "a"; then
695 echo "*** It is currently not possible to build WINE without shared"
696 echo "*** library (.so) support to allow transparent switch between .so"
697 echo "*** and .dll files."
698 echo "*** If you are using Linux, you will need a newer binutils."
705 if test "$LIBEXT" = "so"; then
707 DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
708 LDPATH="LD_LIBRARY_PATH=\"\$(TOPOBJDIR)/unicode:\$\$LD_LIBRARY_PATH\""
709 elif test "$LIBEXT" = "dll"; then
710 #DLLFLAGS="-fPIC" # -fPIC doesn't work(at least in cygwin-b20) - FIXME
711 DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
712 LDPATH="PATH=\"\$(TOPOBJDIR)/unicode:\$\$PATH\""
714 DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) \$(LIBWINE) \$(LIBUNICODE) \$(X_LIBS) \$(XLIB)"
715 AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)],
716 ac_cv_c_whole_archive,
717 [saved_cflags=$CFLAGS
718 CFLAGS="$CFLAGS -Wl,--whole-archive -Wl,--no-whole-archive"
719 AC_TRY_LINK(,[return 1],ac_cv_c_whole_archive="yes",ac_cv_c_whole_archive="no")
722 if test "$ac_cv_c_whole_archive" = "yes"
724 DLL_LINK="-Wl,--whole-archive $DLL_LINK -Wl,--no-whole-archive"
726 AC_CACHE_CHECK([whether the linker supports -z {all,default}extract (Linux)],
728 [saved_cflags=$CFLAGS
729 CFLAGS="$CFLAGS -Wl,-z,allextract -Wl,-z,defaultextract"
730 AC_TRY_LINK(,[return 1],ac_cv_c_allextract="yes",ac_cv_c_allextract="no")
733 if test "$ac_cv_c_allextract" = "yes"
735 DLL_LINK="-Wl,-z,allextract $DLL_LINK -Wl,-z,defaultextract"
747 dnl **** Check for reentrant libc ****
749 dnl For cross-compiling we blindly assume that libc is reentrant. This is
750 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
752 AC_DEFUN(WINE_CHECK_ERRNO,
754 AC_CACHE_CHECK(for reentrant libc: $1, wine_cv_libc_r_$1,
755 [AC_TRY_RUN([int myerrno = 0;
757 int *$1(){return &myerrno;}
758 main(){connect(0,buf,255); exit(!myerrno);}],
759 wine_cv_libc_r_$1=yes, wine_cv_libc_r_$1=no,
760 wine_cv_libc_r_$1=yes )
762 if test "$wine_cv_libc_r_$1" = "yes"
764 wine_cv_libc_reentrant=$1
768 wine_cv_libc_reentrant=no
769 dnl Linux style errno location
770 WINE_CHECK_ERRNO(__errno_location)
771 dnl FreeBSD style errno location
772 WINE_CHECK_ERRNO(__error)
773 dnl Solaris style errno location
774 WINE_CHECK_ERRNO(___errno)
775 dnl UnixWare style errno location
776 WINE_CHECK_ERRNO(__thr_errno)
777 dnl NetBSD style errno location
778 WINE_CHECK_ERRNO(__errno)
780 if test "$wine_cv_libc_reentrant" != "no"
782 AC_DEFINE_UNQUOTED(ERRNO_LOCATION,$wine_cv_libc_reentrant)
785 dnl **** Check for reentrant X libraries ****
787 dnl This may fail to determine whether X libraries are reentrant if
788 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
789 dnl is possible with the --without-reentrant-x option.
791 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
793 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
794 [ if test "x$with_reentrant_x" = "xno"
796 wine_cv_x_reentrant=no
799 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
800 if test -r $dir/libX11.so; then
801 libX11_check="-D $dir/libX11.so"
804 if test -r $dir/libX11.a; then
805 libX11_check="$dir/libX11.a"
809 if test "$libX11_check" != "none"; then
810 if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
812 wine_cv_x_reentrant=yes
814 wine_cv_x_reentrant=no
817 wine_cv_x_reentrant=unknown
821 wine_cv_x_reentrant=no
823 if test "$wine_cv_x_reentrant" = "no"
825 AC_DEFINE(NO_REENTRANT_X11)
829 dnl **** Check for functions ****
870 dnl **** Check for header files ****
927 dnl **** Check for types ****
932 AC_CHECK_SIZEOF(long long,0)
934 AC_CACHE_CHECK("whether linux/input.h is for real",
935 wine_cv_linux_input_h,
937 #include <linux/input.h>
939 int foo = EVIOCGBIT(EV_ABS,42);
940 int bar = BTN_PINKIE;
943 wine_cv_linux_input_h=yes,
944 wine_cv_linux_input_h=no,
948 if test "$wine_cv_linux_input_h" = "yes"
950 AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H)
954 AC_CACHE_CHECK("whether we can use re-entrant gethostbyname_r Linux style",
955 wine_cv_linux_gethostbyname_r_6,
961 struct hostent *result;
968 res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
969 res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
971 wine_cv_linux_gethostbyname_r_6=yes,
972 wine_cv_linux_gethostbyname_r_6=no
975 if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
977 AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6)
980 if test "$ac_cv_header_linux_joystick_h" = "yes"
982 AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
983 wine_cv_linux_joystick_22_api,
985 #include <sys/ioctl.h>
986 #include <linux/joystick.h>
988 struct js_event blub;
989 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
990 #error "no 2.2 header"
993 wine_cv_linux_joystick_22_api=yes,
994 wine_cv_linux_joystick_22_api=no,
995 wine_cv_linux_joystick_22_api=no
998 if test "$wine_cv_linux_joystick_22_api" = "yes"
1000 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API)
1004 dnl **** statfs checks ****
1006 if test "$ac_cv_header_sys_vfs_h" = "yes"
1008 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
1009 wine_cv_sys_vfs_has_statfs,
1011 #include <sys/types.h>
1012 #ifdef HAVE_SYS_PARAM_H
1013 # include <sys/param.h>
1015 #include <sys/vfs.h>
1019 memset(&stfs,0,sizeof(stfs));
1020 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
1023 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
1025 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
1029 if test "$ac_cv_header_sys_statfs_h" = "yes"
1031 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
1032 wine_cv_sys_statfs_has_statfs,
1034 #include <sys/types.h>
1035 #ifdef HAVE_SYS_PARAM_H
1036 # include <sys/param.h>
1038 #include <sys/statfs.h>
1041 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
1044 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
1046 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
1050 if test "$ac_cv_header_sys_mount_h" = "yes"
1052 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
1053 wine_cv_sys_mount_has_statfs,
1055 #include <sys/types.h>
1056 #ifdef HAVE_SYS_PARAM_H
1057 # include <sys/param.h>
1059 #include <sys/mount.h>
1062 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
1065 if test "$wine_cv_sys_mount_has_statfs" = "yes"
1067 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
1071 dnl **** FIXME: what about mixed cases, where we need two of them? ***
1073 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
1074 [ if test "x$statfs_bfree" = "xno"
1076 wine_cv_statfs_bfree=no
1079 #include <sys/types.h>
1080 #ifdef HAVE_SYS_PARAM_H
1081 # include <sys/param.h>
1083 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1084 # include <sys/mount.h>
1086 # ifdef STATFS_DEFINED_BY_SYS_VFS
1087 # include <sys/vfs.h>
1089 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1090 # include <sys/statfs.h>
1098 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
1101 if test "$wine_cv_statfs_bfree" = "yes"
1103 AC_DEFINE(STATFS_HAS_BFREE)
1106 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
1107 [ if test "x$statfs_bavail" = "xno"
1109 wine_cv_statfs_bavail=no
1112 #include <sys/types.h>
1113 #ifdef HAVE_SYS_PARAM_H
1114 # include <sys/param.h>
1116 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1117 # include <sys/mount.h>
1119 # ifdef STATFS_DEFINED_BY_SYS_VFS
1120 # include <sys/vfs.h>
1122 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1123 # include <sys/statfs.h>
1131 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
1134 if test "$wine_cv_statfs_bavail" = "yes"
1136 AC_DEFINE(STATFS_HAS_BAVAIL)
1139 dnl *** check for file descriptor passing with msg_accrights
1141 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
1142 AC_TRY_COMPILE([#include <sys/types.h>
1143 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
1144 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
1145 if test "$ac_cv_c_msg_accrights" = "yes"
1147 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
1150 dnl *** Check for the sun_len member in struct sockaddr_un
1152 AC_CACHE_CHECK("for sun_len in struct sockaddr_un", ac_cv_c_sun_len,
1153 AC_TRY_COMPILE([#include <sys/types.h>
1154 #include <sys/socket.h>
1155 #include <sys/un.h>], [static struct sockaddr_un addr; addr.sun_len = 1],
1156 ac_cv_c_sun_len="yes", ac_cv_c_sun_len="no"))
1157 if test "$ac_cv_c_sun_len" = "yes"
1159 AC_DEFINE(HAVE_SOCKADDR_SUN_LEN)
1162 dnl *** check for the need to define __i386__
1164 AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
1165 AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
1168 ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
1169 if test "$ac_cv_cpp_def_i386" = "yes"
1171 CFLAGS="$CFLAGS -D__i386__"
1172 LINTFLAGS="$LINTFLAGS -D__i386__"
1175 dnl $GCC is set by autoconf
1177 if test "$GCC" = "yes"
1179 GCC_NO_BUILTIN="-fno-builtin"
1181 AC_SUBST(GCC_NO_BUILTIN)
1183 dnl **** Generate output files ****
1185 AC_OUTPUT_COMMANDS([
1187 dlls/ddraw/d3ddevice \
1188 dlls/ddraw/dclipper \
1190 dlls/ddraw/direct3d \
1191 dlls/ddraw/dpalette \
1192 dlls/ddraw/dsurface \
1193 dlls/dinput/joystick \
1194 dlls/dinput/keyboard \
1196 dlls/kernel/messages \
1197 dlls/user/resources \
1200 for i in $extra_subdirs; do [ -d $i ] || (echo "creating $i" && mkdir $i); done ])
1202 MAKE_RULES=Make.rules
1203 AC_SUBST_FILE(MAKE_RULES)
1205 MAKE_DLL_RULES=dlls/Makedll.rules
1206 AC_SUBST_FILE(MAKE_DLL_RULES)
1208 MAKE_PROG_RULES=programs/Makeprog.rules
1209 AC_SUBST_FILE(MAKE_PROG_RULES)
1214 programs/Makeprog.rules
1220 dlls/advapi32/Makefile
1221 dlls/avifil32/Makefile
1222 dlls/comctl32/Makefile
1223 dlls/commdlg/Makefile
1224 dlls/crtdll/Makefile
1225 dlls/dciman32/Makefile
1227 dlls/dinput/Makefile
1229 dlls/dplayx/Makefile
1230 dlls/dsound/Makefile
1234 dlls/imagehlp/Makefile
1236 dlls/kernel/Makefile
1237 dlls/lzexpand/Makefile
1240 dlls/msnet32/Makefile
1241 dlls/msvcrt/Makefile
1242 dlls/msvideo/Makefile
1244 dlls/odbc32/Makefile
1246 dlls/oleaut32/Makefile
1247 dlls/olecli/Makefile
1248 dlls/oledlg/Makefile
1249 dlls/olepro32/Makefile
1250 dlls/olesvr/Makefile
1251 dlls/opengl32/Makefile
1253 dlls/rasapi32/Makefile
1254 dlls/richedit/Makefile
1255 dlls/rpcrt4/Makefile
1256 dlls/serialui/Makefile
1257 dlls/setupapi/Makefile
1258 dlls/shdocvw/Makefile
1259 dlls/shell32/Makefile
1260 dlls/shfolder/Makefile
1261 dlls/shlwapi/Makefile
1262 dlls/tapi32/Makefile
1263 dlls/ttydrv/Makefile
1264 dlls/urlmon/Makefile
1266 dlls/version/Makefile
1267 dlls/win32s/Makefile
1268 dlls/winaspi/Makefile
1269 dlls/winedos/Makefile
1270 dlls/wineps/Makefile
1271 dlls/wininet/Makefile
1273 dlls/winmm/joystick/Makefile
1274 dlls/winmm/mcianim/Makefile
1275 dlls/winmm/mciavi/Makefile
1276 dlls/winmm/mcicda/Makefile
1277 dlls/winmm/mciseq/Makefile
1278 dlls/winmm/mciwave/Makefile
1279 dlls/winmm/midimap/Makefile
1280 dlls/winmm/wavemap/Makefile
1281 dlls/winmm/wineoss/Makefile
1282 dlls/winnls/Makefile
1283 dlls/winsock/Makefile
1284 dlls/winspool/Makefile
1285 dlls/wintrust/Makefile
1287 dlls/wsock32/Makefile
1288 dlls/x11drv/Makefile
1289 documentation/Makefile
1290 documentation/wine.conf.man
1291 documentation/wine.man
1294 graphics/enhmetafiledrv/Makefile
1295 graphics/metafiledrv/Makefile
1296 graphics/win16drv/Makefile
1297 graphics/x11drv/Makefile
1312 programs/avitools/Makefile
1313 programs/clock/Makefile
1314 programs/cmdlgtst/Makefile
1315 programs/control/Makefile
1316 programs/notepad/Makefile
1317 programs/osversioncheck/Makefile
1318 programs/progman/Makefile
1319 programs/regapi/Makefile
1320 programs/regtest/Makefile
1321 programs/uninstaller/Makefile
1322 programs/view/Makefile
1323 programs/wcmd/Makefile
1324 programs/winemine/Makefile
1325 programs/winetest/Makefile
1326 programs/winhelp/Makefile
1327 programs/winver/Makefile
1332 tools/cvdump/Makefile
1333 tools/specmaker/Makefile
1334 tools/winebuild/Makefile
1342 windows/x11drv/Makefile ])
1344 if test "$have_x" = "no"
1347 echo "*** Warning: X development files not found. Wine will be built without"
1348 echo "*** X support, which currently does not work, and would probably not be"
1349 echo "*** what you want anyway. You will need to install devel packages of"
1350 echo "*** Xlib/Xfree86 and Xpm at the very least."
1351 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
1354 echo "*** Warning: Xpm development files not found. Wine will be built without"
1355 echo "*** Xpm support, which currently does not work. You will need to install"
1356 echo "*** devel packages of Xpm."
1359 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
1362 echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
1363 echo "*** terminal resize support. Consider upgrading ncurses."
1366 if test "$wine_cv_libc_reentrant" = "no"
1369 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
1370 echo "*** thread support. Consider upgrading libc to a more recent"
1371 echo "*** reentrant version of libc."
1374 if test "$wine_cv_opengl_version_OK" = "no"
1377 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1378 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1381 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "normal"
1384 echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
1385 echo "*** thread-safety. To prevent crashes, OpenGL support has been removed."
1386 echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine,"
1387 echo "*** start configure with '--enable-opengl' to force OpenGL support."
1390 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "yes"
1393 echo "*** Warning: you explicitly linked in a thread-safe OpenGL version. If you"
1394 echo "*** experience unusual crashes on DirectDraw games, try first to disable OpenGL"
1395 echo "*** support before reporting bugs."
1398 if test "$wine_cv_warn_cups_h" = "yes"
1401 echo "*** Note: You have cups runtime libraries, but no development"
1402 echo "*** libraries. Install the cups-devel package or whichever package"
1403 echo "*** contains cups.h to enable CUPS support in WINE."
1406 if test "$wine_cv_msg_freetype" = "yes"
1409 echo "*** Note: Your system appears to have the FreeType 2 runtime libraries"
1410 echo "*** installed, but 'freetype-config' is not in your PATH. Install the"
1411 echo "*** freetype-devel package (or its equivalent on your distribution) to"
1412 echo "*** enable Wine to use TrueType fonts."
1416 echo "Configure finished. Do 'make depend && make' to compile Wine."
1419 dnl Local Variables:
1420 dnl comment-start: "dnl "
1422 dnl comment-start-skip: "\\bdnl\\b\\s *"
1423 dnl compile-command: "autoconf"