~jamesodhunt/ubuntu/raring/upstart/1.6

« back to all changes in this revision

Viewing changes to m4/linker.m4

  • Committer: Scott James Remnant
  • Date: 2010-02-04 23:59:00 UTC
  • mfrom: (1185.1.9 upstream)
  • Revision ID: scott@netsplit.com-20100204235900-c0j0frow10azwsus
* New upstream release:
  - libnih has been separated out into its own project.
  - "start on" and "stop on" now support != matches.  LP: #513035.
  - Fixed crash in child when unable to spawn job.  LP: #451917.
  - No longer holds /dev/console open so SAK won't kill init.  LP: #486005.
  - Added missing OPTIONS section to init(8).  LP: #449883.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# libnih
2
 
#
3
 
# linker.m4 - autoconf macros for linker settings
4
 
#
5
 
# Copyright © 2009 Scott James Remnant <scott@netsplit.com>.
6
 
# Copyright © 2009 Canonical Ltd.
7
 
#
8
 
# This file is free software; the author gives unlimited permission to
9
 
# copy and/or distribute it, with or without modifications, as long as
10
 
# this notice is preserved.
11
 
 
12
 
 
13
 
# NIH_LINKER_OPTIMISATIONS
14
 
# ------------------------
15
 
# Add configure option to disable linker optimisations.
16
 
AC_DEFUN([NIH_LINKER_OPTIMISATIONS],
17
 
[AC_ARG_ENABLE(linker-optimisations,
18
 
        AS_HELP_STRING([--disable-linker-optimisations],
19
 
                       [Disable linker optimisations]),
20
 
[AS_IF([test "x$enable_linker_optimisations" = "xno"],
21
 
       [LDFLAGS=`echo "$LDFLAGS" | sed -e "s/ -Wl,-O[0-9]*\b//g"`],
22
 
       [LDFLAGS="$LDFLAGS -Wl,-O1"])
23
 
])dnl
24
 
])# NIH_LINKER_OPTIMISATIONS
25
 
 
26
 
# NIH_LINKER_VERSION_SCRIPT
27
 
# -------------------------
28
 
# Detect whether the linker supports version scripts
29
 
AC_DEFUN([NIH_LINKER_VERSION_SCRIPT],
30
 
[AC_CACHE_CHECK([for linker version script argument], [nih_cv_version_script],
31
 
[nih_cv_version_script=none
32
 
for nih_try_arg in "-Wl,--version-script"; do
33
 
        nih_old_libs="$LIBS"
34
 
        LIBS="$LIBS $nih_try_arg=conftest.ver"
35
 
 
36
 
        cat >conftest.ver <<EOF
37
 
TEST {
38
 
        global:
39
 
                *;
40
 
};
41
 
EOF
42
 
 
43
 
        AC_TRY_LINK([], [], [
44
 
                rm -f conftest.ver
45
 
                LIBS="$nih_old_libs"
46
 
                nih_cv_version_script="$nih_try_arg"
47
 
                break
48
 
        ])
49
 
 
50
 
        rm -f conftest.ver
51
 
        LIBS="$nih_old_libs"
52
 
done])
53
 
AS_IF([test "x$nih_cv_version_script" != "xnone"],
54
 
      [AC_SUBST(VERSION_SCRIPT_ARG, [$nih_cv_version_script])])
55
 
AM_CONDITIONAL(HAVE_VERSION_SCRIPT_ARG,
56
 
               [test "x$nih_cv_version_script" != "xnone"])
57
 
])# NIH_LINKER_VERSION_SCRIPT
58
 
 
59
 
# NIH_LINKER_SYMBOLIC_FUNCTIONS
60
 
# -----------------------------
61
 
# Detect whether the linker supports symbolic functions
62
 
AC_DEFUN([NIH_LINKER_SYMBOLIC_FUNCTIONS],
63
 
[AC_CACHE_CHECK([for linker symbolic functions argument],
64
 
[nih_cv_symbolic_functions],
65
 
[nih_cv_symbolic_functions=none
66
 
for nih_try_arg in "-Wl,-Bsymbolic-functions"; do
67
 
        nih_old_ldflags="$LDFLAGS"
68
 
        LDFLAGS="$LDFLAGS $nih_try_arg"
69
 
        AC_TRY_LINK([], [], [
70
 
                LDFLAGS="$nih_old_ldflags"
71
 
                nih_cv_symbolic_functions="$nih_try_arg"
72
 
                break
73
 
        ])
74
 
 
75
 
        LDFLAGS="$nih_old_ldflags"
76
 
done])
77
 
AS_IF([test "x$nih_cv_symbolic_functions" != "xnone"],
78
 
      [LDFLAGS="$LDFLAGS $nih_cv_symbolic_functions"])dnl
79
 
])# NIH_LINKER_SYMBOLIC_FUNCTIONS