Project

General

Profile

Bug #13402

[PATCH] fix --with-gmp (broken by r57490)

Added by shyouhei (Shyouhei Urabe) about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-04-05 trunk 58250) [x86_64-darwin15]
[ruby-core:80569]

Description

From 1ff8c57aee9d777d114a0f961139510ee93dc9c5 Mon Sep 17 00:00:00 2001
From: "Urabe, Shyouhei" <shyouhei@ruby-lang.org>
Date: Wed, 5 Apr 2017 09:56:09 +0900
Subject: [PATCH] fix --with-gmp (broken by r57490)

Looking at the generated shell script (also the autoconf manual), it
seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
preprocessor macros, unlike AC_CHECK_LIB() which does define them.
This previous change effectively killed building with GMP because
building that mode depends on existence of HAVE_LIBGMP.

Signed-off-by: Urabe, Shyouhei <shyouhei@ruby-lang.org>
---
 configure.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure.in b/configure.in
index 48a10811a0..1dfec8b2d3 100644
--- a/configure.in
+++ b/configure.in
@@ -1386,13 +1386,15 @@ AC_ARG_WITH([gmp],
 AS_IF([test "x$with_gmp" != xno],
   [AC_CHECK_HEADERS(gmp.h)
    AS_IF([test "x$ac_cv_header_gmp_h" != xno],
-     AC_SEARCH_LIBS([__gmpz_init], [gmp]))])
+     AC_SEARCH_LIBS([__gmpz_init], [gmp],
+       [AC_DEFINE(HAVE_LIBGMP, 1)]))])

 AC_ARG_WITH([jemalloc],
   [AS_HELP_STRING([--with-jemalloc],[use jemalloc allocator])],
   [with_jemalloc=$withval], [with_jemalloc=no])
 AS_IF([test "x$with_jemalloc" = xyes],[
-  AC_SEARCH_LIBS([malloc_conf], [jemalloc], [], [with_jemalloc=no])
+  AC_SEARCH_LIBS([malloc_conf], [jemalloc],
+    [AC_DEFINE(HAVE_LIBJEMALLOC, 1)], [with_jemalloc=no])
   AC_CHECK_HEADER(jemalloc/jemalloc.h, [
     AC_DEFINE(RUBY_ALTERNATIVE_MALLOC_HEADER, [<jemalloc/jemalloc.h>])
   ])
-- 
2.12.2


Related issues

Related to Ruby trunk - Bug #13175: Building --with-jemalloc on FreeBSD failsClosedActions
Related to Ruby trunk - Bug #13899: Ruby 2.4.2 and 2.3.5 cannot link with libgmp nor jemallocClosedActions

Associated revisions

Revision 77c26ee6
Added by shyouhei (Shyouhei Urabe) about 2 years ago

fix --with-gmp (broken by r57490)

Looking at the generated shell script (also the autoconf manual), it
seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
preprocessor macros, unlike AC_CHECK_LIB() which does define them.
This previous change effectively killed building with GMP because
building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58254
Added by shyouhei (Shyouhei Urabe) about 2 years ago

fix --with-gmp (broken by r57490)

Looking at the generated shell script (also the autoconf manual), it
seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
preprocessor macros, unlike AC_CHECK_LIB() which does define them.
This previous change effectively killed building with GMP because
building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]

Revision 58254
Added by shyouhei (Shyouhei Urabe) about 2 years ago

fix --with-gmp (broken by r57490)

Looking at the generated shell script (also the autoconf manual), it
seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
preprocessor macros, unlike AC_CHECK_LIB() which does define them.
This previous change effectively killed building with GMP because
building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]

Revision 58254
Added by shyouhei (Shyouhei Urabe) about 2 years ago

fix --with-gmp (broken by r57490)

Looking at the generated shell script (also the autoconf manual), it
seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
preprocessor macros, unlike AC_CHECK_LIB() which does define them.
This previous change effectively killed building with GMP because
building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]

Revision 463a56d1
Added by usa (Usaku NAKAMURA) almost 2 years ago

merge revision(s) 58254: [Backport #13402]

    fix --with-gmp (broken by r57490)

    Looking at the generated shell script (also the autoconf manual), it
    seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
    preprocessor macros, unlike AC_CHECK_LIB() which does define them.
    This previous change effectively killed building with GMP because
    building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59912
Added by usa (Usaku NAKAMURA) almost 2 years ago

merge revision(s) 58254: [Backport #13402]

fix --with-gmp (broken by r57490)

Looking at the generated shell script (also the autoconf manual), it
seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
preprocessor macros, unlike AC_CHECK_LIB() which does define them.
This previous change effectively killed building with GMP because
building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]

Revision edda7925
Added by nagachika (Tomoyuki Chikanaga) almost 2 years ago

merge revision(s) 58254: [Backport #13402]

    fix --with-gmp (broken by r57490)

    Looking at the generated shell script (also the autoconf manual), it
    seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
    preprocessor macros, unlike AC_CHECK_LIB() which does define them.
    This previous change effectively killed building with GMP because
    building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59914
Added by nagachika (Tomoyuki Chikanaga) almost 2 years ago

merge revision(s) 58254: [Backport #13402]

fix --with-gmp (broken by r57490)

Looking at the generated shell script (also the autoconf manual), it
seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
preprocessor macros, unlike AC_CHECK_LIB() which does define them.
This previous change effectively killed building with GMP because
building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]

History

Updated by shyouhei (Shyouhei Urabe) about 2 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: DONTNEED, 2.3: DONTNEED, 2.4: DONTNEED
  • ruby -v set to ruby 2.5.0dev (2017-04-05 trunk 58250) [x86_64-darwin15]
  • Assignee set to nobu (Nobuyoshi Nakada)
  • Status changed from Open to Assigned

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

Indeed.
Please commit it.

#3

Updated by shyouhei (Shyouhei Urabe) about 2 years ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r58254.


fix --with-gmp (broken by r57490)

Looking at the generated shell script (also the autoconf manual), it
seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
preprocessor macros, unlike AC_CHECK_LIB() which does define them.
This previous change effectively killed building with GMP because
building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]

#4

Updated by usa (Usaku NAKAMURA) almost 2 years ago

  • Related to Bug #13175: Building --with-jemalloc on FreeBSD fails added
#5

Updated by usa (Usaku NAKAMURA) almost 2 years ago

  • Backport changed from 2.2: DONTNEED, 2.3: DONTNEED, 2.4: DONTNEED to 2.2: DONTNEED, 2.3: REQUIRED, 2.4: REQUIRED

Updated by usa (Usaku NAKAMURA) almost 2 years ago

  • Backport changed from 2.2: DONTNEED, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: DONTNEED, 2.3: DONE, 2.4: REQUIRED

ruby_2_3 r59912 merged revision(s) 58254.

Updated by nagachika (Tomoyuki Chikanaga) almost 2 years ago

  • Backport changed from 2.2: DONTNEED, 2.3: DONE, 2.4: REQUIRED to 2.2: DONTNEED, 2.3: DONE, 2.4: DONE

ruby_2_4 r59914 merged revision(s) 58254.

#8

Updated by usa (Usaku NAKAMURA) almost 2 years ago

  • Related to Bug #13899: Ruby 2.4.2 and 2.3.5 cannot link with libgmp nor jemalloc added

Also available in: Atom PDF