blob: a3e681a2a31f8e945a646dd1d009c52e037f8896 [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.
Alexandre Julliard02e90081998-01-04 17:49:09 +000010LIBS="$LIBS -lm"
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
Uwe Bonnes2a4707a1998-10-11 14:57:08 +000018ALT_LINK=" "
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 Julliard02e90081998-01-04 17:49:09 +000034dnl AC_ARG_WITH(ipc,
35dnl [ --enable-ipc use inter-process communication for DDE],
36dnl [if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
Alexandre Julliardff8331e1995-09-18 11:19:54 +000037
Alexandre Julliardf90efa91998-06-14 15:24:15 +000038AC_ARG_ENABLE(debug,
39[ --disable-debug compile out all debugging messages],
40[if test "$enableval" = "no"; then DEBUG_MSGS="no"; fi])
41
42AC_ARG_ENABLE(trace,
43[ --disable-trace compile out TRACE messages],
44[if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
45
Alexandre Julliarda11d7b11998-03-01 20:05:02 +000046AC_ARG_WITH(reentrant-x,
47[ --without-reentrant-x Compile for use with non-reentrant X libraries])
48
Alexandre Julliard18f92e71996-07-17 20:02:21 +000049AC_SUBST(MAIN_TARGET)
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +000050AC_SUBST(LIB_TARGET)
Uwe Bonnes2a4707a1998-10-11 14:57:08 +000051AC_SUBST(ALT_LINK)
Alexandre Julliard18f92e71996-07-17 20:02:21 +000052AC_SUBST(OPTIONS)
Alexandre Julliardb7258be1995-09-01 15:57:28 +000053
Alexandre Julliardf90efa91998-06-14 15:24:15 +000054if test "$DEBUG_MSGS" = "no"
55then
56 AC_DEFINE(NO_DEBUG_MSGS)
57 AC_DEFINE(NO_TRACE_MSGS)
58else
59 if test "$TRACE_MSGS" = "no"
60 then
61 AC_DEFINE(NO_TRACE_MSGS)
62 fi
63fi
64
Alexandre Julliard02e90081998-01-04 17:49:09 +000065dnl **** Check for some programs ****
Alexandre Julliardff8331e1995-09-18 11:19:54 +000066
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000067AC_PROG_MAKE_SET
68AC_PROG_CC
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000069AC_PROG_CPP
Alexandre Julliardff8331e1995-09-18 11:19:54 +000070AC_PATH_XTRA
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000071AC_PROG_YACC
72AC_PROG_LEX
Alexandre Julliardff8331e1995-09-18 11:19:54 +000073AC_PROG_RANLIB
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000074AC_PROG_INSTALL
Alexandre Julliard641ee761997-08-04 16:34:36 +000075AC_PROG_LN_S
Alexandre Julliardc7c217b1998-04-13 12:21:30 +000076AC_CHECK_PROG(C2MAN,c2man,c2man,true)
Alexandre Julliard02e90081998-01-04 17:49:09 +000077
78dnl **** Check for some libraries ****
79
Alexandre Julliardd37eb361997-07-20 16:23:21 +000080dnl Check for -li386 for NetBSD and OpenBSD
Alexandre Julliard02e90081998-01-04 17:49:09 +000081AC_CHECK_LIB(i386,i386_set_ldt)
82dnl Check for -lw for Solaris
83AC_CHECK_LIB(w,iswalnum)
Patrik Stridvallea584721998-11-01 16:22:07 +000084dnl Check for -lnsl for Solaris
85AC_CHECK_FUNCS(gethostbyname)
86if test "$ac_cv_func_gethostbyname" = "no"
87then
88 AC_CHECK_LIB(nsl,gethostbyname)
89fi
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000090dnl Check for -lxpg4 for FreeBSD
91AC_CHECK_LIB(xpg4,setrunelocale)
Marcus Meissner8220bc91998-10-11 11:10:27 +000092dnl Check for -ldl
93AC_CHECK_LIB(dl,dlopen)
Patrik Stridvallea584721998-11-01 16:22:07 +000094AC_SUBST(XLIB)
95if test "$have_x" = "yes"
96then
97 XLIB="-lXpm -lXext -lX11"
98 dnl Check for -lXpm
99 dnl FIXME: should be done once we can compile without -lXpm
100 dnl AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData,AC_DEFINE(HAVE_LIBXXPM) X_PRE_LIBS="$X_PRE_LIBS -lXpm",,$X_LIBS -lXext -lX11)
101 dnl Check for X Shm extension
102 AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
103 dnl Check for XFree86 DGA extension
104 AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
105else
106 XLIB=""
107 X_CFLAGS=""
108 X_LIBS=""
109fi
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000110
111dnl **** Check for Open Sound System ****
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000112AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000113
114AC_CACHE_CHECK("for Open Sound System",
115 ac_cv_c_opensoundsystem,
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000116 AC_TRY_COMPILE([
117 #ifdef HAVE_SYS_SOUNDCARD_H
118 #include <sys/soundcard.h>
119 #endif
120 #ifdef HAVE_MACHINE_SOUNDCARD_H
121 #include <machine/soundcard.h>
122 #endif
123 ],[
124
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000125/* check for one of the Open Sound System specific SNDCTL_ defines */
126#if !defined(SNDCTL_DSP_STEREO)
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000127#error No open sound system
128#endif
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000129],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
130
131if test "$ac_cv_c_opensoundsystem" = "yes"
132then
133 AC_DEFINE(HAVE_OSS)
134fi
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000135
136dnl **** Check for union semun ****
137
138AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000139 AC_TRY_COMPILE([#include <sys/types.h>
140#include <sys/sem.h>],[union semun foo],
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000141 ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
142if test "$ac_cv_c_union_semun" = "yes"
143then
144 AC_DEFINE(HAVE_UNION_SEMUN)
145fi
Alexandre Julliard902da691995-11-05 14:39:02 +0000146
Alexandre Julliard641ee761997-08-04 16:34:36 +0000147dnl **** If ln -s doesn't work, use cp instead ****
148if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
149
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000150dnl **** Check for gcc strength-reduce bug ****
151
152if test "x${GCC}" = "xyes"
153then
154 CFLAGS="$CFLAGS -Wall"
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000155 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
156 AC_TRY_RUN([
157int main(void) {
Alexandre Julliardd2e1c1a1996-03-09 16:12:43 +0000158 static int Array[[3]];
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000159 unsigned int B = 3;
160 int i;
Alexandre Julliardd2e1c1a1996-03-09 16:12:43 +0000161 for(i=0; i<B; i++) Array[[i]] = i - 3;
162 exit( Array[[1]] != -2 );
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000163}],
164 ac_cv_c_gcc_strength_bug="no",
165 ac_cv_c_gcc_strength_bug="yes",
166 ac_cv_c_gcc_strength_bug="yes") )
167 if test "$ac_cv_c_gcc_strength_bug" = "yes"
168 then
169 CFLAGS="$CFLAGS -fno-strength-reduce"
170 fi
171fi
172
Alexandre Julliard8cc3a5e1996-08-11 15:49:51 +0000173dnl **** Check for underscore on external symbols ****
174
175AC_CACHE_CHECK("whether external symbols need an underscore prefix",
176 ac_cv_c_extern_prefix,
177[saved_libs=$LIBS
178LIBS="conftest_asm.s $LIBS"
179cat > conftest_asm.s <<EOF
180 .globl _ac_test
181_ac_test:
182 .long 0
183EOF
184AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
185 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
186LIBS=$saved_libs])
187if test "$ac_cv_c_extern_prefix" = "yes"
188then
189 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
190fi
191
Alexandre Julliard0623a6f1998-01-18 18:01:49 +0000192dnl **** Check for .string in assembler ****
193
194AC_CACHE_CHECK("whether assembler accepts .string",
195 ac_cv_c_asm_string,
196[saved_libs=$LIBS
197LIBS="conftest_asm.s $LIBS"
198cat > conftest_asm.s <<EOF
199 .string "test"
200EOF
201AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
202LIBS=$saved_libs])
203if test "$ac_cv_c_asm_string" = "yes"
204then
205 AC_DEFINE(HAVE_ASM_STRING)
206fi
207
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000208dnl **** Check for working dll ****
209
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000210DLLFLAGS=""
211if test "$LIB_TARGET" = "libwine.so.1.0"
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000212then
213 AC_CACHE_CHECK("whether we can build a dll",
214 ac_cv_c_dll,
215 [saved_cflags=$CFLAGS
216 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
217 AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
218 CFLAGS=$saved_cflags
219 ])
220 if test "$ac_cv_c_dll" = "yes"
221 then
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000222 DLLFLAGS="-fPIC"
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000223 else
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000224 LIB_TARGET="libwine.a"
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000225 fi
226fi
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000227AC_SUBST(DLLFLAGS)
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000228
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000229dnl **** Check for reentrant libc ****
230dnl
231dnl For cross-compiling we blindly assume that libc is reentrant. This is
232dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
233
234AC_CACHE_CHECK("for reentrant libc", wine_cv_libc_reentrant,
235 [AC_TRY_RUN([int myerrno = 0;
236char buf[256];
237int *__errno_location(){return &myerrno;}
238main(){connect(0,buf,255); exit(!myerrno);}],
239 wine_cv_libc_reentrant=yes, wine_cv_libc_reentrant=no,
240 wine_cv_libc_reentrant=yes ) ] )
241if test "$wine_cv_libc_reentrant" = "no"
242then
243 AC_DEFINE(NO_REENTRANT_LIBC)
244fi
245
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000246dnl **** Check for reentrant X libraries ****
247dnl
248dnl This may fail to determine whether X libraries are reentrant if
249dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
250dnl is possible with the --without-reentrant-x option.
251
252AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
253 [ if test "x$with_reentrant_x" = "xno"
254 then
255 wine_cv_x_reentrant=no
256 else
257 libX11_ckeck=none
258 for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
Alexandre Julliard829fe321998-07-26 14:27:39 +0000259 if test -r $dir/libX11.so; then
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000260 libX11_check="-D $dir/libX11.so"
261 break 1
262 fi
Alexandre Julliard829fe321998-07-26 14:27:39 +0000263 if test -r $dir/libX11.a; then
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000264 libX11_check="$dir/libX11.a"
265 break 1
266 fi
267 done
268 if test "$libX11_check" != "none"; then
Alexandre Julliard829fe321998-07-26 14:27:39 +0000269 if nm $libX11_check | grep __errno_location >/dev/null 2>&1
270 then
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000271 wine_cv_x_reentrant=yes
272 else
273 wine_cv_x_reentrant=no
274 fi
275 else
276 wine_cv_x_reentrant=unknown
277 fi
278 fi ] )
279if test "$wine_cv_x_reentrant" = "no"
280then
281 AC_DEFINE(NO_REENTRANT_X11)
282fi
283
Alexandre Julliard902da691995-11-05 14:39:02 +0000284dnl **** Check for functions and header files ****
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000285
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000286AC_CHECK_FUNCS(clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
Stephen Langasekdc163421998-11-08 15:42:40 +0000287AC_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 dlfcn.h unistd.h sys/sockio.h net/if.h netinet/in.h linux/ipx.h)
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000288AC_HEADER_STAT()
289AC_C_CONST()
290AC_TYPE_SIZE_T()
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000291AC_CHECK_SIZEOF(long long,0)
292
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000293dnl **** Check for sendmsg in -lsocket if not found above ****
294
295if test $ac_cv_func_sendmsg = no; then
296 AC_CHECK_LIB(socket,sendmsg)
297fi
298
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000299dnl **** statfs checks ****
300
301if test "$ac_cv_header_sys_vfs_h" = "yes"
302then
303 AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
304 wine_cv_sys_vfs_has_statfs,
305 AC_TRY_COMPILE([
306 #include <sys/types.h>
307 #ifdef HAVE_SYS_PARAM_H
308 # include <sys/param.h>
309 #endif
310 #include <sys/vfs.h>
311 ],[
312 struct statfs stfs;
313
314 memset(&stfs,0,sizeof(stfs));
315 ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
316 )
317 )
318 if test "$wine_cv_sys_vfs_has_statfs" = "yes"
319 then
320 AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
321 fi
322fi
323
324if test "$ac_cv_header_sys_statfs_h" = "yes"
325then
326 AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
327 wine_cv_sys_statfs_has_statfs,
328 AC_TRY_COMPILE([
329 #include <sys/types.h>
330 #ifdef HAVE_SYS_PARAM_H
331 # include <sys/param.h>
332 #endif
333 #include <sys/statfs.h>
334 ],[
335 struct statfs stfs;
336 ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
337 )
338 )
339 if test "$wine_cv_sys_statfs_has_statfs" = "yes"
340 then
341 AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
342 fi
343fi
344
345if test "$ac_cv_header_sys_mount_h" = "yes"
346then
347 AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
348 wine_cv_sys_mount_has_statfs,
349 AC_TRY_COMPILE([
350 #include <sys/types.h>
351 #ifdef HAVE_SYS_PARAM_H
352 # include <sys/param.h>
353 #endif
354 #include <sys/mount.h>
355 ],[
356 struct statfs stfs;
357 ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
358 )
359 )
360 if test "$wine_cv_sys_mount_has_statfs" = "yes"
361 then
362 AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
363 fi
364fi
365
366dnl **** FIXME: what about mixed cases, where we need two of them? ***
367
368AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
369 [ if test "x$statfs_bfree" = "xno"
370 then
371 wine_cv_statfs_bfree=no
372 else
373 AC_TRY_COMPILE([
374 #include <sys/types.h>
375 #ifdef HAVE_SYS_PARAM_H
376 # include <sys/param.h>
377 #endif
378 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
379 # include <sys/mount.h>
380 #else
381 # ifdef STATFS_DEFINED_BY_SYS_VFS
382 # include <sys/vfs.h>
383 # else
384 # ifdef STATFS_DEFINED_BY_SYS_STATFS
385 # include <sys/statfs.h>
386 # endif
387 # endif
388 #endif
389 ],[
390 struct statfs stfs;
391
392 stfs.f_bfree++;
393 ],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
394 )
395 fi ] )
396if test "$wine_cv_statfs_bfree" = "yes"
397then
398 AC_DEFINE(STATFS_HAS_BFREE)
399fi
400
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000401AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
402 [ if test "x$statfs_bavail" = "xno"
403 then
404 wine_cv_statfs_bavail=no
405 else
406 AC_TRY_COMPILE([
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000407 #include <sys/types.h>
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000408 #ifdef HAVE_SYS_PARAM_H
409 # include <sys/param.h>
410 #endif
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000411 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000412 # include <sys/mount.h>
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000413 #else
414 # ifdef STATFS_DEFINED_BY_SYS_VFS
415 # include <sys/vfs.h>
416 # else
417 # ifdef STATFS_DEFINED_BY_SYS_STATFS
418 # include <sys/statfs.h>
419 # endif
420 # endif
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000421 #endif
422 ],[
423 struct statfs stfs;
424
425 stfs.f_bavail++;
426 ],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
427 )
428 fi ] )
429if test "$wine_cv_statfs_bavail" = "yes"
430then
431 AC_DEFINE(STATFS_HAS_BAVAIL)
432fi
433
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000434dnl *** check for working sigaltstack
435dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
436
437AC_CACHE_CHECK("for working sigaltstack",
438 ac_cv_c_working_sigaltstack,
439 AC_TRY_RUN([
440 #include <stdio.h>
441 #include <time.h> /* <sys/time.h> ? bad magic without end */
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000442 #include <sys/types.h>
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000443 #include <sys/signal.h>
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000444 #ifdef HAVE_SYS_PARAM_H
445 # include <sys/param.h>
446 #endif
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000447 #ifdef HAVE_SYSCALL_H
448 # include <syscall.h>
449 #else
450 # ifdef HAVE_SYS_SYSCALL_H
451 # include <sys/syscall.h>
452 # endif
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000453 #endif
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000454
455 unsigned char *xaltstack;
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000456
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000457 int
458 main(int argc,char **argv) {
459 struct sigaltstack ss;
460
461 xaltstack = malloc(16384);
462 ss.ss_sp = xaltstack;
463 ss.ss_size = 16384;
464 ss.ss_flags = 0;
465 if (sigaltstack(&ss, NULL) < 0) {
466 /* this catches the glibc case */
467 perror("sigaltstack");
468 return (1); /* aka exit(1) aka fail */
469 }
470 /* assume it works. */
471 return 0; /* OK */
472 }
473 ],
474 ac_cv_c_working_sigaltstack="yes",
475 ac_cv_c_working_sigaltstack="no",
476 ac_cv_c_working_sigaltstack="no"
477))
478
479if test "$ac_cv_c_working_sigaltstack" = "yes"
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000480then
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000481 AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000482fi
483
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000484
Alexandre Julliard829fe321998-07-26 14:27:39 +0000485dnl *** check for file descriptor passing with msg_accrights
486
487AC_CACHE_CHECK("for msg_accrights in struct msghdr", ac_cv_c_msg_accrights,
488 AC_TRY_COMPILE([#include <sys/types.h>
489#include <sys/socket.h>],[struct msghdr hdr; hdr.msg_accrights=0],
490 ac_cv_c_msg_accrights="yes", ac_cv_c_msg_accrights="no"))
491if test "$ac_cv_c_msg_accrights" = "yes"
492then
493 AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
494fi
495
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000496dnl **** Generate output files ****
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000497
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000498MAKE_RULES=Make.rules
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000499AC_SUBST_FILE(MAKE_RULES)
500
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000501AC_OUTPUT([
502Make.rules
503Makefile
504controls/Makefile
505debugger/Makefile
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000506dlls/Makefile
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000507dlls/comctl32/Makefile
Patrik Stridvall8295c861998-10-11 17:09:05 +0000508dlls/imagehlp/Makefile
509dlls/msacm/Makefile
510dlls/msacm32/Makefile
Marcus Meissner51505b11998-11-01 14:00:21 +0000511dlls/ntdll/Makefile
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000512dlls/psapi/Makefile
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000513dlls/shell32/Makefile
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000514dlls/winaspi/Makefile
515dlls/wnaspi32/Makefile
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000516documentation/Makefile
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000517files/Makefile
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000518graphics/Makefile
Alexandre Julliardbf9130a1996-10-13 17:45:47 +0000519graphics/metafiledrv/Makefile
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000520graphics/psdrv/Makefile
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000521graphics/win16drv/Makefile
522graphics/x11drv/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000523if1632/Makefile
524ipc/Makefile
525library/Makefile
526libtest/Makefile
527loader/Makefile
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000528loader/ne/Makefile
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000529loader/dos/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000530memory/Makefile
531misc/Makefile
532miscemu/Makefile
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000533msdos/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000534multimedia/Makefile
535objects/Makefile
Alexandre Julliarde658d821997-11-30 17:45:40 +0000536ole/Makefile
Alexandre Julliard02ed4c21996-03-02 19:34:10 +0000537programs/Makefile
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000538programs/clock/Makefile
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000539programs/control/Makefile
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000540programs/notepad/Makefile
Alexandre Julliard02ed4c21996-03-02 19:34:10 +0000541programs/progman/Makefile
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000542programs/regtest/Makefile
Alexandre Julliarda11d7b11998-03-01 20:05:02 +0000543programs/view/Makefile
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000544programs/winhelp/Makefile
Alexandre Julliarde658d821997-11-30 17:45:40 +0000545programs/winver/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000546rc/Makefile
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000547relay32/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000548resources/Makefile
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000549scheduler/Makefile
Alexandre Julliard642d3131998-07-12 19:29:36 +0000550server/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000551tools/Makefile
Alexandre Julliarda845b881998-06-01 10:44:35 +0000552tools/wrc/Makefile
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000553tsx11/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000554win32/Makefile
Patrik Stridvallea584721998-11-01 16:22:07 +0000555windows/Makefile
556windows/x11drv/Makefile ])
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000557
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000558if test "$wine_cv_libc_reentrant" = "no"
559then
560 echo
561 echo "*** Warning: non-reentrant libc detected. Wine will be build without"
562 echo "*** thread support. Consider upgrading libc to a more recent"
563 echo "*** reentrant version of libc."
564 echo
565fi
566
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000567echo
568echo "Configure finished. Do 'make depend; make' to compile Wine."
569echo
570
571dnl Local Variables:
572dnl comment-start: "dnl "
573dnl comment-end: ""
574dnl comment-start-skip: "\\bdnl\\b\\s *"
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000575dnl compile-command: "autoconf"
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000576dnl End: