aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-04-28 15:12:05 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-04-28 15:12:05 +0200
commit06a429d0148c94c35f3e4e226714299dc03af5eb (patch)
tree0cab2eaa230e6101f537c0e4d086ff5877cb800d /configure.ac
downloadODR-EDI2EDI-06a429d0148c94c35f3e4e226714299dc03af5eb.tar.gz
ODR-EDI2EDI-06a429d0148c94c35f3e4e226714299dc03af5eb.tar.bz2
ODR-EDI2EDI-06a429d0148c94c35f3e4e226714299dc03af5eb.zip
Initial commitv0.0.1
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac67
1 files changed, 67 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..5f77dd8
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,67 @@
+# Copyright (C) 2019 Matthias P. Braendli, http://opendigitalradio.org
+
+
+AC_PREREQ(2.69)
+AC_INIT([ODR-EDI2EDI], [0.0.1], [matthias.braendli@mpb.li])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CANONICAL_SYSTEM
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
+AC_CONFIG_SRCDIR([src/main.cpp])
+AC_CONFIG_HEADER([config.h])
+AM_SILENT_RULES([yes])
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+
+AX_CXX_COMPILE_STDCXX(11,noext,mandatory)
+
+# Checks for libraries.
+AX_PTHREAD([], AC_MSG_ERROR([requires pthread]))
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
+
+AC_LANG_PUSH([C++])
+AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], [CXXFLAGS="$CXXFLAGS -Wduplicated-cond"], [], ["-Werror"])
+AX_CHECK_COMPILE_FLAG([-Wduplicated-branches], [CXXFLAGS="$CXXFLAGS -Wduplicated-branches"], [], ["-Werror"])
+AX_CHECK_COMPILE_FLAG([-Wlogical-op], [CXXFLAGS="$CXXFLAGS -Wlogical-op"], [], ["-Werror"])
+AX_CHECK_COMPILE_FLAG([-Wrestrict], [CXXFLAGS="$CXXFLAGS -Wrestrict"], [], ["-Werror"])
+AX_CHECK_COMPILE_FLAG([-Wdouble-promotion], [CXXFLAGS="$CXXFLAGS -Wdouble-promotion"], [], ["-Werror"])
+AX_CHECK_COMPILE_FLAG(["-Wformat=2"], [CXXFLAGS="$CXXFLAGS -Wformat=2"], [], ["-Werror"])
+
+# Linux defines MSG_NOSIGNAL, some other systems have SO_NOSIGPIPE instead
+AC_MSG_CHECKING(for MSG_NOSIGNAL)
+AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
+ #include <sys/socket.h>
+ int f = MSG_NOSIGNAL;
+ ]])],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Define this symbol if you have MSG_NOSIGNAL]) ],
+ [ AC_MSG_RESULT(no) ])
+
+AC_MSG_CHECKING(for SO_NOSIGPIPE)
+AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
+ #include <sys/socket.h>
+ int f = SO_NOSIGPIPE;
+ ]])],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SO_NOSIGPIPE, 1, [Define this symbol if you have SO_NOSIGPIPE]) ],
+ [ AC_MSG_RESULT(no) ])
+
+AC_LANG_POP([C++])
+
+AM_CONDITIONAL([IS_GIT_REPO], [test -d '.git'])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+
+
+
+echo "***********************************************"
+echo "Configured, please run make"
+echo