Skip to content

Commit

Permalink
configure: fix cross(-like) build for --enable-pb
Browse files Browse the repository at this point in the history
  • Loading branch information
mflatt committed Jan 24, 2022
1 parent f790217 commit b0e86b5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion racket/src/cs/c/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ config-scheme:
scheme-cross:
env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt
$(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA)
cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS)
cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure $(CONFIG_SCHEME_MODE) @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS)
cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t
$(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch

Expand Down
25 changes: 19 additions & 6 deletions racket/src/cs/c/configure
Original file line number Diff line number Diff line change
Expand Up @@ -2878,6 +2878,7 @@ show_explicitly_set "${enable_racket}" "Racket"
show_explicitly_set "${enable_scheme}" "Chez Scheme build directory"
show_explicitly_set "${enable_mach}" "machine type"
show_explicitly_set "${enable_target}" "cross-build machine type"
show_explicitly_set "${enable_pb}" "pb machine type"
show_explicitly_enabled "${enable_portable}" "portable"
show_explicitly_enabled "${enable_natipkg}" "Adding \"-natipkg\" suffix to library subpath"
Expand Down Expand Up @@ -4659,6 +4660,17 @@ if test "${enable_mach}" != "" ; then
MACH="${enable_mach}"
fi
# For a pb build where Racket is supplied, force cross-build
# mode on the assumption that the host is not a a pb build
# (because it should be created with default configure options)
if test "${enable_pb}" = "yes" ; then
if test "${enable_racket}" != "" ; then
if test "${enable_target}" = "" ; then
enable_target="${MACH}"
fi
fi
fi
if test "${enable_target}" != "" ; then
TARGET_MACH=${enable_target}
CROSS_MODE="cross"
Expand Down Expand Up @@ -4722,7 +4734,6 @@ elif test "${build_os}_${build_cpu}" != "${host_os}_${host_cpu}" ; then
MACH=${BUILD_MACH}
CROSS_MODE="cross"
else
BUILD_MACH=${MACH}
TARGET_MACH=${MACH}
CROSS_MODE=""
fi
Expand Down Expand Up @@ -5796,15 +5807,17 @@ fi
############## libffi in pb mode ################
BUILD_MACH="${MACH}"
BUILD_TARGET_MACH="${TARGET_MACH}"
KERNEL_MACH="${MACH}"
KERNEL_TARGET_MACH="${TARGET_MACH}"
if test "${enable_pb}" = "yes" ; then
enable_libffi=yes
enable_foreign=yes
CONFIG_MAIN_SCHEME_MODE="--pb --threads --enable-libffi"
MACH=tpb
TARGET_MACH=tpb
if test "${CROSS_MODE}" != "cross" ; then
MACH=tpb
fi
else
CONFIG_MAIN_SCHEME_MODE=""
fi
Expand Down Expand Up @@ -6044,8 +6057,8 @@ do
done
SCHEME_CONFIG_ARGS="--machine=${BUILD_MACH} --disable-x11 ${disable_curses_arg} ${cs_auto_flags} ${extra_scheme_config_args}"
SCHEME_CROSS_CONFIG_ARGS="--machine=${BUILD_TARGET_MACH} --disable-x11 ${cs_auto_flags} ${disable_curses_arg} ${extra_scheme_config_args}"
SCHEME_CONFIG_ARGS="--machine=${KERNEL_MACH} --disable-x11 ${disable_curses_arg} ${cs_auto_flags} ${extra_scheme_config_args}"
SCHEME_CROSS_CONFIG_ARGS="--machine=${KERNEL_TARGET_MACH} --disable-x11 ${cs_auto_flags} ${disable_curses_arg} ${extra_scheme_config_args}"
Expand Down
25 changes: 19 additions & 6 deletions racket/src/cs/c/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ show_explicitly_set "${enable_racket}" "Racket"
show_explicitly_set "${enable_scheme}" "Chez Scheme build directory"
show_explicitly_set "${enable_mach}" "machine type"
show_explicitly_set "${enable_target}" "cross-build machine type"
show_explicitly_set "${enable_pb}" "pb machine type"
m4_include(../ac/portable_show.m4)
m4_include(../ac/natipkg_show.m4)
show_explicitly_enabled "${enable_libz}" "Installed libz"
Expand Down Expand Up @@ -411,6 +412,17 @@ if test "${enable_mach}" != "" ; then
MACH="${enable_mach}"
fi

# For a pb build where Racket is supplied, force cross-build
# mode on the assumption that the host is not a a pb build
# (because it should be created with default configure options)
if test "${enable_pb}" = "yes" ; then
if test "${enable_racket}" != "" ; then
if test "${enable_target}" = "" ; then
enable_target="${MACH}"
fi
fi
fi

if test "${enable_target}" != "" ; then
TARGET_MACH=${enable_target}
CROSS_MODE="cross"
Expand Down Expand Up @@ -474,7 +486,6 @@ elif test "${build_os}_${build_cpu}" != "${host_os}_${host_cpu}" ; then
MACH=${BUILD_MACH}
CROSS_MODE="cross"
else
BUILD_MACH=${MACH}
TARGET_MACH=${MACH}
CROSS_MODE=""
fi
Expand Down Expand Up @@ -685,15 +696,17 @@ fi

############## libffi in pb mode ################

BUILD_MACH="${MACH}"
BUILD_TARGET_MACH="${TARGET_MACH}"
KERNEL_MACH="${MACH}"
KERNEL_TARGET_MACH="${TARGET_MACH}"

if test "${enable_pb}" = "yes" ; then
enable_libffi=yes
enable_foreign=yes
CONFIG_MAIN_SCHEME_MODE="--pb --threads --enable-libffi"
MACH=tpb
TARGET_MACH=tpb
if test "${CROSS_MODE}" != "cross" ; then
MACH=tpb
fi
else
CONFIG_MAIN_SCHEME_MODE=""
fi
Expand Down Expand Up @@ -805,8 +818,8 @@ fi

m4_include(../ac/rktio_keep.m4)

SCHEME_CONFIG_ARGS="--machine=${BUILD_MACH} --disable-x11 ${disable_curses_arg} ${cs_auto_flags} ${extra_scheme_config_args}"
SCHEME_CROSS_CONFIG_ARGS="--machine=${BUILD_TARGET_MACH} --disable-x11 ${cs_auto_flags} ${disable_curses_arg} ${extra_scheme_config_args}"
SCHEME_CONFIG_ARGS="--machine=${KERNEL_MACH} --disable-x11 ${disable_curses_arg} ${cs_auto_flags} ${extra_scheme_config_args}"
SCHEME_CROSS_CONFIG_ARGS="--machine=${KERNEL_TARGET_MACH} --disable-x11 ${cs_auto_flags} ${disable_curses_arg} ${extra_scheme_config_args}"

AC_SUBST(upsrcdir)
AC_SUBST(CC)
Expand Down

0 comments on commit b0e86b5

Please sign in to comment.