Wed, 22 Jan 2014 12:53:21 -0800
Added tag jdk8-b125 for changeset 790bbd46b201
erikj@459 | 1 | # |
erikj@459 | 2 | # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
erikj@459 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
erikj@459 | 4 | # |
erikj@459 | 5 | # This code is free software; you can redistribute it and/or modify it |
erikj@459 | 6 | # under the terms of the GNU General Public License version 2 only, as |
erikj@459 | 7 | # published by the Free Software Foundation. Oracle designates this |
erikj@459 | 8 | # particular file as subject to the "Classpath" exception as provided |
erikj@459 | 9 | # by Oracle in the LICENSE file that accompanied this code. |
erikj@459 | 10 | # |
erikj@459 | 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
erikj@459 | 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
erikj@459 | 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
erikj@459 | 14 | # version 2 for more details (a copy is included in the LICENSE file that |
erikj@459 | 15 | # accompanied this code). |
erikj@459 | 16 | # |
erikj@459 | 17 | # You should have received a copy of the GNU General Public License version |
erikj@459 | 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
erikj@459 | 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
erikj@459 | 20 | # |
erikj@459 | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
erikj@459 | 22 | # or visit www.oracle.com if you need additional information or have any |
erikj@459 | 23 | # questions. |
erikj@459 | 24 | # |
erikj@459 | 25 | |
erikj@459 | 26 | AC_DEFUN_ONCE([LIB_SETUP_INIT], |
erikj@459 | 27 | [ |
ihse@839 | 28 | |
ihse@839 | 29 | ############################################################################### |
ihse@839 | 30 | # |
ihse@839 | 31 | # OS specific settings that we never will need to probe. |
ihse@839 | 32 | # |
ihse@839 | 33 | if test "x$OPENJDK_TARGET_OS" = xlinux; then |
erikj@459 | 34 | AC_MSG_CHECKING([what is not needed on Linux?]) |
erikj@459 | 35 | PULSE_NOT_NEEDED=yes |
erikj@459 | 36 | AC_MSG_RESULT([pulse]) |
ihse@839 | 37 | fi |
erikj@459 | 38 | |
ihse@839 | 39 | if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
erikj@459 | 40 | AC_MSG_CHECKING([what is not needed on Solaris?]) |
erikj@459 | 41 | ALSA_NOT_NEEDED=yes |
erikj@459 | 42 | PULSE_NOT_NEEDED=yes |
erikj@459 | 43 | AC_MSG_RESULT([alsa pulse]) |
ihse@839 | 44 | fi |
erikj@459 | 45 | |
ihse@839 | 46 | if test "x$OPENJDK_TARGET_OS" = xwindows; then |
erikj@459 | 47 | AC_MSG_CHECKING([what is not needed on Windows?]) |
ihse@839 | 48 | CUPS_NOT_NEEDED=yes |
erikj@459 | 49 | ALSA_NOT_NEEDED=yes |
erikj@459 | 50 | PULSE_NOT_NEEDED=yes |
erikj@459 | 51 | X11_NOT_NEEDED=yes |
erikj@459 | 52 | AC_MSG_RESULT([alsa cups pulse x11]) |
ihse@839 | 53 | fi |
erikj@459 | 54 | |
ihse@839 | 55 | if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
erikj@459 | 56 | AC_MSG_CHECKING([what is not needed on MacOSX?]) |
erikj@459 | 57 | ALSA_NOT_NEEDED=yes |
erikj@459 | 58 | PULSE_NOT_NEEDED=yes |
erikj@459 | 59 | X11_NOT_NEEDED=yes |
erikj@459 | 60 | # If the java runtime framework is disabled, then we need X11. |
erikj@459 | 61 | # This will be adjusted below. |
ihse@868 | 62 | AC_MSG_RESULT([alsa pulse x11]) |
ihse@839 | 63 | fi |
erikj@459 | 64 | |
ihse@839 | 65 | if test "x$OPENJDK_TARGET_OS" = xbsd; then |
erikj@459 | 66 | AC_MSG_CHECKING([what is not needed on bsd?]) |
erikj@459 | 67 | ALSA_NOT_NEEDED=yes |
ihse@839 | 68 | AC_MSG_RESULT([alsa]) |
ihse@839 | 69 | fi |
erikj@459 | 70 | |
ihse@839 | 71 | if test "x$OPENJDK" = "xfalse"; then |
ihse@868 | 72 | FREETYPE_NOT_NEEDED=yes |
ihse@839 | 73 | fi |
erikj@459 | 74 | |
ihse@839 | 75 | if test "x$SUPPORT_HEADFUL" = xno; then |
ohair@478 | 76 | X11_NOT_NEEDED=yes |
ihse@839 | 77 | fi |
ohair@478 | 78 | |
ihse@839 | 79 | ############################################################################### |
ihse@839 | 80 | # |
ihse@863 | 81 | # Check for MacOSX support for OpenJDK. |
ihse@839 | 82 | # |
erikj@459 | 83 | |
ihse@863 | 84 | BASIC_DEPRECATED_ARG_ENABLE(macosx-runtime-support, macosx_runtime_support) |
ihse@863 | 85 | |
ihse@863 | 86 | AC_MSG_CHECKING([for Mac OS X Java Framework]) |
ihse@839 | 87 | if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then |
ihse@863 | 88 | AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework]) |
ihse@839 | 89 | else |
erikj@459 | 90 | AC_MSG_RESULT([no]) |
ihse@839 | 91 | fi |
erikj@459 | 92 | ]) |
erikj@459 | 93 | |
erikj@459 | 94 | AC_DEFUN_ONCE([LIB_SETUP_X11], |
erikj@459 | 95 | [ |
erikj@459 | 96 | |
ihse@839 | 97 | ############################################################################### |
ihse@839 | 98 | # |
ihse@839 | 99 | # Check for X Windows |
ihse@839 | 100 | # |
erikj@459 | 101 | |
ihse@839 | 102 | # Check if the user has specified sysroot, but not --x-includes or --x-libraries. |
ihse@839 | 103 | # Make a simple check for the libraries at the sysroot, and setup --x-includes and |
ihse@839 | 104 | # --x-libraries for the sysroot, if that seems to be correct. |
ihse@839 | 105 | if test "x$SYS_ROOT" != "x/"; then |
ihse@839 | 106 | if test "x$x_includes" = xNONE; then |
ihse@839 | 107 | if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then |
ihse@839 | 108 | x_includes="$SYS_ROOT/usr/X11R6/include" |
ihse@839 | 109 | elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then |
ihse@839 | 110 | x_includes="$SYS_ROOT/usr/include" |
ihse@839 | 111 | fi |
ihse@839 | 112 | fi |
ihse@839 | 113 | if test "x$x_libraries" = xNONE; then |
ihse@839 | 114 | if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then |
ihse@839 | 115 | x_libraries="$SYS_ROOT/usr/X11R6/lib" |
ihse@839 | 116 | elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
ihse@839 | 117 | x_libraries="$SYS_ROOT/usr/lib64" |
ihse@839 | 118 | elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then |
ihse@839 | 119 | x_libraries="$SYS_ROOT/usr/lib" |
ihse@839 | 120 | fi |
erikj@459 | 121 | fi |
erikj@459 | 122 | fi |
ihse@839 | 123 | |
ihse@839 | 124 | # Now let autoconf do it's magic |
ihse@839 | 125 | AC_PATH_X |
ihse@839 | 126 | AC_PATH_XTRA |
ihse@839 | 127 | |
ihse@839 | 128 | # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling |
ihse@839 | 129 | # this doesn't make sense so we remove it. |
ihse@839 | 130 | if test "x$COMPILE_TYPE" = xcross; then |
ihse@839 | 131 | X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'` |
ihse@839 | 132 | fi |
ihse@839 | 133 | |
ihse@839 | 134 | if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then |
ihse@839 | 135 | HELP_MSG_MISSING_DEPENDENCY([x11]) |
ihse@839 | 136 | AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG]) |
ihse@839 | 137 | fi |
ihse@839 | 138 | |
ihse@839 | 139 | if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
ihse@839 | 140 | OPENWIN_HOME="/usr/openwin" |
ihse@839 | 141 | fi |
ihse@839 | 142 | AC_SUBST(OPENWIN_HOME) |
erikj@459 | 143 | |
erikj@459 | 144 | |
ihse@839 | 145 | # |
ihse@839 | 146 | # Weird Sol10 something check...TODO change to try compile |
ihse@839 | 147 | # |
ihse@839 | 148 | if test "x${OPENJDK_TARGET_OS}" = xsolaris; then |
ihse@839 | 149 | if test "`uname -r`" = "5.10"; then |
ihse@839 | 150 | if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then |
ihse@839 | 151 | X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS" |
ihse@839 | 152 | fi |
ihse@839 | 153 | fi |
ihse@839 | 154 | fi |
erikj@600 | 155 | |
ihse@839 | 156 | AC_LANG_PUSH(C) |
ihse@839 | 157 | OLD_CFLAGS="$CFLAGS" |
ihse@839 | 158 | CFLAGS="$CFLAGS $X_CFLAGS" |
erikj@459 | 159 | |
ihse@839 | 160 | # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 |
ihse@839 | 161 | AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h], |
ihse@839 | 162 | [X11_A_OK=yes], |
ihse@839 | 163 | [X11_A_OK=no; break], |
ihse@839 | 164 | [ |
ihse@839 | 165 | # include <X11/Xlib.h> |
ihse@839 | 166 | # include <X11/Xutil.h> |
ihse@839 | 167 | ] |
ihse@839 | 168 | ) |
erikj@459 | 169 | |
ihse@839 | 170 | CFLAGS="$OLD_CFLAGS" |
ihse@839 | 171 | AC_LANG_POP(C) |
erikj@459 | 172 | |
ihse@839 | 173 | if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then |
erikj@459 | 174 | HELP_MSG_MISSING_DEPENDENCY([x11]) |
erikj@782 | 175 | AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG]) |
ihse@839 | 176 | fi |
erikj@459 | 177 | |
ihse@839 | 178 | AC_SUBST(X_CFLAGS) |
ihse@839 | 179 | AC_SUBST(X_LIBS) |
erikj@459 | 180 | ]) |
erikj@459 | 181 | |
erikj@459 | 182 | AC_DEFUN_ONCE([LIB_SETUP_CUPS], |
erikj@459 | 183 | [ |
erikj@459 | 184 | |
ihse@839 | 185 | ############################################################################### |
ihse@839 | 186 | # |
ihse@839 | 187 | # The common unix printing system cups is used to print from java. |
ihse@839 | 188 | # |
ihse@839 | 189 | AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups], |
ihse@839 | 190 | [specify prefix directory for the cups package |
ihse@839 | 191 | (expecting the headers under PATH/include)])]) |
ihse@839 | 192 | AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include], |
ihse@839 | 193 | [specify directory for the cups include files])]) |
erikj@459 | 194 | |
ihse@839 | 195 | if test "x$CUPS_NOT_NEEDED" = xyes; then |
ihse@839 | 196 | if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then |
ihse@839 | 197 | AC_MSG_WARN([cups not used, so --with-cups is ignored]) |
ihse@839 | 198 | fi |
ihse@839 | 199 | CUPS_CFLAGS= |
ihse@839 | 200 | else |
ihse@839 | 201 | CUPS_FOUND=no |
erikj@459 | 202 | |
ihse@839 | 203 | if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then |
ihse@839 | 204 | AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.]) |
ihse@839 | 205 | fi |
erikj@459 | 206 | |
ihse@839 | 207 | if test "x${with_cups}" != x; then |
ihse@839 | 208 | CUPS_CFLAGS="-I${with_cups}/include" |
ihse@839 | 209 | CUPS_FOUND=yes |
ihse@839 | 210 | fi |
ihse@839 | 211 | if test "x${with_cups_include}" != x; then |
ihse@839 | 212 | CUPS_CFLAGS="-I${with_cups_include}" |
ihse@839 | 213 | CUPS_FOUND=yes |
ihse@839 | 214 | fi |
ihse@839 | 215 | if test "x$CUPS_FOUND" = xno; then |
ihse@839 | 216 | BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes]) |
ihse@839 | 217 | fi |
ihse@839 | 218 | if test "x$CUPS_FOUND" = xno; then |
ihse@839 | 219 | # Are the cups headers installed in the default /usr/include location? |
ihse@839 | 220 | AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], |
ihse@839 | 221 | [ |
ihse@839 | 222 | CUPS_FOUND=yes |
ihse@839 | 223 | CUPS_CFLAGS= |
ihse@839 | 224 | DEFAULT_CUPS=yes |
ihse@839 | 225 | ] |
ihse@839 | 226 | ) |
ihse@839 | 227 | fi |
ihse@839 | 228 | if test "x$CUPS_FOUND" = xno; then |
ihse@839 | 229 | # Getting nervous now? Lets poke around for standard Solaris third-party |
ihse@839 | 230 | # package installation locations. |
ihse@839 | 231 | AC_MSG_CHECKING([for cups headers]) |
ihse@839 | 232 | if test -s /opt/sfw/cups/include/cups/cups.h; then |
ihse@839 | 233 | # An SFW package seems to be installed! |
ihse@839 | 234 | CUPS_FOUND=yes |
ihse@839 | 235 | CUPS_CFLAGS="-I/opt/sfw/cups/include" |
ihse@839 | 236 | elif test -s /opt/csw/include/cups/cups.h; then |
ihse@839 | 237 | # A CSW package seems to be installed! |
ihse@839 | 238 | CUPS_FOUND=yes |
ihse@839 | 239 | CUPS_CFLAGS="-I/opt/csw/include" |
ihse@839 | 240 | fi |
ihse@839 | 241 | AC_MSG_RESULT([$CUPS_FOUND]) |
ihse@839 | 242 | fi |
ihse@839 | 243 | if test "x$CUPS_FOUND" = xno; then |
ihse@839 | 244 | HELP_MSG_MISSING_DEPENDENCY([cups]) |
ihse@839 | 245 | AC_MSG_ERROR([Could not find cups! $HELP_MSG ]) |
ihse@839 | 246 | fi |
ihse@839 | 247 | fi |
erikj@459 | 248 | |
ihse@839 | 249 | AC_SUBST(CUPS_CFLAGS) |
erikj@459 | 250 | |
erikj@459 | 251 | ]) |
erikj@459 | 252 | |
ihse@868 | 253 | AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE], |
ihse@868 | 254 | [ |
ihse@868 | 255 | POTENTIAL_FREETYPE_INCLUDE_PATH="$1" |
ihse@868 | 256 | POTENTIAL_FREETYPE_LIB_PATH="$2" |
ihse@868 | 257 | METHOD="$3" |
ihse@868 | 258 | |
ihse@868 | 259 | # First check if the files exists. |
ihse@868 | 260 | if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then |
ihse@868 | 261 | # We found an arbitrary include file. That's a good sign. |
ihse@868 | 262 | AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD]) |
ihse@868 | 263 | FOUND_FREETYPE=yes |
ihse@868 | 264 | |
ihse@868 | 265 | FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" |
ihse@868 | 266 | if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then |
ihse@868 | 267 | AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.]) |
ihse@868 | 268 | FOUND_FREETYPE=no |
ihse@868 | 269 | else |
ihse@868 | 270 | if test "x$OPENJDK_TARGET_OS" = xwindows; then |
ihse@868 | 271 | # On Windows, we will need both .lib and .dll file. |
ihse@868 | 272 | if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then |
ihse@868 | 273 | AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location.]) |
ihse@868 | 274 | FOUND_FREETYPE=no |
ihse@868 | 275 | fi |
ihse@868 | 276 | 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 | 277 | # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! |
ihse@868 | 278 | POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" |
ihse@868 | 279 | fi |
ihse@868 | 280 | fi |
ihse@868 | 281 | fi |
ihse@868 | 282 | |
ihse@868 | 283 | if test "x$FOUND_FREETYPE" = xyes; then |
ihse@868 | 284 | BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH) |
ihse@868 | 285 | BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH) |
ihse@868 | 286 | |
ihse@868 | 287 | FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" |
ihse@868 | 288 | AC_MSG_CHECKING([for freetype includes]) |
ihse@868 | 289 | AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH]) |
ihse@868 | 290 | FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" |
ihse@868 | 291 | AC_MSG_CHECKING([for freetype libraries]) |
ihse@868 | 292 | AC_MSG_RESULT([$FREETYPE_LIB_PATH]) |
ihse@868 | 293 | fi |
ihse@868 | 294 | ]) |
ihse@868 | 295 | |
erikj@459 | 296 | AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], |
erikj@459 | 297 | [ |
erikj@459 | 298 | |
ihse@839 | 299 | ############################################################################### |
ihse@839 | 300 | # |
ihse@868 | 301 | # The ubiquitous freetype library is used to render fonts. |
ihse@839 | 302 | # |
ihse@839 | 303 | AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype], |
ihse@868 | 304 | [specify prefix directory for the freetype package |
ihse@839 | 305 | (expecting the libraries under PATH/lib and the headers under PATH/include)])]) |
ihse@868 | 306 | AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include], |
ihse@868 | 307 | [specify directory for the freetype include files])]) |
ihse@868 | 308 | AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib], |
ihse@868 | 309 | [specify directory for the freetype library])]) |
ihse@868 | 310 | AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling], |
ihse@868 | 311 | [disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])]) |
erikj@459 | 312 | |
ihse@868 | 313 | FREETYPE_CFLAGS= |
ihse@868 | 314 | FREETYPE_LIBS= |
ihse@868 | 315 | FREETYPE_BUNDLE_LIB_PATH= |
erikj@459 | 316 | |
ihse@868 | 317 | if test "x$FREETYPE_NOT_NEEDED" = xyes; then |
ihse@839 | 318 | if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then |
ihse@839 | 319 | AC_MSG_WARN([freetype not used, so --with-freetype is ignored]) |
ihse@839 | 320 | fi |
ihse@868 | 321 | if test "x$enable_freetype_bundling" != x; then |
ihse@868 | 322 | AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored]) |
ihse@868 | 323 | fi |
ihse@839 | 324 | else |
ihse@868 | 325 | # freetype is needed to build; go get it! |
erikj@459 | 326 | |
ihse@868 | 327 | BUNDLE_FREETYPE="$enable_freetype_bundling" |
ihse@868 | 328 | |
ihse@868 | 329 | if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then |
ihse@868 | 330 | # User has specified settings |
ihse@868 | 331 | |
ihse@868 | 332 | if test "x$BUNDLE_FREETYPE" = x; then |
ihse@868 | 333 | # If not specified, default is to bundle freetype |
ihse@868 | 334 | BUNDLE_FREETYPE=yes |
ihse@839 | 335 | fi |
ihse@868 | 336 | |
ihse@868 | 337 | if test "x$with_freetype" != x; then |
ihse@868 | 338 | POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include" |
ihse@868 | 339 | POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib" |
ihse@839 | 340 | fi |
ihse@868 | 341 | |
ihse@868 | 342 | # Allow --with-freetype-lib and --with-freetype-include to override |
ihse@868 | 343 | if test "x$with_freetype_include" != x; then |
ihse@868 | 344 | POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include" |
ihse@839 | 345 | fi |
ihse@868 | 346 | if test "x$with_freetype_lib" != x; then |
ihse@868 | 347 | POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib" |
ihse@868 | 348 | fi |
ihse@868 | 349 | |
ihse@868 | 350 | if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then |
ihse@868 | 351 | # Okay, we got it. Check that it works. |
ihse@868 | 352 | LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype]) |
ihse@868 | 353 | if test "x$FOUND_FREETYPE" != xyes; then |
ihse@868 | 354 | AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype]) |
erikj@459 | 355 | fi |
ihse@868 | 356 | else |
ihse@868 | 357 | # User specified only one of lib or include. This is an error. |
ihse@868 | 358 | if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then |
ihse@868 | 359 | AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include]) |
ihse@868 | 360 | AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) |
ihse@868 | 361 | else |
ihse@868 | 362 | AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib]) |
ihse@868 | 363 | AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) |
ihse@839 | 364 | fi |
ihse@839 | 365 | fi |
ihse@868 | 366 | else |
ihse@868 | 367 | # User did not specify settings, but we need freetype. Try to locate it. |
ihse@868 | 368 | |
ihse@868 | 369 | if test "x$BUNDLE_FREETYPE" = x; then |
ihse@868 | 370 | # If not specified, default is to bundle freetype only on windows |
ihse@868 | 371 | if test "x$OPENJDK_TARGET_OS" = xwindows; then |
ihse@868 | 372 | BUNDLE_FREETYPE=yes |
ihse@868 | 373 | else |
ihse@868 | 374 | BUNDLE_FREETYPE=no |
ihse@839 | 375 | fi |
ihse@868 | 376 | fi |
ihse@868 | 377 | |
ihse@868 | 378 | if test "x$FOUND_FREETYPE" != xyes; then |
ihse@868 | 379 | # Check builddeps |
ihse@868 | 380 | BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) |
ihse@868 | 381 | # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. |
ihse@868 | 382 | if test "x$FOUND_FREETYPE" = xyes; then |
ihse@868 | 383 | if test "x$BUNDLE_FREETYPE" = xyes; then |
ihse@868 | 384 | AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that]) |
ihse@868 | 385 | FOUND_FREETYPE=no |
ihse@868 | 386 | else |
ihse@868 | 387 | AC_MSG_CHECKING([for freetype]) |
ihse@868 | 388 | AC_MSG_RESULT([yes (using builddeps)]) |
ihse@868 | 389 | fi |
ihse@839 | 390 | fi |
ihse@839 | 391 | fi |
ihse@868 | 392 | |
ihse@868 | 393 | if test "x$FOUND_FREETYPE" != xyes; then |
ihse@868 | 394 | # Check modules using pkg-config, but only if we have it (ugly output results otherwise) |
ihse@868 | 395 | if test "x$PKG_CONFIG" != x; then |
ihse@868 | 396 | PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) |
ihse@868 | 397 | if test "x$FOUND_FREETYPE" = xyes; then |
ihse@868 | 398 | # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. |
ihse@868 | 399 | FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'` |
ihse@868 | 400 | # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 |
ihse@868 | 401 | if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ihse@868 | 402 | FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'` |
ihse@868 | 403 | fi |
ihse@868 | 404 | # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. |
ihse@868 | 405 | if test "x$BUNDLE_FREETYPE" = xyes; then |
ihse@868 | 406 | AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that]) |
ihse@868 | 407 | FOUND_FREETYPE=no |
ihse@868 | 408 | else |
ihse@868 | 409 | AC_MSG_CHECKING([for freetype]) |
ihse@868 | 410 | AC_MSG_RESULT([yes (using pkg-config)]) |
ihse@868 | 411 | fi |
ihse@868 | 412 | fi |
ihse@868 | 413 | fi |
ihse@868 | 414 | fi |
ihse@868 | 415 | |
ihse@868 | 416 | if test "x$FOUND_FREETYPE" != xyes; then |
ihse@868 | 417 | # Check in well-known locations |
ihse@868 | 418 | if test "x$OPENJDK_TARGET_OS" = xwindows; then |
ihse@868 | 419 | FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32" |
ihse@868 | 420 | BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) |
ihse@868 | 421 | LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
ihse@868 | 422 | if test "x$FOUND_FREETYPE" != xyes; then |
ihse@868 | 423 | FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32" |
ihse@868 | 424 | BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) |
ihse@868 | 425 | LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
ihse@868 | 426 | fi |
ihse@868 | 427 | else |
ihse@868 | 428 | if test "x$SYS_ROOT" = "x/"; then |
ihse@868 | 429 | FREETYPE_ROOT= |
ihse@868 | 430 | else |
ihse@868 | 431 | FREETYPE_ROOT="$SYS_ROOT" |
ihse@868 | 432 | fi |
ihse@868 | 433 | FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr" |
ihse@868 | 434 | LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
ihse@868 | 435 | |
ihse@868 | 436 | if test "x$FOUND_FREETYPE" != xyes; then |
ihse@868 | 437 | FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr/X11" |
ihse@868 | 438 | LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
ihse@868 | 439 | fi |
ihse@868 | 440 | |
ihse@868 | 441 | if test "x$FOUND_FREETYPE" != xyes; then |
ihse@868 | 442 | FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr" |
ihse@868 | 443 | if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
ihse@868 | 444 | LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location]) |
ihse@868 | 445 | else |
ihse@868 | 446 | LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location]) |
ihse@868 | 447 | if test "x$FOUND_FREETYPE" != xyes; then |
ihse@868 | 448 | LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location]) |
ihse@868 | 449 | fi |
ihse@868 | 450 | fi |
ihse@868 | 451 | fi |
ihse@868 | 452 | fi |
ihse@868 | 453 | fi # end check in well-known locations |
ihse@868 | 454 | |
ihse@868 | 455 | if test "x$FOUND_FREETYPE" != xyes; then |
ihse@868 | 456 | HELP_MSG_MISSING_DEPENDENCY([freetype]) |
ihse@868 | 457 | AC_MSG_ERROR([Could not find freetype! $HELP_MSG ]) |
ihse@868 | 458 | fi |
ihse@868 | 459 | fi # end user specified settings |
ihse@868 | 460 | |
ihse@868 | 461 | # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir. |
ihse@868 | 462 | if test "x$FREETYPE_CFLAGS" = x; then |
ihse@868 | 463 | BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH) |
ihse@868 | 464 | if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then |
ihse@868 | 465 | FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH" |
ihse@868 | 466 | else |
ihse@868 | 467 | FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH" |
ihse@839 | 468 | fi |
ihse@839 | 469 | fi |
ihse@868 | 470 | |
ihse@868 | 471 | if test "x$FREETYPE_LIBS" = x; then |
ihse@868 | 472 | BASIC_FIXUP_PATH(FREETYPE_LIB_PATH) |
ihse@868 | 473 | if test "x$OPENJDK_TARGET_OS" = xwindows; then |
ihse@868 | 474 | FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib" |
ihse@868 | 475 | else |
ihse@868 | 476 | FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype" |
ihse@839 | 477 | fi |
ihse@839 | 478 | fi |
erikj@459 | 479 | |
ihse@868 | 480 | # Try to compile it |
ihse@868 | 481 | AC_MSG_CHECKING([if we can compile and link with freetype]) |
ihse@868 | 482 | AC_LANG_PUSH(C++) |
ihse@868 | 483 | PREV_CXXCFLAGS="$CXXFLAGS" |
ihse@873 | 484 | PREV_LIBS="$LIBS" |
ihse@868 | 485 | PREV_CXX="$CXX" |
ihse@868 | 486 | CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" |
ihse@873 | 487 | LIBS="$LIBS $FREETYPE_LIBS" |
ihse@868 | 488 | CXX="$FIXPATH $CXX" |
ihse@868 | 489 | AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
ihse@868 | 490 | #include<ft2build.h> |
ihse@868 | 491 | #include FT_FREETYPE_H |
ihse@868 | 492 | int main () { |
ihse@868 | 493 | FT_Init_FreeType(NULL); |
ihse@868 | 494 | return 0; |
ihse@868 | 495 | } |
ihse@868 | 496 | ]])], |
ihse@868 | 497 | [ |
ihse@868 | 498 | AC_MSG_RESULT([yes]) |
ihse@868 | 499 | ], |
ihse@868 | 500 | [ |
ihse@868 | 501 | AC_MSG_RESULT([no]) |
ihse@868 | 502 | AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.]) |
ihse@868 | 503 | AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS]) |
ihse@868 | 504 | |
ihse@868 | 505 | HELP_MSG_MISSING_DEPENDENCY([freetype]) |
ihse@868 | 506 | |
ihse@868 | 507 | AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG]) |
ihse@868 | 508 | ] |
ihse@868 | 509 | ) |
ihse@868 | 510 | CXXCFLAGS="$PREV_CXXFLAGS" |
ihse@873 | 511 | LIBS="$PREV_LIBS" |
ihse@868 | 512 | CXX="$PREV_CXX" |
ihse@868 | 513 | AC_LANG_POP(C++) |
ihse@868 | 514 | |
ihse@868 | 515 | AC_MSG_CHECKING([if we should bundle freetype]) |
ihse@868 | 516 | if test "x$BUNDLE_FREETYPE" = xyes; then |
ihse@868 | 517 | FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH" |
ihse@839 | 518 | fi |
ihse@868 | 519 | AC_MSG_RESULT([$BUNDLE_FREETYPE]) |
ihse@839 | 520 | |
ihse@868 | 521 | fi # end freetype needed |
ihse@868 | 522 | |
ihse@868 | 523 | AC_SUBST(FREETYPE_BUNDLE_LIB_PATH) |
ihse@868 | 524 | AC_SUBST(FREETYPE_CFLAGS) |
ihse@868 | 525 | AC_SUBST(FREETYPE_LIBS) |
erikj@459 | 526 | ]) |
erikj@459 | 527 | |
erikj@459 | 528 | AC_DEFUN_ONCE([LIB_SETUP_ALSA], |
erikj@459 | 529 | [ |
erikj@459 | 530 | |
ihse@839 | 531 | ############################################################################### |
ihse@839 | 532 | # |
ihse@839 | 533 | # Check for alsa headers and libraries. Used on Linux/GNU systems. |
ihse@839 | 534 | # |
ihse@839 | 535 | AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa], |
ihse@839 | 536 | [specify prefix directory for the alsa package |
ihse@839 | 537 | (expecting the libraries under PATH/lib and the headers under PATH/include)])]) |
ihse@839 | 538 | AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include], |
ihse@839 | 539 | [specify directory for the alsa include files])]) |
ihse@839 | 540 | AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib], |
ihse@839 | 541 | [specify directory for the alsa library])]) |
erikj@459 | 542 | |
ihse@839 | 543 | if test "x$ALSA_NOT_NEEDED" = xyes; then |
ihse@839 | 544 | if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then |
ihse@839 | 545 | AC_MSG_WARN([alsa not used, so --with-alsa is ignored]) |
ihse@839 | 546 | fi |
ihse@839 | 547 | ALSA_CFLAGS= |
ihse@839 | 548 | ALSA_LIBS= |
ihse@839 | 549 | else |
ihse@839 | 550 | ALSA_FOUND=no |
erikj@459 | 551 | |
ihse@839 | 552 | if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then |
ihse@839 | 553 | AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.]) |
ihse@839 | 554 | fi |
erikj@459 | 555 | |
ihse@839 | 556 | if test "x${with_alsa}" != x; then |
ihse@839 | 557 | ALSA_LIBS="-L${with_alsa}/lib -lalsa" |
ihse@839 | 558 | ALSA_CFLAGS="-I${with_alsa}/include" |
ihse@839 | 559 | ALSA_FOUND=yes |
ihse@839 | 560 | fi |
ihse@839 | 561 | if test "x${with_alsa_include}" != x; then |
ihse@839 | 562 | ALSA_CFLAGS="-I${with_alsa_include}" |
ihse@839 | 563 | ALSA_FOUND=yes |
ihse@839 | 564 | fi |
ihse@839 | 565 | if test "x${with_alsa_lib}" != x; then |
ihse@839 | 566 | ALSA_LIBS="-L${with_alsa_lib} -lalsa" |
ihse@839 | 567 | ALSA_FOUND=yes |
ihse@839 | 568 | fi |
ihse@839 | 569 | if test "x$ALSA_FOUND" = xno; then |
ihse@839 | 570 | BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no]) |
ihse@839 | 571 | fi |
ihse@839 | 572 | if test "x$ALSA_FOUND" = xno; then |
ihse@839 | 573 | PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no]) |
ihse@839 | 574 | fi |
ihse@839 | 575 | if test "x$ALSA_FOUND" = xno; then |
ihse@839 | 576 | AC_CHECK_HEADERS([alsa/asoundlib.h], |
ihse@839 | 577 | [ |
ihse@839 | 578 | ALSA_FOUND=yes |
ihse@839 | 579 | ALSA_CFLAGS=-Iignoreme |
ihse@839 | 580 | ALSA_LIBS=-lasound |
ihse@839 | 581 | DEFAULT_ALSA=yes |
ihse@839 | 582 | ], |
ihse@839 | 583 | [ALSA_FOUND=no]) |
ihse@839 | 584 | fi |
ihse@839 | 585 | if test "x$ALSA_FOUND" = xno; then |
ihse@839 | 586 | HELP_MSG_MISSING_DEPENDENCY([alsa]) |
ihse@839 | 587 | AC_MSG_ERROR([Could not find alsa! $HELP_MSG ]) |
ihse@839 | 588 | fi |
ihse@839 | 589 | fi |
erikj@459 | 590 | |
ihse@839 | 591 | AC_SUBST(ALSA_CFLAGS) |
ihse@839 | 592 | AC_SUBST(ALSA_LIBS) |
erikj@459 | 593 | ]) |
erikj@459 | 594 | |
erikj@459 | 595 | AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], |
erikj@459 | 596 | [ |
erikj@459 | 597 | |
ihse@839 | 598 | ############################################################################### |
ihse@839 | 599 | # |
ihse@839 | 600 | # Check for the jpeg library |
ihse@839 | 601 | # |
erikj@459 | 602 | |
ihse@839 | 603 | USE_EXTERNAL_LIBJPEG=true |
ihse@839 | 604 | AC_CHECK_LIB(jpeg, main, [], |
ihse@839 | 605 | [ USE_EXTERNAL_LIBJPEG=false |
ihse@839 | 606 | AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source]) |
ihse@839 | 607 | ]) |
ihse@839 | 608 | AC_SUBST(USE_EXTERNAL_LIBJPEG) |
erikj@459 | 609 | |
ihse@839 | 610 | ############################################################################### |
ihse@839 | 611 | # |
ihse@839 | 612 | # Check for the gif library |
ihse@839 | 613 | # |
omajid@665 | 614 | |
ihse@839 | 615 | AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib], |
ihse@839 | 616 | [use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) |
omajid@665 | 617 | |
omajid@665 | 618 | |
ihse@839 | 619 | AC_MSG_CHECKING([for which giflib to use]) |
omajid@665 | 620 | |
ihse@839 | 621 | # default is bundled |
ihse@839 | 622 | DEFAULT_GIFLIB=bundled |
ihse@839 | 623 | |
ihse@839 | 624 | # |
ihse@839 | 625 | # if user didn't specify, use DEFAULT_GIFLIB |
ihse@839 | 626 | # |
ihse@839 | 627 | if test "x${with_giflib}" = "x"; then |
omajid@665 | 628 | with_giflib=${DEFAULT_GIFLIB} |
ihse@839 | 629 | fi |
omajid@665 | 630 | |
ihse@839 | 631 | AC_MSG_RESULT(${with_giflib}) |
omajid@665 | 632 | |
ihse@839 | 633 | if test "x${with_giflib}" = "xbundled"; then |
omajid@665 | 634 | USE_EXTERNAL_LIBGIF=false |
ihse@839 | 635 | elif test "x${with_giflib}" = "xsystem"; then |
omajid@665 | 636 | AC_CHECK_HEADER(gif_lib.h, [], |
ihse@839 | 637 | [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])]) |
omajid@665 | 638 | AC_CHECK_LIB(gif, DGifGetCode, [], |
ihse@839 | 639 | [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])]) |
omajid@665 | 640 | |
omajid@665 | 641 | USE_EXTERNAL_LIBGIF=true |
ihse@839 | 642 | else |
omajid@665 | 643 | AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled']) |
ihse@839 | 644 | fi |
ihse@839 | 645 | AC_SUBST(USE_EXTERNAL_LIBGIF) |
erikj@459 | 646 | |
ihse@839 | 647 | ############################################################################### |
ihse@839 | 648 | # |
ihse@839 | 649 | # Check for the zlib library |
ihse@839 | 650 | # |
erikj@459 | 651 | |
ihse@839 | 652 | AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib], |
ihse@839 | 653 | [use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) |
erikj@459 | 654 | |
ihse@839 | 655 | AC_CHECK_LIB(z, compress, |
ihse@839 | 656 | [ ZLIB_FOUND=yes ], |
ihse@839 | 657 | [ ZLIB_FOUND=no ]) |
erikj@459 | 658 | |
ihse@839 | 659 | AC_MSG_CHECKING([for which zlib to use]) |
erikj@459 | 660 | |
ihse@839 | 661 | DEFAULT_ZLIB=bundled |
ihse@839 | 662 | if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
ihse@839 | 663 | # |
ihse@839 | 664 | # On macosx default is system...on others default is |
ihse@839 | 665 | # |
erikj@459 | 666 | DEFAULT_ZLIB=system |
ihse@839 | 667 | fi |
erikj@459 | 668 | |
ihse@839 | 669 | if test "x${ZLIB_FOUND}" != "xyes"; then |
ihse@839 | 670 | # |
ihse@839 | 671 | # If we don't find any system...set default to bundled |
ihse@839 | 672 | # |
erikj@459 | 673 | DEFAULT_ZLIB=bundled |
ihse@839 | 674 | fi |
erikj@459 | 675 | |
ihse@839 | 676 | # |
ihse@839 | 677 | # If user didn't specify, use DEFAULT_ZLIB |
ihse@839 | 678 | # |
ihse@839 | 679 | if test "x${with_zlib}" = "x"; then |
erikj@459 | 680 | with_zlib=${DEFAULT_ZLIB} |
ihse@839 | 681 | fi |
erikj@459 | 682 | |
ihse@839 | 683 | if test "x${with_zlib}" = "xbundled"; then |
erikj@459 | 684 | USE_EXTERNAL_LIBZ=false |
erikj@459 | 685 | AC_MSG_RESULT([bundled]) |
ihse@839 | 686 | elif test "x${with_zlib}" = "xsystem"; then |
erikj@459 | 687 | if test "x${ZLIB_FOUND}" = "xyes"; then |
ihse@839 | 688 | USE_EXTERNAL_LIBZ=true |
ihse@839 | 689 | AC_MSG_RESULT([system]) |
erikj@459 | 690 | else |
ihse@839 | 691 | AC_MSG_RESULT([system not found]) |
ihse@839 | 692 | AC_MSG_ERROR([--with-zlib=system specified, but no zlib found!]) |
erikj@459 | 693 | fi |
ihse@839 | 694 | else |
ihse@839 | 695 | AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) |
ihse@839 | 696 | fi |
erikj@459 | 697 | |
ihse@839 | 698 | AC_SUBST(USE_EXTERNAL_LIBZ) |
erikj@459 | 699 | |
ihse@839 | 700 | ############################################################################### |
ihse@839 | 701 | LIBZIP_CAN_USE_MMAP=true |
ohair@478 | 702 | |
ihse@839 | 703 | AC_SUBST(LIBZIP_CAN_USE_MMAP) |
erikj@459 | 704 | |
ihse@839 | 705 | ############################################################################### |
ihse@839 | 706 | # |
ihse@839 | 707 | # Check if altzone exists in time.h |
ihse@839 | 708 | # |
erikj@459 | 709 | |
ihse@839 | 710 | AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [return (int)altzone;])], |
ihse@839 | 711 | [has_altzone=yes], |
ihse@839 | 712 | [has_altzone=no]) |
ihse@839 | 713 | if test "x$has_altzone" = xyes; then |
erikj@459 | 714 | AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h]) |
ihse@839 | 715 | fi |
erikj@459 | 716 | |
ihse@839 | 717 | ############################################################################### |
ihse@839 | 718 | # |
ihse@839 | 719 | # Check the maths library |
ihse@839 | 720 | # |
erikj@459 | 721 | |
ihse@839 | 722 | AC_CHECK_LIB(m, cos, [], |
ihse@839 | 723 | [ |
ihse@839 | 724 | AC_MSG_NOTICE([Maths library was not found]) |
ihse@839 | 725 | ] |
ihse@839 | 726 | ) |
ihse@839 | 727 | AC_SUBST(LIBM) |
erikj@459 | 728 | |
ihse@839 | 729 | ############################################################################### |
ihse@839 | 730 | # |
ihse@839 | 731 | # Check for libdl.so |
erikj@459 | 732 | |
ihse@839 | 733 | save_LIBS="$LIBS" |
ihse@839 | 734 | LIBS="" |
ihse@839 | 735 | AC_CHECK_LIB(dl,dlopen) |
ihse@839 | 736 | LIBDL="$LIBS" |
ihse@839 | 737 | AC_SUBST(LIBDL) |
ihse@839 | 738 | LIBS="$save_LIBS" |
erikj@459 | 739 | ]) |
erikj@459 | 740 | |
erikj@459 | 741 | AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], |
erikj@459 | 742 | [ |
ihse@839 | 743 | ############################################################################### |
ihse@839 | 744 | # |
ihse@839 | 745 | # statically link libstdc++ before C++ ABI is stablized on Linux unless |
ihse@839 | 746 | # dynamic build is configured on command line. |
ihse@839 | 747 | # |
ihse@839 | 748 | AC_ARG_WITH([stdc++lib], [AS_HELP_STRING([--with-stdc++lib=<static>,<dynamic>,<default>], |
ihse@839 | 749 | [force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback])], |
ihse@839 | 750 | [ |
ihse@839 | 751 | if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \ |
ihse@839 | 752 | && test "x$with_stdc__lib" != xdefault; then |
ihse@839 | 753 | AC_MSG_ERROR([Bad parameter value --with-stdc++lib=$with_stdc__lib!]) |
ihse@839 | 754 | fi |
ihse@839 | 755 | ], |
ihse@839 | 756 | [with_stdc__lib=default] |
ihse@839 | 757 | ) |
erikj@459 | 758 | |
ihse@839 | 759 | if test "x$OPENJDK_TARGET_OS" = xlinux; then |
erikj@459 | 760 | # Test if -lstdc++ works. |
erikj@459 | 761 | AC_MSG_CHECKING([if dynamic link of stdc++ is possible]) |
erikj@459 | 762 | AC_LANG_PUSH(C++) |
erikj@459 | 763 | OLD_CXXFLAGS="$CXXFLAGS" |
erikj@459 | 764 | CXXFLAGS="$CXXFLAGS -lstdc++" |
erikj@459 | 765 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], |
ihse@839 | 766 | [has_dynamic_libstdcxx=yes], |
ihse@839 | 767 | [has_dynamic_libstdcxx=no]) |
erikj@459 | 768 | CXXFLAGS="$OLD_CXXFLAGS" |
erikj@459 | 769 | AC_LANG_POP(C++) |
erikj@459 | 770 | AC_MSG_RESULT([$has_dynamic_libstdcxx]) |
erikj@459 | 771 | |
erikj@459 | 772 | # Test if stdc++ can be linked statically. |
erikj@459 | 773 | AC_MSG_CHECKING([if static link of stdc++ is possible]) |
erikj@459 | 774 | STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic" |
erikj@459 | 775 | AC_LANG_PUSH(C++) |
erikj@459 | 776 | OLD_LIBS="$LIBS" |
erikj@459 | 777 | OLD_CXX="$CXX" |
erikj@459 | 778 | LIBS="$STATIC_STDCXX_FLAGS" |
ihse@839 | 779 | CXX="$CC" |
erikj@459 | 780 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], |
ihse@839 | 781 | [has_static_libstdcxx=yes], |
ihse@839 | 782 | [has_static_libstdcxx=no]) |
erikj@459 | 783 | LIBS="$OLD_LIBS" |
erikj@459 | 784 | CXX="$OLD_CXX" |
erikj@459 | 785 | AC_LANG_POP(C++) |
erikj@459 | 786 | AC_MSG_RESULT([$has_static_libstdcxx]) |
erikj@459 | 787 | |
tbell@511 | 788 | if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then |
ihse@839 | 789 | AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!]) |
erikj@459 | 790 | fi |
erikj@459 | 791 | |
tbell@511 | 792 | if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then |
ihse@839 | 793 | AC_MSG_ERROR([Static linking of libstdc++ was not possible!]) |
erikj@459 | 794 | fi |
erikj@459 | 795 | |
tbell@511 | 796 | if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then |
ihse@839 | 797 | AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!]) |
erikj@459 | 798 | fi |
erikj@459 | 799 | |
erikj@459 | 800 | AC_MSG_CHECKING([how to link with libstdc++]) |
tbell@511 | 801 | # If dynamic was requested, it's available since it would fail above otherwise. |
tbell@511 | 802 | # If dynamic wasn't requested, go with static unless it isn't available. |
omajid@671 | 803 | if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then |
ihse@839 | 804 | LIBCXX="$LIBCXX -lstdc++" |
ihse@839 | 805 | LDCXX="$CXX" |
ihse@839 | 806 | STATIC_CXX_SETTING="STATIC_CXX=false" |
ihse@839 | 807 | AC_MSG_RESULT([dynamic]) |
tbell@511 | 808 | else |
ihse@839 | 809 | LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" |
ihse@839 | 810 | LDCXX="$CC" |
ihse@839 | 811 | STATIC_CXX_SETTING="STATIC_CXX=true" |
ihse@839 | 812 | AC_MSG_RESULT([static]) |
erikj@459 | 813 | fi |
ihse@839 | 814 | fi |
ihse@839 | 815 | AC_SUBST(STATIC_CXX_SETTING) |
erikj@459 | 816 | |
ihse@839 | 817 | if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then |
omajid@671 | 818 | # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS |
omajid@671 | 819 | PKG_CHECK_MODULES([LIBFFI], [libffi]) |
omajid@671 | 820 | |
ihse@839 | 821 | fi |
omajid@671 | 822 | |
ihse@839 | 823 | if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then |
omajid@671 | 824 | AC_CHECK_PROG([LLVM_CONFIG], [llvm-config], [llvm-config]) |
omajid@671 | 825 | |
omajid@671 | 826 | if test "x$LLVM_CONFIG" != xllvm-config; then |
ihse@839 | 827 | AC_MSG_ERROR([llvm-config not found in $PATH.]) |
omajid@671 | 828 | fi |
omajid@671 | 829 | |
omajid@671 | 830 | llvm_components="jit mcjit engine nativecodegen native" |
omajid@671 | 831 | unset LLVM_CFLAGS |
omajid@671 | 832 | for flag in $("$LLVM_CONFIG" --cxxflags); do |
omajid@671 | 833 | if echo "${flag}" | grep -q '^-@<:@ID@:>@'; then |
omajid@671 | 834 | if test "${flag}" != "-D_DEBUG" ; then |
omajid@671 | 835 | if test "${LLVM_CFLAGS}" != "" ; then |
omajid@671 | 836 | LLVM_CFLAGS="${LLVM_CFLAGS} " |
omajid@671 | 837 | fi |
omajid@671 | 838 | LLVM_CFLAGS="${LLVM_CFLAGS}${flag}" |
omajid@671 | 839 | fi |
omajid@671 | 840 | fi |
omajid@671 | 841 | done |
omajid@671 | 842 | llvm_version=$("${LLVM_CONFIG}" --version | sed 's/\.//; s/svn.*//') |
omajid@671 | 843 | LLVM_CFLAGS="${LLVM_CFLAGS} -DSHARK_LLVM_VERSION=${llvm_version}" |
omajid@671 | 844 | |
omajid@671 | 845 | unset LLVM_LDFLAGS |
omajid@671 | 846 | for flag in $("${LLVM_CONFIG}" --ldflags); do |
omajid@671 | 847 | if echo "${flag}" | grep -q '^-L'; then |
omajid@671 | 848 | if test "${LLVM_LDFLAGS}" != ""; then |
omajid@671 | 849 | LLVM_LDFLAGS="${LLVM_LDFLAGS} " |
omajid@671 | 850 | fi |
omajid@671 | 851 | LLVM_LDFLAGS="${LLVM_LDFLAGS}${flag}" |
omajid@671 | 852 | fi |
omajid@671 | 853 | done |
omajid@671 | 854 | |
omajid@671 | 855 | unset LLVM_LIBS |
omajid@671 | 856 | for flag in $("${LLVM_CONFIG}" --libs ${llvm_components}); do |
omajid@671 | 857 | if echo "${flag}" | grep -q '^-l'; then |
omajid@671 | 858 | if test "${LLVM_LIBS}" != ""; then |
omajid@671 | 859 | LLVM_LIBS="${LLVM_LIBS} " |
omajid@671 | 860 | fi |
omajid@671 | 861 | LLVM_LIBS="${LLVM_LIBS}${flag}" |
omajid@671 | 862 | fi |
omajid@671 | 863 | done |
omajid@671 | 864 | |
omajid@671 | 865 | AC_SUBST(LLVM_CFLAGS) |
omajid@671 | 866 | AC_SUBST(LLVM_LDFLAGS) |
omajid@671 | 867 | AC_SUBST(LLVM_LIBS) |
ihse@839 | 868 | fi |
omajid@671 | 869 | |
ihse@839 | 870 | # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) |
ihse@839 | 871 | if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then |
ohair@478 | 872 | LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" |
ihse@839 | 873 | fi |
erikj@459 | 874 | |
ihse@839 | 875 | # TODO better (platform agnostic) test |
ihse@839 | 876 | if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then |
erikj@459 | 877 | LIBCXX="-lstdc++" |
ihse@839 | 878 | fi |
erikj@459 | 879 | |
ihse@839 | 880 | AC_SUBST(LIBCXX) |
erikj@459 | 881 | ]) |