Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ambrop72/badvpn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTsln <tsln1998@qq.com>2016-06-22 15:04:31 +0300
committerTsln <tsln1998@qq.com>2016-06-22 15:04:31 +0300
commit1624171fa216c75b28a16df4880ff22591cc91db (patch)
tree148c6f3ed8ec390a0f022f7edc1e7ede34d59797
parent93137c8b283e02e3b804f3b8df91b0b9ae7d69a5 (diff)
Fix output file name and source folders conflict
-rwxr-xr-xcompile-tun2sock.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/compile-tun2sock.sh b/compile-tun2sock.sh
index 6510a68..0e14d13 100755
--- a/compile-tun2sock.sh
+++ b/compile-tun2sock.sh
@@ -5,6 +5,7 @@
# Input environment vars:
# SRCDIR - BadVPN source code
+# OUTDIR - tun2socks binary output file directory
# CC - compiler
# CFLAGS - compiler compile flags
# LDFLAGS - compiler link flags
@@ -19,6 +20,11 @@ if [[ -z $SRCDIR ]] || [[ ! -e $SRCDIR/CMakeLists.txt ]]; then
exit 1
fi
+if [[ ! -z $OUTDIR ]] && [[ ! -d $OUTDIR ]]; then
+ echo "OUTDIR is wrong"
+ exit 1
+fi
+
if ! "${CC}" --version &>/dev/null; then
echo "CC is wrong"
exit 1
@@ -43,6 +49,8 @@ DEFS=( -DBADVPN_THREAD_SAFE=0 -DBADVPN_LINUX -DBADVPN_BREACTOR_BADVPN -D_GNU_SOU
[[ $KERNEL = "2.4" ]] && DEFS=( "${DEFS[@]}" -DBADVPN_USE_SELFPIPE -DBADVPN_USE_POLL ) || DEFS=( "${DEFS[@]}" -DBADVPN_USE_SIGNALFD -DBADVPN_USE_EPOLL )
[[ $ENDIAN = "little" ]] && DEFS=( "${DEFS[@]}" -DBADVPN_LITTLE_ENDIAN ) || DEFS=( "${DEFS[@]}" -DBADVPN_BIG_ENDIAN )
+
+[[ -z $OUTDIR ]] && OUTDIR="."
SOURCES="
base/BLog_syslog.c
@@ -111,4 +119,4 @@ for f in $SOURCES; do
OBJS=( "${OBJS[@]}" "${obj}" )
done
-"${CC}" ${LDFLAGS} "${OBJS[@]}" -o tun2socks -lrt
+"${CC}" ${LDFLAGS} "${OBJS[@]}" -o $OUTDIR/tun2socks -lrt