summaryrefslogtreecommitdiff
path: root/src/configure
diff options
context:
space:
mode:
Diffstat (limited to 'src/configure')
-rwxr-xr-xsrc/configure27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/configure b/src/configure
index 01970d6..af3caf5 100755
--- a/src/configure
+++ b/src/configure
@@ -43,6 +43,8 @@ PREFIX='/usr/local'
BINDIR=''
MANDIR=''
INSTALLMANPAGE=1
+EXAMPLESDIR=''
+INSTALLEXAMPLES=1
print_usage() {
echo "configure --help print this"
@@ -51,6 +53,8 @@ print_usage() {
echo " --bindir=<DIR> the path to the bin directory (default: \$PREFIX/bin)"
echo " --mandir=<DIR> the path to the system man pages (default: \$PREFIX/share/man)"
echo " --no-manpage dont't install manpages"
+ echo " --examplesdir=<DIR> the path to the examples files (default: \$PREFIX/share/examples)"
+ echo " --no-examples dont't install example files"
echo " --use-clang use clang/llvm as compiler/linker"
}
@@ -72,6 +76,12 @@ do
--no-manpage)
INSTALLMANPAGE=0
;;
+ --examplesdir=*)
+ EXAMPLESDIR=${arg#--examplesdir=}
+ ;;
+ --no-examples)
+ INSTALLEXAMPLES=0
+ ;;
--use-clang)
USE_CLANG=1
;;
@@ -133,6 +143,10 @@ if [ -z "$MANDIR" ]; then
MANDIR=$PREFIX/share/man
fi
+if [ -z "$EXAMPLESDIR" ]; then
+ EXAMPLESDIR=$PREFIX/share/examples
+fi
+
cat > include.mk <<EOF
# this file was created automatically
# do not edit this file directly
@@ -143,6 +157,7 @@ CC := $COMPILER
CFLAGS := $CFLAGS
LDFLAGS := $LDFLAGS
STRIP := strip
+CP := cp
INSTALL := install
RAGEL := ragel
@@ -157,6 +172,13 @@ else
echo "not installing manpages"
fi
+if [ $INSTALLEXAMPLES -eq 1 ]; then
+ echo "EXAMPLESDIR := $EXAMPLESDIR" >> include.mk
+ echo "installing example files"
+else
+ echo "not installing example files"
+fi
+
VERSION=`cat ../version`
if which git >/dev/null; then
GIT_HASH=`git rev-parse HEAD 2> /dev/null`
@@ -213,6 +235,11 @@ if [ $INSTALLMANPAGE -eq 1 ]; then
echo "#define MANDIR \"$MANDIR\"" >> config-rtp.h
fi
+if [ $INSTALLEXAMPLES -eq 1 ]; then
+ echo "#define EXAMPLESDIR \"$EXAMPLESDIR\"" >> config-launch.h
+ echo "#define EXAMPLESDIR \"$EXAMPLESDIR\"" >> config-rtp.h
+fi
+
cat >> config-rtp.h <<EOF
#endif