changeset 16098:634b96915d2e

Death to Binreloc\!
author Sean Egan <seanegan@gmail.com>
date Sat, 14 Apr 2007 07:15:02 +0000
parents 80adc614a9e5
children 8e0a9b2f5a2e
files ChangeLog.API configure.ac finch/finch.c libpurple/Makefile.am libpurple/example/nullclient.c libpurple/internal.h libpurple/plugins/ssl/ssl-nss.c libpurple/prefix.c libpurple/prefix.h pidgin/gtkdialogs.c pidgin/gtkmain.c pidgin/gtkstatusbox.c pidgin/plugins/crazychat/configure.ac
diffstat 13 files changed, 4 insertions(+), 767 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Sat Apr 14 02:19:49 2007 +0000
+++ b/ChangeLog.API	Sat Apr 14 07:15:02 2007 +0000
@@ -222,6 +222,7 @@
 	* GaimGtkRoomlistDialog: Nothing used it outside of the file it was in.
 	* gaim_gtk_roomlist_dialog_new: use gaim_gtk_roomlist_show
 	* gaim_gtk_roomlist_dialog_new_with_account: use gaim_gtk_roomlist_show_with_account
+	* binreloc functions
 
 	Added:
 	* gaim_prefs_disconnect_by_handle()
--- a/configure.ac	Sat Apr 14 02:19:49 2007 +0000
+++ b/configure.ac	Sat Apr 14 07:15:02 2007 +0000
@@ -1807,8 +1807,6 @@
 	LDFLAGS="$orig_LDFLAGS"
 fi
 
-AM_BINRELOC
-
 AC_MSG_CHECKING(for me pot o' gold)
 AC_MSG_RESULT(no)
 AC_CHECK_FUNCS(gethostid lrand48)
--- a/finch/finch.c	Sat Apr 14 02:19:49 2007 +0000
+++ b/finch/finch.c	Sat Apr 14 07:15:02 2007 +0000
@@ -27,7 +27,6 @@
 #include "ft.h"
 #include "log.h"
 #include "notify.h"
-#include "prefix.h"
 #include "prefs.h"
 #include "prpl.h"
 #include "pounce.h"
@@ -159,66 +158,6 @@
 	return &eventloop_ops;
 }
 
-/* This is copied from gtkpurple */
-static char *
-gnt_find_binary_location(void *symbol, void *data)
-{
-	static char *fullname = NULL;
-	static gboolean first = TRUE;
-
-	char *argv0 = data;
-	struct stat st;
-	char *basebuf, *linkbuf, *fullbuf;
-
-	if (!first)
-		/* We've already been through this. */
-		return strdup(fullname);
-
-	first = FALSE;
-
-	if (!argv0)
-		return NULL;
-
-
-	basebuf = g_find_program_in_path(argv0);
-
-	/* But we still need to deal with symbolic links */
-	g_lstat(basebuf, &st);
-	while ((st.st_mode & S_IFLNK) == S_IFLNK) {
-		int written;
-		linkbuf = g_malloc(1024);
-		written = readlink(basebuf, linkbuf, 1024 - 1);
-		if (written == -1)
-		{
-			/* This really shouldn't happen, but do we
-			 * need something better here? */
-			g_free(linkbuf);
-			continue;
-		}
-		linkbuf[written] = '\0';
-		if (linkbuf[0] == G_DIR_SEPARATOR) {
-			/* an absolute path */
-			fullbuf = g_strdup(linkbuf);
-		} else {
-			char *dirbuf = g_path_get_dirname(basebuf);
-			/* a relative path */
-			fullbuf = g_strdup_printf("%s%s%s",
-					dirbuf, G_DIR_SEPARATOR_S,
-					linkbuf);
-			g_free(dirbuf);
-		}
-		/* There's no memory leak here.  Really! */
-		g_free(linkbuf);
-		g_free(basebuf);
-		basebuf = fullbuf;
-		g_lstat(basebuf, &st);
-	}
-
-	fullname = basebuf;
-	return strdup(fullname);
-}
-
-
 /* This is mostly copied from gtkpurple's source tree */
 static void
 show_usage(const char *name, gboolean terse)
