Skip to content

Commit

Permalink
Use full path to C compiler on Windows by default. Issue #1015
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Oct 24, 2024
1 parent 6eef8ac commit 38fe8e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
18 changes: 5 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -336,26 +336,18 @@ AC_ARG_WITH([system-cc],
[AS_HELP_STRING([--with-system-cc=PATH],
[Path to system compiler to be used for linking])],
[system_cc="$withval"],
[system_cc="$cc_bare"])
[AC_PATH_PROG([system_cc], ["$cc_bare"])])

if test x$system_cc != xno; then
AC_MSG_CHECKING([if $system_cc executable exists])
AS_IF([test -x $system_cc],
AS_IF([command -v $system_cc >/dev/null],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_PATH_PROG([system_cc], ["$system_cc"],
[AC_MSG_ERROR([system C compiler $system_cc not found])])])
AC_MSG_ERROR([system C compiler $system_cc not found])])

case $host_os in
*cygwin*|msys*|mingw32*)
# Do not hard-code full path on Windows
system_cc="$(basename $system_cc)"
;;
esac

AC_DEFINE_UNQUOTED([SYSTEM_CC], ["$system_cc"], [System compiler])
AC_DEFINE_UNQUOTED([SYSTEM_CC], ["`$pathprog $system_cc`"], [System compiler])
else
AC_DEFINE_UNQUOTED([BOOTSTRAP_CC], ["$cc_bare"], [Bootstrap compiler])
AC_DEFINE_UNQUOTED([BOOTSTRAP_CC], ["`$pathprog $cc_bare`"], [Bootstrap compiler])
fi

case $host_os in
Expand Down
3 changes: 2 additions & 1 deletion contrib/msys2/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ build() {
--target="${MINGW_CHOST}" \
--enable-static \
--enable-shared \
--program-prefix=
--program-prefix= \
--with-system-cc=cc

make
}
Expand Down

0 comments on commit 38fe8e6

Please sign in to comment.