1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-04 05:17:37 +03:00

another, more 'experimental' feature to get compiler optimization based on

* libxml.spec.in: another, more 'experimental' feature to
  get compiler optimization based on gcc runtime profiling
This commit is contained in:
Daniel Veillard 2004-06-27 14:07:43 +00:00
parent a2351322c8
commit 577d145b8e
2 changed files with 44 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Sun Jun 27 14:17:15 CEST 2004 Daniel Veillard <daniel@veillard.com>
* libxml.spec.in: another, more 'experimental' feature to
get compiler optimization based on gcc runtime profiling
Sun Jun 27 14:02:36 CEST 2004 Daniel Veillard <daniel@veillard.com>
* elfgcchack.h doc/elfgcchack.xsl libxml.h: hack based on Arjan van de

View File

@ -60,8 +60,45 @@ at parse time or later once the document has been modified.
%setup -q
%build
%configure
make
#
# try to use compiler profiling, based on Arjan van de Ven <arjanv@redhat.com>
# initial test spec
#
GCC_VERSION=`gcc --version | grep "^gcc" | awk '{ print $3 }' | sed 's+\([0-9]\)\.\([0-9]\)\..*+\1\2+'`
if [ $GCC_VERSION -eq 32 ]
then
PROF_GEN='-fprofile-arcs'
PROF_USE='-fbranch-probabilities'
else if [ $GCC_VERSION -eq 33 ]
then
PROF_GEN='-fprofile-arcs'
PROF_USE='-fbranch-probabilities -ftracer'
else if [ $GCC_VERSION -ge 34 ]
then
PROF_GEN='-fprofile-generate'
PROF_USE='-fprofile-use'
fi
fi
fi
if [ "$PROF_GEN" != "" ]
then
# First generate a profiling version
CFLAGS="${RPM_OPT_FLAGS} ${PROF_GEN}" %configure
make
# Run a few sampling
make dba100000.xml
./xmllint --noout dba100000.xml
./xmllint --stream dba100000.xml
./xmllint --noout --valid test/valid/REC-xml-19980210.xml
./xmllint --stream --valid test/valid/REC-xml-19980210.xml
# Then generate code based on profile
CFLAGS="${RPM_OPT_FLAGS} ${PROF_USE}" %configure
make
else
%configure
make
fi
(cd doc/examples ; make clean)
gzip -9 ChangeLog