X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=build%2FMakebottom;h=7ada9532c044e65957214809cf660050d15bb62c;hb=0053f1a862cd0c2f359a4d12f0fdd35b17d18906;hp=35229a6d31be75c178e54a2933b4eea629f101cb;hpb=5885a915fd709d3d1b6559a81145b9fe3aade4d0;p=libucw.git diff --git a/build/Makebottom b/build/Makebottom index 35229a6d..7ada9532 100644 --- a/build/Makebottom +++ b/build/Makebottom @@ -42,7 +42,7 @@ force: # Rules for configuration files -run/$(CONFIG_DIR)/%: $(s)/$(CONFIG_DIR)/% $(o)/config.mk $(BUILDSYS)/genconf +run/$(CONFIG_DIR)/%: $(s)/$(CONFIG_SRC_DIR)/% $(o)/config.mk $(BUILDSYS)/genconf $(M)CF $< $(Q)$(BUILDSYS)/genconf $< $@ $(o)/config.mk @@ -63,10 +63,19 @@ endif %.so: $(M)LD $@ - $(Q)$(CC) $(LSHARED) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(BUILDSYS)/lib-flags $^) $(LIBS) + $(Q)$(CC) $(LSHARED) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" PKG_CONFIG_OPTS="$(PKG_CONFIG_OPTS)" $(BUILDSYS)/lib-flags $^) $(LIBS) $(Q)$(call symlink-alias,$@,run/$(SO_RUNDIR),$(*F)$(SONAME_INFIX).so$(SONAME_SUFFIX)) + $(Q)ln -fs $(*F)$(SONAME_INFIX).so$(SONAME_SUFFIX) run/$(SO_RUNDIR)/$(*F)$(SONAME_INFIX).so -$(o)/%.pc: $(s)/%.pc $(o)/%.$(LS) +# On Darwin, gcc expects shared libraries in *.dylib instead of *.so. +# Surprisingly, when a program is run, it suffices to have *.so files. +# We don't want to mess up the whole build system with configurable +# suffices and we also don't want to incur an overhead on Linux, so we +# just create symbolic links on Darwin, if requested. +%.dylib: %.so + cd $(dir $<) && ln -fs $(notdir $<) $(notdir $@) + +$(o)/%.pc: $(s)/%.pc $(o)/%$(LV).$(LS) $(M)PC $< $(Q)DEPS="$(shell $(BUILDSYS)/lib-deps $^)" LIBDIR=$(@D) $(BUILDSYS)/genconf $< $@ $(o)/config.mk $(Q)mkdir -p $(o)/pkgconfig @@ -134,7 +143,7 @@ $(o)/%-tt.o: $(s)/%.c $(o)/autoconf.h $(o)/%-t: $(o)/%-tt.o $(TESTING_DEPS) $(M)LD-TEST $@ - $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(BUILDSYS)/lib-flags $^) $(LIBS) + $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" PKG_CONFIG_OPTS="$(PKG_CONFIG_OPTS)" $(BUILDSYS)/lib-flags $^) $(LIBS) $(o)/%.test: $(s)/%.t $(BUILDSYS)/tester $(M)TEST $@ @@ -146,7 +155,7 @@ BINDIR=bin $(o)/%: $(o)/%.o $(M)LD $@ - $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(BUILDSYS)/lib-flags $^) $(LIBS) + $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" PKG_CONFIG_OPTS="$(PKG_CONFIG_OPTS)" $(BUILDSYS)/lib-flags $^) $(LIBS) $(Q)$(call symlink,$@,run/$(BINDIR)) $(o)/%: $(s)/%.sh $(o)/config.mk $(BUILDSYS)/genconf