po: Update German scripts translation
[dpkg.git] / m4 / dpkg-linker.m4
blob8c62c21f414ccb7e498d40db56c7e1f22144a33e
1 # serial 1
2 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
3 # Copyright © 2010, 2014, 2016 Guillem Jover <guillem@debian.org>
5 # DPKG_LINKER_OPTIMIZATIONS
6 # -------------------------
7 # Add configure option to disable linker optimizations.
8 AC_DEFUN([DPKG_LINKER_OPTIMIZATIONS], [
9   AC_ARG_ENABLE([linker-optimizations],
10     [AS_HELP_STRING([--disable-linker-optimizations],
11       [Disable (detected) linker optimizations])],
12     [], [enable_linker_optimizations=yes])
14   AS_IF([test "x$enable_linker_optimizations" = "xno"], [
15     LDFLAGS=$(echo "$LDFLAGS" | $SED -e "s/ -Wl,-O[[0-9]]*\b//g")
16   ], [
17     save_LDFLAGS=$LDFLAGS
18     LDFLAGS="$LDFLAGS -Wl,-O1"
19     AC_LINK_IFELSE([
20       AC_LANG_PROGRAM([[]], [[]])
21     ], [], [
22       LDFLAGS="$save_LDFLAGS"
23     ])
24   ])
27 # DPKG_LINKER_AS_NEEDED
28 # ---------------------
29 AC_DEFUN([DPKG_LINKER_AS_NEEDED], [
30   AC_CACHE_CHECK([for --as-needed linker flag], [dpkg_cv_linker_as_needed], [
31     save_LDFLAGS=$LDFLAGS
32     LDFLAGS="$LDFLAGS -Wl,--as-needed"
33     AC_LINK_IFELSE([
34       AC_LANG_PROGRAM([], [])
35     ], [
36       dpkg_cv_linker_as_needed=yes
37     ], [
38       dpkg_cv_linker_as_needed=no
39     ])
40     LDFLAGS="$save_LDFLAGS"
41   ])
42   AM_CONDITIONAL([HAVE_LINKER_AS_NEEDED],
43     [test "x$dpkg_cv_linker_as_needed" = "xyes"])
46 # DPKG_LINKER_VERSION_SCRIPT
47 # --------------------------
48 AC_DEFUN([DPKG_LINKER_VERSION_SCRIPT], [
49   AC_CACHE_CHECK([for --version-script linker flag], [dpkg_cv_version_script], [
50     echo "{ global: symbol; local: *; };" >conftest.map
51     save_LDFLAGS=$LDFLAGS
52     LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
53     AC_LINK_IFELSE([
54       AC_LANG_PROGRAM([[
55 extern int symbol(void);
56 int symbol(void) { return 0; }
57 ]], [[
58 ]])
59     ], [
60       dpkg_cv_version_script=yes
61     ], [
62       dpkg_cv_version_script=no
63     ])
64     LDFLAGS="$save_LDFLAGS"
65     rm -f conftest.map
66   ])
67   AM_CONDITIONAL([HAVE_LINKER_VERSION_SCRIPT],
68     [test "x$dpkg_cv_version_script" = "xyes"])