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"
99 XLIB="-lXpm -lXext -lX11"
101 dnl FIXME: should be done once we can compile without -lXpm
102 dnl AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
103 dnl Check for X Shm extension
104 AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
105 dnl Check for XFree86 DGA extension
106 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
107 dnl Check for XFree86 VMODE extension
108 AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
115 dnl **** Check which curses lib to use ***
116 AC_CHECK_LIB(ncurses,waddch)
117 if test "$ac_cv_lib_ncurses_waddch" = "yes"
120 AC_CHECK_LIB(curses,waddch)
123 dnl **** Check for IPX (currently Linux only) ****
124 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
126 [#include <sys/socket.h>
127 #include <netipx/ipx.h>],
128 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
129 [AC_DEFINE(HAVE_IPX_GNU)
130 ac_cv_c_ipx_gnu="yes"],
131 [ac_cv_c_ipx_gnu="no"])
134 if test "$ac_cv_c_ipx_gnu" = "no"
136 AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
138 [#include <sys/socket.h>
139 #include <asm/types.h>
140 #include <linux/ipx.h>],
141 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
142 [AC_DEFINE(HAVE_IPX_LINUX)
143 ac_cv_c_ipx_linux="yes"],
144 [ac_cv_c_ipx_linux="no"])
148 dnl **** Check for Open Sound System ****
149 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
151 AC_CACHE_CHECK("for Open Sound System",
152 ac_cv_c_opensoundsystem,
154 #if defined(HAVE_SYS_SOUNDCARD_H)
155 #include <sys/soundcard.h>
156 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
157 #include <machine/soundcard.h>
158 #elif defined(HAVE_SOUNDCARD_H)
159 #include <soundcard.h>
163 /* check for one of the Open Sound System specific SNDCTL_ defines */
164 #if !defined(SNDCTL_DSP_STEREO)
165 #error No open sound system
167 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
169 if test "$ac_cv_c_opensoundsystem" = "yes"
174 dnl **** Check for union semun ****
176 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
177 AC_TRY_COMPILE([#include <sys/types.h>
178 #include <sys/sem.h>],[union semun foo],
179 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
180 if test "$ac_cv_c_union_semun" = "yes"
182 AC_DEFINE(HAVE_UNION_SEMUN)
185 dnl **** If ln -s doesn't work, use cp instead ****
186 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
188 dnl **** Check for gcc strength-reduce bug ****
190 if test "x${GCC}" = "xyes"
192 CFLAGS="$CFLAGS -Wall"
193 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
196 static int Array[[3]];
199 for(i=0; i<B; i++) Array[[i]] = i - 3;
200 exit( Array[[1]] != -2 );
202 ac_cv_c_gcc_strength_bug="no",
203 ac_cv_c_gcc_strength_bug="yes",
204 ac_cv_c_gcc_strength_bug="yes") )
205 if test "$ac_cv_c_gcc_strength_bug" = "yes"
207 CFLAGS="$CFLAGS -fno-strength-reduce"
211 dnl **** Check for underscore on external symbols ****
213 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
214 ac_cv_c_extern_prefix,
216 LIBS="conftest_asm.s $LIBS"
217 cat > conftest_asm.s <<EOF
222 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
223 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
225 if test "$ac_cv_c_extern_prefix" = "yes"
227 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
230 dnl **** Check for .string in assembler ****
232 AC_CACHE_CHECK("whether assembler accepts .string",
235 LIBS="conftest_asm.s $LIBS"
236 cat > conftest_asm.s <<EOF
239 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
241 if test "$ac_cv_c_asm_string" = "yes"
243 AC_DEFINE(HAVE_ASM_STRING)
246 dnl **** Check for working dll ****
250 if test "$LIB_TARGET" = "libwine.so.1.0"
252 AC_CACHE_CHECK("whether we can build a Linux dll",
254 [saved_cflags=$CFLAGS
255 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
256 AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
259 if test "$ac_cv_c_dll_linux" = "yes"
262 LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
264 AC_CACHE_CHECK("whether we can build a NetBSD dll",
266 [saved_cflags=$CFLAGS
267 CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
268 AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
271 if test "$ac_cv_c_dll_netbsd" = "yes"
274 LDSHARED="ld -Bshareable -Bforcearchive"
277 if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
279 LIB_TARGET="libwine.a"
285 dnl **** Check for reentrant libc ****
287 dnl For cross-compiling we blindly assume that libc is reentrant. This is
288 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
290 AC_CACHE_CHECK("for reentrant libc", wine_cv_libc_reentrant,
291 [AC_TRY_RUN([int myerrno = 0;
293 int *__errno_location(){return &myerrno;}
294 main(){connect(0,buf,255); exit(!myerrno);}],
295 wine_cv_libc_reentrant=yes, wine_cv_libc_reentrant=no,
296 wine_cv_libc_reentrant=yes ) ] )
297 if test "$wine_cv_libc_reentrant" = "no"
299 AC_DEFINE(NO_REENTRANT_LIBC)
302 dnl **** Check for reentrant X libraries ****
304 dnl This may fail to determine whether X libraries are reentrant if
305 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
306 dnl is possible with the --without-reentrant-x option.
308 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
309 [ if test "x$with_reentrant_x" = "xno"
311 wine_cv_x_reentrant=no
314 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
315 if test -r $dir/libX11.so; then
316 libX11_check="-D $dir/libX11.so"
319 if test -r $dir/libX11.a; then
320 libX11_check="$dir/libX11.a"
324 if test "$libX11_check" != "none"; then
325 if nm $libX11_check | grep __errno_location >/dev/null 2>&1
327 wine_cv_x_reentrant=yes
329 wine_cv_x_reentrant=no
332 wine_cv_x_reentrant=unknown
335 if test "$wine_cv_x_reentrant" = "no"
337 AC_DEFINE(NO_REENTRANT_X11)
340 dnl **** Check for functions and header files ****
342 AC_CHECK_FUNCS(clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
343 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)
347 AC_CHECK_SIZEOF(long long,0)
349 dnl **** Check for sendmsg in -lsocket if not found above ****
351 if test $ac_cv_func_sendmsg = no; then
352 AC_CHECK_LIB(socket,sendmsg)
355 dnl **** statfs checks ****
357 if test "$ac_cv_header_sys_vfs_h" = "yes"
359 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
360 wine_cv_sys_vfs_has_statfs,
362 #include <sys/types.h>
363 #ifdef HAVE_SYS_PARAM_H
364 # include <sys/param.h>
370 memset(&stfs,0,sizeof(stfs));
371 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
374 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
376 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
380 if test "$ac_cv_header_sys_statfs_h" = "yes"
382 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
383 wine_cv_sys_statfs_has_statfs,
385 #include <sys/types.h>
386 #ifdef HAVE_SYS_PARAM_H
387 # include <sys/param.h>
389 #include <sys/statfs.h>
392 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
395 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
397 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
401 if test "$ac_cv_header_sys_mount_h" = "yes"
403 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
404 wine_cv_sys_mount_has_statfs,
406 #include <sys/types.h>
407 #ifdef HAVE_SYS_PARAM_H
408 # include <sys/param.h>
410 #include <sys/mount.h>
413 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
416 if test "$wine_cv_sys_mount_has_statfs" = "yes"
418 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
422 dnl **** FIXME: what about mixed cases, where we need two of them? ***
424 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
425 [ if test "x$statfs_bfree" = "xno"
427 wine_cv_statfs_bfree=no
430 #include <sys/types.h>
431 #ifdef HAVE_SYS_PARAM_H
432 # include <sys/param.h>
434 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
435 # include <sys/mount.h>
437 # ifdef STATFS_DEFINED_BY_SYS_VFS
438 # include <sys/vfs.h>
440 # ifdef STATFS_DEFINED_BY_SYS_STATFS
441 # include <sys/statfs.h>
449 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
452 if test "$wine_cv_statfs_bfree" = "yes"
454 AC_DEFINE(STATFS_HAS_BFREE)
457 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
458 [ if test "x$statfs_bavail" = "xno"
460 wine_cv_statfs_bavail=no
463 #include <sys/types.h>
464 #ifdef HAVE_SYS_PARAM_H
465 # include <sys/param.h>
467 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
468 # include <sys/mount.h>
470 # ifdef STATFS_DEFINED_BY_SYS_VFS
471 # include <sys/vfs.h>
473 # ifdef STATFS_DEFINED_BY_SYS_STATFS
474 # include <sys/statfs.h>
482 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
485 if test "$wine_cv_statfs_bavail" = "yes"
487 AC_DEFINE(STATFS_HAS_BAVAIL)
490 dnl *** check for working sigaltstack
491 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
493 AC_CACHE_CHECK("for working sigaltstack",
494 ac_cv_c_working_sigaltstack,
497 #include <time.h> /* <sys/time.h> ? bad magic without end */
498 #include <sys/types.h>
499 #include <sys/signal.h>
500 #ifdef HAVE_SYS_PARAM_H
501 # include <sys/param.h>
503 #ifdef HAVE_SYSCALL_H
504 # include <syscall.h>
506 # ifdef HAVE_SYS_SYSCALL_H
507 # include <sys/syscall.h>
511 unsigned char *xaltstack;
514 main(int argc,char **argv) {
515 struct sigaltstack ss;
517 xaltstack = malloc(16384);
518 ss.ss_sp = xaltstack;
521 if (sigaltstack(&ss, NULL) < 0) {
522 /* this catches the glibc case */
523 perror("sigaltstack");
524 return (1); /* aka exit(1) aka fail */
526 /* assume it works. */
530 ac_cv_c_working_sigaltstack="yes",
531 ac_cv_c_working_sigaltstack="no",
532 ac_cv_c_working_sigaltstack="no"
535 if test "$ac_cv_c_working_sigaltstack" = "yes"
537 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
541 dnl *** check for file descriptor passing with msg_accrights
543 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
544 AC_TRY_COMPILE([#include <sys/types.h>
545 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
546 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
547 if test "$ac_cv_c_msg_accrights" = "yes"
549 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
552 dnl **** Generate output files ****
554 MAKE_RULES=Make.rules
555 AC_SUBST_FILE(MAKE_RULES)
564 dlls/advapi32/Makefile
565 dlls/comctl32/Makefile
566 dlls/imagehlp/Makefile
568 dlls/msacm32/Makefile
571 dlls/rasapi32/Makefile
572 dlls/shell32/Makefile
573 dlls/winaspi/Makefile
574 dlls/wnaspi32/Makefile
575 documentation/Makefile
578 graphics/metafiledrv/Makefile
579 graphics/psdrv/Makefile
580 graphics/win16drv/Makefile
581 graphics/x11drv/Makefile
597 programs/clock/Makefile
598 programs/control/Makefile
599 programs/notepad/Makefile
600 programs/progman/Makefile
601 programs/regtest/Makefile
602 programs/view/Makefile
603 programs/winhelp/Makefile
604 programs/winver/Makefile
615 windows/ttydrv/Makefile
616 windows/x11drv/Makefile ])
618 if test "$wine_cv_libc_reentrant" = "no"
621 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
622 echo "*** thread support. Consider upgrading libc to a more recent"
623 echo "*** reentrant version of libc."
628 echo "Configure finished. Do 'make depend; make' to compile Wine."
632 dnl comment-start: "dnl "
634 dnl comment-start-skip: "\\bdnl\\b\\s *"
635 dnl compile-command: "autoconf"