~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to m4macros/binreloc.m4

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Check for binary relocation support.
 
2
# Written by Hongli Lai
 
3
# http://autopackage.org/
 
4
 
 
5
AC_DEFUN([AM_BINRELOC],
 
6
[
 
7
        AC_ARG_ENABLE(binreloc,
 
8
                [  --enable-binreloc       compile with binary relocation support
 
9
                          (default=no)],
 
10
                enable_binreloc=$enableval,enable_binreloc=no)
 
11
 
 
12
        AC_ARG_ENABLE(binreloc-threads,
 
13
                [  --enable-binreloc-threads      compile binary relocation with threads support
 
14
                                 (default=yes)],
 
15
                enable_binreloc_threads=$enableval,enable_binreloc_threads=yes)
 
16
 
 
17
        BINRELOC_CFLAGS=
 
18
        BINRELOC_LIBS=
 
19
        if test "x$enable_binreloc" = "xauto"; then
 
20
                AC_CHECK_FILE([/proc/self/maps])
 
21
                AC_CACHE_CHECK([whether everything is installed to the same prefix],
 
22
                               [br_cv_valid_prefixes], [
 
23
                                if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
 
24
                                        "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
 
25
                                        "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
 
26
                                then
 
27
                                        br_cv_valid_prefixes=yes
 
28
                                else
 
29
                                        br_cv_valid_prefixes=no
 
30
                                fi
 
31
                                ])
 
32
        fi
 
33
        AC_CACHE_CHECK([whether binary relocation support should be enabled],
 
34
                       [br_cv_binreloc],
 
35
                       [if test "x$enable_binreloc" = "xyes"; then
 
36
                               br_cv_binreloc=yes
 
37
                       elif test "x$enable_binreloc" = "xauto"; then
 
38
                               if test "x$br_cv_valid_prefixes" = "xyes" -a \
 
39
                                       "x$ac_cv_file__proc_self_maps" = "xyes"; then
 
40
                                       br_cv_binreloc=yes
 
41
                               else
 
42
                                       br_cv_binreloc=no
 
43
                               fi
 
44
                       else
 
45
                               br_cv_binreloc=no
 
46
                       fi])
 
47
 
 
48
        if test "x$br_cv_binreloc" = "xyes"; then
 
49
                BINRELOC_CFLAGS="-DENABLE_BINRELOC"
 
50
                if test "x$enable_binreloc_threads" = "xyes"; then
 
51
                        AC_CHECK_LIB([pthread], [pthread_getspecific])
 
52
                fi
 
53
 
 
54
                AC_CACHE_CHECK([whether binary relocation should use threads],
 
55
                               [br_cv_binreloc_threads],
 
56
                               [if test "x$enable_binreloc_threads" = "xyes"; then
 
57
                                        if test "x$ac_cv_lib_pthread_pthread_getspecific" = "xyes"; then
 
58
                                                br_cv_binreloc_threads=yes
 
59
                                        else
 
60
                                                br_cv_binreloc_threads=no
 
61
                                        fi
 
62
                                else
 
63
                                        br_cv_binreloc_threads=no
 
64
                                fi])
 
65
 
 
66
                if test "x$br_cv_binreloc_threads" = "xyes"; then
 
67
                        BINRELOC_LIBS="-lpthread"
 
68
                else
 
69
                        BINRELOC_CFLAGS="$BINRELOC_CFLAGS -DBR_PTHREADS=0"
 
70
                fi
 
71
        fi
 
72
        AC_SUBST(BINRELOC_CFLAGS)
 
73
        AC_SUBST(BINRELOC_LIBS)
 
74
        AM_CONDITIONAL(USE_BINRELOC, test x$br_cv_binreloc = xyes)
 
75
])