2013-05-27 14:59:41 +10:00
|
|
|
AC_PREREQ([2.64])
|
|
|
|
|
|
|
|
|
|
AC_INIT([libevdev],
|
2013-09-18 14:38:26 +10:00
|
|
|
[0.4],
|
2013-05-27 14:59:41 +10:00
|
|
|
[],
|
|
|
|
|
[libevdev],
|
|
|
|
|
[])
|
|
|
|
|
|
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2013-08-26 13:08:12 +10:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2013-05-27 14:59:41 +10:00
|
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
|
|
|
|
|
|
|
|
|
|
# Before making a release, the LIBEVDEV_LT_VERSION string should be
|
|
|
|
|
# modified.
|
|
|
|
|
# The string is of the form C:R:A.
|
|
|
|
|
# - If interfaces have been changed or added, but binary compatibility has
|
|
|
|
|
# been preserved, change to C+1:0:A+1
|
|
|
|
|
# - If binary compatibility has been broken (eg removed or changed interfaces)
|
|
|
|
|
# change to C+1:0:0
|
|
|
|
|
# - If the interface is the same as the previous version, change to C:R+1:A
|
|
|
|
|
LIBEVDEV_LT_VERSION=1:0:0
|
|
|
|
|
AC_SUBST(LIBEVDEV_LT_VERSION)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AM_SILENT_RULES([yes])
|
|
|
|
|
|
|
|
|
|
# Check for programs
|
|
|
|
|
AC_PROG_CC
|
|
|
|
|
|
|
|
|
|
# Initialize libtool
|
|
|
|
|
LT_PREREQ([2.2])
|
|
|
|
|
LT_INIT
|
2013-09-03 10:32:00 +10:00
|
|
|
LT_PATH_LD
|
2013-09-12 18:07:53 +02:00
|
|
|
|
|
|
|
|
with_ldflags=""
|
2013-09-03 10:32:00 +10:00
|
|
|
if test "x$lt_cv_prog_gnu_ld" = "xyes"; then
|
2013-09-12 18:07:53 +02:00
|
|
|
CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
|
|
|
|
|
-Wl,--as-needed \
|
|
|
|
|
-Wl,--gc-sections \
|
|
|
|
|
-Wl,-z,relro \
|
|
|
|
|
-Wl,-z,now])
|
2013-09-03 10:32:00 +10:00
|
|
|
fi
|
2013-09-12 18:07:53 +02:00
|
|
|
AC_SUBST([GNU_LD_FLAGS], $with_ldflags)
|
2013-05-27 14:59:41 +10:00
|
|
|
|
|
|
|
|
PKG_PROG_PKG_CONFIG()
|
2013-09-11 09:21:32 +10:00
|
|
|
PKG_CHECK_MODULES(CHECK, [check >= 0.9.9], [HAVE_CHECK="yes"], [HAVE_CHECK="no"])
|
2013-07-29 14:27:41 +10:00
|
|
|
if test "x$HAVE_CHECK" != "xyes"; then
|
2013-07-29 13:50:41 +10:00
|
|
|
AC_MSG_WARN([check not found - skipping building unit tests])
|
2013-07-29 14:27:41 +10:00
|
|
|
fi
|
|
|
|
|
AM_CONDITIONAL(BUILD_TESTS, [test "x$HAVE_CHECK" = "xyes"])
|
2013-05-27 14:59:41 +10:00
|
|
|
|
2013-09-12 18:07:53 +02:00
|
|
|
with_cflags=""
|
2013-05-27 14:59:41 +10:00
|
|
|
if test "x$GCC" = "xyes"; then
|
2013-09-12 18:07:53 +02:00
|
|
|
CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
|
|
|
|
|
-Wall \
|
|
|
|
|
-Wextra \
|
|
|
|
|
-Wno-unused-parameter \
|
|
|
|
|
-Wstrict-prototypes \
|
|
|
|
|
-Wmissing-prototypes \
|
|
|
|
|
-fvisibility=hidden \
|
|
|
|
|
-pipe \
|
|
|
|
|
-fno-strict-aliasing \
|
|
|
|
|
-ffunction-sections \
|
|
|
|
|
-fdata-sections \
|
|
|
|
|
-fno-strict-aliasing \
|
|
|
|
|
-fdiagnostics-show-option \
|
|
|
|
|
-fno-common])
|
2013-05-27 14:59:41 +10:00
|
|
|
fi
|
2013-09-12 18:07:53 +02:00
|
|
|
AC_SUBST([GCC_CFLAGS], $with_cflags)
|
2013-05-27 14:59:41 +10:00
|
|
|
|
2013-06-22 19:13:36 +10:00
|
|
|
AC_PATH_PROG(DOXYGEN, [doxygen])
|
|
|
|
|
if test "x$DOXYGEN" = "x"; then
|
|
|
|
|
AC_MSG_WARN([doxygen not found - required for documentation])
|
2013-05-31 11:46:20 +10:00
|
|
|
fi
|
2013-08-23 14:01:34 +10:00
|
|
|
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
|
2013-05-31 11:46:20 +10:00
|
|
|
|
2013-06-05 17:30:08 +10:00
|
|
|
AC_MSG_CHECKING([whether to build with gcov])
|
|
|
|
|
AC_ARG_ENABLE([gcov],
|
|
|
|
|
[AS_HELP_STRING([--enable-gcov],
|
2013-09-09 14:41:11 +02:00
|
|
|
[Whether to enable coverage testing (default:enabled)])],
|
2013-06-05 17:30:08 +10:00
|
|
|
[],
|
|
|
|
|
[enable_gcov=yes],
|
|
|
|
|
)
|
|
|
|
|
AS_IF([test "x$enable_gcov" != "xno"],
|
|
|
|
|
[
|
|
|
|
|
GCOV_CFLAGS="-fprofile-arcs -ftest-coverage"
|
|
|
|
|
GCOV_LDFLAGS="-fprofile-arcs -ftest-coverage"
|
|
|
|
|
enable_gcov=yes
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" != "xno"])
|
|
|
|
|
AC_SUBST([GCOV_CFLAGS])
|
|
|
|
|
AC_SUBST([GCOV_LDFLAGS])
|
|
|
|
|
AC_MSG_RESULT([$enable_gcov])
|
|
|
|
|
|
2013-05-27 14:59:41 +10:00
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
|
libevdev/Makefile
|
2013-06-22 19:13:36 +10:00
|
|
|
doc/Makefile
|
|
|
|
|
doc/libevdev.doxygen
|
2013-06-04 09:35:14 +10:00
|
|
|
tools/Makefile
|
2013-06-04 11:11:57 +10:00
|
|
|
test/Makefile
|
2013-05-27 14:59:41 +10:00
|
|
|
libevdev.pc])
|
|
|
|
|
AC_OUTPUT
|