blob: 3f05ff1893865b5db785316973bb9d09b85603b0 [file] [log] [blame]
Alexandre Julliarde2991ea1995-07-29 13:09:43 +00001dnl Process this file with autoconf to produce a configure script.
2dnl Author: Michael Patra <micky@marie.physik.tu-berlin.de>
3dnl <patra@itp1.physik.tu-berlin.de>
4AC_REVISION([configure.in 1.00])
5AC_INIT(controls/edit.c)
Alexandre Julliard18f92e71996-07-17 20:02:21 +00006AC_CONFIG_HEADER(include/config.h)
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +00007AC_CONFIG_AUX_DIR(tools)
Alexandre Julliarde2991ea1995-07-29 13:09:43 +00008
9# We want these before the checks, so the checks can modify their values.
Howard Abrams13277481999-07-10 13:16:29 +000010
Alexandre Julliardc6c09441997-01-12 18:32:19 +000011test -z "$PROGEXT" && PROGEXT="" AC_SUBST(PROGEXT)
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000012
Alexandre Julliardff8331e1995-09-18 11:19:54 +000013dnl **** Command-line arguments ****
14
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +000015dnl Default values
16MAIN_TARGET=emu
17LIB_TARGET=libwine.a
Todd Vierling8beb15a1998-12-18 17:30:52 +000018ALT_LINK="-L\$(TOPOBJDIR) -lwine"
Alexandre Julliardf90efa91998-06-14 15:24:15 +000019TRACE_MSGS=yes # the TRACE() macro
20DEBUG_MSGS=yes # the TRACE(), WARN(), and FIXME() macros.
Alexandre Julliard7e56f681996-01-31 19:02:28 +000021
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +000022AC_ARG_ENABLE(emulator,
23[ --disable-emulator build only the Wine library, not the emulator],
24[if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi])
25
26AC_ARG_ENABLE(dll,
27[ --enable-dll build the Wine library as a DLL],
28[if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi])
Alexandre Julliardff8331e1995-09-18 11:19:54 +000029
Alexandre Julliard642d3131998-07-12 19:29:36 +000030AC_ARG_ENABLE(lib,
31[ --disable-lib build the Wine without building libwine.a],
Ove Kaaven11e1a5e1998-11-06 10:01:45 +000032[if test "$enableval" = "no"; then ALT_LINK="\$(LIBOBJS) \$(X11OBJS)"; LIB_TARGET=""; fi])
Alexandre Julliard642d3131998-07-12 19:29:36 +000033
Alexandre Julliardf90efa91998-06-14 15:24:15 +000034AC_ARG_ENABLE(debug,
35[ --disable-debug compile out all debugging messages],
36[if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
37
38AC_ARG_ENABLE(trace,
39[ --disable-trace compile out TRACE messages],
40[if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
41
Alexandre Julliarda11d7b11998-03-01 20:05:02 +000042AC_ARG_WITH(reentrant-x,
Joseph Pranevich791cd6a1998-12-02 19:58:08 +000043[ --without-reentrant-x compile for use with non-reentrant X libraries])
Alexandre Julliarda11d7b11998-03-01 20:05:02 +000044
Alexandre Julliard18f92e71996-07-17 20:02:21 +000045AC_SUBST(MAIN_TARGET)
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +000046AC_SUBST(LIB_TARGET)
Uwe Bonnes2a4707a1998-10-11 14:57:08 +000047AC_SUBST(ALT_LINK)
Alexandre Julliard18f92e71996-07-17 20:02:21 +000048AC_SUBST(OPTIONS)
Alexandre Julliardb7258be1995-09-01 15:57:28 +000049
Alexandre Julliardf90efa91998-06-14 15:24:15 +000050if test "$DEBUG_MSGS" = "no"
51then
52 AC_DEFINE(NO_DEBUG_MSGS)
53 AC_DEFINE(NO_TRACE_MSGS)
54else
55 if test "$TRACE_MSGS" = "no"
56 then
57 AC_DEFINE(NO_TRACE_MSGS)
58 fi
59fi
60
Alexandre Julliard02e90081998-01-04 17:49:09 +000061dnl **** Check for some programs ****
Alexandre Julliardff8331e1995-09-18 11:19:54 +000062
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000063AC_PROG_MAKE_SET
64AC_PROG_CC
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000065AC_PROG_CPP
Alexandre Julliardff8331e1995-09-18 11:19:54 +000066AC_PATH_XTRA
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000067AC_PROG_YACC
68AC_PROG_LEX
Alexandre Julliardff8331e1995-09-18 11:19:54 +000069AC_PROG_RANLIB
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000070AC_PROG_INSTALL
Alexandre Julliard641ee761997-08-04 16:34:36 +000071AC_PROG_LN_S
Alexandre Julliardc7c217b1998-04-13 12:21:30 +000072AC_CHECK_PROG(C2MAN,c2man,c2man,true)
James Juranffe6b761999-06-12 08:21:57 +000073AC_PATH_PROG(LDCONFIG, ldconfig, false, /sbin:/usr/sbin:$PATH)
Alexandre Julliard02e90081998-01-04 17:49:09 +000074
Patrik Stridvalla9be64e1999-07-31 17:39:44 +000075dnl Check for lint
76AC_CHECK_PROGS(LINT, lclint lint)
77if test "$LINT" = "lint"
78then
79 LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
80 dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
81fi
82AC_SUBST(LINT)
83AC_SUBST(LINTFLAGS)
84
Alexandre Julliard02e90081998-01-04 17:49:09 +000085dnl **** Check for some libraries ****
86
Howard Abrams13277481999-07-10 13:16:29 +000087dnl Check for -lm for BeOS
88AC_CHECK_LIB(m,sqrt)
Alexandre Julliardd37eb361997-07-20 16:23:21 +000089dnl Check for -li386 for NetBSD and OpenBSD
Alexandre Julliard02e90081998-01-04 17:49:09 +000090AC_CHECK_LIB(i386,i386_set_ldt)
Todd Vierlingecc76691998-12-15 17:49:02 +000091dnl Check for -lossaudio for NetBSD
92AC_CHECK_LIB(ossaudio,_oss_ioctl)
Alexandre Julliard02e90081998-01-04 17:49:09 +000093dnl Check for -lw for Solaris
94AC_CHECK_LIB(w,iswalnum)
Patrik Stridvallea584721998-11-01 16:22:07 +000095dnl Check for -lnsl for Solaris
Ron Recorde977d6c1999-09-05 12:32:05 +000096AC_CHECK_FUNCS(gethostbyname,, AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl", AC_CHECK_LIB(socket, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl", , -lnsl), -lsocket))
Ulrich Weigand715a55e1999-04-18 13:19:56 +000097dnl Check for -lsocket for Solaris
Marcus Meissnerf070fda1999-04-24 12:02:14 +000098AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000099dnl Check for -lxpg4 for FreeBSD
100AC_CHECK_LIB(xpg4,setrunelocale)
Alexandre Julliard0e7bd081999-05-02 11:46:02 +0000101dnl Check for -lmmap for OS/2
102AC_CHECK_LIB(mmap,mmap)
Marcus Meissnerf070fda1999-04-24 12:02:14 +0000103
104AC_CHECK_HEADERS(dlfcn.h,
105 AC_CHECK_FUNCS(dlopen,
106 AC_DEFINE(HAVE_DL_API),
107 AC_CHECK_LIB(dl,dlopen,
108 AC_DEFINE(HAVE_DL_API)
109 LIBS="$LIBS -ldl"
110 )
111 )
112)
Patrik Stridvallea584721998-11-01 16:22:07 +0000113AC_SUBST(XLIB)
114if test "$have_x" = "yes"
115then
Patrik Stridvall24110281999-02-04 10:09:54 +0000116 XLIB="-lXext -lX11"
Ove Kaaven1eb593c1999-02-14 09:34:46 +0000117 ac_save_CPPFLAGS="$CPPFLAGS"
118 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
Patrik Stridvall24110281999-02-04 10:09:54 +0000119
Patrik Stridvallea584721998-11-01 16:22:07 +0000120 dnl Check for -lXpm
Patrik Stridvall24110281999-02-04 10:09:54 +0000121 AC_CHECK_HEADERS(X11/xpm.h)
122 if test "$ac_cv_header_X11_xpm_h" = "yes"
123 then
124 AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
125 fi
126
Patrik Stridvallea584721998-11-01 16:22:07 +0000127 dnl Check for X Shm extension
Patrik Stridvall24110281999-02-04 10:09:54 +0000128 AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/XShm.h)
129 if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_XShm_h" = "yes"
130 then
131 AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
132 fi
Lionel Ulmerd94475b1999-09-20 18:42:46 +0000133 dnl Check for XFree86 DGA / DGA 2.0 extension
Patrik Stridvall24110281999-02-04 10:09:54 +0000134 AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86dga.h)
135 if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
136 then
Lionel Ulmerd94475b1999-09-20 18:42:46 +0000137 AC_CHECK_LIB(Xxf86dga,XDGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA2) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
Patrik Stridvall24110281999-02-04 10:09:54 +0000138 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
139 fi
140
Stephen Crowley399931a1998-12-08 13:10:56 +0000141 dnl Check for XFree86 VMODE extension
Patrik Stridvall24110281999-02-04 10:09:54 +0000142 AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86vmode.h)
143 if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
144 then
145 AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
146 fi
Lionel Ulmer5c085701999-02-28 19:48:53 +0000147
Lionel Ulmer5ff00771999-01-03 17:00:19 +0000148 dnl Check for the presence of Mesa
Lionel Ulmer5d68f791999-07-23 19:33:24 +0000149 AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/osmesa.h)
150 if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
Patrik Stridvall24110281999-02-04 10:09:54 +0000151 then
Lionel Ulmer5c085701999-02-28 19:48:53 +0000152 dnl Check for some problems due to old Mesa versions
153 AC_CACHE_CHECK("for up-to-date Mesa version", wine_cv_mesa_version_OK,
154 AC_TRY_COMPILE(
155 [#include <GL/gl.h>],
156 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
157 [wine_cv_mesa_version_OK="yes"],
158 [wine_cv_mesa_version_OK="no"]
159 )
160 )
161
162 if test "$wine_cv_mesa_version_OK" = "yes"
163 then
164 dnl Check for the presense of the library
Lionel Ulmer5d68f791999-07-23 19:33:24 +0000165 AC_CHECK_LIB(GL,glXCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lGL",,$X_LIBS -lXext -lX11 -lm)
166 if test "$ac_cv_lib_GL_glXCreateContext" = "no"
167 then
Eric Pouech1a971911999-07-24 10:25:45 +0000168 AC_CHECK_LIB(MesaGL,glXCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm)
Lionel Ulmer5d68f791999-07-23 19:33:24 +0000169 fi
Lionel Ulmer5c085701999-02-28 19:48:53 +0000170 fi
Patrik Stridvall24110281999-02-04 10:09:54 +0000171 fi
Ove Kaaven1eb593c1999-02-14 09:34:46 +0000172
173 CPPFLAGS="$ac_save_CPPFLAGS"
Patrik Stridvallea584721998-11-01 16:22:07 +0000174else
175 XLIB=""
176 X_CFLAGS=""
177 X_LIBS=""
178fi
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000179
Joseph Praneviche884f9c1999-01-03 16:14:34 +0000180dnl **** Check which curses lib to use ***
Patrik Stridvall24110281999-02-04 10:09:54 +0000181AC_CHECK_HEADERS(ncurses.h)
182if test "$ac_cv_header_ncurses_h" = "yes"
183then
184 AC_CHECK_LIB(ncurses,waddch)
185fi
Joseph Praneviche884f9c1999-01-03 16:14:34 +0000186if test "$ac_cv_lib_ncurses_waddch" = "yes"
Alexandre Julliard638f1691999-01-17 16:32:32 +0000187then
188 AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
Michael Vekslerf5445071999-02-25 17:11:05 +0000189 AC_CHECK_LIB(ncurses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
Joseph Praneviche884f9c1999-01-03 16:14:34 +0000190else
Patrik Stridvall24110281999-02-04 10:09:54 +0000191 AC_CHECK_HEADERS(curses.h)
192 if test "$ac_cv_header_curses_h" = "yes"
193 then
194 AC_CHECK_LIB(curses,waddch)
195 AC_CHECK_LIB(curses,resizeterm,AC_DEFINE(HAVE_RESIZETERM))
Michael Vekslerf5445071999-02-25 17:11:05 +0000196 AC_CHECK_LIB(curses,getbkgd,AC_DEFINE(HAVE_GETBKGD))
Patrik Stridvall24110281999-02-04 10:09:54 +0000197 fi
Joseph Praneviche884f9c1999-01-03 16:14:34 +0000198fi
199
Pavel Roskin94d99641998-12-26 11:52:51 +0000200dnl **** Check for IPX (currently Linux only) ****
201AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
202 AC_TRY_COMPILE(
203 [#include <sys/socket.h>
204 #include <netipx/ipx.h>],
205 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
206 [AC_DEFINE(HAVE_IPX_GNU)
207 ac_cv_c_ipx_gnu="yes"],
208 [ac_cv_c_ipx_gnu="no"])
209 )
210
211if test "$ac_cv_c_ipx_gnu" = "no"
212then
213 AC_CACHE_CHECK("for linux style IPX support", ac_cv_c_ipx_linux,
214 AC_TRY_COMPILE(
215 [#include <sys/socket.h>
216 #include <asm/types.h>
217 #include <linux/ipx.h>],
218 [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
219 [AC_DEFINE(HAVE_IPX_LINUX)
220 ac_cv_c_ipx_linux="yes"],
221 [ac_cv_c_ipx_linux="no"])
222 )
223fi
224
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000225dnl **** Check for Open Sound System ****
Todd Vierlingecc76691998-12-15 17:49:02 +0000226AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000227
228AC_CACHE_CHECK("for Open Sound System",
229 ac_cv_c_opensoundsystem,
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000230 AC_TRY_COMPILE([
Todd Vierlingecc76691998-12-15 17:49:02 +0000231 #if defined(HAVE_SYS_SOUNDCARD_H)
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000232 #include <sys/soundcard.h>
Todd Vierlingecc76691998-12-15 17:49:02 +0000233 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000234 #include <machine/soundcard.h>
Todd Vierlingecc76691998-12-15 17:49:02 +0000235 #elif defined(HAVE_SOUNDCARD_H)
236 #include <soundcard.h>
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000237 #endif
238 ],[
239
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000240/* check for one of the Open Sound System specific SNDCTL_ defines */
241#if !defined(SNDCTL_DSP_STEREO)
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000242#error No open sound system
243#endif
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000244],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
245
246if test "$ac_cv_c_opensoundsystem" = "yes"
247then
248 AC_DEFINE(HAVE_OSS)
249fi
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000250
Eric Pouech338d3b21999-05-22 18:52:21 +0000251AC_CACHE_CHECK("for Open Sound System/MIDI interface",
252 ac_cv_c_opensoundsystem_midi,
253 AC_TRY_COMPILE([
254 #if defined(HAVE_SYS_SOUNDCARD_H)
255 #include <sys/soundcard.h>
256 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
257 #include <machine/soundcard.h>
258 #elif defined(HAVE_SOUNDCARD_H)
259 #include <soundcard.h>
260 #endif
261 ],[
262
263/* check for one of the Open Sound System specific SNDCTL_SEQ defines */
264#if !defined(SNDCTL_SEQ_SYNC)
265#error No open sound system MIDI interface
266#endif
267],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
268
269if test "$ac_cv_c_opensoundsystem_midi" = "yes"
270then
271 AC_DEFINE(HAVE_OSS_MIDI)
272fi
273
Alexandre Julliard641ee761997-08-04 16:34:36 +0000274dnl **** If ln -s doesn't work, use cp instead ****
275if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
276
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000277dnl **** Check for gcc strength-reduce bug ****
278
279if test "x${GCC}" = "xyes"
280then
281 CFLAGS="$CFLAGS -Wall"
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000282 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
283 AC_TRY_RUN([
284int main(void) {
Alexandre Julliardd2e1c1a1996-03-09 16:12:43 +0000285 static int Array[[3]];
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000286 unsigned int B = 3;
287 int i;
Alexandre Julliardd2e1c1a1996-03-09 16:12:43 +0000288 for(i=0; i<B; i++) Array[[i]] = i - 3;
289 exit( Array[[1]] != -2 );
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000290}],
291 ac_cv_c_gcc_strength_bug="no",
292 ac_cv_c_gcc_strength_bug="yes",
293 ac_cv_c_gcc_strength_bug="yes") )
294 if test "$ac_cv_c_gcc_strength_bug" = "yes"
295 then
296 CFLAGS="$CFLAGS -fno-strength-reduce"
297 fi
298fi
299
Alexandre Julliard8cc3a5e1996-08-11 15:49:51 +0000300dnl **** Check for underscore on external symbols ****
301
302AC_CACHE_CHECK("whether external symbols need an underscore prefix",
303 ac_cv_c_extern_prefix,
304[saved_libs=$LIBS
305LIBS="conftest_asm.s $LIBS"
306cat > conftest_asm.s <<EOF
307 .globl _ac_test
308_ac_test:
309 .long 0
310EOF
311AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
312 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
313LIBS=$saved_libs])
314if test "$ac_cv_c_extern_prefix" = "yes"
315then
316 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
317fi
318
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000319dnl **** Check for .string in assembler ****
320
321AC_CACHE_CHECK("whether assembler accepts .string",
322 ac_cv_c_asm_string,
323[saved_libs=$LIBS
324LIBS="conftest_asm.s $LIBS"
325cat > conftest_asm.s <<EOF
326 .string "test"
327EOF
328AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
329LIBS=$saved_libs])
330if test "$ac_cv_c_asm_string" = "yes"
331then
332 AC_DEFINE(HAVE_ASM_STRING)
333fi
334
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000335dnl **** Check for working dll ****
336
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000337DLLFLAGS=""
Ulrich Weigand4b32fd01999-07-15 14:51:40 +0000338BUILDFLAGS=""
Todd Vierling4b992b01998-12-15 15:26:27 +0000339LDSHARED=""
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000340if test "$LIB_TARGET" = "libwine.so.1.0"
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000341then
Todd Vierling4b992b01998-12-15 15:26:27 +0000342 AC_CACHE_CHECK("whether we can build a Linux dll",
343 ac_cv_c_dll_linux,
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000344 [saved_cflags=$CFLAGS
345 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
Todd Vierling4b992b01998-12-15 15:26:27 +0000346 AC_TRY_LINK(,[return 1],ac_cv_c_dll_linux="yes",ac_cv_c_dll_linux="no")
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000347 CFLAGS=$saved_cflags
348 ])
Todd Vierling4b992b01998-12-15 15:26:27 +0000349 if test "$ac_cv_c_dll_linux" = "yes"
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000350 then
Ulrich Weigand4b32fd01999-07-15 14:51:40 +0000351 BUILDFLAGS="-pic"
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000352 DLLFLAGS="-fPIC"
Todd Vierling4b992b01998-12-15 15:26:27 +0000353 LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000354 else
Ron Recorde977d6c1999-09-05 12:32:05 +0000355 AC_CACHE_CHECK("whether we can build a UnixWare dll",
356 ac_cv_c_dll_unixware,
Todd Vierling4b992b01998-12-15 15:26:27 +0000357 [saved_cflags=$CFLAGS
Ron Recorde977d6c1999-09-05 12:32:05 +0000358 CFLAGS="$CFLAGS -fPIC -Wl,-G,conftest.so.1.0"
359 AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
Todd Vierling4b992b01998-12-15 15:26:27 +0000360 CFLAGS=$saved_cflags
361 ])
Ron Recorde977d6c1999-09-05 12:32:05 +0000362 if test "$ac_cv_c_dll_unixware" = "yes"
Todd Vierling4b992b01998-12-15 15:26:27 +0000363 then
Ulrich Weigand4b32fd01999-07-15 14:51:40 +0000364 BUILDFLAGS="-pic"
Todd Vierling4b992b01998-12-15 15:26:27 +0000365 DLLFLAGS="-fPIC"
Ron Recorde977d6c1999-09-05 12:32:05 +0000366 LDSHARED="\$(CC) -Wl,-G,-h,/usr/local/lib/libwine.so"
367 else
368 AC_CACHE_CHECK("whether we can build a NetBSD dll",
369 ac_cv_c_dll_netbsd,
370 [saved_cflags=$CFLAGS
371 CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
372 AC_TRY_LINK(,[return 1],ac_cv_c_dll_netbsd="yes",ac_cv_c_dll_netbsd="no")
373 CFLAGS=$saved_cflags
374 ])
375 if test "$ac_cv_c_dll_netbsd" = "yes"
376 then
377 BUILDFLAGS="-pic"
378 DLLFLAGS="-fPIC"
379 LDSHARED="ld -Bshareable -Bforcearchive"
380 fi
Todd Vierling4b992b01998-12-15 15:26:27 +0000381 fi
382 fi
Ron Recorde977d6c1999-09-05 12:32:05 +0000383 if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_unixware" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
Todd Vierling4b992b01998-12-15 15:26:27 +0000384 then
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000385 LIB_TARGET="libwine.a"
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000386 fi
387fi
Ulrich Weigand4b32fd01999-07-15 14:51:40 +0000388AC_SUBST(BUILDFLAGS)
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000389AC_SUBST(DLLFLAGS)
Todd Vierling4b992b01998-12-15 15:26:27 +0000390AC_SUBST(LDSHARED)
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000391
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000392dnl **** Check for reentrant libc ****
393dnl
394dnl For cross-compiling we blindly assume that libc is reentrant. This is
395dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
396
Ulrich Weigand715a55e1999-04-18 13:19:56 +0000397wine_cv_libc_reentrant=no
Marcus Meissnerc2606381999-04-11 15:20:29 +0000398dnl
399dnl Linux style errno location
400dnl
Ulrich Weigand715a55e1999-04-18 13:19:56 +0000401AC_CACHE_CHECK("for reentrant libc: __errno_location", wine_cv_libc_r__errno_location,
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000402 [AC_TRY_RUN([int myerrno = 0;
403char buf[256];
404int *__errno_location(){return &myerrno;}
405main(){connect(0,buf,255); exit(!myerrno);}],
Ulrich Weigand715a55e1999-04-18 13:19:56 +0000406 wine_cv_libc_r__errno_location=yes, wine_cv_libc_r__errno_location=no,
407 wine_cv_libc_r__errno_location=yes )
408])
409if test "$wine_cv_libc_r__errno_location" = "yes"
410then
411 AC_DEFINE(HAVE__ERRNO_LOCATION)
412 wine_cv_libc_reentrant=__errno_location
413fi
Marcus Meissnerc2606381999-04-11 15:20:29 +0000414dnl
415dnl FreeBSD style errno location
416dnl
Ulrich Weigand715a55e1999-04-18 13:19:56 +0000417AC_CACHE_CHECK("for reentrant libc: __error", wine_cv_libc_r__error,
418 [AC_TRY_RUN([int myerrno = 0;
Marcus Meissnerc2606381999-04-11 15:20:29 +0000419char buf[256];
420int *__error(){return &myerrno;}
421main(){connect(0,buf,255); exit(!myerrno);}],
Ulrich Weigand715a55e1999-04-18 13:19:56 +0000422 wine_cv_libc_r__error=yes, wine_cv_libc_r__error=no,
423 wine_cv_libc_r__error=yes )
Marcus Meissnerc2606381999-04-11 15:20:29 +0000424])
Ulrich Weigand715a55e1999-04-18 13:19:56 +0000425if test "$wine_cv_libc_r__error" = "yes"
426then
427 AC_DEFINE(HAVE__ERROR)
428 wine_cv_libc_reentrant=__error
429fi
430dnl
431dnl Solaris style errno location
432dnl
433AC_CACHE_CHECK("for reentrant libc: ___errno", wine_cv_libc_r___errno,
434 [AC_TRY_RUN([int myerrno = 0;
435char buf[256];
436int *___errno(){return &myerrno;}
437main(){connect(0,buf,255); exit(!myerrno);}],
438 wine_cv_libc_r___errno=yes, wine_cv_libc_r___errno=no,
439 wine_cv_libc_r___errno=yes )
440])
441if test "$wine_cv_libc_r___errno" = "yes"
442then
443 AC_DEFINE(HAVE___ERRNO)
444 wine_cv_libc_reentrant=___errno
445fi
Ron Recorde977d6c1999-09-05 12:32:05 +0000446dnl
447dnl UnixWare style errno location
448dnl
449AC_CACHE_CHECK("for reentrant libc: __thr_errno", wine_cv_libc_r__thr_errno,
450 [AC_TRY_RUN([int myerrno = 0;
451char buf[256];
452int *__thr_errno(){return &myerrno;}
453main(){connect(0,buf,255); exit(!myerrno);}],
454 wine_cv_libc_r__thr_errno=yes, wine_cv_libc_r__thr_errno=no,
455 wine_cv_libc_r__thr_errno=yes )
456])
457if test "$wine_cv_libc_r__thr_errno" = "yes"
458then
459 AC_DEFINE(HAVE__THR_ERRNO)
460 wine_cv_libc_reentrant=__thr_errno
461fi
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000462if test "$wine_cv_libc_reentrant" = "no"
463then
464 AC_DEFINE(NO_REENTRANT_LIBC)
465fi
466
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000467dnl **** Check for reentrant X libraries ****
468dnl
469dnl This may fail to determine whether X libraries are reentrant if
470dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
471dnl is possible with the --without-reentrant-x option.
472
Ulrich Weigand715a55e1999-04-18 13:19:56 +0000473if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
Patrik Stridvall24110281999-02-04 10:09:54 +0000474then
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000475AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
Ulrich Weigand715a55e1999-04-18 13:19:56 +0000476 [ if test "x$with_reentrant_x" = "xno"
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000477 then
478 wine_cv_x_reentrant=no
479 else
Ulrich Weigand715a55e1999-04-18 13:19:56 +0000480 libX11_check=none
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000481 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
Alexandre Julliard829fe321998-07-26 14:27:39 +0000482 if test -r $dir/libX11.so; then
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000483 libX11_check="-D $dir/libX11.so"
484 break 1
485 fi
Alexandre Julliard829fe321998-07-26 14:27:39 +0000486 if test -r $dir/libX11.a; then
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000487 libX11_check="$dir/libX11.a"
488 break 1
489 fi
490 done
491 if test "$libX11_check" != "none"; then
Ulrich Weigand715a55e1999-04-18 13:19:56 +0000492 if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
Alexandre Julliard829fe321998-07-26 14:27:39 +0000493 then
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000494 wine_cv_x_reentrant=yes
495 else
496 wine_cv_x_reentrant=no
497 fi
498 else
499 wine_cv_x_reentrant=unknown
500 fi
501 fi ] )
Patrik Stridvall24110281999-02-04 10:09:54 +0000502else
503 wine_cv_x_reentrant=no
504fi
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000505if test "$wine_cv_x_reentrant" = "no"
506then
507 AC_DEFINE(NO_REENTRANT_X11)
508fi
509
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000510dnl **** Check for functions ****
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000511
Patrik Stridvall1bb94031999-05-08 15:47:44 +0000512AC_FUNC_ALLOCA()
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000513AC_CHECK_FUNCS(\
514 _lwp_create \
515 clone \
516 getpagesize \
517 memmove \
518 rfork \
519 sendmsg \
520 sigaltstack \
Alexandre Julliard3b96efc1999-09-04 14:36:02 +0000521 strcasecmp \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000522 strerror \
Alexandre Julliard3b96efc1999-09-04 14:36:02 +0000523 strncasecmp \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000524 tcgetattr \
525 timegm \
526 usleep \
527 vfscanf \
528 wait4 \
529 waitpid \
530)
531
532dnl **** Check for header files ****
533
534AC_CHECK_HEADERS(\
Patrik Stridvall96336321999-10-24 22:13:47 +0000535 a.out.h \
536 a_out.h \
537 arpa/inet.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000538 arpa/nameser.h \
539 curses.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000540 elf.h \
541 float.h \
542 libio.h \
Patrik Stridvall96336321999-10-24 22:13:47 +0000543 link.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000544 linux/cdrom.h \
Marcus Meissner028e9a11999-08-04 15:07:56 +0000545 linux/joystick.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000546 linux/ucdrom.h \
547 ncurses.h \
548 net/if.h \
549 netinet/in.h \
Patrik Stridvall96336321999-10-24 22:13:47 +0000550 netinet/tcp.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000551 resolv.h \
Patrik Stridvall96336321999-10-24 22:13:47 +0000552 sched.h \
553 socket.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000554 strings.h \
555 sys/cdio.h \
Howard Abrams13277481999-07-10 13:16:29 +0000556 sys/errno.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000557 sys/file.h \
558 sys/filio.h \
Patrik Stridvall96336321999-10-24 22:13:47 +0000559 sys/ipc.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000560 sys/lwp.h \
Howard Abrams13277481999-07-10 13:16:29 +0000561 sys/mman.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000562 sys/modem.h \
563 sys/mount.h \
Patrik Stridvall96336321999-10-24 22:13:47 +0000564 sys/msg.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000565 sys/param.h \
Howard Abrams13277481999-07-10 13:16:29 +0000566 sys/signal.h \
Patrik Stridvall96336321999-10-24 22:13:47 +0000567 sys/shm.h \
568 sys/socket.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000569 sys/sockio.h \
570 sys/statfs.h \
571 sys/strtio.h \
572 sys/syscall.h \
Patrik Stridvall96336321999-10-24 22:13:47 +0000573 sys/wait.h \
574 sys/v86.h \
575 sys/v86intr.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000576 sys/vfs.h \
Patrik Stridvall96336321999-10-24 22:13:47 +0000577 sys/vm86.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000578 syscall.h \
579 ucontext.h \
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000580 wctype.h \
581)
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000582AC_HEADER_STAT()
Alexandre Julliard2487cce1999-04-18 14:43:16 +0000583
584dnl **** Check for types ****
585
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000586AC_C_CONST()
Marcus Meissner1a8bbd71999-04-26 14:58:58 +0000587AC_C_INLINE()
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000588AC_TYPE_SIZE_T()
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000589AC_CHECK_SIZEOF(long long,0)
590
Marcus Meissner028e9a11999-08-04 15:07:56 +0000591if test "$ac_cv_header_linux_joystick_h" = "yes"
592then
593 AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
594 wine_cv_linux_joystick_22_api,
595 AC_TRY_COMPILE([
596 #include <sys/ioctl.h>
597 #include <linux/joystick.h>
598
599 struct js_event blub;
Marcus Meissner605a9c31999-11-04 02:04:01 +0000600 #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
601 #error "no 2.2 header"
602 #endif
Marcus Meissner028e9a11999-08-04 15:07:56 +0000603 ],/*empty*/,
604 wine_cv_linux_joystick_22_api=yes,
605 wine_cv_linux_joystick_22_api=no,
606 wine_cv_linux_joystick_22_api=no
607 )
608 )
609 if test "$wine_cv_linux_joystick_22_api"
610 then
611 AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API)
612 fi
613fi
614
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000615dnl **** statfs checks ****
616
617if test "$ac_cv_header_sys_vfs_h" = "yes"
618then
619 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
620 wine_cv_sys_vfs_has_statfs,
621 AC_TRY_COMPILE([
622 #include <sys/types.h>
623 #ifdef HAVE_SYS_PARAM_H
624 # include <sys/param.h>
625 #endif
626 #include <sys/vfs.h>
627 ],[
628 struct statfs stfs;
629
630 memset(&stfs,0,sizeof(stfs));
631 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
632 )
633 )
634 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
635 then
636 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
637 fi
638fi
639
640if test "$ac_cv_header_sys_statfs_h" = "yes"
641then
642 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
643 wine_cv_sys_statfs_has_statfs,
644 AC_TRY_COMPILE([
645 #include <sys/types.h>
646 #ifdef HAVE_SYS_PARAM_H
647 # include <sys/param.h>
648 #endif
649 #include <sys/statfs.h>
650 ],[
651 struct statfs stfs;
652 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
653 )
654 )
655 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
656 then
657 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
658 fi
659fi
660
661if test "$ac_cv_header_sys_mount_h" = "yes"
662then
663 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
664 wine_cv_sys_mount_has_statfs,
665 AC_TRY_COMPILE([
666 #include <sys/types.h>
667 #ifdef HAVE_SYS_PARAM_H
668 # include <sys/param.h>
669 #endif
670 #include <sys/mount.h>
671 ],[
672 struct statfs stfs;
673 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
674 )
675 )
676 if test "$wine_cv_sys_mount_has_statfs" = "yes"
677 then
678 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
679 fi
680fi
681
682dnl **** FIXME: what about mixed cases, where we need two of them? ***
683
684AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
685 [ if test "x$statfs_bfree" = "xno"
686 then
687 wine_cv_statfs_bfree=no
688 else
689 AC_TRY_COMPILE([
690 #include <sys/types.h>
691 #ifdef HAVE_SYS_PARAM_H
692 # include <sys/param.h>
693 #endif
694 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
695 # include <sys/mount.h>
696 #else
697 # ifdef STATFS_DEFINED_BY_SYS_VFS
698 # include <sys/vfs.h>
699 # else
700 # ifdef STATFS_DEFINED_BY_SYS_STATFS
701 # include <sys/statfs.h>
702 # endif
703 # endif
704 #endif
705 ],[
706 struct statfs stfs;
707
708 stfs.f_bfree++;
709 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
710 )
711 fi ] )
712if test "$wine_cv_statfs_bfree" = "yes"
713then
714 AC_DEFINE(STATFS_HAS_BFREE)
715fi
716
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000717AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
718 [ if test "x$statfs_bavail" = "xno"
719 then
720 wine_cv_statfs_bavail=no
721 else
722 AC_TRY_COMPILE([
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000723 #include <sys/types.h>
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000724 #ifdef HAVE_SYS_PARAM_H
725 # include <sys/param.h>
726 #endif
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000727 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000728 # include <sys/mount.h>
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000729 #else
730 # ifdef STATFS_DEFINED_BY_SYS_VFS
731 # include <sys/vfs.h>
732 # else
733 # ifdef STATFS_DEFINED_BY_SYS_STATFS
734 # include <sys/statfs.h>
735 # endif
736 # endif
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000737 #endif
738 ],[
739 struct statfs stfs;
740
741 stfs.f_bavail++;
742 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
743 )
744 fi ] )
745if test "$wine_cv_statfs_bavail" = "yes"
746then
747 AC_DEFINE(STATFS_HAS_BAVAIL)
748fi
749
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000750dnl *** check for working sigaltstack
751dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
752
753AC_CACHE_CHECK("for working sigaltstack",
754 ac_cv_c_working_sigaltstack,
755 AC_TRY_RUN([
756 #include <stdio.h>
757 #include <time.h> /* <sys/time.h> ? bad magic without end */
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000758 #include <sys/types.h>
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000759 #include <sys/signal.h>
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000760 #ifdef HAVE_SYS_PARAM_H
761 # include <sys/param.h>
762 #endif
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000763 #ifdef HAVE_SYSCALL_H
764 # include <syscall.h>
765 #else
766 # ifdef HAVE_SYS_SYSCALL_H
767 # include <sys/syscall.h>
768 # endif
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000769 #endif
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000770
771 unsigned char *xaltstack;
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000772
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000773 int
774 main(int argc,char **argv) {
775 struct sigaltstack ss;
776
777 xaltstack = malloc(16384);
778 ss.ss_sp = xaltstack;
779 ss.ss_size = 16384;
780 ss.ss_flags = 0;
781 if (sigaltstack(&ss, NULL) < 0) {
782 /* this catches the glibc case */
783 perror("sigaltstack");
784 return (1); /* aka exit(1) aka fail */
785 }
786 /* assume it works. */
787 return 0; /* OK */
788 }
789 ],
790 ac_cv_c_working_sigaltstack="yes",
791 ac_cv_c_working_sigaltstack="no",
792 ac_cv_c_working_sigaltstack="no"
793))
794
795if test "$ac_cv_c_working_sigaltstack" = "yes"
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000796then
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000797 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000798fi
799
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000800
Alexandre Julliard829fe321998-07-26 14:27:39 +0000801dnl *** check for file descriptor passing with msg_accrights
802
803AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
804 AC_TRY_COMPILE([#include <sys/types.h>
805#include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
806 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
807if test "$ac_cv_c_msg_accrights" = "yes"
808then
809 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
810fi
811
Alexandre Julliard51d46ba1999-05-08 16:05:27 +0000812dnl *** check for the need to define __i386__
813
814AC_CACHE_CHECK("whether we need to define __i386__",ac_cv_cpp_def_i386,
815 AC_EGREP_CPP(yes,[#if (defined(i386) || defined(__i386)) && !defined(__i386__)
816yes
817#endif],
818 ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
819if test "$ac_cv_cpp_def_i386" = "yes"
820then
821 CFLAGS="$CFLAGS -D__i386__"
Patrik Stridvalla9be64e1999-07-31 17:39:44 +0000822 LINTFLAGS="$LINTFLAGS -D__i386__"
Alexandre Julliard51d46ba1999-05-08 16:05:27 +0000823fi
824
Marcus Meissnera7f5cb51999-04-16 08:47:41 +0000825dnl $GCC is set by autoconf
826GCC_NO_BUILTIN=""
827if test "$GCC" = "yes"
828then
829 GCC_NO_BUILTIN="-fno-builtin"
830fi
831AC_SUBST(GCC_NO_BUILTIN)
832
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000833dnl **** Generate output files ****
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000834
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000835MAKE_RULES=Make.rules
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000836AC_SUBST_FILE(MAKE_RULES)
837
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000838AC_OUTPUT([
839Make.rules
840Makefile
Joseph Pranevich791cd6a1998-12-02 19:58:08 +0000841console/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000842controls/Makefile
843debugger/Makefile
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000844dlls/Makefile
Juergen Schmiedf7b0de31999-01-03 12:48:29 +0000845dlls/advapi32/Makefile
Marcus Meissnerb3d1a221999-03-13 18:07:44 +0000846dlls/avifil32/Makefile
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000847dlls/comctl32/Makefile
Klaas van Gendc9127491999-02-28 20:05:11 +0000848dlls/commdlg/Makefile
Ulrich Weigand6c6da671999-08-04 09:49:49 +0000849dlls/crtdll/Makefile
850dlls/dciman32/Makefile
Peter Hunnisett22b861c1999-09-28 16:35:32 +0000851dlls/dplayx/Makefile
Eric Pouech68944c21999-10-24 18:42:42 +0000852dlls/dsound/Makefile
Francois Gougetedf3e431999-11-07 21:22:17 +0000853dlls/icmp/Makefile
Patrik Stridvall8295c861998-10-11 17:09:05 +0000854dlls/imagehlp/Makefile
Ulrich Weigand6c6da671999-08-04 09:49:49 +0000855dlls/imm32/Makefile
856dlls/lzexpand/Makefile
Ulrich Weigandbb1984e1999-08-07 14:32:33 +0000857dlls/mpr/Makefile
Patrik Stridvall8295c861998-10-11 17:09:05 +0000858dlls/msacm/Makefile
859dlls/msacm32/Makefile
Ulrich Weigand6c6da671999-08-04 09:49:49 +0000860dlls/msnet32/Makefile
861dlls/msvideo/Makefile
Marcus Meissner51505b11998-11-01 14:00:21 +0000862dlls/ntdll/Makefile
Ulrich Weigand2a722f41999-09-19 18:36:53 +0000863dlls/ole32/Makefile
864dlls/oleaut32/Makefile
865dlls/olecli/Makefile
866dlls/oledlg/Makefile
867dlls/olesvr/Makefile
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000868dlls/psapi/Makefile
Marcus Meissner30ef8771998-12-11 13:26:26 +0000869dlls/rasapi32/Makefile
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000870dlls/shell32/Makefile
Ulrich Weigand6c6da671999-08-04 09:49:49 +0000871dlls/sound/Makefile
872dlls/stress/Makefile
Andreas Mohr5aa96c11999-03-14 12:34:25 +0000873dlls/tapi32/Makefile
Ulrich Weigandd43a46a1999-01-31 10:11:04 +0000874dlls/ver/Makefile
875dlls/version/Makefile
Ulrich Weigand6c6da671999-08-04 09:49:49 +0000876dlls/win32s/Makefile
Ulrich Weigand4b32fd01999-07-15 14:51:40 +0000877dlls/win87em/Makefile
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000878dlls/winaspi/Makefile
Ulrich Weigand6c6da671999-08-04 09:49:49 +0000879dlls/windebug/Makefile
880dlls/wing/Makefile
Eric Pouech68944c21999-10-24 18:42:42 +0000881dlls/winmm/Makefile
882dlls/winmm/mcianim/Makefile
883dlls/winmm/mciavi/Makefile
884dlls/winmm/mcicda/Makefile
885dlls/winmm/mciseq/Makefile
886dlls/winmm/mciwave/Makefile
Eric Pouechabe72271999-10-31 02:23:49 +0000887dlls/winmm/midimap/Makefile
888dlls/winmm/wavemap/Makefile
Eric Pouech68944c21999-10-24 18:42:42 +0000889dlls/winmm/wineoss/Makefile
Huw D M Daviese39b6761999-05-17 16:20:51 +0000890dlls/winspool/Makefile
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000891dlls/wnaspi32/Makefile
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000892documentation/Makefile
Alexandre Julliardd6baf1b1999-07-18 15:47:22 +0000893documentation/wine.conf.man
Marcus Meissner5a70c971999-06-05 09:00:21 +0000894documentation/wine.man
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000895files/Makefile
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000896graphics/Makefile
Huw D M Davies3a24f3f1999-05-02 10:15:16 +0000897graphics/enhmetafiledrv/Makefile
Alexandre Julliardbf9130a1996-10-13 17:45:47 +0000898graphics/metafiledrv/Makefile
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000899graphics/psdrv/Makefile
Patrik Stridvall24110281999-02-04 10:09:54 +0000900graphics/ttydrv/Makefile
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000901graphics/win16drv/Makefile
902graphics/x11drv/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000903if1632/Makefile
James Juranc70dc831999-02-13 12:18:33 +0000904include/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000905library/Makefile
906libtest/Makefile
907loader/Makefile
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000908loader/ne/Makefile
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000909loader/dos/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000910memory/Makefile
911misc/Makefile
912miscemu/Makefile
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000913msdos/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000914objects/Makefile
Alexandre Julliarde658d821997-11-30 17:45:40 +0000915ole/Makefile
Alexandre Julliard02ed4c21996-03-02 19:34:10 +0000916programs/Makefile
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000917programs/clock/Makefile
Eric Williams30008a01999-02-05 17:40:47 +0000918programs/cmdlgtst/Makefile
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000919programs/control/Makefile
Marcus Meissner32b32d81999-01-29 15:12:10 +0000920programs/avitools/Makefile
Morten Eriksen55bcda81999-09-22 15:22:58 +0000921programs/osversioncheck/Makefile
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000922programs/notepad/Makefile
Alexandre Julliard02ed4c21996-03-02 19:34:10 +0000923programs/progman/Makefile
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000924programs/regtest/Makefile
Sylvain St.Germain1bb0e661999-03-14 14:00:22 +0000925programs/regapi/Makefile
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000926programs/view/Makefile
Dave Pickles74f440e1999-06-06 15:24:04 +0000927programs/wcmd/Makefile
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000928programs/winhelp/Makefile
Alexandre Julliarde658d821997-11-30 17:45:40 +0000929programs/winver/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000930rc/Makefile
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000931relay32/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000932resources/Makefile
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000933scheduler/Makefile
Alexandre Julliard642d3131998-07-12 19:29:36 +0000934server/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000935tools/Makefile
Alexandre Julliarda845b881998-06-01 10:44:35 +0000936tools/wrc/Makefile
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000937tsx11/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000938win32/Makefile
Patrik Stridvallea584721998-11-01 16:22:07 +0000939windows/Makefile
Patrik Stridvallf638aef1998-12-07 09:36:13 +0000940windows/ttydrv/Makefile
Patrik Stridvallea584721998-11-01 16:22:07 +0000941windows/x11drv/Makefile ])
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000942
Ove Kaaven8b4431f1999-01-23 13:59:11 +0000943if test "$have_x" = "no"
944then
945 echo
946 echo "*** Warning: X development files not found. Wine will be built without"
947 echo "*** X support, which currently does not work, and would probably not be"
948 echo "*** what you want anyway. You will need to install devel packages of"
949 echo "*** Xlib/Xfree86 and Xpm at the very least."
Ove Kaaven1eb593c1999-02-14 09:34:46 +0000950elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
951then
952 echo
953 echo "*** Warning: Xpm development files not found. Wine will be built without"
954 echo "*** Xpm support, which currently does not work. You will need to install"
955 echo "*** devel packages of Xpm."
Ove Kaaven8b4431f1999-01-23 13:59:11 +0000956fi
957
Alexandre Julliard638f1691999-01-17 16:32:32 +0000958if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
959then
960 echo
961 echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
962 echo "*** terminal resize support. Consider upgrading ncurses."
Alexandre Julliard638f1691999-01-17 16:32:32 +0000963fi
964
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000965if test "$wine_cv_libc_reentrant" = "no"
966then
967 echo
968 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
969 echo "*** thread support. Consider upgrading libc to a more recent"
970 echo "*** reentrant version of libc."
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000971fi
972
Lionel Ulmer5c085701999-02-28 19:48:53 +0000973if test "$wine_cv_mesa_version_OK" = "no"
974then
975 echo
976 echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
977 echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)"
978fi
979
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000980echo
Steffen Moeller1511bae1999-02-17 15:27:03 +0000981echo "Configure finished. Do 'make depend && make' to compile Wine."
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000982echo
983
984dnl Local Variables:
985dnl comment-start: "dnl "
986dnl comment-end: ""
987dnl comment-start-skip: "\\bdnl\\b\\s *"
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000988dnl compile-command: "autoconf"
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000989dnl End: