summaryrefslogtreecommitdiff
blob: 70ca9f8cb2eef2797e4fcd5749b5ad1a0a0dd350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
diff -Naur varnish-3.0.3.orig/configure.ac varnish-3.0.3/configure.ac
--- varnish-3.0.3.orig/configure.ac	2012-08-20 05:20:40.000000000 -0400
+++ varnish-3.0.3/configure.ac	2013-03-14 10:57:55.000000000 -0400
@@ -87,15 +87,20 @@
 
 save_LIBS="${LIBS}"
 LIBS=""
-AC_SEARCH_LIBS(initscr, [curses ncurses],
-	[have_curses=yes], [have_curses=no])
-CURSES_LIBS="${LIBS}"
-LIBS="${save_LIBS}"
-AC_SUBST(CURSES_LIBS)
-if test "$have_curses" = no; then
-	AC_MSG_WARN([curses not found; some tools will not be built])
-fi
-AC_CHECK_HEADERS([ncurses/curses.h curses.h])
+AC_ARG_WITH([tools], AS_HELP_STRING([--without-tools],
+            [Don't build additional tools: varnishhist, varnishstat, varnishtop, varnishsizes (default: test)]))
+
+AS_IF([test "x$with_tools" != "xno"], [
+  AC_SEARCH_LIBS(initscr, [curses ncurses],
+    [have_curses=yes], [have_curses=no])
+  CURSES_LIBS="${LIBS}"
+  LIBS="${save_LIBS}"
+  AC_SUBST(CURSES_LIBS)
+  if test "$have_curses" = no; then
+    AC_MSG_ERROR([curses not found, required to build additional tools])
+  fi
+  AC_CHECK_HEADERS([ncurses/curses.h curses.h])
+])
 AM_CONDITIONAL([HAVE_CURSES], [test x$have_curses = xyes])
 
 save_LIBS="${LIBS}"
@@ -147,17 +152,13 @@
 AC_SUBST(PCRE_CFLAGS)
 AC_SUBST(PCRE_LIBS)
 
-PKG_CHECK_MODULES([LIBEDIT], [libedit], 
-	[AC_DEFINE([HAVE_LIBEDIT], [1], [Define we have libedit])],
-	[AC_CHECK_HEADERS([readline/readline.h])
-	 AC_CHECK_HEADERS([edit/readline/readline.h])
-	 AC_CHECK_LIB(edit, el_init,
-	        [ AC_DEFINE([HAVE_LIBEDIT], [1], [Define we have libedit])
-		  LIBEDIT_CFLAGS=""
-		  LIBEDIT_LIBS="-ledit ${CURSES_LIBS}"
-		],
-               [AC_MSG_WARN([libedit not found, disabling libedit support])],
-               [${CURSES_LIBS}])])
+AC_ARG_WITH([libedit], AS_HELP_STRING([--with-libedit],
+            [Enable support for libedit in varnishadm (default: disabled)]))
+AS_IF([test "x$with_libedit" = "xyes"], [
+	PKG_CHECK_MODULES([LIBEDIT], [libedit],
+		[AC_DEFINE([HAVE_LIBEDIT], [1], [Define we have libedit])],
+		[AC_MSG_ERROR([libedit not found])])
+])
 
 # Checks for header files.
 AC_HEADER_STDC
@@ -271,7 +272,6 @@
 CFLAGS="${save_CFLAGS}" 
 
 # Use jemalloc on Linux
-JEMALLOC_SUBDIR=
 JEMALLOC_LDADD=
 AC_ARG_WITH([jemalloc],
             [AS_HELP_STRING([--with-jemalloc],
@@ -279,18 +279,11 @@
             [],
             [with_jemalloc=check])
 
-case $target in
-    *-*-linux*)
-        if test "x$with_jemalloc" != xno; then
-            AC_CHECK_LIB([jemalloc], [malloc_conf],
-                  [JEMALLOC_LDADD="-ljemalloc"],
-                  [AC_MSG_NOTICE([No system jemalloc found, using bundled version])
-                   JEMALLOC_SUBDIR=libjemalloc
-                   JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'])
-	fi
-	;;
-esac
-AC_SUBST(JEMALLOC_SUBDIR)
+if test "x$with_jemalloc" != xno; then
+      AC_CHECK_LIB([jemalloc], [jmalloc_conf],
+            [JEMALLOC_LDADD="-ljemalloc"],
+            [AC_MSG_ERROR([No system jemalloc found])])
+fi
 AC_SUBST(JEMALLOC_LDADD)
 
 # Userland slab allocator, available only on Solaris
@@ -582,7 +575,6 @@
     lib/libvcl/Makefile
     lib/libvgz/Makefile
     lib/libvmod_std/Makefile
-    lib/libjemalloc/Makefile
     man/Makefile
     redhat/Makefile
     varnishapi.pc
diff -Naur varnish-3.0.3.orig/lib/Makefile.am varnish-3.0.3/lib/Makefile.am
--- varnish-3.0.3.orig/lib/Makefile.am	2012-08-20 05:20:40.000000000 -0400
+++ varnish-3.0.3/lib/Makefile.am	2013-03-14 10:58:39.000000000 -0400
@@ -6,14 +6,12 @@
 	libvarnishapi \
 	libvcl \
 	libvgz \
-	libvmod_std \
-	@JEMALLOC_SUBDIR@
+	libvmod_std
 
-DIST_SUBDIRS = 	\
+DIST_SUBDIRS = \
 	libvarnishcompat \
 	libvarnish \
 	libvarnishapi \
 	libvcl \
 	libvgz \
-	libvmod_std \
-	libjemalloc
+	libvmod_std