forked from 42ity/libcidr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·35 lines (30 loc) · 917 Bytes
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
ME="$0"
MYDIR=`dirname ${ME}`
PREFIX=/usr/local
PKG_CONFIG_DIR=""
while [ "$1" != "" ] ; do
case "$1" in
--prefix)
PREFIX=$2
shift
;;
--prefix=*)
PREFIX=`echo "$1" | cut -f 2 -d=`
;;
PKG_CONFIG_PATH=*)
# Get the first dir from that path
PKG_CONFIG_DIR=`echo "$1" | cut -f 2 -d= | cut -f 1 -d:`
;;
esac
shift
done
if [ "$PREFIX" != "" ] ; then
sed -i -r "s#^PREFIX\\?=.*\$#PREFIX?=${PREFIX}#" ${MYDIR}/GNUmakefile.inc
sed -i -r "s#^PREFIX\\?=.*\$#PREFIX?=${PREFIX}#" ${MYDIR}/Makefile.inc
fi
# PKG_CONFIG_PATH=/home/travis/build/42ity/fty-nut/tmp/lib/pkgconfig
if [ "${PKG_CONFIG_DIR}" != "" ] ; then
sed -i -r "s#^PKG_CONFIG_DIR\\?=.*\$#PKG_CONFIG_DIR?=${PKG_CONFIG_DIR}#" ${MYDIR}/GNUmakefile.inc
sed -i -r "s#^PKG_CONFIG_DIR\\?=.*\$#PKG_CONFIG_DIR?=${PKG_CONFIG_DIR}#" ${MYDIR}/Makefile.inc
fi