comparison common/autoconf/build-performance.m4 @ 1853:c4d72a162083

8146091: Configure fails to configure icecc on OEL Reviewed-by: ihse
author erikj
date Fri, 08 Jan 2016 15:05:43 +0100
parents e79b5043fd02
children f665c7ac61bc
comparison
equal deleted inserted replaced
26:398c6f823705 27:63f3cbacb1e9
251 fi 251 fi
252 ]) 252 ])
253 253
254 ################################################################################ 254 ################################################################################
255 # 255 #
256 # Runs icecc-create-env once and prints the error if it fails
257 #
258 # $1: arguments to icecc-create-env
259 # $2: log file
260 #
261 AC_DEFUN([BPERF_RUN_ICECC_CREATE_ENV],
262 [
263 cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
264 && ${ICECC_CREATE_ENV} $1 > $2 2>&1
265 if test "$?" != "0"; then
266 AC_MSG_NOTICE([icecc-create-env output:])
267 cat $2
268 AC_MSG_ERROR([Failed to create icecc compiler environment])
269 fi
270 ])
271
272 ################################################################################
273 #
256 # Optionally enable distributed compilation of native code using icecc/icecream 274 # Optionally enable distributed compilation of native code using icecc/icecream
257 # 275 #
258 AC_DEFUN([BPERF_SETUP_ICECC], 276 AC_DEFUN([BPERF_SETUP_ICECC],
259 [ 277 [
260 AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc], 278 AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc],
269 BASIC_REQUIRE_PROGS(ICECC_CREATE_ENV, icecc-create-env) 287 BASIC_REQUIRE_PROGS(ICECC_CREATE_ENV, icecc-create-env)
270 # Use icecc-create-env to create a minimal compilation environment that can 288 # Use icecc-create-env to create a minimal compilation environment that can
271 # be sent to the other hosts in the icecream cluster. 289 # be sent to the other hosts in the icecream cluster.
272 icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log" 290 icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log"
273 ${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc 291 ${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc
274 AC_MSG_CHECKING([for icecc build environment for target compiler]) 292 # Older versions of icecc does not have the --gcc parameter
293 if ${ICECC_CREATE_ENV} | $GREP -q -e --gcc; then
294 icecc_gcc_arg="--gcc"
295 fi
275 if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then 296 if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then
276 cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ 297 BPERF_RUN_ICECC_CREATE_ENV([${icecc_gcc_arg} ${CC} ${CXX}], \
277 && ${ICECC_CREATE_ENV} --gcc ${CC} ${CXX} > ${icecc_create_env_log} 298 ${icecc_create_env_log})
278 elif test "x$TOOLCHAIN_TYPE" = "xclang"; then 299 elif test "x$TOOLCHAIN_TYPE" = "xclang"; then
279 # For clang, the icecc compilerwrapper is needed. It usually resides next 300 # For clang, the icecc compilerwrapper is needed. It usually resides next
280 # to icecc-create-env. 301 # to icecc-create-env.
281 BASIC_REQUIRE_PROGS(ICECC_WRAPPER, compilerwrapper) 302 BASIC_REQUIRE_PROGS(ICECC_WRAPPER, compilerwrapper)
282 cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ 303 BPERF_RUN_ICECC_CREATE_ENV([--clang ${CC} ${ICECC_WRAPPER}], ${icecc_create_env_log})
283 && ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
284 else 304 else
285 AC_MSG_ERROR([Can only create icecc compiler packages for toolchain types gcc and clang]) 305 AC_MSG_ERROR([Can only create icecc compiler packages for toolchain types gcc and clang])
286 fi 306 fi
287 PATH="$old_path" 307 PATH="$old_path"
288 # The bundle with the compiler gets a name based on checksums. Parse log file 308 # The bundle with the compiler gets a name based on checksums. Parse log file
289 # to find it. 309 # to find it.
290 ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`" 310 ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
291 ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}" 311 ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
312 if test ! -f ${ICECC_ENV_BUNDLE}; then
313 AC_MSG_ERROR([icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}])
314 fi
315 AC_MSG_CHECKING([for icecc build environment for target compiler])
292 AC_MSG_RESULT([${ICECC_ENV_BUNDLE}]) 316 AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
293 ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}" 317 ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}"
294 318
295 if test "x${COMPILE_TYPE}" = "xcross"; then 319 if test "x${COMPILE_TYPE}" = "xcross"; then
296 # If cross compiling, create a separate env package for the build compiler 320 # If cross compiling, create a separate env package for the build compiler
297 AC_MSG_CHECKING([for icecc build environment for build compiler])
298 # Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail. 321 # Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail.
322 icecc_create_env_log_build="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env_build.log"
299 if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then 323 if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then
300 cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ 324 BPERF_RUN_ICECC_CREATE_ENV([${icecc_gcc_arg} ${BUILD_CC} ${BUILD_CXX}], \
301 && ${ICECC_CREATE_ENV} --gcc ${BUILD_CC} ${BUILD_CXX} > ${icecc_create_env_log} 325 ${icecc_create_env_log_build})
302 elif test "x${BUILD_CC##*/}" = "xclang"; then 326 elif test "x${BUILD_CC##*/}" = "xclang"; then
303 cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \ 327 BPERF_RUN_ICECC_CREATE_ENV([--clang ${BUILD_CC} ${ICECC_WRAPPER}], ${icecc_create_env_log_build})
304 && ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
305 else 328 else
306 AC_MSG_ERROR([Cannot create icecc compiler package for ${BUILD_CC}]) 329 AC_MSG_ERROR([Cannot create icecc compiler package for ${BUILD_CC}])
307 fi 330 fi
308 ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`" 331 ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log_build}`"
309 ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}" 332 ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
333 if test ! -f ${ICECC_ENV_BUNDLE}; then
334 AC_MSG_ERROR([icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}])
335 fi
336 AC_MSG_CHECKING([for icecc build environment for build compiler])
310 AC_MSG_RESULT([${ICECC_ENV_BUNDLE}]) 337 AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
311 BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \ 338 BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \
312 ICECC_CXX=${BUILD_CXX} ${ICECC_CMD}" 339 ICECC_CXX=${BUILD_CXX} ${ICECC_CMD}"
313 else 340 else
314 BUILD_ICECC="${ICECC}" 341 BUILD_ICECC="${ICECC}"