0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-10-10 00:25:06 -04:00
Files
nasm/autoconf/m4/pa_option_lto.m4
H. Peter Anvin 2de413db32 autoconf: more autoconf library macro updates
More macro updates from the pa_autoconf library.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-22 17:02:58 -07:00

22 lines
883 B
Plaintext

dnl --------------------------------------------------------------------------
dnl PA_OPTION_LTO(default)
dnl
dnl Try to enable link-time optimization. Enable it by default if
dnl the "default" argument is set to "yes"; currently the default is "no",
dnl but that could change in the future -- to force disabled by default,
dnl set to "no".
dnl --------------------------------------------------------------------------
AC_DEFUN([PA_OPTION_LTO],
[AC_BEFORE([$0],[AC_PROG_AR])dnl
AC_BEFORE([$0],[AC_PROG_RANLIB])dnl
PA_ARG_BOOL([lto],
[Try to enable link-time optimization for this compiler],
[m4_default([$1],[no])],
[PA_FIND_FLAGS([-flto=auto],[-flto])
PA_FIND_FLAGS([-ffat-lto-objects])
PA_FIND_FLAGS([-fuse-linker-plugin])
AS_IF([test x$ac_compiler_gnu = xyes],
[AC_CHECK_TOOL(AR, [gcc-ar], [ar], [:])
AC_CHECK_TOOL(RANLIB, [gcc-ranlib], [ranlib], [:])])])])