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 TRACE_MSGS=yes # the TRACE() macro
19 DEBUG_MSGS=yes # the TRACE(), WARN(), and FIXME() macros.
21 AC_ARG_ENABLE(emulator,
22 [ --disable-emulator build only the Wine library, not the emulator],
23 [if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi])
26 [ --enable-dll build the Wine library as a DLL],
27 [if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi])
30 [ --disable-lib build the Wine without building libwine.a],
31 [if test "$enableval" = "no"; then LIB_TARGET="\$(LIBOBJS)"; fi])
34 dnl [ --enable-ipc use inter-process communication for DDE],
35 dnl [if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
38 [ --disable-debug compile out all debugging messages],
39 [if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
42 [ --disable-trace compile out TRACE messages],
43 [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
45 AC_ARG_WITH(reentrant-x,
46 [ --without-reentrant-x Compile for use with non-reentrant X libraries])
52 if test "$DEBUG_MSGS" = "no"
54 AC_DEFINE(NO_DEBUG_MSGS)
55 AC_DEFINE(NO_TRACE_MSGS)
57 if test "$TRACE_MSGS" = "no"
59 AC_DEFINE(NO_TRACE_MSGS)
63 dnl **** Check for some programs ****
74 AC_CHECK_PROG(C2MAN,c2man,c2man,true)
76 dnl **** Check for some libraries ****
78 dnl Check for -li386 for NetBSD and OpenBSD
79 AC_CHECK_LIB(i386,i386_set_ldt)
80 dnl Check for -lw for Solaris
81 AC_CHECK_LIB(w,iswalnum)
82 dnl Check for XFree86 DGA extension
83 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
85 dnl **** Check for Open Sound System ****
86 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
88 AC_CACHE_CHECK("for Open Sound System",
89 ac_cv_c_opensoundsystem,
91 #ifdef HAVE_SYS_SOUNDCARD_H
92 #include <sys/soundcard.h>
94 #ifdef HAVE_MACHINE_SOUNDCARD_H
95 #include <machine/soundcard.h>
99 /* check for one of the Open Sound System specific SNDCTL_ defines */
100 #if !defined(SNDCTL_DSP_STEREO)
101 #error No open sound system
103 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
105 if test "$ac_cv_c_opensoundsystem" = "yes"
110 dnl **** Check for union semun ****
112 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
113 AC_TRY_COMPILE([#include <sys/types.h>
114 #include <sys/sem.h>],[union semun foo],
115 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
116 if test "$ac_cv_c_union_semun" = "yes"
118 AC_DEFINE(HAVE_UNION_SEMUN)
121 dnl **** If ln -s doesn't work, use cp instead ****
122 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
124 dnl **** Check for gcc strength-reduce bug ****
126 if test "x${GCC}" = "xyes"
128 CFLAGS="$CFLAGS -Wall"
129 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
132 static int Array[[3]];
135 for(i=0; i<B; i++) Array[[i]] = i - 3;
136 exit( Array[[1]] != -2 );
138 ac_cv_c_gcc_strength_bug="no",
139 ac_cv_c_gcc_strength_bug="yes",
140 ac_cv_c_gcc_strength_bug="yes") )
141 if test "$ac_cv_c_gcc_strength_bug" = "yes"
143 CFLAGS="$CFLAGS -fno-strength-reduce"
147 dnl **** Check for underscore on external symbols ****
149 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
150 ac_cv_c_extern_prefix,
152 LIBS="conftest_asm.s $LIBS"
153 cat > conftest_asm.s <<EOF
158 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
159 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
161 if test "$ac_cv_c_extern_prefix" = "yes"
163 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
166 dnl **** Check for .string in assembler ****
168 AC_CACHE_CHECK("whether assembler accepts .string",
171 LIBS="conftest_asm.s $LIBS"
172 cat > conftest_asm.s <<EOF
175 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
177 if test "$ac_cv_c_asm_string" = "yes"
179 AC_DEFINE(HAVE_ASM_STRING)
182 dnl **** Check for working dll ****
185 if test "$LIB_TARGET" = "libwine.so.1.0"
187 AC_CACHE_CHECK("whether we can build a dll",
189 [saved_cflags=$CFLAGS
190 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
191 AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
194 if test "$ac_cv_c_dll" = "yes"
198 LIB_TARGET="libwine.a"
203 dnl **** Check for reentrant X libraries ****
205 dnl This may fail to determine whether X libraries are reentrant if
206 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
207 dnl is possible with the --without-reentrant-x option.
209 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
210 [ if test "x$with_reentrant_x" = "xno"
212 wine_cv_x_reentrant=no
215 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
216 if test -r $dir/libX11.so; then
217 libX11_check="-D $dir/libX11.so"
220 if test -r $dir/libX11.a; then
221 libX11_check="$dir/libX11.a"
225 if test "$libX11_check" != "none"; then
226 if nm $libX11_check | grep __errno_location >/dev/null 2>&1
228 wine_cv_x_reentrant=yes
230 wine_cv_x_reentrant=no
233 wine_cv_x_reentrant=unknown
236 if test "$wine_cv_x_reentrant" = "no"
238 AC_DEFINE(NO_REENTRANT_X11)
241 dnl **** Check for functions and header files ****
243 AC_CHECK_FUNCS(clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
244 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)
248 AC_CHECK_SIZEOF(long long,0)
250 dnl **** Check for sendmsg in -lsocket if not found above ****
252 if test $ac_cv_func_sendmsg = no; then
253 AC_CHECK_LIB(socket,sendmsg)
256 dnl **** statfs checks ****
258 if test "$ac_cv_header_sys_vfs_h" = "yes"
260 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
261 wine_cv_sys_vfs_has_statfs,
263 #include <sys/types.h>
264 #ifdef HAVE_SYS_PARAM_H
265 # include <sys/param.h>
271 memset(&stfs,0,sizeof(stfs));
272 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
275 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
277 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
281 if test "$ac_cv_header_sys_statfs_h" = "yes"
283 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
284 wine_cv_sys_statfs_has_statfs,
286 #include <sys/types.h>
287 #ifdef HAVE_SYS_PARAM_H
288 # include <sys/param.h>
290 #include <sys/statfs.h>
293 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
296 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
298 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
302 if test "$ac_cv_header_sys_mount_h" = "yes"
304 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
305 wine_cv_sys_mount_has_statfs,
307 #include <sys/types.h>
308 #ifdef HAVE_SYS_PARAM_H
309 # include <sys/param.h>
311 #include <sys/mount.h>
314 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
317 if test "$wine_cv_sys_mount_has_statfs" = "yes"
319 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
323 dnl **** FIXME: what about mixed cases, where we need two of them? ***
325 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
326 [ if test "x$statfs_bfree" = "xno"
328 wine_cv_statfs_bfree=no
331 #include <sys/types.h>
332 #ifdef HAVE_SYS_PARAM_H
333 # include <sys/param.h>
335 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
336 # include <sys/mount.h>
338 # ifdef STATFS_DEFINED_BY_SYS_VFS
339 # include <sys/vfs.h>
341 # ifdef STATFS_DEFINED_BY_SYS_STATFS
342 # include <sys/statfs.h>
350 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
353 if test "$wine_cv_statfs_bfree" = "yes"
355 AC_DEFINE(STATFS_HAS_BFREE)
358 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
359 [ if test "x$statfs_bavail" = "xno"
361 wine_cv_statfs_bavail=no
364 #include <sys/types.h>
365 #ifdef HAVE_SYS_PARAM_H
366 # include <sys/param.h>
368 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
369 # include <sys/mount.h>
371 # ifdef STATFS_DEFINED_BY_SYS_VFS
372 # include <sys/vfs.h>
374 # ifdef STATFS_DEFINED_BY_SYS_STATFS
375 # include <sys/statfs.h>
383 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
386 if test "$wine_cv_statfs_bavail" = "yes"
388 AC_DEFINE(STATFS_HAS_BAVAIL)
391 dnl *** check for working sigaltstack
392 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
394 AC_CACHE_CHECK("for working sigaltstack",
395 ac_cv_c_working_sigaltstack,
398 #include <time.h> /* <sys/time.h> ? bad magic without end */
399 #include <sys/types.h>
400 #include <sys/signal.h>
401 #ifdef HAVE_SYS_PARAM_H
402 # include <sys/param.h>
404 #ifdef HAVE_SYSCALL_H
405 # include <syscall.h>
407 # ifdef HAVE_SYS_SYSCALL_H
408 # include <sys/syscall.h>
412 unsigned char *xaltstack;
415 main(int argc,char **argv) {
416 struct sigaltstack ss;
418 xaltstack = malloc(16384);
419 ss.ss_sp = xaltstack;
422 if (sigaltstack(&ss, NULL) < 0) {
423 /* this catches the glibc case */
424 perror("sigaltstack");
425 return (1); /* aka exit(1) aka fail */
427 /* assume it works. */
431 ac_cv_c_working_sigaltstack="yes",
432 ac_cv_c_working_sigaltstack="no",
433 ac_cv_c_working_sigaltstack="no"
436 if test "$ac_cv_c_working_sigaltstack" = "yes"
438 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
442 dnl *** check for file descriptor passing with msg_accrights
444 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
445 AC_TRY_COMPILE([#include <sys/types.h>
446 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
447 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
448 if test "$ac_cv_c_msg_accrights" = "yes"
450 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
453 dnl **** Generate output files ****
455 MAKE_RULES=Make.rules
456 AC_SUBST_FILE(MAKE_RULES)
464 dlls/shell32/Makefile
465 documentation/Makefile
468 graphics/metafiledrv/Makefile
469 graphics/psdrv/Makefile
470 graphics/win16drv/Makefile
471 graphics/x11drv/Makefile
487 programs/clock/Makefile
488 programs/notepad/Makefile
489 programs/progman/Makefile
490 programs/regtest/Makefile
491 programs/view/Makefile
492 programs/winhelp/Makefile
493 programs/winver/Makefile
506 echo "Configure finished. Do 'make depend; make' to compile Wine."
510 dnl comment-start: "dnl "
512 dnl comment-start-skip: "\\bdnl\\b\\s *"
513 dnl compile-command: "autoconf"