diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 57ea4b344b7..1b6ca25234f 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -398,6 +398,19 @@ RBR=$RPM_BUILD_ROOT # Clean up the BuildRoot first [ "$RBR" != "/" ] && [ -d "$RBR" ] && rm -rf "$RBR"; +# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921). This +# needs to be in %build as $CC is not set in %install. +if "$CC" --version | grep '(GCC)' >/dev/null 2>&1 +then + libgcc=`$CC $CFLAGS --print-libgcc-file` + if [ -f $libgcc ] + then + %define WITH_LIBGCC 1 + mkdir -p $RBR%{_libdir} + install -m 644 $libgcc $RBR%{_libdir}/libmygcc.a + fi +fi + ############################################################################## %install @@ -419,17 +432,6 @@ install -d $RBR%{_sbindir} make DESTDIR=$RBR install ) -# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921) -if "$CC" --version | grep '(GCC)' >/dev/null 2>&1 -then - libgcc=`$CC $CFLAGS --print-libgcc-file` - if [ -f $libgcc ] - then - %define WITH_LIBGCC 1 - install -m 644 $libgcc $RBR%{_libdir}/libmygcc.a - fi -fi - # Install logrotate and autostart install -m 644 $MBD/release/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql