Skip to content

Commit

Permalink
Generate lib/findlib.conf.d/<TARGETABI> (2/n)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahbeckford committed Oct 3, 2024
1 parent 6c55bd1 commit 393a205
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/r-c-ocaml-3-build_cross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,16 @@ add_text() {
add_findlib_conf() {
# ex. android_arm32v7a
add_findlib_conf_ABI=$1; shift
add_findlib_conf_MLCROSS=$1; shift
# ex. <switch>/share/dkml-base-compiler/mlcross/android_arm64v8a
add_findlib_conf_CROSSTARGET=$1; shift

install -d "$TARGETDIR_UNIX/lib/findlib.conf.d"
add_findlib_conf_CONF="$TARGETDIR_UNIX/lib/findlib.conf.d/$add_findlib_conf_ABI.conf"

# Ex. path(android_arm32v7a)="C:\\source\\windows_x86_64\\lib"
# Any backslashes need to be escaped since it is an OCaml string
bin_buildhost="$add_findlib_conf_MLCROSS/bin"
lib_buildhost="$add_findlib_conf_MLCROSS/lib"
bin_buildhost="$add_findlib_conf_CROSSTARGET/bin"
lib_buildhost="$add_findlib_conf_CROSSTARGET/lib"
sysroot_lib_buildhost="$TARGETDIR_UNIX/$add_findlib_conf_ABI-sysroot/lib"
install -d "$sysroot_lib_buildhost" # needed for realpath to work, even if won't be populated until conf-dkml-cross-toolchain
_dirsep="/"
Expand All @@ -582,7 +583,7 @@ add_findlib_conf() {
printf "%s\n" "path($add_findlib_conf_ABI) = \"$lib_buildhost${_findsep}$sysroot_lib_buildhost\""
printf "%s\n" "destdir($add_findlib_conf_ABI) = \"$sysroot_lib_buildhost\""
printf "%s\n" "stdlib($add_findlib_conf_ABI) = \"$lib_buildhost${_dirsep}ocaml\""
if [ -e "$add_findlib_conf_MLCROSS/bin/flexlink.exe" ]; then
if [ -e "$add_findlib_conf_CROSSTARGET/bin/flexlink.exe" ]; then
printf "%s\n" "flexlink($add_findlib_conf_ABI) = \"$bin_buildhost${_dirsep}flexlink.exe\""
fi
printf "%s\n" "ocaml($add_findlib_conf_ABI) = \"$bin_buildhost${_dirsep}ocaml${_exe}\""
Expand Down Expand Up @@ -628,6 +629,6 @@ while IFS= read -r _abientry; do

# Create lib/findlib.conf.d/android_arm64.conf (etc.)
cd "$TARGETDIR_UNIX"
add_findlib_conf "$_targetabi" "$_CROSS_SRCDIR"
add_findlib_conf "$_targetabi" "$_CROSS_TARGETDIR"

done <"$WORK"/target-abis

0 comments on commit 393a205

Please sign in to comment.