diff options
author | Lukas Larsson <lukas@erlang.org> | 2022-01-25 14:14:13 +0100 |
---|---|---|
committer | Lukas Larsson <lukas@erlang.org> | 2022-01-25 14:14:13 +0100 |
commit | 6f18c8588a89556767d0c763f8cc96aaf04758b4 (patch) | |
tree | 607e18368f28cbca8b8ae061821d7e752871a97f | |
parent | 2e547941e039e2243f8527a104a170bd1211d765 (diff) | |
parent | fc0a8f8204255d5b443abf9da7dec1539180fb9c (diff) | |
download | erlang-6f18c8588a89556767d0c763f8cc96aaf04758b4.tar.gz |
Merge branch 'lukas/erl_interface/update-configure' into maint
* lukas/erl_interface/update-configure:
Update configure scripts
-rwxr-xr-x | lib/crypto/configure | 17 | ||||
-rwxr-xr-x | lib/erl_interface/configure | 16 | ||||
-rwxr-xr-x | lib/megaco/configure | 15 | ||||
-rwxr-xr-x | make/configure | 15 |
4 files changed, 50 insertions, 13 deletions
diff --git a/lib/crypto/configure b/lib/crypto/configure index b2550595c0..7ca886f481 100755 --- a/lib/crypto/configure +++ b/lib/crypto/configure @@ -1462,7 +1462,7 @@ Some influential environment variables: CXX C++ compiler CXXFLAGS C++ compiler flags LD linker (is often overridden by configure) - LDFLAGS linker flags (can be risky to set since LD may be overriden by + LDFLAGS linker flags (can be risky to set since LD may be overridden by configure) LIBS libraries DED_LD linker for Dynamic Erlang Drivers (set all DED_LD* variables or @@ -4698,9 +4698,18 @@ case $host_os in DED_LDFLAGS="-Bshareable" ;; darwin*) - # Mach-O linker: a shared lib and a loadable - # object file is not the same thing. - DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + # Mach-O linker: a shared lib and a loadable object file is not the same thing. + + if test "X${ERL_DED_FLAT_BUNDLE}" = "Xtrue"; then + # EI sets this variable when building its .so file as beam.smp + # has not been built yet and any ei lib will not + # link to beam.smp anyways + DED_LDFLAGS="-bundle -flat_namespace -undefined suppress" + else + # Cannot use flat namespaces for drivers/nifs as that may cause + # symbols to collide during loading + DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + fi # DED_LDFLAGS_CONFTEST is for use in configure tests only. We # cannot use DED_LDFLAGS in configure tests since beam.smp has not # been built yet... diff --git a/lib/erl_interface/configure b/lib/erl_interface/configure index fa5feb72f3..50c4b6396e 100755 --- a/lib/erl_interface/configure +++ b/lib/erl_interface/configure @@ -7995,6 +7995,7 @@ else fi fi +ERL_DED_FLAT_BUNDLE=true USER_LD=$LD @@ -8261,9 +8262,18 @@ case $host_os in DED_LDFLAGS="-Bshareable" ;; darwin*) - # Mach-O linker: a shared lib and a loadable - # object file is not the same thing. - DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + # Mach-O linker: a shared lib and a loadable object file is not the same thing. + + if test "X${ERL_DED_FLAT_BUNDLE}" = "Xtrue"; then + # EI sets this variable when building its .so file as beam.smp + # has not been built yet and any ei lib will not + # link to beam.smp anyways + DED_LDFLAGS="-bundle -flat_namespace -undefined suppress" + else + # Cannot use flat namespaces for drivers/nifs as that may cause + # symbols to collide during loading + DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + fi # DED_LDFLAGS_CONFTEST is for use in configure tests only. We # cannot use DED_LDFLAGS in configure tests since beam.smp has not # been built yet... diff --git a/lib/megaco/configure b/lib/megaco/configure index 13ed7b96a6..fac90552ce 100755 --- a/lib/megaco/configure +++ b/lib/megaco/configure @@ -4785,9 +4785,18 @@ case $host_os in DED_LDFLAGS="-Bshareable" ;; darwin*) - # Mach-O linker: a shared lib and a loadable - # object file is not the same thing. - DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + # Mach-O linker: a shared lib and a loadable object file is not the same thing. + + if test "X${ERL_DED_FLAT_BUNDLE}" = "Xtrue"; then + # EI sets this variable when building its .so file as beam.smp + # has not been built yet and any ei lib will not + # link to beam.smp anyways + DED_LDFLAGS="-bundle -flat_namespace -undefined suppress" + else + # Cannot use flat namespaces for drivers/nifs as that may cause + # symbols to collide during loading + DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + fi # DED_LDFLAGS_CONFTEST is for use in configure tests only. We # cannot use DED_LDFLAGS in configure tests since beam.smp has not # been built yet... diff --git a/make/configure b/make/configure index 698d94db9c..c44049816c 100755 --- a/make/configure +++ b/make/configure @@ -5806,9 +5806,18 @@ case $host_os in DED_LDFLAGS="-Bshareable" ;; darwin*) - # Mach-O linker: a shared lib and a loadable - # object file is not the same thing. - DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + # Mach-O linker: a shared lib and a loadable object file is not the same thing. + + if test "X${ERL_DED_FLAT_BUNDLE}" = "Xtrue"; then + # EI sets this variable when building its .so file as beam.smp + # has not been built yet and any ei lib will not + # link to beam.smp anyways + DED_LDFLAGS="-bundle -flat_namespace -undefined suppress" + else + # Cannot use flat namespaces for drivers/nifs as that may cause + # symbols to collide during loading + DED_LDFLAGS="-bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + fi # DED_LDFLAGS_CONFTEST is for use in configure tests only. We # cannot use DED_LDFLAGS in configure tests since beam.smp has not # been built yet... |