configure.ac: Add 'check-news' Automake option
[libjaylink.git] / configure.ac
blob4f4cb869fcb45742691ac516394f6e52c332271a
1 ##
2 ## This file is part of the libjaylink project.
3 ##
4 ## Copyright (C) 2014-2015 Marc Schink <jaylink-dev@marcschink.de>
5 ##
6 ## This program is free software: you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation, either version 2 of the License, or
9 ## (at your option) any later version.
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ## GNU General Public License for more details.
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 AC_PREREQ([2.64])
22 AC_INIT([libjaylink], [0.1.0], [jaylink-dev@marcschink.de])
23 AC_CONFIG_HEADERS([config.h])
24 AC_CONFIG_MACRO_DIR([m4])
25 AC_CONFIG_AUX_DIR([build-aux])
27 AC_CANONICAL_HOST
29 AM_INIT_AUTOMAKE([-Wall -Werror check-news])
31 # Enable additional compiler warnings via -Wall and -Wextra. Use hidden
32 # visibility for all non-static symbols by default with -fvisibility=hidden.
33 JAYLINK_CFLAGS="-Wall -Wextra -Werror -fvisibility=hidden"
35 # Checks for programs.
36 AC_PROG_CC
38 # Automake >= 1.12 requires AM_PROG_AR when using options -Wall and -Werror.
39 # To be compatible with older versions of Automake use AM_PROG_AR if it's
40 # defined only. This line must occur before LT_INIT.
41 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
43 # Initialize libtool.
44 LT_INIT
46 # Initialize pkg-config.
47 PKG_PROG_PKG_CONFIG
49 # Checks for libraries.
51 # Check for libusb-1.0 which is always needed.
52 PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9])
54 # Checks for header files.
56 # Checks for typedefs, structures, and compiler characteristics.
57 AC_C_BIGENDIAN
59 # Checks for library functions.
61 # Disable progress and informational output of libtool.
62 AC_SUBST([AM_LIBTOOLFLAGS], '--silent')
64 JAYLINK_SET_PACKAGE_VERSION([JAYLINK_VERSION_PACKAGE], [AC_PACKAGE_VERSION])
66 # Libtool interface version of libjaylink. This is not the same as the package
67 # version. For information about the versioning system of libtool, see:
68 # http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
69 JAYLINK_SET_LIBRARY_VERSION([JAYLINK_VERSION_LIBRARY], [0:0:0])
71 AC_ARG_ENABLE([subproject-build], AS_HELP_STRING([--enable-subproject-build],
72         [enable sub-project build [default=no]]))
74 AM_CONDITIONAL([SUBPROJECT_BUILD],
75         [test "x$enable_subproject_build" = "xyes"])
77 # Libtool interface version is not used for sub-project build as libjaylink is
78 # built as libtool convenience library.
79 AS_IF([test "x$enable_subproject_build" != "xyes"],
80         [JAYLINK_LDFLAGS="-version-info $JAYLINK_VERSION_LIBRARY"])
82 # Use C99 compatible stdio functions on MinGW instead of the incompatible
83 # functions provided by Microsoft.
84 AS_CASE([$host_os], [mingw*],
85         [AC_DEFINE([__USE_MINGW_ANSI_STDIO], [1],
86                 [Define to 1 to use C99 compatible stdio functions on MinGW.])])
88 # Add the Winsock2 library on MinGW for socket and other network-related
89 # functions.
90 AS_CASE([$host_os], [mingw*], [JAYLINK_LIBS="$JAYLINK_LIBS -lws2_32"])
92 AC_SUBST([JAYLINK_CFLAGS])
93 AC_SUBST([JAYLINK_LDFLAGS])
94 AC_SUBST([JAYLINK_LIBS])
96 AC_CONFIG_FILES([Makefile])
97 AC_CONFIG_FILES([libjaylink/Makefile])
98 AC_CONFIG_FILES([libjaylink/version.h])
99 AC_CONFIG_FILES([libjaylink.pc])
100 AC_CONFIG_FILES([Doxyfile])
102 AC_OUTPUT
104 echo
105 echo "libjaylink configuration summary:"
106 echo " - Package version ................ $JAYLINK_VERSION_PACKAGE"
107 echo " - Library version ................ $JAYLINK_VERSION_LIBRARY"
108 echo " - Installation prefix ............ $prefix"
109 echo " - Building on .................... $build"
110 echo " - Building for ................... $host"
111 echo