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."
68 AC_CHECK_PROG(C2MAN,c2man,c2man,\$(TOPSRCDIR)/tools/c2man.pl)
69 AC_PATH_PROG(LDCONFIG, ldconfig, true, /sbin:/usr/sbin:$PATH)
71 AC_CHECK_PROG(DLLWRAP,dllwrap,dllwrap,false)
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 ****
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_FUNCS(iswalnum,,AC_CHECK_LIB(w,iswalnum))
101 dnl Check for -lnsl for Solaris
102 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
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,_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)
140 if test "$have_x" = "yes"
143 ac_save_CPPFLAGS="$CPPFLAGS"
144 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
146 dnl *** Check for -lXpm
147 AC_CHECK_HEADERS(X11/xpm.h,
148 [ dnl *** If X11/xpm.h exists...
149 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
150 [ AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
151 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
154 [ dnl *** If X11/xpm.h does not exist...
155 dnl NOTE: autoconf does not allow commas inside the third
156 dnl parameter to AC_CHECK_HEADERS, due to some quoting
158 echo "Redhat : xpm xpm-devel"
159 echo "Caldera OpenLinux : xpm xpm-devel xpm-devel-static"
161 echo "Debian/Corel Linux: xpm4g xpm4g-dev"
163 echo "Or get the sources from ftp.x.org and all its mirror sites from "
164 echo "the directory /contrib/libraries."
170 dnl *** All three of the following tests require X11/Xlib.h
171 AC_CHECK_HEADERS(X11/Xlib.h,
173 dnl *** Check for X keyboard extension
174 AC_CHECK_HEADERS(X11/XKBlib.h,
175 [ dnl *** If X11/XKBlib.h exists...
176 AC_CHECK_LIB(X11, XkbQueryExtension,
177 AC_DEFINE(HAVE_XKB),,
178 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
180 AC_MSG_WARN([XKB extension not found!!])
183 dnl *** Check for X Shm extension
184 AC_CHECK_HEADERS(X11/extensions/XShm.h,
185 [ dnl *** If X11/extensions/XShm.h exists...
186 AC_CHECK_LIB(Xext, XShmQueryExtension,
187 AC_DEFINE(HAVE_LIBXXSHM),,
188 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
190 AC_MSG_WARN([Xshm extension not found!!])
193 dnl *** Check for X shape extension
194 AC_CHECK_HEADERS(X11/extensions/shape.h,
195 [ dnl *** If X11/extensions/shape.h exists...
196 AC_CHECK_LIB(Xext,XShapeQueryExtension,
197 AC_DEFINE(HAVE_LIBXSHAPE),,
198 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
200 AC_MSG_WARN([XShape extension not found!!])
203 dnl *** Check for XFree86 DGA / DGA 2.0 extension
204 AC_CHECK_HEADERS(X11/extensions/xf86dga.h,
205 [ dnl *** If X11/extensions/xf86dga.h exists, check
206 dnl *** for XDGAQueryExtension()...
207 AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
208 [ dnl *** If found...
209 AC_DEFINE(HAVE_LIBXXF86DGA2)
210 AC_DEFINE(HAVE_LIBXXF86DGA)
211 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
213 [ dnl *** If not found, look for XF86DGAQueryExtension()
214 dnl *** instead (DGA 2.0 not found)...
215 AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
216 [ AC_DEFINE(HAVE_LIBXXF86DGA)
217 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
219 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
222 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
225 AC_MSG_WARN([DGA extension not found!!])
228 dnl *** Check for XFree86 VMODE extension
229 AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
230 [ dnl *** If X11/extensions/xf86vmode.h exists...
231 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
232 [ AC_DEFINE(HAVE_LIBXXF86VM)
233 X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
235 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
238 AC_MSG_WARN([XFree86 VMODE extension not found!!])
241 dnl *** Check for XVideo extension supporting XvImages
242 AC_CHECK_HEADERS(X11/extensions/Xvlib.h,
243 [ dnl *** If X11/extensions/Xvlib.h exists...
244 AC_CHECK_LIB(Xv, XvShmCreateImage,
245 [ AC_DEFINE(HAVE_XVIDEO)
246 X_PRE_LIBS="$X_PRE_LIBS -lXv"
248 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
251 AC_MSG_WARN([XVideo extension not found !!])
255 ) dnl *** End of X11/Xlib.h check
257 dnl Check for the presence of OpenGL
258 if test $OPENGL = "yes" -o $OPENGL = "normal"
260 AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h)
261 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
263 dnl Check for some problems due to old Mesa versions
264 AC_CACHE_CHECK("for up-to-date OpenGL version", wine_cv_opengl_version_OK,
266 [#include <GL/gl.h>],
267 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
268 [wine_cv_opengl_version_OK="yes"],
269 [wine_cv_opengl_version_OK="no"]
273 dnl Check for the thread-safety of the OpenGL library
274 AC_CACHE_CHECK("for thread-safe OpenGL version",
275 wine_cv_opengl_version_threadsafe,
278 AC_TRY_LINK([],[pthread_getspecific();],
279 [wine_cv_opengl_version_threadsafe="yes"],
280 [wine_cv_opengl_version_threadsafe="no"])
284 if test "$wine_cv_opengl_version_OK" = "yes" -a \( "$wine_cv_opengl_version_threadsafe" = "no" -o $OPENGL = "yes" \)
286 dnl Check for the presence of the library
287 AC_CHECK_LIB(GL,glXCreateContext,
288 X_PRE_LIBS="$X_PRE_LIBS -lGL"
290 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
292 if test $ac_cv_lib_GL_glXCreateContext = "yes"
295 OPENGLFILES='$(OPENGLFILES)'
296 AC_DEFINE(HAVE_OPENGL)
298 AC_CHECK_LIB(GL,glXGetProcAddressARB,AC_DEFINE(HAVE_GLX_GETPROCADDRESS),,$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
300 if test $ac_cv_lib_GL_glXGetProcAddressARB = "yes"
302 AC_CACHE_CHECK("for OpenGL extension functions prototypes", wine_cv_extension_prototypes,
303 AC_TRY_COMPILE([#include <GL/gl.h>
304 #ifdef HAVE_GL_GLEXT_H
305 # include <GL/glext.h>
308 [PFNGLCOLORTABLEEXTPROC test_proc;],
309 [wine_cv_extension_prototypes="yes"],
310 [wine_cv_extension_prototypes="no"]
313 if test $wine_cv_extension_prototypes = "yes"
315 AC_DEFINE(HAVE_GLEXT_PROTOTYPES)
318 OPENGL32_DLL=opengl32
321 AC_CHECK_HEADERS(GL/osmesa.h,
322 [ dnl *** If GL/osmesa.h exists...
323 AC_CHECK_LIB(GL, OSMesaCreateContext,
324 AC_DEFINE(HAVE_OSMESA),
325 AC_CHECK_LIB(OSMesa, OSMesaCreateContext,
326 [ AC_DEFINE(HAVE_OSMESA)
327 X_PRE_LIBS="$X_PRE_LIBS -lOSMesa"
328 ],,-lGL $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS),
329 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
334 dnl Check for GLU32 library.
335 AC_CHECK_LIB(GLU,glBegin,
336 X_PRE_LIBS="$X_PRE_LIBS -lGLU"
337 GLU32FILES='$(GLU32FILES)'
340 $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
346 CPPFLAGS="$ac_save_CPPFLAGS"
355 dnl **** Check which curses lib to use ***
356 if test "$CURSES" = "yes"
358 AC_CHECK_HEADERS(ncurses.h)
359 if test "$ac_cv_header_ncurses_h" = "yes"
361 AC_CHECK_LIB(ncurses,waddch)
363 if test "$ac_cv_lib_ncurses_waddch" = "yes"
365 AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
366 AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
368 AC_CHECK_HEADERS(curses.h)
369 if test "$ac_cv_header_curses_h" = "yes"
371 AC_CHECK_LIB(curses,waddch)
372 if test "$ac_cv_lib_curses_waddch" = "yes"
374 AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
375 AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
382 dnl **** Check for CUPS ****
383 wine_cv_warn_cups_h=no
384 AC_CHECK_LIB(cups,cupsGetPPD,
385 AC_CHECK_HEADER(cups/cups.h,
388 wine_cv_warn_cups_h=yes)
392 dnl **** Check for FreeType 2 ****
393 AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no)
394 if test "$ft_lib" = "no"
398 wine_cv_msg_freetype=no
400 AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
401 if test "$ft_devel" = "no"
403 AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
404 if test "$ft_devel2" = "freetype2-config"
409 if test "$ft_devel" = "no"
413 wine_cv_msg_freetype=yes
415 AC_DEFINE(HAVE_FREETYPE)
416 FREETYPELIBS=`$ft_devel --libs`
417 FREETYPEINCL=`$ft_devel --cflags`
418 ac_save_CPPFLAGS="$CPPFLAGS"
419 CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
420 AC_CHECK_HEADERS(freetype/freetype.h \
422 freetype/tttables.h \
424 freetype/ftsnames.h \
426 CPPFLAGS="$ac_save_CPPFLAGS"
427 wine_cv_msg_freetype=no
430 AC_SUBST(FREETYPELIBS)
431 AC_SUBST(FREETYPEINCL)
433 dnl **** Check for IPX (currently Linux only) ****
434 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
436 [#include <sys/socket.h>
437 #include <netipx/ipx.h>],
438 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
439 [ac_cv_c_ipx_gnu="yes"],
440 [ac_cv_c_ipx_gnu="no"])
442 if test "$ac_cv_c_ipx_gnu" = "yes"
444 AC_DEFINE(HAVE_IPX_GNU)
447 if test "$ac_cv_c_ipx_gnu" = "no"
449 AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
451 [#include <sys/socket.h>
452 #include <asm/types.h>
453 #include <linux/ipx.h>],
454 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
455 [ac_cv_c_ipx_linux="yes"],
456 [ac_cv_c_ipx_linux="no"])
458 if test "$ac_cv_c_ipx_linux" = "yes"
460 AC_DEFINE(HAVE_IPX_LINUX)
464 dnl **** Check for Open Sound System ****
465 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
467 AC_CACHE_CHECK("for Open Sound System",
468 ac_cv_c_opensoundsystem,
470 #if defined(HAVE_SYS_SOUNDCARD_H)
471 #include <sys/soundcard.h>
472 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
473 #include <machine/soundcard.h>
474 #elif defined(HAVE_SOUNDCARD_H)
475 #include <soundcard.h>
479 /* check for one of the Open Sound System specific SNDCTL_ defines */
480 #if !defined(SNDCTL_DSP_STEREO)
481 #error No open sound system
483 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
485 if test "$ac_cv_c_opensoundsystem" = "yes"
490 AC_CACHE_CHECK("for Open Sound System/MIDI interface",
491 ac_cv_c_opensoundsystem_midi,
493 #if defined(HAVE_SYS_SOUNDCARD_H)
494 #include <sys/soundcard.h>
495 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
496 #include <machine/soundcard.h>
497 #elif defined(HAVE_SOUNDCARD_H)
498 #include <soundcard.h>
502 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
503 #if !defined(SNDCTL_SEQ_SYNC)
504 #error No open sound system MIDI interface
506 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
508 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
510 AC_DEFINE(HAVE_OSS_MIDI)
513 dnl **** If ln -s doesn't work, use cp instead ****
514 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
516 dnl **** Check for broken glibc mmap64 ****
518 AC_CACHE_CHECK( "whether mmap64 works defined as mmap", ac_cv_mmap64_works,
520 #define _FILE_OFFSET_BITS 64
524 #include <sys/mman.h>
527 int main(int argc,char **argv) {
528 int fd = open("conftest.map",O_CREAT|O_RDWR,0600);
529 if (fd == -1) exit(1);
531 unlink("conftest.map");
535 if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) &&
541 fprintf(stderr,"success!\n");
546 ac_cv_mmap64_works="yes",
547 ac_cv_mmap64_works="no",
548 ac_cv_mmap64_works="no") )
550 if test "$ac_cv_mmap64_works" = "yes"
552 AC_DEFINE(_FILE_OFFSET_BITS, 64, [Set this to 64 to enable 64-bit file support on Linux])
555 dnl **** Check for gcc strength-reduce bug ****
557 if test "x${GCC}" = "xyes"
559 CFLAGS="$CFLAGS -Wall"
560 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
562 int L[[4]] = {0,1,2,3};
564 static int Array[[3]];
567 for(i=0; i<B; i++) Array[[i]] = i - 3;
568 for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
571 exit( Array[[1]] != -2 || L[[2]] != 3);
573 ac_cv_c_gcc_strength_bug="no",
574 ac_cv_c_gcc_strength_bug="yes",
575 ac_cv_c_gcc_strength_bug="yes") )
576 if test "$ac_cv_c_gcc_strength_bug" = "yes"
578 CFLAGS="$CFLAGS -fno-strength-reduce"
581 dnl Check for -mpreferred-stack-boundary
582 AC_CACHE_CHECK("for gcc -mpreferred-stack-boundary=2 support",
583 ac_cv_c_gcc_stack_boundary,
584 [saved_cflags=$CFLAGS
585 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
586 AC_TRY_COMPILE(,[return 0],ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")
589 if test "$ac_cv_c_gcc_stack_boundary" = "yes"
591 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
595 dnl **** Check if we need to place .type inside a .def directive ****
597 AC_CACHE_CHECK("whether .type must sit inside a .def directive",
600 LIBS="conftest_asm.s $LIBS"
601 cat > conftest_asm.s <<EOF
603 .def _ac_test; .scl 2; .type 32; .endef
607 AC_TRY_LINK(,,ac_cv_c_type_in_def="yes",ac_cv_c_type_in_def="no")
609 if test "$ac_cv_c_type_in_def" = "yes"
611 AC_DEFINE(NEED_TYPE_IN_DEF)
614 dnl **** Check for underscore on external symbols ****
616 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
617 ac_cv_c_extern_prefix,
619 LIBS="conftest_asm.s $LIBS"
620 cat > conftest_asm.s <<EOF
625 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
626 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
628 if test "$ac_cv_c_extern_prefix" = "yes"
630 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
633 dnl **** Check for .string in assembler ****
635 AC_CACHE_CHECK("whether assembler accepts .string",
638 LIBS="conftest_asm.s $LIBS"
639 cat > conftest_asm.s <<EOF
642 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
644 if test "$ac_cv_c_asm_string" = "yes"
646 AC_DEFINE(HAVE_ASM_STRING)
649 dnl **** Check for working dll ****
653 if test "$LIBEXT" = "so"
655 AC_CACHE_CHECK("whether we can build a GNU style ELF dll",
657 [saved_cflags=$CFLAGS
658 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
659 AC_TRY_LINK(,[return 1],ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")
662 if test "$ac_cv_c_dll_gnuelf" = "yes"
664 LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%) -Wl,-rpath,\$(libdir)"
665 LDDLLFLAGS="-Wl,-Bsymbolic"
667 AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
668 ac_cv_c_dll_unixware,
669 [saved_cflags=$CFLAGS
670 CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
671 AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
674 if test "$ac_cv_c_dll_unixware" = "yes"
676 LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,\$(libdir)/%)"
677 LDDLLFLAGS="-Wl,-B,symbolic"
680 if test "$ac_cv_c_dll_gnuelf" = "no" -a "$ac_cv_c_dll_unixware" = "no"
683 if test "$DLLWRAP" = "dllwrap"; then
684 dnl FIXME - check whether dllwrap works correctly...
685 if test "$CYGWIN" = "yes"; then
686 echo "*** use dllwrap for building shared library."
693 if test "$LIBEXT" = "a"; then
694 echo "*** It is currently not possible to build WINE without shared"
695 echo "*** library (.so) support to allow transparent switch between .so"
696 echo "*** and .dll files."
697 echo "*** If you are using Linux, you will need a newer binutils."
704 if test "$LIBEXT" = "so"; then
706 DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
707 LDPATH="LD_LIBRARY_PATH=\"\$(TOPOBJDIR)/unicode:\$\$LD_LIBRARY_PATH\""
708 elif test "$LIBEXT" = "dll"; then
709 #DLLFLAGS="-fPIC" # -fPIC doesn't work(at least in cygwin-b20) - FIXME
710 DLL_LINK="-L\$(DLLDIR) \$(IMPORTS:%=-l%) \$(LIBWINE) \$(LIBUNICODE)"
711 LDPATH="PATH=\"\$(TOPOBJDIR)/unicode:\$\$PATH\""
713 DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) \$(LIBWINE) \$(LIBUNICODE) \$(X_LIBS) \$(XLIB)"
714 AC_CACHE_CHECK([whether the linker supports --[[no]]-whole-archive (Linux)],
715 ac_cv_c_whole_archive,
716 [saved_cflags=$CFLAGS
717 CFLAGS="$CFLAGS -Wl,--whole-archive -Wl,--no-whole-archive"
718 AC_TRY_LINK(,[return 1],ac_cv_c_whole_archive="yes",ac_cv_c_whole_archive="no")
721 if test "$ac_cv_c_whole_archive" = "yes"
723 DLL_LINK="-Wl,--whole-archive $DLL_LINK -Wl,--no-whole-archive"
725 AC_CACHE_CHECK([whether the linker supports -z {all,default}extract (Linux)],
727 [saved_cflags=$CFLAGS
728 CFLAGS="$CFLAGS -Wl,-z,allextract -Wl,-z,defaultextract"
729 AC_TRY_LINK(,[return 1],ac_cv_c_allextract="yes",ac_cv_c_allextract="no")
732 if test "$ac_cv_c_allextract" = "yes"
734 DLL_LINK="-Wl,-z,allextract $DLL_LINK -Wl,-z,defaultextract"
746 dnl **** Check for reentrant libc ****
748 dnl For cross-compiling we blindly assume that libc is reentrant. This is
749 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
751 AC_DEFUN(WINE_CHECK_ERRNO,
753 AC_CACHE_CHECK(for reentrant libc: $1, wine_cv_libc_r_$1,
754 [AC_TRY_RUN([int myerrno = 0;
756 int *$1(){return &myerrno;}
757 main(){connect(0,buf,255); exit(!myerrno);}],
758 wine_cv_libc_r_$1=yes, wine_cv_libc_r_$1=no,
759 wine_cv_libc_r_$1=yes )
761 if test "$wine_cv_libc_r_$1" = "yes"
763 wine_cv_libc_reentrant=$1
767 wine_cv_libc_reentrant=no
768 dnl Linux style errno location
769 WINE_CHECK_ERRNO(__errno_location)
770 dnl FreeBSD style errno location
771 WINE_CHECK_ERRNO(__error)
772 dnl Solaris style errno location
773 WINE_CHECK_ERRNO(___errno)
774 dnl UnixWare style errno location
775 WINE_CHECK_ERRNO(__thr_errno)
776 dnl NetBSD style errno location
777 WINE_CHECK_ERRNO(__errno)
779 if test "$wine_cv_libc_reentrant" != "no"
781 AC_DEFINE_UNQUOTED(ERRNO_LOCATION,$wine_cv_libc_reentrant)
784 dnl **** Check for reentrant X libraries ****
786 dnl This may fail to determine whether X libraries are reentrant if
787 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
788 dnl is possible with the --without-reentrant-x option.
790 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
792 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
793 [ if test "x$with_reentrant_x" = "xno"
795 wine_cv_x_reentrant=no
798 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
799 if test -r $dir/libX11.so; then
800 libX11_check="-D $dir/libX11.so"
803 if test -r $dir/libX11.a; then
804 libX11_check="$dir/libX11.a"
808 if test "$libX11_check" != "none"; then
809 if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
811 wine_cv_x_reentrant=yes
813 wine_cv_x_reentrant=no
816 wine_cv_x_reentrant=unknown
820 wine_cv_x_reentrant=no
822 if test "$wine_cv_x_reentrant" = "no"
824 AC_DEFINE(NO_REENTRANT_X11)
828 dnl **** Check for functions ****
869 dnl **** Check for header files ****
926 dnl **** Check for types ****
931 AC_CHECK_SIZEOF(long long,0)
933 AC_CACHE_CHECK("whether linux/input.h is for real",
934 wine_cv_linux_input_h,
936 #include <linux/input.h>
938 int foo = EVIOCGBIT(EV_ABS,42);
939 int bar = BTN_PINKIE;
942 wine_cv_linux_input_h=yes,
943 wine_cv_linux_input_h=no,
947 if test "$wine_cv_linux_input_h" = "yes"
949 AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H)
953 AC_CACHE_CHECK("whether we can use re-entrant gethostbyname_r Linux style",
954 wine_cv_linux_gethostbyname_r_6,
960 struct hostent *result;
967 res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
968 res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
970 wine_cv_linux_gethostbyname_r_6=yes,
971 wine_cv_linux_gethostbyname_r_6=no
974 if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
976 AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6)
979 if test "$ac_cv_header_linux_joystick_h" = "yes"
981 AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
982 wine_cv_linux_joystick_22_api,
984 #include <sys/ioctl.h>
985 #include <linux/joystick.h>
987 struct js_event blub;
988 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
989 #error "no 2.2 header"
992 wine_cv_linux_joystick_22_api=yes,
993 wine_cv_linux_joystick_22_api=no,
994 wine_cv_linux_joystick_22_api=no
997 if test "$wine_cv_linux_joystick_22_api" = "yes"
999 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API)
1003 dnl **** statfs checks ****
1005 if test "$ac_cv_header_sys_vfs_h" = "yes"
1007 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
1008 wine_cv_sys_vfs_has_statfs,
1010 #include <sys/types.h>
1011 #ifdef HAVE_SYS_PARAM_H
1012 # include <sys/param.h>
1014 #include <sys/vfs.h>
1018 memset(&stfs,0,sizeof(stfs));
1019 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
1022 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
1024 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
1028 if test "$ac_cv_header_sys_statfs_h" = "yes"
1030 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
1031 wine_cv_sys_statfs_has_statfs,
1033 #include <sys/types.h>
1034 #ifdef HAVE_SYS_PARAM_H
1035 # include <sys/param.h>
1037 #include <sys/statfs.h>
1040 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
1043 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
1045 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
1049 if test "$ac_cv_header_sys_mount_h" = "yes"
1051 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
1052 wine_cv_sys_mount_has_statfs,
1054 #include <sys/types.h>
1055 #ifdef HAVE_SYS_PARAM_H
1056 # include <sys/param.h>
1058 #include <sys/mount.h>
1061 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
1064 if test "$wine_cv_sys_mount_has_statfs" = "yes"
1066 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
1070 dnl **** FIXME: what about mixed cases, where we need two of them? ***
1072 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
1073 [ if test "x$statfs_bfree" = "xno"
1075 wine_cv_statfs_bfree=no
1078 #include <sys/types.h>
1079 #ifdef HAVE_SYS_PARAM_H
1080 # include <sys/param.h>
1082 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1083 # include <sys/mount.h>
1085 # ifdef STATFS_DEFINED_BY_SYS_VFS
1086 # include <sys/vfs.h>
1088 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1089 # include <sys/statfs.h>
1097 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
1100 if test "$wine_cv_statfs_bfree" = "yes"
1102 AC_DEFINE(STATFS_HAS_BFREE)
1105 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
1106 [ if test "x$statfs_bavail" = "xno"
1108 wine_cv_statfs_bavail=no
1111 #include <sys/types.h>
1112 #ifdef HAVE_SYS_PARAM_H
1113 # include <sys/param.h>
1115 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1116 # include <sys/mount.h>
1118 # ifdef STATFS_DEFINED_BY_SYS_VFS
1119 # include <sys/vfs.h>
1121 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1122 # include <sys/statfs.h>
1130 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
1133 if test "$wine_cv_statfs_bavail" = "yes"
1135 AC_DEFINE(STATFS_HAS_BAVAIL)
1138 dnl *** check for file descriptor passing with msg_accrights
1140 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
1141 AC_TRY_COMPILE([#include <sys/types.h>
1142 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
1143 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
1144 if test "$ac_cv_c_msg_accrights" = "yes"
1146 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
1149 dnl *** Check for the sun_len member in struct sockaddr_un
1151 AC_CACHE_CHECK("for sun_len in struct sockaddr_un", ac_cv_c_sun_len,
1152 AC_TRY_COMPILE([#include <sys/types.h>
1153 #include <sys/socket.h>
1154 #include <sys/un.h>], [static struct sockaddr_un addr; addr.sun_len = 1],
1155 ac_cv_c_sun_len="yes", ac_cv_c_sun_len="no"))
1156 if test "$ac_cv_c_sun_len" = "yes"
1158 AC_DEFINE(HAVE_SOCKADDR_SUN_LEN)
1161 dnl *** check for the need to define __i386__
1163 AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
1164 AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
1167 ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
1168 if test "$ac_cv_cpp_def_i386" = "yes"
1170 CFLAGS="$CFLAGS -D__i386__"
1171 LINTFLAGS="$LINTFLAGS -D__i386__"
1174 dnl $GCC is set by autoconf
1176 if test "$GCC" = "yes"
1178 GCC_NO_BUILTIN="-fno-builtin"
1180 AC_SUBST(GCC_NO_BUILTIN)
1182 dnl **** Generate output files ****
1184 AC_OUTPUT_COMMANDS([
1186 dlls/ddraw/d3ddevice \
1187 dlls/ddraw/dclipper \
1189 dlls/ddraw/direct3d \
1190 dlls/ddraw/dpalette \
1191 dlls/ddraw/dsurface \
1192 dlls/dinput/joystick \
1193 dlls/dinput/keyboard \
1195 dlls/kernel/messages \
1196 dlls/user/resources \
1199 for i in $extra_subdirs; do [ -d $i ] || (echo "creating $i" && mkdir $i); done ])
1201 MAKE_RULES=Make.rules
1202 AC_SUBST_FILE(MAKE_RULES)
1204 MAKE_DLL_RULES=dlls/Makedll.rules
1205 AC_SUBST_FILE(MAKE_DLL_RULES)
1207 MAKE_PROG_RULES=programs/Makeprog.rules
1208 AC_SUBST_FILE(MAKE_PROG_RULES)
1213 programs/Makeprog.rules
1219 dlls/advapi32/Makefile
1220 dlls/avifil32/Makefile
1221 dlls/comctl32/Makefile
1222 dlls/commdlg/Makefile
1223 dlls/crtdll/Makefile
1224 dlls/dciman32/Makefile
1226 dlls/dinput/Makefile
1228 dlls/dplayx/Makefile
1229 dlls/dsound/Makefile
1233 dlls/imagehlp/Makefile
1235 dlls/kernel/Makefile
1236 dlls/lzexpand/Makefile
1239 dlls/msnet32/Makefile
1240 dlls/msvcrt/Makefile
1241 dlls/msvideo/Makefile
1243 dlls/odbc32/Makefile
1245 dlls/oleaut32/Makefile
1246 dlls/olecli/Makefile
1247 dlls/oledlg/Makefile
1248 dlls/olepro32/Makefile
1249 dlls/olesvr/Makefile
1250 dlls/opengl32/Makefile
1252 dlls/rasapi32/Makefile
1253 dlls/richedit/Makefile
1254 dlls/rpcrt4/Makefile
1255 dlls/serialui/Makefile
1256 dlls/setupapi/Makefile
1257 dlls/shdocvw/Makefile
1258 dlls/shell32/Makefile
1259 dlls/shfolder/Makefile
1260 dlls/shlwapi/Makefile
1261 dlls/tapi32/Makefile
1262 dlls/ttydrv/Makefile
1263 dlls/urlmon/Makefile
1265 dlls/version/Makefile
1266 dlls/win32s/Makefile
1267 dlls/winaspi/Makefile
1268 dlls/winedos/Makefile
1269 dlls/wineps/Makefile
1270 dlls/wininet/Makefile
1272 dlls/winmm/joystick/Makefile
1273 dlls/winmm/mcianim/Makefile
1274 dlls/winmm/mciavi/Makefile
1275 dlls/winmm/mcicda/Makefile
1276 dlls/winmm/mciseq/Makefile
1277 dlls/winmm/mciwave/Makefile
1278 dlls/winmm/midimap/Makefile
1279 dlls/winmm/wavemap/Makefile
1280 dlls/winmm/wineoss/Makefile
1281 dlls/winnls/Makefile
1282 dlls/winsock/Makefile
1283 dlls/winspool/Makefile
1284 dlls/wintrust/Makefile
1286 dlls/wsock32/Makefile
1287 dlls/x11drv/Makefile
1288 documentation/Makefile
1289 documentation/wine.conf.man
1290 documentation/wine.man
1293 graphics/enhmetafiledrv/Makefile
1294 graphics/metafiledrv/Makefile
1295 graphics/win16drv/Makefile
1296 graphics/x11drv/Makefile
1311 programs/avitools/Makefile
1312 programs/clock/Makefile
1313 programs/cmdlgtst/Makefile
1314 programs/control/Makefile
1315 programs/notepad/Makefile
1316 programs/osversioncheck/Makefile
1317 programs/progman/Makefile
1318 programs/regapi/Makefile
1319 programs/regtest/Makefile
1320 programs/uninstaller/Makefile
1321 programs/view/Makefile
1322 programs/wcmd/Makefile
1323 programs/winemine/Makefile
1324 programs/winetest/Makefile
1325 programs/winhelp/Makefile
1326 programs/winver/Makefile
1331 tools/cvdump/Makefile
1332 tools/specmaker/Makefile
1333 tools/winebuild/Makefile
1341 windows/x11drv/Makefile ])
1343 if test "$have_x" = "no"
1346 echo "*** Warning: X development files not found. Wine will be built without"
1347 echo "*** X support, which currently does not work, and would probably not be"
1348 echo "*** what you want anyway. You will need to install devel packages of"
1349 echo "*** Xlib/Xfree86 and Xpm at the very least."
1350 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
1353 echo "*** Warning: Xpm development files not found. Wine will be built without"
1354 echo "*** Xpm support, which currently does not work. You will need to install"
1355 echo "*** devel packages of Xpm."
1358 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
1361 echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
1362 echo "*** terminal resize support. Consider upgrading ncurses."
1365 if test "$wine_cv_libc_reentrant" = "no"
1368 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
1369 echo "*** thread support. Consider upgrading libc to a more recent"
1370 echo "*** reentrant version of libc."
1373 if test "$wine_cv_opengl_version_OK" = "no"
1376 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1377 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1380 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "normal"
1383 echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
1384 echo "*** thread-safety. To prevent crashes, OpenGL support has been removed."
1385 echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine,"
1386 echo "*** start configure with '--enable-opengl' to force OpenGL support."
1389 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "yes"
1392 echo "*** Warning: you explicitly linked in a thread-safe OpenGL version. If you"
1393 echo "*** experience unusual crashes on DirectDraw games, try first to disable OpenGL"
1394 echo "*** support before reporting bugs."
1397 if test "$wine_cv_warn_cups_h" = "yes"
1400 echo "*** Note: You have cups runtime libraries, but no development"
1401 echo "*** libraries. Install the cups-devel package or whichever package"
1402 echo "*** contains cups.h to enable CUPS support in WINE."
1405 if test "$wine_cv_msg_freetype" = "yes"
1408 echo "*** Note: Your system appears to have the FreeType 2 runtime libraries"
1409 echo "*** installed, but 'freetype-config' is not in your PATH. Install the"
1410 echo "*** freetype-devel package (or its equivalent on your distribution) to"
1411 echo "*** enable Wine to use TrueType fonts."
1415 echo "Configure finished. Do 'make depend && make' to compile Wine."
1418 dnl Local Variables:
1419 dnl comment-start: "dnl "
1421 dnl comment-start-skip: "\\bdnl\\b\\s *"
1422 dnl compile-command: "autoconf"