llvm-vl.spec 15 KB

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