Skip to content

Commit

Permalink
do_autogen.sh: add -P option
Browse files Browse the repository at this point in the history
Signed-off-by: Colin McCabe <[email protected]>
  • Loading branch information
cmccabe committed Mar 4, 2011
1 parent 3d62938 commit 88cc244
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions do_autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ usage() {
do_autogen.sh: make a ceph build by running autogen, etc.
-h: this help message
-3: build 32-bit
-6: build 64-bit
-d <level> debug build
level 0: no debug
level 1: -g
level 2: -Wall
level 3: -Wextra
level 4: even more...
-P profiling build
EOF
}
Expand All @@ -26,16 +25,13 @@ debug_level=0
verbose=0
CFLAGS=""
CXXFLAGS=""
profile=0
while getopts "36d:hPv" flag
do
case $flag in
3) CFLAGS="$CFLAGS -m32";;

6) CFLAGS="$CFLAGS -m64";;

d) debug_level=$OPTARG;;

P) with_profiler="--with-profiler ";;
P) profile=1;;

h) usage
exit 0;;
Expand All @@ -49,6 +45,16 @@ do
esac
done

if [ $profile -eq 1 ]; then
if [ $debug_level -ne 0 ]; then
echo "Can't specify both -d and -P. Profiling builds are \
different than debug builds."
exit 1
fi
CFLAGS="${CFLAGS} -fno-omit-frame-pointer"
debug_level=1
fi

if [ "${debug_level}" -ge 1 ]; then
CFLAGS="${CFLAGS} -g"
fi
Expand Down

0 comments on commit 88cc244

Please sign in to comment.