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