varnish/varnish.jemalloc_as_system_library.patch

74 lines
1.7 KiB
Diff
Raw Normal View History

Index: configure.ac
===================================================================
--- configure.ac (revision 5691)
+++ configure.ac (working copy)
@@ -39,6 +39,13 @@
# Checks for libraries.
save_LIBS="${LIBS}"
LIBS=""
+AC_CHECK_LIB(jemalloc, malloc)
+RT_LIBS="${LIBS}"
+LIBS="${save_LIBS}"
+AC_SUBST(RT_LIBS)
+
+save_LIBS="${LIBS}"
+LIBS=""
AC_CHECK_LIB(rt, clock_gettime)
RT_LIBS="${LIBS}"
LIBS="${save_LIBS}"
@@ -423,25 +430,21 @@
AC_DEFINE_UNQUOTED([VCC_CC],"$VCC_CC",[C compiler command line for VCL code])
# Use jemalloc on Linux
-JEMALLOC_SUBDIR=
JEMALLOC_LDADD=
AC_ARG_ENABLE(jemalloc,
AS_HELP_STRING([--disable-jemalloc],[do not use jemalloc (default is yes on Linux, no everywhere else)]),
[if test "x$enableval" = "xyes"; then
- JEMALLOC_SUBDIR=libjemalloc
- JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'
+ JEMALLOC_LDADD='-ljemalloc'
fi],
[case $target in #(
*-*-linux*)
- JEMALLOC_SUBDIR=libjemalloc
- JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'
+ JEMALLOC_LDADD='-ljemalloc'
;; #(
*)
true
;;
esac])
-AC_SUBST(JEMALLOC_SUBDIR)
AC_SUBST(JEMALLOC_LDADD)
# Generate output
@@ -467,7 +470,6 @@
lib/libvarnishapi/Makefile
lib/libvarnishcompat/Makefile
lib/libvcl/Makefile
- lib/libjemalloc/Makefile
man/Makefile
redhat/Makefile
varnishapi.pc
Index: lib/Makefile.am
===================================================================
--- lib/Makefile.am (revision 5691)
+++ lib/Makefile.am (working copy)
@@ -4,12 +4,10 @@
libvarnishcompat \
libvarnish \
libvarnishapi \
- libvcl \
- @JEMALLOC_SUBDIR@
+ libvcl
DIST_SUBDIRS = \
libvarnishcompat \
libvarnish \
libvarnishapi \
- libvcl \
- libjemalloc
+ libvcl