Skip to content

Commit

Permalink
Add config patch
Browse files Browse the repository at this point in the history
  • Loading branch information
IsabelParedes committed Jun 4, 2024
1 parent 60f4c6f commit 7002ffd
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 17 deletions.
13 changes: 11 additions & 2 deletions recipes/recipes_emscripten/r-base/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@ export FPICFLAGS="-fPIC"
export r_cv_header_zlib_h=yes
export r_cv_have_bzlib=yes


# export LDFLAGS=${LDFLAGS//$PREFIX/$BUILD_PREFIX}
# export CPPFLAGS=${CPPFLAGS//$PREFIX/$BUILD_PREFIX}
# export NM=$($CC_FOR_BUILD -print-prog-name=nm)
# export PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig
# export HOST=$BUILD_PREFIX
# export IS_MINIMAL_R_BUILD=1

# TODO: may need to compile twice, 1. regular, 2. cross-compile

emconfigure ./configure \
--prefix=$PREFIX \
--build=$BUILD \
--host=$HOST \
--host=$ARCH \
--with-lapack=no \
--with-blas=no \
--with-readline=no \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
diff --git a/configure b/configure
index ea413eb..66308ed 100755
--- a/configure
+++ b/configure
@@ -4305,7 +4305,7 @@ R_OS="${host_os}"


case "${host_os}" in
- mingw*|windows*|winnt|msys)
+ mingw*|windows*|winnt|msys|emscripten*)

printf "%s\n" "#define Win32 1" >>confdefs.h

@@ -11123,7 +11123,7 @@ irix5* | irix6* | nonstopux*)
;;

# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | emscripten*)
lt_cv_deplibs_check_method=pass_all
;;

@@ -14878,7 +14878,7 @@ _LT_EOF
archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;

- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | emscripten*)
tmp_diet=no
if test linux-dietlibc = "$host_os"; then
case $cc_basename in
@@ -15645,7 +15645,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
link_all_deplibs=yes
;;

- linux*)
+ linux* | emscripten*)
case $cc_basename in
tcc*)
# Fabrice Bellard et al's Tiny C Compiler
@@ -16702,7 +16702,7 @@ linux*android*)
;;

# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | emscripten*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
@@ -18794,7 +18794,7 @@ fi
inherit_rpath_CXX=yes
;;

- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | emscripten*)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -20679,7 +20679,7 @@ linux*android*)
;;

# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | emscripten*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
@@ -22199,7 +22199,7 @@ _LT_EOF
archive_expsym_cmds_FC='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;

- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | emscripten*)
tmp_diet=no
if test linux-dietlibc = "$host_os"; then
case $cc_basename in
@@ -22915,7 +22915,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
link_all_deplibs_FC=yes
;;

- linux*)
+ linux* | emscripten*)
case $cc_basename in
tcc*)
# Fabrice Bellard et al's Tiny C Compiler
@@ -23800,7 +23800,7 @@ linux*android*)
;;

# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | emscripten*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
@@ -24256,7 +24256,7 @@ case "${host_os}" in
darwin*)
Rshlibpath_var=DYLD_FALLBACK_LIBRARY_PATH
;;
- cygwin*|mingw*|windows*|winnt|msys)
+ cygwin*|mingw*|windows*|winnt|msys|emscripten*)
Rshlibpath_var=PATH
;;
*)
@@ -25653,7 +25653,7 @@ done
fi

case "${host_os}" in
- cygwin*|mingw*|windows*|winnt|msys)
+ cygwin*|mingw*|windows*|winnt|msys|emscripten*)
r_cv_type_socklen=int
;;
esac
@@ -42681,7 +42681,7 @@ fi
## flags to all (C, C++ and Fortran) compiler flags.

case "${host_os}" in
- mingw*|windows*|winnt|msys)
+ mingw*|windows*|winnt|msys|emscripten*)
;;
*)
r_save_CFLAGS=${CFLAGS}
@@ -43630,7 +43630,7 @@ fi
done

case "${host_os}" in
- mingw*|windows*|winnt|msys)
+ mingw*|windows*|winnt|msys|emscripten*)
;;
*)
if test "${ac_cv_have_decl_select}" = "no"; then
@@ -50606,7 +50606,7 @@ then :
printf %s "(cached) " >&6
else $as_nop
case "${host_os}" in
- cygwin*|mingw*|windows*|winnt|msys)
+ cygwin*|mingw*|windows*|winnt|msys|emscripten*)
r_cv_bsd_networking=yes
;;
esac
@@ -51491,6 +51491,12 @@ fi

## libcurl

+case $host_os in
+ emscripten*)
+ have_libcurl=no
+ ;;
+ *)
+
# Extract the first word of "curl-config", so it can be a program name with args.
set dummy curl-config; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -51678,6 +51684,10 @@ else
as_fn_error $? "libcurl >= 7.28.0 library and headers are required with support for https" "$LINENO" 5
fi

+;;
+
+esac
+


## Bitmap headers and libraries.
15 changes: 0 additions & 15 deletions recipes/recipes_emscripten/r-base/patches/zlib_config.patch
Original file line number Diff line number Diff line change
@@ -1,15 +0,0 @@
diff --git a/configure b/configure
index ea413eb..d712ee3 100755
--- a/configure
+++ b/configure
@@ -50802,8 +50802,9 @@ printf "%s\n" "$r_cv_header_zlib_h" >&6; }
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether zlib support suffices" >&5
printf %s "checking whether zlib support suffices... " >&6; }
+have_zlib=yes
if test "${have_zlib}" != yes; then
- as_fn_error $? "zlib library and headers are required" "$LINENO" 5
+ as_fn_error $? "zlib WTF library and headers are required" "$LINENO" 5
else
LIBS="-lz ${LIBS}"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4 changes: 4 additions & 0 deletions recipes/recipes_emscripten/r-base/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ requirements:
- readline
- zlib
- bzip2
- libdeflate
- xz
host:
- zlib
- bzip2
run:
- zlib
- bzip2


about:
Expand Down

0 comments on commit 7002ffd

Please sign in to comment.