build: find lto-wrappers where appropriate

This commit is contained in:
Danny Robson 2015-02-04 15:59:22 +11:00
parent b542062cc4
commit 997dd3415d
2 changed files with 16 additions and 9 deletions

View File

@ -14,23 +14,21 @@ AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS AC_USE_SYSTEM_EXTENSIONS
AC_CANONICAL_HOST AC_CANONICAL_HOST
LT_INIT
AC_LANG([C++]) AC_LANG([C++])
AC_PROG_CXX
AC_PROG_CXXCPP
AX_COMPILER_VENDOR NC_CXX
NC_PLATFORM
NC_OPTIMISATION
NC_WARNINGS
NC_DEBUGGING
LT_INIT
AM_INIT_AUTOMAKE([1.14 dist-bzip2 dist-xz foreign subdir-objects]) AM_INIT_AUTOMAKE([1.14 dist-bzip2 dist-xz foreign subdir-objects])
AM_SILENT_RULES([yes]) AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
NC_CXX
NC_PLATFORM
NC_WARNINGS
NC_DEBUGGING
NC_OPTIMISATION
############################################################################### ###############################################################################
## Architecture features ## Architecture features

View File

@ -2,6 +2,9 @@ AC_DEFUN([NC_OPTIMISATION],[
##------------------------------------------------------------------------- ##-------------------------------------------------------------------------
AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS]) AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS])
AX_REQUIRE_DEFINED([AC_CANONICAL_HOST]) AX_REQUIRE_DEFINED([AC_CANONICAL_HOST])
AX_REQUIRE_DEFINED([AX_COMPILER_VENDOR])
AX_COMPILER_VENDOR
##------------------------------------------------------------------------- ##-------------------------------------------------------------------------
AC_ARG_ENABLE([lto], [ AC_ARG_ENABLE([lto], [
@ -13,6 +16,12 @@ AC_DEFUN([NC_OPTIMISATION],[
AC_ERROR([mingw32 link-time optimisation is currently broken]) AC_ERROR([mingw32 link-time optimisation is currently broken])
]) ])
AS_IF([test "x$ax_cv_cxx_compiler_vendor" == "xgnu"], [
AC_CHECK_TOOLS([RANLIB], [gcc-ranlib ranlib])
AC_CHECK_TOOLS([AR], [gcc-ar ar])
AC_CHECK_TOOLS([NM], [gcc-nm nm])
])
AX_APPEND_COMPILE_FLAGS([-flto], [], [-Werror]) AX_APPEND_COMPILE_FLAGS([-flto], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fno-fat-lto-objects], [], [-Werror]) AX_APPEND_COMPILE_FLAGS([-fno-fat-lto-objects], [], [-Werror])
AX_APPEND_LINK_FLAGS([-fuse-linker-plugin], [], [-Werror]) AX_APPEND_LINK_FLAGS([-fuse-linker-plugin], [], [-Werror])