| @@ -1,36 +1,46 @@ | | | @@ -1,36 +1,46 @@ |
1 | $NetBSD: patch-config.lib,v 1.2 2019/04/25 15:55:07 adam Exp $ | | 1 | $NetBSD: patch-config.lib,v 1.3 2020/08/18 03:27:49 tnn Exp $ |
2 | | | 2 | |
3 | Compile 'strip' test with CFLAGS, so -isysroot can be passed on OSX. | | 3 | Compile 'strip' test with CFLAGS, so -isysroot can be passed on OSX. |
4 | Correct library detection on NetBSD. | | 4 | Correct library detection on NetBSD. |
5 | On Darwin, be able to locate iconv.h inside the SDK. | | 5 | On Darwin, be able to locate iconv.h inside the SDK. |
| | | 6 | Use pkg-config to detect liblzo2 as hand-crafted method seems unreliable. |
6 | | | 7 | |
7 | --- config.lib.orig 2019-04-08 19:42:35.000000000 +0000 | | 8 | --- config.lib.orig 2020-06-01 21:22:01.000000000 +0000 |
8 | +++ config.lib | | 9 | +++ config.lib |
9 | @@ -2140,7 +2140,7 @@ check_strip() { | | 10 | @@ -2088,7 +2088,7 @@ check_strip() { |
10 | elif [ "$os" = "OSX" ]; then | | 11 | elif [ "$os" = "OSX" ]; then |
11 | # Most targets have -V in strip, to see if they exists... OSX doesn't.. so execute something | | 12 | # Most targets have -V in strip, to see if they exists... OSX doesn't.. so execute something |
12 | echo "int main(int argc, char *argv[]) { }" > strip.test.c | | 13 | echo "int main(int argc, char *argv[]) { }" > strip.test.c |
13 | - $cxx_host strip.test.c -o strip.test | | 14 | - $cxx_host strip.test.c -o strip.test |
14 | + $cc_host $CFLAGS strip.test.c -o strip.test | | 15 | + $cc_host $CFLAGS strip.test.c -o strip.test |
15 | check_compiler "host strip" "strip" "$host" "$strip" "$STRIP" "strip" "strip" "3" "strip.test" | | 16 | check_compiler "host strip" "strip" "$host" "$strip" "$STRIP" "strip" "strip" "3" "strip.test" |
16 | rm -f strip.test.c strip.test | | 17 | rm -f strip.test.c strip.test |
17 | else | | 18 | else |
18 | @@ -2676,7 +2676,7 @@ detect_library() { | | 19 | @@ -2633,7 +2633,7 @@ detect_library() { |
19 | if [ -z "$res" ]; then | | 20 | if [ -z "$res" ]; then |
20 | log 2 " trying /opt/local/include/$4$5... no" | | 21 | log 2 " trying /opt/local/include/$4$5... no" |
21 | fi | | 22 | fi |
22 | - if [ -z "$res" ] && [ "$os" = "NETBSD" ]; then | | 23 | - if [ -z "$res" ] && [ "$os" = "NETBSD" ]; then |
23 | + if [ -z "$res" ]; then | | 24 | + if [ -z "$res" ]; then |
24 | eval "$2=`ls -1 /usr/pkg/include/$4*.h 2>/dev/null | egrep \"\/$5\$\"`" | | 25 | eval "$2=`ls -1 /usr/pkg/include/$4*.h 2>/dev/null | egrep \"\/$5\$\"`" |
25 | eval "res=\$$2" | | 26 | eval "res=\$$2" |
26 | if [ -z "$res" ]; then | | 27 | if [ -z "$res" ]; then |
27 | @@ -2926,6 +2926,9 @@ detect_iconv() { | | 28 | @@ -2725,7 +2725,7 @@ detect_zlib() { |
| | | 29 | } |
| | | 30 | |
| | | 31 | detect_lzo2() { |
| | | 32 | - detect_library "$with_lzo2" "lzo2" "liblzo2.a" "lzo/" "lzo1x.h" |
| | | 33 | + detect_pkg_config "$with_lzo2" "lzo2" "lzo2" "2.10" |
| | | 34 | } |
| | | 35 | |
| | | 36 | detect_fluidsynth() { |
| | | 37 | @@ -2885,6 +2885,9 @@ detect_iconv() { |
28 | break | | 38 | break |
29 | fi | | 39 | fi |
30 | done | | 40 | done |
31 | + if [ -z "$iconv" ] && [ "$os" = "OSX" ]; then | | 41 | + if [ -z "$iconv" ] && [ "$os" = "OSX" ]; then |
32 | + iconv=`xcrun --show-sdk-path`/usr/include/iconv.h | | 42 | + iconv=`xcrun --show-sdk-path`/usr/include/iconv.h |
33 | + fi | | 43 | + fi |
34 | else | | 44 | else |
35 | # Make sure it exists | | 45 | # Make sure it exists |
36 | iconv=`ls $with_iconv/include/iconv.h 2>/dev/null` | | 46 | iconv=`ls $with_iconv/include/iconv.h 2>/dev/null` |