summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-21 16:33:21 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-21 16:33:31 +0300
commit875a09d8a893fd17c43d85e9a318ff0d4d359e6f (patch)
treecc1f62f8b786c98f56d51b5c756e9e4ca125e4d0
parent8e50387632bd4bbab6f1a85b94afa24340a3ce19 (diff)
downloadevol-hercules-875a09d8a893fd17c43d85e9a318ff0d4d359e6f.tar.gz
evol-hercules-875a09d8a893fd17c43d85e9a318ff0d4d359e6f.tar.bz2
evol-hercules-875a09d8a893fd17c43d85e9a318ff0d4d359e6f.tar.xz
evol-hercules-875a09d8a893fd17c43d85e9a318ff0d4d359e6f.zip
Add gprof build flag.
-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}