#!/bin/bash

# create a new libtool if possbile
test -f $(which libtoolize) && libtoolize --copy --force && sed -i -r 's/(hardcode_into_libs)=.*$/\1=no/' config/m4/*.m4

# on ubuntu, libtool 2.2.6a-1ubuntu1 is broken. Since we need that for package building, try to fix it if necessary
grep -l "^VERSION=\"2.2.6 Debian-2.2.6a-1ubuntu1\"" ltmain.sh
if [ "$?" == "0" ]; then
	echo "Fixing broken ubuntu libtool"
	patch -p0 < config/m4/ubuntu_ltmain_fix.patch
fi

automake --add-missing --copy
aclocal -I config/m4
autoconf

