summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildlib/defaults.mak5
-rw-r--r--buildlib/environment.mak.in9
-rw-r--r--buildlib/library.mak7
3 files changed, 17 insertions, 4 deletions
diff --git a/buildlib/defaults.mak b/buildlib/defaults.mak
index 17a6b8ac8..47f297cdf 100644
--- a/buildlib/defaults.mak
+++ b/buildlib/defaults.mak
@@ -48,9 +48,11 @@ ifeq ($(words $(BUILDX)),0)
ifeq ($(words $(wildcard *)),0)
error-all/environment.mak:
echo You have a broken version of GNU Make - upgrade.
+ error-out-and-die
else
error-all/environment.mak:
echo Can't find the build directory in $(BUILD_POSSIBLE) -- use BUILD=
+ error-out-and-die
endif
# Force include below to come to the error target
@@ -147,6 +149,7 @@ else
endif
endif
+# Automatic -j support
ifeq ($(NUM_PROCS),1)
PARALLEL_RUN=no
endif
@@ -154,8 +157,8 @@ endif
ifndef PARALLEL_RUN
PARALLEL_RUN=yes
.EXPORT: PARALLEL_RUN
+ # handle recursion
ifneq ($(NUM_PROCS),)
-# handle recursion
MAKEFLAGS += -j $(NUM_PROCS)
endif
endif
diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
index b0b8f185e..6d721c711 100644
--- a/buildlib/environment.mak.in
+++ b/buildlib/environment.mak.in
@@ -35,3 +35,12 @@ PTHREADLIB = @PTHREADLIB@
# Shim Headerfile control
HAVE_C9X = @HAVE_C9X@
HAVE_STATVFS = @HAVE_STATVFS@
+
+# Shared library things
+HOST_OS = @host_os@
+ifeq ($(HOST_OS),linux-gnu)
+ ONLYSHAREDLIBS = yes
+ SONAME_MAGIC=-Wl,-soname -Wl,
+ LFLAGS_SO=
+endif
+
diff --git a/buildlib/library.mak b/buildlib/library.mak
index 54acb6dd4..caf15606b 100644
--- a/buildlib/library.mak
+++ b/buildlib/library.mak
@@ -47,9 +47,10 @@ $(LIB)/lib$(LIBRARY).so: $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR)
$(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS)
-rm -f $(LIB)/lib$($(@F)-LIBRARY).so* 2> /dev/null
echo Building shared library $@
- $(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) -o $@ \
- -Wl,-soname -Wl,$($(@F)-SONAME) -shared $(filter %.opic,$^) \
- $($(@F)-SLIBS)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) $(LFLAGS_SO)\
+ -o $@ $(SONAME_MAGIC)$($(@F)-SONAME) -shared \
+ $(filter %.opic,$^) \
+ $($(@F)-SLIBS)
# Compilation rules
vpath %.cc $(SUBDIRS)