Created
May 27, 2010 12:43
-
-
Save indeyets/415756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/configure b/configure | |
index 3245683..070ac7b 100755 | |
--- a/configure | |
+++ b/configure | |
@@ -17807,171 +17807,11 @@ fi | |
$as_echo "Mac OS X - carbon" >&6; } | |
platform_carbon=yes | |
SOPREFIX='lib' | |
- | |
- # Check whether --enable-binreloc was given. | |
-if test "${enable_binreloc+set}" = set; then : | |
- enableval=$enable_binreloc; enable_binreloc=$enableval | |
-else | |
- enable_binreloc=auto | |
-fi | |
- | |
- | |
- # Check whether --enable-binreloc-threads was given. | |
-if test "${enable_binreloc_threads+set}" = set; then : | |
- enableval=$enable_binreloc_threads; enable_binreloc_threads=$enableval | |
-else | |
- enable_binreloc_threads=yes | |
-fi | |
- | |
- | |
- BINRELOC_CFLAGS= | |
- BINRELOC_LIBS= | |
- if test "x$enable_binreloc" = "xauto"; then | |
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc/self/maps" >&5 | |
-$as_echo_n "checking for /proc/self/maps... " >&6; } | |
-if test "${ac_cv_file__proc_self_maps+set}" = set; then : | |
- $as_echo_n "(cached) " >&6 | |
-else | |
- test "$cross_compiling" = yes && | |
- as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 | |
-if test -r "/proc/self/maps"; then | |
- ac_cv_file__proc_self_maps=yes | |
-else | |
- ac_cv_file__proc_self_maps=no | |
-fi | |
-fi | |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__proc_self_maps" >&5 | |
-$as_echo "$ac_cv_file__proc_self_maps" >&6; } | |
-if test "x$ac_cv_file__proc_self_maps" = x""yes; then : | |
- | |
-fi | |
- | |
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether everything is installed to the same prefix" >&5 | |
-$as_echo_n "checking whether everything is installed to the same prefix... " >&6; } | |
-if test "${br_cv_valid_prefixes+set}" = set; then : | |
- $as_echo_n "(cached) " >&6 | |
-else | |
- | |
- 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 | |
- br_cv_valid_prefixes=yes | |
- else | |
- br_cv_valid_prefixes=no | |
- fi | |
- | |
-fi | |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $br_cv_valid_prefixes" >&5 | |
-$as_echo "$br_cv_valid_prefixes" >&6; } | |
- fi | |
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether binary relocation support should be enabled" >&5 | |
-$as_echo_n "checking whether binary relocation support should be enabled... " >&6; } | |
-if test "${br_cv_binreloc+set}" = set; then : | |
- $as_echo_n "(cached) " >&6 | |
-else | |
- if test "x$enable_binreloc" = "xyes"; then | |
- br_cv_binreloc=yes | |
- elif test "x$enable_binreloc" = "xauto"; then | |
- if test "x$br_cv_valid_prefixes" = "xyes" -a \ | |
- "x$ac_cv_file__proc_self_maps" = "xyes"; then | |
- br_cv_binreloc=yes | |
- else | |
- br_cv_binreloc=no | |
- fi | |
- else | |
- br_cv_binreloc=no | |
- fi | |
-fi | |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $br_cv_binreloc" >&5 | |
-$as_echo "$br_cv_binreloc" >&6; } | |
- | |
- if test "x$br_cv_binreloc" = "xyes"; then | |
- BINRELOC_CFLAGS="-DENABLE_BINRELOC" | |
- | |
-$as_echo "#define ENABLE_BINRELOC /**/" >>confdefs.h | |
- | |
- if test "x$enable_binreloc_threads" = "xyes"; then | |
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_getspecific in -lpthread" >&5 | |
-$as_echo_n "checking for pthread_getspecific in -lpthread... " >&6; } | |
-if test "${ac_cv_lib_pthread_pthread_getspecific+set}" = set; then : | |
- $as_echo_n "(cached) " >&6 | |
-else | |
- ac_check_lib_save_LIBS=$LIBS | |
-LIBS="-lpthread $LIBS" | |
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
-/* end confdefs.h. */ | |
- | |
-/* Override any GCC internal prototype to avoid an error. | |
- Use char because int might match the return type of a GCC | |
- builtin and then its argument prototype would still apply. */ | |
-#ifdef __cplusplus | |
-extern "C" | |
-#endif | |
-char pthread_getspecific (); | |
-int | |
-main () | |
-{ | |
-return pthread_getspecific (); | |
- ; | |
- return 0; | |
-} | |
-_ACEOF | |
-if ac_fn_c_try_link "$LINENO"; then : | |
- ac_cv_lib_pthread_pthread_getspecific=yes | |
-else | |
- ac_cv_lib_pthread_pthread_getspecific=no | |
-fi | |
-rm -f core conftest.err conftest.$ac_objext \ | |
- conftest$ac_exeext conftest.$ac_ext | |
-LIBS=$ac_check_lib_save_LIBS | |
-fi | |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_getspecific" >&5 | |
-$as_echo "$ac_cv_lib_pthread_pthread_getspecific" >&6; } | |
-if test "x$ac_cv_lib_pthread_pthread_getspecific" = x""yes; then : | |
- cat >>confdefs.h <<_ACEOF | |
-#define HAVE_LIBPTHREAD 1 | |
-_ACEOF | |
- | |
- LIBS="-lpthread $LIBS" | |
- | |
-fi | |
- | |
- fi | |
- | |
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether binary relocation should use threads" >&5 | |
-$as_echo_n "checking whether binary relocation should use threads... " >&6; } | |
-if test "${br_cv_binreloc_threads+set}" = set; then : | |
- $as_echo_n "(cached) " >&6 | |
-else | |
- if test "x$enable_binreloc_threads" = "xyes"; then | |
- if test "x$ac_cv_lib_pthread_pthread_getspecific" = "xyes"; then | |
- br_cv_binreloc_threads=yes | |
- else | |
- br_cv_binreloc_threads=no | |
- fi | |
- else | |
- br_cv_binreloc_threads=no | |
- fi | |
-fi | |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $br_cv_binreloc_threads" >&5 | |
-$as_echo "$br_cv_binreloc_threads" >&6; } | |
- | |
- if test "x$br_cv_binreloc_threads" = "xyes"; then | |
- BINRELOC_LIBS="-lpthread" | |
- | |
-$as_echo "#define BR_PTHREAD 1" >>confdefs.h | |
- | |
- else | |
- BINRELOC_CFLAGS="$BINRELOC_CFLAGS -DBR_PTHREADS=0" | |
- | |
-$as_echo "#define BR_PTHREAD 0" >>confdefs.h | |
- | |
- fi | |
- fi | |
- | |
- | |
- | |
+ if test "$enable_binreloc" != "no" | |
+ then | |
+ $as_echo "#define ENABLE_BINRELOC 1" >>confdefs.h | |
+ br_cv_binreloc=yes | |
+ fi | |
LIBTOOL_EXPORT_OPTIONS=$EXPORT_SYM_REGEX | |
LIBTOOL_PROV_EXPORT_OPTIONS=$EXPORT_PROV_SYM_REGEX | |
$as_echo "#define HAVE_CARBON 1" >>confdefs.h | |
diff --git a/libgda/binreloc/gda-binreloc.c b/libgda/binreloc/gda-binreloc.c | |
index 26a0593..26d6333 100644 | |
--- a/libgda/binreloc/gda-binreloc.c | |
+++ b/libgda/binreloc/gda-binreloc.c | |
@@ -40,7 +40,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) | |
return TRUE; | |
} | |
#elif HAVE_CARBON | |
-#include <Carbon/Carbon.h> | |
+ #ifdef ENABLE_BINRELOC | |
+ #include <Carbon/Carbon.h> | |
+ #endif | |
#endif | |
@@ -191,7 +193,8 @@ gda_gbr_get_file_path (GdaPrefixDir where, ...) | |
g_ascii_strcasecmp (p + 1, "lib") == 0)) | |
*p = '\0'; | |
#elif HAVE_CARBON | |
-#define MAXLEN 500 | |
+ #ifdef ENABLE_BINRELOC | |
+ #define MAXLEN 500 | |
ProcessSerialNumber myProcess; | |
FSRef bundleLocation; | |
unsigned char bundlePath[MAXLEN]; | |
@@ -210,6 +213,9 @@ gda_gbr_get_file_path (GdaPrefixDir where, ...) | |
} | |
else | |
g_warning ("Could not get PREFIX (using Mac OS X Carbon)"); | |
+ #endif | |
+ if (!prefix) | |
+ prefix = g_strdup (LIBGDAPREFIX); | |
#else | |
if (!prefix) | |
prefix = _gda_gbr_find_prefix (LIBGDAPREFIX); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment