]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - include/builddefs.in
misc: enable link time optimization, if requested
[thirdparty/xfsprogs-dev.git] / include / builddefs.in
index fe05dc376c97d83a279657b87e9cd58f81616aa8..7a2a6268671789a3b162cfabbd565c782cd554c4 100644 (file)
@@ -183,6 +183,15 @@ OPTIMIZER += @retpoline_cflags@
 LOADERFLAGS += @retpoline_ldflags@
 endif
 
+# Use special ar/ranlib wrappers if we have lto
+HAVE_LTO = @have_lto@
+ifeq ($(HAVE_LTO),yes)
+OPTIMIZER += @lto_cflags@
+LOADERFLAGS += @lto_ldflags@
+AR = @gcc_ar@
+RANLIB = @gcc_ranlib@
+endif
+
 GCFLAGS = $(DEBUG) \
          -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\"  \
          -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include -I$(TOPDIR)/libxfs