$(client) $(daemon):
$(E)echo LD $(LDFLAGS) -o $@ $^ $(LIBS)
- $(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+ +$(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
$(objdir)/sysdep/paths.h: Makefile
$(E)echo GEN $@
$(tests_targets): %: %.o $(tests_objs) | prepare
$(E)echo LD $(LDFLAGS) -o $@ $< "..." $(LIBS)
- $(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+ +$(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
# Hack to avoid problems with tests linking everything
$(tests_targets): LIBS += $(DAEMON_LIBS)
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([ int x = __clang__; ], [])
],
- [bird_cv_compiler_vendor=clang],
+ [bird_cv_compiler_vendor=llvm],
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([ int x = __GNUC__; ], [])
],
[
bird_tmp_cflags="$CFLAGS"
bird_tmp_ldflags="$LDFLAGS"
- CFLAGS="-flto"
- LDFLAGS="-flto=4"
+ CFLAGS="$1"
+ LDFLAGS="$2"
AC_CACHE_CHECK(
[whether link time optimizer is available],
AC_MSG_ERROR([This program requires the GNU C Compiler.])
fi
+BIRD_COMPILER_VENDOR
+
BIRD_CHECK_THREAD_LOCAL
if test "$bird_cv_thread_local" = no ; then
AC_MSG_ERROR([This program requires thread local storage.])
BIRD_CHECK_GCC_OPTION([bird_cv_c_option_werror_implicit_function_declaration], [-Werror=implicit-function-declaration], [-Wall -Wextra])
if test "$enable_debug" = no; then
- BIRD_CHECK_LTO
+ LTO_CFLAGS=-flto
+ AS_CASE(${bird_cv_compiler_vendor},
+ gnu,LTO_LDFLAGS="-flto=jobserver",
+ llvm,LTO_LDFLAGS="-flto",
+ unknown,LTO_LDFLAGS="-flto",
+ AC_MSG_ERROR([Compiler vendor check failed for LTO: got ${bird_cv_compiler_vendor}]))
+ BIRD_CHECK_LTO(${LTO_CFLAGS}, ${LTO_LDFLAGS})
fi
if test "$bird_cv_c_lto" = yes; then
- CFLAGS="$CFLAGS -flto"
- LDFLAGS="$LDFLAGS -flto=4 -g"
+ CFLAGS="$CFLAGS $LTO_CFLAGS"
+ LDFLAGS="$LDFLAGS $LTO_LDFLAGS -g"
else
LDFLAGS="$LDFLAGS -g"
fi