Skip to content

Commit

Permalink
Merge 'rickard/configure/OTP-17398' into rickard/configure/23/OTP-17398
Browse files Browse the repository at this point in the history
* rickard/configure/OTP-17398:
  Support for committing of configure scripts
  • Loading branch information
rickard-green committed May 19, 2021
2 parents 3002f55 + d277599 commit fc5cd2d
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 148 deletions.
22 changes: 0 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ JAVADOC-GENERATED
/bootstrap/lib/xmerl

/Makefile
/configure

/release

Expand Down Expand Up @@ -205,29 +204,12 @@ JAVADOC-GENERATED
# Files generated by "./otp_build autoconf"
#

/lib/configure
/lib/*/configure
/lib/common_test/test_server/configure
/lib/configure.in
/make/aclocal.m4
/make/configure
/lib/common_test/priv/auxdir/config.guess
/lib/common_test/priv/auxdir/config.sub
/lib/common_test/priv/auxdir/install-sh
/lib/erl_interface/aclocal.m4
/lib/erl_interface/src/auxdir/config.guess
/lib/erl_interface/src/auxdir/config.sub
/lib/erl_interface/src/auxdir/install-sh
/lib/erl_interface/config.h.in
/lib/megaco/aclocal.m4
/lib/odbc/aclocal.m4
/lib/common_test/test_server/config.guess
/lib/common_test/test_server/config.sub
/lib/common_test/test_server/install-sh
/lib/wx/aclocal.m4
/lib/wx/autoconf/config.guess
/lib/wx/autoconf/config.sub
/lib/wx/autoconf/install-sh
/lib/crypto/aclocal.m4

#
Expand Down Expand Up @@ -390,10 +372,6 @@ JAVADOC-GENERATED
/system/doc/xml
/system/doc/top/PR.template

# test_server

/lib/test_server/src/configure

# tools

/lib/tools/src/xref_parser.erl
Expand Down
6 changes: 0 additions & 6 deletions HOWTO/INSTALL-ANDROID.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ https://developer.android.com/ndk

### Configure Erlang/OTP ###

If you are building Erlang/OTP from git, you will need to run this
to generate the configure scripts.

$ ./otp_build autoconf


Use the following commands when compiling a 64-bit version.

$ export NDK_ABI_PLAT=android21 # When targeting Android 5.0 Lollipop
Expand Down
1 change: 0 additions & 1 deletion HOWTO/INSTALL-RASPBERRYPI3.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ Uncheck option:

(25)

$ LC_CTYPE=C && LANG=C && ./otp_build autoconf
$ ./otp_build configure --xcomp-conf=./xcomp/erl-xcomp-armv8-rpi3-linux-gnueabihf.conf
$ ./otp_build boot -a
$ ./otp_build release -a /Volumes/xtools-build-env/otp_22.0
28 changes: 8 additions & 20 deletions HOWTO/INSTALL-WIN32-OLD.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ OpenSSL, in which case you will need to go back to earlier compilers etc.

The procedure described uses either Cygwin, MSYS or MSYS2 as a build
environment. You run the bash shell in Cygwin/MSYS/MSYS2 and use the gnu
make/configure/autoconf etc to do the build. The emulator C-source code
configure/make etc to do the build. The emulator C-source code
is, however, mostly compiled with Microsoft Visual C++™, producing a
native Windows binary. This is the same procedure as we use to build the
pre-built binaries. Why we use VC++ and not gcc is explained further in
Expand Down Expand Up @@ -107,7 +107,6 @@ This is the short story though, for the experienced and impatient:
the last row):

$ eval `./otp_build env_win32 x64`
$ ./otp_build autoconf
$ ./otp_build configure
$ ./otp_build boot -a
$ ./otp_build release -a
Expand Down Expand Up @@ -312,8 +311,7 @@ tools:

URL: <http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/>

Make sure to install the basic dev tools, but avoid the MinGW autoconf and
install the msys one instead.
Make sure to install the basic dev tools.

To be able to build the 64bit VM, you will also need the 64bit
MinGW compiler from:
Expand All @@ -330,10 +328,10 @@ tools:
URL: <https://msys2.github.io/>

When you've followed the instructions there, you also need to install
these packages: autoconf, make, perl, and tar. You do so by running
these packages: make, perl, and tar. You do so by running
the following in the msys console:

pacman -S msys/autoconf msys/make msys/perl msys/tar
pacman -S msys/make msys/perl msys/tar

You also need a gcc. If you installed the 64 bit MSYS2 you run:

Expand Down Expand Up @@ -708,7 +706,6 @@ Building and Installing

Building is easiest using the `otp_build` script:

$ ./otp_build autoconf # Ignore the warning blob about versions of autoconf
$ ./otp_build configure <optional configure options>
$ ./otp_build boot -a
$ ./otp_build release -a <installation directory>
Expand All @@ -719,16 +716,7 @@ in the `<installation directory>`, i.e. `$ERL_TOP/release/win32`.

Lets get into more detail:

1. `$ ./otp_build autoconf` - This step rebuilds the configure scripts
to work correctly in your environment. In an ideal world, this
would not be needed, but alas, we have encountered several
incompatibilities between our distributed configure scripts (generated
on a Linux platform) and the Cygwin/MSYS/MSYS2 environment over the
years. Running autoconf in Cygwin/MSYS/MSYS2 ensures that the configure
scripts are generated in a compatible way and that they will work well
in the next step.

2. `$ ./otp_build configure` - This runs the newly generated configure
1. `$ ./otp_build configure` - This runs the newly generated configure
scripts with options making configure behave nicely. The target machine
type is plainly `win32`, so a lot of the configure-scripts recognize
this awkward target name and behave accordingly. The CC variable also
Expand All @@ -737,17 +725,17 @@ Lets get into more detail:
the tests are not needed on Windows, but we thought it best to run the
whole configure anyway.

3. `$ ./otp_build boot -a` - This uses the bootstrap directory (shipped
2. `$ ./otp_build boot -a` - This uses the bootstrap directory (shipped
with the source, `$ERL_TOP/bootstrap`) to build a complete OTP
system. When this is done you can run erl from within the source tree;
just type `$ERL_TOP/bin/erl` and you whould have the prompt.

4. `$ ./otp_build release -a` - Builds a commercial release tree from the
3. `$ ./otp_build release -a` - Builds a commercial release tree from the
source tree. The default is to put it in `$ERL_TOP/release/win32`. You can
give any directory as parameter (Cygwin style), but it doesn't really
matter if you're going to build a self extracting installer too.

5. `$ ./otp_build installer_win32` - Creates the self extracting installer executable.
4. `$ ./otp_build installer_win32` - Creates the self extracting installer executable.
The executable `otp_win32_%OTP-REL%.exe` or `otp_win64_%OTP-REL%.exe` will be placed
in the top directory of the release created in the previous step. If
no release directory is specified, the release is expected to have
Expand Down
23 changes: 6 additions & 17 deletions HOWTO/INSTALL-WIN32.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The instructions apply to Windows 10 (v.1809 and later) supporting the
WSL.1 (Windows Subsystem for Linux v.1) and using Ubuntu 18.04 release.

The procedure described uses WSL as a build environment. You run the
bash shell in WSL and use the gnu make/configure/autoconf etc to do
bash shell in WSL and use the gnu configure/make etc to do
the build. The emulator C-source code is, however, mostly compiled
with Microsoft Visual C++™, producing a native Windows binary. This is
the same procedure as we use to build the pre-built binaries. Why we
Expand Down Expand Up @@ -68,7 +68,7 @@ This is the short story though, for the experienced and impatient:
<http://www.erlang.org/download.html>) and unpack with `tar`
to the windows disk for example to: /mnt/c/src/

* Install mingw-gcc, make and autoconf: `sudo apt install gcc-mingw-w64 make autoconf`
* Install mingw-gcc, and make: `sudo apt install g++-mingw-w64 gcc-mingw-w64 make`

* `$ cd UNPACK_DIR`

Expand All @@ -79,7 +79,6 @@ This is the short story though, for the experienced and impatient:
the last row):

$ eval `./otp_build env_win32 x64`
$ ./otp_build autoconf
$ ./otp_build configure
$ ./otp_build boot -a
$ ./otp_build release -a
Expand Down Expand Up @@ -220,7 +219,6 @@ Building and Installing

Building is easiest using the `otp_build` script:

$ ./otp_build autoconf # Ignore the warning blob about versions of autoconf
$ ./otp_build configure <optional configure options>
$ ./otp_build boot -a
$ ./otp_build release -a <installation directory>
Expand All @@ -231,16 +229,7 @@ in the `<installation directory>`, i.e. `$ERL_TOP/release/win32`.

Lets get into more detail:

1. `$ ./otp_build autoconf` - This step rebuilds the configure scripts
to work correctly in your environment. In an ideal world, this
would not be needed, but alas, we have encountered several
incompatibilities between our distributed configure scripts (generated
on a Linux platform) and the Cygwin/MSYS/MSYS2/WSL environment over the
years. Running autoconf in WSL ensures that the configure
scripts are generated in a compatible way and that they will work well
in the next step.

2. `$ ./otp_build configure` - This runs the newly generated configure
1. `$ ./otp_build configure` - This runs the newly generated configure
scripts with options making configure behave nicely. The target machine
type is plainly `win32`, so a lot of the configure-scripts recognize
this awkward target name and behave accordingly. The CC variable also
Expand All @@ -249,17 +238,17 @@ Lets get into more detail:
the tests are not needed on Windows, but we thought it best to run the
whole configure anyway.

3. `$ ./otp_build boot -a` - This uses the bootstrap directory (shipped
2. `$ ./otp_build boot -a` - This uses the bootstrap directory (shipped
with the source, `$ERL_TOP/bootstrap`) to build a complete OTP
system. When this is done you can run erl from within the source tree;
just type `$ERL_TOP/bin/erl` and you should have the prompt.

4. `$ ./otp_build release -a` - Builds a commercial release tree from the
3. `$ ./otp_build release -a` - Builds a commercial release tree from the
source tree. The default is to put it in `$ERL_TOP/release/win32`. You can
give any directory as parameter, but it doesn't really
matter if you're going to build a self extracting installer too.

5. `$ ./otp_build installer_win32` - Creates the self extracting installer executable.
4. `$ ./otp_build installer_win32` - Creates the self extracting installer executable.
The executable `otp_win32_%OTP-REL%.exe` or `otp_win64_%OTP-REL%.exe` will be placed
in the top directory of the release created in the previous step. If
no release directory is specified, the release is expected to have
Expand Down
42 changes: 17 additions & 25 deletions HOWTO/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ These are the tools you need in order to unpack and build Erlang/OTP.

#### Building in Git ####

* GNU `autoconf` of at least version 2.59. Note that `autoconf` is not
needed when building an unmodified version of the released source.
Build the same way as when building the unpacked tar file.

#### Building on OS X ####

Expand Down Expand Up @@ -110,9 +109,7 @@ The following instructions are for building [the released source tar ball][].

The variable `$ERL_TOP` will be mentioned a lot of times. It refers to
the top directory in the source tree. More information about `$ERL_TOP`
can be found in the [make and $ERL_TOP][] section below. If you are
building in git you probably want to take a look at the [Building in Git][]
section below before proceeding.
can be found in the [make and $ERL_TOP][] section below.

### Unpacking ###

Expand All @@ -132,9 +129,6 @@ Run the following commands to configure the build:

$ ./configure [ options ]

> *NOTE*: If you are building Erlang/OTP from git you will need to run `./otp_build autoconf` to generate
> the configure scripts.
By default, Erlang/OTP release will be installed in `/usr/local/{bin,lib/erlang}`.
If you for instance don't have the permission to install in the standard location,
you can install Erlang/OTP somewhere else. For example, to install in
Expand Down Expand Up @@ -432,6 +426,17 @@ Some of the available `configure` options are:
If you or your system has special requirements please read the `Makefile` for
additional configuration information.

#### Updating configure scripts ####

Generated `configure` scripts are nowadays included in the git repository.

If you modify any `configure.in` files or the `erts/aclocal.m4` file, you need
to regenerate `configure` scripts before the changes will take effect. First
ensure that you have GNU `autoconf` of version 2.69 in your path. Then execute
`./otp_build update_configure [--no-commit]` in the `$ERL_TOP` directory. The
`otp_build` script will verify that `autoconf` is of correct version and will
refuse to update the `configure` scripts if it is of any other version.

#### Atomic Memory Operations and the VM ####

The VM with SMP support makes quite a heavy use of atomic memory operations.
Expand Down Expand Up @@ -480,26 +485,13 @@ If you've upgraded the source with a patch you may need to clean up from previou
builds before the new build.
Make sure to read the [Pre-built Source Release][] section below before doing a `make clean`.

#### Within Git ####

When building in a Git working directory you also have to have a GNU `autoconf`
of at least version 2.59 on your system, because you need to generate the
`configure` scripts before you can start building.

The `configure` scripts are generated by invoking `./otp_build autoconf` in
the `$ERL_TOP` directory. The `configure` scripts also have to be regenerated
when a `configure.in` or `aclocal.m4` file has been modified. Note that when
checking out a branch a `configure.in` or `aclocal.m4` file may change
content, and you may therefore have to regenerate the `configure` scripts
when checking out a branch. Regenerated `configure` scripts imply that you
have to run `configure` and build again.

> *NOTE*: Running `./otp_build autoconf` is **not** needed when building
> an unmodified version of the released source.
Other useful information can be found at our GitHub wiki:
* <http://wiki.github.com/erlang/otp>

#### Within Git ####

Build the same way as when building the unpacked tar file.

#### OS X (Darwin) ####

Make sure that the command `hostname` returns a valid fully qualified host
Expand Down
14 changes: 9 additions & 5 deletions configure.src
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 2018. All Rights Reserved.
# Copyright Ericsson AB 2018-2021. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,12 @@
#
# %CopyrightEnd%
#
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# WARNING!
# DO NOT EDIT the 'configure' file which is automatically generated from
# 'configure.src'! In order to update 'configure' edit 'configure.src' and
# execute './otp_build update_configure [--no-commit]'.
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#
# This is a handcrafted wrapper script which runs the actual (autoconf)
# 'configure' scripts in different parts of OTP.
Expand All @@ -31,8 +37,6 @@
# otherwise takes forever to run configure...
#

OTP_VERSION=@OTP_VERSION@

unset CDPATH

default_cflags="-g -O2"
Expand Down Expand Up @@ -180,7 +184,7 @@ fi
#

root_dir=
dir_chk_data="$OTP_VERSION"
dir_chk_data=`date`

if root_dir=`dirname "$0" 2>/dev/null` \
&& test "$root_dir" != "" \
Expand All @@ -191,7 +195,7 @@ if root_dir=`dirname "$0" 2>/dev/null` \
else
case "$root_dir" in
/*)
echo $dir_chk_data > "$root_dir"/config.dir.check.$$ 2>/dev/null
echo "$dir_chk_data" > "$root_dir"/config.dir.check.$$ 2>/dev/null
;;
*)
root_dir=
Expand Down
2 changes: 0 additions & 2 deletions erts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/Makefile
/configure
/config.log
/config.status
/config.h.in

/start_scripts/RELEASES.src
/start_scripts/*.rel
Expand Down
1 change: 0 additions & 1 deletion lib/megaco/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Files generated by configure.
/configure
/config.log
/config.status

Expand Down
Loading

0 comments on commit fc5cd2d

Please sign in to comment.