summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-12 17:29:28 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-12 17:29:28 +0300
commit0b54822a82f01fe02bda4cb93c56013ab538c406 (patch)
tree6cdac227f9f6bf115faa4672d3a6180aa9b033f5
parent083628b8ee0ffb7832221bcb5ef387ecf063f620 (diff)
downloadevol-hercules-0b54822a82f01fe02bda4cb93c56013ab538c406.tar.gz
evol-hercules-0b54822a82f01fe02bda4cb93c56013ab538c406.tar.bz2
evol-hercules-0b54822a82f01fe02bda4cb93c56013ab538c406.tar.xz
evol-hercules-0b54822a82f01fe02bda4cb93c56013ab538c406.zip
In configure add flag for semi static build.
-rw-r--r--configure.ac20
-rw-r--r--src/Makefile.am5
2 files changed, 25 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index c3d34e0..f21bc47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,26 @@ AC_PROG_LIBTOOL
AC_ENABLE_SHARED
AC_DISABLE_STATIC
+AC_ARG_ENABLE(
+ [static],
+ AC_HELP_STRING(
+ [--enable-static],
+ [
+ Enables or Disables Statick Linking (STATIC is disabled by default)
+ ]
+ ),
+ [
+ enable_static="$enableval"
+ case $enableval in
+ "no");;
+ "yes");;
+ *) AC_MSG_ERROR([[invalid argument --enable-static=$disableval... stopping]]);;
+ esac
+ ],
+ [enable_static="no"]
+)
+AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = 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 d95ddfc..be513e7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,8 +22,13 @@ MAP_SRC = map/dummy.c \
map/sessionext.h
SHARED_CFLAGS = -pipe -ffast-math -Wall -Wextra -Wno-sign-compare -fsanitize=address
+
SHARED_LDFLAGS = -avoid-version -Wl,--no-undefined -lasan
+if ENABLE_STATIC
+SHARED_CFLAGS += "-static-libgcc"
+endif
+
lib_LTLIBRARIES = libevol_char.la libevol_login.la libevol_map.la
libevol_char_la_SOURCES = ${CHAR_SRC}
libevol_char_la_LDFLAGS = ${SHARED_LDFLAGS}