Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Commit

Permalink
gearman: apply patch to fix configure
Browse files Browse the repository at this point in the history
In gearman-0.28, configure.ac has some bad copypasta that ends up
breaking the build on platforms that do not have librt, such as
MacOS X.

configure.ac --

    173 # Check for -lrt
    174 AC_CHECK_LIB([rt], [clock_gettime],
    175              [
    176               RT_LIB="-lrt"
    177               AC_SUBST(RT_LIB)
    178               AC_DEFINE([HAVE_LIBRT], [ 1 ], [Have clock_gettime])
    179               ],
    180              [
    181               AC_DEFINE([HAVE_LIBRT], [ 0 ], [Have clock_gettime])
    182               ])
    183
    184 # Check for -lm
    185 AC_CHECK_LIB([m], [floor],
    186              [
    187               M_LIB="-lrt"
    188               AC_SUBST(M_LIB)
    189               AC_DEFINE([HAVE_LIBRT], [ 1 ], [Have clock_gettime])
    190               ],
    191              [
    192               AC_DEFINE([HAVE_LIBRT], [ 0 ], [Have clock_gettime])
    193               ])

As the comment on line 184 indicates, it's supposed to be checking for
libm, not librt.  This commit corrects this, which fixes issue #10222.

Closes #10823.

Signed-off-by: Jack Nagel <[email protected]>
  • Loading branch information
dossy authored and jacknagel committed Mar 11, 2012
1 parent b2543eb commit 83235bf
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions Library/Formula/gearman.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ class Gearman < Formula
depends_on 'libevent'
depends_on 'ossp-uuid'

def patches
# gearman-0.28 build error "ld: library not found for -lrt"
# see https://bugs.launchpad.net/gearmand/+bug/951198
DATA
end

def install
system "./configure", "--prefix=#{prefix}"
system "make install"
Expand Down Expand Up @@ -54,3 +60,46 @@ def startup_plist
EOPLIST
end
end

__END__
--- gearmand-0.28/configure.ac.orig 2012-03-09 14:56:28.000000000 -0500
+++ gearmand-0.28/configure.ac 2012-03-09 14:56:58.000000000 -0500
@@ -184,12 +184,12 @@
# Check for -lm
AC_CHECK_LIB([m], [floor],
[
- M_LIB="-lrt"
+ M_LIB="-lm"
AC_SUBST(M_LIB)
- AC_DEFINE([HAVE_LIBRT], [ 1 ], [Have clock_gettime])
+ AC_DEFINE([HAVE_LIBM], [ 1 ], [Have floor])
],
[
- AC_DEFINE([HAVE_LIBRT], [ 0 ], [Have clock_gettime])
+ AC_DEFINE([HAVE_LIBM], [ 0 ], [Have floor])
])

AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])

--- gearmand-0.28/configure.orig 2012-03-09 15:06:11.000000000 -0500
+++ gearmand-0.28/configure 2012-03-09 15:06:45.000000000 -0500
@@ -25755,16 +25790,16 @@
$as_echo "$ac_cv_lib_m_floor" >&6; }
if test "x$ac_cv_lib_m_floor" = xyes; then :

- M_LIB="-lrt"
+ M_LIB="-lm"


-$as_echo "#define HAVE_LIBRT 1 " >>confdefs.h
+$as_echo "#define HAVE_LIBM 1 " >>confdefs.h


else


-$as_echo "#define HAVE_LIBRT 0 " >>confdefs.h
+$as_echo "#define HAVE_LIBM 0 " >>confdefs.h


fi

0 comments on commit 83235bf

Please sign in to comment.