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])
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 -lossaudio for NetBSD
87 AC_CHECK_LIB(ossaudio,_oss_ioctl)
88 dnl Check for -lw for Solaris
89 AC_CHECK_LIB(w,iswalnum)
90 dnl Check for -lnsl for Solaris
91 AC_CHECK_FUNCS(gethostbyname)
92 if test "$ac_cv_func_gethostbyname" = "no"
94 AC_CHECK_LIB(nsl,gethostbyname)
96 dnl Check for -lxpg4 for FreeBSD
97 AC_CHECK_LIB(xpg4,setrunelocale)
99 AC_CHECK_LIB(dl,dlopen)
101 if test "$have_x" = "yes"
103 XLIB="-lXpm -lXext -lX11"
105 dnl FIXME: should be done once we can compile without -lXpm
106 dnl AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
107 dnl Check for X Shm extension
108 AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
109 dnl Check for XFree86 DGA extension
110 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
111 dnl Check for XFree86 VMODE extension
112 AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
119 dnl **** Check for IPX (currently Linux only) ****
120 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
122 [#include <sys/socket.h>
123 #include <netipx/ipx.h>],
124 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
125 [AC_DEFINE(HAVE_IPX_GNU)
126 ac_cv_c_ipx_gnu="yes"],
127 [ac_cv_c_ipx_gnu="no"])
130 if test "$ac_cv_c_ipx_gnu" = "no"
132 AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
134 [#include <sys/socket.h>
135 #include <asm/types.h>
136 #include <linux/ipx.h>],
137 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
138 [AC_DEFINE(HAVE_IPX_LINUX)
139 ac_cv_c_ipx_linux="yes"],
140 [ac_cv_c_ipx_linux="no"])
144 dnl **** Check for Open Sound System ****
145 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
147 AC_CACHE_CHECK("for Open Sound System",
148 ac_cv_c_opensoundsystem,
150 #if defined(HAVE_SYS_SOUNDCARD_H)
151 #include <sys/soundcard.h>
152 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
153 #include <machine/soundcard.h>
154 #elif defined(HAVE_SOUNDCARD_H)
155 #include <soundcard.h>
159 /* check for one of the Open Sound System specific SNDCTL_ defines */
160 #if !defined(SNDCTL_DSP_STEREO)
161 #error No open sound system
163 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
165 if test "$ac_cv_c_opensoundsystem" = "yes"
170 dnl **** Check for union semun ****
172 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
173 AC_TRY_COMPILE([#include <sys/types.h>
174 #include <sys/sem.h>],[union semun foo],
175 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
176 if test "$ac_cv_c_union_semun" = "yes"
178 AC_DEFINE(HAVE_UNION_SEMUN)
181 dnl **** If ln -s doesn't work, use cp instead ****
182 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
184 dnl **** Check for gcc strength-reduce bug ****
186 if test "x${GCC}" = "xyes"
188 CFLAGS="$CFLAGS -Wall"
189 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
192 static int Array[[3]];
195 for(i=0; i<B; i++) Array[[i]] = i - 3;
196 exit( Array[[1]] != -2 );
198 ac_cv_c_gcc_strength_bug="no",
199 ac_cv_c_gcc_strength_bug="yes",
200 ac_cv_c_gcc_strength_bug="yes") )
201 if test "$ac_cv_c_gcc_strength_bug" = "yes"
203 CFLAGS="$CFLAGS -fno-strength-reduce"
207 dnl **** Check for underscore on external symbols ****
209 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
210 ac_cv_c_extern_prefix,
212 LIBS="conftest_asm.s $LIBS"
213 cat > conftest_asm.s <<EOF
218 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
219 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
221 if test "$ac_cv_c_extern_prefix" = "yes"
223 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
226 dnl **** Check for .string in assembler ****
228 AC_CACHE_CHECK("whether assembler accepts .string",
231 LIBS="conftest_asm.s $LIBS"
232 cat > conftest_asm.s <<EOF
235 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
237 if test "$ac_cv_c_asm_string" = "yes"
239 AC_DEFINE(HAVE_ASM_STRING)
242 dnl **** Check for working dll ****
246 if test "$LIB_TARGET" = "libwine.so.1.0"
248 AC_CACHE_CHECK("whether we can build a Linux dll",
250 [saved_cflags=$CFLAGS
251 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
252 AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
255 if test "$ac_cv_c_dll_linux" = "yes"
258 LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
260 AC_CACHE_CHECK("whether we can build a NetBSD dll",
262 [saved_cflags=$CFLAGS
263 CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
264 AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
267 if test "$ac_cv_c_dll_netbsd" = "yes"
270 LDSHARED="ld -Bshareable -Bforcearchive"
273 if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
275 LIB_TARGET="libwine.a"
281 dnl **** Check for reentrant libc ****
283 dnl For cross-compiling we blindly assume that libc is reentrant. This is
284 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
286 AC_CACHE_CHECK("for reentrant libc", wine_cv_libc_reentrant,
287 [AC_TRY_RUN([int myerrno = 0;
289 int *__errno_location(){return &myerrno;}
290 main(){connect(0,buf,255); exit(!myerrno);}],
291 wine_cv_libc_reentrant=yes, wine_cv_libc_reentrant=no,
292 wine_cv_libc_reentrant=yes ) ] )
293 if test "$wine_cv_libc_reentrant" = "no"
295 AC_DEFINE(NO_REENTRANT_LIBC)
298 dnl **** Check for reentrant X libraries ****
300 dnl This may fail to determine whether X libraries are reentrant if
301 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
302 dnl is possible with the --without-reentrant-x option.
304 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
305 [ if test "x$with_reentrant_x" = "xno"
307 wine_cv_x_reentrant=no
310 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
311 if test -r $dir/libX11.so; then
312 libX11_check="-D $dir/libX11.so"
315 if test -r $dir/libX11.a; then
316 libX11_check="$dir/libX11.a"
320 if test "$libX11_check" != "none"; then
321 if nm $libX11_check | grep __errno_location >/dev/null 2>&1
323 wine_cv_x_reentrant=yes
325 wine_cv_x_reentrant=no
328 wine_cv_x_reentrant=unknown
331 if test "$wine_cv_x_reentrant" = "no"
333 AC_DEFINE(NO_REENTRANT_X11)
336 dnl **** Check for functions and header files ****
338 AC_CHECK_FUNCS(clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
339 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)
343 AC_CHECK_SIZEOF(long long,0)
345 dnl **** Check for sendmsg in -lsocket if not found above ****
347 if test $ac_cv_func_sendmsg = no; then
348 AC_CHECK_LIB(socket,sendmsg)
351 dnl **** statfs checks ****
353 if test "$ac_cv_header_sys_vfs_h" = "yes"
355 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
356 wine_cv_sys_vfs_has_statfs,
358 #include <sys/types.h>
359 #ifdef HAVE_SYS_PARAM_H
360 # include <sys/param.h>
366 memset(&stfs,0,sizeof(stfs));
367 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
370 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
372 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
376 if test "$ac_cv_header_sys_statfs_h" = "yes"
378 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
379 wine_cv_sys_statfs_has_statfs,
381 #include <sys/types.h>
382 #ifdef HAVE_SYS_PARAM_H
383 # include <sys/param.h>
385 #include <sys/statfs.h>
388 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
391 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
393 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
397 if test "$ac_cv_header_sys_mount_h" = "yes"
399 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
400 wine_cv_sys_mount_has_statfs,
402 #include <sys/types.h>
403 #ifdef HAVE_SYS_PARAM_H
404 # include <sys/param.h>
406 #include <sys/mount.h>
409 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
412 if test "$wine_cv_sys_mount_has_statfs" = "yes"
414 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
418 dnl **** FIXME: what about mixed cases, where we need two of them? ***
420 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
421 [ if test "x$statfs_bfree" = "xno"
423 wine_cv_statfs_bfree=no
426 #include <sys/types.h>
427 #ifdef HAVE_SYS_PARAM_H
428 # include <sys/param.h>
430 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
431 # include <sys/mount.h>
433 # ifdef STATFS_DEFINED_BY_SYS_VFS
434 # include <sys/vfs.h>
436 # ifdef STATFS_DEFINED_BY_SYS_STATFS
437 # include <sys/statfs.h>
445 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
448 if test "$wine_cv_statfs_bfree" = "yes"
450 AC_DEFINE(STATFS_HAS_BFREE)
453 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
454 [ if test "x$statfs_bavail" = "xno"
456 wine_cv_statfs_bavail=no
459 #include <sys/types.h>
460 #ifdef HAVE_SYS_PARAM_H
461 # include <sys/param.h>
463 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
464 # include <sys/mount.h>
466 # ifdef STATFS_DEFINED_BY_SYS_VFS
467 # include <sys/vfs.h>
469 # ifdef STATFS_DEFINED_BY_SYS_STATFS
470 # include <sys/statfs.h>
478 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
481 if test "$wine_cv_statfs_bavail" = "yes"
483 AC_DEFINE(STATFS_HAS_BAVAIL)
486 dnl *** check for working sigaltstack
487 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
489 AC_CACHE_CHECK("for working sigaltstack",
490 ac_cv_c_working_sigaltstack,
493 #include <time.h> /* <sys/time.h> ? bad magic without end */
494 #include <sys/types.h>
495 #include <sys/signal.h>
496 #ifdef HAVE_SYS_PARAM_H
497 # include <sys/param.h>
499 #ifdef HAVE_SYSCALL_H
500 # include <syscall.h>
502 # ifdef HAVE_SYS_SYSCALL_H
503 # include <sys/syscall.h>
507 unsigned char *xaltstack;
510 main(int argc,char **argv) {
511 struct sigaltstack ss;
513 xaltstack = malloc(16384);
514 ss.ss_sp = xaltstack;
517 if (sigaltstack(&ss, NULL) < 0) {
518 /* this catches the glibc case */
519 perror("sigaltstack");
520 return (1); /* aka exit(1) aka fail */
522 /* assume it works. */
526 ac_cv_c_working_sigaltstack="yes",
527 ac_cv_c_working_sigaltstack="no",
528 ac_cv_c_working_sigaltstack="no"
531 if test "$ac_cv_c_working_sigaltstack" = "yes"
533 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
537 dnl *** check for file descriptor passing with msg_accrights
539 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
540 AC_TRY_COMPILE([#include <sys/types.h>
541 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
542 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
543 if test "$ac_cv_c_msg_accrights" = "yes"
545 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
548 dnl **** Generate output files ****
550 MAKE_RULES=Make.rules
551 AC_SUBST_FILE(MAKE_RULES)
560 dlls/comctl32/Makefile
561 dlls/imagehlp/Makefile
563 dlls/msacm32/Makefile
566 dlls/rasapi32/Makefile
567 dlls/shell32/Makefile
568 dlls/winaspi/Makefile
569 dlls/wnaspi32/Makefile
570 documentation/Makefile
573 graphics/metafiledrv/Makefile
574 graphics/psdrv/Makefile
575 graphics/win16drv/Makefile
576 graphics/x11drv/Makefile
592 programs/clock/Makefile
593 programs/control/Makefile
594 programs/notepad/Makefile
595 programs/progman/Makefile
596 programs/regtest/Makefile
597 programs/view/Makefile
598 programs/winhelp/Makefile
599 programs/winver/Makefile
610 windows/ttydrv/Makefile
611 windows/x11drv/Makefile ])
613 if test "$wine_cv_libc_reentrant" = "no"
616 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
617 echo "*** thread support. Consider upgrading libc to a more recent"
618 echo "*** reentrant version of libc."
623 echo "Configure finished. Do 'make depend; make' to compile Wine."
627 dnl comment-start: "dnl "
629 dnl comment-start-skip: "\\bdnl\\b\\s *"
630 dnl compile-command: "autoconf"