Revision: 6002 http://geany.svn.sourceforge.net/geany/?rev=6002&view=rev Author: colombanw Date: 2011-10-06 00:43:28 +0000 (Thu, 06 Oct 2011) Log Message: ----------- Move configure logic for binary relocation support to its own file
Modified Paths: -------------- trunk/ChangeLog trunk/configure.ac
Added Paths: ----------- trunk/m4/geany-binreloc.m4
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-06 00:43:09 UTC (rev 6001) +++ trunk/ChangeLog 2011-10-06 00:43:28 UTC (rev 6002) @@ -2,8 +2,8 @@
* autogen.sh, configure.ac: Modernize configure.ac a bit. - * configure.ac, m4/geany-revision.m4: - Extract some configure logic to a separate file for better + * configure.ac, m4/geany-revision.m4, m4/geany-binreloc.m4: + Extract some configure logic to separate files for better readability.
Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2011-10-06 00:43:09 UTC (rev 6001) +++ trunk/configure.ac 2011-10-06 00:43:28 UTC (rev 6002) @@ -55,60 +55,9 @@
# Check for binary relocation support -# taken from Inkscape (Hongli Lai h.lai@chello.nl) -AC_ARG_ENABLE([binreloc], - [AS_HELP_STRING([--enable-binreloc], - [compile with binary relocation support [default=no]])], - [enable_binreloc=$enableval], - [enable_binreloc=no]) +GEANY_CHECK_BINRELOC
-AC_MSG_CHECKING([whether binary relocation support should be enabled]) -if test "$enable_binreloc" = "yes"; then - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([for linker mappings at /proc/self/maps]) - if test -e /proc/self/maps; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([/proc/self/maps is not available. Binary relocation cannot be enabled.]) - enable_binreloc="no" - fi
-elif test "$enable_binreloc" = "auto"; then - AC_MSG_RESULT([yes when available]) - AC_MSG_CHECKING([for linker mappings at /proc/self/maps]) - if test -e /proc/self/maps; then - AC_MSG_RESULT([yes]) - enable_binreloc=yes - - AC_MSG_CHECKING([whether everything is installed to the same prefix]) - if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \ - "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \ - "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc' - then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - AC_MSG_NOTICE([Binary relocation support will be disabled.]) - enable_binreloc=no - fi - - else - AC_MSG_RESULT([no]) - enable_binreloc=no - fi - -elif test "$enable_binreloc" = "no"; then - AC_MSG_RESULT([no]) -else - AC_MSG_RESULT([no (unknown value "$enable_binreloc")]) - enable_binreloc=no -fi -if test "$enable_binreloc" = "yes"; then - AC_DEFINE([ENABLE_BINRELOC],,[Use AutoPackage?]) -fi - - # GTK/GLib/GIO checks gtk_modules="gtk+-2.0 >= 2.12 glib-2.0 >= 2.16 gio-2.0 >= 2.16" PKG_CHECK_MODULES([GTK], [$gtk_modules])
Added: trunk/m4/geany-binreloc.m4 =================================================================== --- trunk/m4/geany-binreloc.m4 (rev 0) +++ trunk/m4/geany-binreloc.m4 2011-10-06 00:43:28 UTC (rev 6002) @@ -0,0 +1,58 @@ +dnl GEANY_CHECK_BINRELOC +dnl Check for binary relocation support +dnl +dnl logic taken from Inkscape (Hongli Lai h.lai@chello.nl) +AC_DEFUN([GEANY_CHECK_BINRELOC], +[ + AC_ARG_ENABLE([binreloc], + [AS_HELP_STRING([--enable-binreloc], + [compile with binary relocation support [default=no]])], + [enable_binreloc=$enableval], + [enable_binreloc=no]) + + AC_MSG_CHECKING([whether binary relocation support should be enabled]) + if test "$enable_binreloc" = "yes"; then + AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([for linker mappings at /proc/self/maps]) + if test -e /proc/self/maps; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([/proc/self/maps is not available. Binary relocation cannot be enabled.]) + enable_binreloc="no" + fi + + elif test "$enable_binreloc" = "auto"; then + AC_MSG_RESULT([yes when available]) + AC_MSG_CHECKING([for linker mappings at /proc/self/maps]) + if test -e /proc/self/maps; then + AC_MSG_RESULT([yes]) + enable_binreloc=yes + + AC_MSG_CHECKING([whether everything is installed to the same prefix]) + if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \ + "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \ + "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc' + then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([Binary relocation support will be disabled.]) + enable_binreloc=no + fi + + else + AC_MSG_RESULT([no]) + enable_binreloc=no + fi + + elif test "$enable_binreloc" = "no"; then + AC_MSG_RESULT([no]) + else + AC_MSG_RESULT([no (unknown value "$enable_binreloc")]) + enable_binreloc=no + fi + if test "$enable_binreloc" = "yes"; then + AC_DEFINE([ENABLE_BINRELOC],,[Use AutoPackage?]) + fi +])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.