+MACHINE="`uname -m`"
+if [ "$MACHINE" = "x86_64" ]; then
+ MULTIARCH="x86_64-linux-gnu"
+else
+ MULTIARCH="i386-linux-gnu"
+fi
+if [ -e /usr/lib/libdl.so -o -e /usr/lib/$MULTIARCH/libdl.so ]; then
+ LIBS="$LIBS -ldl"
+fi
+
+while [ "$1" ]; do
+ case $1 in
+ --libpath)
+ shift
+ LIBPATH="$1"
+ ;;
+ --libpath=*)
+ LIBPATH="${1#--libpath=}"
+ ;;
+ --prefix)
+ shift
+ PREFIX="$1"
+ ;;
+ --prefix=*)
+ PREFIX="${1#--prefix=}"
+ ;;
+ *)
+ echo "Unknown option $1"
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+if [ -z "$LIBPATH" -o "${LIBPATH%%/*}" ]; then
+ LIBPATH=`pwd`/${LIBPATH:-..}