Skip to content

Commit

Permalink
Add binary relocation support.
Browse files Browse the repository at this point in the history
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2100 ea778897-0a13-0410-b9d1-a72fbfd435f5
  • Loading branch information
eht16 committed Dec 12, 2007
1 parent 2e8a6e8 commit fc6c31a
Show file tree
Hide file tree
Showing 8 changed files with 455 additions and 9 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -7,6 +7,9 @@
* src/vte.c: Enable dragging of text into the VTE.
* src/msgwindow.c: Fix crashes when clicking on message window items
introduced with changing rules hints for treeviews.
* configure.in, src/Makefile.am, src/main.c, src/plugins.c,
src/prefix.c, src/prefix.h, src/symbols.c:
Add binary relocation support.


2007-12-09 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Expand Down
55 changes: 55 additions & 0 deletions configure.in
Expand Up @@ -52,6 +52,61 @@ else
fi
AC_DEFINE_UNQUOTED([REVISION], "$REVISION", [subversion revision number])


dnl Check for binary relocation support
dnl taken from Inkscape (Hongli Lai <h.lai@chello.nl>)

AC_ARG_ENABLE(binreloc,
[ --enable-binreloc compile with binary relocation support],
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


# GTK checks
gtk_modules="gtk+-2.0 >= 2.6.0"
PKG_CHECK_MODULES(GTK, [$gtk_modules])
Expand Down
5 changes: 3 additions & 2 deletions src/Makefile.am
Expand Up @@ -25,6 +25,7 @@ SRCS = \
navqueue.c navqueue.h \
notebook.c notebook.h \
plugins.c plugins.h \
prefix.c prefix.h \
prefs.c prefs.h \
printing.c printing.h \
project.c project.h \
Expand Down Expand Up @@ -75,8 +76,8 @@ nodist_EXTRA_geany_SOURCES = dummy.cxx
geany_LDADD = ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a @GTK_LIBS@ $(INTLLIBS)

INCLUDES = \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" -DPACKAGE_LIB_DIR=\""$(libdir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DDATADIR=\""$(datadir)"\" -DLIBDIR=\""$(libdir)"\" \
-DLOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-I$(srcdir)/../scintilla/include -I$(srcdir)/../tagmanager/include @GTK_CFLAGS@

clean-local:
Expand Down
7 changes: 4 additions & 3 deletions src/main.c
Expand Up @@ -40,6 +40,7 @@
#endif

#include "main.h"
#include "prefix.h"
#include "prefs.h"
#include "interface.h"
#include "support.h"
Expand Down Expand Up @@ -377,8 +378,8 @@ static void setup_paths()

g_free(install_dir);
#else
data_dir = g_strdup(PACKAGE_DATA_DIR "/" PACKAGE "/"); // e.g. /usr/share/geany
doc_dir = g_strdup(PACKAGE_DATA_DIR "/doc/" PACKAGE "/html/");
data_dir = g_strconcat(DATADIR, "/" PACKAGE "/", NULL); // e.g. /usr/share/geany
doc_dir = g_strconcat(DATADIR, "/doc/" PACKAGE "/html/", NULL);
#endif

// convert path names to locale encoding
Expand All @@ -405,7 +406,7 @@ static void locale_init()
locale_dir = g_strconcat(install_dir, "\\lib\\locale", NULL);
g_free(install_dir);
#else
locale_dir = g_strdup(PACKAGE_LOCALE_DIR);
locale_dir = g_strdup(LOCALEDIR);
#endif

bindtextdomain(GETTEXT_PACKAGE, locale_dir);
Expand Down
7 changes: 4 additions & 3 deletions src/plugins.c
Expand Up @@ -33,6 +33,7 @@
#include "Scintilla.h"
#include "ScintillaWidget.h"

#include "prefix.h"
#include "plugins.h"
#include "plugindata.h"
#include "support.h"
Expand Down Expand Up @@ -534,13 +535,13 @@ static void load_plugin_paths()
path = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "plugins", NULL);
// first load plugins in ~/.geany/plugins/, then in $prefix/lib/geany
load_plugins(path);
#ifdef G_OS_WIN32
g_free(path);
#ifdef G_OS_WIN32
path = get_plugin_path();
load_plugins(path);
#else
load_plugins(PACKAGE_LIB_DIR G_DIR_SEPARATOR_S "geany");
path = g_strconcat(LIBDIR, G_DIR_SEPARATOR_S "geany", NULL);
#endif
load_plugins(path);

g_free(path);
}
Expand Down

0 comments on commit fc6c31a

Please sign in to comment.