blob: bf01af46334313616cc5b863c45461f8da4a57dc [file] [log] [blame] [edit]
diff -aruN a/CFUniChar.c b/CFUniChar.c
--- a/CFUniChar.c 2009-02-19 16:25:06.000000000 -0800
+++ b/CFUniChar.c 2016-06-03 16:45:46.707080496 -0700
@@ -67,7 +67,7 @@
#if DEPLOYMENT_TARGET_MACOSX
#define __kCFCharacterSetDir "/System/Library/CoreServices"
#elif DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD
-#define __kCFCharacterSetDir "/usr/local/share/CoreFoundation"
+#define __kCFCharacterSetDir __kCFDataDir "/CoreFoundation"
#elif DEPLOYMENT_TARGET_WINDOWS
#define __kCFCharacterSetDir "\\Windows\\CoreFoundation"
#define MAXPATHLEN MAX_PATH
@@ -129,6 +129,26 @@
strlcpy(cpath, _CFDLLPath(), MAXPATHLEN);
#else
strlcpy(cpath, __kCFCharacterSetDir, MAXPATHLEN);
+ // For non-absolute paths, prefix them with the path to this executable
+ if (*cpath != '/') {
+ int len;
+ char *lastslash;
+
+ len = readlink("/proc/self/exe", cpath, MAXPATHLEN);
+ if (len < 0) {
+ cpath[0] = '\0';
+ } else {
+ cpath[len] = '\0';
+ }
+
+ // Would have used dirname(), but it was behaving badly, and this works in place
+ lastslash = strrchr(cpath, '/');
+ if (lastslash != NULL) {
+ *(lastslash + 1) = '\0';
+ }
+
+ strlcat(cpath, __kCFCharacterSetDir, MAXPATHLEN);
+ }
#endif
#if DEPLOYMENT_TARGET_WINDOWS || 0
diff -aruN a/configure b/configure
--- a/configure 2016-06-03 16:43:52.651387528 -0700
+++ b/configure 2016-06-03 16:44:19.875314281 -0700
@@ -1305,7 +1305,7 @@
# Be sure to have absolute directory names.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
+ sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
do
diff -aruN a/Makefile.am b/Makefile.am
--- a/Makefile.am 2009-03-10 16:31:21.000000000 -0700
+++ b/Makefile.am 2016-06-03 16:44:19.879314270 -0700
@@ -25,7 +25,7 @@
# Unicode character mappings.
#
-libCoreFoundation_la_datadir = ${datadir}/CoreServices
+libCoreFoundation_la_datadir = ${datadir}/CoreFoundation/CharacterSets
libCoreFoundation_la_data_DATA = CFCharacterSetBitmaps.bitmap \
CFUniCharPropertyDatabase.data \
@@ -35,7 +35,7 @@
CF_COMMON_CPPFLAGS = $(AM_CPPFLAGS) \
-DU_SHOW_DRAFT_API=1 \
-DCF_BUILDING_CF=1 \
- -D__kCFCharacterSetDir=\"${libCoreFoundation_la_datadir}\" \
+ -D__kCFDataDir=\"${datadir}\" \
-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_5 \
-I$(top_srcdir)/include \
-I$(top_srcdir)/include/mach_support
diff -aruN a/Makefile.in b/Makefile.in
--- a/Makefile.in 2009-03-10 23:44:36.000000000 -0700
+++ b/Makefile.in 2016-06-03 16:44:19.879314270 -0700
@@ -535,7 +535,7 @@
# Define where we will install and where CoreFoundation can find its
# Unicode character mappings.
#
-libCoreFoundation_la_datadir = ${datadir}/CoreServices
+libCoreFoundation_la_datadir = ${datadir}/CoreFoundation/CharacterSets
libCoreFoundation_la_data_DATA = CFCharacterSetBitmaps.bitmap \
CFUniCharPropertyDatabase.data \
CFUnicodeData-B.mapping \
@@ -544,7 +544,7 @@
CF_COMMON_CPPFLAGS = $(AM_CPPFLAGS) \
-DU_SHOW_DRAFT_API=1 \
-DCF_BUILDING_CF=1 \
- -D__kCFCharacterSetDir=\"${libCoreFoundation_la_datadir}\" \
+ -D__kCFDataDir=\"${datadir}\" \
-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_5 \
-I$(top_srcdir)/include \
-I$(top_srcdir)/include/mach_support