erikj@459: # kevinw@2206: # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. erikj@459: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. erikj@459: # erikj@459: # This code is free software; you can redistribute it and/or modify it erikj@459: # under the terms of the GNU General Public License version 2 only, as erikj@459: # published by the Free Software Foundation. Oracle designates this erikj@459: # particular file as subject to the "Classpath" exception as provided erikj@459: # by Oracle in the LICENSE file that accompanied this code. erikj@459: # erikj@459: # This code is distributed in the hope that it will be useful, but WITHOUT erikj@459: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or erikj@459: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License erikj@459: # version 2 for more details (a copy is included in the LICENSE file that erikj@459: # accompanied this code). erikj@459: # erikj@459: # You should have received a copy of the GNU General Public License version erikj@459: # 2 along with this work; if not, write to the Free Software Foundation, erikj@459: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. erikj@459: # erikj@459: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA erikj@459: # or visit www.oracle.com if you need additional information or have any erikj@459: # questions. erikj@459: # erikj@459: erikj@459: AC_DEFUN_ONCE([LIB_SETUP_INIT], erikj@459: [ ihse@839: ihse@839: ############################################################################### ihse@839: # ihse@839: # OS specific settings that we never will need to probe. ihse@839: # ihse@839: if test "x$OPENJDK_TARGET_OS" = xlinux; then erikj@459: AC_MSG_CHECKING([what is not needed on Linux?]) erikj@459: PULSE_NOT_NEEDED=yes erikj@459: AC_MSG_RESULT([pulse]) ihse@839: fi erikj@459: ihse@839: if test "x$OPENJDK_TARGET_OS" = xsolaris; then erikj@459: AC_MSG_CHECKING([what is not needed on Solaris?]) erikj@459: ALSA_NOT_NEEDED=yes erikj@459: PULSE_NOT_NEEDED=yes erikj@459: AC_MSG_RESULT([alsa pulse]) ihse@839: fi erikj@459: kvn@972: if test "x$OPENJDK_TARGET_OS" = xaix; then simonis@971: AC_MSG_CHECKING([what is not needed on AIX?]) simonis@971: ALSA_NOT_NEEDED=yes simonis@971: PULSE_NOT_NEEDED=yes simonis@971: AC_MSG_RESULT([alsa pulse]) kvn@972: fi simonis@971: simonis@971: ihse@839: if test "x$OPENJDK_TARGET_OS" = xwindows; then erikj@459: AC_MSG_CHECKING([what is not needed on Windows?]) ihse@839: CUPS_NOT_NEEDED=yes erikj@459: ALSA_NOT_NEEDED=yes erikj@459: PULSE_NOT_NEEDED=yes erikj@459: X11_NOT_NEEDED=yes prr@2400: FONTCONFIG_NOT_NEEDED=yes erikj@459: AC_MSG_RESULT([alsa cups pulse x11]) ihse@839: fi erikj@459: ihse@839: if test "x$OPENJDK_TARGET_OS" = xmacosx; then erikj@459: AC_MSG_CHECKING([what is not needed on MacOSX?]) erikj@459: ALSA_NOT_NEEDED=yes erikj@459: PULSE_NOT_NEEDED=yes erikj@459: X11_NOT_NEEDED=yes prr@2400: FONTCONFIG_NOT_NEEDED=yes ihse@868: AC_MSG_RESULT([alsa pulse x11]) ihse@839: fi erikj@459: ihse@839: if test "x$OPENJDK_TARGET_OS" = xbsd; then erikj@459: AC_MSG_CHECKING([what is not needed on bsd?]) erikj@459: ALSA_NOT_NEEDED=yes ihse@839: AC_MSG_RESULT([alsa]) ihse@839: fi erikj@459: ihse@839: if test "x$OPENJDK" = "xfalse"; then ihse@868: FREETYPE_NOT_NEEDED=yes ihse@839: fi erikj@459: ihse@839: if test "x$SUPPORT_HEADFUL" = xno; then ohair@478: X11_NOT_NEEDED=yes ihse@839: fi ohair@478: ddehaven@1304: # Deprecated and now ignored ihse@863: BASIC_DEPRECATED_ARG_ENABLE(macosx-runtime-support, macosx_runtime_support) erikj@459: ]) erikj@459: erikj@459: AC_DEFUN_ONCE([LIB_SETUP_X11], erikj@459: [ erikj@459: ihse@839: ############################################################################### ihse@839: # ihse@839: # Check for X Windows ihse@839: # erikj@459: ihse@839: # Check if the user has specified sysroot, but not --x-includes or --x-libraries. ihse@839: # Make a simple check for the libraries at the sysroot, and setup --x-includes and ihse@839: # --x-libraries for the sysroot, if that seems to be correct. kevinw@2215: if test "x$OPENJDK_TARGET_OS" = "xlinux"; then kevinw@2215: if test "x$SYSROOT" != "x"; then kevinw@2215: if test "x$x_includes" = xNONE; then kevinw@2215: if test -f "$SYSROOT/usr/X11R6/include/X11/Xlib.h"; then kevinw@2215: x_includes="$SYSROOT/usr/X11R6/include" kevinw@2215: elif test -f "$SYSROOT/usr/include/X11/Xlib.h"; then kevinw@2215: x_includes="$SYSROOT/usr/include" kevinw@2215: fi ihse@839: fi kevinw@2215: if test "x$x_libraries" = xNONE; then kevinw@2215: if test -f "$SYSROOT/usr/X11R6/lib/libX11.so"; then kevinw@2215: x_libraries="$SYSROOT/usr/X11R6/lib" kevinw@2215: elif test "$SYSROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then kevinw@2215: x_libraries="$SYSROOT/usr/lib64" kevinw@2215: elif test -f "$SYSROOT/usr/lib/libX11.so"; then kevinw@2215: x_libraries="$SYSROOT/usr/lib" kevinw@2215: fi ihse@839: fi erikj@459: fi erikj@459: fi ihse@839: ihse@839: # Now let autoconf do it's magic ihse@839: AC_PATH_X ihse@839: AC_PATH_XTRA ihse@839: ihse@839: # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling ihse@839: # this doesn't make sense so we remove it. ihse@839: if test "x$COMPILE_TYPE" = xcross; then ihse@839: X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'` ihse@839: fi ihse@839: ihse@839: if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then ihse@839: HELP_MSG_MISSING_DEPENDENCY([x11]) ihse@839: AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG]) ihse@839: fi ihse@839: kevinw@2215: ihse@839: if test "x$OPENJDK_TARGET_OS" = xsolaris; then ihse@839: OPENWIN_HOME="/usr/openwin" kevinw@2215: X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions" kevinw@2215: X_LIBS="-L$SYSROOT$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \ kevinw@2215: -L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \ kevinw@2215: -R$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \ kevinw@2215: -R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR" ihse@839: fi erikj@459: ihse@839: # ihse@839: # Weird Sol10 something check...TODO change to try compile ihse@839: # ihse@839: if test "x${OPENJDK_TARGET_OS}" = xsolaris; then ihse@839: if test "`uname -r`" = "5.10"; then ihse@839: if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then ihse@839: X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS" ihse@839: fi ihse@839: fi ihse@839: fi erikj@600: ihse@839: AC_LANG_PUSH(C) ihse@839: OLD_CFLAGS="$CFLAGS" ihse@839: CFLAGS="$CFLAGS $X_CFLAGS" erikj@459: ihse@839: # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 ihse@839: AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h], ihse@839: [X11_A_OK=yes], ihse@839: [X11_A_OK=no; break], ihse@839: [ ihse@839: # include ihse@839: # include ihse@839: ] ihse@839: ) erikj@459: ihse@839: CFLAGS="$OLD_CFLAGS" ihse@839: AC_LANG_POP(C) erikj@459: ihse@839: if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then erikj@459: HELP_MSG_MISSING_DEPENDENCY([x11]) erikj@782: AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG]) ihse@839: fi erikj@459: ihse@839: AC_SUBST(X_CFLAGS) ihse@839: AC_SUBST(X_LIBS) erikj@459: ]) erikj@459: erikj@459: AC_DEFUN_ONCE([LIB_SETUP_CUPS], erikj@459: [ erikj@459: ihse@839: ############################################################################### ihse@839: # ihse@839: # The common unix printing system cups is used to print from java. ihse@839: # ihse@839: AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups], ihse@839: [specify prefix directory for the cups package ihse@839: (expecting the headers under PATH/include)])]) ihse@839: AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include], ihse@839: [specify directory for the cups include files])]) erikj@459: ihse@839: if test "x$CUPS_NOT_NEEDED" = xyes; then ihse@839: if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then ihse@839: AC_MSG_WARN([cups not used, so --with-cups is ignored]) ihse@839: fi ihse@839: CUPS_CFLAGS= ihse@839: else ihse@839: CUPS_FOUND=no erikj@459: ihse@839: if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then ihse@839: AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.]) ihse@839: fi erikj@459: ihse@839: if test "x${with_cups}" != x; then ihse@839: CUPS_CFLAGS="-I${with_cups}/include" ihse@839: CUPS_FOUND=yes ihse@839: fi ihse@839: if test "x${with_cups_include}" != x; then ihse@839: CUPS_CFLAGS="-I${with_cups_include}" ihse@839: CUPS_FOUND=yes ihse@839: fi ihse@839: if test "x$CUPS_FOUND" = xno; then ihse@839: BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes]) ihse@839: fi ihse@839: if test "x$CUPS_FOUND" = xno; then ihse@839: # Are the cups headers installed in the default /usr/include location? ihse@839: AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], ihse@839: [ ihse@839: CUPS_FOUND=yes ihse@839: CUPS_CFLAGS= ihse@839: DEFAULT_CUPS=yes ihse@839: ] ihse@839: ) ihse@839: fi ihse@839: if test "x$CUPS_FOUND" = xno; then ihse@839: # Getting nervous now? Lets poke around for standard Solaris third-party ihse@839: # package installation locations. ihse@839: AC_MSG_CHECKING([for cups headers]) kevinw@2215: if test -s $SYSROOT/opt/sfw/cups/include/cups/cups.h; then ihse@839: # An SFW package seems to be installed! ihse@839: CUPS_FOUND=yes kevinw@2215: CUPS_CFLAGS="-I$SYSROOT/opt/sfw/cups/include" kevinw@2215: elif test -s $SYSROOT/opt/csw/include/cups/cups.h; then ihse@839: # A CSW package seems to be installed! ihse@839: CUPS_FOUND=yes kevinw@2215: CUPS_CFLAGS="-I$SYSROOT/opt/csw/include" ihse@839: fi ihse@839: AC_MSG_RESULT([$CUPS_FOUND]) ihse@839: fi ihse@839: if test "x$CUPS_FOUND" = xno; then ihse@839: HELP_MSG_MISSING_DEPENDENCY([cups]) ihse@839: AC_MSG_ERROR([Could not find cups! $HELP_MSG ]) ihse@839: fi ihse@839: fi erikj@459: ihse@839: AC_SUBST(CUPS_CFLAGS) erikj@459: erikj@459: ]) erikj@459: kevinw@2220: AC_DEFUN([LIB_BUILD_FREETYPE], kevinw@2220: [ kevinw@2220: FREETYPE_SRC_PATH="$1" kevinw@2220: BUILD_FREETYPE=yes kevinw@2220: kevinw@2220: # Check if the freetype sources are acessible.. kevinw@2220: if ! test -d $FREETYPE_SRC_PATH; then kevinw@2220: AC_MSG_WARN([--with-freetype-src specified, but can't find path "$FREETYPE_SRC_PATH" - ignoring --with-freetype-src]) kevinw@2220: BUILD_FREETYPE=no kevinw@2220: fi kevinw@2220: # ..and contain a vc2010 project file kevinw@2220: vcxproj_path="$FREETYPE_SRC_PATH/builds/windows/vc2010/freetype.vcxproj" kevinw@2220: if test "x$BUILD_FREETYPE" = xyes && ! test -s $vcxproj_path; then kevinw@2220: AC_MSG_WARN([Can't find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src]) kevinw@2220: BUILD_FREETYPE=no kevinw@2220: fi kevinw@2220: # Now check if configure found a version of 'msbuild.exe' kevinw@2220: if test "x$BUILD_FREETYPE" = xyes && test "x$MSBUILD" == x ; then kevinw@2220: AC_MSG_WARN([Can't find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src]) kevinw@2220: BUILD_FREETYPE=no kevinw@2220: fi kevinw@2220: kevinw@2220: # Ready to go.. kevinw@2220: if test "x$BUILD_FREETYPE" = xyes; then kevinw@2220: kevinw@2220: # msbuild requires trailing slashes for output directories kevinw@2220: freetype_lib_path="$FREETYPE_SRC_PATH/lib$OPENJDK_TARGET_CPU_BITS/" kevinw@2220: freetype_lib_path_unix="$freetype_lib_path" kevinw@2220: freetype_obj_path="$FREETYPE_SRC_PATH/obj$OPENJDK_TARGET_CPU_BITS/" kevinw@2220: BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(vcxproj_path) kevinw@2220: BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(freetype_lib_path) kevinw@2220: BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(freetype_obj_path) kevinw@2220: if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then kevinw@2220: freetype_platform=x64 kevinw@2220: else kevinw@2220: freetype_platform=win32 kevinw@2220: fi kevinw@2220: kevinw@2220: # The original freetype project file is for VS 2010 (i.e. 'v100'), kevinw@2220: # so we have to adapt the toolset if building with any other toolsed (i.e. SDK). kevinw@2220: # Currently 'PLATFORM_TOOLSET' is set in 'TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT'/ kevinw@2220: # 'TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT' in toolchain_windows.m4 kevinw@2220: AC_MSG_NOTICE([Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ...]) kevinw@2220: kevinw@2220: # First we try to build the freetype.dll kevinw@2220: $ECHO -e "@echo off\n"\ kevinw@2220: "$MSBUILD $vcxproj_path "\ kevinw@2220: "/p:PlatformToolset=$PLATFORM_TOOLSET "\ kevinw@2220: "/p:Configuration=\"Release Multithreaded\" "\ kevinw@2220: "/p:Platform=$freetype_platform "\ kevinw@2220: "/p:ConfigurationType=DynamicLibrary "\ kevinw@2220: "/p:TargetName=freetype "\ kevinw@2220: "/p:OutDir=\"$freetype_lib_path\" "\ kevinw@2220: "/p:IntDir=\"$freetype_obj_path\" > freetype.log" > freetype.bat kevinw@2220: cmd /c freetype.bat kevinw@2220: kevinw@2220: if test -s "$freetype_lib_path_unix/freetype.dll"; then kevinw@2220: # If that succeeds we also build freetype.lib kevinw@2220: $ECHO -e "@echo off\n"\ kevinw@2220: "$MSBUILD $vcxproj_path "\ kevinw@2220: "/p:PlatformToolset=$PLATFORM_TOOLSET "\ kevinw@2220: "/p:Configuration=\"Release Multithreaded\" "\ kevinw@2220: "/p:Platform=$freetype_platform "\ kevinw@2220: "/p:ConfigurationType=StaticLibrary "\ kevinw@2220: "/p:TargetName=freetype "\ kevinw@2220: "/p:OutDir=\"$freetype_lib_path\" "\ kevinw@2220: "/p:IntDir=\"$freetype_obj_path\" >> freetype.log" > freetype.bat kevinw@2220: cmd /c freetype.bat kevinw@2220: kevinw@2220: if test -s "$freetype_lib_path_unix/freetype.lib"; then kevinw@2220: # Once we build both, lib and dll, set freetype lib and include path appropriately kevinw@2220: POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_SRC_PATH/include" kevinw@2220: POTENTIAL_FREETYPE_LIB_PATH="$freetype_lib_path_unix" kevinw@2220: AC_MSG_NOTICE([Compiling freetype sources succeeded! (see freetype.log for build results)]) kevinw@2220: else kevinw@2220: BUILD_FREETYPE=no kevinw@2220: fi kevinw@2220: else kevinw@2220: BUILD_FREETYPE=no kevinw@2220: fi kevinw@2220: fi kevinw@2220: ]) kevinw@2220: ihse@868: AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE], ihse@868: [ ihse@868: POTENTIAL_FREETYPE_INCLUDE_PATH="$1" ihse@868: POTENTIAL_FREETYPE_LIB_PATH="$2" ihse@868: METHOD="$3" kevinw@2220: ihse@868: # First check if the files exists. ihse@868: if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then ihse@868: # We found an arbitrary include file. That's a good sign. ihse@868: AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD]) ihse@868: FOUND_FREETYPE=yes ihse@868: ihse@868: FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" ihse@868: if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then ihse@868: AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.]) ihse@868: FOUND_FREETYPE=no ihse@868: else ihse@868: if test "x$OPENJDK_TARGET_OS" = xwindows; then ihse@868: # On Windows, we will need both .lib and .dll file. ihse@868: if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then ihse@868: AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location.]) ihse@868: FOUND_FREETYPE=no ihse@868: fi ihse@868: elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then ihse@868: # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! ihse@868: POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" ihse@868: fi ihse@868: fi ihse@868: fi ihse@868: ihse@868: if test "x$FOUND_FREETYPE" = xyes; then ihse@868: BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH) ihse@868: BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH) ihse@868: ihse@868: FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" ihse@868: AC_MSG_CHECKING([for freetype includes]) ihse@868: AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH]) ihse@868: FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" ihse@868: AC_MSG_CHECKING([for freetype libraries]) ihse@868: AC_MSG_RESULT([$FREETYPE_LIB_PATH]) ihse@868: fi ihse@868: ]) ihse@868: erikj@459: AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], erikj@459: [ erikj@459: ihse@839: ############################################################################### ihse@839: # ihse@868: # The ubiquitous freetype library is used to render fonts. ihse@839: # ihse@839: AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype], ihse@868: [specify prefix directory for the freetype package ihse@839: (expecting the libraries under PATH/lib and the headers under PATH/include)])]) ihse@868: AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include], ihse@868: [specify directory for the freetype include files])]) ihse@868: AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib], ihse@868: [specify directory for the freetype library])]) kevinw@2220: AC_ARG_WITH(freetype-src, [AS_HELP_STRING([--with-freetype-src], kevinw@2220: [specify directory with freetype sources to automatically build the library (experimental, Windows-only)])]) ihse@868: AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling], ihse@868: [disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])]) erikj@459: ihse@868: FREETYPE_CFLAGS= ihse@868: FREETYPE_LIBS= ihse@868: FREETYPE_BUNDLE_LIB_PATH= erikj@459: ihse@868: if test "x$FREETYPE_NOT_NEEDED" = xyes; then kevinw@2220: if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x || test "x$with_freetype_src" != x; then ihse@839: AC_MSG_WARN([freetype not used, so --with-freetype is ignored]) ihse@839: fi ihse@868: if test "x$enable_freetype_bundling" != x; then ihse@868: AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored]) ihse@868: fi ihse@839: else ihse@868: # freetype is needed to build; go get it! erikj@459: ihse@868: BUNDLE_FREETYPE="$enable_freetype_bundling" ihse@868: kevinw@2220: if test "x$with_freetype_src" != x; then kevinw@2220: if test "x$OPENJDK_TARGET_OS" = xwindows; then kevinw@2220: # Try to build freetype if --with-freetype-src was given on Windows kevinw@2220: LIB_BUILD_FREETYPE([$with_freetype_src]) kevinw@2220: if test "x$BUILD_FREETYPE" = xyes; then kevinw@2220: # Okay, we built it. Check that it works. kevinw@2220: LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype-src]) kevinw@2220: if test "x$FOUND_FREETYPE" != xyes; then kevinw@2220: AC_MSG_ERROR([Can not use the built freetype at location given by --with-freetype-src]) kevinw@2220: fi kevinw@2220: else kevinw@2220: AC_MSG_NOTICE([User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)]) kevinw@2220: AC_MSG_ERROR([Consider building freetype manually and using --with-freetype instead.]) kevinw@2220: fi kevinw@2220: else kevinw@2220: AC_MSG_WARN([--with-freetype-src is currently only supported on Windows - ignoring]) kevinw@2220: fi kevinw@2220: fi kevinw@2220: ihse@868: if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then ihse@868: # User has specified settings ihse@868: ihse@868: if test "x$BUNDLE_FREETYPE" = x; then ihse@868: # If not specified, default is to bundle freetype ihse@868: BUNDLE_FREETYPE=yes ihse@839: fi kevinw@2220: ihse@868: if test "x$with_freetype" != x; then ihse@868: POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include" ihse@868: POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib" ihse@839: fi kevinw@2220: ihse@868: # Allow --with-freetype-lib and --with-freetype-include to override ihse@868: if test "x$with_freetype_include" != x; then ihse@868: POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include" ihse@839: fi ihse@868: if test "x$with_freetype_lib" != x; then ihse@868: POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib" ihse@868: fi ihse@868: ihse@868: if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then ihse@868: # Okay, we got it. Check that it works. ihse@868: LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype]) ihse@868: if test "x$FOUND_FREETYPE" != xyes; then ihse@868: AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype]) erikj@459: fi ihse@868: else ihse@868: # User specified only one of lib or include. This is an error. ihse@868: if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then ihse@868: AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include]) ihse@868: AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) ihse@868: else ihse@868: AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib]) ihse@868: AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) ihse@839: fi ihse@839: fi ihse@868: else ihse@868: # User did not specify settings, but we need freetype. Try to locate it. ihse@868: ihse@868: if test "x$BUNDLE_FREETYPE" = x; then ihse@868: # If not specified, default is to bundle freetype only on windows ihse@868: if test "x$OPENJDK_TARGET_OS" = xwindows; then ihse@868: BUNDLE_FREETYPE=yes ihse@868: else ihse@868: BUNDLE_FREETYPE=no ihse@839: fi ihse@868: fi ihse@868: ihse@868: if test "x$FOUND_FREETYPE" != xyes; then ihse@868: # Check builddeps ihse@868: BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) ihse@868: # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. ihse@868: if test "x$FOUND_FREETYPE" = xyes; then ihse@868: if test "x$BUNDLE_FREETYPE" = xyes; then ihse@868: AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that]) ihse@868: FOUND_FREETYPE=no ihse@868: else ihse@868: AC_MSG_CHECKING([for freetype]) ihse@868: AC_MSG_RESULT([yes (using builddeps)]) ihse@868: fi ihse@839: fi ihse@839: fi ihse@868: kevinw@2215: # If we have a sysroot, assume that's where we are supposed to look and skip pkg-config. kevinw@2215: if test "x$SYSROOT" = x; then kevinw@2215: if test "x$FOUND_FREETYPE" != xyes; then kevinw@2215: # Check modules using pkg-config, but only if we have it (ugly output results otherwise) kevinw@2215: if test "x$PKG_CONFIG" != x; then kevinw@2215: PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) kevinw@2215: if test "x$FOUND_FREETYPE" = xyes; then kevinw@2215: # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. kevinw@2215: FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'` kevinw@2215: # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 kevinw@2215: if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then kevinw@2215: FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'` kevinw@2215: fi kevinw@2215: # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. kevinw@2215: if test "x$BUNDLE_FREETYPE" = xyes; then kevinw@2215: AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that]) kevinw@2215: FOUND_FREETYPE=no kevinw@2215: else kevinw@2215: AC_MSG_CHECKING([for freetype]) kevinw@2215: AC_MSG_RESULT([yes (using pkg-config)]) kevinw@2215: fi ihse@868: fi ihse@868: fi ihse@868: fi ihse@868: fi ihse@868: ihse@868: if test "x$FOUND_FREETYPE" != xyes; then ihse@868: # Check in well-known locations ihse@868: if test "x$OPENJDK_TARGET_OS" = xwindows; then ihse@868: FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32" ihse@868: BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) ihse@868: LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) ihse@868: if test "x$FOUND_FREETYPE" != xyes; then ihse@868: FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32" ihse@868: BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) ihse@868: LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) ihse@868: fi ihse@868: else kevinw@2215: FREETYPE_BASE_DIR="$SYSROOT/usr" ihse@868: LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) ihse@868: ihse@868: if test "x$FOUND_FREETYPE" != xyes; then kevinw@2215: FREETYPE_BASE_DIR="$SYSROOT/usr/X11" ihse@868: LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) ihse@868: fi ihse@868: ihse@868: if test "x$FOUND_FREETYPE" != xyes; then kevinw@2215: FREETYPE_BASE_DIR="$SYSROOT/usr/sfw" kevinw@2215: LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) kevinw@2215: fi kevinw@2215: kevinw@2215: if test "x$FOUND_FREETYPE" != xyes; then kevinw@2215: FREETYPE_BASE_DIR="$SYSROOT/usr" ihse@868: if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then ihse@868: LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location]) ihse@868: else ihse@868: LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location]) ihse@868: if test "x$FOUND_FREETYPE" != xyes; then ihse@868: LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location]) ihse@868: fi ihse@868: fi ihse@868: fi ihse@868: fi ihse@868: fi # end check in well-known locations ihse@868: ihse@868: if test "x$FOUND_FREETYPE" != xyes; then ihse@868: HELP_MSG_MISSING_DEPENDENCY([freetype]) ihse@868: AC_MSG_ERROR([Could not find freetype! $HELP_MSG ]) ihse@868: fi ihse@868: fi # end user specified settings ihse@868: ihse@868: # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir. ihse@868: if test "x$FREETYPE_CFLAGS" = x; then ihse@868: BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH) ihse@868: if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then ihse@868: FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH" ihse@868: else ihse@868: FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH" ihse@839: fi ihse@839: fi kevinw@2220: ihse@868: if test "x$FREETYPE_LIBS" = x; then ihse@868: BASIC_FIXUP_PATH(FREETYPE_LIB_PATH) ihse@868: if test "x$OPENJDK_TARGET_OS" = xwindows; then ihse@868: FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib" ihse@868: else ihse@868: FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype" ihse@839: fi ihse@839: fi erikj@459: ihse@868: # Try to compile it ihse@868: AC_MSG_CHECKING([if we can compile and link with freetype]) ihse@868: AC_LANG_PUSH(C++) ihse@868: PREV_CXXCFLAGS="$CXXFLAGS" ihse@873: PREV_LIBS="$LIBS" ihse@868: PREV_CXX="$CXX" kevinw@2220: CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" ihse@873: LIBS="$LIBS $FREETYPE_LIBS" ihse@868: CXX="$FIXPATH $CXX" ihse@868: AC_LINK_IFELSE([AC_LANG_SOURCE([[ ihse@868: #include ihse@868: #include FT_FREETYPE_H ihse@868: int main () { ihse@868: FT_Init_FreeType(NULL); ihse@868: return 0; ihse@868: } ihse@868: ]])], ihse@868: [ ihse@868: AC_MSG_RESULT([yes]) ihse@868: ], ihse@868: [ ihse@868: AC_MSG_RESULT([no]) ihse@868: AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.]) ihse@868: AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS]) kevinw@2220: ihse@868: HELP_MSG_MISSING_DEPENDENCY([freetype]) kevinw@2220: ihse@868: AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG]) ihse@868: ] ihse@868: ) ihse@868: CXXCFLAGS="$PREV_CXXFLAGS" ihse@873: LIBS="$PREV_LIBS" ihse@868: CXX="$PREV_CXX" ihse@868: AC_LANG_POP(C++) ihse@868: ihse@868: AC_MSG_CHECKING([if we should bundle freetype]) ihse@868: if test "x$BUNDLE_FREETYPE" = xyes; then ihse@868: FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH" ihse@839: fi ihse@868: AC_MSG_RESULT([$BUNDLE_FREETYPE]) ihse@839: ihse@868: fi # end freetype needed ihse@868: ihse@868: AC_SUBST(FREETYPE_BUNDLE_LIB_PATH) ihse@868: AC_SUBST(FREETYPE_CFLAGS) ihse@868: AC_SUBST(FREETYPE_LIBS) erikj@459: ]) erikj@459: erikj@459: AC_DEFUN_ONCE([LIB_SETUP_ALSA], erikj@459: [ erikj@459: ihse@839: ############################################################################### ihse@839: # ihse@839: # Check for alsa headers and libraries. Used on Linux/GNU systems. ihse@839: # ihse@839: AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa], ihse@839: [specify prefix directory for the alsa package ihse@839: (expecting the libraries under PATH/lib and the headers under PATH/include)])]) ihse@839: AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include], ihse@839: [specify directory for the alsa include files])]) ihse@839: AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib], ihse@839: [specify directory for the alsa library])]) erikj@459: ihse@839: if test "x$ALSA_NOT_NEEDED" = xyes; then ihse@839: if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then ihse@839: AC_MSG_WARN([alsa not used, so --with-alsa is ignored]) ihse@839: fi ihse@839: ALSA_CFLAGS= ihse@839: ALSA_LIBS= ihse@839: else ihse@839: ALSA_FOUND=no erikj@459: ihse@839: if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then ihse@839: AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.]) ihse@839: fi erikj@459: ihse@839: if test "x${with_alsa}" != x; then ihse@961: ALSA_LIBS="-L${with_alsa}/lib -lasound" ihse@839: ALSA_CFLAGS="-I${with_alsa}/include" ihse@839: ALSA_FOUND=yes ihse@839: fi ihse@839: if test "x${with_alsa_include}" != x; then ihse@839: ALSA_CFLAGS="-I${with_alsa_include}" ihse@839: ALSA_FOUND=yes ihse@839: fi ihse@839: if test "x${with_alsa_lib}" != x; then ihse@961: ALSA_LIBS="-L${with_alsa_lib} -lasound" ihse@839: ALSA_FOUND=yes ihse@839: fi ihse@839: if test "x$ALSA_FOUND" = xno; then ihse@839: BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no]) ihse@839: fi kevinw@2215: # Do not try pkg-config if we have a sysroot set. kevinw@2215: if test "x$SYSROOT" = x; then kevinw@2215: if test "x$ALSA_FOUND" = xno; then kevinw@2215: PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no]) kevinw@2215: fi ihse@839: fi ihse@839: if test "x$ALSA_FOUND" = xno; then ihse@839: AC_CHECK_HEADERS([alsa/asoundlib.h], ihse@839: [ ihse@839: ALSA_FOUND=yes ihse@839: ALSA_CFLAGS=-Iignoreme ihse@839: ALSA_LIBS=-lasound ihse@839: DEFAULT_ALSA=yes ihse@839: ], ihse@839: [ALSA_FOUND=no]) ihse@839: fi ihse@839: if test "x$ALSA_FOUND" = xno; then ihse@839: HELP_MSG_MISSING_DEPENDENCY([alsa]) ihse@839: AC_MSG_ERROR([Could not find alsa! $HELP_MSG ]) ihse@839: fi ihse@839: fi erikj@459: ihse@839: AC_SUBST(ALSA_CFLAGS) ihse@839: AC_SUBST(ALSA_LIBS) erikj@459: ]) erikj@459: prr@2400: ################################################################################ prr@2400: # Setup fontconfig prr@2400: ################################################################################ prr@2400: AC_DEFUN_ONCE([LIB_SETUP_FONTCONFIG], prr@2400: [ prr@2400: AC_ARG_WITH(fontconfig, [AS_HELP_STRING([--with-fontconfig], prr@2400: [specify prefix directory for the fontconfig package prr@2400: (expecting the headers under PATH/include)])]) prr@2400: AC_ARG_WITH(fontconfig-include, [AS_HELP_STRING([--with-fontconfig-include], prr@2400: [specify directory for the fontconfig include files])]) prr@2400: prr@2400: if test "x$FONTCONFIG_NOT_NEEDED" = xyes; then prr@2400: if (test "x${with_fontconfig}" != x && test "x${with_fontconfig}" != xno) || \ prr@2400: (test "x${with_fontconfig_include}" != x && test "x${with_fontconfig_include}" != xno); then prr@2400: AC_MSG_WARN([[fontconfig not used, so --with-fontconfig[-*] is ignored]]) prr@2400: fi prr@2400: FONTCONFIG_CFLAGS= prr@2400: else prr@2400: FONTCONFIG_FOUND=no prr@2400: prr@2400: if test "x${with_fontconfig}" = xno || test "x${with_fontconfig_include}" = xno; then prr@2400: AC_MSG_ERROR([It is not possible to disable the use of fontconfig. Remove the --without-fontconfig option.]) prr@2400: fi prr@2400: prr@2400: if test "x${with_fontconfig}" != x; then prr@2400: AC_MSG_CHECKING([for fontconfig headers]) prr@2400: if test -s "${with_fontconfig}/include/fontconfig/fontconfig.h"; then prr@2400: FONTCONFIG_CFLAGS="-I${with_fontconfig}/include" prr@2400: FONTCONFIG_FOUND=yes prr@2400: AC_MSG_RESULT([$FONTCONFIG_FOUND]) prr@2400: else prr@2400: AC_MSG_ERROR([Can't find 'include/fontconfig/fontconfig.h' under ${with_fontconfig} given with the --with-fontconfig option.]) prr@2400: fi prr@2400: fi prr@2400: if test "x${with_fontconfig_include}" != x; then prr@2400: AC_MSG_CHECKING([for fontconfig headers]) prr@2400: if test -s "${with_fontconfig_include}/fontconfig/fontconfig.h"; then prr@2400: FONTCONFIG_CFLAGS="-I${with_fontconfig_include}" prr@2400: FONTCONFIG_FOUND=yes prr@2400: AC_MSG_RESULT([$FONTCONFIG_FOUND]) prr@2400: else prr@2400: AC_MSG_ERROR([Can't find 'fontconfig/fontconfig.h' under ${with_fontconfig_include} given with the --with-fontconfig-include option.]) prr@2400: fi prr@2400: fi prr@2400: if test "x$FONTCONFIG_FOUND" = xno; then prr@2400: # Are the fontconfig headers installed in the default /usr/include location? prr@2400: AC_CHECK_HEADERS([fontconfig/fontconfig.h], [ prr@2400: FONTCONFIG_FOUND=yes prr@2400: FONTCONFIG_CFLAGS= prr@2400: DEFAULT_FONTCONFIG=yes prr@2400: ]) prr@2400: fi prr@2400: if test "x$FONTCONFIG_FOUND" = xno; then prr@2400: HELP_MSG_MISSING_DEPENDENCY([fontconfig]) prr@2400: AC_MSG_ERROR([Could not find fontconfig! $HELP_MSG ]) prr@2400: fi prr@2400: fi prr@2400: prr@2400: AC_SUBST(FONTCONFIG_CFLAGS) prr@2400: ]) prr@2400: erikj@459: AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], erikj@459: [ erikj@459: ihse@839: ############################################################################### ihse@839: # ihse@839: # Check for the jpeg library ihse@839: # erikj@459: ihse@839: USE_EXTERNAL_LIBJPEG=true ihse@839: AC_CHECK_LIB(jpeg, main, [], ihse@839: [ USE_EXTERNAL_LIBJPEG=false ihse@839: AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source]) ihse@839: ]) ihse@839: AC_SUBST(USE_EXTERNAL_LIBJPEG) erikj@459: ihse@839: ############################################################################### ihse@839: # ihse@839: # Check for the gif library ihse@839: # omajid@665: ihse@839: AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib], ihse@839: [use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) omajid@665: omajid@665: ihse@839: AC_MSG_CHECKING([for which giflib to use]) omajid@665: ihse@839: # default is bundled ihse@839: DEFAULT_GIFLIB=bundled ihse@839: ihse@839: # ihse@839: # if user didn't specify, use DEFAULT_GIFLIB ihse@839: # ihse@839: if test "x${with_giflib}" = "x"; then omajid@665: with_giflib=${DEFAULT_GIFLIB} ihse@839: fi omajid@665: ihse@839: AC_MSG_RESULT(${with_giflib}) omajid@665: ihse@839: if test "x${with_giflib}" = "xbundled"; then omajid@665: USE_EXTERNAL_LIBGIF=false ihse@839: elif test "x${with_giflib}" = "xsystem"; then omajid@665: AC_CHECK_HEADER(gif_lib.h, [], ihse@839: [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])]) omajid@665: AC_CHECK_LIB(gif, DGifGetCode, [], ihse@839: [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])]) omajid@665: omajid@665: USE_EXTERNAL_LIBGIF=true ihse@839: else omajid@665: AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled']) ihse@839: fi ihse@839: AC_SUBST(USE_EXTERNAL_LIBGIF) erikj@459: ihse@839: ############################################################################### ihse@839: # ihse@839: # Check for the zlib library ihse@839: # erikj@459: ihse@839: AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib], ihse@839: [use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) erikj@459: ihse@839: AC_CHECK_LIB(z, compress, ihse@839: [ ZLIB_FOUND=yes ], ihse@839: [ ZLIB_FOUND=no ]) erikj@459: ihse@839: AC_MSG_CHECKING([for which zlib to use]) erikj@459: ihse@839: DEFAULT_ZLIB=bundled ihse@839: if test "x$OPENJDK_TARGET_OS" = xmacosx; then ihse@839: # ihse@839: # On macosx default is system...on others default is ihse@839: # erikj@459: DEFAULT_ZLIB=system ihse@839: fi erikj@459: ihse@839: if test "x${ZLIB_FOUND}" != "xyes"; then ihse@839: # ihse@839: # If we don't find any system...set default to bundled ihse@839: # erikj@459: DEFAULT_ZLIB=bundled ihse@839: fi erikj@459: ihse@839: # ihse@839: # If user didn't specify, use DEFAULT_ZLIB ihse@839: # ihse@839: if test "x${with_zlib}" = "x"; then erikj@459: with_zlib=${DEFAULT_ZLIB} ihse@839: fi erikj@459: ihse@839: if test "x${with_zlib}" = "xbundled"; then erikj@459: USE_EXTERNAL_LIBZ=false erikj@459: AC_MSG_RESULT([bundled]) ihse@839: elif test "x${with_zlib}" = "xsystem"; then erikj@459: if test "x${ZLIB_FOUND}" = "xyes"; then ihse@839: USE_EXTERNAL_LIBZ=true ihse@839: AC_MSG_RESULT([system]) erikj@459: else ihse@839: AC_MSG_RESULT([system not found]) ihse@839: AC_MSG_ERROR([--with-zlib=system specified, but no zlib found!]) erikj@459: fi ihse@839: else ihse@839: AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) ihse@839: fi erikj@459: ihse@839: AC_SUBST(USE_EXTERNAL_LIBZ) erikj@459: ihse@839: ############################################################################### ihse@839: LIBZIP_CAN_USE_MMAP=true ohair@478: ihse@839: AC_SUBST(LIBZIP_CAN_USE_MMAP) erikj@459: ihse@839: ############################################################################### ihse@839: # ihse@839: # Check if altzone exists in time.h ihse@839: # erikj@459: ihse@839: AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [return (int)altzone;])], ihse@839: [has_altzone=yes], ihse@839: [has_altzone=no]) ihse@839: if test "x$has_altzone" = xyes; then erikj@459: AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h]) ihse@839: fi erikj@459: ihse@839: ############################################################################### ihse@839: # ihse@839: # Check the maths library ihse@839: # erikj@459: ihse@839: AC_CHECK_LIB(m, cos, [], ihse@839: [ ihse@839: AC_MSG_NOTICE([Maths library was not found]) ihse@839: ] ihse@839: ) ihse@839: AC_SUBST(LIBM) erikj@459: ihse@839: ############################################################################### ihse@839: # ihse@839: # Check for libdl.so erikj@459: ihse@839: save_LIBS="$LIBS" ihse@839: LIBS="" ihse@839: AC_CHECK_LIB(dl,dlopen) ihse@839: LIBDL="$LIBS" ihse@839: AC_SUBST(LIBDL) ihse@839: LIBS="$save_LIBS" erikj@459: ]) erikj@459: erikj@459: AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], erikj@459: [ ihse@839: ############################################################################### ihse@839: # ihse@839: # statically link libstdc++ before C++ ABI is stablized on Linux unless ihse@839: # dynamic build is configured on command line. ihse@839: # ihse@839: AC_ARG_WITH([stdc++lib], [AS_HELP_STRING([--with-stdc++lib=,,], ihse@839: [force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback])], ihse@839: [ ihse@839: if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \ ihse@839: && test "x$with_stdc__lib" != xdefault; then ihse@839: AC_MSG_ERROR([Bad parameter value --with-stdc++lib=$with_stdc__lib!]) ihse@839: fi ihse@839: ], ihse@839: [with_stdc__lib=default] ihse@839: ) erikj@459: ihse@839: if test "x$OPENJDK_TARGET_OS" = xlinux; then erikj@459: # Test if -lstdc++ works. erikj@459: AC_MSG_CHECKING([if dynamic link of stdc++ is possible]) erikj@459: AC_LANG_PUSH(C++) erikj@459: OLD_CXXFLAGS="$CXXFLAGS" erikj@459: CXXFLAGS="$CXXFLAGS -lstdc++" erikj@459: AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], ihse@839: [has_dynamic_libstdcxx=yes], ihse@839: [has_dynamic_libstdcxx=no]) erikj@459: CXXFLAGS="$OLD_CXXFLAGS" erikj@459: AC_LANG_POP(C++) erikj@459: AC_MSG_RESULT([$has_dynamic_libstdcxx]) erikj@459: erikj@459: # Test if stdc++ can be linked statically. erikj@459: AC_MSG_CHECKING([if static link of stdc++ is possible]) erikj@459: STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic" erikj@459: AC_LANG_PUSH(C++) erikj@459: OLD_LIBS="$LIBS" erikj@459: OLD_CXX="$CXX" erikj@459: LIBS="$STATIC_STDCXX_FLAGS" ihse@839: CXX="$CC" erikj@459: AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], ihse@839: [has_static_libstdcxx=yes], ihse@839: [has_static_libstdcxx=no]) erikj@459: LIBS="$OLD_LIBS" erikj@459: CXX="$OLD_CXX" erikj@459: AC_LANG_POP(C++) erikj@459: AC_MSG_RESULT([$has_static_libstdcxx]) erikj@459: tbell@511: if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then ihse@839: AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!]) erikj@459: fi erikj@459: tbell@511: if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then ihse@839: AC_MSG_ERROR([Static linking of libstdc++ was not possible!]) erikj@459: fi erikj@459: tbell@511: if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then ihse@839: AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!]) erikj@459: fi erikj@459: erikj@459: AC_MSG_CHECKING([how to link with libstdc++]) tbell@511: # If dynamic was requested, it's available since it would fail above otherwise. tbell@511: # If dynamic wasn't requested, go with static unless it isn't available. omajid@671: if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then ihse@839: LIBCXX="$LIBCXX -lstdc++" ihse@839: LDCXX="$CXX" ihse@839: STATIC_CXX_SETTING="STATIC_CXX=false" ihse@839: AC_MSG_RESULT([dynamic]) tbell@511: else ihse@839: LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" ihse@839: LDCXX="$CC" ihse@839: STATIC_CXX_SETTING="STATIC_CXX=true" ihse@839: AC_MSG_RESULT([static]) erikj@459: fi ihse@839: fi ihse@839: AC_SUBST(STATIC_CXX_SETTING) erikj@459: ihse@839: if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then omajid@671: # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS omajid@671: PKG_CHECK_MODULES([LIBFFI], [libffi]) omajid@671: ihse@839: fi omajid@671: ihse@839: if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then omajid@671: AC_CHECK_PROG([LLVM_CONFIG], [llvm-config], [llvm-config]) omajid@671: omajid@671: if test "x$LLVM_CONFIG" != xllvm-config; then ihse@839: AC_MSG_ERROR([llvm-config not found in $PATH.]) omajid@671: fi omajid@671: omajid@671: llvm_components="jit mcjit engine nativecodegen native" omajid@671: unset LLVM_CFLAGS omajid@671: for flag in $("$LLVM_CONFIG" --cxxflags); do omajid@671: if echo "${flag}" | grep -q '^-@<:@ID@:>@'; then omajid@671: if test "${flag}" != "-D_DEBUG" ; then omajid@671: if test "${LLVM_CFLAGS}" != "" ; then omajid@671: LLVM_CFLAGS="${LLVM_CFLAGS} " omajid@671: fi omajid@671: LLVM_CFLAGS="${LLVM_CFLAGS}${flag}" omajid@671: fi omajid@671: fi omajid@671: done omajid@671: llvm_version=$("${LLVM_CONFIG}" --version | sed 's/\.//; s/svn.*//') omajid@671: LLVM_CFLAGS="${LLVM_CFLAGS} -DSHARK_LLVM_VERSION=${llvm_version}" omajid@671: omajid@671: unset LLVM_LDFLAGS omajid@671: for flag in $("${LLVM_CONFIG}" --ldflags); do omajid@671: if echo "${flag}" | grep -q '^-L'; then omajid@671: if test "${LLVM_LDFLAGS}" != ""; then omajid@671: LLVM_LDFLAGS="${LLVM_LDFLAGS} " omajid@671: fi omajid@671: LLVM_LDFLAGS="${LLVM_LDFLAGS}${flag}" omajid@671: fi omajid@671: done omajid@671: omajid@671: unset LLVM_LIBS omajid@671: for flag in $("${LLVM_CONFIG}" --libs ${llvm_components}); do omajid@671: if echo "${flag}" | grep -q '^-l'; then omajid@671: if test "${LLVM_LIBS}" != ""; then omajid@671: LLVM_LIBS="${LLVM_LIBS} " omajid@671: fi omajid@671: LLVM_LIBS="${LLVM_LIBS}${flag}" omajid@671: fi omajid@671: done omajid@671: omajid@671: AC_SUBST(LLVM_CFLAGS) omajid@671: AC_SUBST(LLVM_LDFLAGS) omajid@671: AC_SUBST(LLVM_LIBS) ihse@839: fi omajid@671: ihse@839: # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) kevinw@2206: if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then kevinw@2215: LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" ihse@839: fi erikj@459: ihse@839: # TODO better (platform agnostic) test kevinw@2206: if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$TOOLCHAIN_TYPE" = xgcc; then erikj@459: LIBCXX="-lstdc++" ihse@839: fi erikj@459: ihse@839: AC_SUBST(LIBCXX) erikj@459: ]) kevinw@2206: kevinw@2206: AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS], kevinw@2206: [ kevinw@2206: if test "x$OPENJDK_TARGET_OS" = "xwindows"; then kevinw@2223: TOOLCHAIN_SETUP_VS_RUNTIME_DLLS kevinw@2206: BASIC_DEPRECATED_ARG_WITH([dxsdk]) kevinw@2206: BASIC_DEPRECATED_ARG_WITH([dxsdk-lib]) kevinw@2206: BASIC_DEPRECATED_ARG_WITH([dxsdk-include]) kevinw@2206: fi kevinw@2206: ])