From bb7836e734806207107e497c20743b2880b5a5e6 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 10 May 2019 08:46:49 -0600 Subject: [PATCH] cs: support `--enable-natipkg` --- racket/src/ac/natipkg_arg.m4 | 1 + racket/src/ac/natipkg_show.m4 | 1 + racket/src/cfg-racket | 2 ++ racket/src/cs/c/configure | 16 +++++++++++++ racket/src/cs/c/configure.ac | 8 +++++++ racket/src/cs/rumble/system.ss | 44 +++++++++++++++++++--------------- racket/src/racket/configure.ac | 4 ++-- 7 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 racket/src/ac/natipkg_arg.m4 create mode 100644 racket/src/ac/natipkg_show.m4 diff --git a/racket/src/ac/natipkg_arg.m4 b/racket/src/ac/natipkg_arg.m4 new file mode 100644 index 0000000000..a33adf4657 --- /dev/null +++ b/racket/src/ac/natipkg_arg.m4 @@ -0,0 +1 @@ +AC_ARG_ENABLE(natipkg, [ --enable-natipkg add "-natipkg" to library subpath]) diff --git a/racket/src/ac/natipkg_show.m4 b/racket/src/ac/natipkg_show.m4 new file mode 100644 index 0000000000..5e36a5c8b0 --- /dev/null +++ b/racket/src/ac/natipkg_show.m4 @@ -0,0 +1 @@ +show_explicitly_enabled "${enable_natipkg}" "Adding \"-natipkg\" suffix to library subpath" diff --git a/racket/src/cfg-racket b/racket/src/cfg-racket index 41a6a452df..0386bea3da 100755 --- a/racket/src/cfg-racket +++ b/racket/src/cfg-racket @@ -2694,6 +2694,7 @@ if test "${enable_natipkg+set}" = set; then : fi + # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; @@ -3179,6 +3180,7 @@ show_explicitly_disabled "${enable_docs}" "Documentation build" show_explicitly_enabled "${enable_usersetup}" "User-specific setup on install" show_explicitly_enabled "${enable_natipkg}" "Adding \"-natipkg\" suffix to library subpath" + show_explicitly_enabled "${enable_xonx}" "Unix style" show_explicitly_enabled "${enable_shared}" "Shared libraries" diff --git a/racket/src/cs/c/configure b/racket/src/cs/c/configure index 2a2800492a..0d73a12456 100755 --- a/racket/src/cs/c/configure +++ b/racket/src/cs/c/configure @@ -772,6 +772,7 @@ enable_racket enable_scheme enable_mach enable_target +enable_natipkg enable_sdk enable_xonx enable_macprefix @@ -1409,6 +1410,7 @@ Optional Features: --enable-scheme= Chez Scheme build directory at --enable-mach= Use Chez Scheme machine type --enable-target= Cross-build for Chez Scheme machine type + --enable-natipkg add "-natipkg" to library subpath --enable-sdk= use Mac OS 10.4 SDK directory --enable-sdk5= use Mac OS 10.5 SDK directory --enable-sdk6= use Mac OS 10.6 SDK directory @@ -2364,6 +2366,12 @@ if test "${enable_target+set}" = set; then : enableval=$enable_target; fi +# Check whether --enable-natipkg was given. +if test "${enable_natipkg+set}" = set; then : + enableval=$enable_natipkg; +fi + + # Check whether --enable-sdk was given. if test "${enable_sdk+set}" = set; then : enableval=$enable_sdk; @@ -2510,6 +2518,8 @@ 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_enabled "${enable_natipkg}" "Adding \"-natipkg\" suffix to library subpath" + if test "${enable_csonly}" = "yes" ; then enable_csdefault=yes @@ -4297,6 +4307,12 @@ $as_echo "$set_strip_lib" >&6; } fi +############## natipkg ################ + +if test "${enable_natipkg}" = "yes" ; then + CONFIGURE_RACKET_SO_COMPILE="${CONFIGURE_RACKET_SO_COMPILE} env PLT_CS_SLSP_SUFFIX=-natipkg" +fi + ############## Makefile includes ################ if test "$INCLUDEDEP" = "#" ; then diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac index bb14943b6f..74f6232869 100644 --- a/racket/src/cs/c/configure.ac +++ b/racket/src/cs/c/configure.ac @@ -22,6 +22,7 @@ AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket to bui AC_ARG_ENABLE(scheme, [ --enable-scheme= Chez Scheme build directory at ]) AC_ARG_ENABLE(mach, [ --enable-mach= Use Chez Scheme machine type ]) AC_ARG_ENABLE(target, [ --enable-target= Cross-build for Chez Scheme machine type ]) +m4_include(../ac/natipkg_arg.m4) m4_include(../ac/sdk_arg.m4) m4_include(../ac/strip_arg.m4) AC_ARG_ENABLE(csdefault, [ --enable-csdefault use CS as default build]) @@ -63,6 +64,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" +m4_include(../ac/natipkg_show.m4) if test "${enable_csonly}" = "yes" ; then enable_csdefault=yes @@ -407,6 +409,12 @@ fi m4_include(../ac/strip.m4) +############## natipkg ################ + +if test "${enable_natipkg}" = "yes" ; then + CONFIGURE_RACKET_SO_COMPILE="${CONFIGURE_RACKET_SO_COMPILE} env PLT_CS_SLSP_SUFFIX=-natipkg" +fi + ############## Makefile includes ################ if test "$INCLUDEDEP" = "#" ; then diff --git a/racket/src/cs/rumble/system.ss b/racket/src/cs/rumble/system.ss index 46a1cc4f80..7a1b9e7675 100644 --- a/racket/src/cs/rumble/system.ss +++ b/racket/src/cs/rumble/system.ss @@ -49,25 +49,31 @@ [else 'unix])) (define system-library-subpath-string - (case (machine-type) - [(a6nt ta6nt) "win32\\x86_64"] - [(i3nt ti3nt) "win32\\i386"] - [(a6osx ta6osx) (if unix-style-macos? "x86_64-darwin" "x86_64-macosx")] - [(i3osx ti3osx) (if unix-style-macos? "i386-darwin" "i386-macosx")] - [(a6le ta6le) "x86_64-linux"] - [(i3le ti3le) "i386-linux"] - [(arm32le tarm32le) "arm-linux"] - [(ppc32le tppc32le) "ppc-linux"] - [(i3ob ti3ob) "i386-openbsd"] - [(a6ob ta6ob) "x86_64-openbsd"] - [(i3ob ti3ob) "i386-openbsd"] - [(a6fb ta6fb) "x86_64-freebsd"] - [(i3fb ti3fb) "i386-freebsd"] - [(a6nb ta6nb) "x86_64-netbsd"] - [(i3nb ti3nb) "i386-netbsd"] - [(a6s2 ta6s2) "x86_64-solaris"] - [(i3s2 ti3s2) "i386-solaris"] - [else "unix"])) + (string-append + (case (machine-type) + [(a6nt ta6nt) "win32\\x86_64"] + [(i3nt ti3nt) "win32\\i386"] + [(a6osx ta6osx) (if unix-style-macos? "x86_64-darwin" "x86_64-macosx")] + [(i3osx ti3osx) (if unix-style-macos? "i386-darwin" "i386-macosx")] + [(a6le ta6le) "x86_64-linux"] + [(i3le ti3le) "i386-linux"] + [(arm32le tarm32le) "arm-linux"] + [(ppc32le tppc32le) "ppc-linux"] + [(i3ob ti3ob) "i386-openbsd"] + [(a6ob ta6ob) "x86_64-openbsd"] + [(i3ob ti3ob) "i386-openbsd"] + [(a6fb ta6fb) "x86_64-freebsd"] + [(i3fb ti3fb) "i386-freebsd"] + [(a6nb ta6nb) "x86_64-netbsd"] + [(i3nb ti3nb) "i386-netbsd"] + [(a6s2 ta6s2) "x86_64-solaris"] + [(i3s2 ti3s2) "i386-solaris"] + [else "unix"]) + (let-syntax ([suffix + (lambda (stx) + (or (getenv "PLT_CS_SLSP_SUFFIX") + ""))]) + (suffix)))) (define get-machine-info (lambda () "localhost info...")) (define (set-get-machine-info! proc) diff --git a/racket/src/racket/configure.ac b/racket/src/racket/configure.ac index 6bc3cda977..fa19146d65 100644 --- a/racket/src/racket/configure.ac +++ b/racket/src/racket/configure.ac @@ -45,7 +45,7 @@ AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket to build; m4_include(../ac/path_arg.m4) -AC_ARG_ENABLE(natipkg, [ --enable-natipkg add "-natipkg" to library subpath]) +m4_include(../ac/natipkg_arg.m4) AC_ARG_ENABLE(shared, [ --enable-shared create shared libraries (ok, but not recommended)]) AC_ARG_ENABLE(dynlib, [ --enable-dynlib same as --enable-shared]) @@ -179,7 +179,7 @@ show_explicitly_enabled "${enable_csdefault}" "CS will be default" show_explicitly_disabled "${enable_docs}" "Documentation build" show_explicitly_enabled "${enable_usersetup}" "User-specific setup on install" -show_explicitly_enabled "${enable_natipkg}" "Adding \"-natipkg\" suffix to library subpath" +m4_include(../ac/natipkg_show.m4) show_explicitly_enabled "${enable_xonx}" "Unix style" show_explicitly_enabled "${enable_shared}" "Shared libraries"