#!/bin/sh
#
# Copyright (C) 1999-2001 Open Source Telecom Corporation.
#  
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without 
# modifications, as long as this notice is preserved.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

libtoolize --copy --force
ACLOCALDIRS="-I m4"
if [ -d ~/share/aclocal ] ; then
    ACLOCALDIRS="$ACLOCALDIRS -I ~/share/aclocal"
elif [ -d /usr/local/share/aclocal ] ; then
    ACLOCALDIRS="$ACLOCALDIRS -I /usr/local/share/aclocal"
fi

# This fixes a chicken-and-egg problem because we generate the automake
# files by listing the files in doc/whatever/* using a file glob, but
# we create those very files during the build from the docs target
# in doc/Makefile.am.  If you modify the Doxygen config to build docs
# in other formats, make sure to update this as well.
if ! [ -f doc/man3/manpages ]; then
	echo man_MANS = manpages > doc/man3/manpages
fi
if ! [ -f doc/latex/latexpages ]; then
	echo EXTRA_DIST = latexpages > doc/latex/latexpages
fi
if ! [ -f doc/html/htmlpages ]; then
	echo EXTRA_DIST = htmlpages > doc/html/htmlpages
fi
aclocal $ACLOCALDIRS
autoheader
automake --add-missing --copy
autoconf
rm -f config.cache
