Commit 577d145b authored by Daniel Veillard's avatar Daniel Veillard
Browse files

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
parent a2351322
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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment