Skip to content
Browse files

OTP-8323 Cross compilation improvements and other build system

          improvements.

          Most notable:

          Lots of cross compilation improvements. The old cross compilation
          support was more or less non-existing as well as broken. Please,
          note that the cross compilation support should still be
          considered as experimental. Also note that old cross compilation
          configurations cannot be used without modifications. For more
          information on cross compiling Erlang/OTP see the
          $ERL_TOP/xcomp/README file.

          Support for staged install using <url
          href="http://www.gnu.org/prep/standards/html_node/DESTDIR.html">D
          ESTDIR</url>. The old broken INSTALL_PREFIX has also been fixed.
          For more information see the $ERL_TOP/README file.

          Documentation of the release target of the top Makefile. For more
          information see the $ERL_TOP/README file.

          make install now by default creates relative symbolic links
          instead of absolute ones. For more information see the
          $ERL_TOP/README file.

          $ERL_TOP/configure --help=recursive now works and prints help for
          all applications with configure scripts.

          Doing make install, or make release directly after make all no
          longer triggers miscellaneous rebuilds.

          Existing bootstrap system is now used when doing make install, or
          make release without a preceding make all.

          The crypto and ssl applications use the same runtime library path
          when dynamically linking against libssl.so and libcrypto.so. The
          runtime library search path has also been extended.

          The configure scripts of erl_interface and odbc now search for
          thread libraries and thread library quirks the same way as erts
          do.

          The configure script of the odbc application now also looks for
          odbc libraries in lib64 and lib/64 directories when building on a
          64-bit system.

          The config.h.in file in the erl_interface application is now
          automatically generated in instead of statically updated which
          reduces the risk of configure tests without any effect.
  • Loading branch information...
1 parent 639e0b2 commit 1b78e85c9b6097f0d1940793e5fed4e08c0794f9 @rickard-green rickard-green committed with Erlang/OTP
Showing with 4,979 additions and 2,310 deletions.
  1. +245 −46 Makefile.in
  2. +82 −4 README
  3. +3 −0 TAR.include
  4. +1 −0 aclocal.m4
  5. +73 −6 configure.in
  6. +28 −0 erl-build-tool-vars.sh
  7. +319 −179 erts/aclocal.m4
  8. +3 −1 erts/autoconf/win32.config.cache
  9. +394 −151 erts/configure.in
  10. +6 −9 erts/etc/common/Makefile.in
  11. +17 −40 erts/etc/unix/Install.src
  12. +7 −7 erts/start_scripts/Makefile
  13. +14 −7 erts/test/Makefile
  14. +727 −0 erts/test/install_SUITE.erl
  15. +2 −0 erts/test/install_SUITE_data/dirname
  16. +8 −8 lib/Makefile
  17. +118 −6 lib/asn1/c_src/Makefile
  18. +0 −139 lib/asn1/c_src/Makefile.in
  19. +0 −37 lib/configure.in
  20. +61 −0 lib/configure.in.src
  21. +10 −18 lib/crypto/c_src/Makefile.in
  22. +44 −120 lib/erl_interface/configure.in
  23. +6 −6 lib/erl_interface/src/Makefile.in
  24. +0 −277 lib/erl_interface/src/auxdir/config.h.in
  25. +9 −6 lib/hipe/rtl/Makefile
  26. +64 −49 lib/megaco/configure.in
  27. +52 −28 lib/megaco/src/flex/Makefile.in
  28. +5 −8 lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src
  29. +1 −0 lib/odbc/aclocal.m4
  30. +11 −11 lib/odbc/c_src/Makefile.in
  31. +71 −89 lib/odbc/configure.in
  32. +13 −18 lib/runtime_tools/c_src/Makefile.in
  33. +15 −7 lib/ssl/c_src/Makefile.in
  34. +10 −13 lib/wx/c_src/Makefile.in
  35. +14 −7 lib/wx/configure.in
  36. +147 −0 make/cross_check_erl
  37. +702 −0 make/install_bin
  38. +35 −9 make/otp_ded.mk.in
  39. +29 −0 make/unexpected_use
  40. +323 −284 otp_build
  41. +1 −0 prebuild.skip
  42. +376 −163 xcomp/README
  43. +216 −180 xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
  44. +29 −0 xcomp/erl-xcomp-vars.sh
  45. +217 −180 xcomp/erl-xcomp-vxworks_ppc32.conf
  46. +236 −0 xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf
  47. +235 −197 xcomp/erl-xcomp.conf.template
View
291 Makefile.in
@@ -27,6 +27,9 @@ SHELL = /bin/sh
# The top directory in which Erlang is unpacked
ERL_TOP = @ERL_TOP@
+# OTP release
+OTP = @OTP@
+
# erts (Erlang RunTime System) version
ERTS = @ERTS@
@@ -41,48 +44,105 @@ ERTS = @ERTS@
# configure.
#
-# prefix from autoconf, default is /usr/local (must be an absolute path)
-prefix = @prefix@
-exec_prefix = @exec_prefix@
+# prefix from configure, default is /usr/local (must be an absolute path)
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+# Locations where we should install according to configure. These location
+# may be prefixed by $(DESTDIR) and/or $(EXTRA_PREFIX) (see below).
+bindir = @bindir@
+libdir = @libdir@
+
+# Where Erlang/OTP is located
+libdir_suffix = /erlang
+erlang_libdir = $(libdir)$(libdir_suffix)
+erlang_bindir = $(erlang_libdir)/bin
-# The following can be set in case you install Erlang in a different
-# location from where you have configured it to run. This can be
-# useful e.g. when installing on a server that stores the files with a
-# different path from where the clients access them. Or when building
-# rpms.
-#INSTALL_PREFIX =
-# Naah...override `prefix' instead.
+#
+# By default we install relative symbolic links for $(ERL_BASE_PUB_FILES)
+# from $(bindir) to $(erlang_bindir) as long as they are both prefixed
+# by $(exec_prefix) (and are otherwise reasonable). This behavior can be
+# overridden by passing BINDIR_SYMLINKS=<HOW>, where <HOW> is either
+# absolute or relative.
+#
+
+# $ make DESTDIR=<...> install
+#
+# DESTDIR can be set in case you want to install Erlang in a different
+# location than where you have configured it to run. This can be
+# useful, e.g. when installing on a server that stores the files with a
+# different path than where the clients access them, when building
+# rpms, or cross compiling, etc. DESTDIR will prefix the actual
+# installation which will only be able to run once the DESTDIR prefix
+# has disappeard, e.g. the part after DESTDIR has been packed and
+# unpacked without DESTDIR. The name DESTDIR have been chosen since it
+# is the GNU coding standard way of doing it.
+#
+# If INSTALL_PREFIX is set but not DESTDIR, DESTDIR will be set to
+# INSTALL_PREFIX. INSTALL_PREFIX has been buggy for a long time. It was
+# initially intended to have the same effect as DESTDIR. This effect was,
+# however, lost even before it was first released :-( In all released OTP
+# versions up to R13B03, INSTALL_PREFIX has behaved as EXTRA_PREFIX do
+# today (see below).
+
+ifeq ($(DESTDIR),)
+ifneq ($(INSTALL_PREFIX),)
+DESTDIR=$(INSTALL_PREFIX)
+endif
+else
+ifneq ($(INSTALL_PREFIX),)
+ifneq ($(DESTDIR),$(INSTALL_PREFIX))
+$(error Both DESTDIR="$(DESTDIR)" and INSTALL_PREFIX="$(INSTALL_PREFIX)" have been set and have been set differently! Please, only set one of them)
+endif
+endif
+endif
-# The directory in which user executables (ERL_BASE_PUB_FILES) are put
-BINDIR = $(INSTALL_PREFIX)@bindir@
+# $ make EXTRA_PREFIX=<...> install
+#
+# EXTRA_PREFIX behaves exactly as the buggy INSTALL_PREFIX behaved in
+# pre R13B04 releases. It adds a prefix to all installation paths which
+# will be used by the actuall installation. That is, the installation
+# needs to be located at this location when run. This is useful if you
+# want to try out the system, running test suites, etc, before doing the
+# real install using the configuration you have set up using `configure'.
+# A similar thing can be done by overriding `prefix' if only default
+# installation directories are used. However, the installation can get
+# sprawled out all over the place if the user use `--bindir', `--libdir',
+# etc, and it is possible that `prefix' wont have any effect at all. That
+# is, it is not at all the same thing as using EXTRA_PREFIX in the
+# general case. It is also nice to be able to supply this feature if
+# someone should have relied on the old buggy INSTALL_PREFIX.
+
+# The directory in which user executables (ERL_BASE_PUB_FILES) are installed
+BINDIR = $(DESTDIR)$(EXTRA_PREFIX)$(bindir)
#
# Erlang base public files
#
ERL_BASE_PUB_FILES=erl erlc epmd run_erl to_erl dialyzer typer escript
-# The directory which will contain installed Erlang version.
-# (ILIBDIR is supposed to be LIBDIR *without* the install prefix)
-ERLANG_LIBDIR = $(INSTALL_PREFIX)@libdir@/erlang
-ERLANG_ILIBDIR = @libdir@/erlang
+# ERLANG_INST_LIBDIR is the top directory where the Erlang installation
+# will be located when running.
+ERLANG_INST_LIBDIR=$(EXTRA_PREFIX)$(erlang_libdir)
+ERLANG_INST_BINDIR= $(ERLANG_INST_LIBDIR)/bin
-# You can *not* change these two, they have to stay this way for now.
-ERLANG_BINDIR = $(ERLANG_LIBDIR)/bin
-ERLANG_ERTSBINDIR = $(ERLANG_LIBDIR)/$(ERTS)/bin
+# ERLANG_LIBDIR is the top directory where the Erlang installation is copied
+# during installation. If DESTDIR != "", it cannot be run from this location.
+ERLANG_LIBDIR = $(DESTDIR)$(ERLANG_INST_LIBDIR)
# The directory in which man pages for above executables are put
-ERL_MAN1DIR = $(INSTALL_PREFIX)@mandir@/man1
+ERL_MAN1DIR = $(DESTDIR)$(EXTRA_PREFIX)@mandir@/man1
ERL_MAN1EXT = 1
# The directory in which Erlang private man pages are put. In order
# not to clutter up the man namespace these are by default put in the
-# Erlang private directory $(ERLANG_ILIBDIR)/man. If you want to
-# install the man pages together with the rest give the argument
-# "--disable-erlang-mandir" when you run configure, which will set
-# MAN_DIR to @mandir@.
+# Erlang private directory $(ERLANG_LIBDIR)/man (\@erl_mandir\@ is set
+# to $(erlang_libdir)/man). If you want to install the man pages
+# together with the rest give the argument "--disable-erlang-mandir"
+# when you run configure, which will set \@erl_mandir\@ to \@mandir\@.
# If you want a special suffix on the manpages set ERL_MANEXT to
# this suffix, e.g. "erl"
-ERL_MANDIR = $(INSTALL_PREFIX)@erl_mandir@
+ERL_MANDIR = $(DESTDIR)$(EXTRA_PREFIX)@erl_mandir@
ERL_MANEXT =
# ----------------------------------------------------------------------
@@ -93,6 +153,19 @@ MAKE = @MAKE_PROG@
# This should be set to the target "arch-vendor-os"
export TARGET = @TARGET@
+BOOTSTRAP_ONLY = @BOOTSTRAP_ONLY@
+
+CROSS_COMPILING = @CROSS_COMPILING@
+ifeq ($(CROSS_COMPILING),yes)
+INSTALL_CROSS = -cross
+else
+ifneq ($(DESTDIR),)
+INSTALL_CROSS = -cross
+else
+INSTALL_CROSS =
+endif
+endif
+
# A BSD compatible install program
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -107,6 +180,12 @@ RANLIB = @RANLIB@
# ----------------------------------------------------------------------
+# By default we require an Erlang/OTP of the same release as the one
+# we cross compile.
+ERL_XCOMP_FORCE_DIFFERENT_OTP = no
+
+# ----------------------------------------------------------------------
+
#
# The directory where at least the primary bootstrap is placed under.
#
@@ -136,6 +215,57 @@ BOOT_PREFIX=$(WIN32_WRAPPER_PATH):$(BOOTSTRAP_ROOT)/bootstrap/bin:
else
BOOT_PREFIX=$(BOOTSTRAP_ROOT)/bootstrap/bin:
endif
+
+# ----------------------------------------------------------------------
+
+# The following is currently only used for determining what to prevent
+# usage of during strict install or release.
+include $(ERL_TOP)/make/$(TARGET)/otp_ded.mk
+CC = @CC@
+LD = @LD@
+CXX = @CXX@
+
+IBIN_DIR = $(ERL_TOP)/ibin
+#
+# If $(OTP_STRICT_INSTALL) equals `yes' we prefix the PATH with $(IBIN_DIR)
+# when doing `release' or `install'. This directory contains `erlc', `gcc',
+# `ld' etc, that unconditionally will fail if used. This is used during the
+# daily builds in order to pick up on things being erroneously built during
+# the `release' and `install' phases.
+#
+INST_FORBID = gcc g++ cc c++ cxx cl gcc.sh cc.sh ld ld.sh
+INST_FORBID += javac.sh javac guavac gcj jikes bock
+INST_FORBID += $(notdir $(CC)) $(notdir $(LD)) $(notdir $(CXX))
+INST_FORBID += $(notdir $(DED_CC)) $(notdir $(DED_LD))
+INST_FORBID += $(ERL_BASE_PUB_FILES)
+IBIN_FILES = $(addprefix $(IBIN_DIR)/,$(sort $(INST_FORBID))) # sort will
+ # remove
+ # duplicates
+
+ifeq ($(OTP_STRICT_INSTALL),yes)
+
+INST_PATH_PREFIX=$(IBIN_DIR):
+INST_DEP = strict_install
+ifneq ($(CROSS_COMPILING),yes)
+INST_DEP += strict_install_all_bootstraps
+endif
+
+else # --- Normal case, i.e., not strict install ---
+
+#
+# By default we allow build during install and release phase; therefore,
+# make sure that the bootstrap system is available in the path.
+#
+INST_PATH_PREFIX=$(BOOT_PREFIX)
+# If cross compiling `erlc', in path might have be used; therefore,
+# avoid triggering a bootstrap build...
+INST_DEP =
+ifneq ($(CROSS_COMPILING),yes)
+INST_DEP += all_bootstraps
+endif
+
+endif # --- Normal case, i.e., not strict install ---
+
# ----------------------------------------------------------------------
# Fix up RELEASE_ROOT/TESTROOT havoc
ifeq ($(RELEASE_ROOT),)
@@ -164,13 +294,54 @@ endif
# * build additional compilers and copy them into bootstrap/lib
# * use the bootstrap erl and erlc to build all the libs
#
-all: all_bootstraps \
- libs local_setup dialyzer
+
+.PHONY: all bootstrap all_bootstraps
+
+ifneq ($(CROSS_COMPILING),yes)
+# Not cross compiling
+
+ifeq ($(BOOTSTRAP_ONLY),yes)
+all: bootstrap
+else
+# The normal case; not cross compiling, and not bootstrap only build.
+all: bootstrap libs local_setup dialyzer
+endif
+
+else
+# Cross compiling
+
+all: cross_check_erl depend emulator libs start_scripts dialyzer
+
+endif
+
+cross_check_erl:
+ @PATH=$(BOOT_PREFIX)$${PATH} $(ERL_TOP)/make/cross_check_erl \
+ -target $(TARGET) -otp $(OTP) -erl_top $(ERL_TOP) \
+ -force $(ERL_XCOMP_FORCE_DIFFERENT_OTP)
+
+is_cross_configured:
+ @echo @CROSS_COMPILING@
+
+target_configured:
+ @echo @TARGET@
+
+bootstrap: depend all_bootstraps
+
+
+
+ifeq ($(OTP_STRICT_INSTALL),yes)
+
+.PHONY: strict_install_all_bootstraps
+
+strict_install_all_bootstraps:
+ $(MAKE) BOOT_PREFIX=$(INST_PATH_PREFIX) OTP_STRICT_INSTALL=$(OTP_STRICT_INSTALL) all_bootstraps
+
+endif
# With all bootstraps we mean all bootstrapping that is done when
# the system is delivered in open source, the primary
# bootstrap is not included, it requires a pre built emulator...
-all_bootstraps: depend emulator \
+all_bootstraps: emulator \
bootstrap_setup \
secondary_bootstrap_build secondary_bootstrap_copy \
tertiary_bootstrap_build tertiary_bootstrap_copy \
@@ -193,11 +364,15 @@ noboot_install:
.PHONY: release release_docs
-release:
+release: $(INST_DEP)
ifeq ($(OTP_SMALL_BUILD),true)
- cd $(ERL_TOP)/lib && $(MAKE) TESTROOT=$(RELEASE_ROOT) release
+ cd $(ERL_TOP)/lib && \
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
+ $(MAKE) TESTROOT=$(RELEASE_ROOT) release
else
- cd $(ERL_TOP)/lib && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
+ cd $(ERL_TOP)/lib && \
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
+ $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
ifneq ($(findstring vxworks,$(TARGET)),vxworks)
@if test -f lib/dialyzer/SKIP ; then \
echo "=== Skipping dialyzer, reason:" ; \
@@ -205,11 +380,14 @@ ifneq ($(findstring vxworks,$(TARGET)),vxworks)
echo "===" ; \
else \
cd $(ERL_TOP)/lib/dialyzer && \
- $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release ; \
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
+ $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release ; \
fi
endif
endif
- cd $(ERL_TOP)/erts && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
+ cd $(ERL_TOP)/erts && \
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
+ $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
# ---------------------------------------------------------------
# Target only used when building commercial ERTS patches
@@ -353,7 +531,6 @@ secondary_bootstrap_copy:
cp $$x $$TF; \
true; \
done
- rm -f lib/hipe/ebin/*.beam
# if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; fi
@@ -654,9 +831,13 @@ primary_bootstrap_copy:
KERNEL_PRELOAD = otp_ring0 init erl_prim_loader prim_inet prim_file zlib prim_zip erlang
KERNEL_PRELOAD_BEAMS=$(KERNEL_PRELOAD:%=$(BOOTSTRAP_TOP)/lib/kernel/ebin/%.beam)
+start_scripts:
+ @cd erts/start_scripts \
+ && ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} $(MAKE) script
+
# Creates "erl" and "erlc" scripts in bin/erl which uses the libraries in lib
local_setup:
- @rm -f erts/bin/erl erts/bin/erlc erts/bin/cerl
+ @rm -f bin/erl bin/erlc bin/cerl
@cd erts && \
ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
$(MAKE) local_setup
@@ -729,7 +910,9 @@ bootstrap_nc_for_ne_no_debug_sym:
#
# Order is important here, don't change it!
#
-install: install.dirs install.emulator install.libs install.Install install.bin
+INST_DEP += install.dirs install.emulator install.libs install.Install install.bin
+
+install: $(INST_DEP)
install-docs:
ERL_TOP=$(ERL_TOP) INSTALLROOT=$(ERLANG_LIBDIR) PATH=$(BOOT_PREFIX)$${PATH} \
@@ -738,17 +921,17 @@ install-docs:
install.emulator:
cd erts && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
$(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
install.libs:
ifeq ($(OTP_SMALL_BUILD),true)
cd lib && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
$(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
else
cd lib && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
$(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release
@if test -f lib/dialyzer/SKIP ; then \
echo "=== Skipping dialyzer, reason:" ; \
@@ -756,22 +939,27 @@ else
echo "===" ; \
else \
cd lib/dialyzer && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
$(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release ; \
fi
endif
install.Install:
- cd $(ERLANG_LIBDIR) && ./Install -minimal $(ERLANG_LIBDIR)
+ (cd $(ERLANG_LIBDIR) \
+ && ./Install $(INSTALL_CROSS) -minimal $(ERLANG_INST_LIBDIR))
#
# Install erlang base public files
#
+
install.bin:
- for file in $(ERL_BASE_PUB_FILES); do \
- rm -f $(BINDIR)/$$file; \
- ${LN_S} $(ERLANG_BINDIR)/$$file $(BINDIR)/$$file; \
- done
+ @ DESTDIR="$(DESTDIR)" EXTRA_PREFIX="$(EXTRA_PREFIX)" \
+ LN_S="$(LN_S)" BINDIR_SYMLINKS="$(BINDIR_SYMLINKS)" \
+ $(ERL_TOP)/make/install_bin \
+ --bindir "$(bindir)" \
+ --erlang-bindir "$(erlang_bindir)" \
+ --exec-prefix "$(exec_prefix)" \
+ $(ERL_BASE_PUB_FILES)
#
# Directories needed before we can install
@@ -781,6 +969,17 @@ install.dirs:
${MKSUBDIRS} $(ERLANG_LIBDIR)
${MKSUBDIRS} $(ERLANG_LIBDIR)/usr/lib
+.PHONY: strict_install
+
+strict_install: $(IBIN_DIR) $(IBIN_FILES)
+
+$(IBIN_FILES): $(ERL_TOP)/make/unexpected_use
+ rm -f $@
+ (cd $(dir $@) && $(LN_S) $(ERL_TOP)/make/unexpected_use $(notdir $@))
+
+$(IBIN_DIR):
+ $(MKSUBDIRS) $@
+
# ----------------------------------------------------------------------
.PHONY: clean eclean bootstrap_root_clean bootstrap_clean
@@ -790,7 +989,7 @@ install.dirs:
#
clean: check_recreate_primary_bootstrap
- rm -f *~ *.bak config.log config.status prebuilt.files
+ rm -f *~ *.bak config.log config.status prebuilt.files ibin/*
find . -type f -name SKIP -print | xargs $(RM)
cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean
cd lib && ERL_TOP=$(ERL_TOP) $(MAKE) clean BUILD_ALL=true
View
86 README
@@ -13,7 +13,7 @@ The source code for Erlang/OTP can also be found in a Git repository:
%CopyrightBegin%
-Copyright Ericsson AB 1998-2009. All Rights Reserved.
+Copyright Ericsson AB 1998-2010. All Rights Reserved.
The contents of this file are subject to the Erlang Public License,
Version 1.1, (the "License"); you may not use this file except in
@@ -221,9 +221,87 @@ Step 5 builds the Erlang/OTP system. On a fast computer, this will take about
Erlang/OTP system which you can try by typing "bin/erl". This should start
up Erlang/OTP and give you a prompt.
-Step 6 is optional. It installs Erlang/OTP (if you change your
-mind about where you wish to install you can rerun step 4, without
-having to do step 5 again).
+Step 6 is optional. It installs Erlang/OTP at a standardized location (if you
+change your mind about where you wish to install you can rerun step 4,
+without having to do step 5 again).
+
+Alternative installation procedures:
+* Staged install using DESTDIR. You can perform the install phase in a
+ temporary directory and later move the installation into its correct location
+ by use of the DESTDIR variable: 'make DESTDIR=<tmp install dir> install'
+ The installation will be created in a location prefixed by $DESTDIR. It
+ can, however, not be run from there. It needs to be moved into the correct
+ location before it can be run. If DESTDIR have not been set but INSTALL_PREFIX
+ has been set, DESTDIR will be set to INSTALL_PREFIX. Note that INSTALL_PREFIX
+ in pre R13B04 was buggy and behaved as EXTRA_PREFIX (see below). There are
+ lots of areas of use for an installation procedure using DESTDIR, e.g. when
+ creating a package, cross compiling, etc. Here is an example where the
+ installation should be located under /opt/local:
+ $ ./configure --prefix=/opt/local
+ $ make
+ $ mkdir /tmp/erlang-build
+ $ make DESTDIR=/tmp/erlang-build install
+ $ cd /tmp/erlang-build/opt/local
+ $ # gnu-tar is used in this example
+ $ tar -zcf /home/me/my-erlang-build.tgz *
+ $ su -
+ Password: *****
+ $ cd /opt/local
+ $ tar -zxf /home/me/my-erlang-build.tgz
+* Test install using EXTRA_PREFIX. Note that EXTRA_PREFIX is similar to
+ DESTDIR, but it does not have the same effect as DESTDIR. The EXTRA_PREFIX
+ variable will prefix all installation paths, and the installation can and
+ have to be run from there. That is, it can be useful if you want to try the
+ system out, running test suites, etc, before doing the real install without
+ EXTRA_PREFIX.
+* Install using the `release' target. Instead of doing `make install' you can
+ creat the installation in whatever directory you like using the `release'
+ target and run the `Install' script yourself. RELEASE_ROOT is used for
+ specifying the directory where the installation should be created. This is
+ what by default ends up under `/usr/local/lib/erlang' if you do the install
+ using `make install'. All installation paths provided in the `configure'
+ phase are ignored, as well as DESTDIR, and INSTALL_PREFIX. If you want links
+ from a specific `bin' directory to the installation you have to set those up
+ yourself. An example where Erlang/OTP should be located at /home/me/OTP:
+ $ ./configure
+ $ make
+ $ make RELEASE_ROOT=/home/me/OTP release
+ $ cd /home/me/OTP
+ $ ./Install -minimal /home/me/OTP
+ $ mkdir -p /home/me/bin
+ $ cd /home/me/bin
+ $ ln -s /home/me/OTP/bin/erl erl
+ $ ln -s /home/me/OTP/bin/erlc erlc
+ $ ln -s /home/me/OTP/bin/escript escript
+ ...
+ The `Install' script should currently be invoked as follows in the
+ directory where it resides:
+ `./Install [-cross] [-minimal|-sasl] <ERL_ROOT>'
+ where:
+ -minimal - Creates an installation that starts up a minimal amount
+ of applications, i.e., only kernel and stdlib are started.
+ The minimal system is normally enough.
+ -sasl - Creates an installation that also starts up the sasl
+ application.
+ -cross - For cross compilation. Informs the install script that it
+ is run on the build machine.
+ <ERL_ROOT> - The absolute path to the Erlang installation to use at run
+ time. This is often the same as the current working
+ directory, but does not have to be. It can follow any other
+ path through the file system to the same directory.
+
+ If neither -minimal, nor -sasl is passed as argument you will be prompted.
+
+When doing `make install' and the default installation prefix is used, relative
+symbolic links will be created from /usr/local/bin to all public executables in
+the Erlang installation. The installation phase will try to create relative
+symbolic links as long as `--bindir' and the Erlang bin directory, located under
+`--libdir', both have `--exec-prefix' as prefix. Where `--exec-prefix'
+defaults to `--prefix'. `--prefix', `--exec-prefix', `--bindir', and `--libdir'
+are all arguments that can be passed to `configure'. One can however force
+relative, or absolute links by passing BINDIR_SYMLINKS=relative|absolute
+as arguments to make during the install phase. Note that such a request might
+cause a failure if the request cannot be satisfied.
The source tree is delivered with a lot of platform independent
build results already pre-built. If you want to remove these pre-built
View
3 TAR.include
@@ -4,12 +4,15 @@ Makefile.in
README
README.win32
configure.in
+aclocal.m4
otp_build
lib/Makefile
lib/configure
lib/configure.in
+lib/configure.in.src
prebuild.skip
prebuild.delete
+erl-build-tool-vars.sh
bootstrap/lib/*/ebin
bootstrap/lib/*/include
bootstrap/bin/start*.script
View
1 aclocal.m4
View
79 configure.in
@@ -1,8 +1,28 @@
dnl Process this file with autoconf to produce a configure script.
+
+dnl %CopyrightBegin%
+dnl
+dnl Copyright Ericsson AB 1998-2010. All Rights Reserved.
+dnl
+dnl The contents of this file are subject to the Erlang Public License,
+dnl Version 1.1, (the "License"); you may not use this file except in
+dnl compliance with the License. You should have received a copy of the
+dnl Erlang Public License along with this software. If not, it can be
+dnl retrieved online at http://www.erlang.org/.
+dnl
+dnl Software distributed under the License is distributed on an "AS IS"
+dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+dnl the License for the specific language governing rights and limitations
+dnl under the License.
+dnl
+dnl %CopyrightEnd%
+
AC_PREREQ(2.8)dnl
AC_INIT()
+LM_PRECIOUS_VARS
+
default_cache_file=./config.cache
if test "x$no_recursion" != "xyes" -a "x$OVERRIDE_CONFIG_CACHE" = "x"; then
@@ -19,6 +39,18 @@ if test "x$no_recursion" != "xyes" -a "x$OVERRIDE_CONFIG_CACHE" = "x"; then
cache_file=/dev/null
fi
+case "X$ERL_TOP" in
+ X)
+ ;;
+ X/*)
+ test -f $ERL_TOP/erts/emulator/beam/beam_emu.c || {
+ AC_MSG_ERROR([Invalid \$ERL_TOP])
+ }
+ srcdir="$ERL_TOP";;
+ *)
+ AC_MSG_ERROR([\$ERL_TOP needs to be absolute]);;
+esac
+
dnl How to set srcdir absolute is taken from the GNU Emacs distribution
#### Make srcdir absolute, if it isn't already. It's important to
#### avoid running the path through pwd unnecessary, since pwd can
@@ -43,7 +75,7 @@ esac
#
# Now srcdir is absolute and also the top of Erlang distribution, ERL_TOP.
#
-ERL_TOP=${srcdir}
+test "X$ERL_TOP" != "X" || ERL_TOP="$srcdir"
AC_SUBST(ERL_TOP)
dnl
@@ -65,11 +97,35 @@ fi
TARGET=$host
AC_SUBST(TARGET)
+if test X$cross_compiling = Xyes; then
+ CROSS_COMPILING=yes
+else
+ CROSS_COMPILING=no
+fi
+AC_SUBST(CROSS_COMPILING)
+
+
+AC_ARG_ENABLE(bootstrap-only,
+[ --enable-bootstrap-only enable bootstrap only configuration],
+[ if test "X$enableval" = "Xyes"; then
+ BOOTSTRAP_ONLY=yes
+ else
+ BOOTSTRAP_ONLY=no
+ fi
+],
+BOOTSTRAP_ONLY=no)
+
+AC_SUBST(BOOTSTRAP_ONLY)
+
+if test $CROSS_COMPILING = yes -a $BOOTSTRAP_ONLY = yes; then
+ AC_MSG_ERROR([Cannot both cross compile and build a bootstrap system])
+fi
dnl Checks for programs.
AC_PROG_CC
-
+AC_PROG_CXX
+AC_CHECK_TOOL(LD, [ld])
#
# We need GNU make, complain if we can't find it
@@ -123,11 +179,17 @@ AC_PROG_LN_S
AC_PROG_RANLIB
#
-# Get erts version from erts/vsn.mk
+# Get erts version and otp release from erts/vsn.mk
#
-[ERTS=erts-`sed -n 's/^VSN[ ]*=[ ]*\([0-9.]\)/\1/p' < erts/vsn.mk`]
+AC_MSG_CHECKING([ERTS version])
+[ERTS=erts-`sed -n "s/^VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
+AC_MSG_RESULT([$ERTS])
AC_SUBST(ERTS)
+AC_MSG_CHECKING([OTP release])
+[OTP=OTP-`sed -n "s/^SYSTEM_VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
+AC_MSG_RESULT([$OTP])
+AC_SUBST(OTP)
AC_ARG_ENABLE(threads,
[ --enable-threads enable async thread support
@@ -147,6 +209,11 @@ AC_ARG_ENABLE(kernel-poll,
AC_ARG_ENABLE(hipe,
[ --enable-hipe enable hipe support
--disable-hipe disable hipe support])
+
+AC_ARG_WITH(javac,
+[ --with-javac=JAVAC specify Java compiler to use
+ --with-javac use a Java compiler if found (default)
+ --without-javac don't use any Java compiler])
AC_ARG_ENABLE(megaco_flex_scanner_lineno,
[ --enable-megaco-flex-scanner-lineno enable megaco flex scanner lineno
@@ -176,8 +243,8 @@ AC_ARG_ENABLE(erlang-mandir,
[ --disable-erlang-mandir do not install Erlang man pages in a private directory],
[ case "$enableval" in
no) erl_mandir=$mandir ;;
- *) erl_mandir='$(ERLANG_ILIBDIR)/man' ;;
- esac ], erl_mandir='$(ERLANG_ILIBDIR)/man')
+ *) erl_mandir='$(erlang_libdir)/man' ;;
+ esac ], erl_mandir='$(erlang_libdir)/man')
AC_SUBST(erl_mandir)
AC_ARG_ENABLE(darwin-universal,
View
28 erl-build-tool-vars.sh
@@ -0,0 +1,28 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2010. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+
+#
+# erl_build_tool_vars - Build tool configuration variables currently
+# reqognized by `configure' scripts in OTP.
+#
+# NOTE:
+# When updating, also update $ERL_TOP/xcomp/{README,erl-xcomp.conf.template},
+# and precious variables in $ERL_TOP/erts/aclocal.m4.
+#
+erl_build_tool_vars="CC CFLAGS STATIC_CFLAGS CFLAG_RUNTIME_LIBRARY_PATH CPP CPPFLAGS CXX CXXFLAGS LD LDFLAGS DED_LD DED_LDFLAGS DED_LD_FLAG_RUNTIME_LIBRARY_PATH RANLIB AR"
View
498 erts/aclocal.m4
@@ -1,19 +1,19 @@
dnl
dnl %CopyrightBegin%
-dnl
-dnl Copyright Ericsson AB 1998-2009. All Rights Reserved.
-dnl
+dnl
+dnl Copyright Ericsson AB 1998-2010. All Rights Reserved.
+dnl
dnl The contents of this file are subject to the Erlang Public License,
dnl Version 1.1, (the "License"); you may not use this file except in
dnl compliance with the License. You should have received a copy of the
dnl Erlang Public License along with this software. If not, it can be
dnl retrieved online at http://www.erlang.org/.
-dnl
+dnl
dnl Software distributed under the License is distributed on an "AS IS"
dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
dnl the License for the specific language governing rights and limitations
dnl under the License.
-dnl
+dnl
dnl %CopyrightEnd%
dnl
@@ -25,6 +25,63 @@ dnl could/should be part of autoconf are prefixed LM_, macros specific
dnl to the Erlang system are prefixed ERL_.
dnl
+AC_DEFUN(LM_PRECIOUS_VARS,
+[
+
+dnl ERL_TOP
+AC_ARG_VAR(ERL_TOP, [Erlang/OTP top source directory])
+
+dnl Tools
+AC_ARG_VAR(CC, [C compiler])
+AC_ARG_VAR(CFLAGS, [C compiler flags])
+AC_ARG_VAR(STATIC_CFLAGS, [C compiler static flags])
+AC_ARG_VAR(CFLAG_RUNTIME_LIBRARY_PATH, [runtime library path linker flag passed via C compiler])
+AC_ARG_VAR(CPP, [C/C++ preprocessor])
+AC_ARG_VAR(CPPFLAGS, [C/C++ preprocessor flags])
+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(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(RANLIB, [ranlib])
+AC_ARG_VAR(AR, [ar])
+
+dnl Cross system root
+AC_ARG_VAR(erl_xcomp_sysroot, [Absolute cross system root path (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_isysroot, [Absolute cross system root include path (only used when cross compiling)])
+
+dnl Cross compilation variables
+AC_ARG_VAR(erl_xcomp_bigendian, [big endian system: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_linux_clock_gettime_correction, [clock_gettime() can be used for time correction: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_linux_nptl, [have Native POSIX Thread Library: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_linux_usable_sigusrx, [SIGUSR1 and SIGUSR2 can be used: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_linux_usable_sigaltstack, [have working sigaltstack(): yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_poll, [have working poll(): yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_kqueue, [have working kqueue(): yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_putenv_copy, [putenv() stores key-value copy: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_reliable_fpe, [have reliable floating point exceptions: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_getaddrinfo, [have working getaddrinfo() for both IPv4 and IPv6: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_gethrvtime_procfs_ioctl, [have working gethrvtime() which can be used with procfs ioctl(): yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_clock_gettime_cpu_time, [clock_gettime() can be used for retrieving process CPU time: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_after_morecore_hook, [__after_morecore_hook can track malloc()s core memory usage: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_dlsym_brk_wrappers, [dlsym(RTLD_NEXT, _) brk wrappers can track malloc()s core memory usage: yes|no (only used when cross compiling)])
+
+])
+
+AC_DEFUN(ERL_XCOMP_SYSROOT_INIT,
+[
+erl_xcomp_without_sysroot=no
+if test "$cross_compiling" = "yes"; then
+ test "$erl_xcomp_sysroot" != "" || erl_xcomp_without_sysroot=yes
+ test "$erl_xcomp_isysroot" != "" || erl_xcomp_isysroot="$erl_xcomp_sysroot"
+else
+ erl_xcomp_sysroot=
+ erl_xcomp_isysroot=
+fi
+])
+
dnl ----------------------------------------------------------------------
dnl
dnl LM_FIND_EMU_CC
@@ -113,11 +170,15 @@ dnl ----------------------------------------------------------------------
dnl
dnl LM_PROG_INSTALL_DIR
dnl
+dnl This macro may be used by any OTP application.
+dnl
dnl Figure out how to create directories with parents.
dnl (In my opinion INSTALL_DIR is a bad name, MKSUBDIRS or something is better)
dnl
dnl We prefer 'install -d', but use 'mkdir -p' if it exists.
dnl If none of these methods works, we give up.
+dnl
+
AC_DEFUN(LM_PROG_INSTALL_DIR,
[AC_CACHE_CHECK(how to create a directory including parents,
@@ -412,189 +473,84 @@ fi
dnl ----------------------------------------------------------------------
dnl
-dnl ERL_FIND_ETHR_LIB
+dnl LM_CHECK_THR_LIB
dnl
-dnl Find a thread library to use. Sets ETHR_LIBS to libraries to link
-dnl with, ETHR_X_LIBS to extra libraries to link with (same as ETHR_LIBS
-dnl except that the ethread lib itself is not included), ETHR_DEFS to
-dnl defines to compile with, ETHR_THR_LIB_BASE to the name of the
-dnl thread library which the ethread library is based on, and ETHR_LIB_NAME
-dnl to the name of the library where the ethread implementation is located.
-dnl ERL_FIND_ETHR_LIB currently searches for 'pthreads', and
-dnl 'win32_threads'. If no thread library was found ETHR_LIBS, ETHR_X_LIBS,
-dnl ETHR_DEFS, ETHR_THR_LIB_BASE, and ETHR_LIB_NAME are all set to the
-dnl empty string.
+dnl This macro may be used by any OTP application.
+dnl
+dnl LM_CHECK_THR_LIB sets THR_LIBS, THR_DEFS, and THR_LIB_NAME. It also
+dnl checks for some pthread headers which will appear in DEFS or config.h.
dnl
-AC_DEFUN(ERL_FIND_ETHR_LIB,
+AC_DEFUN(LM_CHECK_THR_LIB,
[
-ethr_modified_default_stack_size=
-
-dnl Name of lib where ethread implementation is located
-ethr_lib_name=ethread
-
-ETHR_THR_LIB_BASE=
-ETHR_THR_LIB_BASE_NAME=
-ETHR_X_LIBS=
-ETHR_LIBS=
-ETHR_LIB_NAME=
-ETHR_DEFS=
-
-dnl if test "x$host_os" = "x"; then
-dnl AC_CANONICAL_HOST
-dnl fi
-
dnl win32?
AC_MSG_CHECKING([for native win32 threads])
if test "X$host_os" = "Xwin32"; then
AC_MSG_RESULT(yes)
- # * _WIN32_WINNT >= 0x0400 is needed for
- # TryEnterCriticalSection
- # * _WIN32_WINNT >= 0x0403 is needed for
- # InitializeCriticalSectionAndSpinCount
- # The ethread lib will refuse to build if _WIN32_WINNT < 0x0403.
- #
- # -D_WIN32_WINNT should have been defined in $CPPFLAGS; fetch it
- # and save it in ETHR_DEFS.
- found_win32_winnt=no
- for cppflag in $CPPFLAGS; do
- case $cppflag in
- -DWINVER*)
- ETHR_DEFS="$ETHR_DEFS $cppflag"
- ;;
- -D_WIN32_WINNT*)
- ETHR_DEFS="$ETHR_DEFS $cppflag"
- found_win32_winnt=yes
- ;;
- *)
- ;;
- esac
- done
- if test $found_win32_winnt = no; then
- AC_MSG_ERROR([-D_WIN32_WINNT missing in CPPFLAGS])
- fi
- ETHR_X_LIBS=
- ETHR_THR_LIB_BASE=win32_threads
- AC_DEFINE(ETHR_WIN32_THREADS, 1, [Define if you have win32 threads])
+ THR_DEFS="-DWIN32_THREADS"
+ THR_LIBS=
+ THR_LIB_NAME=win32_threads
else
AC_MSG_RESULT(no)
+ THR_DEFS=
+ THR_LIBS=
+ THR_LIB_NAME=
dnl Try to find POSIX threads
dnl The usual pthread lib...
- AC_CHECK_LIB(pthread, pthread_create, ETHR_X_LIBS="-lpthread")
+ AC_CHECK_LIB(pthread, pthread_create, THR_LIBS="-lpthread")
dnl FreeBSD has pthreads in special c library, c_r...
- if test "x$ETHR_X_LIBS" = "x"; then
- AC_CHECK_LIB(c_r, pthread_create, ETHR_X_LIBS="-lc_r")
+ if test "x$THR_LIBS" = "x"; then
+ AC_CHECK_LIB(c_r, pthread_create, THR_LIBS="-lc_r")
fi
dnl On ofs1 the '-pthread' switch should be used
- if test "x$ETHR_X_LIBS" = "x"; then
+ if test "x$THR_LIBS" = "x"; then
AC_MSG_CHECKING([if the '-pthread' switch can be used])
saved_cflags=$CFLAGS
CFLAGS="$CFLAGS -pthread"
AC_TRY_LINK([#include <pthread.h>],
pthread_create((void*)0,(void*)0,(void*)0,(void*)0);,
- [ETHR_DEFS="-pthread"
- ETHR_X_LIBS="-pthread"])
+ [THR_DEFS="-pthread"
+ THR_LIBS="-pthread"])
CFLAGS=$saved_cflags
- if test "x$ETHR_X_LIBS" != "x"; then
+ if test "x$THR_LIBS" != "x"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
- if test "x$ETHR_X_LIBS" != "x"; then
- ETHR_DEFS="$ETHR_DEFS -D_THREAD_SAFE -D_REENTRANT"
- ETHR_THR_LIB_BASE=pthread
- AC_DEFINE(ETHR_PTHREADS, 1, [Define if you have pthreads])
+ if test "x$THR_LIBS" != "x"; then
+ THR_DEFS="$THR_DEFS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS"
+ THR_LIB_NAME=pthread
case $host_os in
- openbsd*)
- # The default stack size is insufficient for our needs
- # on OpenBSD. We increase it to 256 kilo words.
- ethr_modified_default_stack_size=256;;
solaris*)
- ETHR_DEFS="$ETHR_DEFS -D_POSIX_PTHREAD_SEMANTICS" ;;
+ THR_DEFS="$THR_DEFS -D_POSIX_PTHREAD_SEMANTICS" ;;
linux*)
- ETHR_DEFS="$ETHR_DEFS -D_POSIX_THREAD_SAFE_FUNCTIONS -D_GNU_SOURCE"
-
- if test X$cross_compiling = Xyes; then
- if test "X$erl_xcomp_linux_usable_sigusrx" = "X"; then
- usable_sigusrx=yes
- usable_sigusrx_guessed=yes
- else
- usable_sigusrx=$erl_xcomp_linux_usable_sigusrx
- usable_sigusrx_guessed=no
- fi
- if test "X$erl_xcomp_linux_usable_sigaltstack" = "X"; then
- usable_sigaltstack=yes
- usable_sigaltstack_guessed=yes
- else
- usable_sigaltstack=$erl_xcomp_linux_usable_sigaltstack
- usable_sigaltstack_guessed=no
- fi
- else
- # FIXME: Test for actual problems instead of kernel versions
- linux_kernel_vsn_=`uname -r`
- case $linux_kernel_vsn_ in
- [[0-1]].*|2.[[0-1]]|2.[[0-1]].*)
- usable_sigusrx=no
- usable_sigaltstack=no;;
- 2.[[2-3]]|2.[[2-3]].*)
- usable_sigusrx=yes
- usable_sigaltstack=no;;
- *)
- usable_sigusrx=yes
- usable_sigaltstack=yes;;
- esac
- usable_sigusrx_guessed=no
- usable_sigaltstack_guessed=no
- fi
-
- AC_MSG_CHECKING(if SIGUSR1 and SIGUSR2 can be used)
- AC_MSG_RESULT($usable_sigusrx)
- if test $usable_sigusrx_guessed = yes; then
- AC_MSG_WARN([result $usable_sigusrx guessed because of cross compilation])
- fi
- if test $usable_sigusrx = no; then
- ETHR_DEFS="$ETHR_DEFS -DETHR_UNUSABLE_SIGUSRX"
- fi
-
- AC_MSG_CHECKING(if sigaltstack can be used)
- AC_MSG_RESULT($usable_sigaltstack)
- if test $usable_sigaltstack_guessed = yes; then
- AC_MSG_WARN([result $usable_sigaltstack guessed because of cross compilation])
- fi
- if test $usable_sigaltstack = no; then
- ETHR_DEFS="$ETHR_DEFS -DETHR_UNUSABLE_SIGALTSTACK"
- fi
+ THR_DEFS="$THR_DEFS -D_POSIX_THREAD_SAFE_FUNCTIONS"
AC_MSG_CHECKING(for Native POSIX Thread Library)
if test X$cross_compiling = Xyes; then
- if test "X$erl_xcomp_linux_nptl" = "X"; then
- nptl=yes
- nptl_guessed=yes
- else
- nptl=$erl_xcomp_linux_nptl
- nptl_guessed=no
- fi
+ case X$erl_xcomp_linux_nptl in
+ X) nptl=cross;;
+ Xyes|Xno) 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_guessed=no
fi
AC_MSG_RESULT($nptl)
- if test $nptl_guessed = yes; then
- AC_MSG_WARN([result $nptl guessed because of cross compilation])
- fi
- if test $nptl = yes; then
- ETHR_THR_LIB_BASE_NAME=nptl
+ if test $nptl = cross; then
+ nptl=yes
+ AC_MSG_WARN([result yes guessed because of cross compilation])
fi
if test $nptl = yes; then
need_nptl_incldir=no
@@ -604,6 +560,11 @@ dnl On ofs1 the '-pthread' switch should be used
nptl_path="$C_INCLUDE_PATH:$CPATH"
if test X$cross_compiling != Xyes; then
nptl_path="$nptl_path:/usr/local/include:/usr/include"
+ else
+ IROOT="$erl_xcomp_isysroot"
+ test "$IROOT" != "" || IROOT="$erl_xcomp_sysroot"
+ test "$IROOT" != "" || AC_MSG_ERROR([Don't know where to search for includes! Please set erl_xcomp_isysroot])
+ nptl_path="$nptl_path:$IROOT/usr/local/include:$IROOT/usr/include"
fi
nptl_ws_path=
save_ifs="$IFS"; IFS=":"
@@ -618,7 +579,7 @@ dnl On ofs1 the '-pthread' switch should be used
AC_CHECK_HEADER($dir/nptl/pthread.h,
nptl_incldir=$dir/nptl)
if test "x$nptl_incldir" != "x"; then
- ETHR_DEFS="$ETHR_DEFS -isystem $nptl_incldir"
+ THR_DEFS="$THR_DEFS -isystem $nptl_incldir"
break
fi
done
@@ -627,6 +588,158 @@ dnl On ofs1 the '-pthread' switch should be used
fi
fi
fi
+ ;;
+ *) ;;
+ esac
+
+ dnl We sometimes need THR_DEFS in order to find certain headers
+ dnl (at least for pthread.h on osf1).
+ saved_cppflags=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $THR_DEFS"
+
+ dnl
+ dnl Check for headers
+ dnl
+
+ AC_CHECK_HEADER(pthread.h,
+ AC_DEFINE(HAVE_PTHREAD_H, 1, \
+[Define if you have the <pthread.h> header file.]))
+
+ dnl Some Linuxes have <pthread/mit/pthread.h> instead of <pthread.h>
+ AC_CHECK_HEADER(pthread/mit/pthread.h, \
+ AC_DEFINE(HAVE_MIT_PTHREAD_H, 1, \
+[Define if the pthread.h header file is in pthread/mit directory.]))
+
+ dnl restore CPPFLAGS
+ CPPFLAGS=$saved_cppflags
+
+ fi
+fi
+
+])
+
+dnl ----------------------------------------------------------------------
+dnl
+dnl ERL_FIND_ETHR_LIB
+dnl
+dnl NOTE! This macro may be changed at any time! Should *only* be used by
+dnl ERTS!
+dnl
+dnl Find a thread library to use. Sets ETHR_LIBS to libraries to link
+dnl with, ETHR_X_LIBS to extra libraries to link with (same as ETHR_LIBS
+dnl except that the ethread lib itself is not included), ETHR_DEFS to
+dnl defines to compile with, ETHR_THR_LIB_BASE to the name of the
+dnl thread library which the ethread library is based on, and ETHR_LIB_NAME
+dnl to the name of the library where the ethread implementation is located.
+dnl ERL_FIND_ETHR_LIB currently searches for 'pthreads', and
+dnl 'win32_threads'. If no thread library was found ETHR_LIBS, ETHR_X_LIBS,
+dnl ETHR_DEFS, ETHR_THR_LIB_BASE, and ETHR_LIB_NAME are all set to the
+dnl empty string.
+dnl
+
+AC_DEFUN(ERL_FIND_ETHR_LIB,
+[
+
+LM_CHECK_THR_LIB
+
+ETHR_THR_LIB_BASE="$THR_LIB_NAME"
+ETHR_DEFS="$THR_DEFS"
+ETHR_X_LIBS="$THR_LIBS"
+ETHR_LIBS=
+ETHR_LIB_NAME=
+
+ethr_modified_default_stack_size=
+
+dnl Name of lib where ethread implementation is located
+ethr_lib_name=ethread
+
+case "$THR_LIB_NAME" in
+
+ win32_threads)
+ # * _WIN32_WINNT >= 0x0400 is needed for
+ # TryEnterCriticalSection
+ # * _WIN32_WINNT >= 0x0403 is needed for
+ # InitializeCriticalSectionAndSpinCount
+ # The ethread lib will refuse to build if _WIN32_WINNT < 0x0403.
+ #
+ # -D_WIN32_WINNT should have been defined in $CPPFLAGS; fetch it
+ # and save it in ETHR_DEFS.
+ found_win32_winnt=no
+ for cppflag in $CPPFLAGS; do
+ case $cppflag in
+ -DWINVER*)
+ ETHR_DEFS="$ETHR_DEFS $cppflag"
+ ;;
+ -D_WIN32_WINNT*)
+ ETHR_DEFS="$ETHR_DEFS $cppflag"
+ found_win32_winnt=yes
+ ;;
+ *)
+ ;;
+ esac
+ done
+ if test $found_win32_winnt = no; then
+ AC_MSG_ERROR([-D_WIN32_WINNT missing in CPPFLAGS])
+ fi
+ AC_DEFINE(ETHR_WIN32_THREADS, 1, [Define if you have win32 threads])
+ ;;
+
+ pthread)
+ AC_DEFINE(ETHR_PTHREADS, 1, [Define if you have pthreads])
+ case $host_os in
+ openbsd*)
+ # The default stack size is insufficient for our needs
+ # on OpenBSD. We increase it to 256 kilo words.
+ ethr_modified_default_stack_size=256;;
+ linux*)
+ ETHR_DEFS="$ETHR_DEFS -D_GNU_SOURCE"
+
+ if test X$cross_compiling = Xyes; then
+ case X$erl_xcomp_linux_usable_sigusrx in
+ X) usable_sigusrx=cross;;
+ Xyes|Xno) usable_sigusrx=$erl_xcomp_linux_usable_sigusrx;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_linux_usable_sigusrx value: $erl_xcomp_linux_usable_sigusrx]);;
+ esac
+ case X$erl_xcomp_linux_usable_sigaltstack in
+ X) usable_sigaltstack=cross;;
+ Xyes|Xno) usable_sigaltstack=$erl_xcomp_linux_usable_sigaltstack;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_linux_usable_sigaltstack value: $erl_xcomp_linux_usable_sigaltstack]);;
+ esac
+ else
+ # FIXME: Test for actual problems instead of kernel versions
+ linux_kernel_vsn_=`uname -r`
+ case $linux_kernel_vsn_ in
+ [[0-1]].*|2.[[0-1]]|2.[[0-1]].*)
+ usable_sigusrx=no
+ usable_sigaltstack=no;;
+ 2.[[2-3]]|2.[[2-3]].*)
+ usable_sigusrx=yes
+ usable_sigaltstack=no;;
+ *)
+ usable_sigusrx=yes
+ usable_sigaltstack=yes;;
+ esac
+ fi
+
+ AC_MSG_CHECKING(if SIGUSR1 and SIGUSR2 can be used)
+ AC_MSG_RESULT($usable_sigusrx)
+ if test $usable_sigusrx = cross; then
+ usable_sigusrx=yes
+ AC_MSG_WARN([result yes guessed because of cross compilation])
+ fi
+ if test $usable_sigusrx = no; then
+ ETHR_DEFS="$ETHR_DEFS -DETHR_UNUSABLE_SIGUSRX"
+ fi
+
+ AC_MSG_CHECKING(if sigaltstack can be used)
+ AC_MSG_RESULT($usable_sigaltstack)
+ if test $usable_sigaltstack = cross; then
+ usable_sigaltstack=yes
+ AC_MSG_WARN([result yes guessed because of cross compilation])
+ fi
+ if test $usable_sigaltstack = no; then
+ ETHR_DEFS="$ETHR_DEFS -DETHR_UNUSABLE_SIGALTSTACK"
+ fi
AC_DEFINE(ETHR_INIT_MUTEX_IN_CHILD_AT_FORK, 1, \
[Define if mutexes should be reinitialized (instead of unlocked) in child at fork.]) ;;
@@ -635,20 +748,18 @@ dnl On ofs1 the '-pthread' switch should be used
dnl We sometimes need ETHR_DEFS in order to find certain headers
dnl (at least for pthread.h on osf1).
- saved_cppflags=$CPPFLAGS
+ saved_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $ETHR_DEFS"
dnl We need the thread library in order to find some functions
- saved_libs=$LIBS
+ saved_libs="$LIBS"
LIBS="$LIBS $ETHR_X_LIBS"
-
-
dnl
dnl Check for headers
dnl
- AC_CHECK_HEADER(pthread.h,
+ AC_CHECK_HEADER(pthread.h, \
AC_DEFINE(ETHR_HAVE_PTHREAD_H, 1, \
[Define if you have the <pthread.h> header file.]))
@@ -684,8 +795,8 @@ dnl On ofs1 the '-pthread' switch should be used
AC_CHECK_FUNC(pthread_spin_lock, \
AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \
[Define if you have the pthread_spin_lock function.]))
- case $host_os in
- linux*) # Writers may get starved
+ case "$force_linux_pthread_rwlocks-$host_os" in
+ yes-linux*) # Writers may get starved
# TODO: write a test that tests the implementation
;;
*)
@@ -702,9 +813,10 @@ dnl On ofs1 the '-pthread' switch should be used
LIBS=$saved_libs
dnl restore CPPFLAGS
CPPFLAGS=$saved_cppflags
-
- fi
-fi
+ ;;
+ *)
+ ;;
+esac
AC_MSG_CHECKING([whether default stack size should be modified])
if test "x$ethr_modified_default_stack_size" != "x"; then
@@ -735,7 +847,6 @@ AC_SUBST(ETHR_LIBS)
AC_SUBST(ETHR_LIB_NAME)
AC_SUBST(ETHR_DEFS)
AC_SUBST(ETHR_THR_LIB_BASE)
-AC_SUBST(ETHR_THR_LIB_BASE_NAME)
])
@@ -789,12 +900,6 @@ case $clock_gettime_correction in
unknown)
if test x$clock_gettime_compiles = xyes; then
if test X$cross_compiling != Xyes; then
- if test "X$erl_xcomp_linux_clock_gettime_correction" = "Xno"; then
- erl_cv_time_correction=times
- else
- erl_cv_time_correction=clock_gettime
- fi
- else
linux_kernel_vsn_=`uname -r`
case $linux_kernel_vsn_ in
[[0-1]].*|2.[[0-5]]|2.[[0-5]].*)
@@ -802,6 +907,19 @@ case $clock_gettime_correction in
*)
erl_cv_time_correction=clock_gettime;;
esac
+ else
+ case X$erl_xcomp_linux_clock_gettime_correction in
+ X)
+ erl_cv_time_correction=cross;;
+ Xyes|Xno)
+ if test $erl_xcomp_linux_clock_gettime_correction = yes; then
+ erl_cv_time_correction=clock_gettime
+ else
+ erl_cv_time_correction=times
+ fi;;
+ *)
+ AC_MSG_ERROR([Bad erl_xcomp_linux_clock_gettime_correction value: $erl_xcomp_linux_clock_gettime_correction]);;
+ esac
fi
else
erl_cv_time_correction=times
@@ -826,8 +944,9 @@ case $erl_cv_time_correction in
AC_DEFINE(CORRECT_USING_TIMES,[],
[Define if you do not have a high-res. timer & want to use times() instead])
;;
- clock_gettime)
- if test X$cross_compiling = Xyes -a X$erl_xcomp_linux_clock_gettime_correction = X; then
+ clock_gettime|cross)
+ if test $erl_cv_time_correction = cross; then
+ erl_cv_time_correction=clock_gettime
AC_MSG_WARN([result clock_gettime guessed because of cross compilation])
fi
xrtlib="-lrt"
@@ -892,11 +1011,20 @@ int main() {
],
erl_gethrvtime=procfs_ioctl,
erl_gethrvtime=false,
-if test "x$erl_xcomp_gethrvtime_procfs_ioctl" = "xyes"; then
- erl_gethrvtime=procfs_ioctl
-else
- erl_gethrvtime=false
-fi)
+[
+case X$erl_xcomp_gethrvtime_procfs_ioctl in
+ X)
+ erl_gethrvtime=cross;;
+ Xyes|Xno)
+ if test $erl_xcomp_gethrvtime_procfs_ioctl = yes; then
+ erl_gethrvtime=procfs_ioctl
+ else
+ erl_gethrvtime=false
+ fi;;
+ *)
+ AC_MSG_ERROR([Bad erl_xcomp_gethrvtime_procfs_ioctl value: $erl_xcomp_gethrvtime_procfs_ioctl]);;
+esac
+])
case $erl_gethrvtime in
procfs_ioctl)
@@ -905,7 +1033,13 @@ case $erl_gethrvtime in
AC_MSG_RESULT(uses ioctl to procfs)
;;
*)
- AC_MSG_RESULT(not working)
+ if test $erl_gethrvtime = cross; then
+ erl_gethrvtime=false
+ AC_MSG_RESULT(cross)
+ AC_MSG_WARN([result 'not working' guessed because of cross compilation])
+ else
+ AC_MSG_RESULT(not working)
+ fi
dnl
dnl Check if clock_gettime (linux) is working
@@ -938,29 +1072,35 @@ case $erl_gethrvtime in
exit(0); return 0;
}
],
- erl_clock_gettime=true,
- erl_clock_gettime=false,
- if test "x$erl_xcomp_clock_gettime" = "xyes"; then
- erl_clock_gettime=true
- else
- erl_clock_gettime=false
- fi)
+ erl_clock_gettime=yes,
+ erl_clock_gettime=no,
+ [
+ case X$erl_xcomp_clock_gettime_cpu_time in
+ X) erl_clock_gettime=cross;;
+ Xyes|Xno) erl_clock_gettime=$erl_xcomp_clock_gettime_cpu_time;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_clock_gettime_cpu_time value: $erl_xcomp_clock_gettime_cpu_time]);;
+ esac
+ ])
LIBS=$save_libs
case $host_os in
linux*)
- AC_MSG_RESULT([not stable, disabled])
+ AC_MSG_RESULT([no; not stable])
LIBRT=$xrtlib
;;
*)
+ AC_MSG_RESULT($erl_clock_gettime)
case $erl_clock_gettime in
- true)
+ yes)
AC_DEFINE(HAVE_CLOCK_GETTIME,[],
[define if clock_gettime() works for getting process time])
- AC_MSG_RESULT(using clock_gettime)
LIBRT=-lrt
;;
+ cross)
+ erl_clock_gettime=no
+ AC_MSG_WARN([result no guessed because of cross compilation])
+ LIBRT=$xrtlib
+ ;;
*)
- AC_MSG_RESULT(not working)
LIBRT=$xrtlib
;;
esac
View
4 erts/autoconf/win32.config.cache
@@ -186,10 +186,12 @@ ac_cv_prog_CC=${ac_cv_prog_CC=cc.sh}
ac_cv_prog_CPP=${ac_cv_prog_CPP='cc.sh -E'}
ac_cv_prog_CXX=${ac_cv_prog_CXX=cc.sh}
ac_cv_prog_DED_LD=${ac_cv_prog_DED_LD=ld.sh}
+ac_cv_prog_ac_ct_DED_LD=${ac_cv_prog_ac_ct_DED_LD=ld.sh}
ac_cv_prog_M4=${ac_cv_prog_M4=m4}
ac_cv_prog_PERL=${ac_cv_prog_PERL=perl}
ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=true}
-ac_cv_prog_ac_ct_LD=${ac_cv_prog_ac_ct_LD=ld}
+ac_cv_prog_LD=${ac_cv_prog_LD=ld.sh}
+ac_cv_prog_ac_ct_LD=${ac_cv_prog_ac_ct_LD=ld.sh}
ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes}
ac_cv_prog_cc_stdc=${ac_cv_prog_cc_stdc=}
ac_cv_prog_cxx_g=${ac_cv_prog_cxx_g=no}
View
545 erts/configure.in
@@ -23,6 +23,8 @@ dnl autoconf convention that should be cleaned up.
AC_INIT(vsn.mk)
AC_PREREQ(2.59)
+LM_PRECIOUS_VARS
+
if test "x$no_recursion" != "xyes" -a "x$OVERRIDE_CONFIG_CACHE" = "x"; then
# We do not want to use a common cache!
cache_file=/dev/null
@@ -84,6 +86,9 @@ if test "X$host" != "Xfree_source" -a "X$host" != "Xwin32"; then
else
host_os=$host
fi
+
+ERL_XCOMP_SYSROOT_INIT
+
AC_ISC_POSIX
AC_CONFIG_HEADER($host/config.h:config.h.in include/internal/$host/ethread_header_config.h:include/internal/ethread_header_config.h.in include/$host/erl_int_sizes_config.h:include/erl_int_sizes_config.h.in)
@@ -94,6 +99,22 @@ enable_child_waiter_thread=no
ENABLE_ALLOC_TYPE_VARS=
AC_SUBST(ENABLE_ALLOC_TYPE_VARS)
+AC_ARG_ENABLE(bootstrap-only,
+[ --enable-bootstrap-only enable bootstrap only configuration],
+[ if test "X$enableval" = "Xyes"; then
+ # Disable stuff not necessary in a bootstrap only system in order
+ # to speed up things by reducing the amount of stuff needing to be
+ # built...
+ enable_threads=no
+ enable_smp_support=no
+ with_termcap=no
+ with_ssl=no
+ with_ssl_zlib=no
+ enable_hipe=no
+ enable_sctp=no
+ fi
+])
+
AC_ARG_ENABLE(threads,
[ --enable-threads enable async thread support
--disable-threads disable async thread support],
@@ -734,8 +755,17 @@ HCC='$(CC)' AC_SUBST(HCC)
HCFLAGS="" AC_SUBST(HCFLAGS)
HCFLAGS="$HCFLAGS -I${ERL_TOP}/erts/$host"
vxworks_reclaim="" AC_SUBST(vxworks_reclaim)
-LD='$(CC)' AC_SUBST(LD)
+dnl We want to use $(CC) as linker for the emulator regardless of
+dnl what the user say. This might not be the right way to do it, but
+dnl for now that is the way we do it.
+USER_LD=$LD
+USER_LDFLAGS="$LDFLAGS"
+LD='$(CC)'
+AC_SUBST(LD)
+
+LDFLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
+AC_SUBST(LDFLAG_RUNTIME_LIBRARY_PATH)
dnl Check for cygwin and object/exe files extension
dnl AC_CYGWIN is deprecated
@@ -1474,9 +1504,11 @@ fi
fi
-if test "x$erl_xcomp_bigendian" != "x"; then
- ac_cv_c_bigendian=$erl_xcomp_bigendian
-fi
+case X$erl_xcomp_bigendian in
+ X) ;;
+ Xyes|Xno) ac_cv_c_bigendian=$erl_xcomp_bigendian;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_bigendian value: $erl_xcomp_bigendian]);;
+esac
AC_C_BIGENDIAN
@@ -1514,18 +1546,22 @@ int main(int argc, char **argv) {
}
}
],, have_getaddrinfo=no,
- if test "x$erl_xcomp_getaddrinfo" != "x"; then
- have_getaddrinfo=$erl_xcomp_getaddrinfo
- else
- have_getaddrinfo=no
- fi)
- if test $have_getaddrinfo = yes; then
- AC_MSG_RESULT(yes)
+ [
+ case X$erl_xcomp_getaddrinfo in
+ X) have_getaddrinfo=cross;;
+ Xyes|Xno) have_getaddrinfo=$erl_xcomp_getaddrinfo;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_getaddrinfo value: $erl_xcomp_getaddrinfo]);;
+ esac
+ ])
+ AC_MSG_RESULT($have_getaddrinfo)
+ case $have_getaddrinfo in
+ yes)
AC_DEFINE(HAVE_GETADDRINFO, [1],
- [Define to 1 if you have a good `getaddrinfo' function.])
- else
- AC_MSG_RESULT(no)
- fi
+ [Define to 1 if you have a good `getaddrinfo' function.]);;
+ cross)
+ AC_MSG_WARN([result no guessed because of cross compilation]);;
+ *) ;;
+ esac
fi
AC_CHECK_FUNCS([getnameinfo getipnodebyname getipnodebyaddr gethostbyname2])
@@ -1807,16 +1843,21 @@ int main(void)
],
erts_cv___after_morecore_hook_can_track_malloc=yes,
erts_cv___after_morecore_hook_can_track_malloc=no,
- if test "x$erl_xcomp_after_morecore_hook" != "x"; then
- erts_cv___after_morecore_hook_can_track_malloc=$erl_xcomp_after_morecore_hook
- else
- erts_cv___after_morecore_hook_can_track_malloc=no
- fi)])
+ [
+ case X$erl_xcomp_after_morecore_hook in
+ X) erts_cv___after_morecore_hook_can_track_malloc=cross;;
+ Xyes|Xno) erts_cv___after_morecore_hook_can_track_malloc=$erl_xcomp_after_morecore_hook;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_after_morecore_hook value: $erl_xcomp_after_morecore_hook]);;
+ esac
+ ]
+ )])
-if test $erts_cv___after_morecore_hook_can_track_malloc = yes; then
- AC_DEFINE(ERTS___AFTER_MORECORE_HOOK_CAN_TRACK_MALLOC, 1, \
-[Define if __after_morecore_hook can track malloc()s core memory use.])
-fi
+case $erts_cv___after_morecore_hook_can_track_malloc in
+ yes) AC_DEFINE(ERTS___AFTER_MORECORE_HOOK_CAN_TRACK_MALLOC, 1, \
+[Define if __after_morecore_hook can track malloc()s core memory use.]);;
+ cross) AC_MSG_WARN([result no guessed because of cross compilation]);;
+ *) ;;
+esac
if test "x$ac_cv_func_sbrk" = "xyes"; then
AC_CACHE_CHECK([types of sbrk()s return value and argument],
@@ -2069,15 +2110,21 @@ int main(void)
],
erts_cv_brk_wrappers_can_track_malloc=yes,
erts_cv_brk_wrappers_can_track_malloc=no,
- if test "x$erl_xcomp_dlsym_brk_wrappers" != "x"; then
- erts_cv_brk_wrappers_can_track_malloc=$erl_xcomp_dlsym_brk_wrappers
- else
- erts_cv_brk_wrappers_can_track_malloc=no
- fi)])
- if test $erts_cv_brk_wrappers_can_track_malloc = yes; then
+ [
+ case X$erl_xcomp_dlsym_brk_wrappers in
+ X) erts_cv_brk_wrappers_can_track_malloc=cross;;
+ Xyes|Xno) erts_cv_brk_wrappers_can_track_malloc=$erl_xcomp_dlsym_brk_wrappers;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_dlsym_brk_wrappers value: $erl_xcomp_dlsym_brk_wrappers]);;
+ esac
+ ])])
+ case $erts_cv_brk_wrappers_can_track_malloc in
+ yes)
AC_DEFINE(ERTS_BRK_WRAPPERS_CAN_TRACK_MALLOC, 1, \
-[Define if sbrk()/brk() wrappers can track malloc()s core memory use])
- fi
+[Define if sbrk()/brk() wrappers can track malloc()s core memory use]);;
+ cross)
+ AC_MSG_WARN([result no guessed because of cross compilation]);;
+ *) ;;
+ esac
fi
dnl Restore LIBS
@@ -2090,7 +2137,7 @@ LM_SYS_MULTICAST
ERL_TIME_CORRECTION
AC_CHECK_PROG(M4, m4, m4)
dnl check to auto-enable hipe here...
-if test X${enable_hipe} != Xno; then
+if test "$cross_compiling" != "yes" && test X${enable_hipe} != Xno; then
if test -z "$M4"; then
enable_hipe=no
AC_MSG_NOTICE([HiPE disabled as no valid m4 is found in PATH])
@@ -2657,21 +2704,26 @@ int main(int argc, const char **argv)
return do_check();
}
],
-erl_ok=reliable,
-erl_ok=unreliable,
-if test "x$erl_xcomp_reliable_fpe" = "xyes"; then
- erl_ok=reliable
-else
- erl_ok=unreliable
-fi)
- if test $erl_ok = unreliable; then
- AC_DEFINE(NO_FPE_SIGNALS,[],
- [Define if floating points exceptions are non-existing/not reliable])
- AC_MSG_RESULT([unreliable; testing in software instead])
- FPE=unreliable
- else
+erl_ok=yes,
+erl_ok=no,
+[
+case X$erl_xcomp_reliable_fpe in
+ X) erl_ok=cross;;
+ Xyes|Xno) erl_ok=$erl_xcomp_reliable_fpe;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_reliable_fpe value: $erl_xcomp_reliable_fpe]);;
+esac
+])
+
+ if test $erl_ok = yes; then
+ FPE=reliable
AC_MSG_RESULT(reliable)
- FPE=reliable
+ else
+ FPE=unreliable
+ AC_MSG_RESULT([unreliable; testing in software instead])
+ AC_DEFINE(NO_FPE_SIGNALS,[],[Define if floating points exceptions are non-existing/not reliable])
+ if test $erl_ok = cross; then
+ AC_MSG_WARN([result unreliable guessed because of cross compilation])
+ fi
fi
fi
@@ -2837,45 +2889,46 @@ main()
],
poll_works=yes,
poll_works=no,
-poll_works=$erl_xcomp_poll)
-
-if test "X$poll_works" != "X"; then
- guessed_poll_works=no
-else
- guessed_poll_works=yes
- case $host_os in
- darwin*) poll_works=no;;
- *) poll_works=yes;;
- esac
-fi
+[
+case X$erl_xcomp_poll in
+ X) poll_works=cross;;
+ Xyes|Xno) poll_works=$erl_xcomp_poll;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_poll value: $erl_xcomp_poll]);;
+esac
+])
fi
-case $poll_works in
-yes)
- AC_DEFINE(ERTS_USE_POLL, 1, [Define if poll() should be used instead of select()])
- AC_MSG_RESULT(yes)
- ;;
-*)
+case $poll_works-$host_os in
+ no-*|cross-darwin*)
#
# The USE_SELECT define is used by the ssl application (should not
# be used by erts).
#
- poll_works=no
AC_DEFINE(USE_SELECT, 1, [Define if select() should be used instead of poll()])
- AC_MSG_RESULT([no; non-existing, broken, or based on select()])
- ;;
+ if test $poll_works = cross; then
+ AC_MSG_RESULT(cross)
+ AC_MSG_WARN([result no guessed based on OS ($host_os) because of cross compilation])
+ else
+ AC_MSG_RESULT([no; non-existing, broken, or based on select()])
+ fi
+ poll_works=no;;
+ yes-*|cross-*)
+ AC_DEFINE(ERTS_USE_POLL, 1, [Define if poll() should be used instead of select()])
+ if test $poll_works = cross; then
+ AC_MSG_RESULT(cross)
+ AC_MSG_WARN([result yes guessed based on OS ($host_os) because of cross compilation])
+ else
+ AC_MSG_RESULT(yes)
+ fi
+ poll_works=yes;;
esac
-if test $guessed_poll_works = yes; then
- AC_MSG_WARN([result $poll_works guessed based on OS ($host_os) because of cross compilation])
-fi
-
#
# If kqueue() found, check that it can be selected or polled on...
#
if test $have_kernel_poll = kqueue; then
- if test $poll_works = true; then
+ if test $poll_works = yes; then
kqueue_with=poll
else
kqueue_with=select
@@ -2907,19 +2960,25 @@ int main(void) {
return 0;
}
],
- ok_kqueue=true,
- ok_kqueue=false,
- if test "x$erl_xcomp_kqueue" = "xyes"; then
- ok_kqueue=true
- else
- ok_kqueue=false
- fi)
- if test $ok_kqueue = true; then
- AC_MSG_RESULT(yes);
- else
- AC_MSG_RESULT(no);
+ ok_kqueue=yes,
+ ok_kqueue=no,
+ [
+ case X$erl_xcomp_kqueue in
+ X) ok_kqueue=cross;;
+ Xyes|Xno) ok_kqueue=$erl_xcomp_kqueue;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_kqueue value: $erl_xcomp_kqueue]);;
+ esac
+ ])
+ AC_MSG_RESULT($ok_kqueue);
+ case $ok_kqueue in
+ yes)
+ ;;
+ cross)
have_kernel_poll=no
- fi
+ AC_MSG_WARN([result no guessed because of cross compilation]);;
+ *)
+ have_kernel_poll=no;;
+ esac
fi
#
@@ -3006,16 +3065,23 @@ int main(void) {
],
copying_putenv=yes,
copying_putenv=no,
-if test "x$erl_xcomp_putenv_copy" != "x"; then
- copying_putenv=$erl_xcomp_putenv_copy
-else
- copying_putenv=no
-fi)
+[
+case X$erl_xcomp_putenv_copy in
+ X) copying_putenv=cross;;
+ Xyes|Xno) copying_putenv=$erl_xcomp_putenv_copy;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_putenv_copy value: $erl_xcomp_putenv_copy]);;
+esac
+])
-if test $copying_putenv = yes; then
- AC_DEFINE(HAVE_COPYING_PUTENV,[1],[Define if you have a putenv() that stores a copy of the key-value pair])
-fi
AC_MSG_RESULT($copying_putenv)
+case $copying_putenv in
+ yes)
+ AC_DEFINE(HAVE_COPYING_PUTENV,[1],\
+[Define if you have a putenv() that stores a copy of the key-value pair]);;
+ cross)
+ AC_MSG_WARN([result no guessed because of cross compilation]);;
+ *) ;;
+esac
dnl ----------------------------------------------------------------------
dnl Stuff that should be moved into their respective application
@@ -3043,29 +3109,39 @@ dnl crypto
#
#--------------------------------------------------------------------
-DED_INCLUDE="-I${ERL_TOP}/erts/emulator/beam -I${ERL_TOP}/erts/include -I${ERL_TOP}/erts/include/$host"
+DED_SYS_INCLUDE="-I${ERL_TOP}/erts/emulator/beam -I${ERL_TOP}/erts/include -I${ERL_TOP}/erts/include/$host -I${ERL_TOP}/erts/include/internal -I${ERL_TOP}/erts/include/internal/$host -I${ERL_TOP}/erts/emulator/sys/$ERLANG_OSTYPE"
-DED_CFLAGS="$DED_INCLUDE $CFLAGS $CPPFLAGS $EMU_THR_DEFS"
+if test "X$ETHR_DEFS" = "X"; then
+ DED_THR_DEFS="-D_THREAD_SAFE -D_REENTRANT"
+else
+ DED_THR_DEFS="$ETHR_DEFS"
+fi
+DED_EMU_THR_DEFS=$EMU_THR_DEFS
+DED_CFLAGS="$CFLAGS $CPPFLAGS"
if test "x$GCC" = xyes; then
DED_CFLAGS="$DED_CFLAGS -fPIC"
fi
-STATIC_CFLAGS=""
+DED_EXT=so
+case $host_os in
+ win32) DED_EXT=dll;;
+ darwin*)
+ DED_CFLAGS="$DED_CFLAGS -fno-common"
+ if test "X$STATIC_CFLAGS" = "X"; then
+ STATIC_CFLAGS="-mdynamic-no-pic"
+ fi;;
+ *)
+ ;;
+esac
-# If DED_LD is set in environment, we expect all DED variables to be specified
-# (cross compiling)
+# If DED_LD is set in environment, we expect all DED_LD* variables
+# to be specified (cross compiling)
if test "x$DED_LD" = "x"; then
-if test "x$LD" = "x"; then
- DED_LD=ld
-else
- DED_LD=$LD
-fi
DED_LD_FLAG_RUNTIME_LIBRARY_PATH="-R"
-
case $host_os in
win32)
- DED_LD=ld.sh
+ DED_LD="ld.sh"
DED_LDFLAGS="-dll"
DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
;;
@@ -3099,21 +3175,20 @@ case $host_os in
if test X${enable_darwin_universal} = Xyes; then
DED_LDFLAGS="-arch ppc -arch i386 $DED_LDFLAGS"
fi
- DED_CFLAGS="$DED_CFLAGS -fno-common"
DED_LD="$CC"
- DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
- STATIC_CFLAGS="-mdynamic-no-pic"
+ DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
;;
linux*)
DED_LD="$CC"
+ DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
DED_LDFLAGS="-shared -Wl,-Bsymbolic"
- DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
if test X${enable_m64_build} = Xyes; then
DED_LDFLAGS="-m64 $DED_LDFLAGS"
fi
;;
freebsd*)
DED_LD="$CC"
+ DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
DED_LDFLAGS="-shared"
if test X${enable_m64_build} = Xyes; then
DED_LDFLAGS="-m64 $DED_LDFLAGS"
@@ -3131,8 +3206,16 @@ case $host_os in
;;
esac
+if test "$DED_LD" = "" && test "$USER_LD" != ""; then
+ DED_LD="$USER_LD"
+ DED_LDFLAGS="$USER_LDFLAGS $DED_LDFLAGS"
fi
+fi # "x$DED_LD" = "x"
+
+AC_CHECK_TOOL(DED_LD, ld, false)
+test "$DED_LD" != "false" || AC_MSG_ERROR([No linker found])
+
AC_MSG_CHECKING(for compiler flags for loadable drivers)
AC_MSG_RESULT([$DED_CFLAGS])
AC_MSG_CHECKING(for linker for loadable drivers)
@@ -3146,10 +3229,14 @@ else
AC_MSG_RESULT([not found])
fi
+AC_SUBST(DED_EXT)
+AC_SUBST(DED_SYS_INCLUDE)
AC_SUBST(DED_CFLAGS)
AC_SUBST(DED_LD)
AC_SUBST(DED_LDFLAGS)
AC_SUBST(DED_LD_FLAG_RUNTIME_LIBRARY_PATH)
+AC_SUBST(DED_THR_DEFS)
+AC_SUBST(DED_EMU_THR_DEFS)
AC_SUBST(STATIC_CFLAGS)
dnl
@@ -3172,6 +3259,9 @@ dnl use "PATH/include" and "PATH/lib".
AC_SUBST(SSL_INCLUDE)
AC_SUBST(SSL_ROOT)
AC_SUBST(SSL_LIBDIR)
+AC_SUBST(SSL_CC_RUNTIME_LIBRARY_PATH)
+AC_SUBST(SSL_LD_RUNTIME_LIBRARY_PATH)
+AC_SUBST(SSL_DED_LD_RUNTIME_LIBRARY_PATH)
AC_SUBST(SSL_DYNAMIC_ONLY)
AC_SUBST(SSL_LINK_WITH_KERBEROS)
AC_SUBST(STATIC_KERBEROS_LIBS)
@@ -3179,6 +3269,8 @@ AC_SUBST(SSL_LINK_WITH_ZLIB)
AC_SUBST(STATIC_ZLIB_LIBS)
AC_SUBST(OPENSSL_CMD)
+std_ssl_locations="/usr/local /usr/sfw /opt/local /usr /usr/pkg /usr/local/openssl /usr/lib/openssl /usr/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl"
+
AC_ARG_WITH(ssl-zlib,
[ --with-ssl-zlib=PATH specify location of ZLib to be used by OpenSSL
--with-ssl-zlib link SSL with Zlib (default if found)
@@ -3188,18 +3280,20 @@ AC_ARG_WITH(ssl-zlib,
if test "x$with_ssl_zlib" = "xno"; then
SSL_LINK_WITH_ZLIB=no
STATIC_ZLIB_LIBS=
-elif test "x$with_ssl_zlib" = "xyes" -o "x$with_ssl_zlib" = "x" ;then
- if test "x$MIXED_CYGWIN" = "xyes"; then
+elif test "x$with_ssl_zlib" = "xyes" || test "x$with_ssl_zlib" = "x"; then
+ if test $erl_xcomp_without_sysroot = yes; then
+ AC_MSG_WARN([Cannot search for zlib; missing cross system root (erl_xcomp_sysroot).])
+ SSL_LINK_WITH_ZLIB=no
+ STATIC_ZLIB_LIBS=
+ elif test "x$MIXED_CYGWIN" = "xyes"; then
SSL_LINK_WITH_ZLIB=no
STATIC_ZLIB_LIBS=
else
SSL_LINK_WITH_ZLIB=no
STATIC_ZLIB_LIBS=
AC_MSG_CHECKING(for static ZLib to be used by SSL in standard locations)
- for dir in /usr/local /usr/sfw /usr /usr/pkg \
- /usr/local/openssl /usr/lib/openssl /usr/openssl \
- /usr/local/ssl /usr/lib/ssl /usr/ssl
- do
+ for rdir in $std_ssl_locations; do
+ dir="$erl_xcomp_sysroot$rdir"
if test "x$ac_cv_sizeof_void_p" = "x8"; then
if test -f "$dir/lib64/libz.a"; then
SSL_LINK_WITH_ZLIB=yes
@@ -3280,14 +3374,21 @@ done
SSL_DYNAMIC_ONLY=$enable_dynamic_ssl
-if test "x$with_ssl" = "xno"; then
+case "$erl_xcomp_without_sysroot-$with_ssl" in
+ yes-* | no-no)
SSL_APP=
CRYPTO_APP=
SSH_APP=
+ if test "$with_ssl" = "no"; then
+ skip="User gave --without-ssl option"
+ else
+ skip="Cannot search for ssl; missing cross system root (erl_xcomp_sysroot)."
+ fi
for a in ssl crypto ssh; do
- echo "User gave --without-ssl option" > $ERL_TOP/lib/$a/SKIP
+ echo "$skip" > $ERL_TOP/lib/$a/SKIP
done
-elif test "x$with_ssl" = "xyes" -o "x$with_ssl" = "x" ;then
+ ;;
+ no-yes | no- )
# On windows, we could try to find the installation
# of Shining Light OpenSSL, which can be found by poking in
# the uninstall section in the registry, it's worth a try...
@@ -3314,20 +3415,19 @@ elif test "x$with_ssl" = "xyes" -o "x$with_ssl" = "x" ;then
SSH_APP=ssh
AC_MSG_CHECKING(for OpenSSL >= 0.9.7 in standard locations)
- for dir in $extra_dir /cygdrive/c/OpenSSL \
- /usr/local /usr/sfw /opt/local /usr /usr/pkg \
- /usr/local/openssl /usr/lib/openssl /usr/openssl \
- /usr/local/ssl /usr/lib/ssl /usr/ssl
- do
- if test -f $dir/include/openssl/opensslv.h; then
+ for rdir in $extra_dir /cygdrive/c/OpenSSL $std_ssl_locations; do
+ dir="$erl_xcomp_sysroot$rdir"
+ if test -f "$erl_xcomp_isysroot$rdir/include/openssl/opensslv.h"; then
is_real_ssl=yes
SSL_ROOT="$dir"
if test "x$MIXED_CYGWIN" = "xyes" ; then
- if test -f "$dir/lib/VC/ssleay32.lib" -o \
- -f "$dir/lib/VC/openssl.lib"; then
+ if test -f "$dir/lib/VC/ssleay32.lib" || \
+ test -f "$dir/lib/VC/openssl.lib"; then
+ SSL_RUNTIME_LIBDIR="$rdir/lib/VC"
SSL_LIBDIR="$dir/lib/VC"
- elif test -f "$dir/lib/ssleay32.lib" -o \
- -f "$dir/lib/openssl.lib"; then
+ elif test -f "$dir/lib/ssleay32.lib" || \
+ test -f "$dir/lib/openssl.lib"; then
+ SSL_RUNTIME_LIBDIR="$rdir/lib"
SSL_LIBDIR="$dir/lib"
else
is_real_ssl=no
@@ -3335,31 +3435,42 @@ elif test "x$with_ssl" = "xyes" -o "x$with_ssl" = "x" ;then
else
if test "x$ac_cv_sizeof_void_p" = "x8"; then
if test -f "$dir/lib64/libcrypto.a"; then
+ SSL_RUNTIME_LIBDIR="$rdir/lib64"
SSL_LIBDIR="$dir/lib64"
elif test -f "$dir/lib/64/libcrypto.a"; then
+ SSL_RUNTIME_LIBDIR="$rdir/lib/64"
SSL_LIBDIR="$dir/lib/64"
elif test -f "$dir/lib64/libcrypto.so"; then
+ SSL_RUNTIME_LIBDIR="$rdir/lib64"
SSL_LIBDIR="$dir/lib64"
elif test -f "$dir/lib/64/libcrypto.so"; then
+ SSL_RUNTIME_LIBDIR="$rdir/lib/64"
SSL_LIBDIR="$dir/lib/64"
else
+ SSL_RUNTIME_LIBDIR="$rdir/lib"
SSL_LIBDIR="$dir/lib"
fi
else
+ SSL_RUNTIME_LIBDIR="$rdir/lib"
SSL_LIBDIR="$dir/lib"
fi
fi
if test '!' -f $SSL_LIBDIR/libcrypto.a; then
SSL_DYNAMIC_ONLY=yes
fi
- SSL_BINDIR="$dir/bin"
+ SSL_BINDIR="$rdir/bin"
dnl Should one use EXEEXT or ac_exeext?
- if test -f "$SSL_BINDIR/openssl$EXEEXT"; then
+ if test -f "$erl_xcomp_sysroot$SSL_BINDIR/openssl$EXEEXT"; then
+ if test "$cross_compiling" = "yes"; then
+ dnl Cannot test it; hope it is working...
+ OPENSSL_CMD="$SSL_BINDIR/openssl"
+ else
if "$SSL_BINDIR/openssl" version > /dev/null 2>&1; then
OPENSSL_CMD="$SSL_BINDIR/openssl"
else
is_real_ssl=no
fi
+ fi
else
is_real_ssl=no
fi
@@ -3403,7 +3514,7 @@ dnl Should one use EXEEXT or ac_exeext?
LIBS="$saveLIBS"
fi
fi
- if test "x$ssl_found" = "xyes" -a "x$ssl_linkable" = "xyes" ; then
+ if test "x$ssl_found" = "xyes" && test "x$ssl_linkable" = "xyes"; then
AC_MSG_RESULT([$dir])
break;
fi
@@ -3417,13 +3528,14 @@ dnl Should one use EXEEXT or ac_exeext?
dnl
case $host_os in
openbsd*)
- if test -f /usr/include/openssl/opensslv.h; then
+ if test -f "$erl_xcomp_isysroot/usr/include/openssl/opensslv.h"; then
# Trust OpenBSD to have everything the in the correct locations.
ssl_found=yes
ssl_linkable=yes
- SSL_ROOT="/usr/sbin"
+ SSL_ROOT="$erl_xcomp_sysroot/usr"
AC_MSG_RESULT([$SSL_ROOT])
- SSL_LIB="/usr/lib"
+ SSL_RUNTIME_LIB="/usr/lib"
+ SSL_LIB="$erl_xcomp_sysroot/usr/lib"
SSL_BINDIR="/usr/sbin"
OPENSSL_CMD="$SSL_BINDIR/openssl"
dnl OpenBSD requires us to link with -L and -l
@@ -3436,7 +3548,7 @@ dnl Now, certain linuxes have a 64bit libcrypto
dnl that cannot build shared libraries (i.e. not PIC)
dnl One could argue that this is wrong, but
dnl so it is - be adoptable
- if test "x$ssl_found" = "xyes" -a "x$ssl_linkable" = "xyes" -a "x$SSL_DYNAMIC_ONLY" != "xyes" ; then
+ if test "$ssl_found" = "yes" && test "$ssl_linkable" = "yes" && test "$SSL_DYNAMIC_ONLY" != "yes"; then
case $host_os in
linux*)
saveCFLAGS="$CFLAGS"
@@ -3468,7 +3580,7 @@ dnl so it is - be adoptable
- if test "x$ssl_found" != "xyes" -o "x$ssl_linkable" != "xyes"; then
+ if test "x$ssl_found" != "xyes" || test "x$ssl_linkable" != "xyes"; then
if test "x$ssl_found" = "xyes"; then
AC_MSG_RESULT([found; but not usable])
else
@@ -3483,13 +3595,21 @@ dnl so it is - be adoptable
echo "No usable OpenSSL found" > $ERL_TOP/lib/$a/SKIP
done
fi
-else
+ ;;
+ *)
+ if test "$cross_compiling" = "yes"; then
+ case "$with_ssl" in
+ "$erl_xcomp_sysroot"*) ;;
+ *) AC_MSG_ERROR([Invalid path to option --with-ssl=PATH (not a subdirectory to cross system root)]);;
+ esac
+ fi
+
# Option given with PATH to package
if test ! -d "$with_ssl" ; then
AC_MSG_ERROR(Invalid path to option --with-ssl=PATH)
fi
SSL_ROOT="$with_ssl"
- if test "x$MIXED_CYGWIN" = "xyes" -a -d "$with_ssl/lib/VC"; then
+ if test "x$MIXED_CYGWIN" = "xyes" && test -d "$with_ssl/lib/VC"; then
SSL_LIBDIR="$with_ssl/lib/VC"
elif test "x$ac_cv_sizeof_void_p" = "x8"; then
if test -f "$with_ssl/lib64/libcrypto.a"; then
@@ -3514,7 +3634,12 @@ else
SSL_APP=ssl
CRYPTO_APP=crypto
SSH_APP=ssh
-fi
+ if test "$cross_compiling" = "yes"; then
+ SSL_RUNTIME_LIBDIR=`echo "$SSL_LIBDIR" | sed -n "s|^$erl_xcomp_sysroot\(.*\)\$|\1|p"`
+ else
+ SSL_RUNTIME_LIBDIR="$SSL_LIBDIR"
+ fi
+esac
if test "x$SSL_APP" != "x" ; then
dnl We found openssl, now check if we use kerberos 5 support
@@ -3530,19 +3655,19 @@ if test "x$SSL_APP" != "x" ; then
AC_MSG_RESULT([yes])
ssl_krb5_enabled=yes
if test "x$SSL_DYNAMIC_ONLY" != "xyes"; then
- if test -f $SSL_LIBDIR/libkrb5.a; then
+ if test -f "$SSL_LIBDIR/libkrb5.a"; then
SSL_LINK_WITH_KERBEROS=yes
STATIC_KERBEROS_LIBS="$SSL_LIBDIR/libkrb5.a"
- if test -f $SSL_LIBDIR/libkrb5support.a; then
+ if test -f "$SSL_LIBDIR/libkrb5support.a"; then
STATIC_KERBEROS_LIBS="$STATIC_KERBEROS_LIBS $SSL_LIBDIR/libkrb5support.a"
fi
- if test -f $SSL_LIBDIR/libk5crypto.a; then
+ if test -f "$SSL_LIBDIR/libk5crypto.a"; then
STATIC_KERBEROS_LIBS="$STATIC_KERBEROS_LIBS $SSL_LIBDIR/libk5crypto.a"
fi
- if test -f $SSL_LIBDIR/libresolv.a; then
+ if test -f "$SSL_LIBDIR/libresolv.a"; then
STATIC_KERBEROS_LIBS="$STATIC_KERBEROS_LIBS $SSL_LIBDIR/libresolv.a"
fi
- if test -f $SSL_LIBDIR/libcom_err.a; then
+ if test -f "$SSL_LIBDIR/libcom_err.a"; then
STATIC_KERBEROS_LIBS="$STATIC_KERBEROS_LIBS $SSL_LIBDIR/libcom_err.a"
fi
else
@@ -3568,10 +3693,12 @@ if test "x$SSL_APP" != "x" ; then
SSL_KRB5_INCLUDE=
if test "x$ssl_krb5_enabled" = "xyes" ; then
AC_MSG_CHECKING(for krb5.h in standard locations)
- for dir in $extra_dir $SSL_ROOT/include $SSL_ROOT/include/openssl \
- $SSL_ROOT/include/kerberos /cygdrive/c/kerberos/include \
- /usr/local/kerberos/include /usr/kerberos/include \
- /usr/include
+ for dir in $extra_dir "$SSL_ROOT/include" "$SSL_ROOT/include/openssl" \
+ "$SSL_ROOT/include/kerberos" \
+ "$erl_xcomp_isysroot/cygdrive/c/kerberos/include" \
+ "$erl_xcomp_isysroot/usr/local/kerberos/include" \
+ "$erl_xcomp_isysroot/usr/kerberos/include" \
+ "$erl_xcomp_isysroot/usr/include"
do
if test -f "$dir/krb5.h" ; then
SSL_KRB5_INCLUDE="$dir"
@@ -3596,6 +3723,99 @@ fi
done # while test ssl_done != yes
+SSL_CC_RUNTIME_LIBRARY_PATH=
+SSL_LD_RUNTIME_LIBRARY_PATH=
+SSL_DED_LD_RUNTIME_LIBRARY_PATH=
+cc_rflg="$CFLAG_RUNTIME_LIBRARY_PATH"
+ld_rflg="$LDFLAG_RUNTIME_LIBRARY_PATH"
+ded_ld_rflg="$DED_LD_FLAG_RUNTIME_LIBRARY_PATH"
+
+if test "$SSL_APP" != "" && test "$SSL_DYNAMIC_ONLY" = "yes" && \
+ { test "$cc_rflg" != "" || test "$ld_rflg" != "" || test "$ded_ld_rflg" != ""; } ; then
+
+ AC_MSG_CHECKING(for ssl runtime library path to use)
+
+ libdirs="/lib"
+
+ if test "$ac_cv_sizeof_void_p" = "8"; then
+ dir_lib64=no
+ dir_lib_64=no
+
+ case "$SSL_RUNTIME_LIBDIR" in
+ */lib/64 | */lib/64/ ) dir_lib_64=yes;;
+ */lib64 | */lib64/ ) dir_lib64=yes;;
+ *) ;;
+ esac
+
+ for dir in $std_ssl_locations; do
+ test $dir_lib_64 = no &&
+ test -d "$erl_xcomp_sysroot$dir/lib/64" &&
+ dir_lib_64=yes
+ test $dir_lib64 = no &&
+ test -d "$erl_xcomp_sysroot$dir/lib64" &&
+ dir_lib64=yes
+ done
+
+ test $dir_lib_64 = yes && libdirs="/lib/64 $libdirs"
+ test $dir_lib64 = yes && libdirs="/lib64 $libdirs"
+ fi
+
+ for type in std x_std curr; do
+
+ cc_rpath="$cc_rflg$SSL_RUNTIME_LIBDIR"
+ ld_rpath="$ld_rflg$SSL_RUNTIME_LIBDIR"
+ ded_ld_rpath="$ded_ld_rflg$SSL_RUNTIME_LIBDIR"
+ rpath="$SSL_RUNTIME_LIBDIR"
+
+ if test $type != curr; then
+ for ldir in $libdirs; do
+ for dir in $std_ssl_locations; do
+ test "$SSL_LIBDIR" != "$dir$ldir" || continue
+ test $type != x_std || test -d "$dir$ldir" || continue
+ test "$cc_rflg" = "" ||
+ cc_rpath="$cc_rpath $cc_rflg$dir$ldir"
+ test "$ld_rflg" = "" ||
+ ld_rpath="$ld_rpath $ld_rflg$dir$ldir"
+ test "$ded_ld_rflg" = "" ||
+ ded_ld_rpath="$ded_ld_rpath $ded_ld_rflg$dir$ldir"
+ rpath="$rpath:$dir$ldir"
+ done
+ done
+ fi
+
+ saveCFLAGS="$CFLAGS"
+ saveLDFLAGS="$LDFLAGS"
+ saveLIBS="$LIBS"
+ CFLAGS="$CFLAGS $SSL_INCLUDE"
+ LDFLAGS="$LDFLAGS $ld_rpath -L$SSL_LIBDIR"
+ LIBS="-lcrypto"
+ AC_TRY_LINK([
+ #include <stdio.h>
+ #include <openssl/hmac.h>
+ ],
+ [
+ HMAC_CTX hc;
+ HMAC_CTX_init(&hc);
+ ],
+ [rpath_success=yes],
+ [rpath_success=no])
+ CFLAGS="$saveCFLAGS"
+ LDFLAGS="$saveLDFLAGS"
+ LIBS="$saveLIBS"
+
+ test "$rpath_success" = "yes" && break
+ done
+
+ test "$rpath_success" = "yes" || { cc_rpath=; ld_rpath=; ded_ld_rpath=; rpath=; }
+
+ SSL_CC_RUNTIME_LIBRARY_PATH="$cc_rpath"
+ SSL_LD_RUNTIME_LIBRARY_PATH="$ld_rpath"
+ SSL_DED_LD_RUNTIME_LIBRARY_PATH="$ded_ld_rpath"
+
+ AC_MSG_RESULT([$rpath])
+ test "$rpath" != "" || AC_MSG_WARN([Cannot set run path during linking])
+fi
+
#--------------------------------------------------------------------
# Os mon stuff.
#--------------------------------------------------------------------
@@ -3614,6 +3834,11 @@ case $host_os in
os_mon_programs="$os_mon_programs cpu_sup" ;;
esac
+
+AC_ARG_WITH(javac,
+[ --with-javac=JAVAC specify Java compiler to use
+ --with-javac use a Java compiler if found (default)
+ --without-javac don't use any Java compiler])
dnl
dnl Then there are a number of apps which needs a java compiler...
@@ -3625,7 +3850,20 @@ for a in $need_java ; do