#MIN_CONFIG(3.2.0)

AM_INIT_AUTOMAKE(autostart, 0.1)
AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN

# These numbers should be tweaked on every release. Read carefully:
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
# http://sourceware.org/autobook/autobook/autobook_91.html
lt_current="1"
lt_revision="0"
lt_age="0"
AC_SUBST(lt_current)
AC_SUBST(lt_revision)
AC_SUBST(lt_age)

dnl this package requires heimdal Kerberos to compile
KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [AC_MSG_WARN([Could not find pkg-config ])
])

if test -n "$PKGCONFIG"; then
  vers=`$PKGCONFIG krb5 --modversion 2>/dev/null | sed -e 's/libkrb5 //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
  if test -n "$vers" && test "$vers" -ge 1000000
  then
     KRB5_CFLAGS="`$PKGCONFIG krb5 --cflags`"
     CPPFLAGS="$CPPFLAGS $KRB5_CFLAGS"
  else
     AC_CHECK_HEADER(kadm5/admin.h)
  fi
fi