@@ -263,8 +202,6 @@
 		{0, 0, 0, 0}
 	};
 
-	purple_br_set_locate_fallback_func(gnt_find_binary_location, argv[0]);
-
 #ifdef ENABLE_NLS
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	bind_textdomain_codeset(PACKAGE, "UTF-8");
--- a/libpurple/Makefile.am	Sat Apr 14 02:19:49 2007 +0000
+++ b/libpurple/Makefile.am	Sat Apr 14 07:15:02 2007 +0000
@@ -56,7 +56,6 @@
 	plugin.c \
 	pluginpref.c \
 	pounce.c \
-	prefix.c \
 	prefs.c \
 	privacy.c \
 	proxy.c \
@@ -212,8 +211,7 @@
 	$(dbus_sources)
 
 noinst_HEADERS= \
-	internal.h \
-	prefix.h
+	internal.h 
 
 libpurpleincludedir=$(includedir)/libpurple
 libpurpleinclude_HEADERS = \
--- a/libpurple/example/nullclient.c	Sat Apr 14 02:19:49 2007 +0000
+++ b/libpurple/example/nullclient.c	Sat Apr 14 07:15:02 2007 +0000
@@ -28,7 +28,6 @@
 #include "ft.h"
 #include "log.h"
 #include "notify.h"
-#include "prefix.h"
 #include "prefs.h"
 #include "prpl.h"
 #include "pounce.h"
--- a/libpurple/internal.h	Sat Apr 14 02:19:49 2007 +0000
+++ b/libpurple/internal.h	Sat Apr 14 07:15:02 2007 +0000
@@ -184,10 +184,4 @@
 
 #define PURPLE_WEBSITE "http://pidgin.im/"
 
-#ifndef _WIN32
-/* Everything needs to include this, because
- * everything gets the autoconf macros */
-#include "prefix.h"
-#endif /* _WIN32 */
-
 #endif /* _PURPLE_INTERNAL_H_ */
--- a/libpurple/plugins/ssl/ssl-nss.c	Sat Apr 14 02:19:49 2007 +0000
+++ b/libpurple/plugins/ssl/ssl-nss.c	Sat Apr 14 07:15:02 2007 +0000
@@ -112,7 +112,7 @@
 
 	/* TODO: Fix this so autoconf does the work trying to find this lib. */
 #ifndef _WIN32
-	lib = g_strdup(BR_LIBDIR("/libnssckbi.so"));
+	lib = g_strdup(LIBDIR "/libnssckbi.so");
 #else
 	lib = g_strdup("nssckbi.dll");
 #endif
