summaryrefslogtreecommitdiff
path: root/lpsolve
diff options
context:
space:
mode:
authorPeter Foley <pefoley2@verizon.net>2012-11-03 19:19:30 -0400
committerMichael Stahl <mstahl@redhat.com>2012-11-07 22:33:48 +0000
commit085346f80da394ad5008f40679a0d3519f7a82a3 (patch)
tree2bce02d30a8fca7679e92bca7d6a8cc94a31dee6 /lpsolve
parent74abeff02b750fb22fc3d56299abc2cd12d357d3 (diff)
convert lpsolve to gbuild
Change-Id: I0038b21a1b3bde4d8d3f5dd0092d15d858336680 Reviewed-on: https://gerrit.libreoffice.org/1002 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'lpsolve')
-rw-r--r--lpsolve/ExternalPackage_lpsolve.mk35
-rw-r--r--lpsolve/ExternalProject_lpsolve.mk44
-rw-r--r--lpsolve/Makefile7
-rw-r--r--lpsolve/Module_lpsolve.mk22
-rw-r--r--lpsolve/UnpackedTarball_lpsolve.mk36
-rw-r--r--lpsolve/ccc.static11
-rw-r--r--lpsolve/lp_solve_5.5-windows.patch5
-rw-r--r--lpsolve/lp_solve_5.5.patch50
-rw-r--r--lpsolve/makefile.mk117
-rw-r--r--lpsolve/prj/d.lst11
-rw-r--r--lpsolve/prj/dmake0
11 files changed, 158 insertions, 180 deletions
diff --git a/lpsolve/ExternalPackage_lpsolve.mk b/lpsolve/ExternalPackage_lpsolve.mk
new file mode 100644
index 000000000000..ed777ab0d748
--- /dev/null
+++ b/lpsolve/ExternalPackage_lpsolve.mk
@@ -0,0 +1,35 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,lpsolve,lpsolve))
+$(eval $(call gb_ExternalPackage_use_external_project,lpsolve,lpsolve))
+
+ifeq ($(GUI),WNT)
+ifeq ($(COM),GCC)
+ifneq ($(GUI_FOR_BUILD),WNT)
+$(eval $(call gb_ExternalPackage_add_files,lpsolve,lib,lpsolve55/liblpsolve55.dll.a))
+endif # $(GUI_FOR_BUILD)
+else # $(COM)
+$(eval $(call gb_ExternalPackage_add_files,lpsolve,lib,lpsolve55/lpsolve55.lib))
+endif # $(COM)
+$(eval $(call gb_ExternalPackage_add_files,lpsolve,bin,lpsolve55/lpsolve55.dll))
+else # $(GUI)
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_files,lpsolve,lib,lpsolve55/liblpsolve55.dylib))
+else
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+$(eval $(call gb_ExternalPackage_add_files,lpsolve,lib,lpsolve55/liblpsolve55.a))
+else
+$(eval $(call gb_ExternalPackage_add_files,lpsolve,lib,lpsolve55/liblpsolve55.so))
+endif # $(DISABLE_DYNLOADING)
+
+endif # $(OS)
+endif # $(GUI)
+# vim: set noet sw=4 ts=4:
diff --git a/lpsolve/ExternalProject_lpsolve.mk b/lpsolve/ExternalProject_lpsolve.mk
new file mode 100644
index 000000000000..a398e7c294b3
--- /dev/null
+++ b/lpsolve/ExternalProject_lpsolve.mk
@@ -0,0 +1,44 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,lpsolve))
+
+$(eval $(call gb_ExternalProject_use_unpacked,lpsolve,lpsolve))
+
+$(eval $(call gb_ExternalProject_use_package,lpsolve,hunspell))
+
+$(eval $(call gb_ExternalProject_register_targets,lpsolve,\
+ build \
+))
+
+ifeq ($(GUI),WNT)
+ifeq ($(COM),GCC)
+$(call gb_ExternalProject_get_state_target,lpsolve,build):
+ cd $(EXTERNAL_WORKDIR)/lpsolve55 \
+ && $(if $(filter WNT,$(GUI_FOR_BUILD)), \
+ $(if $(filter YES,$(MINGW_SHARED_GCCLIB)) lpsolve_LDFLAGS="-shared-libgcc") \
+ $(if $(filter YES,$(MINGW_SHARED_GXXLIB)) lpsolve_LIBS="$(MINGW_SHARED_LIBSTDCPP)") \
+ cmd /c cgcc.bat, sh ccc) \
+ && touch $@
+else # $(COM)!=GCC
+$(call gb_ExternalProject_get_state_target,lpsolve,build):
+ cd $(EXTERNAL_WORKDIR)/lpsolve55 \
+ && LIB="$(ILIB)" cmd /c cvc6.bat \
+ && touch $@
+endif # $(COM)
+else # $(GUI)!=WNT
+$(call gb_ExternalProject_get_state_target,lpsolve,build):
+ cd $(EXTERNAL_WORKDIR)/lpsolve55 \
+ && sh $(if $(filter MACOSX,$(OS)),ccc.osx, \
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),ccc.static, \
+ $(if $(filter AIXGCC,$(OS)$(COM)),ccc.aix.gcc, \
+ ccc))) \
+ && touch $@
+endif # $(GUI)
+# vim: set noet sw=4 ts=4:
diff --git a/lpsolve/Makefile b/lpsolve/Makefile
new file mode 100644
index 000000000000..ccb1c85a04da
--- /dev/null
+++ b/lpsolve/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/lpsolve/Module_lpsolve.mk b/lpsolve/Module_lpsolve.mk
new file mode 100644
index 000000000000..420053467f6d
--- /dev/null
+++ b/lpsolve/Module_lpsolve.mk
@@ -0,0 +1,22 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,lpsolve))
+
+ifeq ($(SYSTEM_LPSOLVE),NO)
+ifneq ($(OS),IOS)
+$(eval $(call gb_Module_add_targets,lpsolve,\
+ UnpackedTarball_lpsolve \
+ ExternalPackage_lpsolve \
+ ExternalProject_lpsolve \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/lpsolve/UnpackedTarball_lpsolve.mk b/lpsolve/UnpackedTarball_lpsolve.mk
new file mode 100644
index 000000000000..fc376b345b7d
--- /dev/null
+++ b/lpsolve/UnpackedTarball_lpsolve.mk
@@ -0,0 +1,36 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,lpsolve))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,lpsolve,$(LPSOLVE_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,lpsolve,3))
+
+ifeq ($(GUI_FOR_BUILD),WNT)
+
+$(eval $(call gb_UnpackedTarball_add_patches,lpsolve,\
+ lpsolve/lp_solve_5.5-windows.patch \
+))
+
+else
+
+$(eval $(call gb_UnpackedTarball_add_patches,lpsolve,\
+ lpsolve/lp_solve-aix.patch \
+ lpsolve/lp_solve-fixed-warn.patch \
+ lpsolve/lp_solve_5.5.patch \
+))
+
+$(eval $(call gb_UnpackedTarball_add_file,lpsolve,\
+ lpsolve/lpsolve55/ccc.static,lpsolve/ccc.static))
+
+endif
+# vim: set noet sw=4 ts=4:
+
+
diff --git a/lpsolve/ccc.static b/lpsolve/ccc.static
new file mode 100644
index 000000000000..3f9bba8b670c
--- /dev/null
+++ b/lpsolve/ccc.static
@@ -0,0 +1,11 @@
++src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
++obj=`echo $src|sed -e 's/\.c/.o/g' -e 's!\([^ ]*/\)*!!g'`
++
++opts='-O3'
++
++def=
++
++$CC -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine -c $src
++ls -l
++$AR -r liblpsolve55.a $obj
++rm $obj
diff --git a/lpsolve/lp_solve_5.5-windows.patch b/lpsolve/lp_solve_5.5-windows.patch
index 1a76c32f4bbd..28f7c71de5e0 100644
--- a/lpsolve/lp_solve_5.5-windows.patch
+++ b/lpsolve/lp_solve_5.5-windows.patch
@@ -43,9 +43,10 @@
@@ -14,15 +14,4 @@
set c=cl
- rc lpsolve.rc
+-rc lpsolve.rc
++rc %SOLARINC% lpsolve.rc
-%c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /LD /MD /O1 /Zp8 /Gz -D_WINDLL -D_USRDLL -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve.res ..\lp_solve.def -o lpsolve55.dll
-+%c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /LD /MD /O1 /Zp8 /Gz -D_WINDLL -D_USRDLL -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve.res ..\lp_solve.def -Felpsolve55.dll
++%c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd %SOLARINC% /LD /MD /O1 /Zp8 /Gz -D_WINDLL -D_USRDLL -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve.res ..\lp_solve.def -Felpsolve55.dll
-rem /link /LINK50COMPAT
-
-if exist a.obj del a.obj
diff --git a/lpsolve/lp_solve_5.5.patch b/lpsolve/lp_solve_5.5.patch
index 8b5702be8cae..cea61168913d 100644
--- a/lpsolve/lp_solve_5.5.patch
+++ b/lpsolve/lp_solve_5.5.patch
@@ -98,53 +98,3 @@
fi
rm *.o 2>/dev/null
---- misc/build/lp_solve_5.5/lpsolve55/ccc.solaris.orig Sun May 22 11:19:48 2011
-+++ misc/build/lp_solve_5.5/lpsolve55/ccc.solaris Sun May 22 11:19:48 2011
-@@ -1 +1,31 @@
--dummy
-+src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
-+c=$CC
-+
-+if [ "$CPU" = "U" -o "$CPU" = "X" ]
-+then
-+ extra_cflags=-m64
-+ extra_linkflags=-m64
-+fi
-+
-+def=
-+so=
-+if [ "$PLATFORM" = "SCO_UNIX" ]
-+then def='-dy -K PIC -DNOLONGLONG'
-+ dl=-lc
-+else dl=-ldl
-+ so=y
-+fi
-+
-+opts='-xO3'
-+
-+$c $extra_cflags -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
-+ar rv liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
-+ranlib liblpsolve55.a
-+
-+if [ "$so" != "" ]
-+then
-+ $c $extra_cflags -K PIC -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
-+ $c $extra_linkflags -G -Bsymbolic -h liblpsolve55.so -o liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` $SOLARLIB -lc -lm -ldl
-+fi
-+
-+rm *.o 2>/dev/null
---- misc/build/lp_solve_5.5/lpsolve55/ccc.static
-+++ misc/build/lp_solve_5.5/lpsolve55/ccc.static
-@@ -1,1 +1,11 @@
--dummy
-+src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
-+obj=`echo $src|sed -e 's/\.c/.o/g' -e 's!\([^ ]*/\)*!!g'`
-+
-+opts='-O3'
-+
-+def=
-+
-+$CC -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine -c $src
-+ls -l
-+$AR -r liblpsolve55.a $obj
-+rm $obj
diff --git a/lpsolve/makefile.mk b/lpsolve/makefile.mk
deleted file mode 100644
index b2f12aabfdd5..000000000000
--- a/lpsolve/makefile.mk
+++ /dev/null
@@ -1,117 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=.
-
-PRJNAME=lpsolve
-TARGET=lpsolve
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(OS)" != "IOS"
-
-TARFILE_NAME=lp_solve_5.5
-TARFILE_MD5=26b3e95ddf3d9c077c480ea45874b3b8
-
-.IF "$(GUI_FOR_BUILD)"=="WNT"
-PATCH_FILES=lp_solve_5.5-windows.patch
-.ELSE
-PATCH_FILES=\
- lp_solve_5.5.patch \
- lp_solve-aix.patch \
- lp_solve-fixed-warn.patch
-ADDITIONAL_FILES=lpsolve55$/ccc.solaris lpsolve55$/ccc.static
-.ENDIF
-
-CONFIGURE_DIR=
-CONFIGURE_ACTION=
-CONFIGURE_FLAGS=
-
-.IF "$(DISABLE_DYNLOADING)" == "TRUE"
-CONFIGURE_FLAGS+=--enable-static --disable-shared
-.ENDIF
-
-BUILD_DIR=lpsolve55
-.IF "$(GUI)"=="WNT"
-.IF "$(COM)"=="GCC"
-.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
-lpsolve_LDFLAGS=-shared-libgcc
-.ENDIF
-.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
-lpsolve_LIBS=$(MINGW_SHARED_LIBSTDCPP)
-.ENDIF
-.IF "$(GUI_FOR_BUILD)"=="WNT"
-BUILD_ACTION=lpsolve_LDFLAGS=$(lpsolve_LDFLAGS) lpsolve_LIBS=$(lpsolve_LIBS) cmd /c cgcc.bat
-.ELSE
-BUILD_ACTION=sh ccc
-OUT2LIB=$(BUILD_DIR)$/liblpsolve55.dll.a
-.ENDIF
-.ELSE
-BUILD_ACTION=cmd /c cvc6.bat
-OUT2LIB=$(BUILD_DIR)$/lpsolve55.lib
-.ENDIF
-OUT2BIN=$(BUILD_DIR)$/lpsolve55.dll
-.ELSE
-.IF "$(OS)"=="MACOSX"
-.EXPORT: EXTRA_CDEFS EXTRA_LINKFLAGS verbose
-BUILD_ACTION=sh ccc.osx
-OUT2LIB=$(BUILD_DIR)$/liblpsolve55.dylib
-.ELIF "$(DISABLE_DYNLOADING)" == "TRUE"
-BUILD_ACTION=sh ccc.static
-OUT2LIB=$(BUILD_DIR)$/liblpsolve55.a
-.ELSE
-.IF "$(COMNAME)"=="sunpro5"
-BUILD_ACTION=sh ccc.solaris
-.ELIF "$(OS)$(COM)"=="AIXGCC"
-BUILD_ACTION=lpsolve_LDFLAGS="$(LINKFLAGS) $(LINKFLAGSRUNPATH_OOO)" sh ccc.aix.gcc
-.ELSE
-BUILD_ACTION=sh ccc
-.ENDIF
-OUT2LIB=$(BUILD_DIR)$/liblpsolve55.so
-.ENDIF
-.ENDIF
-
-OUT2INC=lp_lib.h lp_types.h lp_utils.h lp_Hash.h lp_matrix.h lp_mipbb.h lp_SOS.h
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : set_ext.mk
-
-.ENDIF
-
-.INCLUDE : target.mk
-
-.IF "$(OS)" != "IOS"
-
-.INCLUDE : tg_ext.mk
-
-.ENDIF
diff --git a/lpsolve/prj/d.lst b/lpsolve/prj/d.lst
index bf8d87c4eef0..e69de29bb2d1 100644
--- a/lpsolve/prj/d.lst
+++ b/lpsolve/prj/d.lst
@@ -1,11 +0,0 @@
-mkdir: %_DEST%\inc\lpsolve
-
-..\%__SRC%\inc\lp_*.h %_DEST%\inc\lpsolve\*
-..\%__SRC%\lib\liblpsolve55.so %_DEST%\lib\liblpsolve55.so
-..\%__SRC%\lib\liblpsolve55.dylib %_DEST%\lib\liblpsolve55.dylib
-..\%__SRC%\lib\liblpsolve55.lib %_DEST%\lib\liblpsolve55.lib
-..\%__SRC%\lib\liblpsolve55.a %_DEST%\lib\liblpsolve55.a
-..\%__SRC%\lib\liblpsolve55.dll.a %_DEST%\lib\liblpsolve55.dll.a
-..\%__SRC%\lib\lpsolve55.lib %_DEST%\lib\lpsolve55.lib
-..\%__SRC%\bin\lpsolve55.dll %_DEST%\bin\lpsolve55.dll
-
diff --git a/lpsolve/prj/dmake b/lpsolve/prj/dmake
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/lpsolve/prj/dmake
+++ /dev/null