< prev index next >

make/autoconf/flags.m4

Print this page
rev 54158 : 8250876: Fix issues with cross-compile on macos
Reviewed-by: erikj, ihse


 207           if "$SOLARIS_LD" -V > /dev/null 2> /dev/null; then
 208             $1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -Yl,$(dirname $SOLARIS_LD)"
 209           else
 210             AC_MSG_WARN([Could not run $SOLARIS_LD found in devkit, reverting to system ld])
 211           fi
 212         fi
 213       fi
 214     elif test "x$TOOLCHAIN_TYPE" = xgcc; then
 215       $1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT"
 216       $1SYSROOT_LDFLAGS="--sysroot=[$]$1SYSROOT"
 217     elif test "x$TOOLCHAIN_TYPE" = xclang; then
 218       $1SYSROOT_CFLAGS="-isysroot [$]$1SYSROOT"
 219       $1SYSROOT_LDFLAGS="-isysroot [$]$1SYSROOT"
 220     fi
 221   fi
 222 
 223   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
 224     # We also need -iframework<path>/System/Library/Frameworks
 225     $1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks"
 226     $1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks"
 227     # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework

 228     # set this here so it doesn't have to be peppered throughout the forest
 229     $1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
 230     $1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"

 231   fi
 232 
 233   AC_SUBST($1SYSROOT_CFLAGS)
 234   AC_SUBST($1SYSROOT_LDFLAGS)
 235 ])
 236 
 237 AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN],
 238 [
 239   # We should always include user supplied flags
 240   FLAGS_SETUP_USER_SUPPLIED_FLAGS
 241   # The sysroot flags are needed for configure to be able to run the compilers
 242   FLAGS_SETUP_SYSROOT_FLAGS
 243 
 244   # For solstudio and xlc, the word size flag is required for correct behavior.
 245   # For clang/gcc, the flag is only strictly required for reduced builds, but
 246   # set it always where possible (x86, sparc and ppc).
 247   if test "x$TOOLCHAIN_TYPE" = xxlc; then
 248     MACHINE_FLAG="-q${OPENJDK_TARGET_CPU_BITS}"
 249   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
 250     MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"




 207           if "$SOLARIS_LD" -V > /dev/null 2> /dev/null; then
 208             $1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -Yl,$(dirname $SOLARIS_LD)"
 209           else
 210             AC_MSG_WARN([Could not run $SOLARIS_LD found in devkit, reverting to system ld])
 211           fi
 212         fi
 213       fi
 214     elif test "x$TOOLCHAIN_TYPE" = xgcc; then
 215       $1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT"
 216       $1SYSROOT_LDFLAGS="--sysroot=[$]$1SYSROOT"
 217     elif test "x$TOOLCHAIN_TYPE" = xclang; then
 218       $1SYSROOT_CFLAGS="-isysroot [$]$1SYSROOT"
 219       $1SYSROOT_LDFLAGS="-isysroot [$]$1SYSROOT"
 220     fi
 221   fi
 222 
 223   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
 224     # We also need -iframework<path>/System/Library/Frameworks
 225     $1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks"
 226     $1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks"
 227     if test -d "[$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" ; then
 228       # These always need to be set on macOS 10.X, or we can't find the frameworks embedded in JavaVM.framework
 229       # set this here so it doesn't have to be peppered throughout the forest
 230       $1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
 231       $1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
 232     fi
 233   fi
 234 
 235   AC_SUBST($1SYSROOT_CFLAGS)
 236   AC_SUBST($1SYSROOT_LDFLAGS)
 237 ])
 238 
 239 AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN],
 240 [
 241   # We should always include user supplied flags
 242   FLAGS_SETUP_USER_SUPPLIED_FLAGS
 243   # The sysroot flags are needed for configure to be able to run the compilers
 244   FLAGS_SETUP_SYSROOT_FLAGS
 245 
 246   # For solstudio and xlc, the word size flag is required for correct behavior.
 247   # For clang/gcc, the flag is only strictly required for reduced builds, but
 248   # set it always where possible (x86, sparc and ppc).
 249   if test "x$TOOLCHAIN_TYPE" = xxlc; then
 250     MACHINE_FLAG="-q${OPENJDK_TARGET_CPU_BITS}"
 251   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
 252     MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"


< prev index next >