summaryrefslogtreecommitdiffstats
path: root/autogen.sh
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-05-15 15:24:31 +0200
committerLennart Poettering <lennart@poettering.net>2012-05-15 15:25:40 +0200
commit2e8be3fa0df7b6ccf953572ab341ddd9c45db878 (patch)
treea7508b82b35479d293bafdd980550a9d24877541 /autogen.sh
parente13acf74dd4418bc7c913ad111eb75dd4cbaf82d (diff)
build-sys: modernize build system
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..97bc9b2
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+# This file is part of RealtimeKit.
+#
+# Copyright 2009 Lennart Poettering
+#
+# RealtimeKit is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# RealtimeKit is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with RealtimeKit. If not, see <http://www.gnu.org/licenses/>.
+
+if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
+ cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
+ chmod +x .git/hooks/pre-commit && \
+ echo "Activated pre-commit hook."
+fi
+
+autoreconf --force --install --symlink
+
+libdir() {
+ echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
+}
+
+args="\
+--sysconfdir=/etc \
+--localstatedir=/var \
+--libdir=$(libdir /usr/lib) \
+--libexecdir=/usr/lib"
+
+if [ "x$1" == "xc" ]; then
+ ./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args
+ make clean
+else
+ echo
+ echo "----------------------------------------------------------------"
+ echo "Initialized build system. For a common configuration please run:"
+ echo "----------------------------------------------------------------"
+ echo
+ echo "./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args"
+ echo
+fi