-
Notifications
You must be signed in to change notification settings - Fork 0
/
llvm.cygport
124 lines (111 loc) · 4.97 KB
/
llvm.cygport
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
inherit ocaml python python3
NAME="llvm"
VERSION=3.1
RELEASE=4
CATEGORY="Interpreters Devel"
SUMMARY="LLVM bytecode interpreter and toolchain"
DESCRIPTION="The LLVM Core libraries provide a modern source- and target-
independent optimizer, along with code generation support for many popular CPUs
(as well as some less common ones!) These libraries are built around a well
specified code representation known as the LLVM intermediate representation."
HOMEPAGE="http://www.llvm.org/"
SRC_URI="http://www.llvm.org/releases/${PV}/${P}.src.tar.gz
http://www.llvm.org/releases/${PV}/clang-${PV}.src.tar.gz"
SRC_DIR="${P}.src"
PATCH_URI="
mirror://portage/sys-devel/${PN}/files/${P}-fix_debug_line_info.patch
mirror://portage/sys-devel/${PN}/files/${P}-ivybridge_support.patch
2.9-implib.patch
2.9-python-ctypes.patch
3.1-llvm-config.patch
3.0-analyzer-realpath.patch
3.0-cygwin-dllexport.patch
3.1-cygwin-includes.patch
3.1-cross-sysroot.patch
3.1-cygwin-w32api.patch
3.1-cygwin-libdirs.patch
"
PKG_NAMES="llvm llvm-doc libllvm3.1 libllvm-devel ocaml-llvm
clang clang-analyzer libclang libclang-devel python-clang python3-clang"
llvm_CONTENTS="--exclude=cygclang.dll --exclude=clang* --exclude=cygLLVM-*.dll
--exclude=llvm-config* --exclude=c-*.exe --exclude=scan-*
--exclude=html* --exclude=ps --exclude=ocamldoc*
usr/bin/ usr/share/doc/ usr/share/man/man1/"
llvm_doc_SUMMARY="LLVM documentation"
llvm_doc_CONTENTS="usr/share/doc/${PN}/html* usr/share/doc/${PN}/ps/"
libllvm3_1_SUMMARY="LLVM library (runtime)"
libllvm3_1_CONTENTS="usr/bin/cygLLVM-3.1.dll"
libllvm_devel_SUMMARY="LLVM library (development)"
libllvm_devel_CONTENTS="usr/bin/llvm-config* usr/include/llvm*
usr/lib/libLLVM-*.dll.a usr/share/man/man1/llvm-config*"
libllvm_devel_static_CONTENTS="--exclude=*.dll.a usr/lib/libllvm* usr/lib/libLLVM*"
ocaml_llvm_SUMMARY="LLVM library (OCaml bindings)"
ocaml_llvm_CONTENTS="${OCAML_LIBDIR#/} usr/share/doc/${PN}/ocamldoc*"
clang_SUMMARY="C/C++/ObjC compiler frontend based on LLVM"
clang_DESCRIPTION="Clang is an LLVM native C/C++/ObjC compiler, which aims to
deliver amazingly fast compiles, extremely useful error and warning messages
and to provide a platform for building great source level tools. The Clang
Static Analyzer is a tool that automatically finds bugs in your code, and is a
great example of the sort of tool that can be built using the Clang frontend
as a library to parse C/C++ code."
clang_REQUIRES="gcc4-core gcc4-g++"
clang_CONTENTS="usr/bin/c-* usr/bin/clang* usr/lib/clang/ usr/share/man/man1/clang*"
clang_analyzer_SUMMARY="C/C++/ObjC code analyzer"
clang_analyzer_DESCRIPTION=${clang_DESCRIPTION}
clang_analyzer_REQUIRES="clang"
clang_analyzer_CONTENTS="usr/bin/scan-* usr/share/clang-analyzer/"
libclang_SUMMARY="C/C++/ObjC compiler library (runtime)"
libclang_DESCRIPTION=${clang_DESCRIPTION}
libclang_CONTENTS="usr/bin/cygclang.dll"
libclang_devel_SUMMARY="C/C++/ObjC compiler library (development)"
libclang_devel_DESCRIPTION=${clang_DESCRIPTION}
libclang_devel_REQUIRES="libllvm-devel"
libclang_devel_CONTENTS="usr/include/clang-c/ usr/lib/libclang.dll.a"
libclang_devel_static_CONTENTS="--exclude=*.dll.a usr/include/clang/ usr/lib/libclang*"
python_clang_SUMMARY="C/C++/ObjC compiler library (Python bindings)"
python_clang_DESCRIPTION=${clang_DESCRIPTION}
python_clang_REQUIRES="libclang" # loaded via ctypes
python_clang_CONTENTS="${PYTHON_SITELIB#/}/clang/"
python3_clang_SUMMARY="C/C++/ObjC compiler library (Py3K bindings)"
python3_clang_DESCRIPTION=${clang_DESCRIPTION}
python3_clang_REQUIRES="libclang" # loaded via ctypes
python3_clang_CONTENTS="${PYTHON3_SITELIB#/}/clang/"
CYGPORT_USE_UNSTABLE_API=1
src_unpack_hook() {
rm -fr tools/clang
mv ../clang-${PV}.src tools/clang
}
src_compile() {
# leave optimization to build system, fails to dlopen with -O2
CFLAGS=${CFLAGS/-O[0-9]/}
CXXFLAGS=${CXXFLAGS/-O[0-9]/}
# local gccdir=/usr/lib/gcc/i686-pc-cygwin/$(${CC} -dumpversion)
cd ${B}
cygconf --disable-assertions --enable-optimized --enable-debug-runtime \
--enable-debug-symbols --enable-targets=all \
--enable-libffi --enable-shared --disable-embed-stdcxx \
--with-gcc-toolchain=/usr
# --with-clang-resource-dir=../lib/clang/i686-pc-cygwin/${PV} \
# --with-c-include-dirs=${gccdir}/include:/usr/include:/usr/include/w32api
cygmake REQUIRES_RTTI=1
}
src_install() {
cd ${B}
cyginstall PROJ_docsdir=/usr/share/doc/llvm
# PROJ_headers=${D}/usr/lib/clang/i686-pc-cygwin/${PV}/include
dodir /usr/share/clang-analyzer
for a in scan-build scan-view
do
cp -r ${S}/tools/clang/tools/$a ${D}/usr/share/clang-analyzer/
dosym ../share/clang-analyzer/$a/$a /usr/bin/$a
done
python_optimize /usr/share/clang-analyzer
pythoninto clang
dopython ${S}/tools/clang/bindings/python/clang/*.py
python_optimize
python3into clang
dopython3 ${S}/tools/clang/bindings/python/clang/*.py
2to3-${PYTHON3_VERSION} -n -w ${D}${PYTHON3_SITELIB}/clang/*.py
python3_optimize
find ${D}${OCAML_LIBDIR} -type l -delete
}