Skip to content
Snippets Groups Projects
configure.in 4.03 KiB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
dnl Process this file with autoconf to produce a configure script.
dnl Author: Michael Patra   <micky@marie.physik.tu-berlin.de>
dnl                         <patra@itp1.physik.tu-berlin.de>
AC_REVISION([configure.in 1.00])
AC_INIT(controls/edit.c)		
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_CONFIG_HEADER(include/config.h)
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_CONFIG_AUX_DIR(tools)
Alexandre Julliard's avatar
Alexandre Julliard committed

# We want these before the checks, so the checks can modify their values.
Alexandre Julliard's avatar
Alexandre Julliard committed
test -z "$LDLIBS" && LDLIBS=-lm AC_SUBST(LDLIBS)
Alexandre Julliard's avatar
Alexandre Julliard committed
test -z "$PROGEXT" && PROGEXT="" AC_SUBST(PROGEXT)
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Command-line arguments ****

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl Default values
MAIN_TARGET=emu
LIB_TARGET=libwine.a
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
AC_ARG_ENABLE(emulator,
[  --disable-emulator      build only the Wine library, not the emulator],
[if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi])

AC_ARG_ENABLE(dll,
[  --enable-dll            build the Wine library as a DLL],
[if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi])
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
AC_ARG_WITH(ipc,
Alexandre Julliard's avatar
Alexandre Julliard committed
[  --enable-ipc            use inter-process communication for DDE],
[if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
AC_SUBST(MAIN_TARGET)
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_SUBST(LIB_TARGET)
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_SUBST(OPTIONS)
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Check for some programs and libraries ****
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_MAKE_SET
AC_PROG_CC
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_CPP
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PATH_XTRA
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_YACC
AC_PROG_LEX
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_RANLIB
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_INSTALL
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_LN_S
Alexandre Julliard's avatar
Alexandre Julliard committed
dnl Check for -li386 for NetBSD and OpenBSD
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_CHECK_LIB(i386,i386_set_ldt,LDLIBS="$LDLIBS -li386")

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** If ln -s doesn't work, use cp instead ****
if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Check for gcc strength-reduce bug ****

if test "x${GCC}" = "xyes"
then
  CFLAGS="$CFLAGS -Wall"
  AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
                  AC_TRY_RUN([
int main(void) {
Alexandre Julliard's avatar
Alexandre Julliard committed
  static int Array[[3]];
Alexandre Julliard's avatar
Alexandre Julliard committed
  unsigned int B = 3;
  int i;
Alexandre Julliard's avatar
Alexandre Julliard committed
  for(i=0; i<B; i++) Array[[i]] = i - 3;
  exit( Array[[1]] != -2 );
Alexandre Julliard's avatar
Alexandre Julliard committed
}],
    ac_cv_c_gcc_strength_bug="no",
    ac_cv_c_gcc_strength_bug="yes",
    ac_cv_c_gcc_strength_bug="yes") )
  if test "$ac_cv_c_gcc_strength_bug" = "yes"
  then
    CFLAGS="$CFLAGS -fno-strength-reduce"
  fi
fi

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Check for underscore on external symbols ****

AC_CACHE_CHECK("whether external symbols need an underscore prefix",
               ac_cv_c_extern_prefix,
[saved_libs=$LIBS
LIBS="conftest_asm.s $LIBS"
cat > conftest_asm.s <<EOF
	.globl _ac_test
_ac_test:
	.long 0
EOF
AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
            ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
LIBS=$saved_libs])
if test "$ac_cv_c_extern_prefix" = "yes"
then
  AC_DEFINE(NEED_UNDERSCORE_PREFIX)
fi

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Check for working dll ****

Alexandre Julliard's avatar
Alexandre Julliard committed
DLLFLAGS=""
if test "$LIB_TARGET" = "libwine.so.1.0"
Alexandre Julliard's avatar
Alexandre Julliard committed
then
  AC_CACHE_CHECK("whether we can build a dll",
                 ac_cv_c_dll,
  [saved_cflags=$CFLAGS
  CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
  AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
  CFLAGS=$saved_cflags
  ])
  if test "$ac_cv_c_dll" = "yes"
  then
Alexandre Julliard's avatar
Alexandre Julliard committed
    DLLFLAGS="-fPIC"
Alexandre Julliard's avatar
Alexandre Julliard committed
  else
Alexandre Julliard's avatar
Alexandre Julliard committed
    LIB_TARGET="libwine.a"
Alexandre Julliard's avatar
Alexandre Julliard committed
  fi
fi
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_SUBST(DLLFLAGS)
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Check for functions and header files ****
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
AC_CHECK_FUNCS(memmove tcgetattr usleep wait4 waitpid)
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_HEADER_STAT()
AC_C_CONST()
AC_TYPE_SIZE_T()

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Generate output files ****
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
MAKE_RULES=Make.rules
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_SUBST_FILE(MAKE_RULES)
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
AC_OUTPUT([
Make.rules
Makefile
controls/Makefile
debugger/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
documentation/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
files/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
graphics/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
graphics/metafiledrv/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
graphics/win16drv/Makefile
graphics/x11drv/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
if1632/Makefile
ipc/Makefile
library/Makefile
libtest/Makefile
loader/Makefile
memory/Makefile
misc/Makefile
miscemu/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
msdos/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
multimedia/Makefile
objects/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
ole/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
programs/Makefile
programs/progman/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
programs/winhelp/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
programs/winver/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
rc/Makefile
resources/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
scheduler/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
tools/Makefile
win32/Makefile
windows/Makefile ])
Alexandre Julliard's avatar
Alexandre Julliard committed

echo
echo "Configure finished.  Do 'make depend; make' to compile Wine."
echo

dnl Local Variables:
dnl comment-start: "dnl "
dnl comment-end: ""
dnl comment-start-skip: "\\bdnl\\b\\s *"
Alexandre Julliard's avatar
Alexandre Julliard committed
dnl compile-command: "autoconf"
Alexandre Julliard's avatar
Alexandre Julliard committed
dnl End: