]>
Commit | Line | Data |
---|---|---|
28441938 | 1 | %define realname boost |
2 | Summary: The Boost C++ Libraries - Mingw32 cross version | |
f825d7b1 | 3 | Summary(pl.UTF-8): Biblioteki C++ "Boost" - wersja skrośna dla Mingw32 |
28441938 | 4 | Name: crossmingw32-%{realname} |
8d134d9a | 5 | Version: 1.36.0 |
670a15d7 | 6 | %define fver %(echo %{version} | tr . _) |
c66a9041 | 7 | Release: 0.1 |
28441938 | 8 | License: Boost Software License and others |
33145f37 | 9 | Group: Development/Libraries |
670a15d7 | 10 | Source0: http://dl.sourceforge.net/boost/%{realname}_%{fver}.tar.bz2 |
8d134d9a | 11 | # Source0-md5: 328bfec66c312150e4c2a78dcecb504b |
28441938 | 12 | Patch0: %{name}-win.patch |
13 | URL: http://www.boost.org/ | |
8d134d9a | 14 | BuildRequires: boost-jam >= 3.1.12 |
a72e6f01 | 15 | BuildRequires: crossmingw32-bzip2 |
28441938 | 16 | BuildRequires: crossmingw32-gcc-c++ |
17 | BuildRequires: crossmingw32-runtime | |
18 | BuildRequires: crossmingw32-w32api | |
a72e6f01 | 19 | BuildRequires: crossmingw32-zlib |
28441938 | 20 | BuildRequires: libtool >= 2:1.4d |
21 | BuildRequires: perl-base | |
a72e6f01 ŁK |
22 | Requires: crossmingw32-bzip2 |
23 | Requires: crossmingw32-runtime | |
24 | Requires: crossmingw32-zlib | |
28441938 | 25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
27 | %define no_install_post_strip 1 | |
28 | ||
29 | %define target i386-mingw32 | |
30 | %define target_platform i386-pc-mingw32 | |
c66a9041 JB |
31 | |
32 | %define _sysprefix /usr | |
33 | %define _prefix %{_sysprefix}/%{target} | |
34 | %define _libdir %{_prefix}/lib | |
35 | %define _dlldir /usr/share/wine/windows/system | |
28441938 | 36 | |
37 | %define __cc %{target}-gcc | |
38 | %define __cxx %{target}-g++ | |
39 | ||
c66a9041 JB |
40 | %ifnarch %{ix86} |
41 | # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc | |
28441938 | 42 | %define optflags -O2 |
43 | %endif | |
44 | ||
45 | %description | |
46 | The Boost web site provides free peer-reviewed portable C++ source | |
47 | libraries. The emphasis is on libraries which work well with the C++ | |
48 | Standard Library. One goal is to establish "existing practice" and | |
49 | provide reference implementations so that the Boost libraries are | |
50 | suitable for eventual standardization. Some of the libraries have | |
51 | already been proposed for inclusion in the C++ Standards Committee's | |
52 | upcoming C++ Standard Library Technical Report. | |
53 | ||
241a7e06 | 54 | %description -l pl.UTF-8 |
28441938 | 55 | Strona http://www.boost.org/ dostarcza darmowe biblioteki C++ wraz z |
241a7e06 JR |
56 | kodem źródłowym. Nacisk położono na biblioteki, które dobrze |
57 | współpracują ze standardową biblioteką C++. Celem jest ustanowienie | |
58 | "istniejącej praktyki" i dostarczenie implementacji, tak że biblioteki | |
59 | "Boost" nadają się do ewentualnej standaryzacji. Niektóre z bibliotek | |
60 | już zostały zgłoszone do komitetu standaryzacyjnego C++ w nadchodzącym | |
28441938 | 61 | Raporcie Technicznym Biblioteki Standardowej C++ |
62 | ||
63 | %package dll | |
c66a9041 JB |
64 | Summary: Boost - DLL libraries for Windows |
65 | Summary(pl.UTF-8): Boost - biblioteki DLL dla Windows | |
28441938 | 66 | Group: Applications/Emulators |
670a15d7 JB |
67 | Requires: crossmingw32-bzip2-dll |
68 | Requires: crossmingw32-zlib-dll | |
69 | Requires: wine | |
28441938 | 70 | |
71 | %description dll | |
c66a9041 | 72 | Boost - DLL libraries for Windows. |
28441938 | 73 | |
241a7e06 | 74 | %description dll -l pl.UTF-8 |
c66a9041 | 75 | Boost - biblioteki DLL dla Windows. |
28441938 | 76 | |
77 | %prep | |
670a15d7 | 78 | %setup -q -n %{realname}_%{fver} |
28441938 | 79 | %patch0 -p1 |
80 | ||
1a6d6278 ŁK |
81 | # - don't know how to pass it through (b)jam -s (no way?) |
82 | # due to oversophisticated build flags system. | |
83 | %{__perl} -pi -e 's/ -O3 / %{rpmcxxflags} /' tools/build/v2/tools/gcc.jam | |
28441938 | 84 | |
c66a9041 JB |
85 | sed -i -e 's/#error "wide char i\/o not supported on this platform"//' \ |
86 | boost/archive/*.hpp \ | |
87 | libs/serialization/src/*.cpp \ | |
88 | libs/serialization/test/*.hpp | |
28441938 | 89 | |
90 | %build | |
c66a9041 JB |
91 | CC=%{__cc} ; export CC |
92 | CXX=%{__cxx} ; export CXX | |
28441938 | 93 | LD=%{target}-ld ; export LD |
94 | AR=%{target}-ar ; export AR | |
95 | AS=%{target}-as ; export AS | |
96 | CROSS_COMPILE=1 ; export CROSS_COMPILE | |
28441938 | 97 | RANLIB=%{target}-ranlib ; export RANLIB |
c66a9041 | 98 | LDSHARED="%{__cc} -shared" ; export LDSHARED |
28441938 | 99 | TARGET="%{target}" ; export TARGET |
100 | ||
28441938 | 101 | bjam \ |
0826927f JB |
102 | -q -d2 \ |
103 | -sBZIP2_BINARY=bzip2 \ | |
104 | --toolset=gcc \ | |
105 | --without-python \ | |
106 | --without-serialization \ | |
107 | --without-test \ | |
108 | variant=release \ | |
109 | debug-symbols=on \ | |
110 | inlining=on \ | |
111 | link=static,shared \ | |
112 | threading=multi \ | |
113 | threadapi=win32 | |
28441938 | 114 | |
115 | mkdir wlib | |
0826927f | 116 | cd bin.v2/libs |
28441938 | 117 | for i in * |
118 | do | |
0826927f JB |
119 | cd $i/build/gcc-mingw-*/release/debug-symbols-on/inlining-on |
120 | cd link-static/threadapi-win32/threading-multi | |
121 | $AR cru ../../../../../../../../../../../wlib/libboost_$i.a *.o | |
122 | $RANLIB ../../../../../../../../../../../wlib/libboost_$i.a | |
1a6d6278 | 123 | |
0826927f | 124 | cd ../../.. |
1a6d6278 ŁK |
125 | |
126 | # if there is threading-multi dir | |
127 | # it's content is used for dll and implib | |
0826927f JB |
128 | dll_dir='link-static/threadapi-win32/threading-multi' |
129 | up_dir='../../..' | |
1a6d6278 | 130 | if [ -d threading-multi ]; then |
0826927f JB |
131 | dll_dir='threadapi-win32/threading-multi' |
132 | up_dir='../..' | |
1a6d6278 ŁK |
133 | fi |
134 | ||
135 | cd $dll_dir | |
136 | ||
137 | # libboost_iostreams requires additional | |
138 | # libraries | |
139 | additional_so_params= | |
140 | if [ $i = "iostreams" ]; then | |
141 | additional_so_params="-lz.dll -lbzip2.dll" | |
142 | fi | |
143 | ||
144 | # there are some issuses with dynamic libboost_wave | |
145 | if [ $i != "wave" ]; then | |
0826927f | 146 | $CXX --shared *.o $additional_so_params \ |
1a6d6278 ŁK |
147 | -Wl,--enable-auto-image-base \ |
148 | -o $up_dir/../../../../../../../../wlib/boost_$i.dll \ | |
149 | -Wl,--out-implib,libboost_$i.dll.a | |
150 | mv libboost_$i.dll.a $up_dir/../../../../../../../../wlib/ | |
151 | fi | |
152 | ||
153 | cd $up_dir/../../../../../.. | |
28441938 | 154 | done |
1a6d6278 | 155 | cd ../.. |
28441938 | 156 | |
157 | %if 0%{!?debug:1} | |
158 | %{target}-strip wlib/*.dll | |
159 | %{target}-strip -g -R.comment -R.note wlib/*.a | |
160 | %endif | |
161 | ||
162 | %install | |
163 | rm -rf $RPM_BUILD_ROOT | |
c66a9041 | 164 | install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_dlldir}} |
28441938 | 165 | |
c66a9041 JB |
166 | cp -r boost $RPM_BUILD_ROOT%{_includedir} |
167 | install wlib/*.a $RPM_BUILD_ROOT%{_libdir} | |
168 | install wlib/*.dll $RPM_BUILD_ROOT%{_dlldir} | |
28441938 | 169 | |
170 | %clean | |
171 | rm -rf $RPM_BUILD_ROOT | |
172 | ||
173 | %files | |
174 | %defattr(644,root,root,755) | |
c66a9041 JB |
175 | %{_includedir}/boost |
176 | %{_libdir}/*.a | |
28441938 | 177 | |
178 | %files dll | |
179 | %defattr(644,root,root,755) | |
c66a9041 | 180 | %{_dlldir}/*.dll |