|
Lines 1-11
Link Here
|
| 1 |
Index: configure |
1 |
--- configure.orig 2017-03-02 11:48:03 UTC |
|
|
2 |
+++ configure |
| 2 |
@@ -1,4 +1,4 @@ |
3 |
@@ -1,4 +1,4 @@ |
| 3 |
-#!/usr/bin/env bash |
4 |
-#!/usr/bin/env bash |
| 4 |
+#!/bin/sh |
5 |
+#!/bin/sh |
| 5 |
|
6 |
|
| 6 |
CONFIG="config.mk" |
7 |
CONFIG="config.mk" |
| 7 |
PREFIX="/usr/local" |
8 |
PREFIX="/usr/local" |
| 8 |
@@ -8,7 +8,7 @@ DEBUG= |
9 |
@@ -14,7 +14,7 @@ DEBUG= |
| 9 |
SSE=auto |
10 |
SSE=auto |
| 10 |
OPENMP= |
11 |
OPENMP= |
| 11 |
LIBPNG_DIR=. |
12 |
LIBPNG_DIR=. |
|
Lines 14-20
Index: configure
Link Here
|
| 14 |
COCOA_READER=auto |
15 |
COCOA_READER=auto |
| 15 |
LCMS2=0 |
16 |
LCMS2=0 |
| 16 |
else |
17 |
else |
| 17 |
@@ -38,7 +38,7 @@ for i in "$@"; do |
18 |
@@ -44,7 +44,7 @@ for i in "$@"; do |
| 18 |
echo |
19 |
echo |
| 19 |
help "--with-openmp=static compile with multicore support" |
20 |
help "--with-openmp=static compile with multicore support" |
| 20 |
help "--with-lcms2/--without-lcms2 compile with color profile support" |
21 |
help "--with-lcms2/--without-lcms2 compile with color profile support" |
|
Lines 23-29
Index: configure
Link Here
|
| 23 |
help "--with-cocoa/--without-cocoa use Cocoa framework to read images" |
24 |
help "--with-cocoa/--without-cocoa use Cocoa framework to read images" |
| 24 |
fi |
25 |
fi |
| 25 |
help "--with-libpng=<dir> search for libpng in directory" |
26 |
help "--with-libpng=<dir> search for libpng in directory" |
| 26 |
@@ -109,7 +109,7 @@ done |
27 |
@@ -115,7 +115,7 @@ done |
| 27 |
|
28 |
|
| 28 |
# If someone runs sudo make install as very first command, and configure later, |
29 |
# If someone runs sudo make install as very first command, and configure later, |
| 29 |
# $CONFIG cannot be overwritten, and must be deleted before continuing. |
30 |
# $CONFIG cannot be overwritten, and must be deleted before continuing. |
|
Lines 32-38
Index: configure
Link Here
|
| 32 |
echo "Cannot overwrite file $CONFIG! Please delete it." |
33 |
echo "Cannot overwrite file $CONFIG! Please delete it." |
| 33 |
exit 1 |
34 |
exit 1 |
| 34 |
fi |
35 |
fi |
| 35 |
@@ -146,7 +146,7 @@ find_h() { |
36 |
@@ -152,7 +152,7 @@ find_h() { |
| 36 |
|
37 |
|
| 37 |
find_pkgconfig() { |
38 |
find_pkgconfig() { |
| 38 |
local LIBNAME=$1 |
39 |
local LIBNAME=$1 |
|
Lines 41-47
Index: configure
Link Here
|
| 41 |
cflags "$(pkg-config --cflags "$LIBNAME")" |
42 |
cflags "$(pkg-config --cflags "$LIBNAME")" |
| 42 |
lflags "$(pkg-config --libs "$LIBNAME")" |
43 |
lflags "$(pkg-config --libs "$LIBNAME")" |
| 43 |
status "$LIBNAME" "shared ($(pkg-config --modversion "$LIBNAME"))" |
44 |
status "$LIBNAME" "shared ($(pkg-config --modversion "$LIBNAME"))" |
| 44 |
@@ -210,9 +210,13 @@ find_library() { |
45 |
@@ -216,9 +216,13 @@ find_library() { |
| 45 |
return 0 |
46 |
return 0 |
| 46 |
fi |
47 |
fi |
| 47 |
|
48 |
|
|
Lines 58-77
Index: configure
Link Here
|
| 58 |
return 0 |
59 |
return 0 |
| 59 |
fi |
60 |
fi |
| 60 |
done |
61 |
done |
| 61 |
@@ -262,10 +266,8 @@ fi |
62 |
@@ -272,12 +276,8 @@ fi |
| 62 |
|
|
|
| 63 |
# SSE |
63 |
# SSE |
| 64 |
if [ "$SSE" = 'auto' ]; then |
64 |
if [ "$SSE" = 'auto' ]; then |
| 65 |
- if [[ "$(uname -m)" =~ (amd|x86_)64 || |
65 |
SSE=0 |
| 66 |
- "$(grep -E -m1 "^flags" /proc/cpuinfo)" =~ "sse" ]]; then |
66 |
- if type uname > /dev/null; then |
| 67 |
- SSE=1 |
67 |
- if [[ "$(uname -m)" =~ "amd64" || "$(uname -m)" =~ "x86_64" || |
|
|
68 |
- "$(grep -E -m1 "^flags" /proc/cpuinfo)" =~ "sse" ]]; then |
| 69 |
- SSE=1 |
| 70 |
- fi |
| 68 |
- fi |
71 |
- fi |
| 69 |
+ echo $(uname -m) | grep -E -q '(amd|x86_)64' && SSE=1 |
72 |
+ echo $(uname -m) | grep -E -q '(amd|x86_)64' && SSE=1 |
| 70 |
+ grep -E -m1 -q '^flags.*sse' /proc/cpuinfo 2>/dev/null && SSE=1 |
73 |
+ grep -E -m1 -q '^flags.*sse' /proc/cpuinfo 2>/dev/null && SSE=1 |
| 71 |
fi |
74 |
fi |
| 72 |
|
75 |
|
| 73 |
if [ "$SSE" -eq 1 ]; then |
76 |
if [ "$SSE" -eq 1 ]; then |
| 74 |
@@ -288,9 +290,8 @@ if [ -n "$OPENMP" ]; then |
77 |
@@ -300,9 +300,8 @@ if [ -n "$OPENMP" ]; then |
| 75 |
else |
78 |
else |
| 76 |
OPENMPFLAGS="-fopenmp" |
79 |
OPENMPFLAGS="-fopenmp" |
| 77 |
fi |
80 |
fi |
|
Lines 83-89
Index: configure
Link Here
|
| 83 |
cflags "$OPENMPFLAGS" |
86 |
cflags "$OPENMPFLAGS" |
| 84 |
lflags "$OPENMPFLAGS" |
87 |
lflags "$OPENMPFLAGS" |
| 85 |
status "OpenMP" "yes" |
88 |
status "OpenMP" "yes" |
| 86 |
@@ -305,11 +306,13 @@ else |
89 |
@@ -317,11 +316,13 @@ else |
| 87 |
fi |
90 |
fi |
| 88 |
|
91 |
|
| 89 |
# Cocoa |
92 |
# Cocoa |
|
Lines 99-105
Index: configure
Link Here
|
| 99 |
COCOA_READER=1 |
102 |
COCOA_READER=1 |
| 100 |
cflags "-DUSE_COCOA=1" |
103 |
cflags "-DUSE_COCOA=1" |
| 101 |
lflags "-framework Cocoa" |
104 |
lflags "-framework Cocoa" |
| 102 |
@@ -320,25 +323,24 @@ if [[ "$OSTYPE" =~ "darwin" ]]; then |
105 |
@@ -332,25 +333,24 @@ if [[ "$OSTYPE" =~ "darwin" ]]; then |
| 103 |
fi |
106 |
fi |
| 104 |
|
107 |
|
| 105 |
# pairs of possible *.h and lib*.so locations |
108 |
# pairs of possible *.h and lib*.so locations |
|
Lines 133-139
Index: configure
Link Here
|
| 133 |
else |
136 |
else |
| 134 |
SOLIBSUFFIX=so |
137 |
SOLIBSUFFIX=so |
| 135 |
fi |
138 |
fi |
| 136 |
@@ -350,7 +352,7 @@ HAS_LIBPNG=0 |
139 |
@@ -362,7 +362,7 @@ HAS_LIBPNG=0 |
| 137 |
if echo "#include \"png.h\" |
140 |
if echo "#include \"png.h\" |
| 138 |
int main(){ |
141 |
int main(){ |
| 139 |
return !png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); |
142 |
return !png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); |
|
Lines 142-148
Index: configure
Link Here
|
| 142 |
status "libpng" "custom flags" |
145 |
status "libpng" "custom flags" |
| 143 |
HAS_LIBPNG=1 |
146 |
HAS_LIBPNG=1 |
| 144 |
fi |
147 |
fi |
| 145 |
@@ -361,7 +363,7 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then |
148 |
@@ -373,7 +373,7 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then |
| 146 |
if [ -n "$PNGH" ]; then |
149 |
if [ -n "$PNGH" ]; then |
| 147 |
PNGH_STRING=$(pngh_string "$PNGH") |
150 |
PNGH_STRING=$(pngh_string "$PNGH") |
| 148 |
PNGH_MAJMIN=$(pngh_majmin "$PNGH") |
151 |
PNGH_MAJMIN=$(pngh_majmin "$PNGH") |
|
Lines 151-157
Index: configure
Link Here
|
| 151 |
LIBPNGA=$(find_f "$LIBPNG_DIR" "libpng${PNGH_MAJMIN}.a") |
154 |
LIBPNGA=$(find_f "$LIBPNG_DIR" "libpng${PNGH_MAJMIN}.a") |
| 152 |
if [ -n "$LIBPNGA" ]; then |
155 |
if [ -n "$LIBPNGA" ]; then |
| 153 |
cflags "-I${PNGH%/*}" |
156 |
cflags "-I${PNGH%/*}" |
| 154 |
@@ -377,14 +379,19 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then |
157 |
@@ -389,14 +389,19 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then |
| 155 |
if find_pkgconfig libpng; then |
158 |
if find_pkgconfig libpng; then |
| 156 |
HAS_LIBPNG=1 |
159 |
HAS_LIBPNG=1 |
| 157 |
else |
160 |
else |
|
Lines 176-182
Index: configure
Link Here
|
| 176 |
if [ -n "$LIBPNGSO" ]; then |
179 |
if [ -n "$LIBPNGSO" ]; then |
| 177 |
cflags "-I${PNGH%/*}" |
180 |
cflags "-I${PNGH%/*}" |
| 178 |
lflags "-L${LIBPNGSO%/*} -lpng${PNGH_MAJMIN}" |
181 |
lflags "-L${LIBPNGSO%/*} -lpng${PNGH_MAJMIN}" |
| 179 |
@@ -398,7 +405,7 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then |
182 |
@@ -410,7 +415,7 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then |
| 180 |
fi |
183 |
fi |
| 181 |
fi |
184 |
fi |
| 182 |
if [ "$HAS_LIBPNG" -eq 0 ]; then |
185 |
if [ "$HAS_LIBPNG" -eq 0 ]; then |