diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 68 |
1 files changed, 65 insertions, 3 deletions
@@ -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 |