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 -lxpg4 for FreeBSD
83 AC_CHECK_LIB(xpg4,setrunelocale)
84 dnl Check for XFree86 DGA extension
85 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
87 dnl **** Check for Open Sound System ****
88 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
90 AC_CACHE_CHECK("for Open Sound System",
91 ac_cv_c_opensoundsystem,
93 #ifdef HAVE_SYS_SOUNDCARD_H
94 #include <sys/soundcard.h>
96 #ifdef HAVE_MACHINE_SOUNDCARD_H
97 #include <machine/soundcard.h>
101 /* check for one of the Open Sound System specific SNDCTL_ defines */
102 #if !defined(SNDCTL_DSP_STEREO)
103 #error No open sound system
105 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
107 if test "$ac_cv_c_opensoundsystem" = "yes"
112 dnl **** Check for union semun ****
114 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
115 AC_TRY_COMPILE([#include <sys/types.h>
116 #include <sys/sem.h>],[union semun foo],
117 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
118 if test "$ac_cv_c_union_semun" = "yes"
120 AC_DEFINE(HAVE_UNION_SEMUN)
123 dnl **** If ln -s doesn't work, use cp instead ****
124 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
126 dnl **** Check for gcc strength-reduce bug ****
128 if test "x${GCC}" = "xyes"
130 CFLAGS="$CFLAGS -Wall"
131 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
134 static int Array[[3]];
137 for(i=0; i<B; i++) Array[[i]] = i - 3;
138 exit( Array[[1]] != -2 );
140 ac_cv_c_gcc_strength_bug="no",
141 ac_cv_c_gcc_strength_bug="yes",
142 ac_cv_c_gcc_strength_bug="yes") )
143 if test "$ac_cv_c_gcc_strength_bug" = "yes"
145 CFLAGS="$CFLAGS -fno-strength-reduce"
149 dnl **** Check for underscore on external symbols ****
151 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
152 ac_cv_c_extern_prefix,
154 LIBS="conftest_asm.s $LIBS"
155 cat > conftest_asm.s <<EOF
160 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
161 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
163 if test "$ac_cv_c_extern_prefix" = "yes"
165 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
168 dnl **** Check for .string in assembler ****
170 AC_CACHE_CHECK("whether assembler accepts .string",
173 LIBS="conftest_asm.s $LIBS"
174 cat > conftest_asm.s <<EOF
177 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
179 if test "$ac_cv_c_asm_string" = "yes"
181 AC_DEFINE(HAVE_ASM_STRING)
184 dnl **** Check for working dll ****
187 if test "$LIB_TARGET" = "libwine.so.1.0"
189 AC_CACHE_CHECK("whether we can build a dll",
191 [saved_cflags=$CFLAGS
192 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
193 AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
196 if test "$ac_cv_c_dll" = "yes"
200 LIB_TARGET="libwine.a"
205 dnl **** Check for reentrant libc ****
207 dnl For cross-compiling we blindly assume that libc is reentrant. This is
208 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
210 AC_CACHE_CHECK("for reentrant libc", wine_cv_libc_reentrant,
211 [AC_TRY_RUN([int myerrno = 0;
213 int *__errno_location(){return &myerrno;}
214 main(){connect(0,buf,255); exit(!myerrno);}],
215 wine_cv_libc_reentrant=yes, wine_cv_libc_reentrant=no,
216 wine_cv_libc_reentrant=yes ) ] )
217 if test "$wine_cv_libc_reentrant" = "no"
219 AC_DEFINE(NO_REENTRANT_LIBC)
222 dnl **** Check for reentrant X libraries ****
224 dnl This may fail to determine whether X libraries are reentrant if
225 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
226 dnl is possible with the --without-reentrant-x option.
228 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
229 [ if test "x$with_reentrant_x" = "xno"
231 wine_cv_x_reentrant=no
234 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
235 if test -r $dir/libX11.so; then
236 libX11_check="-D $dir/libX11.so"
239 if test -r $dir/libX11.a; then
240 libX11_check="$dir/libX11.a"
244 if test "$libX11_check" != "none"; then
245 if nm $libX11_check | grep __errno_location >/dev/null 2>&1
247 wine_cv_x_reentrant=yes
249 wine_cv_x_reentrant=no
252 wine_cv_x_reentrant=unknown
255 if test "$wine_cv_x_reentrant" = "no"
257 AC_DEFINE(NO_REENTRANT_X11)
260 dnl **** Check for functions and header files ****
262 AC_CHECK_FUNCS(clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
263 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)
267 AC_CHECK_SIZEOF(long long,0)
269 dnl **** Check for sendmsg in -lsocket if not found above ****
271 if test $ac_cv_func_sendmsg = no; then
272 AC_CHECK_LIB(socket,sendmsg)
275 dnl **** statfs checks ****
277 if test "$ac_cv_header_sys_vfs_h" = "yes"
279 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
280 wine_cv_sys_vfs_has_statfs,
282 #include <sys/types.h>
283 #ifdef HAVE_SYS_PARAM_H
284 # include <sys/param.h>
290 memset(&stfs,0,sizeof(stfs));
291 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
294 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
296 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
300 if test "$ac_cv_header_sys_statfs_h" = "yes"
302 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
303 wine_cv_sys_statfs_has_statfs,
305 #include <sys/types.h>
306 #ifdef HAVE_SYS_PARAM_H
307 # include <sys/param.h>
309 #include <sys/statfs.h>
312 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
315 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
317 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
321 if test "$ac_cv_header_sys_mount_h" = "yes"
323 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
324 wine_cv_sys_mount_has_statfs,
326 #include <sys/types.h>
327 #ifdef HAVE_SYS_PARAM_H
328 # include <sys/param.h>
330 #include <sys/mount.h>
333 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
336 if test "$wine_cv_sys_mount_has_statfs" = "yes"
338 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
342 dnl **** FIXME: what about mixed cases, where we need two of them? ***
344 AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
345 [ if test "x$statfs_bfree" = "xno"
347 wine_cv_statfs_bfree=no
350 #include <sys/types.h>
351 #ifdef HAVE_SYS_PARAM_H
352 # include <sys/param.h>
354 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
355 # include <sys/mount.h>
357 # ifdef STATFS_DEFINED_BY_SYS_VFS
358 # include <sys/vfs.h>
360 # ifdef STATFS_DEFINED_BY_SYS_STATFS
361 # include <sys/statfs.h>
369 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
372 if test "$wine_cv_statfs_bfree" = "yes"
374 AC_DEFINE(STATFS_HAS_BFREE)
377 AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
378 [ if test "x$statfs_bavail" = "xno"
380 wine_cv_statfs_bavail=no
383 #include <sys/types.h>
384 #ifdef HAVE_SYS_PARAM_H
385 # include <sys/param.h>
387 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
388 # include <sys/mount.h>
390 # ifdef STATFS_DEFINED_BY_SYS_VFS
391 # include <sys/vfs.h>
393 # ifdef STATFS_DEFINED_BY_SYS_STATFS
394 # include <sys/statfs.h>
402 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
405 if test "$wine_cv_statfs_bavail" = "yes"
407 AC_DEFINE(STATFS_HAS_BAVAIL)
410 dnl *** check for working sigaltstack
411 dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
413 AC_CACHE_CHECK("for working sigaltstack",
414 ac_cv_c_working_sigaltstack,
417 #include <time.h> /* <sys/time.h> ? bad magic without end */
418 #include <sys/types.h>
419 #include <sys/signal.h>
420 #ifdef HAVE_SYS_PARAM_H
421 # include <sys/param.h>
423 #ifdef HAVE_SYSCALL_H
424 # include <syscall.h>
426 # ifdef HAVE_SYS_SYSCALL_H
427 # include <sys/syscall.h>
431 unsigned char *xaltstack;
434 main(int argc,char **argv) {
435 struct sigaltstack ss;
437 xaltstack = malloc(16384);
438 ss.ss_sp = xaltstack;
441 if (sigaltstack(&ss, NULL) < 0) {
442 /* this catches the glibc case */
443 perror("sigaltstack");
444 return (1); /* aka exit(1) aka fail */
446 /* assume it works. */
450 ac_cv_c_working_sigaltstack="yes",
451 ac_cv_c_working_sigaltstack="no",
452 ac_cv_c_working_sigaltstack="no"
455 if test "$ac_cv_c_working_sigaltstack" = "yes"
457 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
461 dnl *** check for file descriptor passing with msg_accrights
463 AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
464 AC_TRY_COMPILE([#include <sys/types.h>
465 #include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
466 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
467 if test "$ac_cv_c_msg_accrights" = "yes"
469 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
472 dnl **** Generate output files ****
474 MAKE_RULES=Make.rules
475 AC_SUBST_FILE(MAKE_RULES)
483 dlls/comctl32/Makefile
485 dlls/shell32/Makefile
486 dlls/winaspi/Makefile
487 dlls/wnaspi32/Makefile
488 documentation/Makefile
491 graphics/metafiledrv/Makefile
492 graphics/psdrv/Makefile
493 graphics/win16drv/Makefile
494 graphics/x11drv/Makefile
510 programs/clock/Makefile
511 programs/control/Makefile
512 programs/notepad/Makefile
513 programs/progman/Makefile
514 programs/regtest/Makefile
515 programs/view/Makefile
516 programs/winhelp/Makefile
517 programs/winver/Makefile
529 if test "$wine_cv_libc_reentrant" = "no"
532 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
533 echo "*** thread support. Consider upgrading libc to a more recent"
534 echo "*** reentrant version of libc."
539 echo "Configure finished. Do 'make depend; make' to compile Wine."
543 dnl comment-start: "dnl "
545 dnl comment-start-skip: "\\bdnl\\b\\s *"
546 dnl compile-command: "autoconf"