From 4213a111caef9d9258ebf368da4406890478abf9 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Sat, 19 Nov 2022 10:29:46 -0800 Subject: [PATCH] Update build files to work with more modern autotools (#358) * Include missing libboost files in tarball - Closes #355 * Fixes for newer autoconf - Closes #351 * Autoupdate was run on 2.70 but we tested on 2.69 so manually adjusted that. * Testing builds on Ubuntu 22.04 in CI --- .github/workflows/c-cpp.yml | 2 +- Makefile.am | 1 + benchmark/benchmark.h | 7 +------ configure.ac | 14 ++++++-------- gearmand/gearmand.cc | 12 +++--------- gearmand/server_common.h | 12 +++--------- libboost/include.am | 5 +++++ libgearman-server/common.h | 10 ++-------- 8 files changed, 22 insertions(+), 41 deletions(-) create mode 100644 libboost/include.am diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 94861df2f..566032e95 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -25,7 +25,7 @@ jobs: - {name: 'ubtunu-18.04 gcc-8', os: ubuntu-18.04, cc: 'gcc', cxx: 'g++', tag: '8'} - {name: 'ubtunu-20.04 gcc-9', os: ubuntu-20.04, cc: 'gcc', cxx: 'g++', tag: '9'} - {name: 'ubtunu-20.04 gcc-10', os: ubuntu-20.04, cc: 'gcc', cxx: 'g++', tag: '10'} - - {name: 'ubtunu-20.04 gcc-11', os: ubuntu-20.04, cc: 'gcc', cxx: 'g++', tag: '11'} + - {name: 'ubtunu-22.04 gcc-11', os: ubuntu-20.04, cc: 'gcc', cxx: 'g++', tag: '11'} env: CC: ${{ matrix.config.cc }}-${{ matrix.config.tag }} diff --git a/Makefile.am b/Makefile.am index 6b839b259..35893ed40 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,6 +50,7 @@ include benchmark/include.am include bin/include.am include examples/include.am include gearmand/include.am +include libboost/include.am include libgearman-server/include.am include libgearman/include.am include libgearman-1.0/include.am diff --git a/benchmark/benchmark.h b/benchmark/benchmark.h index efa3f14e6..6d30ef708 100644 --- a/benchmark/benchmark.h +++ b/benchmark/benchmark.h @@ -46,15 +46,10 @@ #include -#ifdef TIME_WITH_SYS_TIME -# include + # include -#else # ifdef HAVE_SYS_TIME_H # include -# else -# include -# endif #endif #define GEARMAN_BENCHMARK_DEFAULT_FUNCTION "gb" diff --git a/configure.ac b/configure.ac index 7dadce987..bdfc288f8 100644 --- a/configure.ac +++ b/configure.ac @@ -10,8 +10,8 @@ m4_include([version.m4]) AC_REVISION([m4_esyscmd_s([git describe --always])]) -AC_PREREQ([2.63]) -AC_INIT([gearmand],VERSION_NUMBER,[https://github.com/gearman/gearmand/issues],[gearmand],[http://gearman.info/]) +AC_PREREQ([2.69]) +AC_INIT([gearmand],[VERSION_NUMBER],[https://github.com/gearman/gearmand/issues],[gearmand],[http://gearman.info/]) AC_CONFIG_AUX_DIR([build-aux]) @@ -54,8 +54,7 @@ LT_LIB_M AC_SUBST([lt_cv_dlopen_libs]) -AC_PROG_CC_C99 -AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])]) +# AC_REQUIRE(AC_PROG_CC) AC_DEFUN([CHECK_CXX0X],[ AC_LANG_PUSH([C++]) @@ -136,8 +135,6 @@ AX_PROG_SPHINX_BUILD(,[AC_MSG_WARN([sphinx-build version 1.0 or greater is requi AX_WITH_PROG([LCOV],[lcov]) AX_WITH_PROG([LCOV_GENHTML],[genhtml]) -# Checks for header files. -AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS_ONCE([arpa/inet.h]) AC_CHECK_HEADERS_ONCE([errno.h]) @@ -191,7 +188,8 @@ AC_C_CONST AC_C_INLINE AC_C_VOLATILE AC_HEADER_STDBOOL -AC_HEADER_TIME +AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_TYPE_INT32_T AC_TYPE_INT64_T AC_TYPE_OFF_T @@ -259,7 +257,7 @@ AX_CHECK_WOLFSSL([have_wolfssl=yes],[have_wolfssl=no]) AM_CONDITIONAL([ENABLE_WOLFSSL],[test "x${have_wolfssl}" = "xyes"]) AC_DEFUN([AX_ENABLE_SSL], - [AC_PREREQ([2.63])dnl + [AC_PREREQ([2.69])dnl m4_define([_SSL_ENABLE_DEFAULT], [m4_if($1, no, no, no)])dnl AC_ARG_ENABLE([ssl], [AS_HELP_STRING([--enable-ssl], diff --git a/gearmand/gearmand.cc b/gearmand/gearmand.cc index 2985674b4..9c4005db9 100644 --- a/gearmand/gearmand.cc +++ b/gearmand/gearmand.cc @@ -54,15 +54,9 @@ #include #include -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif +#include +#ifdef HAVE_SYS_TIME_H +#include #endif #include "libgearman-server/gearmand.h" diff --git a/gearmand/server_common.h b/gearmand/server_common.h index dd178578c..774c7de17 100644 --- a/gearmand/server_common.h +++ b/gearmand/server_common.h @@ -41,15 +41,9 @@ #include #endif -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif +#include +#ifdef HAVE_SYS_TIME_H +#include #endif #ifdef HAVE_EVENT_H diff --git a/libboost/include.am b/libboost/include.am new file mode 100644 index 000000000..af218249e --- /dev/null +++ b/libboost/include.am @@ -0,0 +1,5 @@ +# vim:ft=automake +# included from Top Level Makefile.am +# All paths should be given relative to the root + +noinst_HEADERS+= libboost/config/workaround.hpp diff --git a/libgearman-server/common.h b/libgearman-server/common.h index 2f30999ee..aab160111 100644 --- a/libgearman-server/common.h +++ b/libgearman-server/common.h @@ -73,15 +73,9 @@ # include #endif -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H +#include +#ifdef HAVE_SYS_TIME_H # include -# else -# include -# endif #endif #ifdef __cplusplus