• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3if [ -z "$INSTALL_PATH" ]; then
4	echo
5	echo 'Error: No $INSTALL_PATH defined'
6	echo
7	echo "   usage: [PREFIX=prefix][BUILD_PATH=/path/to/build] INSTALL_PATH=/path/to/install make-trace-cmd.sh install|install_libs|clean|uninstall"
8	echo
9	echo "     Used to create a self contained directory to copy to other machines."
10	echo
11	echo "   Please read PACKAGING for more information."
12	echo
13	exit
14fi
15
16if [ ! -d $INSTALL_PATH ]; then
17	mkdir $INSTALL_PATH
18fi
19
20if [ ! -z "$BUILD_PATH" ]; then
21	if [ ! -d $BUILD_PATH ]; then
22		mkdir $BUILD_PATH
23	fi
24	O_PATH="O=$BUILD_PATH"
25fi
26
27if [ -z "$PREFIX" ]; then
28	PREFIX="/usr"
29fi
30
31PKG_PATH=`pkg-config --variable pc_path pkg-config | tr ":" " " | cut -d' ' -f1`
32
33WITH_PATH=""
34# If pkg-config supports --with-path, use that as well
35if pkg-config --with-path=/tmp --variable pc_path pkg-config &> /dev/null ; then
36	WITH_PATH="--with-path=$INSTALL_PATH$PKG_PATH"
37fi
38
39PKG_CONFIG_PATH="$INSTALL_PATH/$PKG_PATH" PKG_CONFIG="pkg-config $WITH_PATH --define-variable=prefix=$INSTALL_PATH/$PREFIX" CFLAGS="-g -Wall -I$INSTALL_PATH/$PREFIX/include" make DESTDIR=$INSTALL_PATH  $O_PATH prefix=$PREFIX $@
40