forked from nrolland/homebrew-formal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
picosat.rb
52 lines (44 loc) · 1.27 KB
/
picosat.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
40
41
42
43
44
45
46
47
48
49
50
51
require 'formula'
class Picosat < Formula
homepage 'http://fmv.jku.at/picosat/'
url 'http://fmv.jku.at/picosat/picosat-951.tar.gz'
sha1 '92319ba08e58e7637b4535197d2c1ba54e486083'
def patches
# Fix the dynamic shared library.
DATA
end
def install
system "./configure -shared"
system "make"
bin.install "picosat", "picogcnf", "picomcs", "picomus"
lib.install "libpicosat.a", "libpicosat.dylib"
include.install "picosat.h"
end
end
__END__
diff --git a/configure b/configure
index ca5ec77..fe9e162 100755
--- a/configure
+++ b/configure
@@ -108,7 +108,7 @@ fi
TARGETS="picosat picomcs picomus picogcnf libpicosat.a"
if [ $shared = yes ]
then
- TARGETS="$TARGETS libpicosat.so"
+ TARGETS="$TARGETS libpicosat.dylib"
CFLAGS="$CFLAGS -fPIC"
fi
echo "targets ... $TARGETS"
diff --git a/makefile.in b/makefile.in
index 6621bb8..211031a 100644
--- a/makefile.in
+++ b/makefile.in
@@ -49,8 +49,7 @@ libpicosat.a: picosat.o version.o
ar rc $@ picosat.o version.o
ranlib $@
-SONAME=-Xlinker -soname -Xlinker libpicosat.so
-libpicosat.so: picosat.o version.o
- $(CC) $(CFLAGS) -shared -o $@ picosat.o version.o $(SONAME)
+libpicosat.dylib: picosat.o version.o
+ $(CC) $(CFLAGS) -shared -install_name $@ -o $@ picosat.o version.o
.PHONY: all clean