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