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, 1, [Define if all debug messages are to be compiled out])
44 if test "$TRACE_MSGS" = "no" -o "$DEBUG_MSGS" = "no"
46 AC_DEFINE(NO_TRACE_MSGS, 1, [Define if TRACE messages are to be compiled out])
49 dnl **** Check for some programs ****
57 AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
58 if test "$XLEX" = "none"
60 echo "*** Error: No suitable lex found. ***"
61 echo " Please install the 'flex' package."
67 AC_CHECK_PROG(C2MAN,c2man,c2man,\$(TOPSRCDIR)/tools/c2man.pl)
68 AC_PATH_PROG(LDCONFIG, ldconfig, true, /sbin:/usr/sbin:$PATH)
70 AC_CHECK_PROG(DLLWRAP,dllwrap,dllwrap,false)
73 AC_CHECK_PROGS(LINT, lclint lint)
74 if test "$LINT" = "lint"
76 LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
77 dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
82 if test "$CYGWIN" = "yes"
84 LDCOMBINE="ld -r --enable-stdcall-fixup"
90 dnl **** Check for some libraries ****
94 dnl Check for -li386 for NetBSD and OpenBSD
95 AC_CHECK_LIB(i386,i386_set_ldt)
96 dnl Check for -lossaudio for NetBSD
97 AC_CHECK_LIB(ossaudio,_oss_ioctl)
98 dnl Check for -lw for Solaris
99 AC_CHECK_FUNCS(iswalnum,,AC_CHECK_LIB(w,iswalnum))
100 dnl Check for -lnsl for Solaris
101 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
102 dnl Check for -lsocket for Solaris
103 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
104 dnl Check for -lxpg4 for FreeBSD
105 AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
106 dnl Check for -lmmap for OS/2
107 AC_CHECK_LIB(mmap,mmap)
108 dnl Check for openpty
109 AC_CHECK_FUNCS(openpty,,
110 AC_CHECK_LIB(util,openpty,
111 AC_DEFINE(HAVE_OPENPTY)
115 AC_CHECK_HEADERS(dlfcn.h,
116 AC_CHECK_FUNCS(dlopen,,
117 AC_CHECK_LIB(dl,dlopen,
118 AC_DEFINE(HAVE_DLOPEN)
127 AC_CHECK_HEADERS(jpeglib.h,
128 AC_CHECK_LIB(jpeg,jpeg_start_decompress,
129 AC_DEFINE(HAVE_LIBJPEG,1,[Define if you have libjpeg including devel headers])
138 AC_SUBST(OPENGLFILES)
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, 1, [Define if you have the Xpm library])
153 X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
154 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
157 [ dnl *** If X11/xpm.h does not exist...
158 dnl NOTE: autoconf does not allow commas inside the third
159 dnl parameter to AC_CHECK_HEADERS, due to some quoting
161 echo "Redhat : xpm xpm-devel"
162 echo "Caldera OpenLinux : xpm xpm-devel xpm-devel-static"
164 echo "Debian/Corel Linux: xpm4g xpm4g-dev"
166 echo "Or get the sources from ftp.x.org and all its mirror sites from "
167 echo "the directory /contrib/libraries."
173 dnl *** All of the following tests require X11/Xlib.h
174 AC_CHECK_HEADERS(X11/Xlib.h,
176 dnl *** Check for X keyboard extension
177 AC_CHECK_HEADERS(X11/XKBlib.h,
178 [ dnl *** If X11/XKBlib.h exists...
179 AC_CHECK_LIB(X11, XkbQueryExtension,
180 AC_DEFINE(HAVE_XKB, 1, [Define if you have the XKB extension]),,
181 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
183 AC_MSG_WARN([XKB extension not found!!])
186 dnl *** Check for X Shm extension
187 AC_CHECK_HEADERS(X11/extensions/XShm.h,
188 [ dnl *** If X11/extensions/XShm.h exists...
189 AC_CHECK_LIB(Xext, XShmQueryExtension,
190 AC_DEFINE(HAVE_LIBXXSHM, 1, [Define if you have the X Shm extension]),,
191 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
193 AC_MSG_WARN([Xshm extension not found!!])
196 dnl *** Check for X shape extension
197 AC_CHECK_HEADERS(X11/extensions/shape.h,
198 [ dnl *** If X11/extensions/shape.h exists...
199 AC_CHECK_LIB(Xext,XShapeQueryExtension,
200 AC_DEFINE(HAVE_LIBXSHAPE, 1, [Define if you have the X Shape extension]),,
201 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
203 AC_MSG_WARN([XShape extension not found!!])
206 dnl *** Check for XFree86 DGA / DGA 2.0 extension
207 AC_CHECK_HEADERS(X11/extensions/xf86dga.h,
208 [ dnl *** If X11/extensions/xf86dga.h exists, check
209 dnl *** for XDGAQueryExtension()...
210 AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
211 [ dnl *** If found...
212 AC_DEFINE(HAVE_LIBXXF86DGA2, 1,
213 [Define if you have the Xxf86dga library version 2])
214 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
216 [ dnl *** If not found, look for XF86DGAQueryExtension()
217 dnl *** instead (DGA 2.0 not found)...
218 AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
219 [ AC_DEFINE(HAVE_LIBXXF86DGA, 1,
220 [Define if you have the Xxf86dga library version 1])
221 X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
223 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
226 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
229 AC_MSG_WARN([DGA extension not found!!])
232 dnl *** Check for XFree86 VMODE extension
233 AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
234 [ dnl *** If X11/extensions/xf86vmode.h exists...
235 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
236 [ AC_DEFINE(HAVE_LIBXXF86VM, 1, [Define if you have the Xxf86vm library])
237 X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
239 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
242 AC_MSG_WARN([XFree86 VMODE extension not found!!])
245 dnl *** Check for XVideo extension supporting XvImages
246 AC_CHECK_HEADERS(X11/extensions/Xvlib.h,
247 [ dnl *** If X11/extensions/Xvlib.h exists...
248 AC_CHECK_LIB(Xv, XvShmCreateImage,
249 [ AC_DEFINE(HAVE_XVIDEO, 1, [Define if the X libraries support XVideo])
250 X_PRE_LIBS="$X_PRE_LIBS -lXv"
252 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
255 AC_MSG_WARN([XVideo extension not found !!])
258 dnl *** Check for XRender extension
259 AC_CHECK_HEADERS(X11/extensions/Xrender.h,
260 [ dnl *** If X11/extensions/Xrender.h exists...
261 AC_CHECK_LIB(Xrender, XRenderQueryExtension,
262 [ AC_DEFINE(HAVE_LIBXRENDER, 1, [Define if you have the XRender extension library])
263 X_PRE_LIBS="$X_PRE_LIBS -lXrender"
265 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
268 AC_MSG_WARN([XRender extension not found !!])
272 ) dnl *** End of X11/Xlib.h check
274 dnl Check for the presence of OpenGL
275 if test $OPENGL = "yes" -o $OPENGL = "normal"
277 AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h)
278 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
280 dnl Check for some problems due to old Mesa versions
281 AC_CACHE_CHECK("for up-to-date OpenGL version", wine_cv_opengl_version_OK,
283 [#include <GL/gl.h>],
284 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
285 [wine_cv_opengl_version_OK="yes"],
286 [wine_cv_opengl_version_OK="no"]
290 dnl Check for the thread-safety of the OpenGL library
291 AC_CACHE_CHECK("for thread-safe OpenGL version",
292 wine_cv_opengl_version_threadsafe,
295 AC_TRY_LINK([],[pthread_getspecific();],
296 [wine_cv_opengl_version_threadsafe="yes"],
297 [wine_cv_opengl_version_threadsafe="no"])
301 if test "$wine_cv_opengl_version_OK" = "yes" -a \( "$wine_cv_opengl_version_threadsafe" = "no" -o $OPENGL = "yes" \)
303 dnl Check for the presence of the library
304 AC_CHECK_LIB(GL,glXCreateContext,
305 X_PRE_LIBS="$X_PRE_LIBS -lGL"
307 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
309 if test $ac_cv_lib_GL_glXCreateContext = "yes"
312 OPENGLFILES='$(OPENGLFILES)'
313 AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is present on the system])
315 AC_CHECK_LIB(GL,glXGetProcAddressARB,
316 AC_DEFINE(HAVE_GLX_GETPROCADDRESS, 1,
317 [Define if the OpenGL library supports the glXGetProcAddressARB call]),,
318 $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
320 if test $ac_cv_lib_GL_glXGetProcAddressARB = "yes"
322 AC_CACHE_CHECK("for OpenGL extension functions prototypes", wine_cv_extension_prototypes,
323 AC_TRY_COMPILE([#include <GL/gl.h>
324 #ifdef HAVE_GL_GLEXT_H
325 # include <GL/glext.h>
328 [PFNGLCOLORTABLEEXTPROC test_proc;],
329 [wine_cv_extension_prototypes="yes"],
330 [wine_cv_extension_prototypes="no"]
333 if test $wine_cv_extension_prototypes = "yes"
335 AC_DEFINE(HAVE_GLEXT_PROTOTYPES, 1,
336 [Define if the OpenGL headers define extension typedefs])
341 dnl Check for GLU32 library.
342 AC_CHECK_LIB(GLU,gluLookAt,
343 X_PRE_LIBS="$X_PRE_LIBS -lGLU"
344 GLU32FILES='$(GLU32FILES)'
346 $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
352 CPPFLAGS="$ac_save_CPPFLAGS"
360 dnl **** Check which curses lib to use ***
361 if test "$CURSES" = "yes"
363 AC_CHECK_HEADERS(ncurses.h,
364 AC_CHECK_LIB(ncurses,waddch),
365 AC_CHECK_HEADERS(curses.h,AC_CHECK_LIB(curses,waddch)))
366 AC_CHECK_FUNCS(getbkgd resizeterm)
370 dnl **** Check for CUPS ****
371 wine_cv_warn_cups_h=no
372 AC_CHECK_LIB(cups,cupsGetPPD,
373 AC_CHECK_HEADER(cups/cups.h,
374 AC_DEFINE(HAVE_CUPS, 1, [Define if we have CUPS])
376 wine_cv_warn_cups_h=yes)
380 dnl **** Check for FreeType 2 ****
381 AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no)
382 if test "$ft_lib" = "no"
386 wine_cv_msg_freetype=no
388 AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
389 if test "$ft_devel" = "no"
391 AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
392 if test "$ft_devel2" = "freetype2-config"
397 if test "$ft_devel" = "no"
401 wine_cv_msg_freetype=yes
403 AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
404 FREETYPELIBS=`$ft_devel --libs`
405 FREETYPEINCL=`$ft_devel --cflags`
406 ac_save_CPPFLAGS="$CPPFLAGS"
407 CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
408 AC_CHECK_HEADERS(freetype/freetype.h \
410 freetype/tttables.h \
412 freetype/ftsnames.h \
413 freetype/ttnameid.h \
415 CPPFLAGS="$ac_save_CPPFLAGS"
416 wine_cv_msg_freetype=no
419 AC_SUBST(FREETYPELIBS)
420 AC_SUBST(FREETYPEINCL)
422 dnl **** Check for parport (currently Linux only) ****
423 AC_CACHE_CHECK("for parport header/ppdev.h", ac_cv_c_ppdev,
425 [#include <linux/ppdev.h>],
426 [ioctl (1,PPCLAIM,0)],
427 [ac_cv_c_ppdev="yes"],
428 [ac_cv_c_ppdev="no"])
430 if test "$ac_cv_c_ppdev" = "yes"
432 AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev.h for parallel port access])
435 dnl **** Check for IPX (currently Linux only) ****
436 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
438 [#include <sys/socket.h>
439 #include <netipx/ipx.h>],
440 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
441 [ac_cv_c_ipx_gnu="yes"],
442 [ac_cv_c_ipx_gnu="no"])
444 if test "$ac_cv_c_ipx_gnu" = "yes"
446 AC_DEFINE(HAVE_IPX_GNU, 1, [Define if IPX should use netipx/ipx.h from libc])
449 if test "$ac_cv_c_ipx_gnu" = "no"
451 AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
453 [#include <sys/socket.h>
454 #include <asm/types.h>
455 #include <linux/ipx.h>],
456 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
457 [ac_cv_c_ipx_linux="yes"],
458 [ac_cv_c_ipx_linux="no"])
460 if test "$ac_cv_c_ipx_linux" = "yes"
462 AC_DEFINE(HAVE_IPX_LINUX, 1, [Define if IPX includes are taken from Linux kernel])
466 dnl **** Check for Open Sound System ****
467 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
469 AC_CACHE_CHECK("for Open Sound System",
470 ac_cv_c_opensoundsystem,
472 #if defined(HAVE_SYS_SOUNDCARD_H)
473 #include <sys/soundcard.h>
474 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
475 #include <machine/soundcard.h>
476 #elif defined(HAVE_SOUNDCARD_H)
477 #include <soundcard.h>
481 /* check for one of the Open Sound System specific SNDCTL_ defines */
482 #if !defined(SNDCTL_DSP_STEREO)
483 #error No open sound system
485 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
487 if test "$ac_cv_c_opensoundsystem" = "yes"
489 AC_DEFINE(HAVE_OSS, 1, [Define if you have the Open Sound system])
492 AC_CACHE_CHECK("for Open Sound System/MIDI interface",
493 ac_cv_c_opensoundsystem_midi,
495 #if defined(HAVE_SYS_SOUNDCARD_H)
496 #include <sys/soundcard.h>
497 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
498 #include <machine/soundcard.h>
499 #elif defined(HAVE_SOUNDCARD_H)
500 #include <soundcard.h>
504 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
505 #if !defined(SNDCTL_SEQ_SYNC)
506 #error No open sound system MIDI interface
508 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
510 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
512 AC_DEFINE(HAVE_OSS_MIDI, 1, [Define if you have the Open Sound system (MIDI interface)])
515 dnl **** If ln -s doesn't work, use cp instead ****
516 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
518 dnl **** Check for broken glibc mmap64 ****
520 AC_CACHE_CHECK( "whether mmap64 works defined as mmap", ac_cv_mmap64_works,
522 #define _FILE_OFFSET_BITS 64
526 #include <sys/mman.h>
529 int main(int argc,char **argv) {
530 int fd = open("conftest.map",O_CREAT|O_RDWR,0600);
531 if (fd == -1) exit(1);
533 unlink("conftest.map");
537 if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) &&
543 fprintf(stderr,"success!\n");
548 ac_cv_mmap64_works="yes",
549 ac_cv_mmap64_works="no",
550 ac_cv_mmap64_works="no") )
552 if test "$ac_cv_mmap64_works" = "yes"
554 AC_DEFINE(_FILE_OFFSET_BITS, 64, [Set this to 64 to enable 64-bit file support on Linux])
557 dnl **** Check for gcc strength-reduce bug ****
559 if test "x${GCC}" = "xyes"
561 CFLAGS="$CFLAGS -Wall"
562 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
564 int L[[4]] = {0,1,2,3};
566 static int Array[[3]];
569 for(i=0; i<B; i++) Array[[i]] = i - 3;
570 for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
573 exit( Array[[1]] != -2 || L[[2]] != 3);
575 ac_cv_c_gcc_strength_bug="no",
576 ac_cv_c_gcc_strength_bug="yes",
577 ac_cv_c_gcc_strength_bug="yes") )
578 if test "$ac_cv_c_gcc_strength_bug" = "yes"
580 CFLAGS="$CFLAGS -fno-strength-reduce"
583 dnl Check for -mpreferred-stack-boundary
584 AC_CACHE_CHECK("for gcc -mpreferred-stack-boundary=2 support",
585 ac_cv_c_gcc_stack_boundary,
586 [saved_cflags=$CFLAGS
587 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
588 AC_TRY_COMPILE(,[return 0],ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")
591 if test "$ac_cv_c_gcc_stack_boundary" = "yes"
593 CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
597 dnl **** Check if we need to place .type inside a .def directive ****
599 AC_CACHE_CHECK("whether .type must sit inside a .def directive",
602 LIBS="conftest_asm.s $LIBS"
603 cat > conftest_asm.s <<EOF
605 .def _ac_test; .scl 2; .type 32; .endef
609 AC_TRY_LINK(,,ac_cv_c_type_in_def="yes",ac_cv_c_type_in_def="no")
611 if test "$ac_cv_c_type_in_def" = "yes"
613 AC_DEFINE(NEED_TYPE_IN_DEF, 1, [Define if .type asm directive must be inside a .def directive])
616 dnl **** Check for underscore on external symbols ****
618 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
619 ac_cv_c_extern_prefix,
621 LIBS="conftest_asm.s $LIBS"
622 cat > conftest_asm.s <<EOF
627 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
628 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
630 if test "$ac_cv_c_extern_prefix" = "yes"
632 AC_DEFINE(NEED_UNDERSCORE_PREFIX, 1,
633 [Define if symbols declared in assembly code need an underscore prefix])
636 dnl **** Check for .string in assembler ****
638 AC_CACHE_CHECK("whether assembler accepts .string",
641 LIBS="conftest_asm.s $LIBS"
642 cat > conftest_asm.s <<EOF
645 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
647 if test "$ac_cv_c_asm_string" = "yes"
649 AC_DEFINE(HAVE_ASM_STRING, 1, [Define to use .string instead of .ascii])
652 dnl **** Check for working dll ****
656 if test "$LIBEXT" = "so"
658 AC_CACHE_CHECK("whether we can build a GNU style ELF dll",
660 [saved_cflags=$CFLAGS
661 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
662 AC_TRY_LINK(,[return 1],ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")
665 if test "$ac_cv_c_dll_gnuelf" = "yes"
667 LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
668 LDDLLFLAGS="-Wl,-Bsymbolic"
670 AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
671 ac_cv_c_dll_unixware,
672 [saved_cflags=$CFLAGS
673 CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
674 AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
677 if test "$ac_cv_c_dll_unixware" = "yes"
679 LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
680 LDDLLFLAGS="-Wl,-B,symbolic"
683 if test "$ac_cv_c_dll_gnuelf" = "no" -a "$ac_cv_c_dll_unixware" = "no"
686 if test "$DLLWRAP" = "dllwrap"; then
687 dnl FIXME - check whether dllwrap works correctly...
688 if test "$CYGWIN" = "yes"; then
689 echo "*** use dllwrap for building shared library."
696 if test "$LIBEXT" = "a"; then
697 echo "*** It is currently not possible to build WINE without shared"
698 echo "*** library (.so) support to allow transparent switch between .so"
699 echo "*** and .dll files."
700 echo "*** If you are using Linux, you will need a newer binutils."
707 if test "$LIBEXT" = "so"; then
709 LDPATH="LD_LIBRARY_PATH=\"\$(TOPOBJDIR)/unicode:\$\$LD_LIBRARY_PATH\""
710 elif test "$LIBEXT" = "dll"; then
711 #DLLFLAGS="-fPIC" # -fPIC doesn't work(at least in cygwin-b20) - FIXME
712 LDPATH="PATH=\"\$(TOPOBJDIR)/unicode:\$\$PATH\""
721 dnl **** Check for reentrant libc ****
723 dnl For cross-compiling we blindly assume that libc is reentrant. This is
724 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
726 AC_DEFUN(WINE_CHECK_ERRNO,
728 AC_CACHE_CHECK(for reentrant libc: $1, wine_cv_libc_r_$1,
729 [AC_TRY_RUN([int myerrno = 0;
731 int *$1(){return &myerrno;}
732 main(){connect(0,buf,255); exit(!myerrno);}],
733 wine_cv_libc_r_$1=yes, wine_cv_libc_r_$1=no,
734 wine_cv_libc_r_$1=yes )
736 if test "$wine_cv_libc_r_$1" = "yes"
738 wine_cv_libc_reentrant=$1
742 wine_cv_libc_reentrant=no
743 dnl Linux style errno location
744 WINE_CHECK_ERRNO(__errno_location)
745 dnl FreeBSD style errno location
746 WINE_CHECK_ERRNO(__error)
747 dnl Solaris style errno location
748 WINE_CHECK_ERRNO(___errno)
749 dnl UnixWare style errno location
750 WINE_CHECK_ERRNO(__thr_errno)
751 dnl NetBSD style errno location
752 WINE_CHECK_ERRNO(__errno)
754 if test "$wine_cv_libc_reentrant" != "no"
756 AC_DEFINE_UNQUOTED(ERRNO_LOCATION,$wine_cv_libc_reentrant,
757 [Define to the name of the function returning errno for reentrant libc])
760 dnl **** Check for reentrant X libraries ****
762 dnl This may fail to determine whether X libraries are reentrant if
763 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
764 dnl is possible with the --without-reentrant-x option.
766 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
768 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
769 [ if test "x$with_reentrant_x" = "xno"
771 wine_cv_x_reentrant=no
774 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
775 if test -r $dir/libX11.so; then
776 libX11_check="-D $dir/libX11.so"
779 if test -r $dir/libX11.a; then
780 libX11_check="$dir/libX11.a"
784 if test "$libX11_check" != "none"; then
785 if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
787 wine_cv_x_reentrant=yes
789 wine_cv_x_reentrant=no
792 wine_cv_x_reentrant=unknown
796 wine_cv_x_reentrant=no
798 if test "$wine_cv_x_reentrant" = "no"
800 AC_DEFINE(NO_REENTRANT_X11, 1,
801 [Define if X libraries are not reentrant (compiled without -D_REENTRANT)])
805 dnl **** Check for functions ****
846 dnl **** Check for header files ****
904 dnl **** Check for types ****
909 AC_CHECK_SIZEOF(long long,0)
911 AC_CACHE_CHECK("whether linux/input.h is for real",
912 wine_cv_linux_input_h,
914 #include <linux/input.h>
916 int foo = EVIOCGBIT(EV_ABS,42);
917 int bar = BTN_PINKIE;
920 wine_cv_linux_input_h=yes,
921 wine_cv_linux_input_h=no,
925 if test "$wine_cv_linux_input_h" = "yes"
927 AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H, 1,
928 [Define if we have linux/input.h AND it contains the INPUT event API])
932 AC_CACHE_CHECK("whether we can use re-entrant gethostbyname_r Linux style",
933 wine_cv_linux_gethostbyname_r_6,
939 struct hostent *result;
946 res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
947 res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
949 wine_cv_linux_gethostbyname_r_6=yes,
950 wine_cv_linux_gethostbyname_r_6=no
953 if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
955 AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6, 1,
956 [Define if Linux-style gethostbyname_r and gethostbyaddr_r are available])
959 if test "$ac_cv_header_linux_joystick_h" = "yes"
961 AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
962 wine_cv_linux_joystick_22_api,
964 #include <sys/ioctl.h>
965 #include <linux/joystick.h>
967 struct js_event blub;
968 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
969 #error "no 2.2 header"
972 wine_cv_linux_joystick_22_api=yes,
973 wine_cv_linux_joystick_22_api=no,
974 wine_cv_linux_joystick_22_api=no
977 if test "$wine_cv_linux_joystick_22_api" = "yes"
979 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API, 1,
980 [Define if <linux/joystick.h> defines the Linux 2.2 joystick API])
984 dnl **** statfs checks ****
986 if test "$ac_cv_header_sys_vfs_h" = "yes"
988 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
989 wine_cv_sys_vfs_has_statfs,
991 #include <sys/types.h>
992 #ifdef HAVE_SYS_PARAM_H
993 # include <sys/param.h>
999 memset(&stfs,0,sizeof(stfs));
1000 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
1003 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
1005 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS, 1,
1006 [Define if the struct statfs is defined by <sys/vfs.h>])
1010 if test "$ac_cv_header_sys_statfs_h" = "yes"
1012 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
1013 wine_cv_sys_statfs_has_statfs,
1015 #include <sys/types.h>
1016 #ifdef HAVE_SYS_PARAM_H
1017 # include <sys/param.h>
1019 #include <sys/statfs.h>
1022 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
1025 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
1027 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS, 1,
1028 [Define if the struct statfs is defined by <sys/statfs.h>])
1032 if test "$ac_cv_header_sys_mount_h" = "yes"
1034 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
1035 wine_cv_sys_mount_has_statfs,
1037 #include <sys/types.h>
1038 #ifdef HAVE_SYS_PARAM_H
1039 # include <sys/param.h>
1041 #include <sys/mount.h>
1044 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
1047 if test "$wine_cv_sys_mount_has_statfs" = "yes"
1049 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT, 1,
1050 [Define if the struct statfs is defined by <sys/mount.h>])
1054 dnl **** FIXME: what about mixed cases, where we need two of them? ***
1056 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
1057 [ if test "x$statfs_bfree" = "xno"
1059 wine_cv_statfs_bfree=no
1062 #include <sys/types.h>
1063 #ifdef HAVE_SYS_PARAM_H
1064 # include <sys/param.h>
1066 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1067 # include <sys/mount.h>
1069 # ifdef STATFS_DEFINED_BY_SYS_VFS
1070 # include <sys/vfs.h>
1072 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1073 # include <sys/statfs.h>
1081 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
1084 if test "$wine_cv_statfs_bfree" = "yes"
1086 AC_DEFINE(STATFS_HAS_BFREE, 1, [Define if the struct statfs has the member bfree])
1089 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
1090 [ if test "x$statfs_bavail" = "xno"
1092 wine_cv_statfs_bavail=no
1095 #include <sys/types.h>
1096 #ifdef HAVE_SYS_PARAM_H
1097 # include <sys/param.h>
1099 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1100 # include <sys/mount.h>
1102 # ifdef STATFS_DEFINED_BY_SYS_VFS
1103 # include <sys/vfs.h>
1105 # ifdef STATFS_DEFINED_BY_SYS_STATFS
1106 # include <sys/statfs.h>
1114 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
1117 if test "$wine_cv_statfs_bavail" = "yes"
1119 AC_DEFINE(STATFS_HAS_BAVAIL, 1, [Define if the struct statfs has the member bavail])
1122 dnl *** check for file descriptor passing with msg_accrights
1124 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
1125 AC_TRY_COMPILE([#include <sys/types.h>
1126 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
1127 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
1128 if test "$ac_cv_c_msg_accrights" = "yes"
1130 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS, 1, [Define if struct msghdr contains msg_accrights])
1133 dnl *** Check for the sa_len member in struct sockaddr
1135 AC_CACHE_CHECK("for sa_len in struct sockaddr", ac_cv_c_sockaddr_sa_len,
1136 AC_TRY_COMPILE([#include <sys/types.h>
1137 #include <sys/socket.h>
1138 ], [static struct sockaddr addr; addr.sa_len = 1],
1139 ac_cv_c_sockaddr_sa_len="yes", ac_cv_c_sockaddr_sa_len="no"))
1140 if test "$ac_cv_c_sockaddr_sa_len" = "yes"
1142 AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if struct sockaddr contains sa_len])
1145 dnl *** Check for the sun_len member in struct sockaddr_un
1147 AC_CACHE_CHECK("for sun_len in struct sockaddr_un", ac_cv_c_sockaddr_sun_len,
1148 AC_TRY_COMPILE([#include <sys/types.h>
1149 #include <sys/socket.h>
1150 #include <sys/un.h>], [static struct sockaddr_un addr; addr.sun_len = 1],
1151 ac_cv_c_sockaddr_sun_len="yes", ac_cv_c_sockaddr_sun_len="no"))
1152 if test "$ac_cv_c_sockaddr_sun_len" = "yes"
1154 AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un contains sun_len])
1157 dnl *** check for the need to define __i386__
1159 AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
1160 AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
1163 ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
1164 if test "$ac_cv_cpp_def_i386" = "yes"
1166 CFLAGS="$CFLAGS -D__i386__"
1167 LINTFLAGS="$LINTFLAGS -D__i386__"
1170 dnl $GCC is set by autoconf
1172 if test "$GCC" = "yes"
1174 GCC_NO_BUILTIN="-fno-builtin"
1176 AC_SUBST(GCC_NO_BUILTIN)
1178 dnl **** Generate output files ****
1180 AC_OUTPUT_COMMANDS([
1182 dlls/ddraw/d3ddevice \
1183 dlls/ddraw/dclipper \
1185 dlls/ddraw/direct3d \
1186 dlls/ddraw/dpalette \
1187 dlls/ddraw/dsurface \
1188 dlls/dinput/joystick \
1189 dlls/dinput/keyboard \
1191 dlls/kernel/messages \
1193 dlls/user/resources \
1196 for i in $extra_subdirs; do [ -d $i ] || (echo "creating $i" && mkdir $i); done ])
1198 MAKE_RULES=Make.rules
1199 AC_SUBST_FILE(MAKE_RULES)
1201 MAKE_DLL_RULES=dlls/Makedll.rules
1202 AC_SUBST_FILE(MAKE_DLL_RULES)
1204 MAKE_PROG_RULES=programs/Makeprog.rules
1205 AC_SUBST_FILE(MAKE_PROG_RULES)
1210 programs/Makeprog.rules
1216 dlls/advapi32/Makefile
1217 dlls/avifil32/Makefile
1218 dlls/comctl32/Makefile
1219 dlls/commdlg/Makefile
1220 dlls/crtdll/Makefile
1221 dlls/dciman32/Makefile
1223 dlls/dinput/Makefile
1225 dlls/dplayx/Makefile
1226 dlls/dsound/Makefile
1230 dlls/imagehlp/Makefile
1232 dlls/kernel/Makefile
1233 dlls/lzexpand/Makefile
1234 dlls/mapi32/Makefile
1237 dlls/msimg32/Makefile
1238 dlls/msnet32/Makefile
1239 dlls/msvcrt/Makefile
1240 dlls/msvideo/Makefile
1242 dlls/odbc32/Makefile
1244 dlls/oleaut32/Makefile
1245 dlls/olecli/Makefile
1246 dlls/oledlg/Makefile
1247 dlls/olepro32/Makefile
1248 dlls/olesvr/Makefile
1249 dlls/opengl32/Makefile
1251 dlls/quartz/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
1262 dlls/tapi32/Makefile
1263 dlls/ttydrv/Makefile
1265 dlls/urlmon/Makefile
1267 dlls/version/Makefile
1268 dlls/win32s/Makefile
1269 dlls/winaspi/Makefile
1270 dlls/winedos/Makefile
1271 dlls/wineps/Makefile
1272 dlls/wininet/Makefile
1274 dlls/winmm/joystick/Makefile
1275 dlls/winmm/mcianim/Makefile
1276 dlls/winmm/mciavi/Makefile
1277 dlls/winmm/mcicda/Makefile
1278 dlls/winmm/mciseq/Makefile
1279 dlls/winmm/mciwave/Makefile
1280 dlls/winmm/midimap/Makefile
1281 dlls/winmm/wavemap/Makefile
1282 dlls/winmm/wineoss/Makefile
1283 dlls/winnls/Makefile
1284 dlls/winsock/Makefile
1285 dlls/winspool/Makefile
1286 dlls/wintrust/Makefile
1288 dlls/wsock32/Makefile
1289 dlls/x11drv/Makefile
1290 documentation/Makefile
1291 documentation/wine.conf.man
1292 documentation/wine.man
1295 graphics/enhmetafiledrv/Makefile
1296 graphics/metafiledrv/Makefile
1297 graphics/win16drv/Makefile
1298 graphics/x11drv/Makefile
1313 programs/avitools/Makefile
1314 programs/clock/Makefile
1315 programs/cmdlgtst/Makefile
1316 programs/control/Makefile
1317 programs/notepad/Makefile
1318 programs/osversioncheck/Makefile
1319 programs/progman/Makefile
1320 programs/regapi/Makefile
1321 programs/regtest/Makefile
1322 programs/uninstaller/Makefile
1323 programs/view/Makefile
1324 programs/wcmd/Makefile
1325 programs/winemine/Makefile
1326 programs/winetest/Makefile
1327 programs/winhelp/Makefile
1328 programs/winver/Makefile
1333 tools/winapi/Makefile
1334 tools/winebuild/Makefile
1335 tools/winedump/Makefile
1343 windows/x11drv/Makefile ])
1345 if test "$have_x" = "no"
1348 echo "*** Warning: X development files not found. Wine will be built without"
1349 echo "*** X support, which currently does not work, and would probably not be"
1350 echo "*** what you want anyway. You will need to install devel packages of"
1351 echo "*** Xlib/Xfree86 and Xpm at the very least."
1352 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
1355 echo "*** Warning: Xpm development files not found. Wine will be built without"
1356 echo "*** Xpm support, which currently does not work. You will need to install"
1357 echo "*** devel packages of Xpm."
1360 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
1363 echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
1364 echo "*** terminal resize support. Consider upgrading ncurses."
1367 if test "$wine_cv_libc_reentrant" = "no"
1370 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
1371 echo "*** thread support. Consider upgrading libc to a more recent"
1372 echo "*** reentrant version of libc."
1375 if test "$wine_cv_opengl_version_OK" = "no"
1378 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1379 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1382 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "normal"
1385 echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
1386 echo "*** thread-safety. To prevent crashes, OpenGL support has been removed."
1387 echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine,"
1388 echo "*** start configure with '--enable-opengl' to force OpenGL support."
1391 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a $OPENGL = "yes"
1394 echo "*** Warning: you explicitly linked in a thread-safe OpenGL version. If you"
1395 echo "*** experience unusual crashes on DirectDraw games, try first to disable OpenGL"
1396 echo "*** support before reporting bugs."
1399 if test "$wine_cv_warn_cups_h" = "yes"
1402 echo "*** Note: You have cups runtime libraries, but no development"
1403 echo "*** libraries. Install the cups-devel package or whichever package"
1404 echo "*** contains cups.h to enable CUPS support in WINE."
1407 if test "$wine_cv_msg_freetype" = "yes"
1410 echo "*** Note: Your system appears to have the FreeType 2 runtime libraries"
1411 echo "*** installed, but 'freetype-config' is not in your PATH. Install the"
1412 echo "*** freetype-devel package (or its equivalent on your distribution) to"
1413 echo "*** enable Wine to use TrueType fonts."
1417 echo "Configure finished. Do 'make depend && make' to compile Wine."
1420 dnl Local Variables:
1421 dnl comment-start: "dnl "
1423 dnl comment-start-skip: "\\bdnl\\b\\s *"
1424 dnl compile-command: "autoconf"