1 dnl GEANY_CHECK_BINRELOC
2 dnl Check for binary relocation support
4 dnl logic taken from Inkscape (Hongli Lai <h.lai@chello.nl>)
5 AC_DEFUN([GEANY_CHECK_BINRELOC],
7 AC_ARG_ENABLE([binreloc],
8 [AS_HELP_STRING([--enable-binreloc],
9 [compile with binary relocation support [default=no]])],
10 [enable_binreloc=$enableval],
13 AC_MSG_CHECKING([whether binary relocation support should be enabled])
14 if test "$enable_binreloc" = "yes"; then
16 AC_MSG_CHECKING([for linker mappings at /proc/self/maps])
17 if test -e /proc/self/maps; then
21 AC_MSG_ERROR([/proc/self/maps is not available. Binary relocation cannot be enabled.])
25 elif test "$enable_binreloc" = "auto"; then
26 AC_MSG_RESULT([yes when available])
27 AC_MSG_CHECKING([for linker mappings at /proc/self/maps])
28 if test -e /proc/self/maps; then
32 AC_MSG_CHECKING([whether everything is installed to the same prefix])
33 if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
34 "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
35 "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
40 AC_MSG_NOTICE([Binary relocation support will be disabled.])
49 elif test "$enable_binreloc" = "no"; then
52 AC_MSG_RESULT([no (unknown value "$enable_binreloc")])
55 AM_CONDITIONAL(ENABLE_BINRELOC, [test "$enable_binreloc" = "yes"])
56 AM_COND_IF(ENABLE_BINRELOC,
58 AC_DEFINE([ENABLE_BINRELOC],,[Use AutoPackage?])
61 GEANY_STATUS_ADD([Enable binary relocation], [$enable_binreloc])