2 ## This file is part of the libjaylink project.
4 ## Copyright (C) 2014-2015 Marc Schink <jaylink-dev@marcschink.de>
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/>.
22 AC_INIT([libjaylink], [0.2.0], [jaylink-dev@marcschink.de], [libjaylink],
23 [http://git.zapb.de/libjaylink.git])
24 AC_CONFIG_HEADERS([config.h])
25 AC_CONFIG_MACRO_DIR([m4])
26 AC_CONFIG_AUX_DIR([build-aux])
30 AM_INIT_AUTOMAKE([-Wall -Werror])
32 # Enable additional compiler warnings via -Wall and -Wextra. Use hidden
33 # visibility for all non-static symbols by default with -fvisibility=hidden.
34 JAYLINK_CFLAGS="-Wall -Wextra -Werror -fvisibility=hidden"
36 # Checks for programs.
40 # Automake >= 1.12 requires AM_PROG_AR when using options -Wall and -Werror.
41 # To be compatible with older versions of Automake use AM_PROG_AR if it's
42 # defined only. This line must occur before LT_INIT.
43 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
48 # Initialize pkg-config.
51 # Checks for libraries.
53 # Check for libusb-1.0 which is always needed.
54 PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.16],
55 [HAVE_LIBUSB=yes], [HAVE_LIBUSB=no])
57 AS_IF([test "x$HAVE_LIBUSB" = "xyes"],
58 [libusb_msg="yes"], [libusb_msg="no (missing: libusb-1.0)"])
60 # Checks for header files.
62 # Checks for typedefs, structures, and compiler characteristics.
65 # Checks for library functions.
67 # Disable progress and informational output of libtool.
68 AC_SUBST([AM_LIBTOOLFLAGS], '--silent')
70 JAYLINK_SET_PACKAGE_VERSION([JAYLINK_VERSION_PACKAGE], [AC_PACKAGE_VERSION])
72 # Libtool interface version of libjaylink. This is not the same as the package
73 # version. For information about the versioning system of libtool, see:
74 # http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
75 JAYLINK_SET_LIBRARY_VERSION([JAYLINK_VERSION_LIBRARY], [0:0:0])
77 AC_ARG_ENABLE([subproject-build], AS_HELP_STRING([--enable-subproject-build],
78 [enable sub-project build [default=no]]))
80 AM_CONDITIONAL([SUBPROJECT_BUILD],
81 [test "x$enable_subproject_build" = "xyes"])
83 AC_ARG_WITH([libusb], [AS_HELP_STRING([--without-libusb],
84 [disable libusb support [default=detect]])])
86 AS_IF([test "x$with_libusb" != "xno"],
89 AS_IF([test "x$with_libusb$HAVE_LIBUSB" = "xyesyes"],
90 [AC_DEFINE([HAVE_LIBUSB], [1], [Define to 1 if libusb is available.])])
92 AS_IF([test "x$with_libusb" != "xyes"],
93 [libusb_msg="no (disabled)"])
95 AS_IF([test "x$with_libusb$HAVE_LIBUSB" = "xyesyes"],
96 [JAYLINK_PKG_LIBS="libusb-1.0"])
98 AM_CONDITIONAL([HAVE_LIBUSB],
99 [test "x$with_libusb$HAVE_LIBUSB" = "xyesyes"])
101 # Libtool interface version is not used for sub-project build as libjaylink is
102 # built as libtool convenience library.
103 AS_IF([test "x$enable_subproject_build" != "xyes"],
104 [JAYLINK_LDFLAGS="-version-info $JAYLINK_VERSION_LIBRARY"])
106 # Use C99 compatible stdio functions on MinGW instead of the incompatible
107 # functions provided by Microsoft.
108 AS_CASE([$host_os], [mingw*],
109 [JAYLINK_CFLAGS="$JAYLINK_CFLAGS -D__USE_MINGW_ANSI_STDIO"])
111 # Add the Winsock2 library on MinGW for socket and other network-related
113 AS_CASE([$host_os], [mingw*], [JAYLINK_LIBS="$JAYLINK_LIBS -lws2_32"])
115 AC_SUBST([JAYLINK_CFLAGS])
116 AC_SUBST([JAYLINK_LDFLAGS])
117 AC_SUBST([JAYLINK_LIBS])
118 AC_SUBST([JAYLINK_PKG_LIBS])
120 AC_CONFIG_FILES([Makefile])
121 AC_CONFIG_FILES([libjaylink/Makefile])
122 AC_CONFIG_FILES([libjaylink/version.h])
123 AC_CONFIG_FILES([libjaylink.pc])
124 AC_CONFIG_FILES([Doxyfile])
129 echo "libjaylink configuration summary:"
130 echo " - Package version ................ $JAYLINK_VERSION_PACKAGE"
131 echo " - Library version ................ $JAYLINK_VERSION_LIBRARY"
132 echo " - Installation prefix ............ $prefix"
133 echo " - Building on .................... $build"
134 echo " - Building for ................... $host"
137 echo "Enabled transports:"
138 echo " - USB ............................ $libusb_msg"
139 echo " - TCP ............................ yes"