Skip to content

Commit 0656ec0

Browse files
committed
Fix build system problems.
Split library build rules up so that parallel building works. Fix autoconf-related dependencies. Remove obsolete JEMALLOC_VERSION definition.
1 parent af36659 commit 0656ec0

6 files changed

Lines changed: 21 additions & 32 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/jemalloc/autom4te.cache/
2-
/jemalloc/cfghdrs.stamp
3-
/jemalloc/cfgoutputs.stamp
2+
/jemalloc/config.stamp
43
/jemalloc/config.log
54
/jemalloc/config.status
65
/jemalloc/configure

jemalloc/Makefile.in

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ all: $(DSOS)
6363
$(CC) $(CFLAGS) -c $(CPPFLAGS) -o $@ $<
6464
@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)"
6565

66-
$(DSOS): $(CSRCS:@srcroot@%.c=@objroot@%.o)
66+
%.so : %.so.$(REV)
6767
@mkdir -p $(@D)
68-
$(CC) -shared -Wl,-soname,libjemalloc@[email protected].$(REV) -o $@ $+ $(LDFLAGS) $(LIBS)
69-
ln -sf libjemalloc@[email protected].$(REV) lib/libjemalloc@[email protected]
70-
ar crus @objroot@lib/libjemalloc@install_suffix@_pic.a $+
68+
ln -sf $(<F) $@
69+
70+
@objroot@lib/libjemalloc@[email protected].$(REV) : $(CSRCS:@srcroot@%.c=@objroot@%.o)
71+
@mkdir -p $(@D)
72+
$(CC) -shared -Wl,-soname,$(@F) -o $@ $+ $(LDFLAGS) $(LIBS)
73+
74+
@objroot@lib/libjemalloc@install_suffix@_pic.a : $(CSRCS:@srcroot@%.c=@objroot@%.o)
75+
@mkdir -p $(@D)
76+
ar crus $@ $+
7177

7278
install_bin:
7379
install -d $(BINDIR)
@@ -128,26 +134,15 @@ ifeq (@enable_autogen@, 1)
128134
@[email protected] : @srcroot@configure
129135
./@[email protected] --recheck
130136

131-
# cfghdrs rules.
132-
133-
echo stamp > @[email protected]
134-
135-
@[email protected] : @cfghdrs_in@ @srcroot@configure
136-
137-
@touch $@
138-
139-
@cfghdrs@ : @[email protected]
140-
141-
# cfgoutputs rules.
142-
143-
echo stamp > @[email protected]
137+
138+
echo stamp > @[email protected]
144139

145-
@objroot@cfgoutputs.stamp : @cfgoutputs_in@ @srcroot@configure
140+
@objroot@config.stamp : @cfgoutputs_in@ @cfghdrs_in@ @srcroot@configure
146141
147142
@touch $@
148143

149144
# There must be some action in order for make to re-read Makefile when it is
150145
# out of date.
151-
@cfgoutputs@ : @objroot@cfgoutputs.stamp
146+
@cfgoutputs_out@ @cfghdrs_out@ : @objroot@config.stamp
152147
@true
153148
endif

jemalloc/cfgoutputs.stamp.in

Whitespace-only changes.

jemalloc/configure.ac

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ AC_ARG_WITH([install_suffix],
263263
install_suffix="$INSTALL_SUFFIX"
264264
AC_SUBST([install_suffix])
265265

266-
cfgoutputs_in="Makefile doc/jemalloc.3.in"
267-
cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc.h.in"
268-
cfgoutputs_in="${cfgoutputs_in} include/jemalloc/internal/jemalloc_internal.h.in"
266+
cfgoutputs_in="${srcroot}Makefile.in ${srcroot}doc/jemalloc.3.in"
267+
cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/jemalloc.h.in"
268+
cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/internal/jemalloc_internal.h.in"
269269

270270
cfgoutputs_out="Makefile doc/jemalloc${install_suffix}.3"
271271
cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc${install_suffix}.h"
@@ -275,7 +275,7 @@ cfgoutputs_tup="Makefile doc/jemalloc${install_suffix}.3:doc/jemalloc.3.in"
275275
cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc${install_suffix}.h:include/jemalloc/jemalloc.h.in"
276276
cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h"
277277

278-
cfghdrs_in="include/jemalloc/jemalloc_defs.h.in"
278+
cfghdrs_in="${srcroot}include/jemalloc/jemalloc_defs.h.in"
279279

280280
cfghdrs_out="include/jemalloc/jemalloc_defs${install_suffix}.h"
281281

@@ -720,11 +720,11 @@ AC_HEADER_STDBOOL
720720
dnl Process .in files.
721721
AC_SUBST([cfghdrs_in])
722722
AC_SUBST([cfghdrs_out])
723-
AC_CONFIG_HEADERS([$cfghdrs_tup cfghdrs.stamp])
723+
AC_CONFIG_HEADERS([$cfghdrs_tup])
724724

725725
dnl ============================================================================
726726
dnl Generate outputs.
727-
AC_CONFIG_FILES([$cfgoutputs_tup cfgoutputs.stamp])
727+
AC_CONFIG_FILES([$cfgoutputs_tup config.stamp])
728728
AC_SUBST([cfgoutputs_in])
729729
AC_SUBST([cfgoutputs_out])
730730
AC_OUTPUT

jemalloc/include/jemalloc/jemalloc_defs.h.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#ifndef JEMALLOC_DEFS_H_
22
#define JEMALLOC_DEFS_H_
33

4-
/*
5-
* jemalloc version string.
6-
*/
7-
#undef JEMALLOC_VERSION
8-
94
/*
105
* If JEMALLOC_PREFIX is defined, it will cause all public APIs to be prefixed.
116
* This makes it possible, with some care, to use multiple allocators

0 commit comments

Comments
 (0)