--- a/libpurple/prefix.c	Sat Apr 14 02:19:49 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,476 +0,0 @@
-/*
- * BinReloc - a library for creating relocatable executables
- * Written by: Mike Hearn <mike@theoretic.com>
- *             Hongli Lai <h.lai@chello.nl>
- * http://autopackage.org/
- * 
- * This source code is public domain. You can relicense this code
- * under whatever license you want.
- *
- * NOTE: if you're using C++ and are getting "undefined reference
- * to br_*", try renaming prefix.c to prefix.cpp
- */
-
-/* WARNING, BEFORE YOU MODIFY PREFIX.C:
- *
- * If you make changes to any of the functions in prefix.c, you MUST
- * change the BR_NAMESPACE macro (in prefix.h).
- * This way you can avoid symbol table conflicts with other libraries
- * that also happen to use BinReloc.
- *
- * Example:
- * #define BR_NAMESPACE(funcName) foobar_ ## funcName
- * --> expands br_locate to foobar_br_locate
- */
-
-#ifndef _PREFIX_C_
-#define _PREFIX_C_
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#endif
-
-#ifndef BR_PTHREADS
-	/* Change 1 to 0 if you don't want pthread support */
-	#define BR_PTHREADS 1
-#endif /* BR_PTHREADS */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <limits.h>
-#include <string.h>
-#include "prefix.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-#undef NULL
-#define NULL ((void *) 0)
-
-#ifdef __GNUC__
-	#define br_return_val_if_fail(expr,val) if (!(expr)) {fprintf (stderr, "** BinReloc (%s): assertion %s failed\n", __PRETTY_FUNCTION__, #expr); return val;}
-#else
-	#define br_return_val_if_fail(expr,val) if (!(expr)) return val
-#endif /* __GNUC__ */
-
-
-static br_locate_fallback_func fallback_func = NULL;
-static void *fallback_data = NULL;
-
-
-#ifdef ENABLE_BINRELOC
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <unistd.h>
-
-
-/**
- * br_locate:
- * symbol: A symbol that belongs to the app/library you want to locate.
- * Returns: A newly allocated string containing the full path of the
- *	    app/library that func belongs to, or NULL on error. This
- *	    string should be freed when not when no longer needed.
- *
- * Finds out to which application or library symbol belongs, then locate
- * the full path of that application or library.
- * Note that symbol cannot be a pointer to a function. That will not work.
- *
- * Example:
- * --> main.c
- * #include "prefix.h"
- * #include "libfoo.h"
- *
- * int main (int argc, char *argv[]) {
- *	printf ("Full path of this app: %s\n", br_locate (&argc));
- *	libfoo_start ();
- *	return 0;
- * }
- *
- * --> libfoo.c starts here
- * #include "prefix.h"
- *
- * void libfoo_start () {
- *	--> "" is a symbol that belongs to libfoo (because it's called
- *	--> from libfoo_start()); that's why this works.
- *	printf ("libfoo is located in: %s\n", br_locate (""));
- * }
- */
-char *
-br_locate (void *symbol)
-{
-	char line[5000];
-	FILE *f;
-	char *path;
-
-	br_return_val_if_fail (symbol != NULL, NULL);
-
-	f = fopen ("/proc/self/maps", "r");
-	if (!f) {
-		if (fallback_func)
-			return fallback_func(symbol, fallback_data);
-		else
-			return NULL;
-	}
-
-	while (!feof (f))
-	{
-		unsigned long start, end;
-
-		if (!fgets (line, sizeof (line), f))
-			continue;
-		if (!strstr (line, " r-xp ") || !strchr (line, '/'))
-			continue;
-
-		sscanf (line, "%lx-%lx ", &start, &end);
-		if (symbol >= (void *) start && symbol < (void *) end)
-		{
-			char *tmp;
-			size_t len;
-
-			/* Extract the filename; it is always an absolute path */
-			path = strchr (line, '/');
-
-			/* Get rid of the newline */
-			tmp = strrchr (path, '\n');
-			if (tmp) *tmp = 0;
-
-			/* Get rid of "(deleted)" */
-			len = strlen (path);
-			if (len > 10 && strcmp (path + len - 10, " (deleted)") == 0)
-			{
-				tmp = path + len - 10;
-				*tmp = 0;
-			}
-
-			fclose(f);
-			return strdup (path);
-		}
-	}
-
-	fclose (f);
-	return NULL;
-}
-
-
-/**
- * br_locate_prefix:
- * symbol: A symbol that belongs to the app/library you want to locate.
- * Returns: A prefix. This string should be freed when no longer needed.
- *
- * Locates the full path of the app/library that symbol belongs to, and return
- * the prefix of that path, or NULL on error.
- * Note that symbol cannot be a pointer to a function. That will not work.
- *
- * Example:
- * --> This application is located in /usr/bin/foo
- * br_locate_prefix (&argc);   --> returns: "/usr"
- */
-char *
-br_locate_prefix (void *symbol)
-{
-	char *path, *prefix;
-
-	br_return_val_if_fail (symbol != NULL, NULL);
-
-	path = br_locate (symbol);
-	if (!path) return NULL;
-
-	prefix = br_extract_prefix (path);
-	free (path);
-	return prefix;
-}
-
-
-/**
- * br_prepend_prefix:
- * symbol: A symbol that belongs to the app/library you want to locate.
- * path: The path that you want to prepend the prefix to.
- * Returns: The new path, or NULL on error. This string should be freed when no
- *	    longer needed.
- *
- * Gets the prefix of the app/library that symbol belongs to. Prepend that prefix to path.
- * Note that symbol cannot be a pointer to a function. That will not work.
- *
- * Example:
- * --> The application is /usr/bin/foo
- * br_prepend_prefix (&argc, "/share/foo/data.png");   --> Returns "/usr/share/foo/data.png"
- */
-char *
-br_prepend_prefix (void *symbol, char *path)
-{
-	char *tmp, *newpath;
-
-	br_return_val_if_fail (symbol != NULL, NULL);
-	br_return_val_if_fail (path != NULL, NULL);
-
-	tmp = br_locate_prefix (symbol);
-	if (!tmp) return NULL;
-
-	if (strcmp (tmp, "/") == 0)
-		newpath = strdup (path);
-	else
-		newpath = br_strcat (tmp, path);
-
-	/* Get rid of compiler warning ("br_prepend_prefix never used") */
-	if (0) br_prepend_prefix (NULL, NULL);
-
-	free (tmp);
-	return newpath;
-}
-
-#endif /* ENABLE_BINRELOC */
-
-
-/* Pthread stuff for thread safetiness */
-#if BR_PTHREADS
-
-#include <pthread.h>
-
-static pthread_key_t br_thread_key;
-static pthread_once_t br_thread_key_once = PTHREAD_ONCE_INIT;
-
-
-static void
-br_thread_local_store_fini ()
-{
-	char *specific;
-
-	specific = (char *) pthread_getspecific (br_thread_key);
-	if (specific)
-	{
-		free (specific);
-		pthread_setspecific (br_thread_key, NULL);
-	}
-	pthread_key_delete (br_thread_key);
-	br_thread_key = 0;
-}
-
-
-static void
-br_str_free (void *str)
-{
-	if (str)
-		free (str);
-}
-
-
-static void
-br_thread_local_store_init ()
-{
-	if (pthread_key_create (&br_thread_key, br_str_free) == 0)
-		atexit (br_thread_local_store_fini);
-}
-
-#else /* BR_PTHREADS */
-
-static char *br_last_value = (char *) NULL;
-
-static void
-br_free_last_value ()
-{
-	if (br_last_value)
-		free (br_last_value);
-}
-
-#endif /* BR_PTHREADS */
-
-
-/**
- * br_thread_local_store:
- * str: A dynamically allocated string.
- * Returns: str. This return value must not be freed.
- *
- * Store str in a thread-local variable and return str. The next
- * you run this function, that variable is freed too.
- * This function is created so you don't have to worry about freeing
- * strings. Just be careful about doing this sort of thing:
- *
- * some_function( BR_DATADIR("/one.png"), BR_DATADIR("/two.png") )
- *
- * Examples:
- * char *foo;
- * foo = br_thread_local_store (strdup ("hello")); --> foo == "hello"
- * foo = br_thread_local_store (strdup ("world")); --> foo == "world"; "hello" is now freed.
- */
-const char *
-br_thread_local_store (char *str)
-{
-	#if BR_PTHREADS
-		char *specific;
-
-		pthread_once (&br_thread_key_once, br_thread_local_store_init);
-
-		specific = (char *) pthread_getspecific (br_thread_key);
-		br_str_free (specific);
-		pthread_setspecific (br_thread_key, str);
-
-	#else /* BR_PTHREADS */
-		static int initialized = 0;
-
-		if (!initialized)
-		{
-			atexit (br_free_last_value);
-			initialized = 1;
-		}
-
-		if (br_last_value)
-			free (br_last_value);
-		br_last_value = str;
-	#endif /* BR_PTHREADS */
-
-	return (const char *) str;
-}
-
-
-/**
- * br_strcat:
- * str1: A string.
- * str2: Another string.
- * Returns: A newly-allocated string. This string should be freed when no longer needed.
- *
- * Concatenate str1 and str2 to a newly allocated string.
- */
-char *
-br_strcat (const char *str1, const char *str2)
-{
-	char *result;
-	size_t len1, len2;
-
-	if (!str1) str1 = "";
-	if (!str2) str2 = "";
-
-	len1 = strlen (str1);
-	len2 = strlen (str2);
-
-	result = (char *) malloc (len1 + len2 + 1);
-	memcpy (result, str1, len1);
-	memcpy (result + len1, str2, len2);
-	result[len1 + len2] = '\0';
-
-	return result;
-}
-
-
-/* Emulates glibc's strndup() */
-static char *
-br_strndup (char *str, size_t size)
-{
-	char *result = (char *) NULL;
-	size_t len;
-
-	br_return_val_if_fail (str != (char *) NULL, (char *) NULL);
-
-	len = strlen (str);
-	if (!len) return strdup ("");
-	if (size > len) size = len;
-
-	result = (char *) calloc (sizeof (char), len + 1);
-	memcpy (result, str, size);
-	return result;
-}
-
-
-/**
- * br_extract_dir:
- * path: A path.
- * Returns: A directory name. This string should be freed when no longer needed.
- *
- * Extracts the directory component of path. Similar to g_dirname() or the dirname
- * commandline application.
- *
- * Example:
- * br_extract_dir ("/usr/local/foobar");  --> Returns: "/usr/local"
- */
-char *
-br_extract_dir (const char *path)
-{
-	char *end, *result;
-
-	br_return_val_if_fail (path != (char *) NULL, (char *) NULL);
-
-	end = strrchr (path, '/');
-	if (!end) return strdup (".");
-
-	while (end > path && *end == '/')
-		end--;
-	result = br_strndup ((char *) path, end - path + 1);
-	if (!*result)
-	{
-		free (result);
-		return strdup ("/");
-	} else
-		return result;
-}
-
-
-/**
- * br_extract_prefix:
- * path: The full path of an executable or library.
- * Returns: The prefix, or NULL on error. This string should be freed when no longer needed.
- *
- * Extracts the prefix from path. This function assumes that your executable
- * or library is installed in an LSB-compatible directory structure.
- *
- * Example:
- * br_extract_prefix ("/usr/bin/gnome-panel");       --> Returns "/usr"
- * br_extract_prefix ("/usr/local/lib/libfoo.so");   --> Returns "/usr/local"
- * br_extract_prefix ("/usr/local/libfoo.so");       --> Returns "/usr"
- */
-char *
-br_extract_prefix (const char *path)
-{
-	char *end, *tmp, *result;
-
-	br_return_val_if_fail (path != (char *) NULL, (char *) NULL);
-
-	if (!*path) return strdup ("/");
-	end = strrchr (path, '/');
-	if (!end) return strdup (path);
-
-	tmp = br_strndup ((char *) path, end - path);
-	if (!*tmp)
-	{
-		free (tmp);
-		return strdup ("/");
-	}
-	end = strrchr (tmp, '/');
-	if (!end) return tmp;
-
-	result = br_strndup (tmp, end - tmp);
-	free (tmp);
-
-	if (!*result)
-	{
-		free (result);
-		result = strdup ("/");
-	}
-
-	return result;
-}
-
-
-/**
- * br_set_fallback_function:
- * func: A function to call to find the binary.
- * data: User data to pass to func.
- *
- * Sets a function to call to find the path to the binary, in
- * case "/proc/self/maps" can't be opened. The function set should
- * return a string that is safe to free with free().
- */
-void
-br_set_locate_fallback_func (br_locate_fallback_func func, void *data)
-{
-	fallback_func = func;
-	fallback_data = data;
-}
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _PREFIX_C */
--- a/libpurple/prefix.h	Sat Apr 14 02:19:49 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-/*
- * I made the following modifications, be sure to readd these when
- * upgrading these files.
- *
- * Added this comment.
- * Added "purple_ ## " to the namespace
- * Changed the lib macro to use /lib/purple instead of just /lib
- *  (why does purple do that in the -DLIBDIR autoconf thing anyway?)
- *
- */
-
-/*
- * BinReloc - a library for creating relocatable executables
- * Written by: Mike Hearn <mike@theoretic.com>
- *             Hongli Lai <h.lai@chello.nl>
- * http://autopackage.org/
- *
- * This source code is public domain. You can relicense this code
- * under whatever license you want.
- *
- * See http://autopackage.org/docs/binreloc/ for
- * more information and how to use this.
- *
- * NOTE: if you're using C++ and are getting "undefined reference
- * to br_*", try renaming prefix.c to prefix.cpp
- */
-
-#ifndef _PREFIX_H_
-#define _PREFIX_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/* WARNING, BEFORE YOU MODIFY PREFIX.C:
- *
- * If you make changes to any of the functions in prefix.c, you MUST
- * change the BR_NAMESPACE macro.
- * This way you can avoid symbol table conflicts with other libraries
- * that also happen to use BinReloc.
- *
- * Example:
- * #define BR_NAMESPACE(funcName) foobar_ ## funcName
- * --> expands br_locate to foobar_br_locate
- */
-#undef BR_NAMESPACE
-#define BR_NAMESPACE(funcName) purple_ ## funcName
-
-
-#ifdef ENABLE_BINRELOC
-
-#define br_thread_local_store BR_NAMESPACE(br_thread_local_store)
-#define br_locate BR_NAMESPACE(br_locate)
-#define br_locate_prefix BR_NAMESPACE(br_locate_prefix)
-#define br_prepend_prefix BR_NAMESPACE(br_prepend_prefix)
-
-#ifndef BR_NO_MACROS
-	/* These are convenience macros that replace the ones usually used
-	   in Autoconf/Automake projects */
-	#undef SELFPATH
-	#undef PREFIX
-	#undef PREFIXDIR
-	#undef BINDIR
-	#undef SBINDIR
-	#undef DATADIR
-	#undef LIBDIR
-	#undef LIBEXECDIR
-	#undef ETCDIR
-	#undef SYSCONFDIR
-	#undef CONFDIR
-	#undef LOCALEDIR
-
-	#define SELFPATH	(br_thread_local_store (br_locate ((void *) "")))
-	#define PREFIX		(br_thread_local_store (br_locate_prefix ((void *) "")))
-	#define PREFIXDIR	(br_thread_local_store (br_locate_prefix ((void *) "")))
-	#define BINDIR		(br_thread_local_store (br_prepend_prefix ((void *) "", "/bin")))
-	#define SBINDIR		(br_thread_local_store (br_prepend_prefix ((void *) "", "/sbin")))
-	#define DATADIR		(br_thread_local_store (br_prepend_prefix ((void *) "", "/share")))
-	#define LIBDIR		(br_thread_local_store (br_prepend_prefix ((void *) "", "/lib/libpurple")))
-	#define LIBEXECDIR	(br_thread_local_store (br_prepend_prefix ((void *) "", "/libexec")))
-	#define ETCDIR		(br_thread_local_store (br_prepend_prefix ((void *) "", "/etc")))
-	#define SYSCONFDIR	(br_thread_local_store (br_prepend_prefix ((void *) "", "/etc")))
-	#define CONFDIR		(br_thread_local_store (br_prepend_prefix ((void *) "", "/etc")))
-	#define LOCALEDIR	(br_thread_local_store (br_prepend_prefix ((void *) "", "/share/locale")))
-#endif /* BR_NO_MACROS */
-
-
-/* The following functions are used internally by BinReloc
-   and shouldn't be used directly in applications. */
-
-char *br_locate		(void *symbol);
-char *br_locate_prefix	(void *symbol);
-char *br_prepend_prefix	(void *symbol, char *path);
-
-#endif /* ENABLE_BINRELOC */
-
-const char *br_thread_local_store (char *str);
-
-
-/* These macros and functions are not guarded by the ENABLE_BINRELOC
- * macro because they are portable. You can use these functions.
- */
-
-#define br_strcat BR_NAMESPACE(br_strcat)
-#define br_extract_dir BR_NAMESPACE(br_extract_dir)
-#define br_extract_prefix BR_NAMESPACE(br_extract_prefix)
-#define br_set_locate_fallback_func BR_NAMESPACE(br_set_locate_fallback_func)
-
-#ifndef BR_NO_MACROS
-	/* Convenience functions for concatenating paths */
-
-	/* Each time you call one, the previous result will be freed. So don't do this:
-	 *
-	 *   some_function( BR_DATADIR("/one"), BR_DATADIR("/two") )
-	 *
-	 * as the first parameter will now be bogus!
-	 */
-
-	#define BR_SELFPATH(suffix)	(br_thread_local_store (br_strcat (SELFPATH, suffix)))
-	#define BR_PREFIX(suffix)	(br_thread_local_store (br_strcat (PREFIX, suffix)))
-	#define BR_PREFIXDIR(suffix)	(br_thread_local_store (br_strcat (BR_PREFIX, suffix)))
-	#define BR_BINDIR(suffix)	(br_thread_local_store (br_strcat (BINDIR, suffix)))
-	#define BR_SBINDIR(suffix)	(br_thread_local_store (br_strcat (SBINDIR, suffix)))
-	#define BR_DATADIR(suffix)	(br_thread_local_store (br_strcat (DATADIR, suffix)))
-	#define BR_LIBDIR(suffix)	(br_thread_local_store (br_strcat (LIBDIR, suffix)))
-	#define BR_LIBEXECDIR(suffix)	(br_thread_local_store (br_strcat (LIBEXECDIR, suffix)))
-	#define BR_ETCDIR(suffix)	(br_thread_local_store (br_strcat (ETCDIR, suffix)))
-	#define BR_SYSCONFDIR(suffix)	(br_thread_local_store (br_strcat (SYSCONFDIR, suffix)))
-	#define BR_CONFDIR(suffix)	(br_thread_local_store (br_strcat (CONFDIR, suffix)))
-	#define BR_LOCALEDIR(suffix)	(br_thread_local_store (br_strcat (LOCALEDIR, suffix)))
-#endif
-
-char *br_strcat	(const char *str1, const char *str2);
-char *br_extract_dir	(const char *path);
-char *br_extract_prefix(const char *path);
-typedef char *(*br_locate_fallback_func) (void *symbol, void *data);
-void br_set_locate_fallback_func (br_locate_fallback_func func, void *data);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _PREFIX_H_ */
--- a/pidgin/gtkdialogs.c	Sat Apr 14 02:19:49 2007 +0000
+++ b/pidgin/gtkdialogs.c	Sat Apr 14 07:15:02 2007 +0000
@@ -494,12 +494,6 @@
 #else
 	g_string_append(str, "  <b>Print debugging messages:</b> No<br/>");
 #endif
