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 AC_CACHE_CHECK("for Open Sound System on *BSD",
71 ac_cv_c_opensoundsystem_bsd,
72 AC_TRY_COMPILE([#include <machine/soundcard.h>],[
73 /* check for one of the Open Sound System specific SNDCTL_ defines */
74 #if !defined(SNDCTL_DSP_STEREO)
75 #error No open sound system
77 ],ac_cv_c_opensoundsystem_bsd="yes",ac_cv_c_opensoundsystem_bsd="no"))
79 if test "$ac_cv_c_opensoundsystem" = "yes" -o "$ac_cv_c_opensoundsystem_bsd" = "yes"
82 if test "$ac_cv_c_opensoundsystem_bsd" = "yes"
84 AC_DEFINE(HAVE_MACHINE_SOUNDCARD_H)
88 dnl **** Check for union semun ****
90 AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
91 AC_TRY_COMPILE([#include <sys/types.h>
92 #include <sys/sem.h>],[union semun foo],
93 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
94 if test "$ac_cv_c_union_semun" = "yes"
96 AC_DEFINE(HAVE_UNION_SEMUN)
99 dnl **** If ln -s doesn't work, use cp instead ****
100 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
102 dnl **** Check for gcc strength-reduce bug ****
104 if test "x${GCC}" = "xyes"
106 CFLAGS="$CFLAGS -Wall"
107 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
110 static int Array[[3]];
113 for(i=0; i<B; i++) Array[[i]] = i - 3;
114 exit( Array[[1]] != -2 );
116 ac_cv_c_gcc_strength_bug="no",
117 ac_cv_c_gcc_strength_bug="yes",
118 ac_cv_c_gcc_strength_bug="yes") )
119 if test "$ac_cv_c_gcc_strength_bug" = "yes"
121 CFLAGS="$CFLAGS -fno-strength-reduce"
125 dnl **** Check for underscore on external symbols ****
127 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
128 ac_cv_c_extern_prefix,
130 LIBS="conftest_asm.s $LIBS"
131 cat > conftest_asm.s <<EOF
136 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
137 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
139 if test "$ac_cv_c_extern_prefix" = "yes"
141 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
144 dnl **** Check for .string in assembler ****
146 AC_CACHE_CHECK("whether assembler accepts .string",
149 LIBS="conftest_asm.s $LIBS"
150 cat > conftest_asm.s <<EOF
153 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
155 if test "$ac_cv_c_asm_string" = "yes"
157 AC_DEFINE(HAVE_ASM_STRING)
160 dnl **** Check for working dll ****
163 if test "$LIB_TARGET" = "libwine.so.1.0"
165 AC_CACHE_CHECK("whether we can build a dll",
167 [saved_cflags=$CFLAGS
168 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
169 AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
172 if test "$ac_cv_c_dll" = "yes"
176 LIB_TARGET="libwine.a"
181 dnl **** Check for reentrant X libraries ****
183 dnl This may fail to determine whether X libraries are reentrant if
184 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
185 dnl is possible with the --without-reentrant-x option.
187 AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
188 [ if test "x$with_reentrant_x" = "xno"
190 wine_cv_x_reentrant=no
193 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
194 if test -e $dir/libX11.so; then
195 libX11_check="-D $dir/libX11.so"
198 if test -e $dir/libX11.a; then
199 libX11_check="$dir/libX11.a"
203 if test "$libX11_check" != "none"; then
204 if nm $libX11_check | grep -q __errno_location; then
205 wine_cv_x_reentrant=yes
207 wine_cv_x_reentrant=no
210 wine_cv_x_reentrant=unknown
213 if test "$wine_cv_x_reentrant" = "no"
215 AC_DEFINE(NO_REENTRANT_X11)
218 dnl **** Check for functions and header files ****
220 AC_CHECK_FUNCS(clone memmove strerror tcgetattr timegm usleep wait4 waitpid)
221 AC_CHECK_HEADERS(wctype.h)
226 dnl **** Generate output files ****
228 MAKE_RULES=Make.rules
229 AC_SUBST_FILE(MAKE_RULES)
236 documentation/Makefile
239 graphics/metafiledrv/Makefile
240 graphics/win16drv/Makefile
241 graphics/x11drv/Makefile
255 programs/clock/Makefile
256 programs/notepad/Makefile
257 programs/progman/Makefile
258 programs/view/Makefile
259 programs/winhelp/Makefile
260 programs/winver/Makefile
271 echo "Configure finished. Do 'make depend; make' to compile Wine."
275 dnl comment-start: "dnl "
277 dnl comment-start-skip: "\\bdnl\\b\\s *"
278 dnl compile-command: "autoconf"