summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/configure30
-rw-r--r--src/options.c8
2 files changed, 20 insertions, 18 deletions
diff --git a/src/configure b/src/configure
index 3b7b1b4..8044552 100755
--- a/src/configure
+++ b/src/configure
@@ -153,12 +153,12 @@ if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then
fi
if [ $USE_CLANG -eq 0 ]; then
- CFLAGS='-g -Wall -O2'
- LDFLAGS='-g -Wall -O2'
+ CFLAGS=$CFLAGS'-g -Wall -O2'
+ LDFLAGS=$LDFLAGS'-g -Wall -O2'
COMPILER='gcc'
else
- CFLAGS='-g -O2'
- LDFLAGS='-g -O2'
+ CFLAGS=$CFLAGS'-g -O2'
+ LDFLAGS=$LDFLAGS'-g -O2'
COMPILER='clang'
fi
@@ -183,28 +183,33 @@ case $TARGET in
;;
esac
-
+CRYPTO_LIB_NAME=""
case $CRYPTO_LIB in
gcrypt)
CFLAGS=$CFLAGS' -DUSE_GCRYPT'
LDFLAGS=$LDFLAGS' -lgcrypt'
- echo "using gcrypt library"
+ CRYPTO_LIB_NAME="libgcrypt"
;;
nettle)
CFLAGS=$CFLAGS' -DUSE_NETTLE'
LDFLAGS=$LDFLAGS' -lnettle'
- echo "using nettle library"
+ CRYPTO_LIB_NAME="Nettle"
;;
ssl)
CFLAGS=$CFLAGS' -DUSE_SSL_CRYPTO'
LDFLAGS=$LDFLAGS' -lcrypto'
- echo "using ssl crypto library"
+ CRYPTO_LIB_NAME="OpenSSL"
;;
none)
CFLAGS=$CFLAGS' -DNO_CRYPT'
- echo "disabling crypto"
+ CRYPTO_LIB_NAME="none"
+ ;;
+ *)
+ echo "unknown crypto library: $$CRYPTO_LIB"
+ exit 1
;;
esac
+echo "crypto-library: $CRYPTO_LIB_NAME"
if [ $PASSPHRASE -eq 0 ]; then
CFLAGS=$CFLAGS' -DNO_PASSPHRASE'
@@ -270,9 +275,6 @@ if which git >/dev/null; then
fi
fi
-HOSTNAME=`hostname`
-DATE=`date +"%d.%m.%Y %H:%M:%S %Z"`
-
cat > version.h <<EOF
/*
* uanytun version info
@@ -285,8 +287,8 @@ cat > version.h <<EOF
#ifndef UANYTUN_version_h_INCLUDED
#define UANYTUN_version_h_INCLUDED
-#define VERSION_STRING_0 "uanytun version $VERSION"
-#define VERSION_STRING_1 "built on $HOSTNAME, $DATE"
+#define VERSION_STRING "uanytun version $VERSION"
+#define CRYPTO_LIB_NAME "$CRYPTO_LIB_NAME"
#endif
diff --git a/src/options.c b/src/options.c
index c3038bb..8f75b8d 100644
--- a/src/options.c
+++ b/src/options.c
@@ -480,13 +480,13 @@ void options_print_usage()
void options_print_version()
{
- printf("%s\n", VERSION_STRING_0);
+ printf("%s\n", VERSION_STRING);
#if defined(__clang__)
- printf("%s, using CLANG %s\n", VERSION_STRING_1, __clang_version__);
+ printf("built using CLANG %s with %s crypto library.\n", __clang_version__, CRYPTO_LIB_NAME);
#elif defined(__GNUC__)
- printf("%s, using GCC %d.%d.%d\n", VERSION_STRING_1, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
+ printf("built using GCC %d.%d.%d with %s crypto library\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__, CRYPTO_LIB_NAME);
#else
- printf("%s\n", VERSION_STRING_1);
+ printf("built using an unknown compiler with %s crypto library\n", CRYPTO_LIB_NAME, CRYPTO_LIB_NAME);
#endif
}