Skip to content

Commit

Permalink
Fix LM_PROG_LD
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Feb 24, 2025
1 parent a57cad4 commit bdc4b25
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 13 deletions.
15 changes: 14 additions & 1 deletion erts/configure
Original file line number Diff line number Diff line change
Expand Up @@ -3693,6 +3693,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu









Expand Down Expand Up @@ -5523,7 +5526,7 @@ printf "%s\n" "no" >&6; }
fi

if test "x$ac_ct_LD" = x; then
LD="'$(CC)'"
LD=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
Expand All @@ -5537,6 +5540,16 @@ else
LD="$ac_cv_prog_LD"
fi

if test "$LD" = ":"
then :
as_fn_error $? "No linker found" "$LINENO" 5
else case e in #(
e)
printf "configure:$LINENO: %s\n" 'setting LD to $(CC)' >&5

LD='$(CC)' ;;
esac
fi



Expand Down
3 changes: 3 additions & 0 deletions lib/common_test/configure
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu









Expand Down
24 changes: 22 additions & 2 deletions lib/crypto/configure
Original file line number Diff line number Diff line change
Expand Up @@ -3059,6 +3059,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu









Expand Down Expand Up @@ -4508,7 +4511,7 @@ printf "%s\n" "no" >&6; }
fi

if test "x$ac_ct_LD" = x; then
LD="'$(CC)'"
LD=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
Expand All @@ -4522,6 +4525,16 @@ else
LD="$ac_cv_prog_LD"
fi

if test "$LD" = ":"
then :
as_fn_error $? "No linker found" "$LINENO" 5
else case e in #(
e)
printf "configure:$LINENO: %s\n" 'setting LD to $(CC)' >&5

LD='$(CC)' ;;
esac
fi



Expand Down Expand Up @@ -5431,6 +5444,10 @@ See 'config.log' for more details" "$LINENO" 5; }
fi

USER_LD=$LD
if test "$USER_LD" = '$(CC)'
then :
USER_LD='$(DED_CC)'
fi
USER_LDFLAGS="$LDFLAGS"

DED_CC=$CC
Expand Down Expand Up @@ -5840,7 +5857,10 @@ printf "%s\n" "#define SIZEOF_VOID_P $ac_cv_sizeof_void_p" >>confdefs.h
;;
esac

if test "$DED_LD" = "" && test "$USER_LD" != ""; then
if test "x$DED_LD" = "x" && test "$USER_LD" != ""; then

printf "configure:$LINENO: %s\n" "setting DED_LD to $USER_LD" >&5

DED_LD="$USER_LD"
DED_LDFLAGS="$USER_LDFLAGS $DED_LDFLAGS"
fi
Expand Down
24 changes: 22 additions & 2 deletions lib/erl_interface/configure
Original file line number Diff line number Diff line change
Expand Up @@ -2921,6 +2921,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu









Expand Down Expand Up @@ -4759,7 +4762,7 @@ printf "%s\n" "no" >&6; }
fi

if test "x$ac_ct_LD" = x; then
LD="'$(CC)'"
LD=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
Expand All @@ -4773,6 +4776,16 @@ else
LD="$ac_cv_prog_LD"
fi

if test "$LD" = ":"
then :
as_fn_error $? "No linker found" "$LINENO" 5
else case e in #(
e)
printf "configure:$LINENO: %s\n" 'setting LD to $(CC)' >&5

LD='$(CC)' ;;
esac
fi



Expand Down Expand Up @@ -5025,6 +5038,10 @@ See 'config.log' for more details" "$LINENO" 5; }
fi

USER_LD=$LD
if test "$USER_LD" = '$(CC)'
then :
USER_LD='$(DED_CC)'
fi
USER_LDFLAGS="$LDFLAGS"

DED_CC=$CC
Expand Down Expand Up @@ -5434,7 +5451,10 @@ printf "%s\n" "#define SIZEOF_VOID_P $ac_cv_sizeof_void_p" >>confdefs.h
;;
esac

if test "$DED_LD" = "" && test "$USER_LD" != ""; then
if test "x$DED_LD" = "x" && test "$USER_LD" != ""; then

printf "configure:$LINENO: %s\n" "setting DED_LD to $USER_LD" >&5

DED_LD="$USER_LD"
DED_LDFLAGS="$USER_LDFLAGS $DED_LDFLAGS"
fi
Expand Down
24 changes: 22 additions & 2 deletions lib/megaco/configure
Original file line number Diff line number Diff line change
Expand Up @@ -2806,6 +2806,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu









Expand Down Expand Up @@ -4181,7 +4184,7 @@ printf "%s\n" "no" >&6; }
fi

if test "x$ac_ct_LD" = x; then
LD="'$(CC)'"
LD=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
Expand All @@ -4195,6 +4198,16 @@ else
LD="$ac_cv_prog_LD"
fi

