dnl -*-shell-script-*-
dnl Process this file with autoconf to produce a configure script.-
AC_INIT(choleski.cc)
AC_LANG_CPLUSPLUS

optimise_b=yes
shared_b=no
LIB_SUFFIX=.a

AC_ARG_ENABLE(shared,
    [  enable-shared       shared flower library],
    [shared_b=$enableval])
    
AC_ARG_ENABLE(optimise,
    [  disable-optimise    optimisations off],
    [optimise_b=$enableval])

if test $shared_b = yes; then
	MODULE_CXXFLAGS="$MODULE_CXXFLAGS -fPIC"
	MODULE_LDFLAGS="-shared -Wl,-soname,libflower.so "
	LIB_SUFFIX=.so
fi

if test $optimise_b = yes; then
    MODULE_CXXFLAGS="$MODULE_CXXFLAGS -O2 -DSTRING_UTILS_INLINED"
fi

AC_SUBST(MODULE_CXXFLAGS)
AC_SUBST(MODULE_LDFLAGS)
AC_SUBST(LIB_SUFFIX)

AC_PROG_CXX
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(memmem snprintf )
AC_CONFIG_HEADER(out/config.hh:config.hh.in)

CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh

AC_OUTPUT(out/Flower-flags.make:Flower-flags.make.in)

