summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2009-11-25 17:09:55 (GMT)
committerChristian Pointner <equinox@helsinki.at>2009-11-25 17:09:55 (GMT)
commit7d2f7bbeeb420ddd8adf3be465d7aaf7f49deb83 (patch)
tree159a4aa5b0f86312b16994e5f48fd9d96b1d33e9 /configure
parent57494f21455e8f374de39524e6d77b8d8356cbc3 (diff)
added install target to Makefile
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure68
1 files changed, 65 insertions, 3 deletions
diff --git a/configure b/configure
index 1af8e01..59861b7 100755
--- a/configure
+++ b/configure
@@ -23,12 +23,25 @@
TARGET=`uname -s`
+EBUILD_COMPAT=0
+
CFLAGS='-g -O2'
LDFLAGS='-g -Wall -O2'
+PREFIX='/usr/local'
+BINDIR=''
+ETCDIR=''
+MANDIR=''
+INSTALLMANPAGE=1
+
print_usage() {
echo "configure --help print this"
echo " --target=<TARGET> build target i.e. Linux (default: autodetect)"
+ echo " --prefix=<PREFIX> the installation prefix (default: /usr/local)"
+ echo " --bindir=<DIR> the path to the bin directory (default: $PREFIX/bin)"
+ echo " --sysconfdir=<DIR> the path to the system configuration directory (default: $PREFIX/etc"
+ echo " --mandir=<DIR> the path to the system man pages (default: $PREFIX/share/man)"
+ echo " --no-manpage dont't install manpage"
}
for arg
@@ -37,18 +50,43 @@ do
--target=*)
TARGET=${arg#--target=}
;;
+ --prefix=*)
+ PREFIX=${arg#--prefix=}
+ ;;
+ --bindir=*)
+ BINDIR=${arg#--bindir=}
+ ;;
+ --sysconfdir=*)
+ ETCDIR=${arg#--sysconfdir=}
+ ;;
+ --mandir=*)
+ MANDIR=${arg#--mandir=}
+ ;;
+ --no-manpage)
+ INSTALLMANPAGE=0
+ ;;
+ --ebuild-compat)
+ EBUILD_COMPAT=1
+ ;;
--help)
print_usage
exit 0
;;
*)
- echo "Unknown argument: $arg"
- print_usage
- exit 1
+ ERRORS="$ERRORS $arg"
;;
esac
done
+if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then
+ for error in $ERRORS; do
+ echo "Unknown argument: $error"
+ done
+
+ print_usage
+ exit 1
+fi
+
rm -f include.mk
case $TARGET in
Linux)
@@ -65,6 +103,18 @@ case $TARGET in
;;
esac
+if [ -z "$BINDIR" ]; then
+ BINDIR=$PREFIX/bin
+fi
+
+if [ -z "$ETCDIR" ]; then
+ ETCDIR=$PREFIX/etc
+fi
+
+if [ -z "$MANDIR" ]; then
+ MANDIR=$PREFIX/share/man
+fi
+
cat >> include.mk <<EOF
# this file was created automatically
# do not edit this file directly
@@ -74,6 +124,18 @@ TARGET := $TARGET
CC := gcc
CFLAGS := $CFLAGS
LDFLAGS := $LDFLAGS
+INSTALL := install
+
+PREFIX := $PREFIX
+BINDIR := $BINDIR
+ETCDIR := $ETCDIR
EOF
+if [ $INSTALLMANPAGE -eq 1 ]; then
+ echo "MANDIR := $MANDIR" >> include.mk
+ echo "installing manpage"
+else
+ echo "not installing manpage"
+fi
+
exit 0