From 5168b97fb5e2eebdc99b40f96f9b6289647e87d2 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 26 Feb 2016 09:29:14 +0900 Subject: Add support for Solaris, fixing HPPA. * configure.ac (HAVE_GCC_ATTRIBUTE_ALIGNED): Remove. (LIB_SCHED_YIELD): New. Check sched_yield in -lrt. * src/gen-posix-lock-obj.c (USE_16BYTE_ALIGNMENT): Remove. (USE_DOUBLE_FOR_ALIGNMENT, USE_LONG_DOUBLE_FOR_ALIGNMENT): New. * src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h: Update. -- Signed-off-by: NIIBE Yutaka --- configure.ac | 43 +++++++++++------------- src/gen-posix-lock-obj.c | 20 ++++++----- src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h | 2 +- 3 files changed, 32 insertions(+), 33 deletions(-) diff --git a/configure.ac b/configure.ac index 19ae9c8..9882d02 100644 --- a/configure.ac +++ b/configure.ac @@ -273,20 +273,6 @@ if test "$GCC" = yes; then fi fi -# -# Check whether the compiler supports the GCC style aligned attribute -# -AC_CACHE_CHECK([whether the GCC style aligned attribute is supported], - [gcry_cv_gcc_attribute_aligned], - [gcry_cv_gcc_attribute_aligned=no - AC_COMPILE_IFELSE([AC_LANG_SOURCE( - [[struct { int a; } foo __attribute__ ((aligned (16)));]])], - [gcry_cv_gcc_attribute_aligned=yes])]) -if test "$gcry_cv_gcc_attribute_aligned" = "yes" ; then - AC_DEFINE(HAVE_GCC_ATTRIBUTE_ALIGNED,1, - [Defined if a GCC style "__attribute__ ((aligned (n))" is supported]) -fi - # # Check for ELF visibility support. # @@ -416,6 +402,25 @@ else fi fi +# Default value for GPG_ERROR_CONFIG_LIBS +config_libs="-lgpg-error" + +# +# Check for other libraries (now only for -lrt). +# +# Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* +# programs in the package would end up linked with that potentially-shared +# library, inducing unnecessary run-time overhead. +LIB_SCHED_YIELD= +AC_SUBST([LIB_SCHED_YIELD]) +gl_saved_libs=$LIBS +AC_SEARCH_LIBS([sched_yield], [rt posix4], + [if test "$ac_cv_search_sched_yield" != "none required"; then + LIB_SCHED_YIELD=$ac_cv_search_sched_yield + config_libs="$config_libs $LIB_SCHED_YIELD" + fi]) +LIBS=$gl_saved_libs + # # Prepare building of estream # @@ -424,7 +429,7 @@ estream_INIT # # Substitution used for gpg-error-config # -GPG_ERROR_CONFIG_LIBS="-lgpg-error" +GPG_ERROR_CONFIG_LIBS="$config_libs" if test "x$LIBTHREAD" != x; then GPG_ERROR_CONFIG_LIBS="${GPG_ERROR_CONFIG_LIBS} ${LIBTHREAD}" fi @@ -544,11 +549,3 @@ echo " Revision: mym4_revision (mym4_revision_dec) Platform: $host$tmp " -if test "$gcry_cv_gcc_attribute_aligned" != "yes" ; then -cat <