-
-#ifdef ENABLE_BINRELOC
-	g_string_append(str, "  <b>Binary relocation:</b> Enabled<br/>");
-#else
-	g_string_append(str, "  <b>Binary relocation:</b> Disabled<br/>");
-#endif
 #endif
 
 #ifdef PURPLE_PLUGINS
--- a/pidgin/gtkmain.c	Sat Apr 14 02:19:49 2007 +0000
+++ b/pidgin/gtkmain.c	Sat Apr 14 07:15:02 2007 +0000
@@ -414,65 +414,6 @@
 }
 #endif /* HAVE_STARTUP_NOTIFICATION */
 
-#ifndef _WIN32
-static char *pidgin_find_binary_location(void *symbol, void *data)
-{
-	static char *fullname = NULL;
-	static gboolean first = TRUE;
-
-	char *argv0 = data;
-	struct stat st;
-	char *basebuf, *linkbuf, *fullbuf;
-
-	if (!first)
-		/* We've already been through this. */
-		return strdup(fullname);
-
-	first = FALSE;
-
-	if (!argv0)
-		return NULL;
-
-
-	basebuf = g_find_program_in_path(argv0);
-
-	/* But we still need to deal with symbolic links */
-	g_lstat(basebuf, &st);
-	while ((st.st_mode & S_IFLNK) == S_IFLNK) {
-		int written;
-		linkbuf = g_malloc(1024);
-		written = readlink(basebuf, linkbuf, 1024 - 1);
-		if (written == -1)
-		{
-			/* This really shouldn't happen, but do we
-			 * need something better here? */
-			g_free(linkbuf);
-			continue;
-		}
-		linkbuf[written] = '\0';
-		if (linkbuf[0] == G_DIR_SEPARATOR) {
-			/* an absolute path */
-			fullbuf = g_strdup(linkbuf);
-		} else {
-			char *dirbuf = g_path_get_dirname(basebuf);
-			/* a relative path */
-			fullbuf = g_strdup_printf("%s%s%s",
-						  dirbuf, G_DIR_SEPARATOR_S,
-						  linkbuf);
-			g_free(dirbuf);
-		}
-		/* There's no memory leak here.  Really! */
-		g_free(linkbuf);
-		g_free(basebuf);
-		basebuf = fullbuf;
-		g_lstat(basebuf, &st);
-	}
-
-	fullname = basebuf;
-	return strdup(fullname);
-}
-#endif /* #ifndef _WIN32 */
-
 /* FUCKING GET ME A TOWEL! */
 #ifdef _WIN32
 /* suppress gcc "no previous prototype" warning */
