summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0a0b715)
Detect whether the local 'ld' command supports -x, and only use the
flag if it does.
-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
dnl
dnl Extra autoconf macros for the Glasgow fptools
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
AC_DEFUN(FPTOOLS_PROG_YACCY,
dnl Finding the Right Yacc
dnl
AC_DEFUN(FPTOOLS_PROG_YACCY,
dnl ** code before data?
FPTOOLS_CODE_BEFORE_DATA
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 )
AC_OUTPUT(mk/config.mk, echo timestamp > mk/stamp-h )
LATEX = latex
HEVEA = hevea
HACHA = hacha
LATEX = latex
HEVEA = hevea
HACHA = hacha
LN_S = @LN_S@
MANMACROS = -man
MSMACROS = -ms
LN_S = @LN_S@
MANMACROS = -man
MSMACROS = -ms
RM = rm -f
SED = @SedCmd@
SHELL = /bin/sh
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
#
# In emergency situations, REAL_SHELL is used to perform shell commands
# from within the ghc driver script, by scribbling the command line to
$(RM) $@; if [ ! -d $(basename $@) ]; then mkdir $(basename $@); else \
$(FIND) $(basename $@) -name '*.$(way_)o' | xargs $(RM) __rm_food; fi
ifeq "$(GhcWithInterpreter)" "YES"
$(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
else
HC_SPLIT_POST = touch $@
endif # GhcWithInterpreter == YES
ifeq "$(SplitObjs)" "YES"
SRC_HC_POST_OPTS += \
for i in $(basename $@)/*; do \
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 += \
$(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
endif # SplitObjs
endif # StripLibraries
# hslibs/Win32 uses this 'feature'.
#
$(GHCI_LIBRARY) :: $(LIBOBJS)
# 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
endif # DONT_WANT_STD_GHCI_LIB_RULE
endif # GhcWithInterpreter