aboutsummaryrefslogtreecommitdiff
path: root/math/lp_solve/files/patch-respect-TMPDIR
blob: 870da18d87cd39da9b74577b772b50553e77d293 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
--- lp_solve/ccc.orig	2009-01-25 18:39:03 UTC
+++ lp_solve/ccc
@@ -2,31 +2,33 @@
 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
 
+tmp="${TMPDIR:-/tmp}"
+
 #determine platform (32/64 bit)
->/tmp/platform.c
-echo '#include <stdlib.h>'>>/tmp/platform.c
-echo '#include <stdio.h>'>>/tmp/platform.c
-echo '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
+>"${tmp}"/platform.c
+echo '#include <stdlib.h>'>>"${tmp}"/platform.c
+echo '#include <stdio.h>'>>"${tmp}"/platform.c
+echo '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
 
 mkdir bin bin/$PLATFORM >/dev/null 2>&1
 
 math=-lm
 
 #check if this system has the isnan function
->/tmp/isnan.c
-echo '#include <stdio.h>'>>/tmp/isnan.c
-echo '#include <stdlib.h>'>>/tmp/isnan.c
-echo '#include <math.h>'>>/tmp/isnan.c
-echo 'main(){isnan(0);}'>>/tmp/isnan.c
-$c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1
+>"${tmp}"/isnan.c
+echo '#include <stdio.h>'>>"${tmp}"/isnan.c
+echo '#include <stdlib.h>'>>"${tmp}"/isnan.c
+echo '#include <math.h>'>>"${tmp}"/isnan.c
+echo 'main(){isnan(0);}'>>"${tmp}"/isnan.c
+$c "${tmp}"/isnan.c -o "${tmp}"/isnan $math >/dev/null 2>&1
 if [ $? = 0 ]
 then NOISNAN=
 else NOISNAN=-DNOISNAN
 fi
-rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1
+rm "${tmp}"/isnan.c "${tmp}"/isnan >/dev/null 2>&1
 
 opts='-O3'
 
--- lpsolve55/ccc.orig	2009-03-25 00:27:18 UTC
+++ lpsolve55/ccc
@@ -2,29 +2,31 @@
 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
 
+tmp="${TMPDIR:-/tmp}"
+
 #determine platform (32/64 bit)
->/tmp/platform.c
-echo '#include <stdlib.h>'>>/tmp/platform.c
-echo '#include <stdio.h>'>>/tmp/platform.c
-echo '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
+>"${tmp}"/platform.c
+echo '#include <stdlib.h>'>>"${tmp}"/platform.c
+echo '#include <stdio.h>'>>"${tmp}"/platform.c
+echo '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
 
 mkdir bin bin/$PLATFORM >/dev/null 2>&1
 
 #check if this system has the isnan function
->/tmp/isnan.c
-echo '#include <stdio.h>'>>/tmp/isnan.c
-echo '#include <stdlib.h>'>>/tmp/isnan.c
-echo '#include <math.h>'>>/tmp/isnan.c
-echo 'main(){isnan(0);}'>>/tmp/isnan.c
-$c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1
+>"${tmp}"/isnan.c
+echo '#include <stdio.h>'>>"${tmp}"/isnan.c
+echo '#include <stdlib.h>'>>"${tmp}"/isnan.c
+echo '#include <math.h>'>>"${tmp}"/isnan.c
+echo 'main(){isnan(0);}'>>"${tmp}"/isnan.c
+$c "${tmp}"/isnan.c -o "${tmp}"/isnan $math >/dev/null 2>&1
 if [ $? = 0 ]
 then NOISNAN=
 else NOISNAN=-DNOISNAN
 fi
-rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1
+rm "${tmp}"/isnan.c "${tmp}"/isnan >/dev/null 2>&1
 
 def=
 so=