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 ****
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])
47 [ --with-ncurses compile in the ncurses terminal (EXPERIMENTAL)],
48 [if test "$withval" = "yes"; then LIBS="$LIBS -lncurses"; AC_DEFINE(WINE_NCURSES) fi])
50 AC_ARG_WITH(reentrant-x,
51 [ --without-reentrant-x compile for use with non-reentrant X libraries])
58 if test "$DEBUG_MSGS" = "no"
60 AC_DEFINE(NO_DEBUG_MSGS)
61 AC_DEFINE(NO_TRACE_MSGS)
63 if test "$TRACE_MSGS" = "no"
65 AC_DEFINE(NO_TRACE_MSGS)
69 dnl **** Check for some programs ****
80 AC_CHECK_PROG(C2MAN,c2man,c2man,true)
82 dnl **** Check for some libraries ****
84 dnl Check for -li386 for NetBSD and OpenBSD
85 AC_CHECK_LIB(i386,i386_set_ldt)
86 dnl Check for -lw for Solaris
87 AC_CHECK_LIB(w,iswalnum)
88 dnl Check for -lnsl for Solaris
89 AC_CHECK_FUNCS(gethostbyname)
90 if test "$ac_cv_func_gethostbyname" = "no"
92 AC_CHECK_LIB(nsl,gethostbyname)
94 dnl Check for -lxpg4 for FreeBSD
95 AC_CHECK_LIB(xpg4,setrunelocale)
97 AC_CHECK_LIB(dl,dlopen)
99 if test "$have_x" = "yes"
101 XLIB="-lXpm -lXext -lX11"
103 dnl FIXME: should be done once we can compile without -lXpm
104 dnl AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
105 dnl Check for X Shm extension
106 AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
107 dnl Check for XFree86 DGA extension
108 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
109 dnl Check for XFree86 VMODE extension
110 AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
117 dnl **** Check for Open Sound System ****
118 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
120 AC_CACHE_CHECK("for Open Sound System",
121 ac_cv_c_opensoundsystem,
123 #ifdef HAVE_SYS_SOUNDCARD_H
124 #include <sys/soundcard.h>
126 #ifdef HAVE_MACHINE_SOUNDCARD_H
127 #include <machine/soundcard.h>
131 /* check for one of the Open Sound System specific SNDCTL_ defines */
132 #if !defined(SNDCTL_DSP_STEREO)
133 #error No open sound system
135 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
137 if test "$ac_cv_c_opensoundsystem" = "yes"
142 dnl **** Check for union semun ****
144 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
145 AC_TRY_COMPILE([#include <sys/types.h>
146 #include <sys/sem.h>],[union semun foo],
147 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
148 if test "$ac_cv_c_union_semun" = "yes"
150 AC_DEFINE(HAVE_UNION_SEMUN)
153 dnl **** If ln -s doesn't work, use cp instead ****
154 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
156 dnl **** Check for gcc strength-reduce bug ****
158 if test "x${GCC}" = "xyes"
160 CFLAGS="$CFLAGS -Wall"
161 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
164 static int Array[[3]];
167 for(i=0; i<B; i++) Array[[i]] = i - 3;
168 exit( Array[[1]] != -2 );
170 ac_cv_c_gcc_strength_bug="no",
171 ac_cv_c_gcc_strength_bug="yes",
172 ac_cv_c_gcc_strength_bug="yes") )
173 if test "$ac_cv_c_gcc_strength_bug" = "yes"
175 CFLAGS="$CFLAGS -fno-strength-reduce"
179 dnl **** Check for underscore on external symbols ****
181 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
182 ac_cv_c_extern_prefix,
184 LIBS="conftest_asm.s $LIBS"
185 cat > conftest_asm.s <<EOF
190 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
191 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
193 if test "$ac_cv_c_extern_prefix" = "yes"
195 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
198 dnl **** Check for .string in assembler ****
200 AC_CACHE_CHECK("whether assembler accepts .string",
203 LIBS="conftest_asm.s $LIBS"
204 cat > conftest_asm.s <<EOF
207 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
209 if test "$ac_cv_c_asm_string" = "yes"
211 AC_DEFINE(HAVE_ASM_STRING)
214 dnl **** Check for working dll ****
218 if test "$LIB_TARGET" = "libwine.so.1.0"
220 AC_CACHE_CHECK("whether we can build a Linux dll",
222 [saved_cflags=$CFLAGS
223 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
224 AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
227 if test "$ac_cv_c_dll_linux" = "yes"
230 LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
232 AC_CACHE_CHECK("whether we can build a NetBSD dll",
234 [saved_cflags=$CFLAGS
235 CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
236 AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
239 if test "$ac_cv_c_dll_netbsd" = "yes"
242 LDSHARED="ld -Bshareable -Bforcearchive"
245 if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
247 LIB_TARGET="libwine.a"
253 dnl **** Check for reentrant libc ****
255 dnl For cross-compiling we blindly assume that libc is reentrant. This is
256 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
258 AC_CACHE_CHECK("for reentrant libc", wine_cv_libc_reentrant,
259 [AC_TRY_RUN([int myerrno = 0;
261 int *__errno_location(){return &myerrno;}
262 main(){connect(0,buf,255); exit(!myerrno);}],
263 wine_cv_libc_reentrant=yes, wine_cv_libc_reentrant=no,
264 wine_cv_libc_reentrant=yes ) ] )
265 if test "$wine_cv_libc_reentrant" = "no"
267 AC_DEFINE(NO_REENTRANT_LIBC)
270 dnl **** Check for reentrant X libraries ****
272 dnl This may fail to determine whether X libraries are reentrant if
273 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
274 dnl is possible with the --without-reentrant-x option.
276 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
277 [ if test "x$with_reentrant_x" = "xno"
279 wine_cv_x_reentrant=no
282 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
283 if test -r $dir/libX11.so; then
284 libX11_check="-D $dir/libX11.so"
287 if test -r $dir/libX11.a; then
288 libX11_check="$dir/libX11.a"
292 if test "$libX11_check" != "none"; then
293 if nm $libX11_check | grep __errno_location >/dev/null 2>&1
295 wine_cv_x_reentrant=yes
297 wine_cv_x_reentrant=no
300 wine_cv_x_reentrant=unknown
303 if test "$wine_cv_x_reentrant" = "no"
305 AC_DEFINE(NO_REENTRANT_X11)
308 dnl **** Check for functions and header files ****
310 AC_CHECK_FUNCS(clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
311 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 linux/ipx.h)
315 AC_CHECK_SIZEOF(long long,0)
317 dnl **** Check for sendmsg in -lsocket if not found above ****
319 if test $ac_cv_func_sendmsg = no; then
320 AC_CHECK_LIB(socket,sendmsg)
323 dnl **** statfs checks ****
325 if test "$ac_cv_header_sys_vfs_h" = "yes"
327 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
328 wine_cv_sys_vfs_has_statfs,
330 #include <sys/types.h>
331 #ifdef HAVE_SYS_PARAM_H
332 # include <sys/param.h>
338 memset(&stfs,0,sizeof(stfs));
339 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
342 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
344 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
348 if test "$ac_cv_header_sys_statfs_h" = "yes"
350 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
351 wine_cv_sys_statfs_has_statfs,
353 #include <sys/types.h>
354 #ifdef HAVE_SYS_PARAM_H
355 # include <sys/param.h>
357 #include <sys/statfs.h>
360 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
363 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
365 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
369 if test "$ac_cv_header_sys_mount_h" = "yes"
371 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
372 wine_cv_sys_mount_has_statfs,
374 #include <sys/types.h>
375 #ifdef HAVE_SYS_PARAM_H
376 # include <sys/param.h>
378 #include <sys/mount.h>
381 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
384 if test "$wine_cv_sys_mount_has_statfs" = "yes"
386 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
390 dnl **** FIXME: what about mixed cases, where we need two of them? ***
392 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
393 [ if test "x$statfs_bfree" = "xno"
395 wine_cv_statfs_bfree=no
398 #include <sys/types.h>
399 #ifdef HAVE_SYS_PARAM_H
400 # include <sys/param.h>
402 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
403 # include <sys/mount.h>
405 # ifdef STATFS_DEFINED_BY_SYS_VFS
406 # include <sys/vfs.h>
408 # ifdef STATFS_DEFINED_BY_SYS_STATFS
409 # include <sys/statfs.h>
417 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
420 if test "$wine_cv_statfs_bfree" = "yes"
422 AC_DEFINE(STATFS_HAS_BFREE)
425 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
426 [ if test "x$statfs_bavail" = "xno"
428 wine_cv_statfs_bavail=no
431 #include <sys/types.h>
432 #ifdef HAVE_SYS_PARAM_H
433 # include <sys/param.h>
435 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
436 # include <sys/mount.h>
438 # ifdef STATFS_DEFINED_BY_SYS_VFS
439 # include <sys/vfs.h>
441 # ifdef STATFS_DEFINED_BY_SYS_STATFS
442 # include <sys/statfs.h>
450 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
453 if test "$wine_cv_statfs_bavail" = "yes"
455 AC_DEFINE(STATFS_HAS_BAVAIL)
458 dnl *** check for working sigaltstack
459 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
461 AC_CACHE_CHECK("for working sigaltstack",
462 ac_cv_c_working_sigaltstack,
465 #include <time.h> /* <sys/time.h> ? bad magic without end */
466 #include <sys/types.h>
467 #include <sys/signal.h>
468 #ifdef HAVE_SYS_PARAM_H
469 # include <sys/param.h>
471 #ifdef HAVE_SYSCALL_H
472 # include <syscall.h>
474 # ifdef HAVE_SYS_SYSCALL_H
475 # include <sys/syscall.h>
479 unsigned char *xaltstack;
482 main(int argc,char **argv) {
483 struct sigaltstack ss;
485 xaltstack = malloc(16384);
486 ss.ss_sp = xaltstack;
489 if (sigaltstack(&ss, NULL) < 0) {
490 /* this catches the glibc case */
491 perror("sigaltstack");
492 return (1); /* aka exit(1) aka fail */
494 /* assume it works. */
498 ac_cv_c_working_sigaltstack="yes",
499 ac_cv_c_working_sigaltstack="no",
500 ac_cv_c_working_sigaltstack="no"
503 if test "$ac_cv_c_working_sigaltstack" = "yes"
505 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
509 dnl *** check for file descriptor passing with msg_accrights
511 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
512 AC_TRY_COMPILE([#include <sys/types.h>
513 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
514 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
515 if test "$ac_cv_c_msg_accrights" = "yes"
517 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
520 dnl **** Generate output files ****
522 MAKE_RULES=Make.rules
523 AC_SUBST_FILE(MAKE_RULES)
532 dlls/comctl32/Makefile
533 dlls/imagehlp/Makefile
535 dlls/msacm32/Makefile
538 dlls/rasapi32/Makefile
539 dlls/shell32/Makefile
540 dlls/winaspi/Makefile
541 dlls/wnaspi32/Makefile
542 documentation/Makefile
545 graphics/metafiledrv/Makefile
546 graphics/psdrv/Makefile
547 graphics/win16drv/Makefile
548 graphics/x11drv/Makefile
564 programs/clock/Makefile
565 programs/control/Makefile
566 programs/notepad/Makefile
567 programs/progman/Makefile
568 programs/regtest/Makefile
569 programs/view/Makefile
570 programs/winhelp/Makefile
571 programs/winver/Makefile
582 windows/ttydrv/Makefile
583 windows/x11drv/Makefile ])
585 if test "$wine_cv_libc_reentrant" = "no"
588 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
589 echo "*** thread support. Consider upgrading libc to a more recent"
590 echo "*** reentrant version of libc."
595 echo "Configure finished. Do 'make depend; make' to compile Wine."
599 dnl comment-start: "dnl "
601 dnl comment-start-skip: "\\bdnl\\b\\s *"
602 dnl compile-command: "autoconf"