summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh2
-rw-r--r--configure.ac20
-rw-r--r--src/Makefile.am4
3 files changed, 26 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 7b59289..29cc8b7 100755
--- a/build.sh
+++ b/build.sh
@@ -15,6 +15,8 @@ if [[ "${CMD}" == "default" ]]; then
../configure --enable-sanitize
elif [[ "${CMD}" == "old" ]]; then
../configure
+elif [[ "${CMD}" == "gprof" ]]; then
+ ../configure --enable-gprof
fi
make -j3
export RET=$?
diff --git a/configure.ac b/configure.ac
index f922d99..1f8435b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,26 @@ AC_ARG_ENABLE(
)
AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
+AC_ARG_ENABLE(
+ [gprof],
+ AC_HELP_STRING(
+ [--enable-gprof],
+ [
+ Enables or Disables Gprof (disabled by default)
+ ]
+ ),
+ [
+ enable_gprof="$enableval"
+ case $enableval in
+ "no");;
+ "yes");;
+ *) AC_MSG_ERROR([[invalid argument --enable-gprof=$disableval... stopping]]);;
+ esac
+ ],
+ [enable_gprof="no"]
+)
+AM_CONDITIONAL(ENABLE_GPROF, test x$enable_gprof = xyes)
+
AC_CHECK_FUNC([strnlen],[CFLAGS="$CFLAGS -DHAVE_STRNLEN"])
AC_CHECK_FUNC([setrlimit],[CLAGS="$CFLAGS -DHAVE_SETRLIMIT"])
diff --git a/src/Makefile.am b/src/Makefile.am
index 61dc883..4fcbfc1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -87,6 +87,10 @@ if ENABLE_STATIC
SHARED_CFLAGS += "-static-libgcc"
endif
+if ENABLE_GPROF
+SHARED_CFLAGS += "-pg"
+endif
+
lib_LTLIBRARIES = libevol_char.la libevol_login.la libevol_map.la
libevol_char_la_SOURCES = ${CHAR_SRC}
libevol_char_la_LDFLAGS = ${SHARED_LDFLAGS}