Skip to content
Snippets Groups Projects
configure.ac 45.7 KiB
Newer Older
	sys/poll.h \
	sys/sockio.h \
	sys/statfs.h \
	sys/strtio.h \
	sys/syscall.h \
	sys/sysctl.h \
	sys/times.h \
Alexandre Julliard's avatar
Alexandre Julliard committed
	termios.h \
	utime.h \
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_HEADER_STAT()
dnl *** Check for net/if.h
AC_CHECK_HEADERS(net/if.h,,,
    [#if HAVE_SYS_TYPES_H
     # include <sys/types.h>
     #endif
     #if HAVE_SYS_SOCKET_H
     # include <sys/socket.h>
     #endif])

dnl *** Check for netinet/ip.h
AC_CHECK_HEADERS(netinet/ip.h,,,
    [#if HAVE_SYS_SOCKET_H
     # include <sys/socket.h>
     #endif
     #if HAVE_NETINET_IN_SYSTM_H
     # include <netinet/in_systm.h>
     #endif])

dnl *** Check for resolv.h
AC_CHECK_HEADERS(resolv.h,,,
    [#if HAVE_SYS_SOCKET_H
     # include <sys/socket.h>
     #endif])

dnl **** Check for types ****

AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t])
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_CHECK_SIZEOF(long long,0)

AC_CACHE_CHECK([whether linux/input.h is for real],
	wine_cv_linux_input_h,
	AC_TRY_COMPILE([
	    #include <linux/input.h>
	] , [
	    int foo = EVIOCGBIT(EV_ABS,42);
	    int bar = BTN_PINKIE;
	    int fortytwo = 42;
	],
	wine_cv_linux_input_h=yes,
	wine_cv_linux_input_h=no,
	no
	)
    )
    if test "$wine_cv_linux_input_h" = "yes"
    then
        AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H, 1,
                  [Define if we have linux/input.h AND it contains the INPUT event API])
AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
   	wine_cv_linux_gethostbyname_r_6,
	AC_TRY_COMPILE([
#include <netdb.h>
	], [
    char *name=NULL;
    struct hostent he;
    struct hostent *result;
    char *buf=NULL;
    int bufsize=0;
    int res,errnr;
    char *addr=NULL;
    int addrlen=0;
    int addrtype=0;
    res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
    res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
    ],
	wine_cv_linux_gethostbyname_r_6=yes,
	wine_cv_linux_gethostbyname_r_6=no
	)
   )
   if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
   then
      AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6, 1,
                [Define if Linux-style gethostbyname_r and gethostbyaddr_r are available])
if test "$ac_cv_header_linux_joystick_h" = "yes"
then
   AC_CACHE_CHECK([whether linux/joystick.h uses the Linux 2.2+ API],
   	wine_cv_linux_joystick_22_api,
	AC_TRY_COMPILE([
	#include <sys/ioctl.h>
	#include <linux/joystick.h>

	struct js_event blub;
	#if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
	#error "no 2.2 header"
	#endif
	],/*empty*/,
	wine_cv_linux_joystick_22_api=yes,
	wine_cv_linux_joystick_22_api=no,
	wine_cv_linux_joystick_22_api=no
	)
   )
   if test "$wine_cv_linux_joystick_22_api" = "yes"
      AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API, 1,
                [Define if <linux/joystick.h> defines the Linux 2.2 joystick API])
Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** statfs checks ****

if test "$ac_cv_header_sys_vfs_h" = "yes"
then
    AC_CACHE_CHECK( [whether sys/vfs.h defines statfs],
Alexandre Julliard's avatar
Alexandre Julliard committed
		    wine_cv_sys_vfs_has_statfs,
	AC_TRY_COMPILE([
Alexandre Julliard's avatar
Alexandre Julliard committed
	#include <sys/types.h>
Alexandre Julliard's avatar
Alexandre Julliard committed
	#ifdef HAVE_SYS_PARAM_H
	# include <sys/param.h>
	#endif
Alexandre Julliard's avatar
Alexandre Julliard committed
	#include <sys/vfs.h>
Alexandre Julliard's avatar
Alexandre Julliard committed
	],[
		struct statfs stfs;

Alexandre Julliard's avatar
Alexandre Julliard committed
		memset(&stfs,0,sizeof(stfs));
	],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
Alexandre Julliard's avatar
Alexandre Julliard committed
	)
Alexandre Julliard's avatar
Alexandre Julliard committed
    )
    if test "$wine_cv_sys_vfs_has_statfs" = "yes"
    then
      AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS, 1,
                [Define if the struct statfs is defined by <sys/vfs.h>])
Alexandre Julliard's avatar
Alexandre Julliard committed
    fi
fi

if test "$ac_cv_header_sys_statfs_h" = "yes"
Alexandre Julliard's avatar
Alexandre Julliard committed
then
    AC_CACHE_CHECK( [whether sys/statfs.h defines statfs],
Alexandre Julliard's avatar
Alexandre Julliard committed
		    wine_cv_sys_statfs_has_statfs,
	AC_TRY_COMPILE([
	#include <sys/types.h>
	#ifdef HAVE_SYS_PARAM_H
	# include <sys/param.h>
	#endif
	#include <sys/statfs.h>
	],[
		struct statfs stfs;
	],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
	)
    )
    if test "$wine_cv_sys_statfs_has_statfs" = "yes"
    then
      AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS, 1,
                [Define if the struct statfs is defined by <sys/statfs.h>])
Alexandre Julliard's avatar
Alexandre Julliard committed
    fi
fi

if test "$ac_cv_header_sys_mount_h" = "yes"
then
    AC_CACHE_CHECK( [whether sys/mount.h defines statfs],
Alexandre Julliard's avatar
Alexandre Julliard committed
		    wine_cv_sys_mount_has_statfs,
	AC_TRY_COMPILE([
	#include <sys/types.h>
	#ifdef HAVE_SYS_PARAM_H
	# include <sys/param.h>
	#endif
	#include <sys/mount.h>
	],[
		struct statfs stfs;
	],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
	)
    )
    if test "$wine_cv_sys_mount_has_statfs" = "yes"
    then
      AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT, 1,
                [Define if the struct statfs is defined by <sys/mount.h>])
Alexandre Julliard's avatar
Alexandre Julliard committed
    fi
dnl **** FIXME: what about mixed cases, where we need two of them? ***
WINE_CHECK_STRUCT_MEMBER(statfs,f_bfree,
[#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef STATFS_DEFINED_BY_SYS_MOUNT
# include <sys/mount.h>
#else
# ifdef STATFS_DEFINED_BY_SYS_VFS
#  include <sys/vfs.h>
# else
#  ifdef STATFS_DEFINED_BY_SYS_STATFS
#   include <sys/statfs.h>
#  endif
# endif
#endif],
    [AC_DEFINE(STATFS_HAS_BFREE, 1, [Define if the struct statfs has the member bfree])])
WINE_CHECK_STRUCT_MEMBER(statfs,f_bavail,
[#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef STATFS_DEFINED_BY_SYS_MOUNT
# include <sys/mount.h>
#else
# ifdef STATFS_DEFINED_BY_SYS_VFS
#  include <sys/vfs.h>
# else
#  ifdef STATFS_DEFINED_BY_SYS_STATFS
#   include <sys/statfs.h>
#  endif
# endif
#endif],
    [AC_DEFINE(STATFS_HAS_BAVAIL, 1, [Define if the struct statfs has the member bavail])])

dnl Check for file descriptor passing with msg_accrights
WINE_CHECK_STRUCT_MEMBER(msghdr,msg_accrights,
[#include <sys/types.h>
#include <sys/socket.h>],
    [AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS, 1, [Define if struct msghdr contains msg_accrights])])

dnl Check for the sa_len member in struct sockaddr
WINE_CHECK_STRUCT_MEMBER(sockaddr,sa_len,
[#include <sys/types.h>
#include <sys/socket.h>],
    [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if struct sockaddr contains sa_len])])

dnl Check for the sun_len member in struct sockaddr_un
WINE_CHECK_STRUCT_MEMBER(sockaddr_un,sun_len,
[#include <sys/types.h>
#include <sys/un.h>],
    [AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un contains sun_len])])
dnl *** check for the need to define __i386__

  *i[3456789]86* )
    AC_CACHE_CHECK([whether we need to define __i386__],ac_cv_cpp_def_i386,
      AC_EGREP_CPP(yes,[#ifndef __i386__
yes
#endif],
 ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
if test "$ac_cv_cpp_def_i386" = "yes"
then
    CFLAGS="$CFLAGS -D__i386__"
    LINTFLAGS="$LINTFLAGS -D__i386__"
dnl *** check for the need to define __sparc__

case $host_cpu in
  *sparc* )
    AC_CACHE_CHECK([whether we need to define __sparc__],ac_cv_cpp_def_sparc,
      AC_EGREP_CPP(yes,[#ifndef __sparc__
yes
#endif],
 ac_cv_cpp_def_sparc="yes", ac_cv_cpp_def_sparc="no"))
    ;;
esac
if test "$ac_cv_cpp_def_sparc" = "yes"
then
    CFLAGS="$CFLAGS -D__sparc__"
    LINTFLAGS="$LINTFLAGS -D__sparc__"
fi

dnl *** check for the need to define __sun__

case $host_vendor in
  *sun* )
    AC_CACHE_CHECK([whether we need to define __sun__],ac_cv_cpp_def_sun,
      AC_EGREP_CPP(yes,[#ifndef __sun__
yes
#endif],
 ac_cv_cpp_def_sun="yes", ac_cv_cpp_def_sun="no"))
    ;;
esac
if test "$ac_cv_cpp_def_sun" = "yes"
then
    CFLAGS="$CFLAGS -D__sun__"
    LINTFLAGS="$LINTFLAGS -D__sun__"
fi

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Generate output files ****
WINE_CONFIG_EXTRA_DIR(dlls/ddraw/d3ddevice)
WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dclipper)
WINE_CONFIG_EXTRA_DIR(dlls/ddraw/ddraw)
WINE_CONFIG_EXTRA_DIR(dlls/ddraw/direct3d)
WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dpalette)
WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dsurface)
WINE_CONFIG_EXTRA_DIR(dlls/dinput/joystick)
WINE_CONFIG_EXTRA_DIR(dlls/dinput/keyboard)
WINE_CONFIG_EXTRA_DIR(dlls/dinput/mouse)
WINE_CONFIG_EXTRA_DIR(dlls/gdi/enhmfdrv)
WINE_CONFIG_EXTRA_DIR(dlls/gdi/mfdrv)
WINE_CONFIG_EXTRA_DIR(dlls/gdi/win16drv)
WINE_CONFIG_EXTRA_DIR(dlls/kernel/messages)
WINE_CONFIG_EXTRA_DIR(dlls/user/dde)
WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
WINE_CONFIG_EXTRA_DIR(files)
WINE_CONFIG_EXTRA_DIR(graphics)
WINE_CONFIG_EXTRA_DIR(graphics/x11drv)
WINE_CONFIG_EXTRA_DIR(if1632)
WINE_CONFIG_EXTRA_DIR(loader)
WINE_CONFIG_EXTRA_DIR(loader/ne)
WINE_CONFIG_EXTRA_DIR(memory)
WINE_CONFIG_EXTRA_DIR(misc)
WINE_CONFIG_EXTRA_DIR(msdos)
WINE_CONFIG_EXTRA_DIR(objects)
WINE_CONFIG_EXTRA_DIR(programs/regapi/tests)
WINE_CONFIG_EXTRA_DIR(programs/regedit/tests)
WINE_CONFIG_EXTRA_DIR(programs/winetest/tests)
WINE_CONFIG_EXTRA_DIR(relay32)
WINE_CONFIG_EXTRA_DIR(scheduler)
WINE_CONFIG_EXTRA_DIR(win32)
WINE_CONFIG_EXTRA_DIR(windows)
Alexandre Julliard's avatar
Alexandre Julliard committed
MAKE_RULES=Make.rules
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_SUBST_FILE(MAKE_RULES)
MAKE_DLL_RULES=dlls/Makedll.rules
AC_SUBST_FILE(MAKE_DLL_RULES)

MAKE_TEST_RULES=dlls/Maketest.rules
AC_SUBST_FILE(MAKE_TEST_RULES)

MAKE_PROG_RULES=programs/Makeprog.rules
AC_SUBST_FILE(MAKE_PROG_RULES)

Alexandre Julliard's avatar
Alexandre Julliard committed
Make.rules
Alexandre Julliard's avatar
Alexandre Julliard committed
Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
dlls/Makefile
dlls/advapi32/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
dlls/comctl32/Makefile
dlls/crtdll/Makefile
dlls/crypt32/Makefile
dlls/d3d8/Makefile
dlls/dciman32/Makefile
dlls/ddraw/Makefile
dlls/dinput/Makefile
dlls/dinput8/Makefile
dlls/gdi/tests/Makefile
dlls/glu32/Makefile
dlls/icmp/Makefile
dlls/imm32/Makefile
dlls/kernel/Makefile
dlls/lzexpand/Makefile
dlls/msacm/imaadp32/Makefile
dlls/msacm/msadp32/Makefile
dlls/msacm/msg711/Makefile
dlls/msacm/winemp3/Makefile
dlls/msimg32/Makefile
dlls/msisys/Makefile
dlls/msnet32/Makefile
dlls/msvcrt/Makefile
dlls/msvcrt/tests/Makefile
dlls/msvcrt20/Makefile
dlls/msvideo/Makefile
dlls/msvideo/msrle32/Makefile
dlls/netapi32/Makefile
dlls/ntdll/tests/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
dlls/odbc32/Makefile
dlls/ole32/Makefile
dlls/oleaut32/Makefile
dlls/olecli/Makefile
dlls/oledlg/Makefile
Sean Langley's avatar
Sean Langley committed
dlls/olepro32/Makefile
Lionel Ulmer's avatar
Lionel Ulmer committed
dlls/opengl32/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
dlls/psapi/Makefile
dlls/quartz/Makefile
dlls/rasapi32/Makefile
dlls/richedit/Makefile
Huw D. M. Davies's avatar
Huw D. M. Davies committed
dlls/rpcrt4/Makefile
dlls/shdocvw/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
dlls/shell32/Makefile
dlls/shfolder/Makefile
dlls/shlwapi/Makefile
dlls/snmpapi/Makefile
dlls/tapi32/Makefile
dlls/twain/Makefile
dlls/version/Makefile
dlls/win32s/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
dlls/winaspi/Makefile
dlls/wineps/Makefile
dlls/winmm/joystick/Makefile
dlls/winmm/mcianim/Makefile
dlls/winmm/mciavi/Makefile
dlls/winmm/mcicda/Makefile
dlls/winmm/mciseq/Makefile
dlls/winmm/mciwave/Makefile
dlls/winmm/midimap/Makefile
dlls/winmm/wavemap/Makefile
Chris Morgan's avatar
Chris Morgan committed
dlls/winmm/winearts/Makefile
dlls/winmm/wineaudioio/Makefile
dlls/winmm/winenas/Makefile
dlls/winmm/wineoss/Makefile
dlls/winnls/Makefile
dlls/winsock/Makefile
dlls/wow32/Makefile
dlls/wsock32/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
documentation/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
library/Makefile
miscemu/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
ole/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
programs/Makefile
programs/avitools/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
programs/clock/Makefile
programs/cmdlgtst/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
programs/control/Makefile
programs/expand/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
programs/notepad/Makefile
programs/osversioncheck/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
programs/progman/Makefile
programs/regapi/Makefile
programs/regedit/Makefile
programs/regtest/Makefile
programs/uninstaller/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
programs/view/Makefile
programs/wcmd/Makefile
programs/wineconsole/Makefile
Joshua Thielen's avatar
Joshua Thielen committed
programs/winemine/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
server/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
tools/Makefile
tools/winapi/Makefile
tools/winebuild/Makefile
tools/wmc/Makefile
if test "$have_x" = "no"
then
  echo
  echo "*** Warning: X development files not found. Wine will be built without"
  echo "*** X support, which currently does not work, and would probably not be"
  echo "*** what you want anyway. You will need to install devel packages of"
  echo "*** Xlib/Xfree86 at the very least."
if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
then
  echo
  echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
  echo "*** terminal resize support. Consider upgrading ncurses."
fi

if test "$wine_cv_libc_reentrant" = "no"
Alexandre Julliard's avatar
Alexandre Julliard committed
then
  echo
  echo "*** Warning: non-reentrant libc detected. Wine will be built without"
  echo "*** threading support. Consider upgrading libc to a more recent"
Alexandre Julliard's avatar
Alexandre Julliard committed
  echo "*** reentrant version of libc."
fi

if test "$have_x" = "yes" -a "$wine_cv_x_reentrant" != "yes"
then
  echo
  echo "*** Warning: non-reentrant X11 library detected. Multi-threaded"
  echo "*** applications won't work properly. You should upgrade your X11 library."
fi

Lionel Ulmer's avatar
Lionel Ulmer committed
if test "$wine_cv_opengl_version_OK" = "no"
then
  echo
  echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
  echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
fi

if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "x"
then
  echo
  echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
  echo "*** thread-safety. To prevent crashes, OpenGL support has been disabled."
Andreas Mohr's avatar
Andreas Mohr committed
  echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine,"
  echo "*** start configure with '--enable-opengl' to force OpenGL support."
if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "xyes"
  echo "*** Warning: you explicitly linked in a thread-safe OpenGL version. If you"
  echo "*** experience unusual crashes on DirectDraw games, try first to disable OpenGL"
  echo "*** support before reporting bugs."
fi

if test "$wine_cv_warn_cups_h" = "yes"
then
  echo
  echo "*** Note: You have cups runtime libraries, but no development"
  echo "*** libraries. Install the cups-devel package or whichever package"
  echo "*** contains cups.h to enable CUPS support in Wine."
if test "$wine_cv_msg_freetype" = "yes"
then
  echo
  echo "*** Note: Your system appears to have the FreeType 2 runtime libraries"
  echo "*** installed, but 'freetype-config' is not in your PATH. Install the"
  echo "*** freetype-devel package (or its equivalent on your distribution) to"
  echo "*** enable Wine to use TrueType fonts."
Alexandre Julliard's avatar
Alexandre Julliard committed
echo
echo "Configure finished.  Do 'make depend && make' to compile Wine."
Alexandre Julliard's avatar
Alexandre Julliard committed
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: