Skip to content
Snippets Groups Projects
configure.ac 96.2 KiB
Newer Older
		                        opengl_msg="/usr/X11R6/lib/libGL.a is present on your system.
This probably prevents linking to OpenGL. Try deleting the file and restarting configure."
	                                opengl_msg="No OpenGL library found on this system."
				    $X_LIBS $XLIB -lm $X_EXTRA_LIBS -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib)],
			     $X_LIBS $XLIB -lm $X_EXTRA_LIBS)
                 if test "$ac_cv_header_GL_glu_h" = "yes"
                 then
                    WINE_CHECK_SONAME(GLU,gluLookAt,,,[$OPENGL_LIBS $X_LIBS $X_PRE_LIBS $XLIB -lm $X_EXTRA_LIBS])
                 fi
                 WINE_NOTICE_WITH(glu,[test "x$ac_cv_lib_soname_GLU" = "x"],
                                 [libGLU ${notice_platform}development files not found, GLU won't be supported.])
                 opengl_msg="Old Mesa headers detected. Consider upgrading your Mesa libraries."
             opengl_msg="OpenGL development headers not found."
         test -n "$opengl_msg" && enable_opengl32=${enable_opengl32:-no}
         test "x$ac_cv_lib_soname_GLU" = "x" && enable_glu32=${enable_glu32:-no}
    else
         enable_opengl32=${enable_opengl32:-no}
         enable_glu32=${enable_glu32:-no}
    WINE_WARNING_WITH(opengl,[test -n "$opengl_msg"],[$opengl_msg
OpenGL and Direct3D won't be supported.])
    dnl **** Check for NAS ****
    AC_SUBST(NASLIBS,"")
    AC_CHECK_HEADERS(audio/audiolib.h,
         [AC_CHECK_HEADERS(audio/soundlib.h,,,[#include <audio/audiolib.h>])
          AC_CHECK_LIB(audio,AuCreateFlow,
                       [AC_DEFINE(HAVE_NAS,1,[Define if you have NAS including devel headers])
                          [NASLIBS="-lXau -laudio -lXt $X_LIBS $XLIB $X_EXTRA_LIBS"],
                          [NASLIBS="-laudio -lXt $X_LIBS $XLIB $X_EXTRA_LIBS"],
                       [-lXt $X_LIBS $XLIB $X_EXTRA_LIBS])])
    CPPFLAGS="$ac_save_CPPFLAGS"
    enable_winex11_drv=${enable_winex11_drv:-no}
    enable_opengl32=${enable_opengl32:-no}
    enable_glu32=${enable_glu32:-no}
WINE_ERROR_WITH(x,[test "x$XLIB" = "x"],[X ${notice_platform}development files not found. Wine will be built
without X support, which probably isn't what you want. You will need to install
${notice_platform}development packages of Xlib/Xfree86 at the very least.])
dnl **** Check for libxml2 ****

AC_SUBST(XML2LIBS,"")
AC_SUBST(XML2INCL,"")
AC_SUBST(XSLTINCL,"")
    ac_save_CPPFLAGS="$CPPFLAGS"
    if test "$PKG_CONFIG" != "false"
    then
        ac_xml_libs="`$PKG_CONFIG --libs libxml-2.0 2>/dev/null`"
        ac_xml_cflags="`$PKG_CONFIG --cflags libxml-2.0 2>/dev/null`"
    else
        ac_xml_libs="`xml2-config --libs 2>/dev/null`"
        ac_xml_cflags="`xml2-config --cflags  2>/dev/null`"
    fi
    CPPFLAGS="$CPPFLAGS $ac_xml_cflags"
    AC_CHECK_HEADERS(libxml/parser.h,
            [AC_CHECK_LIB(xml2, xmlParseMemory,
                [AC_DEFINE(HAVE_LIBXML2, 1, [Define if you have the libxml2 library])
                 XML2LIBS="$ac_xml_libs"
                 XML2INCL="$ac_xml_cflags"],,$ac_xml_libs)
             AC_CHECK_LIB(xml2, xmlReadMemory,
                [AC_DEFINE(HAVE_XMLREADMEMORY,1,[Define if libxml2 has the xmlReadMemory function])],,$ac_xml_libs)
             AC_CHECK_LIB(xml2, xmlNewDocPI,
                [AC_DEFINE(HAVE_XMLNEWDOCPI,1,[Define if libxml2 has the xmlNewDocPI function])],,$ac_xml_libs)
        ])
    CPPFLAGS="$ac_save_CPPFLAGS"
WINE_WARNING_WITH(xml,[test "$ac_cv_lib_xml2_xmlParseMemory" != "yes"],
                 [libxml2 ${notice_platform}development files not found, XML won't be supported.])
    if test "$PKG_CONFIG" != "false"
    then
        ac_xslt_libs="`$PKG_CONFIG --libs libxslt 2>/dev/null`"
        ac_xslt_cflags="`$PKG_CONFIG --cflags libxslt 2>/dev/null`"
    else
        ac_xslt_libs="`xslt-config --libs 2>/dev/null`"
        ac_xslt_cflags="`xslt-config --cflags 2>/dev/null`"
    fi
    ac_save_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="$CPPFLAGS $ac_xslt_cflags"
    AC_CHECK_HEADERS([libxslt/pattern.h libxslt/transform.h],,,
# include <libxslt/pattern.h>
#endif])
    if test "$ac_cv_header_libxslt_transform_h" = "yes"
    then
        WINE_CHECK_SONAME(xslt,xsltCompilePattern,
                         [XSLTINCL="$ac_xslt_cflags"],,[$ac_xslt_libs])
WINE_WARNING_WITH(xslt,[test "x$ac_cv_lib_soname_xslt" = "x"],
                 [libxslt ${notice_platform}development files not found, xslt won't be supported.])
dnl **** Check for libhal ****
AC_SUBST(HALINCL,"")
then
    ac_save_CPPFLAGS="$CPPFLAGS"
    if test "$PKG_CONFIG" != "false"
    then
        ac_hal_libs="`$PKG_CONFIG --libs hal 2>/dev/null`"
        ac_hal_cflags="`$PKG_CONFIG --cflags hal 2>/dev/null`"
        CPPFLAGS="$CPPFLAGS $ac_hal_cflags"
    fi
    AC_CHECK_HEADERS([dbus/dbus.h hal/libhal.h])
    if test "$ac_cv_header_dbus_dbus_h" = "yes" -a "$ac_cv_header_hal_libhal_h" = "yes"
    then
        AC_CHECK_LIB(dbus-1, dbus_connection_close,
          [WINE_CHECK_SONAME(hal, libhal_ctx_new,
            [HALINCL="$ac_hal_cflags"],,[$ac_hal_libs])],,[$ac_hal_libs])
    CPPFLAGS="$ac_save_CPPFLAGS"
fi
WINE_NOTICE_WITH(hal,[test "x$ac_cv_lib_soname_hal" = "x"],
                 [libhal/libdbus ${notice_platform}development files not found, no dynamic device support.])
dnl **** Check for libgnutls ****
then
    ac_save_CPPFLAGS="$CPPFLAGS"
    if test "$PKG_CONFIG" != "false"
    then
        ac_gnutls_libs="`$PKG_CONFIG --libs gnutls 2>/dev/null`"
        ac_gnutls_cflags="`$PKG_CONFIG --cflags gnutls 2>/dev/null`"
        CPPFLAGS="$CPPFLAGS $ac_gnutls_cflags"
    fi
    AC_CHECK_HEADER(gnutls/gnutls.h,
        [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]], [[typeof(gnutls_mac_get_key_size) *pfunc;]])],
            [WINE_CHECK_SONAME(gnutls,gnutls_global_init,
                [AC_SUBST(GNUTLSINCL,"$ac_gnutls_cflags")],,[$ac_gnutls_libs])])])
    CPPFLAGS="$ac_save_CPPFLAGS"
fi
WINE_NOTICE_WITH(gnutls,[test "x$ac_cv_lib_soname_gnutls" = "x"],
                 [libgnutls ${notice_platform}development files not found, no schannel support.])
dnl **** Check which curses lib to use ***
if test "$ac_cv_header_ncurses_h" = "yes"
    WINE_CHECK_SONAME(ncurses,waddch,[CURSESLIBS="-lncurses"])
elif test "$ac_cv_header_curses_h" = "yes"
then
    WINE_CHECK_SONAME(curses,waddch,[CURSESLIBS="-lcurses"])
ac_save_LIBS="$LIBS"
LIBS="$LIBS $CURSESLIBS"
AC_CHECK_FUNCS(mousemask)
LIBS="$ac_save_LIBS"
WINE_NOTICE_WITH(curses,[test "x$ac_cv_lib_soname_curses$ac_cv_lib_soname_ncurses" = "x"],
                 [lib(n)curses ${notice_platform}development files not found, curses won't be supported.])
dnl **** Check for SANE ****
then
    ac_save_CPPFLAGS="$CPPFLAGS"
    AC_CHECK_PROG(sane_devel,sane-config,sane-config,no)
    if test "$sane_devel" != "no"
    then
        ac_sane_incl="`$sane_devel --cflags`"
        ac_sane_libs="`$sane_devel --ldflags`"
        CPPFLAGS="$CPPFLAGS $ac_sane_incl"
    fi
    AC_CHECK_HEADER(sane/sane.h,
        [WINE_CHECK_SONAME(sane,sane_init,[AC_SUBST(SANEINCL,"$ac_sane_incl")],,[$ac_sane_libs])])
    CPPFLAGS="$ac_save_CPPFLAGS"
fi
WINE_NOTICE_WITH(sane,[test "x$ac_cv_lib_soname_sane" = "x"],
                 [libsane ${notice_platform}development files not found, scanners won't be supported.])
dnl **** Check for libv4l1 ****
if test "x$with_v4l" != "xno"
then
    WINE_CHECK_SONAME(v4l1,v4l1_open,,,)
fi
WINE_NOTICE_WITH(v4l,[test "x$ac_cv_lib_soname_v4l1" = "x"],
                 [libv4l ${notice_platform}development files not found.])

    AC_CHECK_PROG(gphoto2_devel,gphoto2-config,gphoto2-config,no)
    AC_CHECK_PROG(gphoto2port_devel,gphoto2-port-config,gphoto2-port-config,no)
    if test "$gphoto2_devel" != "no" -a "$gphoto2port_devel" != "no"
    then
        ac_gphoto2_incl="`$gphoto2_devel --cflags` `$gphoto2port_devel --cflags`"
        ac_gphoto2_libs=""
        for i in `$gphoto2_devel --libs` `$gphoto2port_devel --libs`
        do
            case "$i" in
            -L/usr/lib|-L/usr/lib64) ;;
            -L*|-l*) ac_gphoto2_libs="$ac_gphoto2_libs $i";;
            esac
        done
        CPPFLAGS="$CPPFLAGS $ac_gphoto2_incl"
    fi
    ac_gphoto2_libs=${ac_gphoto2_libs:-"-lgphoto2"}
    AC_CHECK_HEADER(gphoto2-camera.h,
                    [AC_CHECK_LIB(gphoto2,gp_camera_new,
                                  [AC_DEFINE(HAVE_GPHOTO2, 1, [Define if we have libgphoto2 development environment])
                                   AC_SUBST(GPHOTO2LIBS,"$ac_gphoto2_libs")
                                   AC_SUBST(GPHOTO2INCL,"$ac_gphoto2_incl")],,
WINE_NOTICE_WITH(gphoto,[test "$ac_cv_lib_gphoto2_gp_camera_new" != "yes"],
                 [libgphoto2 ${notice_platform}development files not found, digital cameras won't be supported.])
dnl **** Check for resolver library ***
AC_SUBST(RESOLVLIBS,"")
if test "$ac_cv_header_resolv_h" = "yes"
then
    ac_save_LIBS="$LIBS"
    LIBS="$LIBS -lresolv"
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <resolv.h>]],[[res_init();]])],
        [AC_DEFINE(HAVE_RESOLV, 1, [Define if you have the resolver library and header])
         RESOLVLIBS="-lresolv"])
    LIBS="$ac_save_LIBS"
dnl **** Check for LittleCMS ***
AC_SUBST(LCMSLIBS,"")
if test "$ac_cv_header_lcms_h" = "yes" -o "$ac_cv_header_lcms_lcms_h" = "yes"
then
    AC_CHECK_LIB(lcms, cmsOpenProfileFromFile,
        [AC_DEFINE(HAVE_LCMS, 1, [Define if you have the LittleCMS development environment])
         LCMSLIBS="-llcms"])
fi
WINE_NOTICE_WITH(cms,[test "$ac_cv_lib_lcms_cmsOpenProfileFromFile" != "yes"],
                 [liblcms ${notice_platform}development files not found, Color Management won't be supported.])
dnl **** Check for FreeType 2 ****
    AC_CHECK_PROGS(ft_devel,[freetype-config freetype2-config],no)
    if test "$ft_devel" != "no"
    then
        ac_freetype_incl=`$ft_devel --cflags`
        ac_freetype_libs=`$ft_devel --libs`
    fi
    ac_freetype_libs=${ac_freetype_libs:-"-lfreetype"}
    WINE_CHECK_SONAME(freetype,FT_Init_FreeType,[ft_lib=yes],[ft_lib=no],[$ac_freetype_libs])
    if test "$ft_lib" = "yes"
	ac_save_CPPFLAGS="$CPPFLAGS"
	CPPFLAGS="$ac_freetype_incl $CPPFLAGS"
	AC_CHECK_HEADERS(ft2build.h \
                         freetype/freetype.h \
                         freetype/fttypes.h \
                         freetype/tttables.h \
                         freetype/ftsnames.h \
Huw D. M. Davies's avatar
Huw D. M. Davies committed
                         freetype/ftoutln.h \
                         freetype/ftwinfnt.h \
                         freetype/ftmodapi.h \
                         [#ifdef HAVE_FT2BUILD_H
                          # include <ft2build.h>
	AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <ft2build.h>
                    #include <freetype/fttrigon.h>]])],[AC_DEFINE(HAVE_FREETYPE_FTTRIGON_H, 1,
          [Define if you have the <freetype/fttrigon.h> header file.])
                    wine_cv_fttrigon=yes],[wine_cv_fttrigon=no])
        AC_CHECK_TYPES(FT_TrueTypeEngineType,,,[#include <freetype/ftmodapi.h>])
        AC_CHECK_FUNCS(FT_Load_Sfnt_Table)
        CFLAGS="$ac_save_CFLAGS"
	CPPFLAGS="$ac_save_CPPFLAGS"
	dnl Check that we have at least freetype/freetype.h
	if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
	then
	    AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
            AC_SUBST(FREETYPELIBS,"$ac_freetype_libs")
            AC_SUBST(FREETYPEINCL,"$ac_freetype_incl")
WINE_ERROR_WITH(freetype,[test "x$FREETYPELIBS" = "x"],[FreeType ${notice_platform}development files not found. Fonts will not be built.])
test "x$FREETYPELIBS" = "x" && enable_fonts=${enable_fonts:-no}
dnl **** Check for parport (currently Linux only) ****
AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#include <linux/ppdev.h>]], [[ioctl (1,PPCLAIM,0)]])],
    [ac_cv_c_ppdev="yes"],[ac_cv_c_ppdev="no"]))
if test "$ac_cv_c_ppdev" = "yes"
then
    AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev.h for parallel port access])
dnl **** Check for pthread functions ****
        pthread_attr_get_np \
        pthread_getattr_np \
        pthread_get_stackaddr_np \
dnl **** Check for zlib ****
if test "$ac_cv_header_zlib_h" = "yes"
then
    AC_CHECK_LIB(z,inflate,[AC_DEFINE(HAVE_ZLIB,1,[Define to 1 if you have the `z' library (-lz).])
                            AC_SUBST(ZLIB,"-lz")])
fi

dnl **** Check for EsounD ****
then
    save_CFLAGS="$CFLAGS"
    AC_PATH_PROG(ESDCONFIG, esd-config, no)
    if test "x$ESDCONFIG" != "xno"
    then
        ac_esd_incl=""
        for i in `$ESDCONFIG --cflags`
        do
            case "$i" in
                -I*) ac_esd_incl="$ac_esd_incl $i";;
            esac
        done
        ac_esd_libs=`$ESDCONFIG --libs`
        CFLAGS="$CFLAGS $ac_esd_incl"
    fi
    ac_esd_libs=${ac_esd_libs:-"-lesd"}
    AC_CHECK_HEADER(esd.h,
        [AC_CHECK_LIB(esd,esd_open_sound,
            [AC_SUBST(ESDINCL, "$ac_esd_incl")
             AC_SUBST(ESDLIBS, "$ac_esd_libs")
             AC_DEFINE(HAVE_ESD, 1, [Define if you have EsounD sound server])],,
            [$ac_esd_libs])])
    CFLAGS="$save_CFLAGS"
fi

dnl **** Check for ALSA 1.x ****
AC_SUBST(ALSALIBS,"")
if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes"
    AC_CHECK_LIB(asound,snd_pcm_hw_params_get_access,
        [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_ALSA_ASOUNDLIB_H
#include <alsa/asoundlib.h>
#elif defined(HAVE_SYS_ASOUNDLIB_H)
#include <sys/asoundlib.h>
#endif]], [[int ret = snd_pcm_hw_params_get_access(NULL, NULL)]])],
                        [AC_DEFINE(HAVE_ALSA,1,[Define if you have ALSA 1.x including devel headers])
dnl **** Check for libaudioio (which can be used to get solaris audio support) ****
AC_SUBST(AUDIOIOLIBS,"")
if test "$ac_cv_header_libaudioio_h" = "yes"
then
    AC_CHECK_LIB(audioio,AudioIOGetVersion,
                  [AUDIOIOLIBS="-laudioio"
                   AC_DEFINE(HAVE_LIBAUDIOIO, 1, [Define if you have libaudioIO])])
fi
dnl **** Check for capi4linux ****

if test "$ac_cv_header_capi20_h" = "yes" -a "$ac_cv_header_linux_capi_h" = "yes"
then
    WINE_CHECK_SONAME(capi20,capi20_register)
WINE_NOTICE_WITH(capi,[test "x$ac_cv_lib_soname_capi20" = "x"],
                 [libcapi20 ${notice_platform}development files not found, ISDN won't be supported.])
AC_SUBST(CUPSINCL,"")
if test "x$with_cups" != "xno"
    ac_save_CPPFLAGS="$CPPFLAGS"
    ac_cups_cflags=`cups-config --cflags 2>/dev/null`
    ac_cups_libs=`cups-config --ldflags 2>/dev/null`
    CPPFLAGS="$CPPFLAGS $ac_cups_cflags"
    AC_CHECK_HEADERS(cups/cups.h,
            [WINE_CHECK_SONAME(cups,cupsGetDefault,
                       [CUPSINCL="$ac_cups_cflags"],,
                       [$ac_cups_libs])])
    CPPFLAGS="$ac_save_CPPFLAGS"
WINE_NOTICE_WITH(cups,[test "x$ac_cv_lib_soname_cups" = "x"],
                 [libcups ${notice_platform}development files not found, CUPS won't be supported.])
dnl **** Check for jack ****
if test "$ac_cv_header_jack_jack_h" = "yes"
then
    WINE_CHECK_SONAME(jack,jack_client_new,,,,[[libjack-*[[0-9.]]*]])
dnl **** Check for fontconfig ****
if test "$ac_cv_header_fontconfig_fontconfig_h" = "yes"
then
    WINE_CHECK_SONAME(fontconfig,FcInit)
elif test -n "$X_CFLAGS" -a "x$with_fontconfig" != "xno"
then
    dnl fontconfig is in the X directory on Mac OS X
    ac_save_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
    $as_unset ac_cv_header_fontconfig_fontconfig_h
    AC_CHECK_HEADERS([fontconfig/fontconfig.h])
    CPPFLAGS="$ac_save_CPPFLAGS"
    if test "$ac_cv_header_fontconfig_fontconfig_h" = "yes"
    then
        AC_SUBST(FONTCONFIGINCL,"$X_CFLAGS")
        WINE_CHECK_SONAME(fontconfig,FcInit,,,[$X_LIBS])
    fi
WINE_NOTICE_WITH(fontconfig,[test "x$ac_cv_lib_soname_fontconfig" = "x"],
                 [fontconfig ${notice_platform}development files not found, fontconfig won't be supported.])
dnl **** Check for SSL ****
if test "$ac_cv_header_openssl_err_h" = "yes" -a "$ac_cv_header_openssl_ssl_h" = "yes"
then
    WINE_CHECK_SONAME(ssl,SSL_library_init)
    WINE_CHECK_SONAME(crypto,BIO_new_socket)
fi
WINE_WARNING_WITH(openssl,[test "x$ac_cv_lib_soname_ssl" = "x" -o "x$ac_cv_lib_soname_crypto" = "x"],
                 [OpenSSL ${notice_platform}development files not found, SSL won't be supported.])
dnl **** Check for gsm codec ****
if test "$ac_cv_header_gsm_h" = "yes" -o "$ac_cv_header_gsm_gsm_h" = "yes"
then
    WINE_CHECK_SONAME(gsm,gsm_create)
fi
WINE_NOTICE_WITH(gsm,[test "x$ac_cv_lib_soname_gsm" = "x"],
                 [libgsm ${notice_platform}development files not found, gsm 06.10 codec won't be supported.])

dnl **** Check for libjpeg ****
if test "$ac_cv_header_jpeglib_h" = "yes"
then
    WINE_CHECK_SONAME(jpeg,jpeg_start_decompress)
fi
WINE_WARNING_WITH(jpeg,[test "x$ac_cv_lib_soname_jpeg" = "x"],
                 [libjpeg ${notice_platform}development files not found, JPEG won't be supported.])
dnl **** Check for libpng ****
if test "$ac_cv_header_png_h" = "yes"
then
    WINE_CHECK_SONAME(png,png_create_read_struct,,,-lm -lz,[[libpng[[0-9]]*]])
    AC_CHECK_LIB(png,png_set_expand_gray_1_2_4_to_8,
	[AC_DEFINE(HAVE_PNG_SET_EXPAND_GRAY_1_2_4_TO_8,1,[Define to 1 if libpng has the png_set_expand_gray_1_2_4_to_8 function.])]
	,,-lm -lz)
elif test -n "$X_CFLAGS" -a "x$with_png" != "xno"
then
    dnl libpng is in the X directory on Mac OS X
    ac_save_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
    $as_unset ac_cv_header_png_h
    AC_CHECK_HEADERS([png.h])
    CPPFLAGS="$ac_save_CPPFLAGS"
    if test "$ac_cv_header_png_h" = "yes"
    then
        AC_SUBST(PNGINCL,"$X_CFLAGS")
        WINE_CHECK_SONAME(png,png_create_read_struct,,,[$X_LIBS -lm -lz],[[libpng[[0-9]]*]])
        AC_CHECK_LIB(png,png_set_expand_gray_1_2_4_to_8,
		[AC_DEFINE(HAVE_PNG_SET_EXPAND_GRAY_1_2_4_TO_8,1)],,[$X_LIBS -lm -lz])
WINE_WARNING_WITH(png,[test "x$ac_cv_lib_soname_png" = "x"],
                 [libpng ${notice_platform}development files not found, PNG won't be supported.])
dnl **** Check for libtiff ****
if test "$ac_cv_header_tiffio_h" = "yes"
then
    WINE_CHECK_SONAME(tiff,TIFFClientOpen)
fi
WINE_NOTICE_WITH(tiff,[test "x$ac_cv_lib_soname_tiff" = "x"],
                 [libtiff ${notice_platform}development files not found, TIFF won't be supported.])

dnl **** Check for mpg123 ****
if test "$ac_cv_header_mpg123_h" = "yes"
then
    AC_CHECK_LIB(mpg123,mpg123_feed,[AC_SUBST(LIBMPG123,"-lmpg123")])
WINE_NOTICE_WITH(mpg123,[test "x$ac_cv_lib_mpg123_mpg123_feed" != xyes -a x"$ac_cv_header_CoreAudio_CoreAudio_h" != xyes],
                 [libmpg123 ${notice_platform}development files not found (or too old), mp3 codec won't be supported.])
test "x$ac_cv_lib_mpg123_mpg123_feed" = xyes -o "x$ac_cv_func_AudioFileStreamOpen" = xyes || enable_winemp3_acm=${enable_winemp3_acm:-no}
dnl **** Check for OpenAL 1.1 ****
if test "$ac_cv_header_AL_al_h" = "yes"
then
    WINE_CHECK_SONAME(openal,alGetSource3i,[AC_SUBST(LIBOPENAL,"-lopenal")
                      ac_cv_lib_openal=yes
                      AC_DEFINE_UNQUOTED(HAVE_OPENAL,1,[Define to 1 if OpenAL is available])],,)
WINE_NOTICE_WITH(openal,[test "x$ac_cv_lib_openal" != xyes],
                 [libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported.])
test "x$ac_cv_lib_openal" = xyes || enable_openal32=${enable_openal32:-no}
dnl **** Check for libkstat ****
if test "$ac_cv_header_kstat_h" = "yes"
then
    AC_CHECK_LIB(kstat,kstat_open,
                 [AC_DEFINE(HAVE_LIBKSTAT, 1, [Define to 1 if you have the `kstat' library (-lkstat).])
                  AC_SUBST(LIBKSTAT,"-lkstat")])
fi

dnl **** Check for libodbc ****
WINE_CHECK_SONAME(odbc,SQLConnect,,[AC_DEFINE_UNQUOTED(SONAME_LIBODBC,["libodbc.$LIBEXT"])])

if test "x$ALSALIBS$AUDIOIOLIBS$COREAUDIO$NASLIBS$ESDLIBS$ac_cv_lib_soname_jack" = "x" -a \
        "$ac_cv_header_sys_soundcard_h" != "yes" -a \
        "$ac_cv_header_machine_soundcard_h" != "yes" -a \
        "$ac_cv_header_soundcard_h" != "yes" -a \
        "x$with_alsa$with_audioio$with_coreaudio$with_nas$with_esd$with_jack$with_oss" != xnonononononono
then
    WINE_WARNING([No sound system was found. Windows applications will be silent.])
fi
dnl **** Check for gcc specific options ****
Alexandre Julliard's avatar
Alexandre Julliard committed
if test "x${GCC}" = "xyes"
then
  EXTRACFLAGS="-Wall -pipe"
  AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug,
                  AC_RUN_IFELSE([AC_LANG_PROGRAM([[int L[[4]] = {0,1,2,3};]],
[[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;
  for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
  L[[i]] = 4;
  return (Array[[1]] != -2 || L[[2]] != 3)]])],
    [ac_cv_c_gcc_strength_bug="no"],[ac_cv_c_gcc_strength_bug="yes"],[ac_cv_c_gcc_strength_bug="yes"]) )
Alexandre Julliard's avatar
Alexandre Julliard committed
  if test "$ac_cv_c_gcc_strength_bug" = "yes"
  then
    EXTRACFLAGS="$EXTRACFLAGS -fno-strength-reduce"
Alexandre Julliard's avatar
Alexandre Julliard committed
  fi
  dnl Check for some compiler flags
  WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")])
  WINE_TRY_CFLAGS([-fno-strict-aliasing])
  WINE_TRY_CFLAGS([-Wdeclaration-after-statement])
  WINE_TRY_CFLAGS([-Wstrict-prototypes])
  WINE_TRY_CFLAGS([-Wtype-limits])
  WINE_TRY_CFLAGS([-Wwrite-strings])
  CFLAGS="$CFLAGS -Wpointer-arith -Werror"
  AC_CACHE_CHECK([for broken string.h that generates warnings], ac_cv_c_string_h_warnings,
      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[]])],[ac_cv_c_string_h_warnings=no],[ac_cv_c_string_h_warnings=yes]))
  if test "$ac_cv_c_string_h_warnings" = "no"
  then
    EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith"

  dnl Enable -Werror for maintainer mode
  if test "${enable_maintainer_mode+set}" = set
  then
      WINE_TRY_CFLAGS([-Werror])
  fi

  dnl Check for ms_hook_prologue support
  saved_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -Werror"
  AC_CACHE_CHECK([for ms_hook_prologue attribute], ac_cv_have_ms_hook_prologue,
                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int __attribute__((__ms_hook_prologue__)) test(void) { return 0; }]])],
                                   [ac_cv_have_ms_hook_prologue="yes"],[ac_cv_have_ms_hook_prologue="no"]))
  CFLAGS="$saved_CFLAGS"
  if test "$ac_cv_have_ms_hook_prologue" = "yes"
  then
      AC_DEFINE(DECLSPEC_HOTPATCH, [__attribute__((__ms_hook_prologue__))],
                [Define to a function attribute for Microsoft hotpatch assembly prefix.])
  else
      AC_DEFINE(DECLSPEC_HOTPATCH, [/* */])
  fi
