dnl Process this file with autoconf to produce a configure script.
AC_INIT(plug.c)
AM_INIT_AUTOMAKE(zorp-module-plug, 1.4.0)

AM_CONFIG_HEADER(config.h)

# We want an absolute path to the source-dir.
case "$srcdir" in
    /*)
        ;;
    *)
        oldsrcdir="$srcdir"
        top_srcdir="`cd \"$srcdir\"; pwd`"
        ;;
esac

dnl Checks for arguments

AC_ARG_WITH(zorp,
   [  --with-zorp=path       use an uninstalled copy of zorp-core],
   [with_zorp=`cd $with_zorp; pwd`],
   [with_zorp=""])

if test "x$with_zorp" = "x"; then
	AC_PATH_PROG(path_zorp_config, zorp-config, none)

	if test "x$path_zorp_config" = "xnone"; then
		AC_ERROR([zorp-config script required, set your PATH])
	fi
else
    	path_zorp_config="$with_zorp/zorp-config"
fi



dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP

if test "x$with_zorp" != "x"; then
	LIBTOOL="$with_zorp/libtool"
	AC_SUBST(LIBTOOL)
else
	AC_DISABLE_STATIC
	AM_PROG_LIBTOOL
fi


if test "x$prefix" = "xNONE"; then
	prefix=`$path_zorp_config --prefix`
fi

if test "x$with_zorp" = "x"; then
	CPPFLAGS=`$path_zorp_config --cppflags`
	CFLAGS=`$path_zorp_config --cflags`
	LDFLAGS=`$path_zorp_config --libs`
else
	CPPFLAGS=`$path_zorp_config --local-cppflags`
	CFLAGS=`$path_zorp_config --local-cflags`
	LDFLAGS=`$path_zorp_config --local-libs`
fi

dnl Checks for libraries.

dnl Checks for header files.

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.

AC_OUTPUT(Makefile)
