2013-11-19 11:57:38 -05:00
|
|
|
# Copyright © 2013 Red Hat, Inc.
|
|
|
|
|
#
|
|
|
|
|
# Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
|
# documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
|
# the above copyright notice appear in all copies and that both that copyright
|
|
|
|
|
# notice and this permission notice appear in supporting documentation, and
|
|
|
|
|
# that the name of the copyright holders not be used in advertising or
|
|
|
|
|
# publicity pertaining to distribution of the software without specific,
|
|
|
|
|
# written prior permission. The copyright holders make no representations
|
|
|
|
|
# about the suitability of this software for any purpose. It is provided "as
|
|
|
|
|
# is" without express or implied warranty.
|
|
|
|
|
#
|
|
|
|
|
# THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
|
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
|
|
|
# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
|
|
|
|
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
|
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
|
|
|
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
|
|
|
|
# OF THIS SOFTWARE.
|
|
|
|
|
|
2013-10-29 13:46:14 +10:00
|
|
|
AC_PREREQ([2.62])
|
2013-05-27 14:59:41 +10:00
|
|
|
|
|
|
|
|
AC_INIT([libevdev],
|
2018-03-08 15:25:28 +10:00
|
|
|
[1.5.9],
|
2013-11-19 11:56:40 -05:00
|
|
|
[https://bugs.freedesktop.org/enter_bug.cgi?product=libevdev],
|
2013-05-27 14:59:41 +10:00
|
|
|
[libevdev],
|
2014-03-11 09:19:18 +10:00
|
|
|
[http://freedesktop.org/wiki/Software/libevdev/])
|
2013-05-27 14:59:41 +10:00
|
|
|
|
2013-11-05 07:58:24 +01:00
|
|
|
AC_CONFIG_SRCDIR([libevdev/libevdev.c])
|
2013-05-27 14:59:41 +10:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2013-11-04 15:43:57 +01:00
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
2013-08-26 13:08:12 +10:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2013-05-27 14:59:41 +10:00
|
|
|
|
2017-01-06 09:48:48 +10:00
|
|
|
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz subdir-objects])
|
2013-05-27 14:59:41 +10:00
|
|
|
|
|
|
|
|
# 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
|
2018-03-08 15:25:28 +10:00
|
|
|
LIBEVDEV_LT_VERSION=3:21:1
|
2013-05-27 14:59:41 +10:00
|
|
|
AC_SUBST(LIBEVDEV_LT_VERSION)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AM_SILENT_RULES([yes])
|
|
|
|
|
|
|
|
|
|
# Check for programs
|
2013-11-19 11:58:45 -05:00
|
|
|
AC_PROG_CC_C99
|
2013-05-27 14:59:41 +10:00
|
|
|
|
|
|
|
|
# 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
|
|
|
|
2016-07-13 11:33:43 +10:00
|
|
|
AC_CHECK_LIB([m], [round])
|
|
|
|
|
|
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"])
|
2014-04-24 11:27:14 +10:00
|
|
|
if test "x$HAVE_CHECK" = "xyes"; then
|
|
|
|
|
AC_PATH_PROG(VALGRIND, [valgrind])
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_WARN([check not found - skipping building unit tests])
|
2013-07-29 14:27:41 +10:00
|
|
|
fi
|
2014-04-24 11:27:14 +10:00
|
|
|
AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"])
|
2014-08-25 10:48:50 +10:00
|
|
|
AM_CONDITIONAL(ENABLE_RUNTIME_TESTS, [test "x$HAVE_CHECK" = "xyes"])
|
2015-03-13 22:44:31 +01:00
|
|
|
AM_CONDITIONAL(ENABLE_STATIC_LINK_TEST, [test "x$enable_static" = "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-10-02 09:55:08 +10:00
|
|
|
have_doxygen="no"
|
|
|
|
|
else
|
|
|
|
|
have_doxygen="yes"
|
2013-05-31 11:46:20 +10:00
|
|
|
fi
|
2013-10-02 09:55:08 +10:00
|
|
|
AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$have_doxygen" = "xyes"])
|
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-10-02 09:40:43 +10:00
|
|
|
[Whether to enable coverage testing (default:disabled)])],
|
2013-06-05 17:30:08 +10:00
|
|
|
[],
|
2013-10-02 09:40:43 +10:00
|
|
|
[enable_gcov=no],
|
2013-06-05 17:30:08 +10:00
|
|
|
)
|
|
|
|
|
AS_IF([test "x$enable_gcov" != "xno"],
|
|
|
|
|
[
|
|
|
|
|
GCOV_CFLAGS="-fprofile-arcs -ftest-coverage"
|
2018-06-29 11:49:51 +10:00
|
|
|
GCOV_LDFLAGS="-lgcov"
|
2013-06-05 17:30:08 +10:00
|
|
|
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])
|
|
|
|
|
|
2014-08-19 08:20:49 +10:00
|
|
|
AM_PATH_PYTHON([2.6])
|
2016-03-17 11:02:50 +10:00
|
|
|
AC_PATH_PROG(CAT, [cat])
|
2014-08-19 08:20:49 +10:00
|
|
|
|
2014-08-19 09:16:39 +10:00
|
|
|
# nm to check for leaking symbols in the static library
|
|
|
|
|
AC_PATH_PROG(NM, [nm])
|
|
|
|
|
AM_CONDITIONAL(HAVE_NM, [test "x$NM" != "x"])
|
2015-03-13 22:44:31 +01:00
|
|
|
if test "x$enable_static" = "xno"; then
|
|
|
|
|
static_symbol_leaks_test="no - static build disabled"
|
2014-08-19 09:16:39 +10:00
|
|
|
else
|
2015-03-13 22:44:31 +01:00
|
|
|
if test "x$NM" = "x"; then
|
|
|
|
|
AC_MSG_WARN([nm not found - skipping symbol leak test])
|
|
|
|
|
have_nm="no"
|
|
|
|
|
static_symbol_leaks_test="no - nm not found"
|
|
|
|
|
else
|
|
|
|
|
have_nm="yes"
|
|
|
|
|
static_symbol_leaks_test="yes"
|
|
|
|
|
fi
|
2014-08-19 09:16:39 +10:00
|
|
|
fi
|
|
|
|
|
|
2015-03-13 22:44:31 +01:00
|
|
|
AM_CONDITIONAL(ENABLE_STATIC_SYMBOL_LEAKS_TEST, [test "x$static_symbol_leaks_test" = "xyes"])
|
|
|
|
|
|
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-12-09 08:42:17 +10:00
|
|
|
doc/libevdev.man
|
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
|
2013-10-02 09:55:08 +10:00
|
|
|
|
|
|
|
|
AC_MSG_RESULT([
|
2014-08-27 09:42:56 +10:00
|
|
|
Prefix ${prefix}
|
|
|
|
|
Libdir ${libdir}
|
|
|
|
|
|
2014-08-19 09:16:39 +10:00
|
|
|
Build documentation ${have_doxygen}
|
2014-08-25 10:48:50 +10:00
|
|
|
Enable unit-tests ${HAVE_CHECK}
|
2014-08-19 09:16:39 +10:00
|
|
|
Enable profiling ${enable_gcov}
|
2015-03-13 22:44:31 +01:00
|
|
|
Static library symbol check ${static_symbol_leaks_test}
|
2013-10-02 09:55:08 +10:00
|
|
|
])
|