Skip to content

Commit bc2b76a

Browse files
committed
bash-less configure; #53
1 parent 92d48bd commit bc2b76a

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

configure

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env bash
21
# Anticonf (tm) script by Jeroen Ooms (2020)
32
# This script will query 'pkg-config' for the required cflags and ldflags.
43
# If pkg-config is unavailable or does not find the library, try setting
@@ -31,19 +30,16 @@ elif [ "$PKGCONFIG_CFLAGS" ] || [ "$PKGCONFIG_LIBS" ]; then
3130
echo "Found pkg-config cflags and libs!"
3231
PKG_CFLAGS=${PKGCONFIG_CFLAGS}
3332
PKG_LIBS=${PKGCONFIG_LIBS}
34-
else
35-
case "$OSTYPE" in "darwin"*)
33+
elif [ `uname` = "Darwin" ]; then
3634
brew --version 2>/dev/null
3735
if [ $? -eq 0 ]; then
3836
BREWDIR=`brew --prefix`
37+
PKG_CFLAGS="-I$BREWDIR/opt/openssl/include"
38+
PKG_LIBS="-L$BREWDIR/opt/openssl/lib $PKG_LIBS"
3939
else
4040
curl -sfL "https://autobrew.github.io/scripts/$PKG_BREW_NAME" > autobrew
41-
source autobrew
41+
. autobrew
4242
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
4743
fi
4844

4945
# Find compiler
@@ -79,14 +75,11 @@ fi
7975
if [ -z "$AUTOBREW" ]; then
8076
SONAME=`${CC} -E ${PKG_CFLAGS} src/tests/soname.h | sh | xargs`
8177
if [ "$SONAME" ]; then
82-
case "$OSTYPE" in
83-
"darwin"*)
78+
if [`uname` = "Darwin" ]; then
8479
PKG_LIBS_VERSIONED=`echo "${PKG_LIBS}" | sed "s/-lssl/-lssl.${SONAME}/" | sed "s/-lcrypto/-lcrypto.${SONAME}/"`
85-
;;
86-
*)
80+
else
8781
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
9083

9184
# Test if versioned linking works
9285
${CC} ${PKG_CFLAGS} src/tests/main.c ${PKG_LIBS_VERSIONED} -o src/main.exe 2>/dev/null

0 commit comments

Comments
 (0)