diff --git a/configure.ac b/configure.ac index 9d45360c0..093b87d8c 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/contrib/msys2/PKGBUILD b/contrib/msys2/PKGBUILD index a87aeefad..d8d97f795 100644 --- a/contrib/msys2/PKGBUILD +++ b/contrib/msys2/PKGBUILD @@ -52,7 +52,8 @@ build() { --target="${MINGW_CHOST}" \ --enable-static \ --enable-shared \ - --program-prefix= + --program-prefix= \ + --with-system-cc=cc make }