From 9768f632a2825704b56f47a3a272d49de528671d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 19 Sep 2015 08:56:08 -0600 Subject: [PATCH] Disable static-library install for Windows or Mac OS X Also, OS X `strip` needs `-S` for archives, in case a static-library install is enabled. --- racket/src/configure | 23 ++++++++++++++++++----- racket/src/racket/configure.ac | 21 ++++++++++++++++++--- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/racket/src/configure b/racket/src/configure index 84167ff948..b4353468f8 100755 --- a/racket/src/configure +++ b/racket/src/configure @@ -1451,7 +1451,7 @@ Optional Features: --enable-shared create shared libraries (ok, but not recommended) --enable-dynlib same as --enable-shared --enable-lt= use instead of libtool; disable to use bundled - --enable-libs install static libraries, if any (enabled by default) + --enable-libs install static libraries (enabled by default for Unix) --enable-libffi use installed libffi (enabled by default for Unix) --enable-sdk= use Mac OS X 10.4 SDK directory --enable-sdk5= use Mac OS X 10.5 SDK directory @@ -2685,8 +2685,6 @@ fi # Check whether --enable-libs was given. if test "${enable_libs+set}" = set; then : enableval=$enable_libs; -else - enable_libs=yes fi @@ -3054,6 +3052,7 @@ show_explicitly_enabled "${enable_noopt}" "No-optimization" "Note that this mode show_explicitly_enabled "${enable_strip}" "Debug-symbol stripping" show_explicitly_disabled "${enable_strip}" "Debug-symbol stripping" +show_explicitly_enabled "${enable_libs}" "Installation of static libraries (if any)" show_explicitly_disabled "${enable_libs}" "Installation of static libraries (if any)" show_explicitly_disabled "${enable_mac64}" "64-bit Mac OS X" @@ -3178,6 +3177,7 @@ INSTALL_SETUP_RACKET_FLAGS= INSTALL_LIBS_ENABLE=no-install STRIP_DEBUG=":" +strip_debug_flags="" enable_strip_by_default=yes use_flag_pthread=yes @@ -4528,7 +4528,8 @@ if test "${enable_jit}" = "yes" ; then check_for_mprotect=yes fi -if test "${enable_libs}" = "yes" ; then +if test "${enable_libs}" != "no" ; then + # Canceled for some platforms below: INSTALL_LIBS_ENABLE=install fi @@ -4657,6 +4658,10 @@ case "$host_os" in GUI_CONFIG_PATH="../etc" skip_iconv_check=yes check_for_mprotect=no + # ".a" is typically not useful, since we always build a DLL: + if test "${enable_libs}" == "" ; then + INSTALL_LIBS_ENABLE=no-install + fi $as_echo "#define HAVE_STDINT_H 1" >>confdefs.h @@ -4738,6 +4743,14 @@ $as_echo "#define HAVE_STDINT_H 1" >>confdefs.h PREFLAGS="$PREFLAGS -DOS_X -D_DARWIN_UNLIMITED_SELECT" try_kqueue_syscall=yes + # Needed when stripping ".a"s: + strip_debug_flags=" -S" + + # ".a" is typically not useful, since we always build a ".dylib": + if test "${enable_libs}" == "" ; then + INSTALL_LIBS_ENABLE=no-install + fi + SO_SUFFIX=.dylib # Force 32-bit build unless mac64 is enabled: @@ -4936,7 +4949,7 @@ else fi # Used to add -S flag, but not all `strip' variants support it: - STRIP_DEBUG="$STRIP" + STRIP_DEBUG="${STRIP}${strip_debug_flags}" fi ############## C flags ################ diff --git a/racket/src/racket/configure.ac b/racket/src/racket/configure.ac index 41e2e7aff9..8ad72a7af4 100644 --- a/racket/src/racket/configure.ac +++ b/racket/src/racket/configure.ac @@ -53,7 +53,7 @@ AC_ARG_ENABLE(natipkg, [ --enable-natipkg add "-natipkg" to library subp AC_ARG_ENABLE(shared, [ --enable-shared create shared libraries (ok, but not recommended)]) AC_ARG_ENABLE(dynlib, [ --enable-dynlib same as --enable-shared]) AC_ARG_ENABLE(lt, [ --enable-lt= use instead of libtool; disable to use bundled], LIBTOOLPROG="$enableval", enable_lt=default) -AC_ARG_ENABLE(libs, [ --enable-libs install static libraries, if any (enabled by default)], , enable_libs=yes) +AC_ARG_ENABLE(libs, [ --enable-libs install static libraries (enabled by default for Unix)]) AC_ARG_ENABLE(libffi, [ --enable-libffi use installed libffi (enabled by default for Unix)], , enable_libffi=default) @@ -325,6 +325,7 @@ show_explicitly_enabled "${enable_noopt}" "No-optimization" "Note that this mode show_explicitly_enabled "${enable_strip}" "Debug-symbol stripping" show_explicitly_disabled "${enable_strip}" "Debug-symbol stripping" +show_explicitly_enabled "${enable_libs}" "Installation of static libraries (if any)" show_explicitly_disabled "${enable_libs}" "Installation of static libraries (if any)" show_explicitly_disabled "${enable_mac64}" "64-bit Mac OS X" @@ -449,6 +450,7 @@ INSTALL_SETUP_RACKET_FLAGS= INSTALL_LIBS_ENABLE=no-install STRIP_DEBUG=":" +strip_debug_flags="" enable_strip_by_default=yes use_flag_pthread=yes @@ -652,7 +654,8 @@ if test "${enable_jit}" = "yes" ; then check_for_mprotect=yes fi -if test "${enable_libs}" = "yes" ; then +if test "${enable_libs}" != "no" ; then + # Canceled for some platforms below: INSTALL_LIBS_ENABLE=install fi @@ -781,6 +784,10 @@ case "$host_os" in GUI_CONFIG_PATH="../etc" skip_iconv_check=yes check_for_mprotect=no + # ".a" is typically not useful, since we always build a DLL: + if test "${enable_libs}" == "" ; then + INSTALL_LIBS_ENABLE=no-install + fi AC_DEFINE(HAVE_STDINT_H,1,[Have stdint.h]) if `which ${host}-windres > /dev/null` ; then WINDRES="${host}-windres" @@ -860,6 +867,14 @@ case "$host_os" in PREFLAGS="$PREFLAGS -DOS_X -D_DARWIN_UNLIMITED_SELECT" try_kqueue_syscall=yes + # Needed when stripping ".a"s: + strip_debug_flags=" -S" + + # ".a" is typically not useful, since we always build a ".dylib": + if test "${enable_libs}" == "" ; then + INSTALL_LIBS_ENABLE=no-install + fi + SO_SUFFIX=.dylib # Force 32-bit build unless mac64 is enabled: @@ -967,7 +982,7 @@ fi if test "${enable_strip}" = "yes" ; then AC_CHECK_TOOL([STRIP], [strip]) # Used to add -S flag, but not all `strip' variants support it: - STRIP_DEBUG="$STRIP" + STRIP_DEBUG="${STRIP}${strip_debug_flags}" fi ############## C flags ################