Added --enable-gprof for code profiling with gprof tools (initial profiling support)
This commit is contained in:
parent
13819432bd
commit
addc31f7d4
24
configure.in
24
configure.in
|
|
@ -42,6 +42,11 @@ dnl --disable-debug: remove -g and -Wall option to the compiler
|
||||||
AC_ARG_ENABLE(debug,
|
AC_ARG_ENABLE(debug,
|
||||||
AS_HELP_STRING([--enable-debug],[Add -g option for compilation (default)]))
|
AS_HELP_STRING([--enable-debug],[Add -g option for compilation (default)]))
|
||||||
|
|
||||||
|
dnl --enable-gprof: add -pg option to the compiler (GCC)
|
||||||
|
AC_ARG_ENABLE(gprof,
|
||||||
|
AS_HELP_STRING([--enable-gprof],[Produce gprof profiling data in 'gmon.out' (GCC only).]))
|
||||||
|
|
||||||
|
|
||||||
dnl --enable-checker: add --with-checker-debug option to the compiler
|
dnl --enable-checker: add --with-checker-debug option to the compiler
|
||||||
AC_ARG_ENABLE(checker,
|
AC_ARG_ENABLE(checker,
|
||||||
AS_HELP_STRING([--enable-checkergcc],[Option for compilation with checkergcc]))
|
AS_HELP_STRING([--enable-checkergcc],[Option for compilation with checkergcc]))
|
||||||
|
|
@ -219,6 +224,25 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl the profiling option
|
||||||
|
if test "$enable_gprof" = "yes"; then
|
||||||
|
dnl Probably other compilers support -pg or something similar;
|
||||||
|
dnl feel free to extend this to include them.
|
||||||
|
if test "$GCC" = "yes"; then
|
||||||
|
if test "$enable_shared" = "yes" ; then
|
||||||
|
AC_MSG_ERROR(Can't have --enable-gprof without --disable-shared (we
|
||||||
|
recommend also using --enable-all-static).)
|
||||||
|
fi
|
||||||
|
if test ! "$enable_static" = "yes" ; then
|
||||||
|
AC_MSG_WARN(We recommend --enable-static with --enable-gprof.)
|
||||||
|
fi
|
||||||
|
AC_MSG_NOTICE([Enabling gprof profiling data (to gmon.out).])
|
||||||
|
CFLAGS="$CFLAGS -pg"
|
||||||
|
LDFLAGS="$LDFLAGS -pg"
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR(We only support --enable-gprof with GCC right now.)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
dnl Not sure that this will work....
|
dnl Not sure that this will work....
|
||||||
if test "$with_checkergcc" = "yes"; then
|
if test "$with_checkergcc" = "yes"; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue