Skip to content
Snippets Groups Projects
configure.ac 40.7 KiB
Newer Older
    )
    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 *** Check for some structure members
dnl Macro to check if a structure contains a specified member
dnl Usage: WINE_CHECK_STRUCT_MEMBER(struct,member,[includes,[action-if-found,[action-if-not-found]]])
AC_DEFUN([WINE_CHECK_STRUCT_MEMBER],
[AC_CACHE_CHECK([for $2 in struct $1], ac_cv_c_$1_$2,
 AC_TRY_COMPILE([$3],[struct $1 s; s.$2 = 0],ac_cv_c_$1_$2="yes",ac_cv_c_$1_$2="no"))
AS_IF([ test "x$ac_cv_c_$1_$2" = "xyes"],[$4],[$5])
])
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__

case $target_cpu in
  *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__"
Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Generate output files ****
dnl Macro to create non-existent directories from config.status
dnl Usage: WINE_CONFIG_EXTRA_DIR(dirname)
AC_DEFUN([WINE_CONFIG_EXTRA_DIR],
[AC_CONFIG_COMMANDS([$1],[test -d "$1" || (AC_MSG_NOTICE([creating $1]) && mkdir "$1")])])

AH_TOP([#define __WINE_CONFIG_H])

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/kernel/messages)
WINE_CONFIG_EXTRA_DIR(dlls/kernel/tests)
WINE_CONFIG_EXTRA_DIR(dlls/user/dde)
WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
WINE_CONFIG_EXTRA_DIR(dlls/user/tests)
WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
WINE_CONFIG_EXTRA_DIR(include/wine)
WINE_CONFIG_EXTRA_DIR(programs/regapi/tests)
WINE_CONFIG_EXTRA_DIR(programs/winetest/tests)

AC_CONFIG_COMMANDS([include/wine/version.h],
[AC_MSG_NOTICE([creating include/wine/version.h])
cat >$tmp/version.h <<CEOF
/* Generated automatically by configure; DO NOT EDIT! */
#define WINE_RELEASE_INFO "Wine version $wine_version"
CEOF
if cmp -s $tmp/version.h include/wine/version.h 2>/dev/null; then
  AC_MSG_NOTICE([include/wine/version.h is unchanged])
  rm -f $tmp/version.h
else
  rm -f include/wine/version.h
  mv $tmp/version.h include/wine/version.h
fi],
[wine_version=$PACKAGE_VERSION])
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_PROG_RULES=programs/Makeprog.rules
AC_SUBST_FILE(MAKE_PROG_RULES)

Alexandre Julliard's avatar
Alexandre Julliard committed
Make.rules
dlls/Makedll.rules
programs/Makeprog.rules
Alexandre Julliard's avatar
Alexandre Julliard committed
Makefile
Joseph Pranevich's avatar
Joseph Pranevich committed
console/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
controls/Makefile
debugger/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/dciman32/Makefile
dlls/ddraw/Makefile
dlls/dinput/Makefile
dlls/glu32/Makefile
dlls/icmp/Makefile
dlls/imm32/Makefile
dlls/kernel/Makefile
dlls/lzexpand/Makefile
dlls/msimg32/Makefile
dlls/msnet32/Makefile
dlls/msvcrt/Makefile
dlls/msvcrt20/Makefile
dlls/msvideo/Makefile
dlls/netapi32/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/tapi32/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/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
files/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
graphics/Makefile
graphics/enhmetafiledrv/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
Alexandre Julliard's avatar
Alexandre Julliard committed
library/Makefile
libtest/Makefile
loader/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
memory/Makefile
misc/Makefile
miscemu/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
msdos/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
objects/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
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/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
relay32/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
scheduler/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
Alexandre Julliard's avatar
Alexandre Julliard committed
tsx11/Makefile
Alexandre Julliard's avatar
Alexandre Julliard committed
win32/Makefile
windows/Makefile
windows/x11drv/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

Alexandre Julliard's avatar
Alexandre Julliard committed
if test "$wine_cv_libc_reentrant" = "no" 
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

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 removed."
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: