Browse Source

Download GCC's library dependencies if they don't exist

Some systems don't have things like GMP, MPFR, and friends installed.
Rather than requiring them to be installed as root, this uses a bit of
GCC's built-in functionality to download these libraries and build
them along with GCC.

This allows the tools to build on Red Hat, but only if you install
newer host tools (I have GCC, make, and texinfo).
pull/40/head
Palmer Dabbelt 11 years ago
parent
commit
10d12c683d
  1. 1
      Makefile.in
  2. 18
      configure.ac

1
Makefile.in

@ -62,6 +62,7 @@ $(addprefix src/,$(PACKAGES)): src/%: src/original-%
cp -R $< $@.tmp
$(srcdir)/scripts/cp_s $(srcdir)/$(notdir $@) $@.tmp
cd $@.tmp && patch -p1 < $(srcdir)/patches/$(notdir $@)
if test -f $@.tmp/contrib/download_prerequisites && test "@NEED_GCC_EXTERNAL_LIBRARIES@" == "true"; then cd $@.tmp && ./contrib/download_prerequisites; fi
mv $@.tmp $@
.PHONY: patches $(addprefix $(srcdir)/patches/,$(PACKAGES))

18
configure.ac

@ -18,14 +18,16 @@ AC_PATH_PROGS_FEATURE_CHECK([GSED], [gsed sed],
[AC_MSG_ERROR([GNU sed not found])])
AC_SUBST([GSED], [$ac_cv_path_GSED])
AC_CHECK_LIB(gmp, __gmpz_init, ,
[AC_MSG_ERROR([GNU MP not found; see https://gmplib.org/])])
AC_CHECK_LIB(mpfr, mpfr_init, ,
[AC_MSG_ERROR([MPFR not found; see http://www.mpfr.org/])])
AC_CHECK_LIB(mpc, mpc_init2, ,
[AC_MSG_ERROR([MPC not found; see http://www.multiprecision.org/])])
need_gcc_external_libraries="no"
AC_CHECK_LIB(gmp, __gmpz_init,
[need_gcc_external_libraries="yes"])
AC_CHECK_LIB(mpfr, mpfr_init,
[need_gcc_external_libraries="yes"])
AC_CHECK_LIB(mpc, mpc_init2,
[need_gcc_external_libraries="yes"])
AS_IF([test x"$need_gcc_external_libraries" == xno],
[AC_SUBST(NEED_GCC_EXTERNAL_LIBRARIES,true)],
[AC_SUBST(NEED_GCC_EXTERNAL_LIBRARIES,false)])
AC_PATH_PROG([CURL], [curl], [no])
AC_PATH_PROG([WGET], [wget], [no])

Loading…
Cancel
Save