diff options
author | Andrzej Hunt <andrzej@ahunt.org> | 2015-06-02 13:53:55 +0100 |
---|---|---|
committer | Andrzej Hunt <andrzej@ahunt.org> | 2015-10-20 18:18:41 +0200 |
commit | 09556129755e2aebee2ebf656e9e6689eb562118 (patch) | |
tree | 86bd4feafcaa2f35bc3aff2e94a3ab35642c7344 | |
parent | 4331384ef441857d1448cfab2efe499f2e9de552 (diff) |
Enable --with-system-udunits2
We also have to move udunits2 headers to match the default system
installation location of ududnits2/udunits2.h (whereas udunits2 bundled
build puts the headers in lib/udunits2.h by default).
Change-Id: I1d314f6b3e016f90cfb8e19a143bb77ae98e7734
-rw-r--r-- | RepositoryExternal.mk | 11 | ||||
-rw-r--r-- | config_host.mk.in | 3 | ||||
-rw-r--r-- | configure.ac | 46 | ||||
-rw-r--r-- | external/udunits2/ExternalProject_udunits2.mk | 5 | ||||
-rw-r--r-- | sc/CppunitTest_sc_ucalc.mk | 2 | ||||
-rw-r--r-- | sc/CppunitTest_sc_units.mk | 2 | ||||
-rw-r--r-- | sc/Library_sc.mk | 2 | ||||
-rw-r--r-- | sc/source/core/units/unitsimpl.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/units/unitsimpl.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/units/util.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/units/utunit.hxx | 2 |
11 files changed, 33 insertions, 46 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 933d28111244..1510ee50acf1 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -151,18 +151,21 @@ ifeq ($(ENABLE_CALC_UNITVERIFICATION),TRUE) ifneq ($(SYSTEM_UDUNITS2),) -define gb_LinkTarget__use_libudunits2 +define gb_LinkTarget__use_udunits2 +$(call gb_LinkTarget_add_defs,$(1),\ + -DSYSTEM_UDUNITS2 \ +) $(call gb_LinkTarget_set_include,$(1),\ $(UDUNITS2_CFLAGS) \ $$(INCLUDE) \ ) -$(call gb_LinkTarget_add_libs,$(1),$(UDUNIT2_LIBS)) +$(call gb_LinkTarget_add_libs,$(1),$(UDUNITS2_LIBS)) endef else # !SYSTEM_UDUNITS2 -define gb_LinkTarget__use_libudunits2 +define gb_LinkTarget__use_udunits2 $(call gb_LinkTarget_use_package,$(1),udunits2) $(call gb_LinkTarget_set_include,$(1),\ $$(INCLUDE) \ @@ -184,7 +187,7 @@ endif # !SYSTEM_UDUNITS2 else # !ENABLE_CALC_UNITVERIFICATION -gb_LinkTarget__use_libudunits2 := +gb_LinkTarget__use_udunits2 := endif # ENABLE_CALC_UNITVERIFICATION diff --git a/config_host.mk.in b/config_host.mk.in index 417bfee6593e..fc5cc875309e 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -179,6 +179,9 @@ export ENABLE_TDE=@ENABLE_TDE@ export ENABLE_TDEAB=@ENABLE_TDEAB@ export ENABLE_TELEPATHY=@ENABLE_TELEPATHY@ export ENABLE_CALC_UNITVERIFICATION=@ENABLE_CALC_UNITVERIFICATION@ +export SYSTEM_UDUNITS2=@SYSTEM_UDUNITS2@ +export UDUNITS2_CFLAGS=@UDUNITS2_CFLAGS@ +export UDUNITS2_LIBS=@UDUNITS2_LIBS@ export ENABLE_VALGRIND=@ENABLE_VALGRIND@ export ENABLE_VLC=@ENABLE_VLC@ export ENABLE_WERROR=@ENABLE_WERROR@ diff --git a/configure.ac b/configure.ac index b02577eba1ea..115e85dab5f8 100644 --- a/configure.ac +++ b/configure.ac @@ -1744,7 +1744,7 @@ AC_ARG_WITH(system-firebird, AC_ARG_WITH(system-udunits2, AS_HELP_STRING([--with-system-udunits2], - [Use udunits libraries already on system, for building calc unit-verification it.]),, + [Use udunits libraries already on system, for building calc unit-verification with it.]),, [with_system_udunits2="$with_system_libs"]) AC_ARG_WITH(system-hsqldb, @@ -8692,48 +8692,26 @@ if test "x$enable_calc_unitverification" = "xyes"; then if test "$with_system_udunits2" = "yes"; then AC_MSG_RESULT([external]) SYSTEM_UDUNITS2=TRUE - AC_PATH_PROG(FIREBIRDCONFIG, [fb_config]) - if test -z "$FIREBIRDCONFIG"; then - AC_MSG_NOTICE([No fb_config -- using pkg-config]) - PKG_CHECK_MODULES(FIREBIRD, fbembed) - FIREBIRD_VERSION=`pkg-config --modversion fbembed` - else - AC_MSG_NOTICE([fb_config found]) - FIREBIRD_VERSION=`$FIREBIRDCONFIG --version` - AC_MSG_CHECKING([for Firebird Client library]) - FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags` - FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs` - fi - AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS']) - AC_MSG_CHECKING([Firebird version]) - if test -n "${FIREBIRD_VERSION}"; then - FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1` - FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2` - if test "$FIREBIRD_MAJOR" -eq "2" -a "$FIREBIRD_MINOR" -eq "5"; then - AC_MSG_RESULT([OK]) - else - AC_MSG_ERROR([Ensure firebird 2.5.x is installed]) - fi - else - __save_CFLAGS="${CFLAGS}" - CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h> -#if defined(FB_API_VER) && FB_API_VER == 25 -#else -#error "Wrong Firebird API version" -#endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 2.5.x is installed])) - CFLAGS="${__save_CFLAGS}" + + PKG_CHECK_MODULES(UDUNITS2, udunits >= 2.2.1, UDUNITS2_PKGCONFIG=yes, UDUNITS2_PKGCONFIG=no) + + if test "x$UDUNITS2_PKGCONFIG" = "xno"; then + AC_CHECK_HEADER(udunits2/udunits2.h, [], + [AC_MSG_ERROR(udunits2/ududunits2.h not found. install udunits2)], []) + AC_CHECK_LIB([udunits2], [ut_read_xml], [:], [AC_MSG_ERROR(udunits2 lib not found or functional)], []) fi - ENABLE_FIREBIRD_SDBC="TRUE" + + ENABLE_CALC_UNITVERIFICATION="TRUE" else AC_MSG_RESULT([internal]) SYSTEM_UDUNITS2= UDUNITS2_CFLAGS="-I${WORKDIR}/UnpackedTarball/udunits2/lib" - UDUNITS2_LIBS="-ludunits2" BUILD_TYPE="$BUILD_TYPE UDUNITS2" ENABLE_CALC_UNITVERIFICATION="TRUE" fi + + UDUNITS2_LIBS="-ludunits2" fi AC_SUBST(ENABLE_CALC_UNITVERIFICATION) AC_SUBST(SYSTEM_UDUNITS2) diff --git a/external/udunits2/ExternalProject_udunits2.mk b/external/udunits2/ExternalProject_udunits2.mk index fd54fc4b44a4..ba6479ee8cd1 100644 --- a/external/udunits2/ExternalProject_udunits2.mk +++ b/external/udunits2/ExternalProject_udunits2.mk @@ -20,7 +20,10 @@ $(eval $(call gb_ExternalProject_register_targets,udunits2,\ $(call gb_ExternalProject_get_state_target,udunits2,build) : $(call gb_ExternalProject_get_state_target,udunits2,configure) +$(call gb_ExternalProject_run,build,\ - cd lib && $(MAKE) libudunits2.la \ + cd lib && \ + $(MAKE) libudunits2.la && \ + mkdir udunits2 && \ + cp udunits2.h udunits2/ \ ) $(call gb_ExternalProject_get_state_target,udunits2,configure) : diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk index 4d35f781be9a..db3ecdfb6372 100644 --- a/sc/CppunitTest_sc_ucalc.mk +++ b/sc/CppunitTest_sc_ucalc.mk @@ -35,7 +35,7 @@ $(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\ icui18n \ icuuc \ $(if $(ENABLE_CALC_UNITVERIFICATION), \ - libudunits2 \ + udunits2 \ ) \ libxml2 \ mdds_headers \ diff --git a/sc/CppunitTest_sc_units.mk b/sc/CppunitTest_sc_units.mk index 241836b43baa..9af3d7e9f471 100644 --- a/sc/CppunitTest_sc_units.mk +++ b/sc/CppunitTest_sc_units.mk @@ -29,7 +29,7 @@ $(eval $(call gb_CppunitTest_use_externals,sc_units,\ icu_headers \ icui18n \ icuuc \ - libudunits2 \ + udunits2 \ libxml2 \ mdds_headers \ orcus \ diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index fb47b3ccacf7..c86c4ec5f3dc 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -48,7 +48,7 @@ $(eval $(call gb_Library_use_externals,sc,\ icuuc \ libxml2 \ $(if $(ENABLE_CALC_UNITVERIFICATION), \ - libudunits2 \ + udunits2 \ ) \ mdds_headers \ )) diff --git a/sc/source/core/units/unitsimpl.cxx b/sc/source/core/units/unitsimpl.cxx index 63327478570b..c440df605be9 100644 --- a/sc/source/core/units/unitsimpl.cxx +++ b/sc/source/core/units/unitsimpl.cxx @@ -55,7 +55,7 @@ UnitsImpl::UnitsImpl() { // System udunits will (/should) be able to find it's unit database // itself -- however for bundled udunits we always need to find the // correct relative path within our LO installation. -#ifdef USING_SYSTEM_UDUNITS +#ifdef SYSTEM_UDUNITS2 const sal_Char* pPath = 0; #else OUString sDBURL("$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/udunits2/udunits2.xml"); diff --git a/sc/source/core/units/unitsimpl.hxx b/sc/source/core/units/unitsimpl.hxx index 934bb2604de6..f3e2cb8484a7 100644 --- a/sc/source/core/units/unitsimpl.hxx +++ b/sc/source/core/units/unitsimpl.hxx @@ -19,7 +19,7 @@ #include <osl/mutex.hxx> #include <rtl/ustring.hxx> -#include <udunits2.h> +#include <udunits2/udunits2.h> #include "rangelst.hxx" #include "units.hxx" diff --git a/sc/source/core/units/util.cxx b/sc/source/core/units/util.cxx index 2146c4395aa9..b536e9955631 100644 --- a/sc/source/core/units/util.cxx +++ b/sc/source/core/units/util.cxx @@ -9,7 +9,7 @@ */ #include "util.hxx" -#include <udunits2.h> +#include <udunits2/udunits2.h> namespace sc { namespace units { diff --git a/sc/source/core/units/utunit.hxx b/sc/source/core/units/utunit.hxx index 5d1442a6d03a..8508f93e0f20 100644 --- a/sc/source/core/units/utunit.hxx +++ b/sc/source/core/units/utunit.hxx @@ -15,7 +15,7 @@ #include <boost/optional.hpp> #include <boost/shared_ptr.hpp> -#include <udunits2.h> +#include <udunits2/udunits2.h> namespace sc { namespace units { |