configure: add support for --prefix
authorJens Axboe <axboe@fb.com>
Wed, 29 Apr 2015 16:29:16 +0000 (10:29 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 29 Apr 2015 16:29:16 +0000 (10:29 -0600)
Allows other installation paths that /usr/local

Signed-off-by: Jens Axboe <axboe@fb.com>
Makefile
configure

index 9b7f27ab735978fc1faa3dda5c2a09556a438ca5..1b312cbda08b2b6784a7b8a75f5978d74d996474 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -243,7 +243,7 @@ ifeq ($(CONFIG_TARGET_OS), SunOS)
 else
        INSTALL = install
 endif
 else
        INSTALL = install
 endif
-prefix = /usr/local
+prefix = $(INSTALL_PREFIX)
 bindir = $(prefix)/bin
 
 ifeq ($(CONFIG_TARGET_OS), Darwin)
 bindir = $(prefix)/bin
 
 ifeq ($(CONFIG_TARGET_OS), Darwin)
index 8e496b0f852ab7372fe9254cdbd4cd5ecdd6e61f..0b9874bfce3b51604610acb6ee61477f892ace96 100755 (executable)
--- a/configure
+++ b/configure
@@ -135,11 +135,14 @@ show_help="no"
 exit_val=0
 gfio_check="no"
 libhdfs="no"
 exit_val=0
 gfio_check="no"
 libhdfs="no"
+prefix=/usr/local
 
 # parse options
 for opt do
   optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
   case "$opt" in
 
 # parse options
 for opt do
   optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
   case "$opt" in
+  --prefix=*) prefix="$optarg"
+  ;;
   --cpu=*) cpu="$optarg"
   ;;
   #  esx is cross compiled and cannot be detect through simple uname calls
   --cpu=*) cpu="$optarg"
   ;;
   #  esx is cross compiled and cannot be detect through simple uname calls
@@ -178,6 +181,7 @@ for opt do
 done
 
 if test "$show_help" = "yes" ; then
 done
 
 if test "$show_help" = "yes" ; then
+  echo "--prefix=              Use this directory as installation prefix"
   echo "--cpu=                 Specify target CPU if auto-detect fails"
   echo "--cc=                  Specify compiler to use"
   echo "--extra-cflags=        Specify extra CFLAGS to pass to compiler"
   echo "--cpu=                 Specify target CPU if auto-detect fails"
   echo "--cc=                  Specify compiler to use"
   echo "--extra-cflags=        Specify extra CFLAGS to pass to compiler"
@@ -1612,3 +1616,4 @@ echo "CFLAGS+=$CFLAGS" >> $config_host_mak
 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
+echo "INSTALL_PREFIX=$prefix" >> $config_host_mak