diff --git a/Makefile.in b/Makefile.in index 3fd21eea14..047f781030 100644 --- a/Makefile.in +++ b/Makefile.in @@ -78,6 +78,7 @@ MJIT_HEADER_INSTALL_DIR = @MJIT_HEADER_INSTALL_DIR@ MJIT_CC = @MJIT_CC@ MJIT_OPTFLAGS = @MJIT_OPTFLAGS@ MJIT_DEBUGFLAGS = @MJIT_DEBUGFLAGS@ +MJIT_LDSHARED = @MJIT_LDSHARED@ LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ EXTLDFLAGS = @EXTLDFLAGS@ XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS) @@ -564,7 +565,7 @@ mjit_config.h: quote "MJIT_CFLAGS " -w $(ARCH_FLAG); \ quote "MJIT_OPTFLAGS " $(MJIT_OPTFLAGS); \ quote "MJIT_DEBUGFLAGS " $(MJIT_DEBUGFLAGS); \ - quote "MJIT_LDSHARED " @LDSHARED@; \ + quote "MJIT_LDSHARED " $(MJIT_LDSHARED); \ quote "MJIT_DLDFLAGS " @DLDFLAGS@; \ quote "MJIT_LIBS " $(LIBRUBYARG_SHARED); \ echo; \ diff --git a/configure.ac b/configure.ac index 733a0c992f..f4c1688032 100644 --- a/configure.ac +++ b/configure.ac @@ -2461,6 +2461,7 @@ AC_SUBST(MJIT_HEADER_INSTALL_DIR)dnl AC_SUBST(MJIT_CC, [${MJIT_CC-'$(CC)'}])dnl AC_SUBST(MJIT_OPTFLAGS, [${MJIT_OPTFLAGS-'$(optflags)'}])dnl AC_SUBST(MJIT_DEBUGFLAGS, [${MJIT_DEBUGFLAGS-'$(debugflags)'}])dnl +AC_SUBST(MJIT_LDSHARED)dnl AC_SUBST(STATIC)dnl AC_SUBST(CCDLFLAGS)dnl @@ -3431,6 +3432,8 @@ AS_IF([test "${universal_binary-no}" = yes ], [ [rb_cv_architecture_available=yes], [rb_cv_architecture_available=no])) ]) +: ${MJIT_LDSHARED=`echo "$LDSHARED" | sed ['s|\$(LD)|'"${LD}"'|g;s|\$(CC)|$(MJIT_CC)|g']`} + MAINLIBS="$LIBS" LIBS=$ORIG_LIBS AS_IF([test -n "${LIBS}"], [ diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 5c1090c340..b35821d50f 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -310,6 +310,9 @@ MJIT_OPTFLAGS = $(OPTFLAGS) !ifndef MJIT_DEBUGFLAGS MJIT_DEBUGFLAGS = $(DEBUGFLAGS) !endif +!ifndef MJIT_LDSHARED +MJIT_LDSHARED = $(MJITCC) -LD +!endif DLDFLAGS = $(LDFLAGS) -dll MAINLIBS = $(LIBS) @@ -1289,7 +1292,7 @@ mjit_config.h: @echo /* MJIT_DEBUGFLAGS */>> $@ @ @(set sep=#define MJIT_LDSHARED ) & \ - for %I in ($(LDSHARED)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ + for %I in ($(MJIT_LDSHARED)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ @echo /* MJIT_LDSHARED */>> $@ @ @(set sep=#define MJIT_DLDFLAGS ) & \