From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- external/lpsolve/ExternalPackage_lpsolve.mk | 24 ++++++++ external/lpsolve/ExternalProject_lpsolve.mk | 36 +++++++++++ external/lpsolve/Makefile | 7 +++ external/lpsolve/Module_lpsolve.mk | 18 ++++++ external/lpsolve/README | 1 + external/lpsolve/UnpackedTarball_lpsolve.mk | 36 +++++++++++ external/lpsolve/ccc.static | 11 ++++ external/lpsolve/lp_solve-fixed-warn.patch | 84 +++++++++++++++++++++++++ external/lpsolve/lp_solve_5.5-windows.patch | 60 ++++++++++++++++++ external/lpsolve/lp_solve_5.5.patch | 95 +++++++++++++++++++++++++++++ external/lpsolve/lpsolve-ubsan.patch.0 | 22 +++++++ 11 files changed, 394 insertions(+) create mode 100644 external/lpsolve/ExternalPackage_lpsolve.mk create mode 100644 external/lpsolve/ExternalProject_lpsolve.mk create mode 100644 external/lpsolve/Makefile create mode 100644 external/lpsolve/Module_lpsolve.mk create mode 100644 external/lpsolve/README create mode 100644 external/lpsolve/UnpackedTarball_lpsolve.mk create mode 100644 external/lpsolve/ccc.static create mode 100644 external/lpsolve/lp_solve-fixed-warn.patch create mode 100644 external/lpsolve/lp_solve_5.5-windows.patch create mode 100644 external/lpsolve/lp_solve_5.5.patch create mode 100644 external/lpsolve/lpsolve-ubsan.patch.0 (limited to 'external/lpsolve') diff --git a/external/lpsolve/ExternalPackage_lpsolve.mk b/external/lpsolve/ExternalPackage_lpsolve.mk new file mode 100644 index 0000000000..23c2c5abfa --- /dev/null +++ b/external/lpsolve/ExternalPackage_lpsolve.mk @@ -0,0 +1,24 @@ +# -*- 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)) + +ifneq ($(DISABLE_DYNLOADING),TRUE) +ifeq ($(OS),WNT) +$(eval $(call gb_ExternalPackage_add_file,lpsolve,$(LIBO_LIB_FOLDER)/lpsolve55.dll,lpsolve55/lpsolve55.dll)) +else ifeq ($(OS),MACOSX) +$(eval $(call gb_ExternalPackage_add_file,lpsolve,$(LIBO_LIB_FOLDER)/liblpsolve55.dylib,lpsolve55/liblpsolve55.dylib)) +else # $(OS) != WNT/MACOSX +$(eval $(call gb_ExternalPackage_add_file,lpsolve,$(LIBO_LIB_FOLDER)/liblpsolve55.so,lpsolve55/liblpsolve55.so)) +endif # $(OS) +endif # $(DISABLE_DYNLOADING) + +# vim: set noet sw=4 ts=4: diff --git a/external/lpsolve/ExternalProject_lpsolve.mk b/external/lpsolve/ExternalProject_lpsolve.mk new file mode 100644 index 0000000000..21843f713c --- /dev/null +++ b/external/lpsolve/ExternalProject_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_ExternalProject_ExternalProject,lpsolve)) + +$(eval $(call gb_ExternalProject_register_targets,lpsolve,\ + build \ +)) + +ifeq ($(OS),WNT) +$(call gb_ExternalProject_get_state_target,lpsolve,build): + $(call gb_Trace_StartRange,lpsolve,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + LIB="$(ILIB)" RUNTIME_FLAG="$(if $(MSVC_USE_DEBUG_RUNTIME),/MDd,/MD)" \ + cmd /c cvc6.bat \ + ,lpsolve55) + $(call gb_Trace_EndRange,lpsolve,EXTERNAL) +else # $(OS)!=WNT +$(call gb_ExternalProject_get_state_target,lpsolve,build): + $(call gb_Trace_StartRange,lpsolve,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + CC="$(CC) $(call gb_ExternalProject_get_build_flags,lpsolve)" \ + $(if $(filter MACOSX,$(OS)),EXTRA_LINKFLAGS='-install_name @__________________________________________________OOO/liblpsolve55.dylib') \ + sh -e $(if $(filter MACOSX,$(OS)),ccc.osx, \ + $(if $(filter TRUE,$(DISABLE_DYNLOADING)),ccc.static, \ + ccc)) \ + ,lpsolve55) + $(call gb_Trace_EndRange,lpsolve,EXTERNAL) +endif # $(OS) +# vim: set noet sw=4 ts=4: diff --git a/external/lpsolve/Makefile b/external/lpsolve/Makefile new file mode 100644 index 0000000000..e4968cf85f --- /dev/null +++ b/external/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/external/lpsolve/Module_lpsolve.mk b/external/lpsolve/Module_lpsolve.mk new file mode 100644 index 0000000000..e0094f609c --- /dev/null +++ b/external/lpsolve/Module_lpsolve.mk @@ -0,0 +1,18 @@ +# -*- 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)) + +$(eval $(call gb_Module_add_targets,lpsolve,\ + UnpackedTarball_lpsolve \ + ExternalPackage_lpsolve \ + ExternalProject_lpsolve \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/lpsolve/README b/external/lpsolve/README new file mode 100644 index 0000000000..3ef9db3e1c --- /dev/null +++ b/external/lpsolve/README @@ -0,0 +1 @@ +A mixed Integer Linear Programming (MILP) solver from [http://lpsolve.sourceforge.net/]. diff --git a/external/lpsolve/UnpackedTarball_lpsolve.mk b/external/lpsolve/UnpackedTarball_lpsolve.mk new file mode 100644 index 0000000000..62a182dc75 --- /dev/null +++ b/external/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 ($(OS_FOR_BUILD),WNT) + +$(eval $(call gb_UnpackedTarball_set_patchflags,lpsolve,--binary)) +$(eval $(call gb_UnpackedTarball_add_patches,lpsolve,\ + external/lpsolve/lp_solve_5.5-windows.patch \ +)) + +else + +$(eval $(call gb_UnpackedTarball_add_patches,lpsolve,\ + external/lpsolve/lp_solve-fixed-warn.patch \ + external/lpsolve/lp_solve_5.5.patch \ + external/lpsolve/lpsolve-ubsan.patch.0 \ +)) + +$(eval $(call gb_UnpackedTarball_add_file,lpsolve,lpsolve55/ccc.static,external/lpsolve/ccc.static)) + +endif +# vim: set noet sw=4 ts=4: + + diff --git a/external/lpsolve/ccc.static b/external/lpsolve/ccc.static new file mode 100644 index 0000000000..6911c4b2c8 --- /dev/null +++ b/external/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 + +$AR -r liblpsolve55.a $obj +rm $obj diff --git a/external/lpsolve/lp_solve-fixed-warn.patch b/external/lpsolve/lp_solve-fixed-warn.patch new file mode 100644 index 0000000000..46742887a8 --- /dev/null +++ b/external/lpsolve/lp_solve-fixed-warn.patch @@ -0,0 +1,84 @@ +--- misc/build/lp_solve_5.5/lp_report.c 2007-01-14 10:31:34.000000000 -0800 ++++ misc/build/lp_solve_5.5/lp_report.c 2007-01-14 10:31:34.000000000 -0800 +@@ -160,7 +160,7 @@ + { + int i, k = 0; + +- fprintf(output, label); ++ fputs(label, output); + fprintf(output, "\n"); + for(i = first; i <= last; i++) { + fprintf(output, " %18g", vector[i]); +@@ -189,7 +189,7 @@ + if(last < 0) + last = lp->rows; + +- fprintf(output, label); ++ fputs(label, output); + fprintf(output, "\n"); + + if(first == 0) { +@@ -254,7 +254,7 @@ + if(last < 0) + last = lp->rows; + +- fprintf(output, label); ++ fputs(label, output); + fprintf(output, "\n"); + + for(i = first; i <= last; i++) { +--- misc/build/lp_solve_5.5/lp_rlp.h 2007-01-14 10:31:52.000000000 -0800 ++++ misc/build/lp_solve_5.5/lp_rlp.h 2007-01-14 10:31:52.000000000 -0800 +@@ -615,7 +615,7 @@ + /* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +-#define ECHO (void) fwrite( lp_yytext, lp_yyleng, 1, lp_yyout ) ++#define ECHO if(fwrite( lp_yytext, lp_yyleng, 1, lp_yyout ) != 1) YY_FATAL_ERROR( "can't write into lp_yytext" ) + #endif + + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, +--- misc/build/lp_solve_5.5/shared/commonlib.c 2007-01-14 10:33:14.000000000 -0800 ++++ misc/build/lp_solve_5.5/shared/commonlib.c 2007-01-14 10:33:14.000000000 -0800 +@@ -715,7 +715,7 @@ + { + int i, k = 0; + +- fprintf(output, label); ++ fputs(label, output); + fprintf(output, "\n"); + for(i = first; i <= last; i++) { + fprintf(output, " %5d", myvector[i]); +@@ -734,7 +734,7 @@ + { + int i, k = 0; + +- fprintf(output, label); ++ fputs(label, output); + fprintf(output, "\n"); + for(i = first; i <= last; i++) { + if(asRaw) +@@ -756,7 +756,7 @@ + { + int i, k = 0; + +- fprintf(output, label); ++ fputs(label, output); + fprintf(output, "\n"); + for(i = first; i <= last; i++) { + fprintf(output, " %18g", myvector[i]); +--- misc/build/lp_solve_5.5/shared/mmio.c 2007-01-14 10:33:14.000000000 -0800 ++++ misc/build/lp_solve_5.5/shared/mmio.c 2007-01-14 10:33:14.000000000 -0800 +@@ -74,7 +74,11 @@ + + for (i=0; i/dev/null +--- misc/build/lp_solve_5.5/lpsolve55/ccc.osx.orig Thu Jun 23 22:53:08 2005 ++++ misc/build/lp_solve_5.5/lpsolve55/ccc.osx +@@ -1,23 +1,30 @@ + 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 ++c=$CC + ++if test -n "$verbose"; then ++ set -x ++fi ++ + def= + so= ++# EXTRA_LINKFLAGS is set in the ExternalProject_lpsolve.mk ++extra_linkflags=$EXTRA_LINKFLAGS ++ + if [ "$PLATFORM" = "SCO_UNIX" ] + then def='-DLoadInverseLib=0 -DLoadLanguageLib=0 -D__HYPER=long' + else dl=-ldl + so=y + fi + +-opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME -Wno-long-double' ++opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME' + +-$c -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 ++$c -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 +-libtool -static -o liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` ++$LIBTOOL -static -o liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` + + if [ "$so" != "" ] + then +- $c -fPIC -fno-common -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 -dynamiclib liblpsolve55.a -compatibility_version 5.5.0 -current_version 5.5.0 -o liblpsolve55.dylib `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc ++ $c -fPIC -fno-common -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 -dynamiclib liblpsolve55.a -compatibility_version 5.5.0 -current_version 5.5.0 -o liblpsolve55.dylib `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc + fi + + rm *.o 2>/dev/null diff --git a/external/lpsolve/lpsolve-ubsan.patch.0 b/external/lpsolve/lpsolve-ubsan.patch.0 new file mode 100644 index 0000000000..7a5e308c6e --- /dev/null +++ b/external/lpsolve/lpsolve-ubsan.patch.0 @@ -0,0 +1,22 @@ +--- lp_presolve.c ++++ lp_presolve.c +@@ -168,7 +168,7 @@ + if(isprimal) { + if(psdata->primalundo != NULL) + mat = psdata->primalundo->tracker; +- solution = lp->full_solution + lp->presolve_undo->orig_rows; ++ solution = lp->full_solution == NULL ? NULL : lp->full_solution + lp->presolve_undo->orig_rows; + slacks = lp->full_solution; + } + else { +--- lp_pricePSE.c ++++ lp_pricePSE.c +@@ -145,7 +147,7 @@ + + /* Store the active/current pricing type */ + if(isdual == AUTOMATIC) +- isdual = (MYBOOL) lp->edgeVector[0]; ++ isdual = lp->edgeVector[0] != 0.0; + else + lp->edgeVector[0] = isdual; + -- cgit v1.2.3