]> sigrok.org Git - libsigrokflow.git/blame - configure.ac
Add initial tests/main.cpp (main Catch2 file).
[libsigrokflow.git] / configure.ac
CommitLineData
dbfaa548
UH
1##
2## This file is part of the libsigrokflow project.
3##
4## Copyright (C) 2018 Uwe Hermann <uwe@hermann-uwe.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 3 of the License, or
9## (at your option) any later version.
10##
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.
15##
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/>.
18##
19
20# We require at least autoconf 2.63 (AC_INIT format changed there).
21AC_PREREQ([2.63])
22
23AC_INIT([libsigrokflow], [0.1.0],
24 [sigrok-devel@lists.sourceforge.net],
25 [libsigrokflow], [http://www.sigrok.org])
26AC_CONFIG_MACRO_DIR([m4])
27AC_CONFIG_AUX_DIR([autostuff])
28AC_CONFIG_HEADERS([config.h])
29
30# We require at least automake 1.11 (needed for 'silent rules').
31AM_INIT_AUTOMAKE([1.11 -Wall -Werror no-define nostdinc subdir-objects check-news color-tests])
32AM_SILENT_RULES([yes])
33m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
34
35AC_CANONICAL_HOST
36
37# Checks for programs.
38AC_PROG_CXX
39AC_PROG_INSTALL
40AC_PROG_LN_S
41
42# Get compiler versions.
43SR_PROG_VERSION([$CXX], [srf_cxx_version])
44
45# Check for optional make features.
46SR_PROG_MAKE_ORDER_ONLY
47
48# Initialize libtool.
49LT_INIT
50
51# Set up the libsigrokflow version defines.
52SR_PKG_VERSION_SET([SRF_PACKAGE_VERSION], [AC_PACKAGE_VERSION])
53
54# Library version for libsigrokflow (NOT the same as the package version).
55# Carefully read the libtool docs before updating these numbers!
56# The algorithm for determining which number to change (and how) is nontrivial!
57# http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
58# Format: current:revision:age.
59SR_LIB_VERSION_SET([SRF_LIB_VERSION], [0:0:0])
60
61# Initialize pkg-config.
62# We require at least 0.22, as "Requires.private" behaviour changed there.
63PKG_PROG_PKG_CONFIG([0.22])
64
1060e9b5
UH
65# Keep track of all checked modules so we can list them at the end.
66SR_PKG_CHECK_SUMMARY([srf_pkglibs_summary])
67
68# Collect the pkg-config module names of all dependencies in SRF_PKGLIBS.
69# These are used to derive the compiler flags and for the "Requires.private"
70# field in the generated libsigrokflow.pc file.
71SR_VAR_OPT_PKG([SRF_PKGLIBS], [srf_deps_avail])
72
73SR_ARG_OPT_PKG([libsigrokcxx], [LIBSIGROKCXX], , [libsigrokcxx >= 0.5.1])
45e6e688 74SR_ARG_OPT_PKG([libsigrokdecode], [LIBSIGROKDECODE], , [libsigrokdecode >= 0.5.1])
1060e9b5 75
dbfaa548 76AC_LANG([C++])
374fd24f 77SR_ARG_ENABLE_WARNINGS([SRF_WXXFLAGS], [-Wall], [-Wall -Wextra -Wformat-security])
dbfaa548
UH
78
79# Check if the C++ compiler supports the C++11 standard.
80AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
81
82##############################
83## Finalize configuration ##
84##############################
85
81c16ddc
UH
86# Add mandatory dependencies to module list.
87SR_APPEND([SRF_PKGLIBS], ['gstreamermm-1.0 >= 1.8.0'])
88AC_SUBST([SRF_PKGLIBS])
89
90# Retrieve the compile and link flags for all modules combined.
91# Also, bail out at this point if any module dependency is not met.
92PKG_CHECK_MODULES([LIBSIGROKFLOW], [$SRF_PKGLIBS])
93
94srf_gstreamermm_version=`$PKG_CONFIG --modversion gstreamermm-1.0 2>&AS_MESSAGE_LOG_FD`
95
dbfaa548
UH
96AC_CONFIG_FILES([Makefile libsigrokflow.pc])
97
98AC_OUTPUT
99
100cat >&AS_MESSAGE_FD <<_EOF
101
102libsigrokflow configuration summary:
103 - Package version................. $SRF_PACKAGE_VERSION
104 - Library ABI version............. $SRF_LIB_VERSION
105 - Prefix.......................... $prefix
106 - Building on..................... $build
107 - Building for.................... $host
108 - Building shared / static........ $enable_shared / $enable_static
109
110Compile configuration:
111 - C++ compiler.................... $CXX
112 - C++ compiler version............ $srf_cxx_version
113 - C++ compiler flags.............. $CXXFLAGS
114 - C++ compiler warnings........... $SRF_WXXFLAGS
115 - Linker flags.................... $LDFLAGS
116
7fc14c7d 117Detected libraries (required):
81c16ddc 118 - gstreamermm >= 1.8.0 ........... $srf_gstreamermm_version
7fc14c7d 119
1060e9b5
UH
120Detected libraries (optional):
121$srf_pkglibs_summary
122
dbfaa548 123_EOF