forked from tomtom-international/homebrew-taps
/
libtool@2.4.rb
39 lines (35 loc) · 1.38 KB
/
libtool@2.4.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Xcode 4.3 provides the Apple libtool.
# This is not the same so as a result we must install this as glibtool.
class LibtoolAT24 < Formula
desc "Generic library support script"
homepage "https://www.gnu.org/software/libtool/"
url "https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.xz"
mirror "https://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.xz"
sha256 "7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f"
revision 1
def install
ENV["SED"] = "sed" # prevent libtool from hardcoding sed path from superenv
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--program-prefix=g",
"--enable-ltdl-install"
system "make", "install"
end
def caveats; <<~EOS
In order to prevent conflicts with Apple's own libtool we have prepended a "g"
so, you have instead: glibtool and glibtoolize.
EOS
end
test do
system "#{bin}/glibtool", "execute", "/usr/bin/true"
(testpath/"hello.c").write <<~EOS
#include <stdio.h>
int main() { puts("Hello, world!"); return 0; }
EOS
system bin/"glibtool", "--mode=compile", "--tag=CC",
ENV.cc, "-c", "hello.c", "-o", "hello.o"
system bin/"glibtool", "--mode=link", "--tag=CC",
ENV.cc, "hello.o", "-o", "hello"
assert_match "Hello, world!", shell_output("./hello")
end
end