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 # We want these before the checks, so the checks can modify their values.
11 test -z "$PROGEXT" && PROGEXT="" AC_SUBST(PROGEXT)
13 dnl **** Command-line arguments ****
18 ALT_LINK="-L\$(TOPOBJDIR) -lwine"
19 TRACE_MSGS=yes # the TRACE() macro
20 DEBUG_MSGS=yes # the TRACE(), WARN(), and FIXME() macros.
22 AC_ARG_ENABLE(emulator,
23 [ --disable-emulator build only the Wine library, not the emulator],
24 [if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi])
27 [ --enable-dll build the Wine library as a DLL],
28 [if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi])
31 [ --disable-lib build the Wine without building libwine.a],
32 [if test "$enableval" = "no"; then ALT_LINK="\$(LIBOBJS) \$(X11OBJS)"; LIB_TARGET=""; fi])
35 dnl [ --enable-ipc use inter-process communication for DDE],
36 dnl [if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
39 [ --disable-debug compile out all debugging messages],
40 [if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
43 [ --disable-trace compile out TRACE messages],
44 [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
46 AC_ARG_WITH(reentrant-x,
47 [ --without-reentrant-x compile for use with non-reentrant X libraries])
54 if test "$DEBUG_MSGS" = "no"
56 AC_DEFINE(NO_DEBUG_MSGS)
57 AC_DEFINE(NO_TRACE_MSGS)
59 if test "$TRACE_MSGS" = "no"
61 AC_DEFINE(NO_TRACE_MSGS)
65 dnl **** Check for some programs ****
76 AC_CHECK_PROG(C2MAN,c2man,c2man,true)
78 dnl **** Check for some libraries ****
80 dnl Check for -li386 for NetBSD and OpenBSD
81 AC_CHECK_LIB(i386,i386_set_ldt)
82 dnl Check for -lossaudio for NetBSD
83 AC_CHECK_LIB(ossaudio,_oss_ioctl)
84 dnl Check for -lw for Solaris
85 AC_CHECK_LIB(w,iswalnum)
86 dnl Check for -lnsl for Solaris
87 AC_CHECK_FUNCS(gethostbyname)
88 if test "$ac_cv_func_gethostbyname" = "no"
90 AC_CHECK_LIB(nsl,gethostbyname)
92 dnl Check for -lxpg4 for FreeBSD
93 AC_CHECK_LIB(xpg4,setrunelocale)
95 AC_CHECK_LIB(dl,dlopen)
97 if test "$have_x" = "yes"
100 ac_save_CPPFLAGS="$CPPFLAGS"
101 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
104 AC_CHECK_HEADERS(X11/xpm.h)
105 if test "$ac_cv_header_X11_xpm_h" = "yes"
107 AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
110 dnl Check for X Shm extension
111 AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/XShm.h)
112 if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_XShm_h" = "yes"
114 AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
116 dnl Check for XFree86 DGA extension
117 AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86dga.h)
118 if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
120 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
123 dnl Check for XFree86 VMODE extension
124 AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86vmode.h)
125 if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
127 AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
129 dnl Check for the presence of Mesa
130 AC_CHECK_HEADERS(GL/gl.h GL/osmesa.h)
131 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_osmesa_h" = "yes"
133 AC_CHECK_LIB(MesaGL,OSMesaCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm)
136 CPPFLAGS="$ac_save_CPPFLAGS"
143 dnl **** Check which curses lib to use ***
144 AC_CHECK_HEADERS(ncurses.h)
145 if test "$ac_cv_header_ncurses_h" = "yes"
147 AC_CHECK_LIB(ncurses,waddch)
149 if test "$ac_cv_lib_ncurses_waddch" = "yes"
151 AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
152 AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
154 AC_CHECK_HEADERS(curses.h)
155 if test "$ac_cv_header_curses_h" = "yes"
157 AC_CHECK_LIB(curses,waddch)
158 AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
159 AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
163 dnl **** Check for IPX (currently Linux only) ****
164 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
166 [#include <sys/socket.h>
167 #include <netipx/ipx.h>],
168 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
169 [AC_DEFINE(HAVE_IPX_GNU)
170 ac_cv_c_ipx_gnu="yes"],
171 [ac_cv_c_ipx_gnu="no"])
174 if test "$ac_cv_c_ipx_gnu" = "no"
176 AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
178 [#include <sys/socket.h>
179 #include <asm/types.h>
180 #include <linux/ipx.h>],
181 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
182 [AC_DEFINE(HAVE_IPX_LINUX)
183 ac_cv_c_ipx_linux="yes"],
184 [ac_cv_c_ipx_linux="no"])
188 dnl **** Check for Open Sound System ****
189 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
191 AC_CACHE_CHECK("for Open Sound System",
192 ac_cv_c_opensoundsystem,
194 #if defined(HAVE_SYS_SOUNDCARD_H)
195 #include <sys/soundcard.h>
196 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
197 #include <machine/soundcard.h>
198 #elif defined(HAVE_SOUNDCARD_H)
199 #include <soundcard.h>
203 /* check for one of the Open Sound System specific SNDCTL_ defines */
204 #if !defined(SNDCTL_DSP_STEREO)
205 #error No open sound system
207 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
209 if test "$ac_cv_c_opensoundsystem" = "yes"
214 dnl **** Check for union semun ****
216 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
217 AC_TRY_COMPILE([#include <sys/types.h>
218 #include <sys/sem.h>],[union semun foo],
219 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
220 if test "$ac_cv_c_union_semun" = "yes"
222 AC_DEFINE(HAVE_UNION_SEMUN)
225 dnl **** If ln -s doesn't work, use cp instead ****
226 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
228 dnl **** Check for gcc strength-reduce bug ****
230 if test "x${GCC}" = "xyes"
232 CFLAGS="$CFLAGS -Wall"
233 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
236 static int Array[[3]];
239 for(i=0; i<B; i++) Array[[i]] = i - 3;
240 exit( Array[[1]] != -2 );
242 ac_cv_c_gcc_strength_bug="no",
243 ac_cv_c_gcc_strength_bug="yes",
244 ac_cv_c_gcc_strength_bug="yes") )
245 if test "$ac_cv_c_gcc_strength_bug" = "yes"
247 CFLAGS="$CFLAGS -fno-strength-reduce"
251 dnl **** Check for underscore on external symbols ****
253 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
254 ac_cv_c_extern_prefix,
256 LIBS="conftest_asm.s $LIBS"
257 cat > conftest_asm.s <<EOF
262 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
263 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
265 if test "$ac_cv_c_extern_prefix" = "yes"
267 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
270 dnl **** Check for .string in assembler ****
272 AC_CACHE_CHECK("whether assembler accepts .string",
275 LIBS="conftest_asm.s $LIBS"
276 cat > conftest_asm.s <<EOF
279 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
281 if test "$ac_cv_c_asm_string" = "yes"
283 AC_DEFINE(HAVE_ASM_STRING)
286 dnl **** Check for working dll ****
290 if test "$LIB_TARGET" = "libwine.so.1.0"
292 AC_CACHE_CHECK("whether we can build a Linux dll",
294 [saved_cflags=$CFLAGS
295 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
296 AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
299 if test "$ac_cv_c_dll_linux" = "yes"
302 LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
304 AC_CACHE_CHECK("whether we can build a NetBSD dll",
306 [saved_cflags=$CFLAGS
307 CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
308 AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
311 if test "$ac_cv_c_dll_netbsd" = "yes"
314 LDSHARED="ld -Bshareable -Bforcearchive"
317 if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
319 LIB_TARGET="libwine.a"
325 dnl **** Check for reentrant libc ****
327 dnl For cross-compiling we blindly assume that libc is reentrant. This is
328 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
330 AC_CACHE_CHECK("for reentrant libc", wine_cv_libc_reentrant,
331 [AC_TRY_RUN([int myerrno = 0;
333 int *__errno_location(){return &myerrno;}
334 main(){connect(0,buf,255); exit(!myerrno);}],
335 wine_cv_libc_reentrant=yes, wine_cv_libc_reentrant=no,
336 wine_cv_libc_reentrant=yes ) ] )
337 if test "$wine_cv_libc_reentrant" = "no"
339 AC_DEFINE(NO_REENTRANT_LIBC)
342 dnl **** Check for reentrant X libraries ****
344 dnl This may fail to determine whether X libraries are reentrant if
345 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
346 dnl is possible with the --without-reentrant-x option.
348 if test "$have_x" = "yes"
350 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
351 [ if test "x$with_reentrant_x" = "xno"
353 wine_cv_x_reentrant=no
356 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
357 if test -r $dir/libX11.so; then
358 libX11_check="-D $dir/libX11.so"
361 if test -r $dir/libX11.a; then
362 libX11_check="$dir/libX11.a"
366 if test "$libX11_check" != "none"; then
367 if nm $libX11_check | grep __errno_location >/dev/null 2>&1
369 wine_cv_x_reentrant=yes
371 wine_cv_x_reentrant=no
374 wine_cv_x_reentrant=unknown
378 wine_cv_x_reentrant=no
380 if test "$wine_cv_x_reentrant" = "no"
382 AC_DEFINE(NO_REENTRANT_X11)
385 dnl **** Check for functions and header files ****
387 AC_CHECK_FUNCS(clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
388 AC_CHECK_HEADERS(wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h sys/statfs.h float.h linux/cdrom.h linux/ucdrom.h sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h dlfcn.h unistd.h sys/sockio.h net/if.h netinet/in.h sys/file.h libio.h curses.h ncurses.h elf.h resolv.h)
392 AC_CHECK_SIZEOF(long long,0)
394 dnl **** Check for sendmsg in -lsocket if not found above ****
396 if test $ac_cv_func_sendmsg = no; then
397 AC_CHECK_LIB(socket,sendmsg)
400 dnl **** statfs checks ****
402 if test "$ac_cv_header_sys_vfs_h" = "yes"
404 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
405 wine_cv_sys_vfs_has_statfs,
407 #include <sys/types.h>
408 #ifdef HAVE_SYS_PARAM_H
409 # include <sys/param.h>
415 memset(&stfs,0,sizeof(stfs));
416 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
419 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
421 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
425 if test "$ac_cv_header_sys_statfs_h" = "yes"
427 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
428 wine_cv_sys_statfs_has_statfs,
430 #include <sys/types.h>
431 #ifdef HAVE_SYS_PARAM_H
432 # include <sys/param.h>
434 #include <sys/statfs.h>
437 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
440 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
442 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
446 if test "$ac_cv_header_sys_mount_h" = "yes"
448 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
449 wine_cv_sys_mount_has_statfs,
451 #include <sys/types.h>
452 #ifdef HAVE_SYS_PARAM_H
453 # include <sys/param.h>
455 #include <sys/mount.h>
458 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
461 if test "$wine_cv_sys_mount_has_statfs" = "yes"
463 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
467 dnl **** FIXME: what about mixed cases, where we need two of them? ***
469 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
470 [ if test "x$statfs_bfree" = "xno"
472 wine_cv_statfs_bfree=no
475 #include <sys/types.h>
476 #ifdef HAVE_SYS_PARAM_H
477 # include <sys/param.h>
479 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
480 # include <sys/mount.h>
482 # ifdef STATFS_DEFINED_BY_SYS_VFS
483 # include <sys/vfs.h>
485 # ifdef STATFS_DEFINED_BY_SYS_STATFS
486 # include <sys/statfs.h>
494 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
497 if test "$wine_cv_statfs_bfree" = "yes"
499 AC_DEFINE(STATFS_HAS_BFREE)
502 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
503 [ if test "x$statfs_bavail" = "xno"
505 wine_cv_statfs_bavail=no
508 #include <sys/types.h>
509 #ifdef HAVE_SYS_PARAM_H
510 # include <sys/param.h>
512 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
513 # include <sys/mount.h>
515 # ifdef STATFS_DEFINED_BY_SYS_VFS
516 # include <sys/vfs.h>
518 # ifdef STATFS_DEFINED_BY_SYS_STATFS
519 # include <sys/statfs.h>
527 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
530 if test "$wine_cv_statfs_bavail" = "yes"
532 AC_DEFINE(STATFS_HAS_BAVAIL)
535 dnl *** check for working sigaltstack
536 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
538 AC_CACHE_CHECK("for working sigaltstack",
539 ac_cv_c_working_sigaltstack,
542 #include <time.h> /* <sys/time.h> ? bad magic without end */
543 #include <sys/types.h>
544 #include <sys/signal.h>
545 #ifdef HAVE_SYS_PARAM_H
546 # include <sys/param.h>
548 #ifdef HAVE_SYSCALL_H
549 # include <syscall.h>
551 # ifdef HAVE_SYS_SYSCALL_H
552 # include <sys/syscall.h>
556 unsigned char *xaltstack;
559 main(int argc,char **argv) {
560 struct sigaltstack ss;
562 xaltstack = malloc(16384);
563 ss.ss_sp = xaltstack;
566 if (sigaltstack(&ss, NULL) < 0) {
567 /* this catches the glibc case */
568 perror("sigaltstack");
569 return (1); /* aka exit(1) aka fail */
571 /* assume it works. */
575 ac_cv_c_working_sigaltstack="yes",
576 ac_cv_c_working_sigaltstack="no",
577 ac_cv_c_working_sigaltstack="no"
580 if test "$ac_cv_c_working_sigaltstack" = "yes"
582 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
586 dnl *** check for file descriptor passing with msg_accrights
588 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
589 AC_TRY_COMPILE([#include <sys/types.h>
590 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
591 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
592 if test "$ac_cv_c_msg_accrights" = "yes"
594 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
597 dnl **** Generate output files ****
599 MAKE_RULES=Make.rules
600 AC_SUBST_FILE(MAKE_RULES)
609 dlls/advapi32/Makefile
610 dlls/comctl32/Makefile
611 dlls/imagehlp/Makefile
613 dlls/msacm32/Makefile
616 dlls/rasapi32/Makefile
617 dlls/shell32/Makefile
619 dlls/version/Makefile
620 dlls/winaspi/Makefile
621 dlls/wnaspi32/Makefile
622 documentation/Makefile
625 graphics/metafiledrv/Makefile
626 graphics/psdrv/Makefile
627 graphics/ttydrv/Makefile
628 graphics/win16drv/Makefile
629 graphics/x11drv/Makefile
646 programs/clock/Makefile
647 programs/cmdlgtst/Makefile
648 programs/control/Makefile
649 programs/avitools/Makefile
650 programs/notepad/Makefile
651 programs/progman/Makefile
652 programs/regtest/Makefile
653 programs/view/Makefile
654 programs/winhelp/Makefile
655 programs/winver/Makefile
666 windows/ttydrv/Makefile
667 windows/x11drv/Makefile ])
669 if test "$have_x" = "no"
672 echo "*** Warning: X development files not found. Wine will be built without"
673 echo "*** X support, which currently does not work, and would probably not be"
674 echo "*** what you want anyway. You will need to install devel packages of"
675 echo "*** Xlib/Xfree86 and Xpm at the very least."
676 elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
679 echo "*** Warning: Xpm development files not found. Wine will be built without"
680 echo "*** Xpm support, which currently does not work. You will need to install"
681 echo "*** devel packages of Xpm."
684 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
687 echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
688 echo "*** terminal resize support. Consider upgrading ncurses."
691 if test "$wine_cv_libc_reentrant" = "no"
694 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
695 echo "*** thread support. Consider upgrading libc to a more recent"
696 echo "*** reentrant version of libc."
700 echo "Configure finished. Do 'make depend && make' to compile Wine."
704 dnl comment-start: "dnl "
706 dnl comment-start-skip: "\\bdnl\\b\\s *"
707 dnl compile-command: "autoconf"