aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
Diffstat (limited to 'erts')
-rw-r--r--erts/aclocal.m449
-rw-r--r--erts/configure.in48
2 files changed, 78 insertions, 19 deletions
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index 8002ed3d34..8052b2d67d 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -42,11 +42,16 @@ AC_ARG_VAR(CXX, [C++ compiler])
AC_ARG_VAR(CXXFLAGS, [C++ compiler flags])
AC_ARG_VAR(LD, [linker (is often overridden by configure)])
AC_ARG_VAR(LDFLAGS, [linker flags (can be risky to set since LD may be overriden by configure)])
+AC_ARG_VAR(LIBS, [libraries])
AC_ARG_VAR(DED_LD, [linker for Dynamic Erlang Drivers (set all DED_LD* variables or none)])
AC_ARG_VAR(DED_LDFLAGS, [linker flags for Dynamic Erlang Drivers (set all DED_LD* variables or none)])
AC_ARG_VAR(DED_LD_FLAG_RUNTIME_LIBRARY_PATH, [runtime library path linker flag for Dynamic Erlang Drivers (set all DED_LD* variables or none)])
+AC_ARG_VAR(LFS_CFLAGS, [large file support C compiler flags (set all LFS_* variables or none)])
+AC_ARG_VAR(LFS_LDFLAGS, [large file support linker flags (set all LFS_* variables or none)])
+AC_ARG_VAR(LFS_LIBS, [large file support libraries (set all LFS_* variables or none)])
AC_ARG_VAR(RANLIB, [ranlib])
AC_ARG_VAR(AR, [ar])
+AC_ARG_VAR(GETCONF, [getconf])
dnl Cross system root
AC_ARG_VAR(erl_xcomp_sysroot, [Absolute cross system root path (only used when cross compiling)])
@@ -82,6 +87,29 @@ else
fi
])
+AC_DEFUN(LM_CHECK_GETCONF,
+[
+if test "$cross_compiling" != "yes"; then
+ AC_CHECK_PROG([GETCONF], [getconf], [getconf], [false])
+else
+ dnl First check if we got a `<HOST>-getconf' in $PATH
+ host_getconf="$host_alias-getconf"
+ AC_CHECK_PROG([GETCONF], [$host_getconf], [$host_getconf], [false])
+ if test "$GETCONF" = "false" && test "$erl_xcomp_sysroot" != ""; then
+ dnl We should perhaps give up if we have'nt found it by now, but at
+ dnl least in one Tilera MDE `getconf' under sysroot is a bourne
+ dnl shell script which we can use. We try to find `<HOST>-getconf'
+ dnl or `getconf' under sysconf, but only under sysconf since
+ dnl `getconf' in $PATH is almost guaranteed to be for the build
+ dnl machine.
+ GETCONF=
+ prfx="$erl_xcomp_sysroot"
+ AC_PATH_TOOL([GETCONF], [getconf], [false],
+ ["$prfx/usr/bin:$prfx/bin:$prfx/usr/local/bin"])
+ fi
+fi
+])
+
dnl ----------------------------------------------------------------------
dnl
dnl LM_FIND_EMU_CC
@@ -533,19 +561,22 @@ dnl On ofs1 the '-pthread' switch should be used
linux*)
THR_DEFS="$THR_DEFS -D_POSIX_THREAD_SAFE_FUNCTIONS"
+ LM_CHECK_GETCONF
AC_MSG_CHECKING(for Native POSIX Thread Library)
- if test X$cross_compiling = Xyes; then
- case X$erl_xcomp_linux_nptl in
- X) nptl=cross;;
- Xyes|Xno) nptl=$erl_xcomp_linux_nptl;;
+ libpthr_vsn=`$GETCONF GNU_LIBPTHREAD_VERSION 2>/dev/null`
+ if test $? -eq 0; then
+ case "$libpthr_vsn" in
+ *nptl*|*NPTL*) nptl=yes;;
+ *) nptl=no;;
+ esac
+ elif test "$cross_compiling" = "yes"; then
+ case "$erl_xcomp_linux_nptl" in
+ "") nptl=cross;;
+ yes|no) nptl=$erl_xcomp_linux_nptl;;
*) AC_MSG_ERROR([Bad erl_xcomp_linux_nptl value: $erl_xcomp_linux_nptl]);;
esac
else
- case `getconf GNU_LIBPTHREAD_VERSION 2>/dev/null` in
- nptl*) nptl=yes;;
- NPTL*) nptl=yes;;
- *) nptl=no;;
- esac
+ nptl=no
fi
AC_MSG_RESULT($nptl)
if test $nptl = cross; then
diff --git a/erts/configure.in b/erts/configure.in
index 1892a7a1f4..3d57c2307e 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -449,16 +449,44 @@ case $host_os in
;;
esac
+lfs_conf=ok
+lfs_source=none
+if test "${LFS_CFLAGS+set}" = "set" || \
+ test "${LFS_LDFLAGS+set}" = "set" || \
+ test "${LFS_LIBS+set}" = "set"; then
+ lfs_source=user
+else
+ LM_CHECK_GETCONF
+ test "$GETCONF" = "false" || lfs_source=getconf
+fi
-dnl
-dnl Use the getconf utility if it exists
-dnl to find large file support flags.
-dnl
-if type getconf >/dev/null 2>&1; then
- CFLAGS="$CFLAGS `getconf LFS_CFLAGS 2>/dev/null`"
- DEBUG_CFLAGS="$DEBUG_CFLAGS `getconf LFS_CFLAGS 2>/dev/null`"
- LDFLAGS="$LDFLAGS `getconf LFS_LDFLAGS 2>/dev/null`"
- LIBS="$LIBS `getconf LFS_LIBS 2>/dev/null`"
+if test "$lfs_source" = "none"; then
+ AC_MSG_WARN([Do not know how to check for large file support flags; no getconf is available])
+else
+ for var in CFLAGS LDFLAGS LIBS; do
+ AC_MSG_CHECKING([for large file support $var])
+ if test $lfs_source = user; then
+ eval "lfs_val=\"\$LFS_$var\""
+ else
+ eval "lfs_var=LFS_$var"
+ lfs_val=`$GETCONF $lfs_var 2>/dev/null` || lfs_conf=failed
+ if test $lfs_conf = failed; then
+ AC_MSG_RESULT([failed])
+ break
+ fi
+ eval "$lfs_var=\"$lfs_val\""
+ fi
+ test "$lfs_val" != "" || lfs_val=none
+ AC_MSG_RESULT([$lfs_val])
+ done
+ if test $lfs_conf = failed; then
+ AC_MSG_WARN([Check for large file support flags failed; $GETCONF failed])
+ else
+ CFLAGS="$CFLAGS $LFS_CFLAGS"
+ DEBUG_CFLAGS="$DEBUG_CFLAGS $LFS_CFLAGS"
+ LDFLAGS="$LDFLAGS $LFS_LDFLAGS"
+ LIBS="$LIBS $LFS_LIBS"
+ fi
fi
if test "x$GCC" = xyes; then
@@ -664,7 +692,7 @@ fi
AC_PROG_LN_S
-AC_CHECK_PROG(AR, ar, ar, false)
+AC_CHECK_TOOL([AR], [ar], [false])
if test "$ac_cv_prog_AR" = false; then
AC_MSG_ERROR([No 'ar' command found in PATH])
fi