aboutsummaryrefslogtreecommitdiffstats
path: root/erts/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'erts/configure.in')
-rw-r--r--erts/configure.in46
1 files changed, 41 insertions, 5 deletions
diff --git a/erts/configure.in b/erts/configure.in
index 5f969a0a8b..506ce0d0fb 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. -*-m4-*-
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1997-2018. All Rights Reserved.
+dnl Copyright Ericsson AB 1997-2019. All Rights Reserved.
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
@@ -590,6 +590,22 @@ AC_SUBST(WERRORFLAGS)
## Check if we can do profile guided optimization of beam_emu
LM_CHECK_ENABLE_CFLAG([-fprofile-generate -Werror],[PROFILE_GENERATE])
LM_CHECK_ENABLE_CFLAG([-fprofile-use -Werror],[PROFILE_USE])
+LM_CHECK_ENABLE_CFLAG([-fprofile-use -fprofile-correction -Werror],[PROFILE_CORRECTION])
+
+if test "X$PROFILE_CORRECTION" = "Xtrue"; then
+ saved_CFLAGS=$CFLAGS
+ saved_LDFLAGS=$LDFLAGS
+ CFLAGS="-fprofile-generate $saved_CFLAGS"
+ LDFLAGS="-fprofile-generate $saved_LDFLAGS"
+ AC_MSG_CHECKING([whether $CC links with -fprofile-generate])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[return 0;])],
+ [AC_MSG_RESULT([yes])
+ PROFILE_GENERATE=true],
+ [AC_MSG_RESULT([no])
+ PROFILE_GENERATE=false])
+ CFLAGS=$saved_CFLAGS
+ LDFLAGS=$saved_LDFLAGS
+fi
## Check if this is clang
LM_CHECK_ENABLE_CFLAG([-fprofile-instr-generate -Werror],[PROFILE_INSTR_GENERATE])
@@ -614,8 +630,8 @@ if test "X$PROFILE_INSTR_GENERATE" = "Xtrue"; then
if test "X$LLVM_PROFDATA" != "X"; then
CFLAGS="-fprofile-instr-use=default.profdata -Werror $saved_CFLAGS";
$LLVM_PROFDATA merge -output=default.profdata *.profraw;
- AC_MSG_CHECKING([whether gcc accepts -fprofile-instr-use=default.profdata -Werror])
- AC_COMPILE_IFELSE([],
+ AC_MSG_CHECKING([whether $CC accepts -fprofile-instr-use=default.profdata -Werror])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[return 0;])],
[AC_MSG_RESULT([yes])
PROFILE_INSTR_USE=true],
[AC_MSG_RESULT([no])
@@ -637,8 +653,6 @@ AS_HELP_STRING([--enable-pgo],
esac
],enable_pgo=default)
-LM_CHECK_ENABLE_CFLAG([-fprofile-use -fprofile-correction -Werror],[PROFILE_CORRECTION])
-
USE_PGO=false
AC_MSG_CHECKING([whether to do PGO of erts])
if test $enable_pgo = no; then
@@ -1329,6 +1343,28 @@ LIBS=$zlib_save_LIBS
fi
AC_SUBST(Z_LIB)
+
+dnl -------------
+dnl esock
+dnl -------------
+
+AC_ARG_ENABLE(esock,
+AS_HELP_STRING([--enable-esock], [enable builtin experimental socket (as a nif) support (default)])
+AS_HELP_STRING([--disable-esock], [disable builtin experimental socket (as a nif) support]))
+
+dnl Default value
+USE_ESOCK=yes
+
+if test "x$enable_esock" = "xyes"; then
+ USE_ESOCK=yes
+else
+ if test "x$enable_esock" = "xno"; then
+ USE_ESOCK=no
+ fi
+fi
+AC_SUBST(USE_ESOCK)
+
+
dnl
dnl This test kindly borrowed from Tcl
dnl