< prev index next >

make/autoconf/flags.m4

Print this page




 159     AC_SUBST(MACOSX_VERSION_MAX)
 160   fi
 161 ])
 162 
 163 # Reset the global CFLAGS/LDFLAGS variables and initialize them with the
 164 # corresponding configure arguments instead
 165 AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
 166 [
 167   if test "x$CFLAGS" != "x"; then
 168     AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
 169   fi
 170 
 171   if test "x$CXXFLAGS" != "x"; then
 172     AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
 173   fi
 174 
 175   if test "x$LDFLAGS" != "x"; then
 176     AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
 177   fi
 178 
 179   if test "x$ASFLAGS" != "x"; then
 180     AC_MSG_WARN([Ignoring ASFLAGS($ASFLAGS) found in environment. Use --with-extra-asflags])
 181   fi
 182 
 183   AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
 184       [extra flags to be used when compiling jdk c-files])])
 185 
 186   AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
 187       [extra flags to be used when compiling jdk c++-files])])
 188 
 189   AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
 190       [extra flags to be used when linking jdk])])
 191 
 192   AC_ARG_WITH(extra-asflags, [AS_HELP_STRING([--with-extra-asflags],
 193       [extra flags to be passed to the assembler])])
 194 
 195   USER_CFLAGS="$with_extra_cflags"
 196   USER_CXXFLAGS="$with_extra_cxxflags"
 197   USER_LDFLAGS="$with_extra_ldflags"
 198   USER_ASFLAGS="$with_extra_asflags"
 199 ])
 200 
 201 # Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so
 202 # that configure can use them while detecting compilers.
 203 # TOOLCHAIN_TYPE is available here.
 204 # Param 1 - Optional prefix to all variables. (e.g BUILD_)
 205 AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS],
 206 [
 207   if test "x[$]$1SYSROOT" != "x"; then
 208     if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
 209       if test "x$OPENJDK_TARGET_OS" = xsolaris; then
 210         # Solaris Studio does not have a concept of sysroot. Instead we must
 211         # make sure the default include and lib dirs are appended to each
 212         # compile and link command line. Must also add -I-xbuiltin to enable
 213         # inlining of system functions and intrinsics.
 214         $1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include"
 215         $1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
 216             -L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR"
 217         # If the devkit contains the ld linker, make sure we use it.
 218         AC_PATH_PROG(SOLARIS_LD, ld, , $DEVKIT_TOOLCHAIN_PATH:$DEVKIT_EXTRA_PATH)


 271     fi
 272   fi
 273 
 274   # FIXME: global flags are not used yet...
 275   # The "global" flags will *always* be set. Without them, it is not possible to
 276   # get a working compilation.
 277   GLOBAL_CFLAGS="$MACHINE_FLAG $SYSROOT_CFLAGS $USER_CFLAGS"
 278   GLOBAL_CXXFLAGS="$MACHINE_FLAG $SYSROOT_CFLAGS $USER_CXXFLAGS"
 279   GLOBAL_LDFLAGS="$MACHINE_FLAG $SYSROOT_LDFLAGS $USER_LDFLAGS"
 280   # FIXME: Don't really know how to do with this, but this was the old behavior
 281   GLOBAL_CPPFLAGS="$SYSROOT_CFLAGS"
 282   AC_SUBST(GLOBAL_CFLAGS)
 283   AC_SUBST(GLOBAL_CXXFLAGS)
 284   AC_SUBST(GLOBAL_LDFLAGS)
 285   AC_SUBST(GLOBAL_CPPFLAGS)
 286 
 287   # FIXME: For compatilibity, export this as EXTRA_CFLAGS for now.
 288   EXTRA_CFLAGS="$MACHINE_FLAG $USER_CFLAGS"
 289   EXTRA_CXXFLAGS="$MACHINE_FLAG $USER_CXXFLAGS"
 290   EXTRA_LDFLAGS="$MACHINE_FLAG $USER_LDFLAGS"
 291   EXTRA_ASFLAGS="$USER_ASFLAGS"
 292 
 293   AC_SUBST(EXTRA_CFLAGS)
 294   AC_SUBST(EXTRA_CXXFLAGS)
 295   AC_SUBST(EXTRA_LDFLAGS)
 296   AC_SUBST(EXTRA_ASFLAGS)
 297 
 298   # For autoconf testing to work, the global flags must also be stored in the
 299   # "unnamed" CFLAGS etc.
 300   CFLAGS="$GLOBAL_CFLAGS"
 301   CXXFLAGS="$GLOBAL_CXXFLAGS"
 302   LDFLAGS="$GLOBAL_LDFLAGS"
 303   CPPFLAGS="$GLOBAL_CPPFLAGS"
 304 ])
 305 
 306 AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
 307 [
 308   # COMPILER_TARGET_BITS_FLAG  : option for selecting 32- or 64-bit output
 309   # COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler
 310   # COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder
 311   #                              commands produced by the link step (currently AIX only)
 312   if test "x$TOOLCHAIN_TYPE" = xxlc; then
 313     COMPILER_TARGET_BITS_FLAG="-q"
 314     COMPILER_COMMAND_FILE_FLAG="-f"
 315     COMPILER_BINDCMD_FILE_FLAG="-bloadmap:"
 316   else




 159     AC_SUBST(MACOSX_VERSION_MAX)
 160   fi
 161 ])
 162 
 163 # Reset the global CFLAGS/LDFLAGS variables and initialize them with the
 164 # corresponding configure arguments instead
 165 AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
 166 [
 167   if test "x$CFLAGS" != "x"; then
 168     AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
 169   fi
 170 
 171   if test "x$CXXFLAGS" != "x"; then
 172     AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
 173   fi
 174 
 175   if test "x$LDFLAGS" != "x"; then
 176     AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
 177   fi
 178 




 179   AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
 180       [extra flags to be used when compiling jdk c-files])])
 181 
 182   AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
 183       [extra flags to be used when compiling jdk c++-files])])
 184 
 185   AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
 186       [extra flags to be used when linking jdk])])
 187 



 188   USER_CFLAGS="$with_extra_cflags"
 189   USER_CXXFLAGS="$with_extra_cxxflags"
 190   USER_LDFLAGS="$with_extra_ldflags"

 191 ])
 192 
 193 # Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so
 194 # that configure can use them while detecting compilers.
 195 # TOOLCHAIN_TYPE is available here.
 196 # Param 1 - Optional prefix to all variables. (e.g BUILD_)
 197 AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS],
 198 [
 199   if test "x[$]$1SYSROOT" != "x"; then
 200     if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
 201       if test "x$OPENJDK_TARGET_OS" = xsolaris; then
 202         # Solaris Studio does not have a concept of sysroot. Instead we must
 203         # make sure the default include and lib dirs are appended to each
 204         # compile and link command line. Must also add -I-xbuiltin to enable
 205         # inlining of system functions and intrinsics.
 206         $1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include"
 207         $1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
 208             -L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR"
 209         # If the devkit contains the ld linker, make sure we use it.
 210         AC_PATH_PROG(SOLARIS_LD, ld, , $DEVKIT_TOOLCHAIN_PATH:$DEVKIT_EXTRA_PATH)


 263     fi
 264   fi
 265 
 266   # FIXME: global flags are not used yet...
 267   # The "global" flags will *always* be set. Without them, it is not possible to
 268   # get a working compilation.
 269   GLOBAL_CFLAGS="$MACHINE_FLAG $SYSROOT_CFLAGS $USER_CFLAGS"
 270   GLOBAL_CXXFLAGS="$MACHINE_FLAG $SYSROOT_CFLAGS $USER_CXXFLAGS"
 271   GLOBAL_LDFLAGS="$MACHINE_FLAG $SYSROOT_LDFLAGS $USER_LDFLAGS"
 272   # FIXME: Don't really know how to do with this, but this was the old behavior
 273   GLOBAL_CPPFLAGS="$SYSROOT_CFLAGS"
 274   AC_SUBST(GLOBAL_CFLAGS)
 275   AC_SUBST(GLOBAL_CXXFLAGS)
 276   AC_SUBST(GLOBAL_LDFLAGS)
 277   AC_SUBST(GLOBAL_CPPFLAGS)
 278 
 279   # FIXME: For compatilibity, export this as EXTRA_CFLAGS for now.
 280   EXTRA_CFLAGS="$MACHINE_FLAG $USER_CFLAGS"
 281   EXTRA_CXXFLAGS="$MACHINE_FLAG $USER_CXXFLAGS"
 282   EXTRA_LDFLAGS="$MACHINE_FLAG $USER_LDFLAGS"

 283 
 284   AC_SUBST(EXTRA_CFLAGS)
 285   AC_SUBST(EXTRA_CXXFLAGS)
 286   AC_SUBST(EXTRA_LDFLAGS)

 287 
 288   # For autoconf testing to work, the global flags must also be stored in the
 289   # "unnamed" CFLAGS etc.
 290   CFLAGS="$GLOBAL_CFLAGS"
 291   CXXFLAGS="$GLOBAL_CXXFLAGS"
 292   LDFLAGS="$GLOBAL_LDFLAGS"
 293   CPPFLAGS="$GLOBAL_CPPFLAGS"
 294 ])
 295 
 296 AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
 297 [
 298   # COMPILER_TARGET_BITS_FLAG  : option for selecting 32- or 64-bit output
 299   # COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler
 300   # COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder
 301   #                              commands produced by the link step (currently AIX only)
 302   if test "x$TOOLCHAIN_TYPE" = xxlc; then
 303     COMPILER_TARGET_BITS_FLAG="-q"
 304     COMPILER_COMMAND_FILE_FLAG="-f"
 305     COMPILER_BINDCMD_FILE_FLAG="-bloadmap:"
 306   else


< prev index next >