Skip to content

Commit f85f63c

Browse files
committed
build/CI/packaging: modernize autotools files
Fix warnings about obsolete/deprecated features reported by modern autotools. Also updates third-party m4 macros.
1 parent de18a03 commit f85f63c

File tree

9 files changed

+1099
-77
lines changed

9 files changed

+1099
-77
lines changed

configure.ac

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Process this file with autoconf to produce a configure script.
22

3-
AC_PREREQ(2.63)
4-
AC_INIT([sysbench],[1.1.0],[https://github.com/akopytov/sysbench/issues],
5-
[sysbench], [https://github.com/akopytov/sysbench])
3+
AC_PREREQ([2.72])
4+
AC_INIT([sysbench],[1.1.0],[https://github.com/akopytov/sysbench/issues],[sysbench],[https://github.com/akopytov/sysbench])
65
AC_CONFIG_AUX_DIR([config])
76

87
# Define m4_ifblank and m4_ifnblank macros from introduced in
@@ -31,7 +30,7 @@ CXXFLAGS=${SAVE_CXXFLAGS}
3130

3231
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
3332
AC_CONFIG_SRCDIR([src/sysbench.c])
34-
AC_CONFIG_HEADER([config/config.h])
33+
AC_CONFIG_HEADERS([config/config.h])
3534
AC_CONFIG_MACRO_DIR([m4])
3635

3736
m4_pattern_forbid([^PKG_[A-Z_]+$],
@@ -40,7 +39,6 @@ m4_pattern_forbid([^PKG_[A-Z_]+$],
4039
ACX_USE_SYSTEM_EXTENSIONS
4140

4241
AC_PROG_CC
43-
AC_PROG_CC_C99
4442
AC_PROG_CPP
4543
AM_PROG_CC_C_O
4644

@@ -58,7 +56,7 @@ AS_CASE([$CFLAGS],
5856

5957
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
6058

61-
AC_PROG_LIBTOOL
59+
LT_INIT
6260

6361
AC_CHECK_PROG(sb_have_pkg_config, pkg-config, yes, no)
6462
if test x"$sb_have_pkg_config" = xno; then
@@ -199,9 +197,6 @@ AC_SUBST([USE_PGSQL])
199197
AC_CHECK_AIO
200198
AM_CONDITIONAL(USE_AIO, test x$enable_aio = xyes)
201199

202-
# Checks for header files.
203-
AC_HEADER_STDC
204-
205200
AC_CHECK_HEADERS([ \
206201
errno.h \
207202
fcntl.h \
@@ -225,7 +220,7 @@ libgen.h \
225220

226221
# Checks for typedefs, structures, and compiler characteristics.
227222
AC_TYPE_OFF_T
228-
AC_HEADER_TIME
223+
229224
AX_TLS([],
230225
AC_MSG_ERROR([thread-local storage is not suppored by the target platform!])
231226
)

m4/ac_check_pgsql.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ AC_DEFUN([AC_CHECK_PGSQL],[
1010
if test [ -z "$ac_cv_pgsql_includes" ]
1111
then
1212
AC_ARG_WITH([pgsql-includes],
13-
AC_HELP_STRING([--with-pgsql-includes], [path to PostgreSQL header files]),
13+
AS_HELP_STRING([--with-pgsql-includes], [path to PostgreSQL header files]),
1414
[ac_cv_pgsql_includes=$withval])
1515
fi
1616
if test [ -n "$ac_cv_pgsql_includes" ]
@@ -24,7 +24,7 @@ fi
2424
if test [ -z "$ac_cv_pgsql_libs" ]
2525
then
2626
AC_ARG_WITH([pgsql-libs],
27-
AC_HELP_STRING([--with-pgsql-libs], [path to PostgreSQL libraries]),
27+
AS_HELP_STRING([--with-pgsql-libs], [path to PostgreSQL libraries]),
2828
[ac_cv_pgsql_libs=$withval])
2929
fi
3030

m4/ax_tls.m4

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,28 @@
4444
# modified version of the Autoconf Macro, you may extend this special
4545
# exception to the GPL to apply to your modified version as well.
4646

47-
#serial 14
47+
#serial 15
4848

4949
AC_DEFUN([AX_TLS], [
5050
AC_MSG_CHECKING([for thread local storage (TLS) class])
5151
AC_CACHE_VAL([ac_cv_tls],
5252
[for ax_tls_keyword in thread_local _Thread_local __thread '__declspec(thread)' none; do
5353
AS_CASE([$ax_tls_keyword],
5454
[none], [ac_cv_tls=none ; break],
55-
[AC_TRY_COMPILE(
56-
[#include <stdlib.h>
57-
static void
58-
foo(void) {
59-
static ] $ax_tls_keyword [ int bar;
60-
exit(1);
61-
}],
62-
[],
63-
[ac_cv_tls=$ax_tls_keyword ; break],
64-
ac_cv_tls=none
65-
)])
66-
done
67-
])
55+
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
56+
[#include <stdlib.h>],
57+
[static $ax_tls_keyword int bar;]
58+
)],
59+
[ac_cv_tls=$ax_tls_keyword ; break],
60+
[ac_cv_tls=none]
61+
)]
62+
)
63+
done ]
64+
)
6865
AC_MSG_RESULT([$ac_cv_tls])
6966
7067
AS_IF([test "$ac_cv_tls" != "none"],
71-
[AC_DEFINE_UNQUOTED([TLS],[$ac_cv_tls],[If the compiler supports a TLS storage class define it to that here])
72-
m4_ifnblank([$1],[$1])],
73-
[m4_ifnblank([$2],[$2])])
68+
[AC_DEFINE_UNQUOTED([TLS],[$ac_cv_tls],[If the compiler supports a TLS storage class, define it to that here])
69+
m4_ifnblank([$1],[$1],[[:]])],
70+
[m4_ifnblank([$2],[$2],[[:]])])
7471
])

0 commit comments

Comments
 (0)