diff -uNr R-3.3.2.orig/Makeconf.in R-3.3.2/Makeconf.in
--- R-3.3.2.orig/Makeconf.in	2016-10-04 05:14:59.000000000 -0400
+++ R-3.3.2/Makeconf.in	2017-08-24 20:43:00.000000000 -0400
@@ -87,7 +87,7 @@
 READLINE_LIBS = @READLINE_LIBS@
 SED = @SED@
 SHELL = @R_SHELL@
-SHLIB_EXT = @SHLIB_EXT@
+SHLIB_EXT = .dylib
 SHLIB_CFLAGS = @SHLIB_CFLAGS@
 SHLIB_FFLAGS = @SHLIB_FFLAGS@
 SHLIB_LD = @SHLIB_LD@
diff -uNr R-3.3.2.orig/Makefile.fw R-3.3.2/Makefile.fw
--- R-3.3.2.orig/Makefile.fw	2011-10-02 18:02:39.000000000 -0400
+++ R-3.3.2/Makefile.fw	2017-08-24 20:43:00.000000000 -0400
@@ -8,7 +8,7 @@
 
 install install-strip: install-R-framework
 		@(sed 's|^LIBR =.*|LIBR = -F$(R_FRAMEWORK_DIR)/.. -framework R|' \
-		  $(top_builddir)/etc/Makeconf > "$(rhome)/etc${R_ARCH}/Makeconf")
+		  $(top_builddir)/etc/Makeconf > "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources/etc${R_ARCH}/Makeconf")
 		@(sed 's/Versions\/$(FW_VERSION)\/Resources/Resources/' \
 		  "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources/bin/R" > \
 		  "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources/bin/RR")
