summaryrefslogtreecommitdiff
blob: a11198061c0acb0a01f3d013ced5a3d95cf08415 (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
diff -Naur monkey-1.5.0.orig/configure monkey-1.5.0/configure
--- monkey-1.5.0.orig/configure	2014-05-25 19:12:44.000000000 -0400
+++ monkey-1.5.0/configure	2014-05-26 12:32:16.370879609 -0400
@@ -193,7 +193,7 @@
 
 	echo "+ Creating src/Makefile"
 	create_makefile2 mod_libs mod_obj make_script platform \
-                         malloc_libc malloc_jemalloc
+                         malloc_libc
 
 	echo "+ Creating plugins/Make.common"
 	create_plugins_make_common bindir
@@ -210,33 +210,12 @@
 
 	echo -e "+ Creating Makefile"
 	if [ "$dir" = 0 ]; then
-		create_makefile1 bindir malloc_jemalloc
+		create_makefile1 bindir
 	else
 		create_makefile1_install prefix bindir mandir sysconfdir \
-                datadir logdir malloc_jemalloc
+                datadir logdir
 	fi
 
-        # if the memory allocator is jemalloc, lets start configuring the dependency
-        if [ $malloc_jemalloc -eq 1 ]; then
-                echo
-                echo -e "\033[1m=== Configuring Memory Allocator ===\033[0m"
-                cd deps/jemalloc
-                ./configure $JEMALLOC_OPTS \
-                            --with-jemalloc-prefix=je_ \
-                            --enable-cc-silence \
-                            CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " \
-                            LDFLAGS="" > jemalloc.config 2>&1
-                if [ $? -eq 0 ]; then
-                      echo "+ Jemalloc configured"
-                else
-                      cat jemalloc.config
-                      echo
-                      echo "check more details with: $ cat deps/jemalloc/config.log"
-                      exit 1
-                fi
-                cd ../../
-        fi
-
 	echo
 	echo -e "\033[1m=== Monkey Configuration ===\033[0m"
 	echo -e "Platform\t= $platform"
@@ -316,12 +295,6 @@
 # Create Makefile
 create_makefile1()
 {
-        if [ $malloc_jemalloc -eq 1 ]; then
-                $deps="deps/jemalloc"
-        else
-                $deps=""
-        fi
-
 	cat > Makefile << EOF
 # Monkey HTTP Daemon: Makefile
 # ============================
@@ -459,13 +432,6 @@
 
 create_makefile1_install()
 {
-        # memory allocator
-        if [ $malloc_jemalloc -eq 1 ]; then
-                all_deps="$all_deps jemalloc"
-        else
-                deps=""
-        fi
-
 	# remove old data
 	rm -rf plugins.conf plugins.list
         touch plugins.conf
@@ -523,10 +489,6 @@
 	@\$(MAKE) -s -C plugins all
 	@echo "  DONE"
 
-jemalloc:
-	@echo "  CC    jemalloc [all]"
-	@\$(MAKE) -s -C deps/jemalloc
-
 clean:
 	@(cd src; \$(MAKE) clean)
 	@(cd plugins; \$(MAKE) clean)
@@ -605,9 +567,7 @@
 	fi
 
         if [ $malloc_jemalloc -eq 1 ]; then
-                extra="../deps/jemalloc/lib/libjemalloc.a"
-                extraso="-Wl,--whole-archive ../deps/jemalloc/lib/libjemalloc_pic.a -Wl,--no-whole-archive"
-                libs="$libs -lm"
+                libs="$libs -ljemalloc"
         fi
 
 	cat > src/Makefile<<EOF
diff -Naur monkey-1.5.0.orig/src/include/mk_memory.h monkey-1.5.0/src/include/mk_memory.h
--- monkey-1.5.0.orig/src/include/mk_memory.h	2014-05-25 19:12:44.000000000 -0400
+++ monkey-1.5.0/src/include/mk_memory.h	2014-05-26 12:31:07.103883668 -0400
@@ -23,7 +23,8 @@
 #include <stdio.h>
 
 #ifdef MALLOC_JEMALLOC
-#include "../../deps/jemalloc/include/jemalloc/jemalloc.h"
+#include <jemalloc/jemalloc.h>
+#include <jemalloc/jemalloc_defs.h>
 #endif
 
 #include "mk_macros.h"