blob: 530f1917e6f943b6f4a194acc349a61ffe94f06f [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 Julliard902da691995-11-05 14:39:02 +000010test -z "$LDLIBS" && LDLIBS=-lm AC_SUBST(LDLIBS)
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
15AC_ARG_WITH(library,
16[ --with-library build Wine as a library instead of an emulator],
Alexandre Julliard18f92e71996-07-17 20:02:21 +000017[OPTIONS="-DWINELIB" MAIN_TARGET="libwine.a"],
18[OPTIONS="" MAIN_TARGET="wine"])
Alexandre Julliard7e56f681996-01-31 19:02:28 +000019
20AC_ARG_WITH(dll,
21[ --with-dll build Wine as a DLL instead of an emulator],
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +000022[OPTIONS="-DWINELIB" MAIN_TARGET="libwine.so.1.0"])
Alexandre Julliardff8331e1995-09-18 11:19:54 +000023
Alexandre Julliardb7258be1995-09-01 15:57:28 +000024AC_ARG_WITH(ipc,
25[ --with-ipc use inter-process communication for DDE],
Alexandre Julliard18f92e71996-07-17 20:02:21 +000026[OPTIONS="$OPTIONS -DCONFIG_IPC"])
Alexandre Julliardff8331e1995-09-18 11:19:54 +000027
Alexandre Julliard18f92e71996-07-17 20:02:21 +000028AC_SUBST(MAIN_TARGET)
29AC_SUBST(OPTIONS)
Alexandre Julliardb7258be1995-09-01 15:57:28 +000030
Alexandre Julliard902da691995-11-05 14:39:02 +000031dnl **** Check for some programs and libraries ****
Alexandre Julliardff8331e1995-09-18 11:19:54 +000032
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000033AC_PROG_MAKE_SET
34AC_PROG_CC
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000035AC_PROG_CPP
Alexandre Julliardff8331e1995-09-18 11:19:54 +000036AC_PATH_XTRA
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000037AC_PROG_YACC
38AC_PROG_LEX
Alexandre Julliardff8331e1995-09-18 11:19:54 +000039AC_PROG_RANLIB
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000040AC_PROG_INSTALL
Alexandre Julliardd37eb361997-07-20 16:23:21 +000041dnl Check for -li386 for NetBSD and OpenBSD
Alexandre Julliard902da691995-11-05 14:39:02 +000042AC_CHECK_LIB(i386,i386_set_ldt,LDLIBS="$LDLIBS -li386")
43
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +000044dnl **** Check for gcc strength-reduce bug ****
45
46if test "x${GCC}" = "xyes"
47then
48 CFLAGS="$CFLAGS -Wall"
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +000049 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
50 AC_TRY_RUN([
51int main(void) {
Alexandre Julliardd2e1c1a1996-03-09 16:12:43 +000052 static int Array[[3]];
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +000053 unsigned int B = 3;
54 int i;
Alexandre Julliardd2e1c1a1996-03-09 16:12:43 +000055 for(i=0; i<B; i++) Array[[i]] = i - 3;
56 exit( Array[[1]] != -2 );
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +000057}],
58 ac_cv_c_gcc_strength_bug="no",
59 ac_cv_c_gcc_strength_bug="yes",
60 ac_cv_c_gcc_strength_bug="yes") )
61 if test "$ac_cv_c_gcc_strength_bug" = "yes"
62 then
63 CFLAGS="$CFLAGS -fno-strength-reduce"
64 fi
65fi
66
Alexandre Julliard8cc3a5e1996-08-11 15:49:51 +000067dnl **** Check for underscore on external symbols ****
68
69AC_CACHE_CHECK("whether external symbols need an underscore prefix",
70 ac_cv_c_extern_prefix,
71[saved_libs=$LIBS
72LIBS="conftest_asm.s $LIBS"
73cat > conftest_asm.s <<EOF
74 .globl _ac_test
75_ac_test:
76 .long 0
77EOF
78AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
79 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
80LIBS=$saved_libs])
81if test "$ac_cv_c_extern_prefix" = "yes"
82then
83 AC_DEFINE(NEED_UNDERSCORE_PREFIX)
84fi
85
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +000086dnl **** Check for working dll ****
87
88if test "$MAIN_TARGET" = "libwine.so.1.0"
89then
90 AC_CACHE_CHECK("whether we can build a dll",
91 ac_cv_c_dll,
92 [saved_cflags=$CFLAGS
93 CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
94 AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
95 CFLAGS=$saved_cflags
96 ])
97 if test "$ac_cv_c_dll" = "yes"
98 then
99 CFLAGS="$CFLAGS -fPIC"
100 else
101 MAIN_TARGET="libwine.a"
102 fi
103fi
104
Alexandre Julliard902da691995-11-05 14:39:02 +0000105dnl **** Check for functions and header files ****
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000106
Alexandre Julliard21979011997-03-05 08:22:35 +0000107AC_CHECK_FUNCS(memmove tcgetattr usleep wait4 waitpid)
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000108AC_HEADER_STAT()
109AC_C_CONST()
110AC_TYPE_SIZE_T()
111
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000112dnl **** Generate output files ****
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000113
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000114MAKE_RULES=Make.rules
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000115AC_SUBST_FILE(MAKE_RULES)
116
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000117AC_OUTPUT([
118Make.rules
119Makefile
120controls/Makefile
121debugger/Makefile
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000122documentation/Makefile
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000123files/Makefile
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000124graphics/Makefile
Alexandre Julliardbf9130a1996-10-13 17:45:47 +0000125graphics/metafiledrv/Makefile
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000126graphics/win16drv/Makefile
127graphics/x11drv/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000128if1632/Makefile
129ipc/Makefile
130library/Makefile
131libtest/Makefile
132loader/Makefile
133memory/Makefile
134misc/Makefile
135miscemu/Makefile
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000136msdos/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000137multimedia/Makefile
138objects/Makefile
Alexandre Julliard02ed4c21996-03-02 19:34:10 +0000139programs/Makefile
140programs/progman/Makefile
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000141programs/winhelp/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000142rc/Makefile
143resources/Makefile
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000144scheduler/Makefile
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000145tools/Makefile
146win32/Makefile
147windows/Makefile ])
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000148
149echo
150echo "Configure finished. Do 'make depend; make' to compile Wine."
151echo
152
153dnl Local Variables:
154dnl comment-start: "dnl "
155dnl comment-end: ""
156dnl comment-start-skip: "\\bdnl\\b\\s *"
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000157dnl compile-command: "autoconf"
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000158dnl End: