~ubuntu-branches/ubuntu/natty/freecell-solver/natty

« back to all changes in this revision

Viewing changes to scripts/pgo.bash

  • Committer: Bazaar Package Importer
  • Author(s): RISKO Gergely
  • Date: 2009-07-15 17:42:19 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090715174219-2rlyyvse0kezacly
Tags: 2.34.0-1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
# This is a script for PGO - Profile Guided Optimisations in gcc.
 
4
 
 
5
compiler="$1"
 
6
shift
 
7
mode="$1"
 
8
shift
 
9
 
 
10
pgo_flags=""
 
11
 
 
12
if test "$mode" = "use" ; then
 
13
    if test "$compiler" = "gcc" ; then
 
14
        pgo_flags="-fprofile-use"
 
15
    elif test "$compiler" = "icc" ; then
 
16
        pgo_flags="-prof-use"
 
17
    else
 
18
        echo "Unknown compiler '$compiler'!" 1>&2
 
19
        exit -1
 
20
    fi
 
21
elif test "$mode" = "gen" ; then
 
22
    if test "$compiler" = "gcc" ; then
 
23
        pgo_flags="-fprofile-generate"
 
24
    elif test "$compiler" = "icc" ; then
 
25
        pgo_flags="-prof-gen"
 
26
    else
 
27
        echo "Unknown compiler '$compiler'!" 1>&2
 
28
        exit -1
 
29
    fi
 
30
else
 
31
    echo "Unknown mode '$mode'!" 1>&2
 
32
    exit -1
 
33
fi
 
34
    
 
35
make -f Makefile.gnu FREECELL_ONLY=1 \
 
36
    CFLAGS="-DFCS_FREECELL_ONLY=1 -O3 -Wall -march=pentium4 -fomit-frame-pointer $pgo_flags -fPIC" \
 
37
    COMPILER=icc