[gimp/gimp-2-10] app, libgimpbase: --enable-relocatable-bundle replaces --enable-binreloc



commit 6645cc7ba53baba2a30d044a3b1e3fa500e25d03
Author: Jehan <jehan girinstud io>
Date:   Tue Feb 5 14:21:23 2019 +0100

    app, libgimpbase: --enable-relocatable-bundle replaces --enable-binreloc
    
    Older --enable-binreloc configure option had basically the same purpose
    as the newer --enable-relocatable-bundle, though the old binreloc was
    only used for gimpenv.c code.
    As a consequence, commit 10ce702188 was still not working fine since
    gimp_installation_directory_file() also need binreloc enabled (to be
    actually relocatable).
    
    Let's get rid of this whole mess, by implying we want binreloc code to
    be used when --enable-relocatable-bundle is ON. We don't need the
    m4macros anymore, since AM_BINRELOC was basically just checking that
    `/proc/self/maps` was present. But anyway being present at compile time
    does not mean it will be at runtime (nor the opposite). So this test is
    not that useful. The binreloc code will anyway fallback gracefully to
    the non-binreloc code (i.e. trying to use build-time install paths) if
    the procfs is lacking at runtime.
    
    (cherry picked from commit 4d84c1d7ee5bdd2d9cf8bfb07455547856ae6b59)

 INSTALL.in              |  5 ----
 acinclude.m4            |  1 -
 app/Makefile.am         |  2 +-
 configure.ac            |  4 +--
 libgimpbase/Makefile.am |  1 -
 libgimpbase/gimpreloc.c | 12 ++++----
 m4macros/binreloc.m4    | 75 -------------------------------------------------
 7 files changed, 8 insertions(+), 92 deletions(-)
---
diff --git a/INSTALL.in b/INSTALL.in
index 46cfb33387..029205f5dc 100644
--- a/INSTALL.in
+++ b/INSTALL.in
@@ -252,11 +252,6 @@ These are:
      in the user's home directory) to ~/.config/DIR/@GIMP_APP_VERSION@.
      If DIR is an absolute path, the directory will be changed to DIR.
 
-  --enable-binreloc.  When compiled for Linux with this option enabled,
-     GIMP will be binary relocatable.  Plug-ins and data files will
-     be searched relative to the gimp binary instead of in the paths
-     defined at compile time.
-
   --with-shm=[none|sysv|posix|auto].  This option allows you to specify
      how image data is transported between the core and plug-ins. Usually
      the best way to do this is detected automatically.
diff --git a/acinclude.m4 b/acinclude.m4
index 2984fe97cf..f0ceffb4d5 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -4,6 +4,5 @@ m4_include([m4macros/ax_cxx_compile_stdcxx.m4])
 m4_include([m4macros/ax_gcc_func_attribute.m4])
 m4_include([m4macros/ax_prog_cc_for_build.m4])
 m4_include([m4macros/ax_prog_perl_version.m4])
-m4_include([m4macros/binreloc.m4])
 m4_include([m4macros/detectcflags.m4])
 m4_include([m4macros/pythondev.m4])
diff --git a/app/Makefile.am b/app/Makefile.am
index 46dd220bd0..7bb07dbf99 100644
--- a/app/Makefile.am
+++ b/app/Makefile.am
@@ -106,7 +106,7 @@ else
 libm = -lm
 endif
 
-if USE_BINRELOC
+if ENABLE_RELOCATABLE_RESOURCES
 munix = -Wl,-rpath '-Wl,$$ORIGIN/../lib'
 endif
 
diff --git a/configure.ac b/configure.ac
index 4ca7905d09..56bafecdb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -612,9 +612,6 @@ AC_CHECK_FUNCS(difftime mmap)
 AC_CHECK_FUNCS(thr_self)
 
 
-AM_BINRELOC
-
-
 # _NL_MEASUREMENT_MEASUREMENT is an enum and not a define
 AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
 AC_LINK_IFELSE(
@@ -1500,6 +1497,7 @@ if test "x$enable_relocatable_bundle" = xyes; then
   AC_DEFINE(ENABLE_RELOCATABLE_RESOURCES, 1,
             [Define to 1 if resources are considered bundled under the same prefix])
 fi
+AM_CONDITIONAL(ENABLE_RELOCATABLE_RESOURCES, test x$enable_relocatable_bundle = xyes)
 
 AC_MSG_RESULT([$enable_relocatable_bundle])
 
diff --git a/libgimpbase/Makefile.am b/libgimpbase/Makefile.am
index 8642cc933e..4214939b09 100644
--- a/libgimpbase/Makefile.am
+++ b/libgimpbase/Makefile.am
@@ -65,7 +65,6 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)                                         \
        $(GIO_CFLAGS)                                           \
        $(GEXIV2_CFLAGS)                                        \
-       $(BINRELOC_CFLAGS)                                      \
        -I$(includedir)
 
 AM_CFLAGS = \
diff --git a/libgimpbase/gimpreloc.c b/libgimpbase/gimpreloc.c
index c00d64c54e..d98525b960 100644
--- a/libgimpbase/gimpreloc.c
+++ b/libgimpbase/gimpreloc.c
@@ -16,11 +16,11 @@
 #include <limits.h>
 #include <string.h>
 
-#ifdef ENABLE_BINRELOC
+#if defined(ENABLE_RELOCATABLE_RESOURCES) && ! defined(G_OS_WIN32)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#endif /* ENABLE_BINRELOC */
+#endif /* ENABLE_RELOCATABLE_RESOURCES && ! G_OS_WIN32 */
 
 #include <glib.h>
 #include <glib/gstdio.h>
@@ -36,7 +36,7 @@
 static char *
 _br_find_exe (GimpBinrelocInitError *error)
 {
-#ifndef ENABLE_BINRELOC
+#if ! defined(ENABLE_RELOCATABLE_RESOURCES) || defined(G_OS_WIN32)
         if (error)
                 *error = GIMP_RELOC_INIT_ERROR_DISABLED;
         return NULL;
@@ -164,7 +164,7 @@ _br_find_exe (GimpBinrelocInitError *error)
         g_free (line);
         fclose (f);
         return path;
-#endif /* ENABLE_BINRELOC */
+#endif /* ! ENABLE_RELOCATABLE_RESOURCES || G_OS_WIN32 */
 }
 
 
@@ -175,7 +175,7 @@ _br_find_exe (GimpBinrelocInitError *error)
 static char *
 _br_find_exe_for_symbol (const void *symbol, GimpBinrelocInitError *error)
 {
-#ifndef ENABLE_BINRELOC
+#if ! defined(ENABLE_RELOCATABLE_RESOURCES) || defined(G_OS_WIN32)
         if (error)
                 *error = GIMP_RELOC_INIT_ERROR_DISABLED;
         return (char *) NULL;
@@ -272,7 +272,7 @@ _br_find_exe_for_symbol (const void *symbol, GimpBinrelocInitError *error)
                 return (char *) NULL;
         else
                 return g_strdup (found);
-#endif /* ENABLE_BINRELOC */
+#endif /* ! ENABLE_RELOCATABLE_RESOURCES || G_OS_WIN32 */
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]