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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
Patch for various autotools fixes:
* cleaner enable/disable functions
* allow to build against system jemalloc
* adapated to newer autoconf with standard macros
* use LDADD instead of LDFLAGS to respect user's flags
bicatali@gentoo.org 07/2012
diff -Nur cvmfs-2.0.19.orig/configure.ac cvmfs-2.0.19/configure.ac
--- cvmfs-2.0.19.orig/configure.ac 2012-07-24 17:54:17.000000000 +0100
+++ cvmfs-2.0.19/configure.ac 2012-10-30 11:00:26.000000000 +0000
@@ -9,20 +9,22 @@
AC_CONFIG_HEADER([config.h])
AH_BOTTOM([#define CVMFS_PATCH_LEVEL "0"])
-AC_ARG_ENABLE([cvmfs], AC_HELP_STRING([--disable-cvmfs], [Don't build the CernVM-FS FUSE module]), AC_SUBST([HAVE_CVMFS], [no]))
-AC_ARG_ENABLE([server], AC_HELP_STRING([--disable-server], [Don't build writer's end programs]), AC_SUBST([HAVE_SERVER], [no]))
-AC_ARG_ENABLE([sqlite3-builtin], AC_HELP_STRING([--enable-sqlite3-builtin], [Don't use system SQLite3]), AC_SUBST([USE_BUILTIN_SQLITE3], [yes]))
-AC_ARG_ENABLE([libcurl-builtin], AC_HELP_STRING([--enable-libcurl-builtin], [Don't use system libcurl]), AC_SUBST([USE_BUILTIN_LIBCURL], [yes]))
+AC_ARG_ENABLE([cvmfs], AC_HELP_STRING([--disable-cvmfs], [Don't build the CernVM-FS FUSE module]), AC_SUBST([HAVE_CVMFS], [$enableval]),AC_SUBST([HAVE_CVMFS], [yes]))
+AC_ARG_ENABLE([server], AC_HELP_STRING([--disable-server], [Don't build writer's end programs]), AC_SUBST([HAVE_SERVER], [$enableval]),AC_SUBST([HAVE_SERVER], [yes]))
+AC_ARG_ENABLE([sqlite3-builtin], AC_HELP_STRING([--enable-sqlite3-builtin], [Don't use system SQLite3]), AC_SUBST([USE_BUILTIN_SQLITE3], [$enableval]),AC_SUBST([USE_BUILTIN_SQLITE3], [no]))
+AC_ARG_ENABLE([libcurl-builtin], AC_HELP_STRING([--enable-libcurl-builtin], [Don't use system libcurl]), AC_SUBST([USE_BUILTIN_LIBCURL], [$enableval]),AC_SUBST([USE_BUILTIN_LIBCURL], [no]))
dnl AC_ARG_ENABLE([libfuse-builtin], AC_HELP_STRING([--enable-libfuse-builtin], [Don't use system libfuse]), AC_SUBST([USE_BUILTIN_LIBFUSE], [yes]))
-AC_ARG_ENABLE([zlib-builtin], AC_HELP_STRING([--enable-zlib-builtin], [Don't use system]), AC_SUBST([USE_BUILTIN_ZLIB], [yes]))
-AC_ARG_ENABLE([kernel-module], AC_HELP_STRING([--enable-kernel-module], [Build the kernel module for the server part]), AC_SUBST([HAVE_KMODULE], [yes]))
-AC_ARG_ENABLE([mount-scripts], AC_HELP_STRING([--enable-mount-scripts], [Install CernVM-FS mount tools in /etc and /sbin]), AC_SUBST([HAVE_MOUNTSCRIPTS], [yes]))
+AC_ARG_ENABLE([zlib-builtin], AC_HELP_STRING([--enable-zlib-builtin], [Don't use system]), AC_SUBST([USE_BUILTIN_ZLIB], [$enableval]),AC_SUBST([USE_BUILTIN_ZLIB], [no]))
+AC_ARG_ENABLE([jemalloc-builtin], AC_HELP_STRING([--enable-jemalloc-builtin], [Don't use system jemalloc]), AC_SUBST([USE_BUILTIN_JEMALLOC], [$enableval]),AC_SUBST([USE_BUILTIN_JEMALLOC], [no]))
+AC_ARG_ENABLE([kernel-module], AC_HELP_STRING([--enable-kernel-module], [Build the kernel module for the server part]), AC_SUBST([HAVE_KMODULE], [$enableval]),AC_SUBST([HAVE_KMODULE], [no]))
+AC_ARG_ENABLE([mount-scripts], AC_HELP_STRING([--enable-mount-scripts], [Install CernVM-FS mount tools in /etc and /sbin]), AC_SUBST([HAVE_MOUNTSCRIPTS], [$enableval]),AC_SUBST([HAVE_MOUNTSCRIPTS], [no]))
AM_CONDITIONAL([BUILD_CVMFS], [test x$HAVE_CVMFS != xno])
AM_CONDITIONAL([BUILD_SERVER], [test x$HAVE_SERVER != xno])
AM_CONDITIONAL([SYSTEM_SQLITE3], [test x$USE_BUILTIN_SQLITE3 != xyes])
AM_CONDITIONAL([SYSTEM_LIBCURL], [test x$USE_BUILTIN_LIBCURL != xyes])
AM_CONDITIONAL([SYSTEM_LIBFUSE], [test x != x])
AM_CONDITIONAL([SYSTEM_ZLIB], [test x$USE_BUILTIN_ZLIB != xyes])
+AM_CONDITIONAL([SYSTEM_JEMALLOC], [test x$USE_BUILTIN_JEMALLOC != xyes])
AM_CONDITIONAL([BUILD_KMODULE], [test x$HAVE_KMODULE == xyes])
AM_CONDITIONAL([BUILD_MEMCACHED], [test x$HAVE_MEMCACHED == xyes])
AM_CONDITIONAL([BUILD_MOUNTSCRIPTS], [test x$HAVE_MOUNTSCRIPTS == xyes])
@@ -35,6 +37,7 @@
dnl AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
AC_PROG_RANLIB
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
CXXFLAGS="$CXXFLAGS -g -fno-exceptions -fno-strict-aliasing -fasynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wall \
-D_REENTRANT -D__EXTENSIONS__ -D_LARGEFILE64_SOURCE -D__LARGE64_FILES"
@@ -70,7 +73,7 @@
PKG_CHECK_MODULES([OPENSSL], [libcrypto >= 0.9.7a])
dnl Get OpenMP Options
-gt_OPENMP()
+AC_OPENMP
dnl Checks for libraries.
save_LIBS=$LIBS
@@ -86,6 +89,10 @@
AC_CHECK_LIB([rt], [sched_yield], ,[AC_MSG_ERROR(librt (Posix real time extensions) required)])
+if test x$USE_BUILTIN_JEMALLOC != xyes; then
+ AC_CHECK_LIB([jemalloc], [malloc], ,[AC_MSG_ERROR(jemalloc required)])
+fi
+
if test x$HAVE_CVMFS != xno; then
dnl if test x$USE_BUILTIN_LIBFUSE != xyes; then
dnl AC_CHECK_HEADERS([fuse.h fuse/fuse_opt.h],,[AC_MSG_ERROR(fuse headers required)],[#define _FILE_OFFSET_BITS 64])
diff -Nur cvmfs-2.0.19.orig/cvmfs/src/Makefile.am cvmfs-2.0.19/cvmfs/src/Makefile.am
--- cvmfs-2.0.19.orig/cvmfs/src/Makefile.am 2012-07-25 08:17:28.000000000 +0100
+++ cvmfs-2.0.19/cvmfs/src/Makefile.am 2012-10-30 11:08:44.000000000 +0000
@@ -224,6 +224,11 @@
cvmfs_proxy_rtt_LDADD += $(LDFLAGS_ZLIB)
endif
+if ! SYSTEM_JEMALLOC
+LDFLAGS_JEMALLOC = ../../jemalloc/src/lib/libjemalloc.a
+cvmfs2_debug_LDADD += $(LDFLAGS_JEMALLOC)
+cvmfs2_LDADD += $(LDFLAGS_JEMALLOC)
+endif
CFLAGS_CVMFS2 =
if ! SYSTEM_SQLITE3
@@ -238,8 +243,8 @@
if ! SYSTEM_ZLIB
CFLAGS_CVMFS2 += -I../../zlib/src
endif
-cvmfs2_debug_LDADD += ../../jemalloc/src/lib/libjemalloc.a -ldl
-cvmfs2_LDADD += ../../jemalloc/src/lib/libjemalloc.a -ldl
+
+
CFLAGS_CVMFS2 += $(PTHREAD_CFLAGS) $(CURL_CFLAGS) $(SQLITE_CFLAGS) $(OPENSSL_CFLAGS) $(FUSE_CFLAGS) -DCVMFS_CLIENT -DFUSE_CLIENT
LDFLAGS_CVMFS2 = $(PTHREAD_CFLAGS) -rdynamic
LIBS_CVMFS2 = $(PTHREAD_LIBS) $(CURL_LIBS) $(SQLITE_LIBS) $(FUSE_LIBS) $(Z_LIBS) $(OPENSSL_LIBS) $(CVMFS_LIBS) -lrt
@@ -291,11 +296,11 @@
endif
CFLAGS_PROXYRTT += $(CURL_CFLAGS) -DCVMFS_CLIENT -DNDEBUGMSG
cvmfs_proxy_rtt_CFLAGS = $(CVMFS_CFLAGS) $(CFLAGS_PROXYRTT)
-cvmfs_proxy_rtt_LDFLAGS = $(CVMFS_LIBS) $(CURL_LIBS)
+cvmfs_proxy_rtt_LDADD += $(CVMFS_LIBS) $(CURL_LIBS)
testtracer_CXXFLAGS = $(CVMFS_CXXFLAGS) $(PTHREAD_CFLAGS)
-testtracer_LDFLAGS = $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+testtracer_LDADD += $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
CFLAGS_SYNC =
if ! SYSTEM_SQLITE3
@@ -307,7 +312,7 @@
CFLAGS_SYNC += $(PTHREAD_CFLAGS) $(OPENMP_CFLAGS) $(SQLITE_CFLAGS) $(OPENSSL_CFLAGS) -DNDEBUGMSG
cvmfs_sync_bin_CXXFLAGS = $(CVMFS_CXXFLAGS) $(CFLAGS_SYNC)
cvmfs_sync_bin_CFLAGS = $(CVMFS_CFLAGS) $(CFLAGS_SYNC)
-cvmfs_sync_bin_LDFLAGS = $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(SQLITE_LIBS) $(OPENSSL_LIBS) $(Z_LIBS) $(GOMP_LIBS)
+cvmfs_sync_bin_LDADD += $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(SQLITE_LIBS) $(OPENSSL_LIBS) $(Z_LIBS) $(GOMP_LIBS)
CFLAGS_CLGCMP =
@@ -320,7 +325,7 @@
CFLAGS_CLGCMP += $(SQLITE_CFLAGS) $(PTHREAD_CFLAGS) $(OPENSSL_CFLAGS) -DNDEBUGMSG
cvmfs_clgcmp_CXXFLAGS = $(CVMFS_CXXFLAGS) $(CFLAGS_CLGCMP)
cvmfs_clgcmp_CFLAGS = $(CVMFS_CFLAGS) $(CFLAGS_CLGCMP)
-cvmfs_clgcmp_LDFLAGS = $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(OPENSSL_LIBS) $(SQLITE_LIBS) $(Z_LIBS)
+cvmfs_clgcmp_LDADD += $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(OPENSSL_LIBS) $(SQLITE_LIBS) $(Z_LIBS)
CFLAGS_LSCAT =
@@ -333,7 +338,7 @@
CFLAGS_LSCAT += $(SQLITE_CFLAGS) $(PTHREAD_CFLAGS) $(OPENSSL_CFLAGS) -DNDEBUGMSG
cvmfs_lscat_CXXFLAGS = $(CVMFS_CXXFLAGS) $(CFLAGS_LSCAT)
cvmfs_lscat_CFLAGS = $(CVMFS_CFLAGS) $(CFLAGS_LSCAT)
-cvmfs_lscat_LDFLAGS = $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(OPENSSL_LIBS) $(SQLITE_LIBS) $(Z_LIBS)
+cvmfs_lscat_LDADD += $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(OPENSSL_LIBS) $(SQLITE_LIBS) $(Z_LIBS)
CFLAGS_FIXINODES =
if ! SYSTEM_SQLITE3
@@ -345,7 +350,7 @@
CFLAGS_FIXINODES += $(SQLITE_CFLAGS) $(PTHREAD_CFLAGS) $(OPENSSL_CFLAGS) -DNDEBUGMSG
cvmfs_fixinodes_CXXFLAGS = $(CVMFS_CXXFLAGS) $(CFLAGS_FIXINODES)
cvmfs_fixinodes_CFLAGS = $(CVMFS_CFLAGS) $(CFLAGS_FIXINODES)
-cvmfs_fixinodes_LDFLAGS = $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(OPENSSL_LIBS) $(SQLITE_LIBS) $(Z_LIBS)
+cvmfs_fixinodes_LDADD += $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(OPENSSL_LIBS) $(SQLITE_LIBS) $(Z_LIBS)
CFLAGS_SIGN =
if ! SYSTEM_ZLIB
@@ -354,7 +359,7 @@
CFLAGS_SIGN += $(SQLITE_CFLAGS) $(PTHREAD_CFLAGS) $(OPENSSL_CFLAGS) -DNDEBUGMSG
cvmfs_sign_CXXFLAGS = $(CVMFS_CXXFLAGS) $(CFLAGS_SIGN)
cvmfs_sign_CFLAGS = $(CVMFS_CFLAGS) $(CFLAGS_SIGN)
-cvmfs_sign_LDFLAGS = $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(SQLITE_LIBS) $(Z_LIBS) $(OPENSSL_LIBS)
+cvmfs_sign_LDADD += $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(SQLITE_LIBS) $(Z_LIBS) $(OPENSSL_LIBS)
CFLAGS_PULL =
if ! SYSTEM_SQLITE3
@@ -369,13 +374,13 @@
CFLAGS_PULL += $(SQLITE_CFLAGS) $(PTHREAD_CFLAGS) $(OPENSSL_CFLAGS) -DNDEBUGMSG
cvmfs_pull_CXXFLAGS = $(CVMFS_CXXFLAGS) $(CFLAGS_PULL)
cvmfs_pull_CFLAGS = $(CVMFS_CFLAGS) $(CFLAGS_PULL)
-cvmfs_pull_LDFLAGS = $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(OPENSSL_LIBS) $(SQLITE_LIBS) $(Z_LIBS)
+cvmfs_pull_LDADD += $(CVMFS_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(OPENSSL_LIBS) $(SQLITE_LIBS) $(Z_LIBS) $(CURL_LIBS)
CFLAGS_SCRUB = $(OPENSSL_CFLAGS) -DNDEBUGMSG
cvmfs_scrub_CXXFLAGS = $(CVMFS_CXXFLAGS) $(CFLAGS_SCRUB)
cvmfs_scrub_CFLAGS = $(CVMFS_CFLAGS) $(CFLAGS_SCRUB)
-cvmfs_scrub_LDFLAGS = $(CVMFS_LIBS) $(OPENSSL_LIBS)
+cvmfs_scrub_LDADD += $(CVMFS_LIBS) $(OPENSSL_LIBS)
CFLAGS_ZPIPE =
@@ -383,4 +388,4 @@
CFLAGS_ZPIPE += -I../../zlib/src
endif
cvmfs_zpipe_CFLAGS = $(CVMFS_CFLAGS) $(CFLAGS_ZPIPE)
-cvmfs_zpipe_LDFLAGS = $(CVMFS_LIBS) $(Z_LIBS)
+cvmfs_zpipe_LDADD += $(CVMFS_LIBS) $(Z_LIBS)
diff -Nur cvmfs-2.0.19.orig/Makefile.am cvmfs-2.0.19/Makefile.am
--- cvmfs-2.0.19.orig/Makefile.am 2012-02-07 17:04:54.000000000 +0000
+++ cvmfs-2.0.19/Makefile.am 2012-10-30 11:00:26.000000000 +0000
@@ -10,10 +10,13 @@
if ! SYSTEM_ZLIB
SUBDIR_ZLIB = zlib
endif
+if ! SYSTEM_JEMALLOC
+ SUBDIR_JEMALLOC = jemalloc
+endif
if BUILD_KMODULE
SUBDIR_KMODULE = kernel
endif
-SUBDIRS = $(SUBDIR_KMODULE) $(SUBDIR_SQLITE3) $(SUBDIR_ZLIB) $(SUBDIR_LIBCURL) $(SUBDIR_LIBFUSE) jemalloc cvmfs cvmfsd mount replica
+SUBDIRS = $(SUBDIR_KMODULE) $(SUBDIR_SQLITE3) $(SUBDIR_ZLIB) $(SUBDIR_LIBCURL) $(SUBDIR_LIBFUSE) $(SUBDIR_JEMALLOC) cvmfs cvmfsd mount replica
EXTRA_DIST = sign-whitelist add-ons rpm doc c-ares libcurl libfuse kernel jemalloc zlib mount replica
docdir = ${datadir}/doc/${PACKAGE}-${VERSION}
dist_doc_DATA = NEWS README ChangeLog AUTHORS INSTALL COPYING FAQ
|