configure prefix for "installation" and get_data() function

* LIBO_LANGTAG_DATADIR environment variable may point to liblangtag data and
  override REGDATADIR define.
* deliver data files to $SOLARVER/$INPATH/share/liblangtag
This commit is contained in:
Eike Rathke
2012-06-04 23:28:55 +02:00
parent bf7b50a759
commit 12cfcf3733
3 changed files with 56 additions and 48 deletions

View File

@@ -0,0 +1,35 @@
--- misc/liblangtag-0.2/liblangtag/lt-xml.c 2012-02-02 09:54:51.000000000 +0100
+++ misc/build/liblangtag-0.2/liblangtag/lt-xml.c 2012-06-04 17:39:32.010299830 +0200
@@ -45,6 +45,14 @@
G_LOCK_DEFINE_STATIC (lt_xml);
+static const char* get_datadir()
+{
+ const char* pEnv = getenv( "LIBO_LANGTAG_DATADIR");
+ if (pEnv && *pEnv)
+ return pEnv;
+ return REGDATADIR;
+}
+
/*< private >*/
static gboolean
lt_xml_read_subtag_registry(lt_xml_t *xml,
@@ -62,7 +70,7 @@
if (!g_file_test(regfile, G_FILE_TEST_EXISTS)) {
g_free(regfile);
#endif
- regfile = g_build_filename(REGDATADIR, "language-subtag-registry.xml", NULL);
+ regfile = g_build_filename(get_datadir(), "language-subtag-registry.xml", NULL);
#ifdef GNOME_ENABLE_DEBUG
}
#endif
@@ -120,7 +128,7 @@
if (!g_file_test(regfile, G_FILE_TEST_EXISTS)) {
g_free(regfile);
#endif
- regfile = g_build_filename(REGDATADIR, "common", "bcp47", filename, NULL);
+ regfile = g_build_filename(get_datadir(), "common", "bcp47", filename, NULL);
#ifdef GNOME_ENABLE_DEBUG
}
#endif

View File

@@ -14,8 +14,8 @@ TARGET=liblangtag
LIBLANGTAG_MAJOR=0 LIBLANGTAG_MAJOR=0
LIBLANGTAG_MINOR=2 LIBLANGTAG_MINOR=2
LIBLANGTAG_MICRO=0 LIBLANGTAG_MICRO=0
# currently liblangtag.so.0.1.0 is generated, presumably a bug? # Currently liblangtag.so.0.1.0 is generated instead of 0.2.0, presumably a bug?
LIBLANGTAG_LIBMINOR=1 # For new versions adapt symlink in prj/d.lst
# --- Settings ----------------------------------------------------- # --- Settings -----------------------------------------------------
@@ -36,12 +36,15 @@ PATCH_FILES=liblangtag-0.2-0001-Fix-a-memory-leak.patch
# liblangtag cf8dfcf1604e534f4c9eccbd9a05571c8a9dc74d # liblangtag cf8dfcf1604e534f4c9eccbd9a05571c8a9dc74d
PATCH_FILES+=liblangtag-0.2-0002-Fix-invalid-memory-access.patch PATCH_FILES+=liblangtag-0.2-0002-Fix-invalid-memory-access.patch
PATCH_FILES+=liblangtag-0.2-configure.patch PATCH_FILES+=liblangtag-0.2-configure.patch
PATCH_FILES+=liblangtag-0.2-datadir.patch
CONFIGURE_DIR=. CONFIGURE_DIR=.
BUILD_DIR=$(CONFIGURE_DIR) BUILD_DIR=$(CONFIGURE_DIR)
CONFIGURE_FLAGS+= --prefix=$(SRC_ROOT)$/$(PRJNAME)$/$(MISC)$/install
.IF "$(SYSTEM_LIBXML)"!="YES" .IF "$(SYSTEM_LIBXML)"!="YES"
CONFIGURE_FLAGS+= LIBXML2_CFLAGS='-I$(SOLARINCDIR)/external/libxml' CONFIGURE_FLAGS+= LIBXML2_CFLAGS='-I$(SOLARINCDIR)$/external$/libxml'
.IF "$(GUI)"=="WNT" && "$(COM)"!="GCC" .IF "$(GUI)"=="WNT" && "$(COM)"!="GCC"
CONFIGURE_FLAGS+= LIBXML2_LIBS='$(SOLARLIBDIR)$/libxml2.lib' CONFIGURE_FLAGS+= LIBXML2_LIBS='$(SOLARLIBDIR)$/libxml2.lib'
.ELSE .ELSE
@@ -66,20 +69,11 @@ CONFIGURE_FLAGS+= --disable-glibtest
CONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) .$/configure CONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) .$/configure
BUILD_ACTION=$(AUGMENT_LIBRARY_PATH) $(GNUMAKE) -j$(EXTMAXPROCESS) BUILD_ACTION=$(AUGMENT_LIBRARY_PATH) $(GNUMAKE) -j$(EXTMAXPROCESS) && \
$(AUGMENT_LIBRARY_PATH) $(GNUMAKE) install
.IF "$(GUI)"=="UNX"
OUT2LIB= \
$(BUILD_DIR)$/liblangtag/.libs$/$(TARGET)$(DLLPOST).$(LIBLANGTAG_MAJOR).$(LIBLANGTAG_LIBMINOR).$(LIBLANGTAG_MICRO) \
$(BUILD_DIR)$/liblangtag/.libs$/$(TARGET)$(DLLPOST).$(LIBLANGTAG_MAJOR) \
$(BUILD_DIR)$/liblangtag/.libs$/$(TARGET)$(DLLPOST)
.ENDIF # "$(GUI)"=="UNX"
.IF "$(GUI)"=="WNT" .IF "$(GUI)"=="WNT"
.IF "$(COM)"=="GCC" .IF "$(COM)"=="GCC"
CONFIGURE_FLAGS+= LDFLAGS=-Wl,--enable-runtime-pseudo-reloc-v2 CONFIGURE_FLAGS+= LDFLAGS=-Wl,--enable-runtime-pseudo-reloc-v2
@@ -88,20 +82,11 @@ CONFIGURE_FLAGS+= LDFLAGS=-Wl,--enable-runtime-pseudo-reloc-v2
CONFIGURE_FLAGS+= --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) CONFIGURE_FLAGS+= --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)
.ENDIF .ENDIF
OUT2LIB= \
$(BUILD_DIR)$/liblangtag/.libs$/$(TARGET)$(DLLPOST).$(LIBLANGTAG_MAJOR).$(LIBLANGTAG_LIBMINOR).$(LIBLANGTAG_MICRO) \
$(BUILD_DIR)$/liblangtag/.libs$/$(TARGET)$(DLLPOST).$(LIBLANGTAG_MAJOR) \
$(BUILD_DIR)$/liblangtag/.libs$/$(TARGET)$(DLLPOST)
.ELSE # "$(COM)"=="GCC" .ELSE # "$(COM)"=="GCC"
PATCH_FILES+=liblangtag-0.2-msc-configure.patch PATCH_FILES+=liblangtag-0.2-msc-configure.patch
OUT2LIB= \
$(BUILD_DIR)$/liblangtag/.libs$/langtag.lib
.ENDIF # "$(COM)"=="GCC" .ENDIF # "$(COM)"=="GCC"
.ENDIF # "$(GUI)"=="WNT" .ENDIF # "$(GUI)"=="WNT"

View File

@@ -1,29 +1,17 @@
mkdir: %_DEST%\inc\liblangtag mkdir: %_DEST%\inc\liblangtag
..\%__SRC%\misc\build\liblangtag*\liblangtag\langtag.h %_DEST%\inc\liblangtag\ ..\%__SRC%\misc\install\include\liblangtag\* %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-database.h %_DEST%\inc\liblangtag\ ..\%__SRC%\misc\install\lib\liblangtag.so* %_DEST%\lib\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-error.h %_DEST%\inc\liblangtag\ ..\%__SRC%\misc\install\lib\langtag.lib* %_DEST%\lib\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-extension.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-extlang-db.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-extlang.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-ext-module-data.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-ext-module.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-gobject.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-grandfathered-db.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-grandfathered.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-lang-db.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-lang.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-redundant-db.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-redundant.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-region-db.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-region.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-script-db.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-script.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-tag.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-variant-db.h %_DEST%\inc\liblangtag\
..\%__SRC%\misc\build\liblangtag*\liblangtag\lt-variant.h %_DEST%\inc\liblangtag\
..\%__SRC%\lib\* %_DEST%\lib\ symlink: %_DEST%\lib\liblangtag.so.0.1.0 %_DEST%\lib\liblangtag.so.0
..\%__SRC%\bin\* %_DEST%\bin\ symlink: %_DEST%\lib\liblangtag.so.0.1.0 %_DEST%\lib\liblangtag.so
linklib: liblangtag.*.*.* mkdir: %_DEST%\share
mkdir: %_DEST%\share\liblangtag
mkdir: %_DEST%\share\liblangtag\common
mkdir: %_DEST%\share\liblangtag\common\bcp47
..\%__SRC%\misc\install\share\liblangtag\* %_DEST%\share\liblangtag\
..\%__SRC%\misc\install\share\liblangtag\common\* %_DEST%\share\liblangtag\common\
..\%__SRC%\misc\install\share\liblangtag\common\bcp47\* %_DEST%\share\liblangtag\common\bcp47\