From dda4112ba84f7e117c98ccae2e865fd17f7520d5 Mon Sep 17 00:00:00 2001 From: Ronald Y Date: Sun, 8 Sep 2024 15:26:25 +0800 Subject: [PATCH] new package: lpsolve --- tur-on-device/lpsolve/0001-timeb.h.patch | 40 +++ tur-on-device/lpsolve/build.sh | 38 ++ .../lpsolve/lpsolve-5.5.2.11-misc.patch | 335 ++++++++++++++++++ 3 files changed, 413 insertions(+) create mode 100644 tur-on-device/lpsolve/0001-timeb.h.patch create mode 100644 tur-on-device/lpsolve/build.sh create mode 100644 tur-on-device/lpsolve/lpsolve-5.5.2.11-misc.patch diff --git a/tur-on-device/lpsolve/0001-timeb.h.patch b/tur-on-device/lpsolve/0001-timeb.h.patch new file mode 100644 index 000000000..7cfd74ffa --- /dev/null +++ b/tur-on-device/lpsolve/0001-timeb.h.patch @@ -0,0 +1,40 @@ +diff --git a/lp_utils.c b/lp_utils.c +index 418f7c8..fa7480d 100644 +--- a/lp_utils.c ++++ b/lp_utils.c +@@ -5,7 +5,9 @@ + #include "lp_lib.h" + #include "lp_utils.h" + #include ++#ifndef __ANDROID__ + #include ++#endif + #include "lp_bit.h" + + #ifdef FORTIFY +diff --git a/shared/commonlib.c b/shared/commonlib.c +index 5ab4f12..137eb3a 100644 +--- a/shared/commonlib.c ++++ b/shared/commonlib.c +@@ -5,6 +5,8 @@ + # include + #elif defined EnhTime + # include ++#elif defined(__ANDROID__) ++#include + #else + #include + #endif +@@ -843,6 +845,12 @@ + timeBase = clockNow() - (double) now.QuadPart/(double) freq.QuadPart; + } + return( timeBase + (double) now.QuadPart/(double) freq.QuadPart ); ++#elif defined(__ANDROID__) ++ struct timeval tv; ++ struct timezone tz; ++ ++ gettimeofday(&tv, &tz); ++ return((double)tv.tv_sec+((double)tv.tv_usec)/1000000.0); + #else + struct timeb buf; + diff --git a/tur-on-device/lpsolve/build.sh b/tur-on-device/lpsolve/build.sh new file mode 100644 index 000000000..a5023c947 --- /dev/null +++ b/tur-on-device/lpsolve/build.sh @@ -0,0 +1,38 @@ +TERMUX_PKG_HOMEPAGE=http://lpsolve.sourceforge.net/ +TERMUX_PKG_DESCRIPTION="a Mixed Integer Linear Programming (MILP) solver" +TERMUX_PKG_LICENSE="LGPL-2.1" +TERMUX_PKG_MAINTAINER="@termux-user-repository" +TERMUX_PKG_VERSION=5.5.2.11 +TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/lpsolve/lpsolve/${TERMUX_PKG_VERSION}/lp_solve_${TERMUX_PKG_VERSION}_source.tar.gz +TERMUX_PKG_SHA256=6d4abff5cc6aaa933ae8e6c17a226df0fc0b671c438f69715d41d09fe81f902f +TERMUX_PKG_BUILD_IN_SRC=true + +termux_step_pre_configure() { + if [ "${TERMUX_ON_DEVICE_BUILD}" = false ]; then + termux_error_exit "This package doesn't support cross-compiling." + fi +} + +termux_step_configure() { + : +} + +termux_step_make() { + cd lpsolve55 + sh -x ccc + rm bin/ux*/liblpsolve55.a + + cd ../lp_solve + sh -x ccc + cd . +} + + +termux_step_make_install() { + install -dm755 "$TERMUX_PREFIX"/{bin,lib,include/lpsolve} + install -m755 lp_solve/bin/ux*/lp_solve "$TERMUX_PREFIX"/bin/ + install -m755 lpsolve55/bin/ux*/liblpsolve55.so "$TERMUX_PREFIX"/lib/ + install -m644 lp*.h "$TERMUX_PREFIX"/include/lpsolve/ + + install -D -m644 README.txt -t "$TERMUX_PREFIX/share/licenses/$TERMUX_PKG_NAME/" +} diff --git a/tur-on-device/lpsolve/lpsolve-5.5.2.11-misc.patch b/tur-on-device/lpsolve/lpsolve-5.5.2.11-misc.patch new file mode 100644 index 000000000..b4e1f91f7 --- /dev/null +++ b/tur-on-device/lpsolve/lpsolve-5.5.2.11-misc.patch @@ -0,0 +1,335 @@ +--- a/bfp/bfp_LUSOL/ccc ++++ b/bfp/bfp_LUSOL/ccc +@@ -1,13 +1,13 @@ + : + src='../../shared/commonlib.c ../../colamd/colamd.c lp_LUSOL.c ../../lp_utils.c ../../shared/myblas.c LUSOL/lusol.c' + +-c=cc ++c=${CC:-cc} + + #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 ++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 +--- a/bfp/bfp_LUSOL/ccc.osx ++++ b/bfp/bfp_LUSOL/ccc.osx +@@ -1,13 +1,13 @@ + : + src='../../shared/commonlib.c ../../colamd/colamd.c lp_LUSOL.c ../../lp_utils.c ../../shared/myblas.c LUSOL/lusol.c' + +-c=cc ++c=${CC:-cc} + + #determine platform (32/64 bit) + >/tmp/platform.c + echo '#include '>>/tmp/platform.c + echo '#include '>>/tmp/platform.c +-echo 'main(){printf("osx%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c ++echo 'int main(){printf("osx%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 +--- a/demo/ccc ++++ b/demo/ccc +@@ -1,6 +1,5 @@ + 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} + math=-lm + + def= +--- a/demo/ccc.osx ++++ b/demo/ccc.osx +@@ -1,5 +1,5 @@ + src='../bfp/lp_MDO.c ../commonlib.c ../myblas.c ../colamd/colamd.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_etaPFI/lp_etaPFI.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 demo.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' +-c=cc ++c=${CC:-cc} + + math=-lm + +--- a/lp_solve/ccc ++++ b/lp_solve/ccc +@@ -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:-cc} + + MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX` + +@@ -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(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c + $c "$MYTMP"/platform.c -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(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c + $c "$MYTMP"/isnan.c -o "$MYTMP"/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= +@@ -42,4 +42,4 @@ then opts='-O0' + 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 $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl +--- a/lp_solve/ccc.osx ++++ b/lp_solve/ccc.osx +@@ -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:-cc} + + MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX` + +@@ -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("osx%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c ++echo 'int main(){printf("osx%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c + $c "$MYTMP"/platform.c -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(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c + $c "$MYTMP"/isnan.c -o "$MYTMP"/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= +@@ -37,4 +37,4 @@ dl=-ldl + + opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME -Wno-long-double' + +-$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 $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl +--- 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` + +@@ -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(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c + $c "$MYTMP"/platform.c -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(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c + $c "$MYTMP"/isnan.c -o "$MYTMP"/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= +@@ -42,13 +42,13 @@ 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 +-ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` +-ranlib bin/$PLATFORM/liblpsolve55.a ++${AR:-ar} rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` ++${RANLIB:-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 $LDFLAGS -fpic -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 $CFLAGS $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 +--- a/lpsolve55/ccc.aix ++++ b/lpsolve55/ccc.aix +@@ -4,14 +4,14 @@ src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../in + type xlc >/dev/null 2>&1 + if [ $? = 0 ] + then c=xlc +-else c=cc ++else c=${CC:-cc} + fi + + #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 ++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 +@@ -23,7 +23,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);return 0;}'>>/tmp/isnan.c ++echo 'int main(){isnan(0.0);return 0;}'>>/tmp/isnan.c + $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= +@@ -38,8 +38,8 @@ so=y + opts='-O2' + + $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 +-ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` +-ranlib bin/$PLATFORM/liblpsolve55.a ++${AR:-ar} rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` ++${RANLIB:-ranlib} bin/$PLATFORM/liblpsolve55.a + + if [ "$so" != "" ] + then +--- a/lpsolve55/ccc.hp-ux ++++ b/lpsolve55/ccc.hp-ux +@@ -1,12 +1,12 @@ + : + 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} + + #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 ++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);return 0;}'>>/tmp/isnan.c ++echo 'int main(){isnan(0.0);return 0;}'>>/tmp/isnan.c + $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= +@@ -33,8 +33,8 @@ so=y + 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 +-ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` +-ranlib bin/$PLATFORM/liblpsolve55.a ++${AR:-ar} rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` ++${RANLIB:-ranlib} bin/$PLATFORM/liblpsolve55.a + + if [ "$so" != "" ] + then +--- a/lpsolve55/ccc.osx ++++ b/lpsolve55/ccc.osx +@@ -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` + +@@ -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("osx%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c ++echo 'int main(){printf("osx%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c + $c "$MYTMP"/platform.c -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(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c + $c "$MYTMP"/isnan.c -o "$MYTMP"/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= +--- a/lpsolve55/ccc.solaris ++++ b/lpsolve55/ccc.solaris +@@ -1,12 +1,12 @@ + : + 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} + + #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 ++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);return 0;}'>>/tmp/isnan.c ++echo 'int main(){isnan(0.0);return 0;}'>>/tmp/isnan.c + $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN= +@@ -33,8 +33,8 @@ so=y + 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 +-ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` +-ranlib bin/$PLATFORM/liblpsolve55.a ++${AR:-ar} rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` ++${RANLIB:-ranlib} bin/$PLATFORM/liblpsolve55.a + + if [ "$so" != "" ] + then +--- a/lpsolve55/cccLUSOL.osx ++++ b/lpsolve55/cccLUSOL.osx +@@ -1,11 +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 ../bfp/bfp_LUSOL/lusol.c' +-c=cc ++c=${CC:-cc} + + #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 ++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 +@@ -17,7 +17,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);return 0;}'>>/tmp/isnan.c ++echo 'int main(){isnan(0.0);return 0;}'>>/tmp/isnan.c + $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 + if [ $? = 0 ] + then NOISNAN=