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 ****
19 AC_ARG_ENABLE(emulator,
20 [ --disable-emulator build only the Wine library, not the emulator],
21 [if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi])
24 [ --enable-dll build the Wine library as a DLL],
25 [if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi])
28 dnl [ --enable-ipc use inter-process communication for DDE],
29 dnl [if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
31 AC_ARG_WITH(reentrant-x,
32 [ --without-reentrant-x Compile for use with non-reentrant X libraries])
38 dnl **** Check for some programs ****
50 dnl **** Check for some libraries ****
52 dnl Check for -li386 for NetBSD and OpenBSD
53 AC_CHECK_LIB(i386,i386_set_ldt)
54 dnl Check for -lw for Solaris
55 AC_CHECK_LIB(w,iswalnum)
56 dnl Check for XFree86 DGA extension
57 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
59 dnl **** Check for Open Sound System ****
61 AC_CACHE_CHECK("for Open Sound System",
62 ac_cv_c_opensoundsystem,
63 AC_TRY_COMPILE([#include <sys/soundcard.h>],[
64 /* check for one of the Open Sound System specific SNDCTL_ defines */
65 #if !defined(SNDCTL_DSP_STEREO)
66 #error No open sound system
68 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
70 if test "$ac_cv_c_opensoundsystem" = "yes"
75 dnl **** Check for union semun ****
77 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
78 AC_TRY_COMPILE([#include <sys/types.h>
79 #include <sys/sem.h>],[union semun foo],
80 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
81 if test "$ac_cv_c_union_semun" = "yes"
83 AC_DEFINE(HAVE_UNION_SEMUN)
86 dnl **** If ln -s doesn't work, use cp instead ****
87 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
89 dnl **** Check for gcc strength-reduce bug ****
91 if test "x${GCC}" = "xyes"
93 CFLAGS="$CFLAGS -Wall"
94 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
97 static int Array[[3]];
100 for(i=0; i<B; i++) Array[[i]] = i - 3;
101 exit( Array[[1]] != -2 );
103 ac_cv_c_gcc_strength_bug="no",
104 ac_cv_c_gcc_strength_bug="yes",
105 ac_cv_c_gcc_strength_bug="yes") )
106 if test "$ac_cv_c_gcc_strength_bug" = "yes"
108 CFLAGS="$CFLAGS -fno-strength-reduce"
112 dnl **** Check for underscore on external symbols ****
114 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
115 ac_cv_c_extern_prefix,
117 LIBS="conftest_asm.s $LIBS"
118 cat > conftest_asm.s <<EOF
123 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
124 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
126 if test "$ac_cv_c_extern_prefix" = "yes"
128 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
131 dnl **** Check for .string in assembler ****
133 AC_CACHE_CHECK("whether assembler accepts .string",
136 LIBS="conftest_asm.s $LIBS"
137 cat > conftest_asm.s <<EOF
140 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
142 if test "$ac_cv_c_asm_string" = "yes"
144 AC_DEFINE(HAVE_ASM_STRING)
147 dnl **** Check for working dll ****
150 if test "$LIB_TARGET" = "libwine.so.1.0"
152 AC_CACHE_CHECK("whether we can build a dll",
154 [saved_cflags=$CFLAGS
155 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
156 AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
159 if test "$ac_cv_c_dll" = "yes"
163 LIB_TARGET="libwine.a"
168 dnl **** Check for reentrant X libraries ****
170 dnl This may fail to determine whether X libraries are reentrant if
171 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
172 dnl is possible with the --without-reentrant-x option.
174 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
175 [ if test "x$with_reentrant_x" = "xno"
177 wine_cv_x_reentrant=no
180 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
181 if test -e $dir/libX11.so; then
182 libX11_check="-D $dir/libX11.so"
185 if test -e $dir/libX11.a; then
186 libX11_check="$dir/libX11.a"
190 if test "$libX11_check" != "none"; then
191 if nm $libX11_check | grep -q __errno_location; then
192 wine_cv_x_reentrant=yes
194 wine_cv_x_reentrant=no
197 wine_cv_x_reentrant=unknown
200 if test "$wine_cv_x_reentrant" = "no"
202 AC_DEFINE(NO_REENTRANT_X11)
205 dnl **** Check for functions and header files ****
207 AC_CHECK_FUNCS(clone memmove strerror tcgetattr usleep wait4 waitpid)
208 AC_CHECK_HEADERS(wctype.h)
213 dnl **** Generate output files ****
215 MAKE_RULES=Make.rules
216 AC_SUBST_FILE(MAKE_RULES)
223 documentation/Makefile
226 graphics/metafiledrv/Makefile
227 graphics/win16drv/Makefile
228 graphics/x11drv/Makefile
242 programs/clock/Makefile
243 programs/notepad/Makefile
244 programs/progman/Makefile
245 programs/view/Makefile
246 programs/winhelp/Makefile
247 programs/winver/Makefile
258 echo "Configure finished. Do 'make depend; make' to compile Wine."
262 dnl comment-start: "dnl "
264 dnl comment-start-skip: "\\bdnl\\b\\s *"
265 dnl compile-command: "autoconf"