llvm-vl.spec 15 KB

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