llvm-vl.spec 14 KB

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