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 dnl [ --enable-ipc use inter-process communication for DDE],
31 dnl [if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
34 [ --disable-debug compile out all debugging messages],
35 [if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
38 [ --disable-trace compile out TRACE messages],
39 [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
41 AC_ARG_WITH(reentrant-x,
42 [ --without-reentrant-x Compile for use with non-reentrant X libraries])
48 if test "$DEBUG_MSGS" = "no"
50 AC_DEFINE(NO_DEBUG_MSGS)
51 AC_DEFINE(NO_TRACE_MSGS)
53 if test "$TRACE_MSGS" = "no"
55 AC_DEFINE(NO_TRACE_MSGS)
59 dnl **** Check for some programs ****
70 AC_CHECK_PROG(C2MAN,c2man,c2man,true)
72 dnl **** Check for some libraries ****
74 dnl Check for -li386 for NetBSD and OpenBSD
75 AC_CHECK_LIB(i386,i386_set_ldt)
76 dnl Check for -lw for Solaris
77 AC_CHECK_LIB(w,iswalnum)
78 dnl Check for XFree86 DGA extension
79 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
81 dnl **** Check for Open Sound System ****
82 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
84 AC_CACHE_CHECK("for Open Sound System",
85 ac_cv_c_opensoundsystem,
87 #ifdef HAVE_SYS_SOUNDCARD_H
88 #include <sys/soundcard.h>
90 #ifdef HAVE_MACHINE_SOUNDCARD_H
91 #include <machine/soundcard.h>
95 /* check for one of the Open Sound System specific SNDCTL_ defines */
96 #if !defined(SNDCTL_DSP_STEREO)
97 #error No open sound system
99 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
101 if test "$ac_cv_c_opensoundsystem" = "yes"
106 dnl **** Check for union semun ****
108 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
109 AC_TRY_COMPILE([#include <sys/types.h>
110 #include <sys/sem.h>],[union semun foo],
111 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
112 if test "$ac_cv_c_union_semun" = "yes"
114 AC_DEFINE(HAVE_UNION_SEMUN)
117 dnl **** If ln -s doesn't work, use cp instead ****
118 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
120 dnl **** Check for gcc strength-reduce bug ****
122 if test "x${GCC}" = "xyes"
124 CFLAGS="$CFLAGS -Wall"
125 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
128 static int Array[[3]];
131 for(i=0; i<B; i++) Array[[i]] = i - 3;
132 exit( Array[[1]] != -2 );
134 ac_cv_c_gcc_strength_bug="no",
135 ac_cv_c_gcc_strength_bug="yes",
136 ac_cv_c_gcc_strength_bug="yes") )
137 if test "$ac_cv_c_gcc_strength_bug" = "yes"
139 CFLAGS="$CFLAGS -fno-strength-reduce"
143 dnl **** Check for underscore on external symbols ****
145 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
146 ac_cv_c_extern_prefix,
148 LIBS="conftest_asm.s $LIBS"
149 cat > conftest_asm.s <<EOF
154 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
155 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
157 if test "$ac_cv_c_extern_prefix" = "yes"
159 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
162 dnl **** Check for .string in assembler ****
164 AC_CACHE_CHECK("whether assembler accepts .string",
167 LIBS="conftest_asm.s $LIBS"
168 cat > conftest_asm.s <<EOF
171 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
173 if test "$ac_cv_c_asm_string" = "yes"
175 AC_DEFINE(HAVE_ASM_STRING)
178 dnl **** Check for working dll ****
181 if test "$LIB_TARGET" = "libwine.so.1.0"
183 AC_CACHE_CHECK("whether we can build a dll",
185 [saved_cflags=$CFLAGS
186 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
187 AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
190 if test "$ac_cv_c_dll" = "yes"
194 LIB_TARGET="libwine.a"
199 dnl **** Check for reentrant X libraries ****
201 dnl This may fail to determine whether X libraries are reentrant if
202 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
203 dnl is possible with the --without-reentrant-x option.
205 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
206 [ if test "x$with_reentrant_x" = "xno"
208 wine_cv_x_reentrant=no
211 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
212 if test -e $dir/libX11.so; then
213 libX11_check="-D $dir/libX11.so"
216 if test -e $dir/libX11.a; then
217 libX11_check="$dir/libX11.a"
221 if test "$libX11_check" != "none"; then
222 if nm $libX11_check | grep -q __errno_location; then
223 wine_cv_x_reentrant=yes
225 wine_cv_x_reentrant=no
228 wine_cv_x_reentrant=unknown
231 if test "$wine_cv_x_reentrant" = "no"
233 AC_DEFINE(NO_REENTRANT_X11)
236 dnl **** Check for functions and header files ****
238 AC_CHECK_FUNCS(clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
239 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)
243 AC_CHECK_SIZEOF(long long,0)
245 dnl **** statfs checks ****
247 if test "$ac_cv_header_sys_vfs_h" = "yes"
249 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
250 wine_cv_sys_vfs_has_statfs,
252 #include <sys/types.h>
253 #ifdef HAVE_SYS_PARAM_H
254 # include <sys/param.h>
260 memset(&stfs,0,sizeof(stfs));
261 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
264 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
266 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
270 if test "$ac_cv_header_sys_statfs_h" = "yes"
272 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
273 wine_cv_sys_statfs_has_statfs,
275 #include <sys/types.h>
276 #ifdef HAVE_SYS_PARAM_H
277 # include <sys/param.h>
279 #include <sys/statfs.h>
282 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
285 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
287 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
291 if test "$ac_cv_header_sys_mount_h" = "yes"
293 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
294 wine_cv_sys_mount_has_statfs,
296 #include <sys/types.h>
297 #ifdef HAVE_SYS_PARAM_H
298 # include <sys/param.h>
300 #include <sys/mount.h>
303 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
306 if test "$wine_cv_sys_mount_has_statfs" = "yes"
308 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
312 dnl **** FIXME: what about mixed cases, where we need two of them? ***
314 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
315 [ if test "x$statfs_bfree" = "xno"
317 wine_cv_statfs_bfree=no
320 #include <sys/types.h>
321 #ifdef HAVE_SYS_PARAM_H
322 # include <sys/param.h>
324 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
325 # include <sys/mount.h>
327 # ifdef STATFS_DEFINED_BY_SYS_VFS
328 # include <sys/vfs.h>
330 # ifdef STATFS_DEFINED_BY_SYS_STATFS
331 # include <sys/statfs.h>
339 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
342 if test "$wine_cv_statfs_bfree" = "yes"
344 AC_DEFINE(STATFS_HAS_BFREE)
347 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
348 [ if test "x$statfs_bavail" = "xno"
350 wine_cv_statfs_bavail=no
353 #include <sys/types.h>
354 #ifdef HAVE_SYS_PARAM_H
355 # include <sys/param.h>
357 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
358 # include <sys/mount.h>
360 # ifdef STATFS_DEFINED_BY_SYS_VFS
361 # include <sys/vfs.h>
363 # ifdef STATFS_DEFINED_BY_SYS_STATFS
364 # include <sys/statfs.h>
372 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
375 if test "$wine_cv_statfs_bavail" = "yes"
377 AC_DEFINE(STATFS_HAS_BAVAIL)
380 dnl *** check for working sigaltstack
381 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
383 AC_CACHE_CHECK("for working sigaltstack",
384 ac_cv_c_working_sigaltstack,
387 #include <time.h> /* <sys/time.h> ? bad magic without end */
388 #include <sys/types.h>
389 #include <sys/signal.h>
390 #ifdef HAVE_SYS_PARAM_H
391 # include <sys/param.h>
393 #ifdef HAVE_SYSCALL_H
394 # include <syscall.h>
396 # ifdef HAVE_SYS_SYSCALL_H
397 # include <sys/syscall.h>
401 unsigned char *xaltstack;
404 main(int argc,char **argv) {
405 struct sigaltstack ss;
407 xaltstack = malloc(16384);
408 ss.ss_sp = xaltstack;
411 if (sigaltstack(&ss, NULL) < 0) {
412 /* this catches the glibc case */
413 perror("sigaltstack");
414 return (1); /* aka exit(1) aka fail */
416 /* assume it works. */
420 ac_cv_c_working_sigaltstack="yes",
421 ac_cv_c_working_sigaltstack="no",
422 ac_cv_c_working_sigaltstack="no"
425 if test "$ac_cv_c_working_sigaltstack" = "yes"
427 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
431 dnl **** Generate output files ****
433 MAKE_RULES=Make.rules
434 AC_SUBST_FILE(MAKE_RULES)
441 documentation/Makefile
444 graphics/metafiledrv/Makefile
445 graphics/psdrv/Makefile
446 graphics/win16drv/Makefile
447 graphics/x11drv/Makefile
462 programs/clock/Makefile
463 programs/notepad/Makefile
464 programs/progman/Makefile
465 programs/regtest/Makefile
466 programs/view/Makefile
467 programs/winhelp/Makefile
468 programs/winver/Makefile
480 echo "Configure finished. Do 'make depend; make' to compile Wine."
484 dnl comment-start: "dnl "
486 dnl comment-start-skip: "\\bdnl\\b\\s *"
487 dnl compile-command: "autoconf"