2020-09-27 17:40:05 +00:00
|
|
|
# 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])
|
2023-03-11 15:43:07 +00:00
|
|
|
AC_INIT(wmbusmeters, wmbusmeters, oehrstroem@gmail.com,,https://github.com/wmbusmeters/wmbusmeters)
|
2020-09-27 17:40:05 +00:00
|
|
|
|
2020-12-28 16:21:40 +00:00
|
|
|
AC_CONFIG_AUX_DIR([autoconf])
|
2020-09-27 17:40:05 +00:00
|
|
|
AC_CANONICAL_BUILD
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
2020-12-28 16:21:40 +00:00
|
|
|
m4_include([autoconf/pkg.m4])
|
|
|
|
|
|
|
|
PKG_PREREQ(0.29)
|
|
|
|
|
2020-09-27 17:40:05 +00:00
|
|
|
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++])
|
|
|
|
|
2020-11-28 13:18:18 +00:00
|
|
|
case $host_os in
|
|
|
|
freebsd*)
|
|
|
|
CFLAGS="$CFLAGS -I/usr/local/include"
|
|
|
|
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
2024-05-27 22:27:27 +00:00
|
|
|
;;
|
2024-05-27 22:16:08 +00:00
|
|
|
darwin*)
|
|
|
|
CFLAGS="$CFLAGS -I/usr/local/include -I/opt/homebrew/include"
|
|
|
|
CXXFLAGS="$CXXFLAGS -I/usr/local/include -I/opt/homebrew/include"
|
2024-05-27 22:27:27 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L/usr/local/lib -L/opt/homebrew/lib"
|
2020-11-28 13:18:18 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-10-24 15:14:39 +00:00
|
|
|
#C_CHECK_LIB(usb, usb_init, [],
|
|
|
|
#
|
|
|
|
# C_MSG_ERROR([Could not find libusb library. Try: sudo apt install libusb-dev])
|
|
|
|
#)
|
2020-09-27 17:40:05 +00:00
|
|
|
|
|
|
|
AC_CHECK_LIB(rtlsdr, rtlsdr_get_device_count, [],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([Could not find rtlsdr library. Try: sudo apt install librtlsdr-dev])
|
|
|
|
])
|
|
|
|
|
2023-10-13 14:30:29 +00:00
|
|
|
AC_CHECK_LIB(xml2, xmlFreeDoc, [],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([Could not find libxml2 library. Try: sudo apt install libxml2-dev])
|
|
|
|
])
|
|
|
|
|
2020-09-27 17:40:05 +00:00
|
|
|
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
|