diff options
-rw-r--r-- | configure.ac | 20 | ||||
-rw-r--r-- | src/Makefile.am | 5 |
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} |