@@ -37,7 +37,7 @@
 	  ln -f -s -n Versions/Current/Resources Resources)
 	@## the resulting libR will point dyld to the fat libR regardless of its origin
 	@(cd "$(DESTDIR)$(R_FRAMEWORK_DIR)/Resources/lib" && \
-	  install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/libR.dylib" $(Rexeclibdir)/libR.dylib)
+	  install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/libR.dylib" $(DESTDIR)$(Rexeclibdir)/libR.dylib)
 	@( otool=otool ; if otool -D "$(DESTDIR)$(Rexeclibdir)/libR.dylib"|grep 'not an object'>/dev/null; then otool=otool64; fi; \
 	   for lib in Rlapack Rblas R; do \
 	   if test -e "$(DESTDIR)$(Rexeclibdir)/lib$${lib}.dylib"; then $(ECHO) "  lib$${lib}"; \
diff -Nur R-3.3.3.orig/configure R-3.3.3/configure
--- R-3.3.3.orig/configure	2017-02-26 18:17:05.000000000 -0500
+++ R-3.3.3/configure	2023-10-14 15:07:47.000000000 -0400
@@ -3899,8 +3899,8 @@
 
 ## As from R 3.2.0 split up -L... and -lR
 if test "${want_R_shlib}" = yes; then
-  LIBR0="-L\$(R_HOME)/lib\$(R_ARCH)"
-  LIBR1=-lR
+  LIBR0="\$(R_HOME)/lib\$(R_ARCH)/libR\$(DYLIB_EXT)"
+  LIBR1=
 else
   LIBR0=
   LIBR1=
@@ -27975,7 +27975,7 @@
 main_ld="${CC}"
 shlib_ld="${CC}"
 shlib_cxxld="${CXX}"
-SHLIB_EXT=".so"
+SHLIB_EXT=".dylib"
 SHLIB_LIBADD=
 use_exportfiles=no
 
@@ -32422,7 +32422,7 @@
 
 if test "${use_blas_shlib}" = yes; then
   ## set BLAS_LIBS to point at local version
-  BLAS_LIBS="-L\$(R_HOME)/lib\$(R_ARCH) -lRblas"
+  BLAS_LIBS="\$(R_HOME)/lib\$(R_ARCH)/libRblas\$(DYLIB_EXT)"
 fi
 
  if test "x${use_veclib_g95fix}" = xyes; then
@@ -32592,7 +32592,7 @@
 
 fi
 if test "${acx_lapack_ok}" != "yes"; then
-  LAPACK_LIBS="-L\$(R_HOME)/lib\$(R_ARCH) -lRlapack"
+  LAPACK_LIBS="\$(R_HOME)/lib\$(R_ARCH)/libRlapack\$(DYLIB_EXT)"
 fi
 
  if test "${acx_lapack_ok}" = "yes"; then
@@ -36193,8 +36193,8 @@
 
 
 if test "x${have_libcurl}" = "xyes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libcurl is version 7 and >= 7.28.0" >&5
-$as_echo_n "checking if libcurl is version 7 and >= 7.28.0... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libcurl is >= 7.28.0" >&5
+$as_echo_n "checking if libcurl is >= 7.28.0... " >&6; }
 if ${r_cv_have_curl728+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -36210,7 +36210,7 @@
 {
 #ifdef LIBCURL_VERSION_MAJOR
 #if LIBCURL_VERSION_MAJOR > 7
-  exit(1);
+  exit(0);
 #elif LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 28
   exit(0);
 #else
diff -uNr R-3.3.2.orig/src/extra/intl/vasnprintf.c R-3.3.2/src/extra/intl/vasnprintf.c
--- R-3.3.2.orig/src/extra/intl/vasnprintf.c	2010-03-17 10:43:05.000000000 -0400
+++ R-3.3.2/src/extra/intl/vasnprintf.c	2017-08-24 20:44:36.000000000 -0400
@@ -4006,7 +4006,7 @@
 #endif
 		  *fbp = dp->conversion;
 #if USE_SNPRINTF
-# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))
+# if !defined(__APPLE__) && !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))
 		fbp[1] = '%';
 		fbp[2] = 'n';
 		fbp[3] = '\0';
diff -uNr R-3.3.2.orig/src/main/Makefile.in R-3.3.2/src/main/Makefile.in
--- R-3.3.2.orig/src/main/Makefile.in	2016-10-04 05:14:42.000000000 -0400
+++ R-3.3.2/src/main/Makefile.in	2017-08-24 20:43:00.000000000 -0400
@@ -101,7 +101,7 @@
 R_bin_OBJECTS = Rmain.o @WANT_R_SHLIB_FALSE@$(OBJECTS)
 @WANT_R_SHLIB_FALSE@R_bin_LDADD = $(MAIN_OBJS) $(EXTRA_STATIC_LIBS) $(EXTRA_LIBS)
 ## Linked against -lRblas becasue -lR is and otherwise ld complains.
-@WANT_R_SHLIB_TRUE@R_bin_LDADD = -lR @BLAS_SHLIB_TRUE@-lRblas
+@WANT_R_SHLIB_TRUE@R_bin_LDADD = ../../lib@R_ARCH@/libR$(DYLIB_EXT) @BLAS_SHLIB_TRUE@../../lib@R_ARCH@/libRblas$(DYLIB_EXT)
 @BUILD_LTO_FALSE@R_bin_DEPENDENCIES =@WANT_R_SHLIB_FALSE@ libR.a @USE_EXPORTFILES_TRUE@ $(top_builddir)/etc/R.exp
 
 libR_la = libR$(R_DYLIB_EXT)
diff -uNr R-3.3.2.orig/src/nmath/standalone/Makefile.in R-3.3.2/src/nmath/standalone/Makefile.in
--- R-3.3.2.orig/src/nmath/standalone/Makefile.in	2015-12-10 18:15:18.000000000 -0500
+++ R-3.3.2/src/nmath/standalone/Makefile.in	2017-08-24 20:43:00.000000000 -0400
@@ -131,7 +131,7 @@
 
 test: $(srcdir)/test.c
 	$(CC) -o $@ $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(srcdir)/test.c \
-	  -L. -lRmath $(LIBM)
+	  libRmath$(DYLIB_EXT) $(LIBM)
 
 install: installdirs install-header @WANT_R_FRAMEWORK_FALSE@ install-pc
 @WANT_R_FRAMEWORK_FALSE@	@!(test -f $(libRmath_la)) || $(SHELL) $(top_srcdir)/tools/copy-if-change $(libRmath_la) $(DESTDIR)$(libdir)/$(libRmath_la)