dnl **** Check for underscore on external symbols ****

AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_extern_prefix,
    WINE_TRY_ASM_LINK([".globl _ac_test\n_ac_test:\t.long 0"],
                      [extern int ac_test;],
                      [if (ac_test) return 1],
                      ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no"))

case $host_cpu in
  *i[[3456789]]86*)
    AC_CACHE_CHECK([whether external symbols need stdcall decoration], ac_cv_c_stdcall_suffix,
        WINE_TRY_ASM_LINK(["jmp _ac_test@4"],
[#ifndef _MSC_VER
#define __stdcall __attribute__((__stdcall__))
#endif
int __stdcall ac_test(int i) { return i; }],
                          [if (ac_test(1)) return 1],
                          ac_cv_c_stdcall_suffix="yes",ac_cv_c_stdcall_suffix="no")) ;;
  *) ac_cv_c_stdcall_suffix="no" ;;
esac

AH_TEMPLATE(__ASM_NAME,[Define to a macro to generate an assembly name from a C symbol])
if test "$ac_cv_c_extern_prefix" = "yes"
then
    AC_DEFINE([__ASM_NAME(name)], ["_" name])
    asm_name_prefix="_"
else
    AC_DEFINE([__ASM_NAME(name)], [name])
    asm_name_prefix=""
fi

AH_TEMPLATE(__ASM_STDCALL,[Define to a macro to generate an stdcall suffix])
if test "$ac_cv_c_stdcall_suffix" = "yes"
then
    AC_DEFINE([__ASM_STDCALL(args)],["@" #args])
else
    AC_DEFINE([__ASM_STDCALL(args)],[""])
fi

dnl **** Check how to define a function in assembly code ****

AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,
  WINE_TRY_ASM_LINK(
      ["\t.globl _ac_test\n\t.def _ac_test; .scl 2; .type 32; .endef\n_ac_test:\t.long 0"],,,
      ac_cv_asm_func_def=".def",
    [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,@function\n_ac_test:\t.long 0"],,,
      ac_cv_asm_func_def=".type @function",
    [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,2\n_ac_test:\t.long 0"],,,
      ac_cv_asm_func_def=".type 2",
      ac_cv_asm_func_def="unknown")])]))

AH_TEMPLATE(__ASM_FUNC,[Define to a macro to generate an assembly function directive])
case "$ac_cv_asm_func_def" in
  ".def")
     AC_DEFINE([__ASM_FUNC(name)], [".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"])
     asm_func_header=".def $asm_name_prefix\" #name suffix \"; .scl 2; .type 32; .endef" ;;
     AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",@function"])
     asm_func_header=".type $asm_name_prefix\" #name suffix \",@function" ;;
     AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",2"])
     asm_func_header=".type $asm_name_prefix\" #name suffix \",2" ;;
     AC_DEFINE([__ASM_FUNC(name)], [""])
     asm_func_header="" ;;
