File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change 1
- #! /usr/bin/env bash
2
1
# Anticonf (tm) script by Jeroen Ooms (2020)
3
2
# This script will query 'pkg-config' for the required cflags and ldflags.
4
3
# If pkg-config is unavailable or does not find the library, try setting
@@ -31,19 +30,16 @@ elif [ "$PKGCONFIG_CFLAGS" ] || [ "$PKGCONFIG_LIBS" ]; then
31
30
echo "Found pkg-config cflags and libs!"
32
31
PKG_CFLAGS=${PKGCONFIG_CFLAGS}
33
32
PKG_LIBS=${PKGCONFIG_LIBS}
34
- else
35
- case " $OSTYPE " in " darwin" * )
33
+ elif [ `uname` = "Darwin" ]; then
36
34
brew --version 2>/dev/null
37
35
if [ $? -eq 0 ]; then
38
36
BREWDIR=`brew --prefix`
37
+ PKG_CFLAGS="-I$BREWDIR/opt/openssl/include"
38
+ PKG_LIBS="-L$BREWDIR/opt/openssl/lib $PKG_LIBS"
39
39
else
40
40
curl -sfL "https://autobrew.github.io/scripts/$PKG_BREW_NAME" > autobrew
41
- source autobrew
41
+ . autobrew
42
42
fi
43
- PKG_CFLAGS=" -I$BREWDIR /opt/openssl@1.1/include -I$BREWDIR /opt/openssl/include"
44
- PKG_LIBS=" -L$BREWDIR /opt/openssl@1.1/lib -L$BREWDIR /opt/openssl/lib $PKG_LIBS "
45
- ;;
46
- esac
47
43
fi
48
44
49
45
# Find compiler
79
75
if [ -z "$AUTOBREW" ]; then
80
76
SONAME=`${CC} -E ${PKG_CFLAGS} src/tests/soname.h | sh | xargs`
81
77
if [ "$SONAME" ]; then
82
- case " $OSTYPE " in
83
- " darwin" * )
78
+ if [`uname` = "Darwin" ]; then
84
79
PKG_LIBS_VERSIONED=`echo "${PKG_LIBS}" | sed "s/-lssl/-lssl.${SONAME}/" | sed "s/-lcrypto/-lcrypto.${SONAME}/"`
85
- ;;
86
- * )
80
+ else
87
81
PKG_LIBS_VERSIONED=`echo "${PKG_LIBS}" | sed "s/-lssl/-l:libssl.so.${SONAME}/" | sed "s/-lcrypto/-l:libcrypto.so.${SONAME}/"`
88
- ;;
89
- esac
82
+ fi
90
83
91
84
# Test if versioned linking works
92
85
${CC} ${PKG_CFLAGS} src/tests/main.c ${PKG_LIBS_VERSIONED} -o src/main.exe 2>/dev/null
You can’t perform that action at this time.
0 commit comments