parent
4b1d5d1391
commit
b06b327c5b
|
@ -23,6 +23,11 @@ class Ld64 < Formula
|
||||||
url 'http://opensource.apple.com/tarballs/ld64/ld64-97.17.tar.gz'
|
url 'http://opensource.apple.com/tarballs/ld64/ld64-97.17.tar.gz'
|
||||||
sha1 '7c1d816c2fec02e558f4a528d16d8161f0e379b5'
|
sha1 '7c1d816c2fec02e558f4a528d16d8161f0e379b5'
|
||||||
|
|
||||||
|
resource "makefile" do
|
||||||
|
url "https://trac.macports.org/export/123511/trunk/dports/devel/ld64/files/Makefile-97", :using => :nounzip
|
||||||
|
sha1 "581688eb31a44b406dfb7476a770d2cff190f2bd"
|
||||||
|
end
|
||||||
|
|
||||||
depends_on SnowLeopardOrOlder
|
depends_on SnowLeopardOrOlder
|
||||||
|
|
||||||
# Tiger either includes old versions of these headers,
|
# Tiger either includes old versions of these headers,
|
||||||
|
@ -57,7 +62,8 @@ class Ld64 < Formula
|
||||||
end
|
end
|
||||||
|
|
||||||
def install
|
def install
|
||||||
File.open('Makefile', 'w') {|f| f.write DATA.read}
|
buildpath.install resource("makefile")
|
||||||
|
mv "Makefile-97", "Makefile"
|
||||||
inreplace 'src/ld/Options.cpp', '@@VERSION@@', version
|
inreplace 'src/ld/Options.cpp', '@@VERSION@@', version
|
||||||
|
|
||||||
if MacOS.version < :leopard
|
if MacOS.version < :leopard
|
||||||
|
@ -90,80 +96,3 @@ class Ld64 < Formula
|
||||||
system "make", "install", "PREFIX=#{prefix}"
|
system "make", "install", "PREFIX=#{prefix}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# makefile courtesy Macports:
|
|
||||||
# https://trac.macports.org/browser/trunk/dports/devel/ld64/files/Makefile-97
|
|
||||||
__END__
|
|
||||||
ifdef LLVM_CONFIG
|
|
||||||
LLVM_CPPFLAGS := -I$(shell $(LLVM_CONFIG) --includedir) -DLTO_SUPPORT
|
|
||||||
LLVM_LDFLAGS := -L$(shell $(LLVM_CONFIG) --libdir) -lLTO
|
|
||||||
endif
|
|
||||||
|
|
||||||
CPPFLAGS = $(LLVM_CPPFLAGS) -Isrc/abstraction -Isrc/ld $(OTHER_CPPFLAGS)
|
|
||||||
CFLAGS = -Os $(OTHER_CFLAGS)
|
|
||||||
CXXFLAGS = -Os $(OTHER_CXXFLAGS)
|
|
||||||
LDFLAGS = $(OTHER_LDFLAGS)
|
|
||||||
|
|
||||||
ifndef RANLIB
|
|
||||||
RANLIB = ranlib
|
|
||||||
endif
|
|
||||||
ifndef AR
|
|
||||||
AR = ar
|
|
||||||
endif
|
|
||||||
ifndef PREFIX
|
|
||||||
PREFIX = /usr
|
|
||||||
endif
|
|
||||||
|
|
||||||
all : src/ld/configure.h ObjectDump dyldinfo ld machocheck rebase unwinddump libprunetrie.a
|
|
||||||
|
|
||||||
src/ld/configure.h :
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
ObjectDump : src/ld/debugline.o
|
|
||||||
ObjectDump : src/other/ObjectDump.o
|
|
||||||
$(CXX) $(LLVM_LDFLAGS) $(LDFLAGS) $^ -o $@
|
|
||||||
|
|
||||||
dyldinfo : src/other/dyldinfo.o
|
|
||||||
$(CXX) $(LDFLAGS) -Wl,-exported_symbol,__mh_execute_header $^ -o $@
|
|
||||||
|
|
||||||
ld : src/ld/debugline.o
|
|
||||||
ld : src/ld/ld.o
|
|
||||||
ld : src/ld/Options.o
|
|
||||||
$(CXX) $(LLVM_LDFLAGS) $(LDFLAGS) $(OTHER_LDFLAGS_LD64) -Wl,-exported_symbol,__mh_execute_header $^ -o $@
|
|
||||||
|
|
||||||
machocheck : src/other/machochecker.o
|
|
||||||
$(CXX) $(LDFLAGS) $^ -o $@
|
|
||||||
|
|
||||||
rebase : src/other/rebase.o
|
|
||||||
$(CXX) $(LDFLAGS) -Wl,-exported_symbol,__mh_execute_header $^ -o $@
|
|
||||||
|
|
||||||
unwinddump : src/other/unwinddump.o
|
|
||||||
$(CXX) $(LDFLAGS) -Wl,-exported_symbol,__mh_execute_header $^ -o $@
|
|
||||||
|
|
||||||
libprunetrie.a : src/other/PruneTrie.o
|
|
||||||
$(AR) cru $@ $^
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
install : all
|
|
||||||
install -d -m 755 $(DESTDIR)$(PREFIX)/bin
|
|
||||||
install -d -m 755 $(DESTDIR)$(PREFIX)/lib
|
|
||||||
install -d -m 755 $(DESTDIR)$(PREFIX)/include/mach-o
|
|
||||||
install -d -m 755 $(DESTDIR)$(PREFIX)/share/man/man1
|
|
||||||
|
|
||||||
install -m 755 ObjectDump $(DESTDIR)$(PREFIX)/bin
|
|
||||||
install -m 755 dyldinfo $(DESTDIR)$(PREFIX)/bin
|
|
||||||
install -m 755 ld $(DESTDIR)$(PREFIX)/bin
|
|
||||||
install -m 755 machocheck $(DESTDIR)$(PREFIX)/bin
|
|
||||||
install -m 755 rebase $(DESTDIR)$(PREFIX)/bin
|
|
||||||
install -m 755 unwinddump $(DESTDIR)$(PREFIX)/bin
|
|
||||||
|
|
||||||
install -m 644 src/other/prune_trie.h $(DESTDIR)$(PREFIX)/include/mach-o
|
|
||||||
install -m 644 libprunetrie.a $(DESTDIR)$(PREFIX)/lib
|
|
||||||
|
|
||||||
install -m 644 doc/man/man1/dyldinfo.1 $(DESTDIR)$(PREFIX)/share/man/man1
|
|
||||||
install -m 644 doc/man/man1/ld.1 $(DESTDIR)$(PREFIX)/share/man/man1
|
|
||||||
install -m 644 doc/man/man1/ld64.1 $(DESTDIR)$(PREFIX)/share/man/man1
|
|
||||||
install -m 644 doc/man/man1/rebase.1 $(DESTDIR)$(PREFIX)/share/man/man1
|
|
||||||
install -m 644 doc/man/man1/unwinddump.1 $(DESTDIR)$(PREFIX)/share/man/man1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue