From 4f7b96886ec2e98f270a9ec3c3509cd523fce7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= Date: Fri, 28 Feb 2014 10:39:19 +0100 Subject: [PATCH] Allow to build lpsolver based on CoinMP library. Change-Id: I0a3b2bd6744f6ccca0017cd1e06a4018f085445a --- Repository.mk | 2 +- RepositoryExternal.mk | 35 +++++++++++++- config_host.mk.in | 2 +- configure.ac | 86 +++++++++++++++++++--------------- postprocess/Rdb_services.mk | 2 +- sccomp/Library_solver.mk | 10 +++- sccomp/Module_sccomp.mk | 2 +- scp2/InstallModule_calc.mk | 7 ++- scp2/InstallModule_ooo.mk | 1 - scp2/source/calc/file_calc.scp | 2 +- 10 files changed, 102 insertions(+), 47 deletions(-) diff --git a/Repository.mk b/Repository.mk index 671f0dcf7133..79d7089d8588 100644 --- a/Repository.mk +++ b/Repository.mk @@ -157,8 +157,8 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,calc, \ scd \ scfilt \ scui \ - $(if $(MPL_SUBSET),,$(if $(ENABLE_LPSOLVE),solver)) \ $(if $(ENABLE_OPENCL),scopencl) \ + $(if $(WITH_LPSOLVER),solver) \ $(if $(DISABLE_SCRIPTING),,vbaobj) \ $(if $(ENABLE_TELEPATHY),tubes) \ )) diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 8931fa6d7ce9..8476ae3e3c0c 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -1858,8 +1858,8 @@ endef endif # ANDROID endif # SYSTEM_LCMS2 +ifeq ($(WITH_LPSOLVER),lpsolve) -ifneq ($(ENABLE_LPSOLVE),) ifneq ($(SYSTEM_LPSOLVE),) define gb_LinkTarget__use_lpsolve @@ -1895,7 +1895,38 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo,\ )) endif # SYSTEM_LPSOLVE -endif # ENABLE_LPSOLVE + +else ifeq ($(WITH_LPSOLVER),coinmp) + +define gb_LinkTarget__use_coinmp +$(call gb_LinkTarget_use_package,$(1),coinmp) +ifeq ($(COM),MSC) +$(call gb_LinkTarget_add_libs,$(1),\ + $(call gb_UnpackedTarball_get_dir,coinmp)/CoinMP/MSVisualStudio/v9/release/CoinMP.lib \ +) +else +$(call gb_LinkTarget_add_libs,$(1),\ + -L$(call gb_UnpackedTarball_get_dir,coinmp)/Cbc/src/.libs -lCbc -lCbcSolver \ + -L$(call gb_UnpackedTarball_get_dir,coinmp)/Cgl/src/.libs -lCgl \ + -L$(call gb_UnpackedTarball_get_dir,coinmp)/Clp/src/.libs -lClp \ + -L$(call gb_UnpackedTarball_get_dir,coinmp)/Clp/src/OsiClp/.libs -lOsiClp \ + -L$(call gb_UnpackedTarball_get_dir,coinmp)/CoinMP/src/.libs -lCoinMP \ + -L$(call gb_UnpackedTarball_get_dir,coinmp)/CoinUtils/src/.libs -lCoinUtils \ + -L$(call gb_UnpackedTarball_get_dir,coinmp)/Osi/src/Osi/.libs -lOsi \ +) +endif +$(call gb_LinkTarget_set_include,$(1),\ + -I$(call gb_UnpackedTarball_get_dir,coinmp)/CoinMP/src \ + $$(INCLUDE) \ +) + +endef + +$(eval $(call gb_Helper_register_packages_for_install,ooo,\ + coinmp \ +)) + +endif # WITH_LPSOLVER ifeq ($(ENABLE_GIO),TRUE) diff --git a/config_host.mk.in b/config_host.mk.in index a9caf504eb00..260367823e7e 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -135,7 +135,6 @@ export ENABLE_KDE4=@ENABLE_KDE4@ export ENABLE_KDE=@ENABLE_KDE@ export ENABLE_LIBLANGTAG=@ENABLE_LIBLANGTAG@ export ENABLE_LOCKDOWN=@ENABLE_LOCKDOWN@ -export ENABLE_LPSOLVE=@ENABLE_LPSOLVE@ export ENABLE_LTO=@ENABLE_LTO@ export ENABLE_LWP=@ENABLE_LWP@ export ENABLE_MACOSX_MACLIKE_APP_STRUCTURE=@ENABLE_MACOSX_MACLIKE_APP_STRUCTURE@ @@ -597,6 +596,7 @@ export WITH_KRB5=@WITH_KRB5@ export WITH_LANG=@WITH_LANG@ export WITH_LANG_LIST=@WITH_LANG_LIST@ export WITH_LINKER_HASH_STYLE=@WITH_LINKER_HASH_STYLE@ +export WITH_LPSOLVER=@WITH_LPSOLVER@ export WITH_MOZAB4WIN=@WITH_MOZAB4WIN@ export WITH_MYSPELL_DICTS=@WITH_MYSPELL_DICTS@ export WITH_POOR_HELP_LOCALIZATIONS=@WITH_POOR_HELP_LOCALIZATIONS@ diff --git a/configure.ac b/configure.ac index 301cbc1e27bd..59919d797c1f 100644 --- a/configure.ac +++ b/configure.ac @@ -655,7 +655,6 @@ linux-android*) enable_neon=no enable_mpl_subset=yes enable_opengl=no - enable_lpsolve=no enable_report_builder=no with_theme="tango" test_cups=no @@ -1770,6 +1769,14 @@ AC_ARG_WITH(system-npapi-headers, [with_system_npapi_headers="$with_system_headers"] ) +AC_ARG_WITH(lpsolver, + AS_HELP_STRING([--with-lpsolver], + [Specify which library to use for lpsolver implementation in sccomp. + Possible values: "lpsolve", "coinmp", "no". The default value is "lpsolve". + Example: --with-lpsolver="coinmp"]), + WITH_LPSOLVER=$withval, + WITH_LPSOLVER="lpsolve") + AC_ARG_WITH(linker-hash-style, AS_HELP_STRING([--with-linker-hash-style], [Use linker with --hash-style=