aboutsummaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-04-04 21:59:14 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-07-30 22:09:21 +0200
commitb503900b1456e8bd4b60d1deb0ef7cc3665676f1 (patch)
tree92e7a88c190caf23f810e0a828b6da926f11879a /autogen.sh
parent13c5d6801e3b9fdc71bec88c300243a939346a8d (diff)
First step of cleaning up the Makefile.in hell.first-step-to-automake-integration
The goal is to get rid of the Makefile.in's (replace it with Automake Makefile.am's) as they duplicate lot's of text. That decreases readability and is in general a bad design pattern. It seems appropriate to use Automake for an Autoconf based project. Currently achieved: * using libtool to build the core library (+libtool's semantic versioning) * out-of-source builds should work right now * introducing Automake based Makefile in src/ * removed some (maybe) unused GIT ignored files * provide some small python fixes Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh24
1 files changed, 17 insertions, 7 deletions
diff --git a/autogen.sh b/autogen.sh
index 94e1cfd69..6f6a654ca 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -5,6 +5,8 @@ NDPI_MINOR="1"
NDPI_PATCH="0"
NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
+SCRIPT_DIR="$(dirname ${0})"
+
rm -f configure config.h config.h.in
AUTOCONF=$(command -v autoconf)
@@ -45,19 +47,27 @@ if test -z $PKG_CONFIG; then
exit
fi
-cat configure.seed | sed \
+"${SCRIPT_DIR}/utils/generate_automake_am.sh"
+
+cat "${SCRIPT_DIR}/configure.seed" | sed \
-e "s/@NDPI_MAJOR@/$NDPI_MAJOR/g" \
-e "s/@NDPI_MINOR@/$NDPI_MINOR/g" \
-e "s/@NDPI_PATCH@/$NDPI_PATCH/g" \
-e "s/@NDPI_VERSION_SHORT@/$NDPI_VERSION_SHORT/g" \
-e "s/@FUZZY@/$FUZZY/g" \
- > configure.ac
+ > "${SCRIPT_DIR}/configure.ac"
+OLDPWD="$(pwd)"
+cd "${SCRIPT_DIR}" || exit 1
autoreconf -ivf
-cat configure | sed "s/#define PACKAGE/#define NDPI_PACKAGE/g" | sed "s/#define VERSION/#define NDPI_VERSION/g" > configure.tmp
-cat configure.tmp > configure
+cd "${OLDPWD}" || exit 1
-echo "./configure $@"
-chmod +x configure
-./configure $@
+cat "${SCRIPT_DIR}/configure" | \
+ sed "s/#define PACKAGE/#define NDPI_PACKAGE/g" | \
+ sed "s/#define VERSION/#define NDPI_VERSION/g" \
+ > "${SCRIPT_DIR}/configure.tmp"
+cat "${SCRIPT_DIR}/configure.tmp" > "${SCRIPT_DIR}/configure"
+echo "${SCRIPT_DIR}/configure ${*}"
+chmod +x "${SCRIPT_DIR}/configure"
+${SCRIPT_DIR}/configure ${@}