if test "$LD" = ":"
then :
as_fn_error $? "No linker found" "$LINENO" 5
else case e in #(
e)
printf "configure:$LINENO: %s\n" 'setting LD to $(CC)' >&5

LD='$(CC)' ;;
esac
fi



Expand Down Expand Up @@ -5485,6 +5498,10 @@ See 'config.log' for more details" "$LINENO" 5; }
fi

USER_LD=$LD
if test "$USER_LD" = '$(CC)'
then :
USER_LD='$(DED_CC)'
fi
USER_LDFLAGS="$LDFLAGS"

DED_CC=$CC
Expand Down Expand Up @@ -5894,7 +5911,10 @@ printf "%s\n" "#define SIZEOF_VOID_P $ac_cv_sizeof_void_p" >>confdefs.h
;;
esac

if test "$DED_LD" = "" && test "$USER_LD" != ""; then
if test "x$DED_LD" = "x" && test "$USER_LD" != ""; then

printf "configure:$LINENO: %s\n" "setting DED_LD to $USER_LD" >&5

DED_LD="$USER_LD"
DED_LDFLAGS="$USER_LDFLAGS $DED_LDFLAGS"
fi
Expand Down
15 changes: 14 additions & 1 deletion lib/odbc/configure
Original file line number Diff line number Diff line change
Expand Up @@ -2906,6 +2906,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu









Expand Down Expand Up @@ -4301,7 +4304,7 @@ printf "%s\n" "no" >&6; }
fi

if test "x$ac_ct_LD" = x; then
LD="'$(CC)'"
LD=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
Expand All @@ -4315,6 +4318,16 @@ else
LD="$ac_cv_prog_LD"
fi

if test "$LD" = ":"
then :
as_fn_error $? "No linker found" "$LINENO" 5
else case e in #(
e)
printf "configure:$LINENO: %s\n" 'setting LD to $(CC)' >&5

LD='$(CC)' ;;
esac
fi



Expand Down
3 changes: 3 additions & 0 deletions lib/snmp/configure
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu









Expand Down
15 changes: 14 additions & 1 deletion lib/wx/configure
Original file line number Diff line number Diff line change
Expand Up @@ -3170,6 +3170,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu









Expand Down Expand Up @@ -5209,7 +5212,7 @@ printf "%s\n" "no" >&6; }
fi

if test "x$ac_ct_LD" = x; then
LD="'$(CC)'"
LD=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
Expand All @@ -5223,6 +5226,16 @@ else
LD="$ac_cv_prog_LD"
fi

if test "$LD" = ":"
then :
as_fn_error $? "No linker found" "$LINENO" 5
else case e in #(
e)
printf "configure:$LINENO: %s\n" 'setting LD to $(CC)' >&5

LD='$(CC)' ;;
esac
fi


ac_ext=cpp
Expand Down
18 changes: 16 additions & 2 deletions make/autoconf/otp.m4
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ dnl The Local Macros which could be part of autoconf are prefixed LM_,
dnl macros specific dnl to the Erlang system are prefixed ERL_ (this is
dnl not always consistently made...).
dnl
dnl To make it easier to debug, sprinkle some calls to LM_LOG in the macros

dnl Log a message to config.log
AC_DEFUN(LM_LOG,
[
printf "configure:$LINENO: %s\n" $1 >&AS_MESSAGE_LOG_FD
])


dnl We check if -Werror was given on command line and if so
dnl we disable it for the configure and only use it when
Expand Down Expand Up @@ -334,7 +342,11 @@ dnl we use ld.sh instead of cc.sh.

AC_DEFUN(LM_PROG_LD,
[AC_CHECK_PROGS(LD, ld.sh)
AC_CHECK_TOOL(LD, ld, '$(CC)')
AC_CHECK_TOOL(LD, ld, [:])
AS_IF([test "$LD" = ":"],
[AC_MSG_ERROR([No linker found])],
[LM_LOG('setting LD to $(CC)')
LD='$(CC)'])
])

dnl ----------------------------------------------------------------------
Expand Down Expand Up @@ -3260,6 +3272,7 @@ AC_DEFUN(ERL_DED_FLAGS,
AC_SYS_YEAR2038_RECOMMENDED
USER_LD=$LD
AS_IF([ test "$USER_LD" = '$(CC)' ], [USER_LD='$(DED_CC)'])
USER_LDFLAGS="$LDFLAGS"
DED_CC=$CC
Expand Down Expand Up @@ -3439,7 +3452,8 @@ if test "x$DED_LD" = "x"; then
;;
esac
if test "$DED_LD" = "" && test "$USER_LD" != ""; then
if test "x$DED_LD" = "x" && test "$USER_LD" != ""; then
LM_LOG("setting DED_LD to $USER_LD")
DED_LD="$USER_LD"
DED_LDFLAGS="$USER_LDFLAGS $DED_LDFLAGS"
fi
Expand Down
Loading

0 comments on commit bdc4b25

Please sign in to comment.