summaryrefslogtreecommitdiffstats
path: root/app-arch/ruszip/files/zip-2.32-build.patch
blob: 61a2bae34b3fd9dcf66d875230b231d3a6fe0483 (plain)
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
respect build environment settings

--- zip/unix/Makefile
+++ zip/unix/Makefile
@@ -12,15 +12,15 @@
 
 list:   all
 
-MAKE = make -f unix/Makefile
+MAKE := $(MAKE) -f unix/Makefile
 SHELL = /bin/sh
 LN = ln -s
 
 # (to use the Gnu compiler, change cc to gcc in CC)
-CC = cc
+CC ?= gcc
 BIND = $(CC)
 AS = $(CC) -c
-CPP = /lib/cpp
+CPP ?= $(CC)
 EXE =
 
 # probably can change this to 'install' if you have it
@@ -47,7 +47,7 @@
 #   LFLAGS1   flags after output file spec, before obj file list
 #   LFLAGS2   flags after obj file list (libraries, etc)
 CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP)
-CFLAGS = -O2 $(CFLAGS_NOOPT)
+CFLAGS ?= -O2 $(CFLAGS_NOOPT)
 LFLAGS1 =
 LFLAGS2 = -s
 
--- zip/unix/configure
+++ zip/unix/configure
@@ -13,52 +13,13 @@
 
 CC=${1-cc}
-CFLAGS=${2-"-I. -DUNIX"}
-LFLAGS1=""
+CFLAGS="${2--I. -DUNIX} ${CFLAGS} ${CPPFLAGS}"
+LFLAGS1="${LDFLAGS}"
 LN="ln -s"
-echo "Check C compiler type (optimization option)"
-cat > conftest.c << _EOF_
-int main()
-{
-#ifndef __SUNPRO_C
-   bad code
-#endif
-   return 0;
-}
-_EOF_
-$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
-if test $? -eq 0; then
-  echo '  Sun C (-xO3)'
-  CFLAGS="${CFLAGS} -xO3"
-else
-  cat > conftest.c << _EOF_
-int main()
-{
-#ifndef __DECC
-   bad code
-#endif
-   return 0;
-}
-_EOF_
-  $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
-  if test $? -eq 0; then
-    echo '  DEC C (-O3)'
-    CFLAGS="${CFLAGS} -O3"
-  else
-    echo '  Other (gcc?) (-O2)'
-    CFLAGS="${CFLAGS} -O2"
-  fi
-fi
 
 echo Check for the C preprocessor
 # on SVR4, cc -E does not produce correct assembler files. Need /lib/cpp.
 CPP="${CC} -E"
 # solaris as(1) needs -P, maybe others as well ?
-[ -f /usr/ccs/lib/cpp ] && CPP="/usr/ccs/lib/cpp -P"
-[ -f /usr/lib/cpp ] && CPP=/usr/lib/cpp
-[ -f /lib/cpp ] && CPP=/lib/cpp
-[ -f /usr/bin/cpp ] && CPP=/usr/bin/cpp
-[ -f /xenix ] && CPP="${CC} -E"
-[ -f /lynx.os ] && CPP="${CC} -E"
 
 echo "#include <stdio.h>" > conftest.c
 $CPP conftest.c >/dev/null 2>/dev/null || CPP="${CC} -E"