131 lines (110 with data), 3.7 kB
AC_PREREQ(2.52)
AC_INIT(libat, 0.1.4, mbm-devel@lists.sourceforge.net, libat)
AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2])
AM_MAINTAINER_MODE
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
dnl Required programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LIBTOOL
#PKG_CHECK_MODULES(AT, dbus-glib-1 >= 0.75 glib-2.0 >= 2.18 gmodule-2.0 gobject-2.0)
#PKG_CHECK_MODULES(GUDEV, gudev-1.0)
#AC_SUBST(GUDEV_CFLAGS)
#AC_SUBST(GUDEV_LIBS)
#PKG_CHECK_MODULES(AT, )
#AC_CHECK_LIB(pthreads, pthread_create, [],
# [AC_CHECK_LIB(pthread, pthread_create)])
#THREAD_LIBS="-lpthread"
#AC_SUBST(THREAD_LIBS)
#AC_ARG_WITH(udev-base-dir, AS_HELP_STRING([--with-udev-base-dir=DIR], [where udev base directory is]))
#if test -n "$with_udev_base_dir" ; then
# UDEV_BASE_DIR="$with_udev_base_dir"
#else
# UDEV_BASE_DIR="/lib/udev"
#fi
#AC_SUBST(UDEV_BASE_DIR)
#GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
#AC_SUBST(GLIB_GENMARSHAL)
#AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory]))
#if test -n "$with_pppd_plugin_dir" ; then
# PPPD_PLUGIN_DIR="$with_pppd_plugin_dir"
#else
# PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.4"
#fi
#AC_SUBST(PPPD_PLUGIN_DIR)
AC_ARG_ENABLE(more-warnings,
AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",set_more_warnings=yes)
AC_MSG_CHECKING(for more warnings, including -Werror)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
-Wdeclaration-after-statement -Wstrict-prototypes \
-Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \
-fno-strict-aliasing; do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option"
AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,
has_option=no)
if test $has_option = no; then
CFLAGS="$SAVE_CFLAGS"
fi
AC_MSG_RESULT($has_option)
unset has_option
unset SAVE_CFLAGS
done
unset option
else
AC_MSG_RESULT(no)
fi
#dnl
#dnl Tests
#dnl
#AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build ModemManager tests]))
#AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes")
#case $with_tests in
# yes)
# with_tests=yes
# ;;
# *)
# with_tests=no
# ;;
#esac
# This macro is defined in check.m4 and tests if check.h and
# libcheck.a are installed in your system. It sets CHECK_CFLAGS and
# CHECK_LIBS accordingly.
# AM_PATH_CHECK([MINIMUM-VERSION,
# [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
#AM_PATH_CHECK(0.9.9)
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [have_check=yes],,
AC_MSG_WARN([check not found; cannot run unit tests!])
[have_check=no])
AM_CONDITIONAL(HAVE_CHECK, test x$have_check = xyes)
AC_CHECK_PROG(GCOV, gcov, gcov, no)
if test "$GCOV" = "no" ; then
AC_MSG_WARN([gcov not found; cannot run unit tests!])
fi
AC_CHECK_PROG(LCOV, lcov, lcov, no)
if test "$LCOV" = "no" ; then
AC_MSG_WARN([lcov not found; cannot run unit tests!])
else
lcov_major=`lcov -v | awk '{print $4}' | cut -f1 -d.`
lcov_minor=`lcov -v | awk '{print $4}' | cut -f2 -d.`
AC_MSG_CHECKING([that $LCOV is at least version 1.9])
if test $lcov_major -ge 2 -o \( $lcov_major -eq 1 -a $lcov_minor -ge 8 \); then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_WARN([lcov wrong version; cannot run unit tests!])
fi
fi
AC_CONFIG_FILES([
Makefile
src/Makefile
tests/Makefile
])
AC_OUTPUT