llvm-vl.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. # Build options:
  2. #
  3. # --with doxygen
  4. # The doxygen docs are HUGE, so they are not built by default.
  5. %define build_apidoc %{?_with_doxygen:1}%{!?_with_doxygen:0}
  6. Name: llvm
  7. Version: 3.0
  8. Release: 1%{?_dist_release}
  9. Summary: The Low Level Virtual Machine
  10. Summary(ja): LLVM - 低レベルバーチャルマシン
  11. Group: Development/Languages
  12. License: NCSA
  13. URL: http://llvm.org/
  14. Source0: http://llvm.org/releases/%{version}/llvm-%{version}.tar.gz
  15. Source1: http://llvm.org/releases/%{version}/clang-%{version}.tar.gz
  16. # multilib fixes
  17. Source2: llvm-Config-config.h
  18. Source3: llvm-Config-llvm-config.h
  19. # Data files should be installed with timestamps preserved
  20. Patch0: llvm-2.6-timestamp.patch
  21. # workaround for http://llvm.org/bugs/show_bug.cgi?id=11177
  22. Patch1: llvm-3.0-fix11177.patch
  23. # fix bug 9798 - Linker flags fail / can't find crtbegin.o
  24. # http://llvm.org/bugs/show_bug.cgi?id=9798
  25. Patch2: clang-3.0-fix9798.patch
  26. # Vine Patch
  27. Patch3: llvm-3.0-fixLLVMgold.patch
  28. Patch4: clang-3.0-driver-ld.gold.patch
  29. Patch5: clang-3.0-driver-lib64.patch
  30. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  31. BuildRequires: binutils-devel
  32. BuildRequires: bison
  33. BuildRequires: chrpath
  34. BuildRequires: flex
  35. BuildRequires: gcc-c++ >= 3.4
  36. BuildRequires: groff
  37. BuildRequires: libffi-devel
  38. BuildRequires: libtool-ltdl-devel
  39. BuildRequires: ocaml
  40. # for DejaGNU test suite
  41. BuildRequires: dejagnu tcl python
  42. %if %{build_apidoc}
  43. BuildRequires: doxygen graphviz
  44. %endif
  45. Requires: llvm-libs = %{version}-%{release}
  46. # LLVM is not supported on PPC64
  47. # http://llvm.org/bugs/show_bug.cgi?id=3729
  48. ExcludeArch: ppc64
  49. %description
  50. LLVM is a compiler infrastructure designed for compile-time,
  51. link-time, runtime, and idle-time optimization of programs from
  52. arbitrary programming languages. The compiler infrastructure includes
  53. mirror sets of programming tools as well as libraries with equivalent
  54. functionality.
  55. %package devel
  56. Summary: Libraries and header files for LLVM
  57. Summary(ja): LLVM のライブラリおよびヘッダファイル
  58. Group: Development/Languages
  59. Requires: %{name} = %{version}-%{release}
  60. Requires: libstdc++-devel
  61. Requires: libffi-devel
  62. Provides: llvm-static = %{version}-%{release}
  63. %description devel
  64. This package contains library and header files needed to develop new
  65. native programs that use the LLVM infrastructure.
  66. %package doc
  67. Summary: Documentation for LLVM
  68. Summary(ja): LLVM のドキュメント
  69. Group: Documentation
  70. Requires: %{name} = %{version}-%{release}
  71. %description doc
  72. Documentation for the LLVM compiler infrastructure.
  73. %package libs
  74. Summary: LLVM shared libraries
  75. Summary(ja): LLVM シェアードライブラリ
  76. Group: System Environment/Libraries
  77. %description libs
  78. Shared libraries for the LLVM compiler infrastructure.
  79. %package -n clang
  80. Summary: A C language family front-end for LLVM
  81. Summary(ja): LLVM の C 言語用フロントエンド
  82. License: NCSA
  83. Group: Development/Languages
  84. %description -n clang
  85. clang: noun
  86. 1. A loud, resonant, metallic sound.
  87. 2. The strident call of a crane or goose.
  88. 3. C-language family front-end toolkit.
  89. The goal of the Clang project is to create a new C, C++, Objective C
  90. and Objective C++ front-end for the LLVM compiler. Its tools are built
  91. as libraries and designed to be loosely-coupled and extensible.
  92. %package -n clang-devel
  93. Summary: Header files for clang
  94. Summary(ja): clang のヘッダファイル
  95. Group: Development/Languages
  96. Requires: clang = %{version}-%{release}
  97. %description -n clang-devel
  98. This package contains header files for the Clang compiler.
  99. %package -n clang-analyzer
  100. Summary: A source code analysis framework
  101. Summary(ja): ソースコー分析フレームワーク
  102. License: NCSA
  103. Group: Development/Languages
  104. Requires: clang = %{version}-%{release}
  105. # not picked up automatically since files are currently not instaled
  106. # in standard Python hierarchies yet
  107. Requires: python
  108. %description -n clang-analyzer
  109. The Clang Static Analyzer consists of both a source code analysis
  110. framework and a standalone tool that finds bugs in C and Objective-C
  111. programs. The standalone tool is invoked from the command-line, and is
  112. intended to run in tandem with a build of a project or code base.
  113. %package -n clang-doc
  114. Summary: Documentation for Clang
  115. Summary(ja): Clang のドキュメント
  116. Group: Documentation
  117. Requires: %{name} = %{version}-%{release}
  118. %description -n clang-doc
  119. Documentation for the Clang compiler front-end.
  120. %if %{build_apidoc}
  121. %package apidoc
  122. Summary: API documentation for LLVM
  123. Summary(ja): LLVM の API ドキュメント
  124. Group: Development/Languages
  125. Requires: %{name}-docs = %{version}-%{release}
  126. %description apidoc
  127. API documentation for the LLVM compiler infrastructure.
  128. %endif
  129. %package ocaml
  130. Summary: OCaml binding for LLVM
  131. Summary(ja): LLVM の OCaml バインディング
  132. Group: Development/Libraries
  133. Requires: %{name} = %{version}-%{release}
  134. Requires: ocaml
  135. %description ocaml
  136. OCaml binding for LLVM.
  137. %package ocaml-devel
  138. Summary: Development files for %{name}-ocaml
  139. Summary(ja): %{name}-ocaml の開発ファイル
  140. Group: Development/Libraries
  141. Requires: %{name}-devel = %{version}-%{release}
  142. Requires: %{name}-ocaml = %{version}-%{release}
  143. Requires: ocaml
  144. %description ocaml-devel
  145. The %{name}-ocaml-devel package contains libraries and signature files
  146. for developing applications that use %{name}-ocaml.
  147. %package ocaml-doc
  148. Summary: Documentation for %{name}-ocaml
  149. Summary(ja): %{name}-ocaml のドキュメント
  150. Group: Documentation
  151. Requires: %{name}-ocaml = %{version}-%{release}
  152. %description ocaml-doc
  153. HTML documentation for LLVM's OCaml binding.
  154. %prep
  155. %setup -q -n llvm-%{version}.src -a1 %{?_with_gcc:-a2}
  156. mv clang-%{version}.src tools/clang
  157. # llvm patches
  158. %patch0 -p1 -b .timestamp
  159. %patch1 -p1 -b .fix11177
  160. %patch3 -p1 -b .fixLLVMgold
  161. # clang patches
  162. pushd tools/clang
  163. %patch2 -p1 -b .fix9798
  164. %patch4 -p1 -b .ldgold
  165. %ifarch x86_64
  166. %patch5 -p1 -b .lib64
  167. %endif
  168. popd
  169. # Encoding fix
  170. #(cd tools/clang/docs && \
  171. # iconv -f ISO88591 -t UTF8 BlockImplementation.txt \
  172. # -o BlockImplementation.txt)
  173. %build
  174. # explicitly supply CC and CXX when running 'configure'
  175. # http://llvm.org/bugs/show_bug.cgi?id=9472
  176. export CC=/usr/bin/gcc; export CXX=/usr/bin/g++
  177. # Disabling assertions now, rec. by pure and needed for OpenGTL
  178. # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
  179. %configure \
  180. --prefix=%{_prefix} \
  181. --libdir=%{_libdir}/%{name} \
  182. --datadir=%{_libdir}/%{name} \
  183. %if %{?_with_doxygen:1}%{!?_with_doxygen:0}
  184. --enable-doxygen \
  185. %endif
  186. --enable-targets=host \
  187. --disable-assertions \
  188. --enable-jit \
  189. --enable-libffi \
  190. --enable-shared \
  191. --with-binutils-include=%{_includedir} --enable-pic \
  192. # --with-c-include-dirs=%{_includedir}:$(find %{_prefix}/lib/gcc/*/* \
  193. # -maxdepth 0 -type d)/include \
  194. #%if %{__isa_bits} == 64
  195. # --with-cxx-include-32bit-dir=32 \
  196. #%endif
  197. # --with-cxx-include-root=$(find %{_includedir}/c++/* -maxdepth 0 -type d) \
  198. # --with-cxx-include-arch=%{_target_cpu}-%{_vendor}-%{_os}
  199. # FIXME file this
  200. # configure does not properly specify libdir
  201. sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
  202. make %{_smp_mflags} REQUIRES_RTTI=1 \
  203. OPTIMIZE_OPTION="%{optflags}"
  204. %install
  205. rm -rf %{buildroot}
  206. make install DESTDIR=%{buildroot} \
  207. PROJ_docsdir=/moredocs
  208. # multilib fixes
  209. mv %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
  210. pushd %{buildroot}%{_includedir}/llvm/Config
  211. mv config.h config-%{__isa_bits}.h
  212. cp -p %{SOURCE2} config.h
  213. mv llvm-config.h llvm-config-%{__isa_bits}.h
  214. cp -p %{SOURCE3} llvm-config.h
  215. popd
  216. # Create ld.so.conf.d entry
  217. mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
  218. cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF
  219. %{_libdir}/llvm
  220. EOF
  221. # Static analyzer not installed by default:
  222. # http://clang-analyzer.llvm.org/installation#OtherPlatforms
  223. mkdir -p %{buildroot}%{_libdir}/clang-analyzer
  224. # create launchers
  225. for f in scan-{build,view}; do
  226. ln -s %{_libdir}/clang-analyzer/$f/$f %{buildroot}%{_bindir}/$f
  227. done
  228. (cd tools/clang/tools && cp -pr scan-{build,view} \
  229. %{buildroot}%{_libdir}/clang-analyzer/)
  230. # Move documentation back to build directory
  231. #
  232. pwd
  233. mv %{buildroot}/moredocs .
  234. rm -f moredocs/*.tar.gz
  235. rm -f moredocs/ocamldoc/html/*.tar.gz
  236. # and separate the apidoc
  237. %if %{build_apidoc}
  238. mv moredocs/html/doxygen apidoc
  239. mv tools/clang/docs/doxygen/html clang-apidoc
  240. %endif
  241. # And prepare Clang documentation
  242. #
  243. mkdir clang-docs
  244. for f in LICENSE.TXT NOTES.txt README.txt; do
  245. ln tools/clang/$f clang-docs/
  246. done
  247. rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
  248. #find %%{buildroot} -name .dir -print0 | xargs -0r rm -f
  249. file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
  250. file %{buildroot}/%{_libdir}/llvm/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
  251. #chrpath -d %%{buildroot}/%%{_libexecdir}/clang-cc
  252. # Get rid of erroneously installed example files.
  253. rm %{buildroot}%{_libdir}/%{name}/*LLVMHello.*
  254. # FIXME file this bug
  255. sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \
  256. %{buildroot}%{_bindir}/llvm-config-%{__isa_bits}
  257. chmod -x %{buildroot}%{_libdir}/%{name}/*.a
  258. # remove documentation makefiles:
  259. # they require the build directory to work
  260. find examples -name 'Makefile' | xargs -0r rm -f
  261. %check
  262. make check 2>&1 | tee ../llvm-testlog.txt
  263. make -C tools/clang/test 2>&1 | tee ../llvm-testlog.txt
  264. %clean
  265. rm -rf %{buildroot}
  266. %post libs -p /sbin/ldconfig
  267. %post -n clang -p /sbin/ldconfig
  268. %postun libs -p /sbin/ldconfig
  269. %postun -n clang -p /sbin/ldconfig
  270. %posttrans devel
  271. # link llvm-config to the platform-specific file;
  272. # use ISA bits as priority so that 64-bit is preferred
  273. # over 32-bit if both are installed
  274. alternatives \
  275. --install \
  276. %{_bindir}/llvm-config \
  277. llvm-config \
  278. %{_bindir}/llvm-config-%{__isa_bits} \
  279. %{__isa_bits}
  280. %postun devel
  281. if [ $1 -eq 0 ]; then
  282. alternatives --remove llvm-config \
  283. %{_bindir}/llvm-config-%{__isa_bits}
  284. fi
  285. exit 0
  286. %files
  287. %defattr(-,root,root,-)
  288. %doc CREDITS.TXT LICENSE.TXT README.txt
  289. %{_bindir}/bugpoint
  290. %{_bindir}/llc
  291. %{_bindir}/lli
  292. %exclude %{_bindir}/llvm-config-%{__isa_bits}
  293. %{_bindir}/llvm*
  294. %{_bindir}/macho-dump
  295. %{_bindir}/opt
  296. %exclude %{_mandir}/man1/clang.1.*
  297. %doc %{_mandir}/man1/*.1.*
  298. %files devel
  299. %defattr(-,root,root,-)
  300. %{_bindir}/llvm-config-%{__isa_bits}
  301. %{_includedir}/%{name}
  302. %{_includedir}/%{name}-c
  303. %{_libdir}/%{name}/*.a
  304. %files libs
  305. %defattr(-,root,root,-)
  306. %config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
  307. %dir %{_libdir}/%{name}
  308. %exclude %{_libdir}/%{name}/libclang.so
  309. %{_libdir}/%{name}/*.so
  310. %files -n clang
  311. %defattr(-,root,root,-)
  312. %doc clang-docs/*
  313. %{_bindir}/clang*
  314. %{_libdir}/%{name}/libclang.so
  315. %{_prefix}/lib/clang
  316. %doc %{_mandir}/man1/clang.1.*
  317. %files -n clang-devel
  318. %defattr(-,root,root,-)
  319. %{_includedir}/clang
  320. %{_includedir}/clang-c
  321. %files -n clang-analyzer
  322. %defattr(-,root,root,-)
  323. %{_bindir}/scan-build
  324. %{_bindir}/scan-view
  325. %{_libdir}/clang-analyzer
  326. %files -n clang-doc
  327. %defattr(-,root,root,-)
  328. %doc tools/clang/docs/*
  329. %files doc
  330. %defattr(-,root,root,-)
  331. %doc examples moredocs/html
  332. %files ocaml
  333. %defattr(-,root,root,-)
  334. %{_libdir}/ocaml/*.cma
  335. %{_libdir}/ocaml/*.cmi
  336. %files ocaml-devel
  337. %defattr(-,root,root,-)
  338. %{_libdir}/ocaml/*.a
  339. %{_libdir}/ocaml/*.cmx*
  340. %{_libdir}/ocaml/*.mli
  341. %files ocaml-doc
  342. %defattr(-,root,root,-)
  343. %doc moredocs/ocamldoc/html/*
  344. %if 0%{?_with_doxygen}
  345. %files apidoc
  346. %defattr(-,root,root,-)
  347. %doc apidoc/*
  348. %files -n clang-apidoc
  349. %defattr(-,root,root,-)
  350. %doc clang-apidoc/*
  351. %endif
  352. %changelog
  353. * Tue Jan 24 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 3.0-1
  354. - updated to 3.0 release
  355. * Sun Jan 15 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 2.9-3
  356. - added patch 2-4 to support -O4 link-time optimization
  357. * Fri Sep 9 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.9-2
  358. - disable -fno-var-tracking-assignments on ppc
  359. (seems like gcc-4.4.5 still doesn't support this)
  360. * Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
  361. - new upstream release
  362. - add BR: libffi-devel
  363. - add R: libffi-devel to -devel
  364. * Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
  365. - initial build for Vine Linux
  366. * Sun May 2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
  367. - Update to final 2.7 release
  368. * Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
  369. - Update to first 2.7 pre-release
  370. * Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
  371. - Update to 2.6 pre-release2
  372. - -devel subpackage now virtually provides -static
  373. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
  374. - Disable var tracking assignments on PPC
  375. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
  376. - Don't adjust clang include dir; files there are noarch (bz#521893)
  377. - Enable clang unit tests
  378. - clang and clang-analyzer renamed; no longer depend on llvm at runtime
  379. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
  380. - Package Clang's static analyzer tools
  381. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
  382. - PIC is now enabled by default; explicitly disable on %%{ix86}
  383. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
  384. - First 2.6 prerelease
  385. - Enable Clang front-end
  386. - Enable debuginfo generation
  387. * Sat Sep 5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
  388. - Disable assertions (needed by OpenGTL, bz#521261)
  389. - Align spec file with upstream build instructions
  390. - Enable unit tests
  391. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
  392. - Only disable PIC on %%ix86; ppc actually needs it
  393. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
  394. - Disable use of position-independent code on 32-bit platforms
  395. (buggy in LLVM <= 2.5)
  396. * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
  397. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  398. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
  399. - Remove build scripts; they require the build directory to work
  400. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
  401. - Update to 2.5
  402. - Package build scripts (bug #457881)
  403. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
  404. - Patched build process for the OCaml binding
  405. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
  406. - Update to 2.4
  407. - Package Ocaml binding
  408. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
  409. - Add dependency on groff
  410. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
  411. - LLVM 2.3
  412. * Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
  413. - fix license tags
  414. * Wed Mar 5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
  415. - Fix compilation problems with gcc 4.3
  416. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
  417. - Autorebuild for GCC 4.3
  418. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
  419. - Fix review comments
  420. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
  421. - Initial version