summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2018-06-08 22:43:40 (GMT)
committerChristian Pointner <equinox@anytun.org>2018-06-08 22:43:40 (GMT)
commit32e9e9ace9f34fa547b727f9929b5734a6392984 (patch)
tree899303dbe4160acfd53a68a41f4552ba31fb0c01
parent747ccaaca10830736d3685ad88f252be61a07a91 (diff)
make builds reproducible
-rwxr-xr-xsrc/configure11
-rw-r--r--src/options.cpp11
2 files changed, 12 insertions, 10 deletions
diff --git a/src/configure b/src/configure
index 082e523..b8a7f3f 100755
--- a/src/configure
+++ b/src/configure
@@ -283,6 +283,7 @@ if [ -n "$BOOST_PREFIX" ]; then
LDFLAGS="$LDFLAGS -L\"$BOOST_PREFIX/lib\""
fi
+CRYPTO_LIB_NAME=""
case $CRYPTO_LIB in
gcrypt)
CXXFLAGS=$CXXFLAGS' -DUSE_GCRYPT'
@@ -291,6 +292,7 @@ case $CRYPTO_LIB in
CXXFLAGS="$CXXFLAGS -I\"$GCRYPT_PREFIX/include\""
LDFLAGS="$LDFLAGS -L\"$GCRYPT_PREFIX/lib\""
fi
+ CRYPTO_LIB_NAME="libgcrypt"
echo "using gcrypt library"
;;
nettle)
@@ -300,6 +302,7 @@ case $CRYPTO_LIB in
CXXFLAGS="$CXXFLAGS -I\"$NETTLE_PREFIX/include\""
LDFLAGS="$LDFLAGS -L\"$NETTLE_PREFIX/lib\""
fi
+ CRYPTO_LIB_NAME="Nettle"
echo "using nettle library"
;;
ssl)
@@ -309,10 +312,12 @@ case $CRYPTO_LIB in
CXXFLAGS="$CXXFLAGS -I\"$OPENSSL_PREFIX/include\""
LDFLAGS="$LDFLAGS -L\"$OPENSSL_PREFIX/lib\""
fi
+ CRYPTO_LIB_NAME="OpenSSL"
echo "using openssl crypto library"
;;
none)
CXXFLAGS=$CXXFLAGS' -DNO_CRYPT'
+ CRYPTO_LIB_NAME="none"
echo "disabling crypto"
;;
esac
@@ -417,8 +422,6 @@ if which git >/dev/null; then
VERSION="$VERSION (git $GIT_HASH)"
fi
fi
-HOSTNAME=`hostname`
-DATE=`date +"%d.%m.%Y %H:%M:%S %Z"`
cat > version.h <<EOF
/*
@@ -432,8 +435,8 @@ cat > version.h <<EOF
#ifndef ANYTUN_version_h_INCLUDED
#define ANYTUN_version_h_INCLUDED
-#define VERSION_STRING_0 " version $VERSION"
-#define VERSION_STRING_1 "built on $HOSTNAME, $DATE"
+#define VERSION_STRING " version $VERSION"
+#define CRYPTO_LIB_NAME "$CRYPTO_LIB_NAME"
#endif
EOF
diff --git a/src/options.cpp b/src/options.cpp
index 038e7b7..8cfc480 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -558,17 +558,16 @@ void Options::printVersion()
#else
std::cout << "anytun";
#endif
- std::cout << VERSION_STRING_0 << std::endl;
+ std::cout << VERSION_STRING << std::endl;
#if defined(__clang__)
- std::cout << VERSION_STRING_1 << ", using CLANG " << __clang_version__ << std::endl;
+ std::cout << "built using CLANG " << __clang_version__ << " with " << CRYPTO_LIB_NAME << " crypto library." << std::endl;
#elif defined(__GNUC__)
- std::cout << VERSION_STRING_1 << ", using GCC " << __GNUC__ << '.' << __GNUC_MINOR__
- << '.' << __GNUC_PATCHLEVEL__ << std::endl;
+ std::cout << "built using GCC " << __GNUC__ << '.' << __GNUC_MINOR__ << '.' << __GNUC_PATCHLEVEL__
+ << " with " << CRYPTO_LIB_NAME << " crypto library." << std::endl;
#else
- std::cout << VERSION_STRING_1 << std::endl;
+ std::cout << "built using an unknown compiler " << CRYPTO_LIB_NAME << " crypto library." << std::endl;
#endif
-
}
void Options::printUsage()