@@ -528,9 +469,6 @@
 	g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
 #endif
 
-#ifndef _WIN32
-	br_set_locate_fallback_func(pidgin_find_binary_location, argv[0]);
-#endif
 #ifdef ENABLE_NLS
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	bind_textdomain_codeset(PACKAGE, "UTF-8");
--- a/pidgin/gtkstatusbox.c	Sat Apr 14 02:19:49 2007 +0000
+++ b/pidgin/gtkstatusbox.c	Sat Apr 14 07:15:02 2007 +0000
@@ -1875,7 +1875,7 @@
 		GtkTextDirection dir = gtk_widget_get_direction(widget);
 		parent_alc.width -= (parent_alc.height + border_width);
 		icon_alc = parent_alc;
-		icon_alc.height = MAX(1,req.height) - (border_width*2) -2;
+		icon_alc.height = MAX(1, icon_alc.height) - 2;
 		icon_alc.width = icon_alc.height;
 		if (dir == GTK_TEXT_DIR_RTL) {
 			icon_alc.x = parent_alc.x;
--- a/pidgin/plugins/crazychat/configure.ac	Sat Apr 14 02:19:49 2007 +0000
+++ b/pidgin/plugins/crazychat/configure.ac	Sat Apr 14 07:15:02 2007 +0000
@@ -1376,8 +1376,6 @@
 	LDFLAGS="$orig_LDFLAGS"
 fi
 
-AM_BINRELOC
-
 AC_MSG_CHECKING(for me pot o' gold)
 AC_MSG_RESULT(no)
 AC_CHECK_FUNCS(gethostid lrand48)