Skip to content

Commit

Permalink
erts: Fix various autoconf issues
Browse files Browse the repository at this point in the history
* Check of atomics on bsd
* Add --enable-systemd for epmd
* Remove unused --enable-tsp option
  • Loading branch information
garazdawi committed May 9, 2014
1 parent 07b8f44 commit 12cd5e5
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 35 deletions.
4 changes: 2 additions & 2 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
[Define if you have the "ose_spi/ose_spi.h" header file.]))
;;
esac
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
case $host_os in
openbsd*)
# The default stack size is insufficient for our needs
Expand Down Expand Up @@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
dnl
dnl Check for functions
dnl
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
AC_CHECK_FUNC(pthread_spin_lock, \
[ethr_have_native_spinlock=yes \
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \
Expand Down
4 changes: 2 additions & 2 deletions erts/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
[Define if you have the "ose_spi/ose_spi.h" header file.]))
;;
esac
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
case $host_os in
openbsd*)
# The default stack size is insufficient for our needs
Expand Down Expand Up @@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
dnl
dnl Check for functions
dnl
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
AC_CHECK_FUNC(pthread_spin_lock, \
[ethr_have_native_spinlock=yes \
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \
Expand Down
52 changes: 32 additions & 20 deletions erts/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ AC_ARG_ENABLE(native-libs,
AS_HELP_STRING([--enable-native-libs],
[compile Erlang libraries to native code]))

AC_ARG_ENABLE(tsp,
AS_HELP_STRING([--enable-tsp], [compile tsp app]))

AC_ARG_ENABLE(fp-exceptions,
AS_HELP_STRING([--enable-fp-exceptions],
[use hardware floating point exceptions (default if hipe enabled)]),
Expand Down Expand Up @@ -366,6 +363,11 @@ AC_DEFINE_UNQUOTED(ASSUMED_CACHE_LINE_SIZE,
$with_assumed_cache_line_size,
[Assumed cache-line size (in bytes)])

AC_ARG_ENABLE(systemd,
AS_HELP_STRING([--enable-systemd], [enable systemd support in epmd]),
[],
[enable_systemd=no])

dnl Magic test for clearcase.
OTP_RELEASE=
if test "${ERLANG_COMMERCIAL_BUILD}" != ""; then
Expand Down Expand Up @@ -456,10 +458,10 @@ AS_HELP_STRING([--enable-static-drivers], [comma seperated list of linked-in dri
AC_SUBST(STATIC_DRIVERS)

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

if test X"$with_ets_write_concurrency_locks" != X""; then
AC_DEFINE_UNQUOTED(ERTS_DB_HASH_LOCK_CNT,$with_ets_write_concurrency_locks,
Expand Down Expand Up @@ -1042,8 +1044,6 @@ AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(inet, main)
AC_CHECK_LIB(util, openpty)

AC_CHECK_LIB(systemd-daemon, sd_listen_fds)

dnl Try to find a thread library.
dnl
dnl ETHR_LIB_NAME, ETHR_LIBS, ETHR_X_LIBS, ETHR_THR_LIB_BASE and ETHR_DEFS
Expand Down Expand Up @@ -1679,7 +1679,29 @@ AC_CHECK_MEMBERS([struct ifreq.ifr_enaddr], [], [],
#endif
])

AC_CHECK_HEADERS(systemd/sd-daemon.h)
dnl ----------------------------------------------------------------------
dnl Check the availability of systemd
dnl ----------------------------------------------------------------------
if test x"$enable_systemd" != x"no"; then

systemd_daemon_save_LIBS=$LIBS
LIBS=
AC_SEARCH_LIBS(sd_listen_fds,[systemd systemd-daemon],
[have_sd_listen_fds=yes],[have_sd_listen_fds=no],$systemd_daemon_save_LIBS)
AC_CHECK_HEADERS(systemd/sd-daemon.h,
[have_systemd_sd_daemon_h=yes],[have_systemd_sd_daemon_h=no])

if test x"$have_sd_listen_fds" = x"yes" && \
test x"$have_systemd_sd_daemon_h" = x"yes"; then
AC_DEFINE([HAVE_SYSTEMD_DAEMON],[1],[Define if you have systemd daemon])
SYSTEMD_DAEMON_LIBS=$LIBS
elif test x"$enable_systemd" = x"yes"; then
AC_MSG_FAILURE([--enable-systemd was given, but test for systemd failed])
fi
LIBS=$systemd_daemon_save_LIBS
fi
AC_SUBST(SYSTEMD_DAEMON_LIBS)


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

#
# Check if we should compile TSP app
#

TSP_APP=
if test X${enable_tsp} = Xyes; then
TSP_APP=tsp
fi
AC_SUBST(TSP_APP)

#
# Check if we should enable HiPE.
#
Expand Down
2 changes: 1 addition & 1 deletion erts/epmd/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ LD = @LD@
ifeq ($(findstring ose,$(TARGET)),ose)
LIBS = $(ERTS_INTERNAL_LIBS) @LIBS@
else
LIBS = @LIBS@ $(ERTS_INTERNAL_LIBS)
LIBS = @LIBS@ @SYSTEMD_DAEMON_LIBS@ $(ERTS_INTERNAL_LIBS)
endif
LDFLAGS = @LDFLAGS@

Expand Down
4 changes: 2 additions & 2 deletions erts/epmd/src/epmd_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void run(EpmdVars *g)
node_init(g);
g->conn = conn_init(g);

#ifdef HAVE_SYSTEMD_SD_DAEMON_H
#ifdef HAVE_SYSTEMD_DAEMON
if (g->is_systemd)
{
int n;
Expand Down Expand Up @@ -310,7 +310,7 @@ void run(EpmdVars *g)
SET_ADDR(iserv_addr[0],EPMD_ADDR_ANY,sport);
num_sockets = 1;
}
#ifdef HAVE_SYSTEMD_SD_DAEMON_H
#ifdef HAVE_SYSTEMD_DAEMON
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions lib/erl_interface/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
[Define if you have the "ose_spi/ose_spi.h" header file.]))
;;
esac
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
case $host_os in
openbsd*)
# The default stack size is insufficient for our needs
Expand Down Expand Up @@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
dnl
dnl Check for functions
dnl
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
AC_CHECK_FUNC(pthread_spin_lock, \
[ethr_have_native_spinlock=yes \
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \
Expand Down
4 changes: 2 additions & 2 deletions lib/megaco/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
[Define if you have the "ose_spi/ose_spi.h" header file.]))
;;
esac
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
case $host_os in
openbsd*)
# The default stack size is insufficient for our needs
Expand Down Expand Up @@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
dnl
dnl Check for functions
dnl
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
AC_CHECK_FUNC(pthread_spin_lock, \
[ethr_have_native_spinlock=yes \
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \
Expand Down
4 changes: 2 additions & 2 deletions lib/odbc/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
[Define if you have the "ose_spi/ose_spi.h" header file.]))
;;
esac
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
case $host_os in
openbsd*)
# The default stack size is insufficient for our needs
Expand Down Expand Up @@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
dnl
dnl Check for functions
dnl
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
AC_CHECK_FUNC(pthread_spin_lock, \
[ethr_have_native_spinlock=yes \
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \
Expand Down
4 changes: 2 additions & 2 deletions lib/wx/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ case "$THR_LIB_NAME" in
[Define if you have the "ose_spi/ose_spi.h" header file.]))
;;
esac
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
case $host_os in
openbsd*)
# The default stack size is insufficient for our needs
Expand Down Expand Up @@ -1222,7 +1222,7 @@ case "$THR_LIB_NAME" in
dnl
dnl Check for functions
dnl
if test "x$THR_LIB_NAME" == "xpthread"; then
if test "x$THR_LIB_NAME" = "xpthread"; then
AC_CHECK_FUNC(pthread_spin_lock, \
[ethr_have_native_spinlock=yes \
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \
Expand Down

0 comments on commit 12cd5e5

Please sign in to comment.