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