summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-06 12:08:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-06 12:08:54 +0000
commit78bf275c56ec4cf1f85f69a3cf2cb334cca0ef4b (patch)
treea408edf89659bb46ffe5a7a7e861fd854ce715da
parentbb2ee549ef69166fb68d0f02c7a34fa30065a107 (diff)
Expand MJIT_CC in configure
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--Makefile.in7
-rw-r--r--configure.ac12
2 files changed, 11 insertions, 8 deletions
diff --git a/Makefile.in b/Makefile.in
index 52e04ab..724773c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -598,11 +598,6 @@ mjit_config.h:
esac; \
done; \
}; \
- mjit_cc="$(MJIT_CC)"; \
- if [ "$(CROSS_COMPILING)" = no ]; then \
- mjit_cc="`command -v $$mjit_cc`"; \
- case $(arch) in *-mingw*) mjit_cc="`cygpath -m $$mjit_cc`";; esac; \
- fi; \
test "$(Q)" = @ || set -x; \
archs="$(UNIVERSAL_ARCHNAMES)"; \
arch_flag=""; \
@@ -615,7 +610,7 @@ mjit_config.h:
quote MJIT_BUILD_DIR "`$(CHDIR) . && pwd`"; \
quote MJIT_MIN_HEADER_NAME "/$(MJIT_HEADER_INSTALL_DIR)/$(MJIT_MIN_HEADER_NAME)"; \
sep=,; \
- quote "MJIT_CC_COMMON " "$${mjit_cc}"; \
+ quote "MJIT_CC_COMMON " $(MJIT_CC); \
quote "MJIT_CFLAGS $${need_mjit_archflag:+ MJIT_ARCHFLAG}" $(MJIT_CFLAGS); \
quote "MJIT_OPTFLAGS " $(MJIT_OPTFLAGS); \
quote "MJIT_DEBUGFLAGS " $(MJIT_DEBUGFLAGS); \
diff --git a/configure.ac b/configure.ac
index 165bfd0..dda343e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -252,6 +252,15 @@ AC_SUBST(OUTFLAG)
AC_SUBST(COUTFLAG)
AC_SUBST(CSRCFLAG)
+: ${MJIT_CC=$CC}
+AS_IF([test "x$cross_compiling" = xno], [
+ AC_PATH_PROG([MJIT_CC], ${MJIT_CC-$CC})
+ AS_CASE([$build_os:$host_os],
+ [*mingw*:*cygwin*], [MJIT_CC=`cygpath -ma $MJIT_CC`])
+ shift 2
+ MJIT_CC="$MJIT_CC${1+ }$*"
+])
+
AS_CASE(["$build_os"],
[darwin1*.*], [
# Xcode linker warns for deprecated architecture and wrongly
@@ -260,7 +269,6 @@ AS_CASE(["$build_os"],
echo 'int main(void) {return 0;}' > conftest.c
AS_IF([$CC -framework Foundation -o conftest conftest.c 2>&1 |
grep '^ld: warning: text-based stub file' >/dev/null], [
- : ${MJIT_CC="$CC"}
CC_WRAPPER=`cd -P "$srcdir/tool" && pwd`/darwin-cc
CC="$CC_WRAPPER $CC"
])
@@ -2538,7 +2546,7 @@ AC_SUBST(DLDFLAGS)dnl
AC_SUBST(ARCH_FLAG)dnl
AC_SUBST(MJIT_HEADER_FLAGS)dnl
AC_SUBST(MJIT_HEADER_INSTALL_DIR)dnl
-AC_SUBST(MJIT_CC, [${MJIT_CC-'$(CC)'}])dnl
+AC_SUBST(MJIT_CC)dnl
AC_SUBST(MJIT_CFLAGS, [${MJIT_CFLAGS-"-w ${orig_cflags}"}])dnl
AC_SUBST(MJIT_OPTFLAGS, [${MJIT_OPTFLAGS-'$(optflags)'}])dnl
AC_SUBST(MJIT_DEBUGFLAGS, [${MJIT_DEBUGFLAGS-'$(debugflags)'}])dnl