AC_CACHE_CHECK([whether asm() works outside of functions], ac_cv_c_asm_outside_funcs,
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[asm(".text\n\t.long 0");]],)],
                      ac_cv_c_asm_outside_funcs="yes",ac_cv_c_asm_outside_funcs="no"))
AC_CACHE_CHECK([whether .previous is supported in assembly code], ac_cv_c_dot_previous,
    WINE_TRY_ASM_LINK([".text\nac_test:\t.long 0\n\t.previous"],,,
                      ac_cv_c_dot_previous="yes",ac_cv_c_dot_previous="no"))
AC_CACHE_CHECK([whether CFI directives are supported in assembly code], ac_cv_c_cfi_support,
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[asm(".text\nac_test:\t.cfi_startproc\n\t.long 0\n\t.cfi_endproc");]])],
                      ac_cv_c_cfi_support="yes",ac_cv_c_cfi_support="no"))

asm_func_header=".globl $asm_name_prefix\" #name suffix \"\\n\\t$asm_func_header\\n$asm_name_prefix\" #name suffix \":\\n\\t"
asm_func_trailer=""
if test "$ac_cv_c_dot_previous" = "yes"
then
   asm_func_trailer="\\n\\t.previous"
fi
if test "$ac_cv_c_cfi_support" = "yes"
then
   asm_func_header="$asm_func_header.cfi_startproc\\n\\t"
   asm_func_trailer="\\n\\t.cfi_endproc$asm_func_trailer"
   AC_DEFINE([__ASM_CFI(str)],[str],[Define to a macro to output a .cfi assembly pseudo-op])
   AC_SUBST([UNWINDFLAGS],[-fasynchronous-unwind-tables])
asm_func_code="$asm_func_header\" code \"$asm_func_trailer"

AH_TEMPLATE(__ASM_DEFINE_FUNC,[Define to a macro to define an assembly function])
if test "$ac_cv_c_asm_outside_funcs" = "yes"
Alexandre Julliard's avatar
Alexandre Julliard committed
then
    AC_DEFINE_UNQUOTED([__ASM_DEFINE_FUNC(name,suffix,code)],[asm(".text\n\t.align 4\n\t$asm_func_code");])
    AC_DEFINE_UNQUOTED([__ASM_DEFINE_FUNC(name,suffix,code)],[void __asm_dummy_##name(void) { asm(".text\n\t.align 4\n\t$asm_func_code"); }])
Alexandre Julliard's avatar
Alexandre Julliard committed
fi
AC_DEFINE([__ASM_GLOBAL_FUNC(name,code)],[__ASM_DEFINE_FUNC(name,"",code)],
          [Define to a macro to generate an assembly function with C calling convention])
AC_DEFINE([__ASM_STDCALL_FUNC(name,args,code)],[__ASM_DEFINE_FUNC(name,__ASM_STDCALL(args),code)],
          [Define to a macro to generate an assembly function with stdcall calling convention])
AC_SUBST(LDPATH,"")
case $build_os in
  cygwin*|mingw32*)
    LDPATH="PATH=\"\$(TOOLSDIR)/libs/wine:\$\$PATH\""
    ;;
    LDPATH="LD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/wine:\$\$LD_LIBRARY_PATH\""
    ;;
dnl Mingw needs explicit msvcrt for linking libwine and winsock for wininet
    AC_SUBST(CRTLIBS,"-lmsvcrt")
    AC_SUBST(SOCKETLIBS,"-L\$(TOPOBJDIR)/dlls/ws2_32 -lws2_32")
AC_SUBST(MAIN_BINARY,"wine")
test -z "$with_wine64" || MAIN_BINARY="wine32"

case $host_cpu in
  *i[[3456789]]86*)
    case $host_os in
        AC_SUBST(EXTRA_BINARIES,"wine-preloader") ;;
