Commit 4d6959b1 authored by simonmar's avatar simonmar

[project @ 2001-10-24 09:43:47 by simonmar]

Detect whether the local 'ld' command supports -x, and only use the
flag if it does.
parent 0a0b7155
dnl $Id: aclocal.m4,v 1.85 2001/10/13 20:26:13 sof Exp $
dnl $Id: aclocal.m4,v 1.86 2001/10/24 09:43:47 simonmar Exp $
dnl
dnl Extra autoconf macros for the Glasgow fptools
dnl
......@@ -244,6 +244,29 @@ ContextDiffCmd=$fptools_cv_context_diffs
AC_SUBST(ContextDiffCmd)
])
dnl
dnl Check whether ld supports -x
dnl
AC_DEFUN(FPTOOLS_LD_X,
[AC_CACHE_CHECK([whether ld understands -x], fptools_cv_ld_x,
[
echo 'foo() {}' > conftest.c
${CC-cc} -c conftest.c
if ${LdCmd} -r -x -o foo.o conftest.o; then
fptools_cv_ld_x=yes
else
fptools_cv_ld_x=no
fi
rm -rf conftest.c conftest.o foo.o
])
if test "$fptools_cv_ld_x" = yes; then
LdXFlag=-x
else
LdXFlag=
fi
AC_SUBST(LdXFlag)
])
dnl
dnl Finding the Right Yacc
dnl
......
......@@ -973,5 +973,8 @@ FPTOOLS_END_DATA_SECTION
dnl ** code before data?
FPTOOLS_CODE_BEFORE_DATA
dnl ** check for ld, and whether ld has -x option
AC_PATH_PROG(LdCmd, ld)
FPTOOLS_LD_X
AC_OUTPUT(mk/config.mk, echo timestamp > mk/stamp-h )
......@@ -700,7 +700,6 @@ INSTALL := $(subst .././install-sh,$(FPTOOLS_TOP_ABS)/install-sh,$(INSTALL))
LATEX = latex
HEVEA = hevea
HACHA = hacha
LD = ld
LN_S = @LN_S@
MANMACROS = -man
MSMACROS = -ms
......@@ -714,6 +713,13 @@ RANLIB = @RANLIB@
RM = rm -f
SED = @SedCmd@
SHELL = /bin/sh
# Some ld's support the -x flag and some don't, so the configure
# script detects which we have and sets LdXFlag to "-x" or ""
# respectively.
LD = @LdCmd@
LD_X = @LdXFlag@
#
# In emergency situations, REAL_SHELL is used to perform shell commands
# from within the ghc driver script, by scribbling the command line to
......
......@@ -461,7 +461,7 @@ HC_SPLIT_PRE = \
$(RM) $@; if [ ! -d $(basename $@) ]; then mkdir $(basename $@); else \
$(FIND) $(basename $@) -name '*.$(way_)o' | xargs $(RM) __rm_food; fi
ifeq "$(GhcWithInterpreter)" "YES"
HC_SPLIT_POST = $(LD) -r -x -o $@ $(basename $@)/*.$(way_)o
HC_SPLIT_POST = $(LD) -r $(LD_X) -o $@ $(basename $@)/*.$(way_)o
else
HC_SPLIT_POST = touch $@
endif # GhcWithInterpreter == YES
......@@ -491,12 +491,12 @@ ifeq "$(StripLibraries)" "YES"
ifeq "$(SplitObjs)" "YES"
SRC_HC_POST_OPTS += \
for i in $(basename $@)/*; do \
$(LD) -r -x -o $$i.tmp $$i; \
$(LD) -r $(LD_X) -o $$i.tmp $$i; \
$(MV) $$i.tmp $$i; \
done
else
SRC_HC_POST_OPTS += \
$(LD) -r -x -o $@.tmp $@; $(MV) $@.tmp $@
$(LD) -r $(LD_X) -o $@.tmp $@; $(MV) $@.tmp $@
endif # SplitObjs
endif # StripLibraries
......@@ -538,7 +538,7 @@ ifneq "$(DONT_WANT_STD_GHCI_LIB_RULE)" "YES"
# hslibs/Win32 uses this 'feature'.
#
$(GHCI_LIBRARY) :: $(LIBOBJS)
$(LD) -r -x -o $@ $(LIBOBJS) $(STUBOBJS)
$(LD) -r $(LD_X) -o $@ $(LIBOBJS) $(STUBOBJS)
endif # DONT_WANT_STD_GHCI_LIB_RULE
endif # GhcWithInterpreter
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment