summaryrefslogtreecommitdiff
path: root/m4/linker.m4
blob: 9ac16c4ed7a60bde0e9af63bfe1d766f918c97e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.

# SJR_LINKER_OPTIMISATIONS
# --------------------------
# Add configure option to disable linker optimisations.
AC_DEFUN([SJR_LINKER_OPTIMISATIONS],
[AC_ARG_ENABLE(linker-optimisations,
	AS_HELP_STRING([--disable-linker-optimisations],
		       [Disable linker optimisations]),
[if test "x$enable_linker_optimisations" = "xno"; then
	[LDFLAGS=`echo "$LDFLAGS" | sed -e "s/ -Wl,-O[0-9]*\b//g"`]
else
	[LDFLAGS="$LDFLAGS -Wl,-O1"]
fi], [LDFLAGS="$LDFLAGS -Wl,-O1"])dnl
])