%.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))
# On Darwin, gcc expects shared libraries in *.dylib instead of *.so.
$(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 $@
$(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
ifdef CONFIG_SHARED
LS=$(DYNAMIC_LIBRARIES)
OS=oo
+PKG_CONFIG_OPTS=
else
LS=a
OS=o
+PKG_CONFIG_OPTS=--static
endif
LV=$(UCW_ABI_SUFFIX)
done
if [ -n "$PC" ] ; then
echo -n " "
- PKG_CONFIG_PATH="$PKG_CONFIG_PATH:obj/pkgconfig" pkg-config --libs $PC
+ PKG_CONFIG_PATH="$PKG_CONFIG_PATH:obj/pkgconfig" pkg-config $PKG_CONFIG_OPTS --libs $PC
fi
LIBIMAGES_CONFIGS+=images
LIBIMAGES_MODS=math config context image scale color io-main
LIBIMAGES_INCLUDES=images.h error.h color.h math.h
-export LIBIMAGES_LIBS=
+export LIBIMAGES_LIBS=-lm
ifdef CONFIG_SHERLOCK
LIBIMAGES_MODS+=object
$(o)/images/libucw-images$(LV)-pic.a: $(addsuffix .oo,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
$(o)/images/libucw-images$(LV).so: $(addsuffix .oo,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
$(o)/images/libucw-images$(LV).so: SONAME_SUFFIX=.$(UCW_ABI_MAJOR)
+$(o)/images/libucw-images$(LV).so: LIBS+=$(LIBIMAGES_LIBS)
$(o)/images/libucw-images.pc: $(LIBIMAGES_DEPS)
$(o)/images/ucw-image-tool: $(o)/images/ucw-image-tool.o $(LIBIMAGES)
Description: UCW image library
Version: @UCW_VERSION@
Cflags: -I${incdir}
-Libs: -L${libdir} -lucw-images@UCW_ABI_SUFFIX@${picsuffix} -lm -lpthread @LIBIMAGES_LIBS@
+Libs: -L${libdir} -lucw-images@UCW_ABI_SUFFIX@${picsuffix}
+Libs.private: @LIBIMAGES_LIBS@
Requires: @DEPS@
LIBUCW_MOD_PATHS=$(addprefix $(o)/ucw/,$(LIBUCW_MODS))
+export LIBUCW_LIBS=
+#ifdef CONFIG_UCW_THREADS
+LIBUCW_LIBS+=-lpthread
+#endif
+#ifdef CONFIG_UCW_PCRE
+LIBUCW_LIBS+=-lpcre
+#endif
+#ifdef CONFIG_UCW_MONOTONIC_CLOCK
+LIBUCW_LIBS+=-lrt
+#endif
+
$(o)/ucw/libucw$(LV).a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
$(o)/ucw/libucw$(LV)-pic.a: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
$(o)/ucw/libucw$(LV).so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
$(o)/ucw/libucw$(LV).so: SONAME_SUFFIX=.$(UCW_ABI_MAJOR)
+$(o)/ucw/libucw$(LV).so: LIBS+=$(LIBUCW_LIBS)
ifdef CONFIG_STATIC_PIC
$(o)/ucw/libucw.pc: $(o)/ucw/libucw$(LV)-pic.a
libdir=@LIBDIR@
incdir=.
-#ifdef CONFIG_UCW_THREADS
-threads=-lpthread
-#else
-threads=
-#endif
-
-#ifdef CONFIG_UCW_PCRE
-regex=-lpcre
-#else
-regex=
-#endif
-
-#ifdef CONFIG_UCW_MONOTONIC_CLOCK
-rt=-lrt
-#else
-rt=
-#endif
-
# Override if you want to use the -pic version
picsuffix=
Description: A library of utility functions and data structures
Version: @UCW_VERSION@
Cflags: -I${incdir}
-Libs: -L${libdir} -lucw@UCW_ABI_SUFFIX@${picsuffix} ${threads} ${regex} ${rt}
+Libs: -L${libdir} -lucw@UCW_ABI_SUFFIX@${picsuffix}
+Libs.private: @LIBUCW_LIBS@