Skip to content

Commit 12cd5e5

Browse files
committed
erts: Fix various autoconf issues
* Check of atomics on bsd * Add --enable-systemd for epmd * Remove unused --enable-tsp option
1 parent 07b8f44 commit 12cd5e5

File tree

9 files changed

+47
-35
lines changed

9 files changed

+47
-35
lines changed

aclocal.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
11181118
[Define if you have the "ose_spi/ose_spi.h" header file.]))
11191119
;;
11201120
esac
1121-
if test "x$THR_LIB_NAME" == "xpthread"; then
1121+
if test "x$THR_LIB_NAME" = "xpthread"; then
11221122
case $host_os in
11231123
openbsd*)
11241124
# The default stack size is insufficient for our needs
@@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
12221222
dnl
12231223
dnl Check for functions
12241224
dnl
1225-
if test "x$THR_LIB_NAME" == "xpthread"; then
1225+
if test "x$THR_LIB_NAME" = "xpthread"; then
12261226
AC_CHECK_FUNC(pthread_spin_lock, \
12271227
[ethr_have_native_spinlock=yes \
12281228
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \

erts/aclocal.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
11181118
[Define if you have the "ose_spi/ose_spi.h" header file.]))
11191119
;;
11201120
esac
1121-
if test "x$THR_LIB_NAME" == "xpthread"; then
1121+
if test "x$THR_LIB_NAME" = "xpthread"; then
11221122
case $host_os in
11231123
openbsd*)
11241124
# The default stack size is insufficient for our needs
@@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
12221222
dnl
12231223
dnl Check for functions
12241224
dnl
1225-
if test "x$THR_LIB_NAME" == "xpthread"; then
1225+
if test "x$THR_LIB_NAME" = "xpthread"; then
12261226
AC_CHECK_FUNC(pthread_spin_lock, \
12271227
[ethr_have_native_spinlock=yes \
12281228
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \

erts/configure.in

+32-20
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,6 @@ AC_ARG_ENABLE(native-libs,
214214
AS_HELP_STRING([--enable-native-libs],
215215
[compile Erlang libraries to native code]))
216216

217-
AC_ARG_ENABLE(tsp,
218-
AS_HELP_STRING([--enable-tsp], [compile tsp app]))
219-
220217
AC_ARG_ENABLE(fp-exceptions,
221218
AS_HELP_STRING([--enable-fp-exceptions],
222219
[use hardware floating point exceptions (default if hipe enabled)]),
@@ -366,6 +363,11 @@ AC_DEFINE_UNQUOTED(ASSUMED_CACHE_LINE_SIZE,
366363
$with_assumed_cache_line_size,
367364
[Assumed cache-line size (in bytes)])
368365

366+
AC_ARG_ENABLE(systemd,
367+
AS_HELP_STRING([--enable-systemd], [enable systemd support in epmd]),
368+
[],
369+
[enable_systemd=no])
370+
369371
dnl Magic test for clearcase.
370372
OTP_RELEASE=
371373
if test "${ERLANG_COMMERCIAL_BUILD}" != ""; then
@@ -456,10 +458,10 @@ AS_HELP_STRING([--enable-static-drivers], [comma seperated list of linked-in dri
456458
AC_SUBST(STATIC_DRIVERS)
457459

458460
AC_ARG_WITH(ets-write-concurrency-locks,
459-
AS_HELP_STRING([--with-ets-write-concurrency-locks={8,16,32,64,128,256}],
460-
[specify how many locks the write_concurrency option for ets should use.])
461-
AS_HELP_STRING([--without-ets-write-concurrency-locks],
462-
[use the default number of write_concurrency locks (default)]))
461+
AS_HELP_STRING([--with-ets-write-concurrency-locks={8|16|32|64|128|256}],
462+
[specify how many locks the write_concurrency option for ets should use.])
463+
AS_HELP_STRING([--without-ets-write-concurrency-locks],
464+
[use the default number of write_concurrency locks (default)]))
463465

464466
if test X"$with_ets_write_concurrency_locks" != X""; then
465467
AC_DEFINE_UNQUOTED(ERTS_DB_HASH_LOCK_CNT,$with_ets_write_concurrency_locks,
@@ -1042,8 +1044,6 @@ AC_CHECK_LIB(dl, dlopen)
10421044
AC_CHECK_LIB(inet, main)
10431045
AC_CHECK_LIB(util, openpty)
10441046

1045-
AC_CHECK_LIB(systemd-daemon, sd_listen_fds)
1046-
10471047
dnl Try to find a thread library.
10481048
dnl
10491049
dnl ETHR_LIB_NAME, ETHR_LIBS, ETHR_X_LIBS, ETHR_THR_LIB_BASE and ETHR_DEFS
@@ -1679,7 +1679,29 @@ AC_CHECK_MEMBERS([struct ifreq.ifr_enaddr], [], [],
16791679
#endif
16801680
])
16811681

1682-
AC_CHECK_HEADERS(systemd/sd-daemon.h)
1682+
dnl ----------------------------------------------------------------------
1683+
dnl Check the availability of systemd
1684+
dnl ----------------------------------------------------------------------
1685+
if test x"$enable_systemd" != x"no"; then
1686+
1687+
systemd_daemon_save_LIBS=$LIBS
1688+
LIBS=
1689+
AC_SEARCH_LIBS(sd_listen_fds,[systemd systemd-daemon],
1690+
[have_sd_listen_fds=yes],[have_sd_listen_fds=no],$systemd_daemon_save_LIBS)
1691+
AC_CHECK_HEADERS(systemd/sd-daemon.h,
1692+
[have_systemd_sd_daemon_h=yes],[have_systemd_sd_daemon_h=no])
1693+
1694+
if test x"$have_sd_listen_fds" = x"yes" && \
1695+
test x"$have_systemd_sd_daemon_h" = x"yes"; then
1696+
AC_DEFINE([HAVE_SYSTEMD_DAEMON],[1],[Define if you have systemd daemon])
1697+
SYSTEMD_DAEMON_LIBS=$LIBS
1698+
elif test x"$enable_systemd" = x"yes"; then
1699+
AC_MSG_FAILURE([--enable-systemd was given, but test for systemd failed])
1700+
fi
1701+
LIBS=$systemd_daemon_save_LIBS
1702+
fi
1703+
AC_SUBST(SYSTEMD_DAEMON_LIBS)
1704+
16831705

16841706
dnl ----------------------------------------------------------------------
16851707
dnl Check the availability for libdlpi
@@ -3431,16 +3453,6 @@ dnl Tests related to configurable options given on command line
34313453
dnl (using the --disable, --enable and --with switches).
34323454
dnl ----------------------------------------------------------------------
34333455

3434-
#
3435-
# Check if we should compile TSP app
3436-
#
3437-
3438-
TSP_APP=
3439-
if test X${enable_tsp} = Xyes; then
3440-
TSP_APP=tsp
3441-
fi
3442-
AC_SUBST(TSP_APP)
3443-
34443456
#
34453457
# Check if we should enable HiPE.
34463458
#

erts/epmd/src/Makefile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ LD = @LD@
8484
ifeq ($(findstring ose,$(TARGET)),ose)
8585
LIBS = $(ERTS_INTERNAL_LIBS) @LIBS@
8686
else
87-
LIBS = @LIBS@ $(ERTS_INTERNAL_LIBS)
87+
LIBS = @LIBS@ @SYSTEMD_DAEMON_LIBS@ $(ERTS_INTERNAL_LIBS)
8888
endif
8989
LDFLAGS = @LDFLAGS@
9090

erts/epmd/src/epmd_srv.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void run(EpmdVars *g)
213213
node_init(g);
214214
g->conn = conn_init(g);
215215

216-
#ifdef HAVE_SYSTEMD_SD_DAEMON_H
216+
#ifdef HAVE_SYSTEMD_DAEMON
217217
if (g->is_systemd)
218218
{
219219
int n;
@@ -310,7 +310,7 @@ void run(EpmdVars *g)
310310
SET_ADDR(iserv_addr[0],EPMD_ADDR_ANY,sport);
311311
num_sockets = 1;
312312
}
313-
#ifdef HAVE_SYSTEMD_SD_DAEMON_H
313+
#ifdef HAVE_SYSTEMD_DAEMON
314314
}
315315
#endif
316316

lib/erl_interface/aclocal.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
11181118
[Define if you have the "ose_spi/ose_spi.h" header file.]))
11191119
;;
11201120
esac
1121-
if test "x$THR_LIB_NAME" == "xpthread"; then
1121+
if test "x$THR_LIB_NAME" = "xpthread"; then
11221122
case $host_os in
11231123
openbsd*)
11241124
# The default stack size is insufficient for our needs
@@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
12221222
dnl
12231223
dnl Check for functions
12241224
dnl
1225-
if test "x$THR_LIB_NAME" == "xpthread"; then
1225+
if test "x$THR_LIB_NAME" = "xpthread"; then
12261226
AC_CHECK_FUNC(pthread_spin_lock, \
12271227
[ethr_have_native_spinlock=yes \
12281228
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \

lib/megaco/aclocal.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
11181118
[Define if you have the "ose_spi/ose_spi.h" header file.]))
11191119
;;
11201120
esac
1121-
if test "x$THR_LIB_NAME" == "xpthread"; then
1121+
if test "x$THR_LIB_NAME" = "xpthread"; then
11221122
case $host_os in
11231123
openbsd*)
11241124
# The default stack size is insufficient for our needs
@@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
12221222
dnl
12231223
dnl Check for functions
12241224
dnl
1225-
if test "x$THR_LIB_NAME" == "xpthread"; then
1225+
if test "x$THR_LIB_NAME" = "xpthread"; then
12261226
AC_CHECK_FUNC(pthread_spin_lock, \
12271227
[ethr_have_native_spinlock=yes \
12281228
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \

lib/odbc/aclocal.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
11181118
[Define if you have the "ose_spi/ose_spi.h" header file.]))
11191119
;;
11201120
esac
1121-
if test "x$THR_LIB_NAME" == "xpthread"; then
1121+
if test "x$THR_LIB_NAME" = "xpthread"; then
11221122
case $host_os in
11231123
openbsd*)
11241124
# The default stack size is insufficient for our needs
@@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
12221222
dnl
12231223
dnl Check for functions
12241224
dnl
1225-
if test "x$THR_LIB_NAME" == "xpthread"; then
1225+
if test "x$THR_LIB_NAME" = "xpthread"; then
12261226
AC_CHECK_FUNC(pthread_spin_lock, \
12271227
[ethr_have_native_spinlock=yes \
12281228
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \

lib/wx/aclocal.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
11181118
[Define if you have the "ose_spi/ose_spi.h" header file.]))
11191119
;;
11201120
esac
1121-
if test "x$THR_LIB_NAME" == "xpthread"; then
1121+
if test "x$THR_LIB_NAME" = "xpthread"; then
11221122
case $host_os in
11231123
openbsd*)
11241124
# The default stack size is insufficient for our needs
@@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
12221222
dnl
12231223
dnl Check for functions
12241224
dnl
1225-
if test "x$THR_LIB_NAME" == "xpthread"; then
1225+
if test "x$THR_LIB_NAME" = "xpthread"; then
12261226
AC_CHECK_FUNC(pthread_spin_lock, \
12271227
[ethr_have_native_spinlock=yes \
12281228
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \

0 commit comments

Comments
 (0)