forked from wmbusmeters/wmbusmeters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
72 lines (58 loc) · 2.13 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright (C) 2020 Fredrik Öhrström
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
AC_PREREQ([2.69])
AC_INIT(wmbusmeters, wmbusmeters, [email protected],,https://github.com/wmbusmeters/wmbusmeters)
AC_CONFIG_AUX_DIR([autoconf])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
m4_include([autoconf/pkg.m4])
PKG_PREREQ(0.29)
SRC_ROOT="$(pwd -L)"
CONF_NAME="${host_cpu}-${host_vendor}-${host_os}"
BUILD_ROOT="$SRC_ROOT/build"
OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}"
mkdir -p "$OUTPUT_ROOT"
AC_LANG_PUSH([C++])
case $host_os in
freebsd*)
CFLAGS="$CFLAGS -I/usr/local/include"
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
darwin*)
CFLAGS="$CFLAGS -I/usr/local/include -I/opt/homebrew/include"
CXXFLAGS="$CXXFLAGS -I/usr/local/include -I/opt/homebrew/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib -L/opt/homebrew/lib"
;;
esac
#C_CHECK_LIB(usb, usb_init, [],
#
# C_MSG_ERROR([Could not find libusb library. Try: sudo apt install libusb-dev])
#)
AC_CHECK_LIB(rtlsdr, rtlsdr_get_device_count, [],
[
AC_MSG_ERROR([Could not find rtlsdr library. Try: sudo apt install librtlsdr-dev])
])
AC_CHECK_LIB(xml2, xmlFreeDoc, [],
[
AC_MSG_ERROR([Could not find libxml2 library. Try: sudo apt install libxml2-dev])
])
AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$SRC_ROOT/autoconf/spec.gmk.in])
AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$SRC_ROOT/autoconf/Makefile.in])
# Make sure config.status ends up in the build directory instead of the src root.
CONFIG_STATUS="$OUTPUT_ROOT/config.status"
# Write out spec.gmk and build/Makefile
AC_OUTPUT