dnl **** Check for functions ****

ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $BUILTINFLAG"
	_strtoi64 \
	_strtoui64 \
	fstatfs \
	fstatvfs \
Alexandre Julliard's avatar
Alexandre Julliard committed
	gettimeofday \
	port_create \
Louis Lenders's avatar
Louis Lenders committed
	strtold \
dnl Check for -ldl
if test "$ac_cv_func_dlopen" = no
then
    AC_CHECK_LIB(dl,dlopen,[AC_DEFINE(HAVE_DLOPEN,1) AC_SUBST(LIBDL,"-ldl")])
fi
WINE_CHECK_LIB_FUNCS(dladdr,[$LIBDL])

dnl Check for -lpoll for Mac OS X/Darwin
if test "$ac_cv_func_poll" = no
then
    AC_CHECK_LIB(poll,poll,[AC_DEFINE(HAVE_POLL,1) AC_SUBST(LIBPOLL,"-lpoll")])
fi
dnl **** Check for functions which may rely on -lsocket on Solaris.
AC_CHECK_FUNCS(\
	getaddrinfo \
	getnameinfo \
	getnetbyname \
	getprotobyname \
	getprotobynumber \
	getservbyport \
	inet_network \
dnl **** Check for OpenLDAP ***
AC_SUBST(LDAPLIBS,"")
if test "$ac_cv_header_ldap_h" = "yes" -a "$ac_cv_header_lber_h" = "yes"
then
    AC_CHECK_TYPE(LDAPSortKey,
        [AC_CHECK_LIB(ldap_r, ldap_initialize,
            [AC_CHECK_LIB(lber, ber_init,
                [AC_DEFINE(HAVE_LDAP, 1, [Define if you have the OpenLDAP development environment])
                 LDAPLIBS="-lldap_r -llber"],,
                 [$LIBPTHREAD])],,
                 [$LIBPTHREAD])],,
        [#include <ldap.h>])
    WINE_CHECK_LIB_FUNCS(\
	ldap_count_references \
	ldap_first_reference \
	ldap_next_reference \
	ldap_parse_reference \
	ldap_parse_sort_control \
	ldap_parse_sortresponse_control \
	ldap_parse_vlv_control \
	ldap_parse_vlvresponse_control,
        [$LDAPLIBS $LIBPTHREAD])
fi
WINE_NOTICE_WITH(ldap,[test "x$LDAPLIBS" = "x"],
                 [libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported.])
AC_CACHE_CHECK([whether mkdir takes only one argument],
   	wine_cv_one_arg_mkdir,
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]],[[mkdir("foo");]])],
                          [wine_cv_one_arg_mkdir=yes],[wine_cv_one_arg_mkdir=no]))
