diff --git a/.gitignore b/.gitignore index a4c28b8..faad48e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ lp_solve_5.5.2.0_source.tar.gz +/lp_solve_5.5.2.11_source.tar.gz diff --git a/lp_solve-5.5.2.11-Port-to-C99.patch b/lp_solve-5.5.2.11-Port-to-C99.patch new file mode 100644 index 0000000..55f0c24 --- /dev/null +++ b/lp_solve-5.5.2.11-Port-to-C99.patch @@ -0,0 +1,82 @@ +From dc262b45ae8c63be64fa38c7db0296e0d3889895 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 7 Jun 2023 17:30:18 +0200 +Subject: [PATCH] Port to C99 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Port the ccc build configuration detection tool to C99 by +specifying the return type of main as int. + +Submitted upstream: + + + +Signed-off-by: Petr Písař +--- + bfp/bfp_LUSOL/ccc | 2 +- + lp_solve/ccc | 4 ++-- + lpsolve55/ccc | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/bfp/bfp_LUSOL/ccc b/bfp/bfp_LUSOL/ccc +index 86b274c..a349345 100644 +--- a/bfp/bfp_LUSOL/ccc ++++ b/bfp/bfp_LUSOL/ccc +@@ -7,7 +7,7 @@ c=${CC:-cc} + >/tmp/platform.c + echo '#include '>>/tmp/platform.c + echo '#include '>>/tmp/platform.c +-echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c ++echo 'int main(void){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c + $c $CFLAGS /tmp/platform.c $LDFLAGS -o /tmp/platform + PLATFORM=`/tmp/platform` + rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 +diff --git a/lp_solve/ccc b/lp_solve/ccc +index 83f21df..2e99f39 100644 +--- a/lp_solve/ccc ++++ b/lp_solve/ccc +@@ -8,7 +8,7 @@ MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX` + >"$MYTMP"/platform.c + echo '#include '>>"$MYTMP"/platform.c + echo '#include '>>"$MYTMP"/platform.c +-echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c ++echo 'int main(void){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c + $c $CFLAGS "$MYTMP"/platform.c $LDFLAGS -o "$MYTMP"/platform + PLATFORM=`"$MYTMP"/platform` + rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1 +@@ -22,7 +22,7 @@ math=-lm + echo '#include '>>"$MYTMP"/isnan.c + echo '#include '>>"$MYTMP"/isnan.c + echo '#include '>>"$MYTMP"/isnan.c +-echo 'main(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c ++echo 'int main(void){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c + $c $CFLAGS "$MYTMP"/isnan.c $LDFLAGS -o "$MYTMP"/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= +diff --git a/lpsolve55/ccc b/lpsolve55/ccc +index 49cd7dc..59c720f 100644 +--- a/lpsolve55/ccc ++++ b/lpsolve55/ccc +@@ -8,7 +8,7 @@ MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX` + >"$MYTMP"/platform.c + echo '#include '>>"$MYTMP"/platform.c + echo '#include '>>"$MYTMP"/platform.c +-echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c ++echo 'int main(void){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c + $c $CFLAGS "$MYTMP"/platform.c $LDFLAGS -o "$MYTMP"/platform + PLATFORM=`"$MYTMP"/platform` + rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1 +@@ -20,7 +20,7 @@ mkdir bin bin/$PLATFORM >/dev/null 2>&1 + echo '#include '>>"$MYTMP"/isnan.c + echo '#include '>>"$MYTMP"/isnan.c + echo '#include '>>"$MYTMP"/isnan.c +-echo 'main(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c ++echo 'int main(void){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c + $c $CFLAGS "$MYTMP"/isnan.c $LDFLAGS -o "$MYTMP"/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= +-- +2.40.1 + diff --git a/lp_solve-5.5.2.11-Respect-CC-CFLAGS-and-LDFLAGS.patch b/lp_solve-5.5.2.11-Respect-CC-CFLAGS-and-LDFLAGS.patch new file mode 100644 index 0000000..ec20797 --- /dev/null +++ b/lp_solve-5.5.2.11-Respect-CC-CFLAGS-and-LDFLAGS.patch @@ -0,0 +1,193 @@ +From f29ae58ddc93d86504c7e646ec5e73befb36594c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 7 Jun 2023 17:16:50 +0200 +Subject: [PATCH] Respect CC, CFLAGS, and LDFLAGS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The distributions use these environment variables to compile their +software uniformly. This patch modifies the ccc scripts to respect +them. + +Signed-off-by: Petr Písař +--- + bfp/bfp_LUSOL/ccc | 20 +++++++++----------- + demo/ccc | 7 +++---- + lp_solve/ccc | 13 ++++++------- + lpsolve55/ccc | 14 ++++++-------- + 4 files changed, 24 insertions(+), 30 deletions(-) + +diff --git a/bfp/bfp_LUSOL/ccc b/bfp/bfp_LUSOL/ccc +index 754738b..3ec9596 100644 +--- a/bfp/bfp_LUSOL/ccc ++++ b/bfp/bfp_LUSOL/ccc +@@ -1,37 +1,35 @@ + : + src='../../shared/commonlib.c ../../colamd/colamd.c lp_LUSOL.c ../../lp_utils.c ../../shared/myblas.c LUSOL/lusol.c' + +-c=cc ++c=${CC:-cc} ++CFLAGS=${CFLAGS:--O3} + + #determine platform (32/64 bit) + >/tmp/platform.c + echo '#include '>>/tmp/platform.c + echo '#include '>>/tmp/platform.c + echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c +-$c /tmp/platform.c -o /tmp/platform ++$c $CFLAGS /tmp/platform.c $LDFLAGS -o /tmp/platform + PLATFORM=`/tmp/platform` + rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 + + mkdir bin bin/$PLATFORM >/dev/null 2>&1 + +-opts='-O3' +-#opts='' +- + if [ "$PLATFORM" = "RS6000" ] +-then opts="$opts" ++then + so="-bM:SRE -bE:../bfp_lpsolve.exp" + #so="$so -e _nostart" + so="$so -bnoentry" + elif [ "$PLATFORM" = "SCO_UNIX" ] + then +- opts='-O0' + so="-G -dy" +- opts="$opts -DNOLONGLONG $so" +-else opts="$opts -fpic" ++ CFLAGS="${CFLAGS} -O0 -DNOLONGLONG $so" ++else ++ CFLAGS="${CFLAGS} -fpic" + so="-shared -Wl,-Bsymbolic -Wl,-soname,libbfp_LUSOL.so" + fi + +-$c -s -c $opts -I.. -I../.. -I../../colamd -I../../shared -ILUSOL -I. -DRoleIsExternalInvEngine -DINVERSE_ACTIVE=INVERSE_LUSOL $src +-$c $so -o bin/$PLATFORM/libbfp_LUSOL.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl ++$c $CFLAGS -c -I.. -I../.. -I../../colamd -I../../shared -ILUSOL -I. -DRoleIsExternalInvEngine -DINVERSE_ACTIVE=INVERSE_LUSOL $src ++$c $LDFLAGS $so -o bin/$PLATFORM/libbfp_LUSOL.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl + + rm *.o >/dev/null +diff --git a/demo/ccc b/demo/ccc +index 38713a1..154b898 100644 +--- a/demo/ccc ++++ b/demo/ccc +@@ -1,5 +1,6 @@ + src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.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:-cc} ++CFLAGS=${CFLAGS:--O3} + + math=-lm + +@@ -10,6 +11,4 @@ then def='-dy -K PIC -DNOLONGLONG' + else dl=-ldl + fi + +-opts='-O3' +- +-$c -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 demo.c $src -o demo $math $dl ++$c $CFLAGS -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine demo.c $src $LDFLAGS -o demo $math $dl +diff --git a/lp_solve/ccc b/lp_solve/ccc +index bd5a938..fbb67d9 100644 +--- a/lp_solve/ccc ++++ b/lp_solve/ccc +@@ -1,6 +1,7 @@ + : + src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.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_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' +-c=cc ++c=${CC:-cc} ++CFLAGS=${CFLAGS:--O3} + + MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX` + +@@ -9,7 +10,7 @@ MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX` + echo '#include '>>"$MYTMP"/platform.c + echo '#include '>>"$MYTMP"/platform.c + echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c +-$c "$MYTMP"/platform.c -o "$MYTMP"/platform ++$c $CFLAGS "$MYTMP"/platform.c $LDFLAGS -o "$MYTMP"/platform + PLATFORM=`"$MYTMP"/platform` + rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1 + +@@ -23,23 +24,21 @@ echo '#include '>>"$MYTMP"/isnan.c + echo '#include '>>"$MYTMP"/isnan.c + echo '#include '>>"$MYTMP"/isnan.c + echo 'main(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c +-$c "$MYTMP"/isnan.c -o "$MYTMP"/isnan $math >/dev/null 2>&1 ++$c $CFLAGS "$MYTMP"/isnan.c $LDFLAGS -o "$MYTMP"/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= + else NOISNAN=-DNOISNAN + fi + rm "$MYTMP"/isnan.c "$MYTMP"/isnan >/dev/null 2>&1 + +-opts='-O3' +- + rmdir "$MYTMP" + + def= + if [ "$PLATFORM" = "SCO_UNIX" ] +-then opts='-O0' ++then CFLAGS="${CFLAGS} -O0" + def='-dy -K PIC -DLLONG=long' + dl=-ldl + else dl=-ldl + fi + +-$c -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl ++$c $CFLAGS -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src $LDFLAGS -o bin/$PLATFORM/lp_solve $math $dl +diff --git a/lpsolve55/ccc b/lpsolve55/ccc +index 999f5f6..49cd7dc 100644 +--- a/lpsolve55/ccc ++++ b/lpsolve55/ccc +@@ -1,6 +1,6 @@ + : + 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:-cc} + + MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX` + +@@ -9,7 +9,7 @@ MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX` + echo '#include '>>"$MYTMP"/platform.c + echo '#include '>>"$MYTMP"/platform.c + echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c +-$c "$MYTMP"/platform.c -o "$MYTMP"/platform ++$c $CFLAGS "$MYTMP"/platform.c $LDFLAGS -o "$MYTMP"/platform + PLATFORM=`"$MYTMP"/platform` + rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1 + +@@ -21,7 +21,7 @@ echo '#include '>>"$MYTMP"/isnan.c + echo '#include '>>"$MYTMP"/isnan.c + echo '#include '>>"$MYTMP"/isnan.c + echo 'main(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c +-$c "$MYTMP"/isnan.c -o "$MYTMP"/isnan $math >/dev/null 2>&1 ++$c $CFLAGS "$MYTMP"/isnan.c $LDFLAGS -o "$MYTMP"/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= + else NOISNAN=-DNOISNAN +@@ -39,16 +39,14 @@ else dl=-ldl + so=y + fi + +-opts='-O3' +- +-$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src ++$c $CFLAGS -fPIC -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src + ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` + ranlib bin/$PLATFORM/liblpsolve55.a + + if [ "$so" != "" ] + then +- $c -fpic -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src +- $c -shared -Wl,-Bsymbolic -Wl,-soname,liblpsolve55.so -o bin/$PLATFORM/liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl ++ $c $CFLAGS -fPIC -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src ++ $c $LDFLAGS -shared -Wl,-Bsymbolic -Wl,-soname,liblpsolve55.so -o bin/$PLATFORM/liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl + fi + + rm *.o 2>/dev/null +-- +2.40.1 + diff --git a/lpsolve-5.5.0.11.cflags.patch b/lpsolve-5.5.0.11.cflags.patch deleted file mode 100644 index 2471733..0000000 --- a/lpsolve-5.5.0.11.cflags.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- lp_solve_5.5/lpsolve55/ccc 2018-02-26 09:27:51.074682302 +0000 -+++ lp_solve_5.5/lpsolve55/ccc 2018-02-26 09:36:36.329990782 +0000 -@@ -35,16 +35,14 @@ - so=y - fi - --opts='-O3' -- --$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -+$c $CFLAGS -fPIC -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src - ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` - ranlib bin/$PLATFORM/liblpsolve55.a - - if [ "$so" != "" ] - then -- $c -fpic -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -- $c -shared -Wl,-Bsymbolic -Wl,-soname,liblpsolve55.so -o bin/$PLATFORM/liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl -+ $c $CFLAGS -fPIC -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -+ $c $LDFLAGS -shared -Wl,-Bsymbolic -Wl,-soname,liblpsolve55.so -o bin/$PLATFORM/liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl - fi - - rm *.o 2>/dev/null ---- lp_solve_5.5/lp_solve/ccc 2018-02-26 14:32:54.304981484 +0000 -+++ lp_solve_5.5/lp_solve/ccc 2018-02-26 14:34:03.524750992 +0000 -@@ -28,8 +28,6 @@ - fi - rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1 - --opts='-O3' -- - def= - if [ "$PLATFORM" = "SCO_UNIX" ] - then opts='-O0' -@@ -38,4 +36,4 @@ - else dl=-ldl - fi - --$c -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl -+$c $CFLAGS $LDFLAGS -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl diff --git a/lpsolve-5.5.2.0.defines.patch b/lpsolve-5.5.2.0.defines.patch deleted file mode 100644 index a325c13..0000000 --- a/lpsolve-5.5.2.0.defines.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- lp_solve_5.5/lpsolve55/ccc -+++ lp_solve_5.5/lpsolve55/ccc -@@ -18,7 +18,7 @@ - echo '#include '>>/tmp/isnan.c - echo '#include '>>/tmp/isnan.c - echo '#include '>>/tmp/isnan.c --echo 'main(){isnan(0);}'>>/tmp/isnan.c -+echo 'main(){isnan(0.0);}'>>/tmp/isnan.c - $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 - if [ $? = 0 ] - then NOISNAN= ---- lp_solve_5.5/lp_solve/ccc -+++ lp_solve_5.5/lp_solve/ccc -@@ -20,7 +20,7 @@ - echo '#include '>>/tmp/isnan.c - echo '#include '>>/tmp/isnan.c - echo '#include '>>/tmp/isnan.c --echo 'main(){isnan(0);}'>>/tmp/isnan.c -+echo 'main(){isnan(0.0);}'>>/tmp/isnan.c - $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 - if [ $? = 0 ] - then NOISNAN= diff --git a/lpsolve-ccc-c99.patch b/lpsolve-ccc-c99.patch deleted file mode 100644 index 929138b..0000000 --- a/lpsolve-ccc-c99.patch +++ /dev/null @@ -1,51 +0,0 @@ -Port the ccc build configuration detection tool to C99 by -specifying the return type of main as int. - -Submitted upstream: - - - -diff --git a/lp_solve/ccc b/lp_solve/ccc -index 9b79cea7ee71536c..b1f761aab33345d4 100644 ---- a/lp_solve/ccc -+++ b/lp_solve/ccc -@@ -6,7 +6,7 @@ c=$CC - >/tmp/platform.c - echo '#include '>>/tmp/platform.c - echo '#include '>>/tmp/platform.c --echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c -+echo 'int main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c - $c /tmp/platform.c -o /tmp/platform - PLATFORM=`/tmp/platform` - rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 -@@ -20,7 +20,7 @@ math=-lm - echo '#include '>>/tmp/isnan.c - echo '#include '>>/tmp/isnan.c - echo '#include '>>/tmp/isnan.c --echo 'main(){isnan(0.0);}'>>/tmp/isnan.c -+echo 'int main(){isnan(0.0);}'>>/tmp/isnan.c - $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 - if [ $? = 0 ] - then NOISNAN= -diff --git a/lpsolve55/ccc b/lpsolve55/ccc -index 0470611bc45a851c..ca350f257add7730 100644 ---- a/lpsolve55/ccc -+++ b/lpsolve55/ccc -@@ -6,7 +6,7 @@ c=$CC - >/tmp/platform.c - echo '#include '>>/tmp/platform.c - echo '#include '>>/tmp/platform.c --echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c -+echo 'int main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c - $c /tmp/platform.c -o /tmp/platform - PLATFORM=`/tmp/platform` - rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 -@@ -18,7 +18,7 @@ mkdir bin bin/$PLATFORM >/dev/null 2>&1 - echo '#include '>>/tmp/isnan.c - echo '#include '>>/tmp/isnan.c - echo '#include '>>/tmp/isnan.c --echo 'main(){isnan(0.0);}'>>/tmp/isnan.c -+echo 'int main(){isnan(0.0);}'>>/tmp/isnan.c - $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 - if [ $? = 0 ] - then NOISNAN= diff --git a/lpsolve.spec b/lpsolve.spec index c62bb61..8e8abae 100644 --- a/lpsolve.spec +++ b/lpsolve.spec @@ -1,9 +1,8 @@ Name: lpsolve -Version: 5.5.2.0 -Release: 33%{?dist} +Version: 5.5.2.11 +Release: 1%{?dist} Summary: Mixed Integer Linear Programming (MILP) solver # bfp/bfp_LUSOL/lp_LUSOL.c: LGPL-2.1-or-later -# bfp/bfp_LUSOL/LUSOL/LUSOL_LGPL.txt: LGLP-2.1 text # colamd/colamd.c: ??? (free with attribution in Matlab) # Waiting on an identifier # @@ -21,6 +20,8 @@ Summary: Mixed Integer Linear Programming (MILP) solver # lp_pricePSE.c: LGPL-2.1-or-later # lp_report.c: LGPL-2.1-or-later # lp_rlp.c: GPL-2.0-or-later WITH Bison-exception-2.2 +# Waiting on an approval +# # lp_scale.c: LGPL-2.1-or-later # lp_simplex.c: LGPL-2.1-or-later # lp_SOS.c: LGPL-2.1-or-later @@ -32,11 +33,15 @@ Summary: Mixed Integer Linear Programming (MILP) solver License: LGPL-2.1-or-later AND GPL-2.0-or-later WITH Bison-exception-2.2 # There is a mailing list at . URL: https://sourceforge.net/projects/lpsolve +# A separate documention at +# +# contains proprietary JavaScript files and javascript trackers. Source: https://downloads.sourceforge.net/lpsolve/lp_solve_%{version}_source.tar.gz -Patch0: lpsolve-5.5.0.11.cflags.patch -Patch1: lpsolve-5.5.2.0.defines.patch -Patch2: read-cc-from-env.patch -Patch3: lpsolve-ccc-c99.patch +# Use system-wide compiler, compiler and linker flags +Patch0: lp_solve-5.5.2.11-Respect-CC-CFLAGS-and-LDFLAGS.patch +# Port to C99, GCC 14 will remove support for previous standards, proposed to +# an upstream . +Patch1: lp_solve-5.5.2.11-Port-to-C99.patch BuildRequires: bash # binutils for ar and ranlib BuildRequires: binutils @@ -60,15 +65,16 @@ Header files for developing with lpsolve library. %autosetup -p1 -n lp_solve_5.5 sed -n -e '/Authors:/,/http:\/\/www\.cise\.ufl/p' < colamd/colamd.c \ > colamd/colamd_license +chmod -x lp_lib.h %build %set_build_flags pushd lpsolve55 -sh ccc +sh -x ccc rm bin/ux*/liblpsolve55.a popd pushd lp_solve -sh ccc +sh -x ccc popd %install @@ -80,18 +86,26 @@ install -p -m 755 \ install -p -m 644 \ lp*.h %{buildroot}%{_includedir}/lpsolve +%check +%set_build_flags +LP_PATH="$(echo lpsolve55/bin/ux*)" +${CC} ${CFLAGS} -I. demo/demo.c ${LDFLAGS} -L"$LP_PATH" -llpsolve55 +LD_LIBRARY_PATH="$LP_PATH" ./a.out - 5.5.2.11-1 +- 5.5.2.11 bump + * Wed Jun 07 2023 Petr Pisar - 5.5.2.0-33 - Modernize a spec file - Partially correct a license tag diff --git a/read-cc-from-env.patch b/read-cc-from-env.patch deleted file mode 100644 index 85c7320..0000000 --- a/read-cc-from-env.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -ruN lp_solve_5.5.orig/lp_solve/ccc lp_solve_5.5/lp_solve/ccc ---- lp_solve_5.5.orig/lp_solve/ccc 2020-12-08 12:24:15.118953722 +0100 -+++ lp_solve_5.5/lp_solve/ccc 2020-12-08 12:49:39.661428497 +0100 -@@ -1,6 +1,6 @@ - : - src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.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_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' --c=cc -+c=$CC - - #determine platform (32/64 bit) - >/tmp/platform.c -diff -ruN lp_solve_5.5.orig/lpsolve55/ccc lp_solve_5.5/lpsolve55/ccc ---- lp_solve_5.5.orig/lpsolve55/ccc 2020-12-08 12:24:15.118953722 +0100 -+++ lp_solve_5.5/lpsolve55/ccc 2020-12-08 12:40:22.677752522 +0100 -@@ -1,6 +1,6 @@ - : - 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 - - #determine platform (32/64 bit) - >/tmp/platform.c diff --git a/sources b/sources index 0df0a76..5389ee4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -167c0fb4ab178e0b7ab50bf0a635a836 lp_solve_5.5.2.0_source.tar.gz +SHA512 (lp_solve_5.5.2.11_source.tar.gz) = 24f5a14d0c77a71e1ab3f46e08ea3f85f2f116ae2d3d2c54acddc5fb138251ba258240284060827e1b8b7ef15d580acecc242329ec775802fe5e8028407499bc