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 -e $dir/libX11.so; then
217 libX11_check="-D $dir/libX11.so"
220 if test -e $dir/libX11.a; then
221 libX11_check="$dir/libX11.a"
225 if test "$libX11_check" != "none"; then
226 if nm $libX11_check | grep -q __errno_location; then
227 wine_cv_x_reentrant=yes
229 wine_cv_x_reentrant=no
232 wine_cv_x_reentrant=unknown
235 if test "$wine_cv_x_reentrant" = "no"
237 AC_DEFINE(NO_REENTRANT_X11)
240 dnl **** Check for functions and header files ****
242 AC_CHECK_FUNCS(clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
243 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 sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h)
247 AC_CHECK_SIZEOF(long long,0)
249 dnl **** statfs checks ****
251 if test "$ac_cv_header_sys_vfs_h" = "yes"
253 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
254 wine_cv_sys_vfs_has_statfs,
256 #include <sys/types.h>
257 #ifdef HAVE_SYS_PARAM_H
258 # include <sys/param.h>
264 memset(&stfs,0,sizeof(stfs));
265 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
268 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
270 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
274 if test "$ac_cv_header_sys_statfs_h" = "yes"
276 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
277 wine_cv_sys_statfs_has_statfs,
279 #include <sys/types.h>
280 #ifdef HAVE_SYS_PARAM_H
281 # include <sys/param.h>
283 #include <sys/statfs.h>
286 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
289 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
291 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
295 if test "$ac_cv_header_sys_mount_h" = "yes"
297 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
298 wine_cv_sys_mount_has_statfs,
300 #include <sys/types.h>
301 #ifdef HAVE_SYS_PARAM_H
302 # include <sys/param.h>
304 #include <sys/mount.h>
307 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
310 if test "$wine_cv_sys_mount_has_statfs" = "yes"
312 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
316 dnl **** FIXME: what about mixed cases, where we need two of them? ***
318 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
319 [ if test "x$statfs_bfree" = "xno"
321 wine_cv_statfs_bfree=no
324 #include <sys/types.h>
325 #ifdef HAVE_SYS_PARAM_H
326 # include <sys/param.h>
328 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
329 # include <sys/mount.h>
331 # ifdef STATFS_DEFINED_BY_SYS_VFS
332 # include <sys/vfs.h>
334 # ifdef STATFS_DEFINED_BY_SYS_STATFS
335 # include <sys/statfs.h>
343 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
346 if test "$wine_cv_statfs_bfree" = "yes"
348 AC_DEFINE(STATFS_HAS_BFREE)
351 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
352 [ if test "x$statfs_bavail" = "xno"
354 wine_cv_statfs_bavail=no
357 #include <sys/types.h>
358 #ifdef HAVE_SYS_PARAM_H
359 # include <sys/param.h>
361 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
362 # include <sys/mount.h>
364 # ifdef STATFS_DEFINED_BY_SYS_VFS
365 # include <sys/vfs.h>
367 # ifdef STATFS_DEFINED_BY_SYS_STATFS
368 # include <sys/statfs.h>
376 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
379 if test "$wine_cv_statfs_bavail" = "yes"
381 AC_DEFINE(STATFS_HAS_BAVAIL)
384 dnl *** check for working sigaltstack
385 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
387 AC_CACHE_CHECK("for working sigaltstack",
388 ac_cv_c_working_sigaltstack,
391 #include <time.h> /* <sys/time.h> ? bad magic without end */
392 #include <sys/types.h>
393 #include <sys/signal.h>
394 #ifdef HAVE_SYS_PARAM_H
395 # include <sys/param.h>
397 #ifdef HAVE_SYSCALL_H
398 # include <syscall.h>
400 # ifdef HAVE_SYS_SYSCALL_H
401 # include <sys/syscall.h>
405 unsigned char *xaltstack;
408 main(int argc,char **argv) {
409 struct sigaltstack ss;
411 xaltstack = malloc(16384);
412 ss.ss_sp = xaltstack;
415 if (sigaltstack(&ss, NULL) < 0) {
416 /* this catches the glibc case */
417 perror("sigaltstack");
418 return (1); /* aka exit(1) aka fail */
420 /* assume it works. */
424 ac_cv_c_working_sigaltstack="yes",
425 ac_cv_c_working_sigaltstack="no",
426 ac_cv_c_working_sigaltstack="no"
429 if test "$ac_cv_c_working_sigaltstack" = "yes"
431 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
435 dnl **** Generate output files ****
437 MAKE_RULES=Make.rules
438 AC_SUBST_FILE(MAKE_RULES)
445 documentation/Makefile
448 graphics/metafiledrv/Makefile
449 graphics/psdrv/Makefile
450 graphics/win16drv/Makefile
451 graphics/x11drv/Makefile
466 programs/clock/Makefile
467 programs/notepad/Makefile
468 programs/progman/Makefile
469 programs/regtest/Makefile
470 programs/view/Makefile
471 programs/winhelp/Makefile
472 programs/winver/Makefile
485 echo "Configure finished. Do 'make depend; make' to compile Wine."
489 dnl comment-start: "dnl "
491 dnl comment-start-skip: "\\bdnl\\b\\s *"
492 dnl compile-command: "autoconf"