if test "$wine_cv_one_arg_mkdir" = "yes"
then
  AC_DEFINE(HAVE_ONE_ARG_MKDIR, 1, [Define if mkdir takes only one argument])
fi

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

AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t, long long, fsblkcnt_t, fsfilcnt_t])
AC_CHECK_TYPES([sigset_t],,,[#include <sys/types.h>
#include <signal.h>])
AC_CHECK_TYPES([request_sense],,,[#include <linux/cdrom.h>])
AC_CHECK_TYPES([struct xinpgen],,,
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_SOCKETVAR_H
#include <sys/socketvar.h>
#endif
#ifdef HAVE_NET_ROUTE_H
#include <net/route.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
#endif
#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif
#ifdef HAVE_NETINET_IN_PCB_H
#include <netinet/in_pcb.h>
#endif])

AC_CHECK_MEMBERS([struct ff_effect.direction],,,
[#ifdef HAVE_LINUX_INPUT_H
#include <linux/input.h>
#endif])

AC_CACHE_CHECK([for sigaddset],wine_cv_have_sigaddset,
               AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[sigset_t set; sigaddset(&set,SIGTERM);]])],[wine_cv_have_sigaddset=yes],[wine_cv_have_sigaddset=no]))
if test "$wine_cv_have_sigaddset" = "yes"
then
  AC_DEFINE(HAVE_SIGADDSET, 1, [Define if sigaddset is supported])
fi

AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
   	wine_cv_linux_gethostbyname_r_6,
	AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],[[
    struct hostent he;
    struct hostent *result;
    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],
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
	#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])
   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])
dnl **** FIXME: what about mixed cases, where we need two of them? ***
AC_CHECK_MEMBERS([struct statfs.f_bfree, struct statfs.f_bavail, struct statfs.f_frsize, struct statfs.f_ffree, struct statfs.f_favail, struct statfs.f_namelen],,,
[#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif