-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure
executable file
·55 lines (44 loc) · 2.31 KB
/
configure
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
#!/bin/sh
# ---------------------------------------------------------------------------- #
# Minmiconf (https://github.com/mezantrop/minmiconf) based configure script #
# Note, it is NOT compatible with autotools one! #
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
. ./minmiconf
# ---------------------------------------------------------------------------- #
_DEBUG=N
# ---------------------------------------------------------------------------- #
CC_CANDIDATES="cc clang gcc"
PREFIX_CANDIDATES="$PREFIX /usr/local /opt $HOME"
EHARD; DECIDE CONFIG_START "STATE" .configured
EHARD; DECIDE DETECT_TARGET "TARGET"
EHARD; DECIDE DETECT_PREFIX "PREFIX" '"$PREFIX_CANDIDATES"'
IN_VAR "TARGET" "Darwin" "Y" && {
EHARD; DECIDE DETECT_PATH "MACOS_SDK_PATH" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
DECIDE DEFINE_VAR "MACOS_SDK_INCLUDE_PATH" "$MACOS_SDK_PATH/usr/include"
DECIDE DEFINE_VAR "MACOS_SDK_LIB_PATH" "$MACOS_SDK_PATH/usr/lib"
}
INCLUDE_PATH_CANDIDATES="/usr/include $PREFIX/include $MACOS_SDK_INCLUDE_PATH"
LIB_PATH_CANDIDATES="/lib /usr/lib /usr/lib32 $PREFIX/lib $MACOS_SDK_LIB_PATH"
WITH_TCP_NODELAY=${WITH_TCP_NODELAY-1}
ESOFT; DECIDE DETECT_LPATH "LPATH" '"$LIB_PATH_CANDIDATES" "all"'
ESOFT; DECIDE DETECT_IPATH "IPATH" '"$INCLUDE_PATH_CANDIDATES" "all"'
EHARD; DECIDE DETECT_CC "CC" '"$CC_CANDIDATES"'
ESOFT; DECIDE IF_NDEF_OR_IVAR WITH_LIBSSH2 1 && {
ESOFT; DECIDE DETECT_LIBRARY "LIBSSH2" 'ssh2' && {
DECIDE DEFINE_VAR "WITH_LIBSSH2" '"1"'
} || {
DECIDE DEFINE_VAR "WITH_LIBSSH2" '"0"'
}
}
EHARD; DECIDE DETECT_USER "USER"
IN_VAR "USER" "root" && ! IN_VAR "WITH_USER" "root" && {
NOTIFY "Warning" "Reseting USER variable. To force root, assign WITH_USER=root"
DECIDE DEFINE_VAR "USER" '"nobody"'
}
CPATH="$CPATH $IPATH"
LDFLAGS="$LDFLAGS $LPATH"
LDLIBS="$LDLIBS $LIBSSL $LIBSSH2"
SET_VARS="PREFIX CC WITH_TCP_NODELAY WITH_LIBSSH2 CPATH LDFLAGS LDLIBS USER"
WRITE_VARS "$SET_VARS" "Makefile" "?" "Y"
EHARD; DECIDE CONFIG_FINISH "STATE" .configured