configure: --enable-racket=auto to simplify cross-compilation

Using `--enable-racket=auto` causes a Racket for the current platform
to be built in a "local" subdirectory of the build directory as
support for cross-compilation.
This commit is contained in:
Matthew Flatt 2015-09-18 21:40:39 -06:00
parent a88d52bd34
commit fccd86d67d
4 changed files with 55 additions and 8 deletions

View File

@ -54,6 +54,7 @@ TAGS:
etags `find "@srcdir@/racket" -type f` etags `find "@srcdir@/racket" -type f`
3m: 3m:
$(MAKE) @MAKE_LOCAL_RACKET@
cd racket; $(MAKE) 3m cd racket; $(MAKE) 3m
$(MAKE) @MAKE_GRACKET@-3m $(MAKE) @MAKE_GRACKET@-3m
@ -64,6 +65,7 @@ no-3m:
$(NOOP) $(NOOP)
cgc: cgc:
$(MAKE) @MAKE_LOCAL_RACKET@
cd racket; $(MAKE) cgc cd racket; $(MAKE) cgc
$(MAKE) @MAKE_GRACKET@-cgc $(MAKE) @MAKE_GRACKET@-cgc
@ -77,6 +79,19 @@ both:
$(MAKE) cgc $(MAKE) cgc
$(MAKE) 3m $(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) ---------------------------------------- # Install (common) ----------------------------------------
INST_CONFIG = -X @DIRCVTPRE@"$(DESTDIR)$(collectsdir)"@DIRCVTPOST@ -G @DIRCVTPRE@"$(DESTDIR)$(configdir)"@DIRCVTPOST@ INST_CONFIG = -X @DIRCVTPRE@"$(DESTDIR)$(collectsdir)"@DIRCVTPOST@ -G @DIRCVTPRE@"$(DESTDIR)$(configdir)"@DIRCVTPOST@

View File

@ -271,11 +271,16 @@ Cross-compilation requires at least two flags to `configure':
such as `OS-gcc' and `OS-strip'. such as `OS-gcc' and `OS-strip'.
* `--enable-racket=RACKET', where RACKET is a path to a Racket * `--enable-racket=RACKET', where RACKET is a path to a Racket
executable for the version being compiled that runs on the build executable that runs on the build platform; the executable must be
platform. the same version of Racket as being built for the target platform.
This flag is needed because building and installing Racket requires 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: Some less commonly needed `configure' flags:
@ -292,7 +297,7 @@ the NDK, use (all on one line)
configure --host=arm-linux-androideabi configure --host=arm-linux-androideabi
--enable-sysroot="[ndk]/platforms/android-[N]/arch-arm" --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 where [ndk] is the path to the installed NDK, [N] is a target version
of Android (such as 14), and of Android (such as 14), and

18
racket/src/configure vendored
View File

@ -624,6 +624,7 @@ enable_option_checking=no
ac_subst_vars='LTLIBOBJS ac_subst_vars='LTLIBOBJS
LIBOBJS LIBOBJS
subdirs subdirs
MAKE_LOCAL_RACKET
CGC_IF_NEEDED_FOR_MMM CGC_IF_NEEDED_FOR_MMM
RUN_RACKET_MAIN_VARIANT RUN_RACKET_MAIN_VARIANT
RUN_RACKET_MMM RUN_RACKET_MMM
@ -1441,7 +1442,7 @@ Optional Features:
--enable-float support single-precision floats (enabled by default) --enable-float support single-precision floats (enabled by default)
--enable-floatinstead use single-precision by default (NOT RECOMMENDED) --enable-floatinstead use single-precision by default (NOT RECOMMENDED)
--enable-extflonum support extflonums (enabled by default, if available) --enable-extflonum support extflonums (enabled by default, if available)
--enable-racket=<path> use <path> as Racket executable to build Racket --enable-racket=<path> use <path> as Racket to build; or "auto" to create
--enable-origtree install with original directory structure --enable-origtree install with original directory structure
--enable-pkgscope=<s> set `raco pkg' default: installation, user, or shared --enable-pkgscope=<s> set `raco pkg' default: installation, user, or shared
--enable-docs build docs on install (enabled by default) --enable-docs build docs on install (enabled by default)
@ -3096,7 +3097,11 @@ if test "${enable_sysroot}" != "" ; then
fi fi
if test "${enable_racket}" != "" ; then 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 fi
INSTALL_PKGSCOPE=user INSTALL_PKGSCOPE=user
@ -3180,6 +3185,8 @@ use_flag_posix_pthread=no
skip_iconv_check=no skip_iconv_check=no
check_page_size=yes check_page_size=yes
MAKE_LOCAL_RACKET=no-local-racket
###### OSKit stuff ####### ###### OSKit stuff #######
if test "${enable_oskit}" = "yes" ; then if test "${enable_oskit}" = "yes" ; then
@ -6646,6 +6653,11 @@ fi
############## Racket for Racket ################ ############## 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 if test "${enable_racket}" = "" ; then
RUN_RACKET_CGC='$(RUN_THIS_RACKET_CGC)' RUN_RACKET_CGC='$(RUN_THIS_RACKET_CGC)'
RUN_RACKET_MMM='$(RUN_THIS_RACKET_MMM)' RUN_RACKET_MMM='$(RUN_THIS_RACKET_MMM)'
@ -6852,6 +6864,8 @@ LIBS="$LIBS $EXTRALIBS"

View File

@ -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(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(extflonum, [ --enable-extflonum support extflonums (enabled by default, if available)], , enable_extflonum=default)
AC_ARG_ENABLE(racket, [ --enable-racket=<path> use <path> as Racket executable to build Racket]) AC_ARG_ENABLE(racket, [ --enable-racket=<path> use <path> as Racket to build; or "auto" to create])
AC_ARG_ENABLE(origtree,[ --enable-origtree install with original directory structure]) AC_ARG_ENABLE(origtree,[ --enable-origtree install with original directory structure])
AC_ARG_ENABLE(pkgscope,[ --enable-pkgscope=<s> set `raco pkg' default: installation, user, or shared]) AC_ARG_ENABLE(pkgscope,[ --enable-pkgscope=<s> set `raco pkg' default: installation, user, or shared])
@ -368,7 +368,11 @@ if test "${enable_sysroot}" != "" ; then
fi fi
if test "${enable_racket}" != "" ; then 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 fi
INSTALL_PKGSCOPE=user INSTALL_PKGSCOPE=user
@ -452,6 +456,8 @@ use_flag_posix_pthread=no
skip_iconv_check=no skip_iconv_check=no
check_page_size=yes check_page_size=yes
MAKE_LOCAL_RACKET=no-local-racket
###### OSKit stuff ####### ###### OSKit stuff #######
if test "${enable_oskit}" = "yes" ; then if test "${enable_oskit}" = "yes" ; then
@ -1561,6 +1567,11 @@ fi
############## Racket for Racket ################ ############## 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 if test "${enable_racket}" = "" ; then
RUN_RACKET_CGC='$(RUN_THIS_RACKET_CGC)' RUN_RACKET_CGC='$(RUN_THIS_RACKET_CGC)'
RUN_RACKET_MMM='$(RUN_THIS_RACKET_MMM)' RUN_RACKET_MMM='$(RUN_THIS_RACKET_MMM)'
@ -1770,6 +1781,8 @@ AC_SUBST(RUN_RACKET_MMM)
AC_SUBST(RUN_RACKET_MAIN_VARIANT) AC_SUBST(RUN_RACKET_MAIN_VARIANT)
AC_SUBST(CGC_IF_NEEDED_FOR_MMM) AC_SUBST(CGC_IF_NEEDED_FOR_MMM)
AC_SUBST(MAKE_LOCAL_RACKET)
mk_needed_dir() mk_needed_dir()
{ {
if test ! -d "$1" ; then if test ! -d "$1" ; then