diff --git a/racket/src/Makefile.in b/racket/src/Makefile.in index 51e0b4660b..e15d1367b9 100644 --- a/racket/src/Makefile.in +++ b/racket/src/Makefile.in @@ -54,6 +54,7 @@ TAGS: etags `find "@srcdir@/racket" -type f` 3m: + $(MAKE) @MAKE_LOCAL_RACKET@ cd racket; $(MAKE) 3m $(MAKE) @MAKE_GRACKET@-3m @@ -64,6 +65,7 @@ no-3m: $(NOOP) cgc: + $(MAKE) @MAKE_LOCAL_RACKET@ cd racket; $(MAKE) cgc $(MAKE) @MAKE_GRACKET@-cgc @@ -77,6 +79,19 @@ both: $(MAKE) cgc $(MAKE) 3m +# Cross-compilation helper: + +no-local-racket: + $(NOOP) + +local/racket/racket3m: + mkdir -p local + $(MAKE) local/Makefile + cd local ; $(MAKE) + +local/Makefile: + cd local ; `cd ..; cd $(srcdir); pwd`/configure --disable-gracket + # Install (common) ---------------------------------------- INST_CONFIG = -X @DIRCVTPRE@"$(DESTDIR)$(collectsdir)"@DIRCVTPOST@ -G @DIRCVTPRE@"$(DESTDIR)$(configdir)"@DIRCVTPOST@ diff --git a/racket/src/README b/racket/src/README index d7920f0e77..46265f9e47 100644 --- a/racket/src/README +++ b/racket/src/README @@ -271,11 +271,16 @@ Cross-compilation requires at least two flags to `configure': such as `OS-gcc' and `OS-strip'. * `--enable-racket=RACKET', where RACKET is a path to a Racket - executable for the version being compiled that runs on the build - platform. + executable that runs on the build platform; the executable must be + the same version of Racket as being built for the target platform. This flag is needed because building and installing Racket requires - running (an intermediate version of) Racket. + running (an existing build of) Racket. + + Use "auto" for RACKET to indicates that one should be built + automatically for the current platform. In that case, `make` + will run `configure` again (with no arguments) in a "local" + subdirectory to create a build for the current platform. Some less commonly needed `configure' flags: @@ -292,7 +297,7 @@ the NDK, use (all on one line) configure --host=arm-linux-androideabi --enable-sysroot="[ndk]/platforms/android-[N]/arch-arm" - --enable-racket=racket + --enable-racket=auto where [ndk] is the path to the installed NDK, [N] is a target version of Android (such as 14), and diff --git a/racket/src/configure b/racket/src/configure index 96711f02cf..84167ff948 100755 --- a/racket/src/configure +++ b/racket/src/configure @@ -624,6 +624,7 @@ enable_option_checking=no ac_subst_vars='LTLIBOBJS LIBOBJS subdirs +MAKE_LOCAL_RACKET CGC_IF_NEEDED_FOR_MMM RUN_RACKET_MAIN_VARIANT RUN_RACKET_MMM @@ -1441,7 +1442,7 @@ Optional Features: --enable-float support single-precision floats (enabled by default) --enable-floatinstead use single-precision by default (NOT RECOMMENDED) --enable-extflonum support extflonums (enabled by default, if available) - --enable-racket= use as Racket executable to build Racket + --enable-racket= use as Racket to build; or "auto" to create --enable-origtree install with original directory structure --enable-pkgscope= set `raco pkg' default: installation, user, or shared --enable-docs build docs on install (enabled by default) @@ -3096,7 +3097,11 @@ if test "${enable_sysroot}" != "" ; then fi if test "${enable_racket}" != "" ; then - echo "=== Using Racket executable ${enable_racket}" + if test "${enable_racket}" == "auto" ; then + echo "=== Creating and using local Racket executable" + else + echo "=== Using Racket executable ${enable_racket}" + fi fi INSTALL_PKGSCOPE=user @@ -3180,6 +3185,8 @@ use_flag_posix_pthread=no skip_iconv_check=no check_page_size=yes +MAKE_LOCAL_RACKET=no-local-racket + ###### OSKit stuff ####### if test "${enable_oskit}" = "yes" ; then @@ -6646,6 +6653,11 @@ fi ############## Racket for Racket ################ +if test "${enable_racket}" = "auto" ; then + enable_racket="`pwd`/local/racket/racket3m" + MAKE_LOCAL_RACKET="local/racket/racket3m" +fi + if test "${enable_racket}" = "" ; then RUN_RACKET_CGC='$(RUN_THIS_RACKET_CGC)' RUN_RACKET_MMM='$(RUN_THIS_RACKET_MMM)' @@ -6852,6 +6864,8 @@ LIBS="$LIBS $EXTRALIBS" + + diff --git a/racket/src/racket/configure.ac b/racket/src/racket/configure.ac index a6f7b73b3d..41e2e7aff9 100644 --- a/racket/src/racket/configure.ac +++ b/racket/src/racket/configure.ac @@ -41,7 +41,7 @@ AC_ARG_ENABLE(float, [ --enable-float support single-precision float AC_ARG_ENABLE(floatinstead, [ --enable-floatinstead use single-precision by default (NOT RECOMMENDED)]) AC_ARG_ENABLE(extflonum, [ --enable-extflonum support extflonums (enabled by default, if available)], , enable_extflonum=default) -AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket executable to build Racket]) +AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket to build; or "auto" to create]) AC_ARG_ENABLE(origtree,[ --enable-origtree install with original directory structure]) AC_ARG_ENABLE(pkgscope,[ --enable-pkgscope= set `raco pkg' default: installation, user, or shared]) @@ -368,7 +368,11 @@ if test "${enable_sysroot}" != "" ; then fi if test "${enable_racket}" != "" ; then - echo "=== Using Racket executable ${enable_racket}" + if test "${enable_racket}" == "auto" ; then + echo "=== Creating and using local Racket executable" + else + echo "=== Using Racket executable ${enable_racket}" + fi fi INSTALL_PKGSCOPE=user @@ -452,6 +456,8 @@ use_flag_posix_pthread=no skip_iconv_check=no check_page_size=yes +MAKE_LOCAL_RACKET=no-local-racket + ###### OSKit stuff ####### if test "${enable_oskit}" = "yes" ; then @@ -1561,6 +1567,11 @@ fi ############## Racket for Racket ################ +if test "${enable_racket}" = "auto" ; then + enable_racket="`pwd`/local/racket/racket3m" + MAKE_LOCAL_RACKET="local/racket/racket3m" +fi + if test "${enable_racket}" = "" ; then RUN_RACKET_CGC='$(RUN_THIS_RACKET_CGC)' RUN_RACKET_MMM='$(RUN_THIS_RACKET_MMM)' @@ -1770,6 +1781,8 @@ AC_SUBST(RUN_RACKET_MMM) AC_SUBST(RUN_RACKET_MAIN_VARIANT) AC_SUBST(CGC_IF_NEEDED_FOR_MMM) +AC_SUBST(MAKE_LOCAL_RACKET) + mk_needed_dir() { if test ! -d "$1" ; then