#!/bin/sh
-export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+PREFIX=${PREFIX:=/usr/local}
+
+if ! [ -d /lib64 ] ;
+then
+ LIBDIR=${LIBDIR:=$PREFIX/lib}
+else
+ LIBDIR=${LIBDIR:=$PREFIX/lib64}
+fi
+export PKG_CONFIG_PATH=$LIBDIR/pkgconfig:$PKG_CONFIG_PATH
+
if ! [ -e Makefile ] ;
then
echo "No Makefile available, generating it."
libtoolize --automake --force --copy
- autoreconf --force --install
- ./configure --prefix=/usr/local
+ autoreconf --install
+ ./configure --prefix=$PREFIX --libdir=$LIBDIR
else
echo "Makefile found, no need to generate it."
fi