| 1 | %global gcc_version 4.4.6
|
|---|
| 2 | %global gcc_target_platform %{_target_cpu}
|
|---|
| 3 |
|
|---|
| 4 | Summary: Various compilers (C, C++, Objective-C, Java, ...)
|
|---|
| 5 | Name: gcc
|
|---|
| 6 | Version: %{gcc_version}
|
|---|
| 7 | Release: 15%{?dist}
|
|---|
| 8 |
|
|---|
| 9 | # libgcc, libgfortran, libmudflap, libgomp, libstdc++ and crtstuff have
|
|---|
| 10 | # GCC Runtime Exception.
|
|---|
| 11 | License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
|
|---|
| 12 | Group: Development/Languages
|
|---|
| 13 | URL: http://gcc.gnu.org
|
|---|
| 14 |
|
|---|
| 15 | Source0: gcc-os2-20111223.tar.bz2
|
|---|
| 16 | Patch0: gcc-os2.diff
|
|---|
| 17 |
|
|---|
| 18 | BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
|
|---|
| 19 |
|
|---|
| 20 | Obsoletes: gcc < %{gcc_version}
|
|---|
| 21 |
|
|---|
| 22 | BuildRequires: binutils
|
|---|
| 23 | BuildRequires: gmp-devel >= 4.1.2-8, mpfr-devel >= 2.2.1
|
|---|
| 24 |
|
|---|
| 25 | Requires: libgcc446 = %{gcc_version}
|
|---|
| 26 | Requires: libc-devel >= 0.6.3
|
|---|
| 27 | Requires: binutils
|
|---|
| 28 | Requires: libssp, libstdc++, libsupc++
|
|---|
| 29 |
|
|---|
| 30 | %description
|
|---|
| 31 | The gcc package contains the GNU Compiler Collection version 4.4.
|
|---|
| 32 | You'll need this package in order to compile C code.
|
|---|
| 33 |
|
|---|
| 34 | %package -n libgcc446
|
|---|
| 35 | Summary: GCC version 4.4 shared support library
|
|---|
| 36 | Group: System Environment/Libraries
|
|---|
| 37 | Autoreq: false
|
|---|
| 38 |
|
|---|
| 39 | %description -n libgcc446
|
|---|
| 40 | This package contains GCC shared support library which is needed
|
|---|
| 41 | e.g. for exception handling support.
|
|---|
| 42 |
|
|---|
| 43 | %package -n libssp
|
|---|
| 44 | Summary: GCC stack protector shared library
|
|---|
| 45 | Group: System Environment/Libraries
|
|---|
| 46 |
|
|---|
| 47 | %description -n libssp
|
|---|
| 48 | This package contains GCC shared library which is needed
|
|---|
| 49 | for stack protector.
|
|---|
| 50 |
|
|---|
| 51 | %package -n libstdc++
|
|---|
| 52 | Summary: GNU Standard C++ Library v3
|
|---|
| 53 | Group: System Environment/Libraries
|
|---|
| 54 |
|
|---|
| 55 | %description -n libstdc++
|
|---|
| 56 | This package contains GNU Standard C++ Library v3 shared library.
|
|---|
| 57 |
|
|---|
| 58 | %package -n libsupc++
|
|---|
| 59 | Summary: GNU Standard C++ Library v3 subset
|
|---|
| 60 | Group: System Environment/Libraries
|
|---|
| 61 |
|
|---|
| 62 | %description -n libsupc++
|
|---|
| 63 | This package contains GNU Standard C++ Library v3 subset shared library.
|
|---|
| 64 |
|
|---|
| 65 | %package wlink
|
|---|
| 66 | Summary: GCC configuration changes for Watcom linker support.
|
|---|
| 67 | Group: Development/Languages
|
|---|
| 68 | Requires: watcom-wlink-hll
|
|---|
| 69 |
|
|---|
| 70 | %description wlink
|
|---|
| 71 | This package triggers the required config.sys settings to allow use of Watcom
|
|---|
| 72 | Linker instead of ld.
|
|---|
| 73 |
|
|---|
| 74 | %package wrc
|
|---|
| 75 | Summary: GCC configuration changes for Watcom resource compiler support.
|
|---|
| 76 | Group: Development/Languages
|
|---|
| 77 | Requires: watcom-wrc
|
|---|
| 78 |
|
|---|
| 79 | %description wrc
|
|---|
| 80 | This package triggers the required config.sys settings to allow use of Watcom
|
|---|
| 81 | resource compiler instead of IBM one.
|
|---|
| 82 |
|
|---|
| 83 | %prep
|
|---|
| 84 | %setup -q -c
|
|---|
| 85 | %patch0 -p1 -b .os2~
|
|---|
| 86 |
|
|---|
| 87 | %build
|
|---|
| 88 | rm -fr obj-%{gcc_target_platform}
|
|---|
| 89 | mkdir obj-%{gcc_target_platform}
|
|---|
| 90 | cd obj-%{gcc_target_platform}
|
|---|
| 91 |
|
|---|
| 92 | script_dir=%{_topdir}/BUILD/%{name}-%{version}/obj-%{gcc_target_platform}
|
|---|
| 93 | export PATH="$script_dir/gcc${PATH:+;$PATH}"
|
|---|
| 94 | export BEGINLIBPATH="$script_dir/gcc${BEGINLIBPATH:+;$BEGINLIBPATH}"
|
|---|
| 95 |
|
|---|
| 96 | export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe;
|
|---|
| 97 | export AWK=awk;
|
|---|
| 98 | export CFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
|
|---|
| 99 | export CXXFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
|
|---|
| 100 | export LDFLAGS="-g -Zexe -Zomf -Zmap -Zargs-wild -Zhigh-mem"
|
|---|
| 101 | export LANG="";
|
|---|
| 102 | ../configure --prefix=%{_prefix} \
|
|---|
| 103 | --with-sysroot=/@unixroot \
|
|---|
| 104 | --enable-shared \
|
|---|
| 105 | --enable-languages=c,c++ \
|
|---|
| 106 | --with-gnu-as \
|
|---|
| 107 | --disable-bootstrap \
|
|---|
| 108 | --disable-multilib \
|
|---|
| 109 | --disable-libstdcxx-pch \
|
|---|
| 110 | --enable-threads \
|
|---|
| 111 | "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
|
|---|
| 112 |
|
|---|
| 113 | make %{?_smp_mflags}
|
|---|
| 114 |
|
|---|
| 115 | %install
|
|---|
| 116 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 117 |
|
|---|
| 118 | cd obj-%{gcc_target_platform}
|
|---|
| 119 |
|
|---|
| 120 | # There are some MP bugs in libstdc++ Makefiles
|
|---|
| 121 | #make -C %{gcc_target_platform}/libstdc++-v3
|
|---|
| 122 |
|
|---|
| 123 | #make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \
|
|---|
| 124 | # infodir=%{buildroot}%{_infodir} install
|
|---|
| 125 |
|
|---|
| 126 | make DESTDIR=${RPM_BUILD_ROOT} install
|
|---|
| 127 |
|
|---|
| 128 | #build dll
|
|---|
| 129 | dllar -o stdcpp.dll i386-pc-os2-emx/libstdc++-v3/src/.libs/stdc++.a \
|
|---|
| 130 | -d "GNU stdc++ %{gcc_version}" \
|
|---|
| 131 | -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
|
|---|
| 132 | -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
|
|---|
| 133 | -libf "INITINSTANCE TERMINSTANCE" \
|
|---|
| 134 | -libd "DATA MULTIPLE"
|
|---|
| 135 | cp -p stdcpp.dll %{buildroot}%{_libdir}
|
|---|
| 136 | cp -p stdcpp.a %{buildroot}%{_libdir}/stdc++.a
|
|---|
| 137 | cp -p stdcpp.lib %{buildroot}%{_libdir}/stdc++.lib
|
|---|
| 138 | mv %{buildroot}%{_libdir}/stdc++.a %{buildroot}%{_libdir}/stdc++_s.a
|
|---|
| 139 |
|
|---|
| 140 | #build dll
|
|---|
| 141 | dllar -o supcpp.dll i386-pc-os2-emx/libstdc++-v3/libsupc++/.libs/supc++.a \
|
|---|
| 142 | -d "GNU supc++ %{gcc_version}" \
|
|---|
| 143 | -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
|
|---|
| 144 | -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
|
|---|
| 145 | -libf "INITINSTANCE TERMINSTANCE" \
|
|---|
| 146 | -libd "DATA MULTIPLE"
|
|---|
| 147 | cp -p supcpp.dll %{buildroot}%{_libdir}
|
|---|
| 148 | cp -p supcpp.a %{buildroot}%{_libdir}/supc++.a
|
|---|
| 149 | cp -p supcpp.lib %{buildroot}%{_libdir}/supc++.lib
|
|---|
| 150 | mv %{buildroot}%{_libdir}/supc++.a %{buildroot}%{_libdir}/supc++_s.a
|
|---|
| 151 |
|
|---|
| 152 | #build dll
|
|---|
| 153 | dllar -o ssp.dll i386-pc-os2-emx/libssp/.libs/ssp.a \
|
|---|
| 154 | -d "GNU Stack Protector %{gcc_version}" \
|
|---|
| 155 | -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
|
|---|
| 156 | -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
|
|---|
| 157 | -libf "INITINSTANCE TERMINSTANCE" \
|
|---|
| 158 | -libd "DATA MULTIPLE"
|
|---|
| 159 | cp -p ssp.dll %{buildroot}%{_libdir}
|
|---|
| 160 | cp -p ssp.a %{buildroot}%{_libdir}
|
|---|
| 161 | cp -p ssp.lib %{buildroot}%{_libdir}
|
|---|
| 162 | mv %{buildroot}%{_libdir}/ssp.a %{buildroot}%{_libdir}/ssp_s.a
|
|---|
| 163 |
|
|---|
| 164 | cd ..
|
|---|
| 165 |
|
|---|
| 166 | echo dummy for virtual package > gcc-wrc.txt
|
|---|
| 167 | echo dummy for virtual package > gcc-wlink.txt
|
|---|
| 168 |
|
|---|
| 169 | #mkdir -p %{buildroot}%{_usr}
|
|---|
| 170 |
|
|---|
| 171 | rm %{buildroot}%{_libdir}/*.la
|
|---|
| 172 |
|
|---|
| 173 | #mv %{buildroot}%{_usr}/readme.os2 $RPM_BUILD_ROOT%_docdir/%{name}-%{version}/
|
|---|
| 174 |
|
|---|
| 175 | ln -s ./cc1.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{version}/cc1
|
|---|
| 176 | ln -s ./cc1plus.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{version}/cc1plus
|
|---|
| 177 |
|
|---|
| 178 | #yd fix attributes for executables
|
|---|
| 179 | chmod 0755 %{buildroot}%{_bindir}/*.exe
|
|---|
| 180 |
|
|---|
| 181 | %clean
|
|---|
| 182 | rm -rf %{buildroot}
|
|---|
| 183 |
|
|---|
| 184 | %post wrc
|
|---|
| 185 | if [ "$1" = 1 ] ; then
|
|---|
| 186 | #execute only on first install
|
|---|
| 187 | %cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
|
|---|
| 188 | %cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
|
|---|
| 189 | %cube {ADDLINE "SET EMXOMFLD_RC=wrc.exe"} c:\config.sys > NUL
|
|---|
| 190 | %cube {ADDLINE "SET EMXOMFLD_RC_TYPE=WRC"} c:\config.sys > NUL
|
|---|
| 191 | fi
|
|---|
| 192 |
|
|---|
| 193 | %postun wrc
|
|---|
| 194 | if [ "$1" = 0 ] ; then
|
|---|
| 195 | #execute only on last uninstall
|
|---|
| 196 | %cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
|
|---|
| 197 | %cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
|
|---|
| 198 | fi
|
|---|
| 199 |
|
|---|
| 200 | %post wlink
|
|---|
| 201 | if [ "$1" = 1 ] ; then
|
|---|
| 202 | #execute only on first install
|
|---|
| 203 | %cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
|
|---|
| 204 | %cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
|
|---|
| 205 | %cube {ADDLINE "SET EMXOMFLD_LINKER=wl.exe"} c:\config.sys > NUL
|
|---|
| 206 | %cube {ADDLINE "SET EMXOMFLD_TYPE=WLINK"} c:\config.sys > NUL
|
|---|
| 207 | fi
|
|---|
| 208 |
|
|---|
| 209 | %postun wlink
|
|---|
| 210 | if [ "$1" = 0 ] ; then
|
|---|
| 211 | #execute only on last uninstall
|
|---|
| 212 | %cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
|
|---|
| 213 | %cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
|
|---|
| 214 | fi
|
|---|
| 215 |
|
|---|
| 216 | %files
|
|---|
| 217 | %defattr(-,root,root,-)
|
|---|
| 218 | %{_usr}/bin
|
|---|
| 219 | %{_usr}/include
|
|---|
| 220 | %{_usr}/info
|
|---|
| 221 | %{_libdir}/*.*a
|
|---|
| 222 | %{_libdir}/*.lib
|
|---|
| 223 | %{_libdir}/*.dll
|
|---|
| 224 | %exclude %{_libdir}/*.dll
|
|---|
| 225 | %{_libdir}/*.spec
|
|---|
| 226 | %{_libdir}/gcc/*
|
|---|
| 227 | %{_usr}/libexec
|
|---|
| 228 | %{_usr}/man
|
|---|
| 229 | %{_usr}/share
|
|---|
| 230 |
|
|---|
| 231 | %files -n libssp
|
|---|
| 232 | %defattr(-,root,root,-)
|
|---|
| 233 | %{_libdir}/ssp.dll
|
|---|
| 234 |
|
|---|
| 235 | %files -n libstdc++
|
|---|
| 236 | %defattr(-,root,root,-)
|
|---|
| 237 | %{_libdir}/stdcpp.dll
|
|---|
| 238 |
|
|---|
| 239 | %files -n libsupc++
|
|---|
| 240 | %defattr(-,root,root,-)
|
|---|
| 241 | %{_libdir}/supcpp.dll
|
|---|
| 242 |
|
|---|
| 243 | %files wlink
|
|---|
| 244 | %doc gcc-wlink.txt
|
|---|
| 245 |
|
|---|
| 246 | %files wrc
|
|---|
| 247 | %doc gcc-wrc.txt
|
|---|
| 248 |
|
|---|
| 249 | %files -n libgcc446
|
|---|
| 250 | %defattr(-,root,root,-)
|
|---|
| 251 | %{_libdir}/gcc446.dll
|
|---|
| 252 | #%doc %{_datadir}/doc/*
|
|---|
| 253 |
|
|---|
| 254 | %changelog
|
|---|
| 255 | * Wed Jan 11 2012 yd
|
|---|
| 256 | - use more conventionional names for shared libraries packages.
|
|---|
| 257 |
|
|---|
| 258 | * Mon Jan 09 2012 yd
|
|---|
| 259 | - install also dlls with main package.
|
|---|
| 260 |
|
|---|
| 261 | * Sun Jan 08 2012 yd
|
|---|
| 262 | - moved dlls out from main package.
|
|---|
| 263 |
|
|---|
| 264 | * Fri Dec 23 2011 yd
|
|---|
| 265 | - fixed spawn internal error report.
|
|---|
| 266 | - fixed handling of big command lines (fixes OOo building).
|
|---|
| 267 | - fixed Optlink calls.
|
|---|
| 268 |
|
|---|
| 269 | * Fri Dec 9 2011 yd
|
|---|
| 270 | - updated source code to 4.4.6, github tree
|
|---|