common/autoconf/libraries.m4

Print this page




  93 
  94   AC_MSG_CHECKING([for Mac OS X Java Framework])
  95   if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
  96     AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework])
  97   else
  98     AC_MSG_RESULT([no])
  99   fi
 100 ])
 101 
 102 AC_DEFUN_ONCE([LIB_SETUP_X11],
 103 [
 104 
 105   ###############################################################################
 106   #
 107   # Check for X Windows
 108   #
 109 
 110   # Check if the user has specified sysroot, but not --x-includes or --x-libraries.
 111   # Make a simple check for the libraries at the sysroot, and setup --x-includes and
 112   # --x-libraries for the sysroot, if that seems to be correct.
 113   if test "x$SYS_ROOT" != "x/"; then

 114     if test "x$x_includes" = xNONE; then
 115       if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then
 116         x_includes="$SYS_ROOT/usr/X11R6/include"
 117       elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then
 118         x_includes="$SYS_ROOT/usr/include"
 119       fi
 120     fi
 121     if test "x$x_libraries" = xNONE; then
 122       if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then
 123         x_libraries="$SYS_ROOT/usr/X11R6/lib"
 124       elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
 125         x_libraries="$SYS_ROOT/usr/lib64"
 126       elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then
 127         x_libraries="$SYS_ROOT/usr/lib"

 128       fi
 129     fi
 130   fi
 131 
 132   # Now let autoconf do it's magic
 133   AC_PATH_X
 134   AC_PATH_XTRA
 135 
 136   # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling
 137   # this doesn't make sense so we remove it.
 138   if test "x$COMPILE_TYPE" = xcross; then
 139     X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
 140   fi
 141 
 142   if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then
 143     HELP_MSG_MISSING_DEPENDENCY([x11])
 144     AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
 145   fi
 146 
 147   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
 148     OPENWIN_HOME="/usr/openwin"





 149   fi
 150   AC_SUBST(OPENWIN_HOME)
 151 
 152 
 153   #
 154   # Weird Sol10 something check...TODO change to try compile
 155   #
 156   if test "x${OPENJDK_TARGET_OS}" = xsolaris; then
 157     if test "`uname -r`" = "5.10"; then
 158       if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then
 159         X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS"
 160       fi
 161     fi
 162   fi
 163 
 164   AC_LANG_PUSH(C)
 165   OLD_CFLAGS="$CFLAGS"
 166   CFLAGS="$CFLAGS $X_CFLAGS"
 167 
 168   # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
 169   AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
 170       [X11_A_OK=yes],
 171       [X11_A_OK=no; break],


 220       CUPS_CFLAGS="-I${with_cups_include}"
 221       CUPS_FOUND=yes
 222     fi
 223     if test "x$CUPS_FOUND" = xno; then
 224       BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes])
 225     fi
 226     if test "x$CUPS_FOUND" = xno; then
 227       # Are the cups headers installed in the default /usr/include location?
 228       AC_CHECK_HEADERS([cups/cups.h cups/ppd.h],
 229           [
 230             CUPS_FOUND=yes
 231             CUPS_CFLAGS=
 232             DEFAULT_CUPS=yes
 233           ]
 234       )
 235     fi
 236     if test "x$CUPS_FOUND" = xno; then
 237       # Getting nervous now? Lets poke around for standard Solaris third-party
 238       # package installation locations.
 239       AC_MSG_CHECKING([for cups headers])
 240       if test -s /opt/sfw/cups/include/cups/cups.h; then
 241         # An SFW package seems to be installed!
 242         CUPS_FOUND=yes
 243         CUPS_CFLAGS="-I/opt/sfw/cups/include"
 244       elif test -s /opt/csw/include/cups/cups.h; then
 245         # A CSW package seems to be installed!
 246         CUPS_FOUND=yes
 247         CUPS_CFLAGS="-I/opt/csw/include"
 248       fi
 249       AC_MSG_RESULT([$CUPS_FOUND])
 250     fi
 251     if test "x$CUPS_FOUND" = xno; then
 252       HELP_MSG_MISSING_DEPENDENCY([cups])
 253       AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
 254     fi
 255   fi
 256 
 257   AC_SUBST(CUPS_CFLAGS)
 258 
 259 ])
 260 
 261 AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
 262 [
 263   POTENTIAL_FREETYPE_INCLUDE_PATH="$1"
 264   POTENTIAL_FREETYPE_LIB_PATH="$2"
 265   METHOD="$3"
 266   
 267   # First check if the files exists.


 381         else
 382           BUNDLE_FREETYPE=no
 383         fi
 384       fi
 385 
 386       if test "x$FOUND_FREETYPE" != xyes; then
 387         # Check builddeps
 388         BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
 389         # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
 390         if test "x$FOUND_FREETYPE" = xyes; then
 391           if test "x$BUNDLE_FREETYPE" = xyes; then
 392             AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that])
 393             FOUND_FREETYPE=no
 394           else
 395             AC_MSG_CHECKING([for freetype])
 396             AC_MSG_RESULT([yes (using builddeps)])
 397           fi
 398         fi
 399       fi
 400 


 401       if test "x$FOUND_FREETYPE" != xyes; then
 402         # Check modules using pkg-config, but only if we have it (ugly output results otherwise)
 403         if test "x$PKG_CONFIG" != x; then
 404           PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
 405           if test "x$FOUND_FREETYPE" = xyes; then
 406             # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
 407             FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'`
 408             # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
 409             if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
 410               FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'`
 411             fi
 412             # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
 413             if test "x$BUNDLE_FREETYPE" = xyes; then
 414               AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that])
 415               FOUND_FREETYPE=no
 416             else
 417               AC_MSG_CHECKING([for freetype])
 418               AC_MSG_RESULT([yes (using pkg-config)])
 419             fi
 420           fi
 421         fi
 422       fi

 423 
 424       if test "x$FOUND_FREETYPE" != xyes; then
 425         # Check in well-known locations
 426         if test "x$OPENJDK_TARGET_OS" = xwindows; then
 427           FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32"
 428           BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
 429           LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
 430           if test "x$FOUND_FREETYPE" != xyes; then
 431             FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32"
 432             BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
 433             LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
 434           fi
 435         else
 436           if test "x$SYS_ROOT" = "x/"; then
 437             FREETYPE_ROOT=
 438           else
 439             FREETYPE_ROOT="$SYS_ROOT"
 440           fi
 441           FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"
 442           LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
 443 
 444           if test "x$FOUND_FREETYPE" != xyes; then
 445             FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr/X11"
 446             LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
 447           fi
 448 
 449           if test "x$FOUND_FREETYPE" != xyes; then
 450             FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"





 451             if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
 452               LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location])
 453             else
 454               LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location])
 455               if test "x$FOUND_FREETYPE" != xyes; then
 456                 LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location])
 457               fi
 458             fi
 459           fi
 460         fi
 461       fi # end check in well-known locations
 462 
 463       if test "x$FOUND_FREETYPE" != xyes; then
 464         HELP_MSG_MISSING_DEPENDENCY([freetype])
 465         AC_MSG_ERROR([Could not find freetype! $HELP_MSG ])
 466       fi
 467     fi # end user specified settings
 468 
 469     # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir.
 470     if test "x$FREETYPE_CFLAGS" = x; then


 560     if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then
 561       AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.])
 562     fi
 563 
 564     if test "x${with_alsa}" != x; then
 565       ALSA_LIBS="-L${with_alsa}/lib -lasound"
 566       ALSA_CFLAGS="-I${with_alsa}/include"
 567       ALSA_FOUND=yes
 568     fi
 569     if test "x${with_alsa_include}" != x; then
 570       ALSA_CFLAGS="-I${with_alsa_include}"
 571       ALSA_FOUND=yes
 572     fi
 573     if test "x${with_alsa_lib}" != x; then
 574       ALSA_LIBS="-L${with_alsa_lib} -lasound"
 575       ALSA_FOUND=yes
 576     fi
 577     if test "x$ALSA_FOUND" = xno; then
 578       BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no])
 579     fi


 580     if test "x$ALSA_FOUND" = xno; then
 581       PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
 582     fi

 583     if test "x$ALSA_FOUND" = xno; then
 584       AC_CHECK_HEADERS([alsa/asoundlib.h],
 585           [
 586             ALSA_FOUND=yes
 587             ALSA_CFLAGS=-Iignoreme
 588             ALSA_LIBS=-lasound
 589             DEFAULT_ALSA=yes
 590           ],
 591           [ALSA_FOUND=no])
 592     fi
 593     if test "x$ALSA_FOUND" = xno; then
 594       HELP_MSG_MISSING_DEPENDENCY([alsa])
 595       AC_MSG_ERROR([Could not find alsa! $HELP_MSG ])
 596     fi
 597   fi
 598 
 599   AC_SUBST(ALSA_CFLAGS)
 600   AC_SUBST(ALSA_LIBS)
 601 ])
 602 


 900       fi
 901     done
 902 
 903     unset LLVM_LIBS
 904     for flag in $("${LLVM_CONFIG}" --libs ${llvm_components}); do
 905       if echo "${flag}" | grep -q '^-l'; then
 906         if test "${LLVM_LIBS}" != ""; then
 907           LLVM_LIBS="${LLVM_LIBS} "
 908         fi
 909         LLVM_LIBS="${LLVM_LIBS}${flag}"
 910       fi
 911     done
 912 
 913     AC_SUBST(LLVM_CFLAGS)
 914     AC_SUBST(LLVM_LDFLAGS)
 915     AC_SUBST(LLVM_LIBS)
 916   fi
 917 
 918   # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
 919   if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then
 920     LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
 921   fi
 922 
 923   # TODO better (platform agnostic) test
 924   if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$TOOLCHAIN_TYPE" = xgcc; then
 925     LIBCXX="-lstdc++"
 926   fi
 927 
 928   AC_SUBST(LIBCXX)
 929 ])
 930 
 931 AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS],
 932 [
 933   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
 934     TOOLCHAIN_SETUP_MSVCR_DLL
 935     BASIC_DEPRECATED_ARG_WITH([dxsdk])
 936     BASIC_DEPRECATED_ARG_WITH([dxsdk-lib])
 937     BASIC_DEPRECATED_ARG_WITH([dxsdk-include])
 938   fi
 939   AC_SUBST(MSVCR_DLL)
 940 ])


  93 
  94   AC_MSG_CHECKING([for Mac OS X Java Framework])
  95   if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
  96     AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework])
  97   else
  98     AC_MSG_RESULT([no])
  99   fi
 100 ])
 101 
 102 AC_DEFUN_ONCE([LIB_SETUP_X11],
 103 [
 104 
 105   ###############################################################################
 106   #
 107   # Check for X Windows
 108   #
 109 
 110   # Check if the user has specified sysroot, but not --x-includes or --x-libraries.
 111   # Make a simple check for the libraries at the sysroot, and setup --x-includes and
 112   # --x-libraries for the sysroot, if that seems to be correct.
 113   if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
 114     if test "x$SYSROOT" != "x"; then
 115       if test "x$x_includes" = xNONE; then
 116         if test -f "$SYSROOT/usr/X11R6/include/X11/Xlib.h"; then
 117           x_includes="$SYSROOT/usr/X11R6/include"
 118         elif test -f "$SYSROOT/usr/include/X11/Xlib.h"; then
 119           x_includes="$SYSROOT/usr/include"
 120         fi
 121       fi
 122       if test "x$x_libraries" = xNONE; then
 123         if test -f "$SYSROOT/usr/X11R6/lib/libX11.so"; then
 124           x_libraries="$SYSROOT/usr/X11R6/lib"
 125         elif test "$SYSROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
 126           x_libraries="$SYSROOT/usr/lib64"
 127         elif test -f "$SYSROOT/usr/lib/libX11.so"; then
 128           x_libraries="$SYSROOT/usr/lib"
 129         fi
 130       fi
 131     fi
 132   fi
 133 
 134   # Now let autoconf do it's magic
 135   AC_PATH_X
 136   AC_PATH_XTRA
 137 
 138   # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling
 139   # this doesn't make sense so we remove it.
 140   if test "x$COMPILE_TYPE" = xcross; then
 141     X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
 142   fi
 143 
 144   if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then
 145     HELP_MSG_MISSING_DEPENDENCY([x11])
 146     AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
 147   fi
 148 
 149   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
 150     OPENWIN_HOME="/usr/openwin"
 151     X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions"
 152     X_LIBS="-L$SYSROOT$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
 153         -L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
 154         -R$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
 155         -R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR"
 156   fi


 157 
 158   #
 159   # Weird Sol10 something check...TODO change to try compile
 160   #
 161   if test "x${OPENJDK_TARGET_OS}" = xsolaris; then
 162     if test "`uname -r`" = "5.10"; then
 163       if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then
 164         X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS"
 165       fi
 166     fi
 167   fi
 168 
 169   AC_LANG_PUSH(C)
 170   OLD_CFLAGS="$CFLAGS"
 171   CFLAGS="$CFLAGS $X_CFLAGS"
 172 
 173   # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
 174   AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
 175       [X11_A_OK=yes],
 176       [X11_A_OK=no; break],


 225       CUPS_CFLAGS="-I${with_cups_include}"
 226       CUPS_FOUND=yes
 227     fi
 228     if test "x$CUPS_FOUND" = xno; then
 229       BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes])
 230     fi
 231     if test "x$CUPS_FOUND" = xno; then
 232       # Are the cups headers installed in the default /usr/include location?
 233       AC_CHECK_HEADERS([cups/cups.h cups/ppd.h],
 234           [
 235             CUPS_FOUND=yes
 236             CUPS_CFLAGS=
 237             DEFAULT_CUPS=yes
 238           ]
 239       )
 240     fi
 241     if test "x$CUPS_FOUND" = xno; then
 242       # Getting nervous now? Lets poke around for standard Solaris third-party
 243       # package installation locations.
 244       AC_MSG_CHECKING([for cups headers])
 245       if test -s $SYSROOT/opt/sfw/cups/include/cups/cups.h; then
 246         # An SFW package seems to be installed!
 247         CUPS_FOUND=yes
 248         CUPS_CFLAGS="-I$SYSROOT/opt/sfw/cups/include"
 249       elif test -s $SYSROOT/opt/csw/include/cups/cups.h; then
 250         # A CSW package seems to be installed!
 251         CUPS_FOUND=yes
 252         CUPS_CFLAGS="-I$SYSROOT/opt/csw/include"
 253       fi
 254       AC_MSG_RESULT([$CUPS_FOUND])
 255     fi
 256     if test "x$CUPS_FOUND" = xno; then
 257       HELP_MSG_MISSING_DEPENDENCY([cups])
 258       AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
 259     fi
 260   fi
 261 
 262   AC_SUBST(CUPS_CFLAGS)
 263 
 264 ])
 265 
 266 AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
 267 [
 268   POTENTIAL_FREETYPE_INCLUDE_PATH="$1"
 269   POTENTIAL_FREETYPE_LIB_PATH="$2"
 270   METHOD="$3"
 271   
 272   # First check if the files exists.


 386         else
 387           BUNDLE_FREETYPE=no
 388         fi
 389       fi
 390 
 391       if test "x$FOUND_FREETYPE" != xyes; then
 392         # Check builddeps
 393         BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
 394         # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
 395         if test "x$FOUND_FREETYPE" = xyes; then
 396           if test "x$BUNDLE_FREETYPE" = xyes; then
 397             AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that])
 398             FOUND_FREETYPE=no
 399           else
 400             AC_MSG_CHECKING([for freetype])
 401             AC_MSG_RESULT([yes (using builddeps)])
 402           fi
 403         fi
 404       fi
 405 
 406       # If we have a sys-root, assume that's where we are supposed to look and skip pkg-config.
 407       if test "x$SYSROOT" = x; then
 408         if test "x$FOUND_FREETYPE" != xyes; then
 409           # Check modules using pkg-config, but only if we have it (ugly output results otherwise)
 410           if test "x$PKG_CONFIG" != x; then
 411             PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
 412             if test "x$FOUND_FREETYPE" = xyes; then
 413               # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
 414               FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'`
 415               # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
 416               if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
 417                 FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'`
 418               fi
 419               # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
 420               if test "x$BUNDLE_FREETYPE" = xyes; then
 421                 AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that])
 422                 FOUND_FREETYPE=no
 423               else
 424                 AC_MSG_CHECKING([for freetype])
 425                 AC_MSG_RESULT([yes (using pkg-config)])
 426               fi
 427             fi
 428           fi
 429         fi
 430       fi
 431 
 432       if test "x$FOUND_FREETYPE" != xyes; then
 433         # Check in well-known locations
 434         if test "x$OPENJDK_TARGET_OS" = xwindows; then
 435           FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32"
 436           BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
 437           LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
 438           if test "x$FOUND_FREETYPE" != xyes; then
 439             FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32"
 440             BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
 441             LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
 442           fi
 443         else
 444           FREETYPE_BASE_DIR="$SYSROOT/usr"





 445           LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
 446 
 447           if test "x$FOUND_FREETYPE" != xyes; then
 448             FREETYPE_BASE_DIR="$SYSROOT/usr/X11"
 449             LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
 450           fi
 451 
 452           if test "x$FOUND_FREETYPE" != xyes; then
 453             FREETYPE_BASE_DIR="$SYSROOT/usr/sfw"
 454             LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
 455           fi
 456 
 457           if test "x$FOUND_FREETYPE" != xyes; then
 458             FREETYPE_BASE_DIR="$SYSROOT/usr"
 459             if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
 460               LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location])
 461             else
 462               LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location])
 463               if test "x$FOUND_FREETYPE" != xyes; then
 464                 LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location])
 465               fi
 466             fi
 467           fi
 468         fi
 469       fi # end check in well-known locations
 470 
 471       if test "x$FOUND_FREETYPE" != xyes; then
 472         HELP_MSG_MISSING_DEPENDENCY([freetype])
 473         AC_MSG_ERROR([Could not find freetype! $HELP_MSG ])
 474       fi
 475     fi # end user specified settings
 476 
 477     # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir.
 478     if test "x$FREETYPE_CFLAGS" = x; then


 568     if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then
 569       AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.])
 570     fi
 571 
 572     if test "x${with_alsa}" != x; then
 573       ALSA_LIBS="-L${with_alsa}/lib -lasound"
 574       ALSA_CFLAGS="-I${with_alsa}/include"
 575       ALSA_FOUND=yes
 576     fi
 577     if test "x${with_alsa_include}" != x; then
 578       ALSA_CFLAGS="-I${with_alsa_include}"
 579       ALSA_FOUND=yes
 580     fi
 581     if test "x${with_alsa_lib}" != x; then
 582       ALSA_LIBS="-L${with_alsa_lib} -lasound"
 583       ALSA_FOUND=yes
 584     fi
 585     if test "x$ALSA_FOUND" = xno; then
 586       BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no])
 587     fi
 588     # Do not try pkg-config if we have a sysroot set.
 589     if test "x$SYSROOT" = x; then
 590       if test "x$ALSA_FOUND" = xno; then
 591         PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
 592       fi
 593     fi
 594     if test "x$ALSA_FOUND" = xno; then
 595       AC_CHECK_HEADERS([alsa/asoundlib.h],
 596           [
 597             ALSA_FOUND=yes
 598             ALSA_CFLAGS=-Iignoreme
 599             ALSA_LIBS=-lasound
 600             DEFAULT_ALSA=yes
 601           ],
 602           [ALSA_FOUND=no])
 603     fi
 604     if test "x$ALSA_FOUND" = xno; then
 605       HELP_MSG_MISSING_DEPENDENCY([alsa])
 606       AC_MSG_ERROR([Could not find alsa! $HELP_MSG ])
 607     fi
 608   fi
 609 
 610   AC_SUBST(ALSA_CFLAGS)
 611   AC_SUBST(ALSA_LIBS)
 612 ])
 613 


 911       fi
 912     done
 913 
 914     unset LLVM_LIBS
 915     for flag in $("${LLVM_CONFIG}" --libs ${llvm_components}); do
 916       if echo "${flag}" | grep -q '^-l'; then
 917         if test "${LLVM_LIBS}" != ""; then
 918           LLVM_LIBS="${LLVM_LIBS} "
 919         fi
 920         LLVM_LIBS="${LLVM_LIBS}${flag}"
 921       fi
 922     done
 923 
 924     AC_SUBST(LLVM_CFLAGS)
 925     AC_SUBST(LLVM_LDFLAGS)
 926     AC_SUBST(LLVM_LIBS)
 927   fi
 928 
 929   # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
 930   if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then
 931     LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
 932   fi
 933 
 934   # TODO better (platform agnostic) test
 935   if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$TOOLCHAIN_TYPE" = xgcc; then
 936     LIBCXX="-lstdc++"
 937   fi
 938 
 939   AC_SUBST(LIBCXX)
 940 ])
 941 
 942 AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS],
 943 [
 944   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
 945     TOOLCHAIN_SETUP_MSVCR_DLL
 946     BASIC_DEPRECATED_ARG_WITH([dxsdk])
 947     BASIC_DEPRECATED_ARG_WITH([dxsdk-lib])
 948     BASIC_DEPRECATED_ARG_WITH([dxsdk-include])
 949   fi
 950   AC_SUBST(MSVCR_DLL)
 951 ])