Author: Ole Streicher Description: Dynamically link to libastrometry.so, when possible --- a/blind/Makefile +++ b/blind/Makefile @@ -43,9 +43,7 @@ LDLIBS := $(LDLIBS_DEF) LDLIBS += $(ANFILES_LIB) -SLIB := $(ENGINE_LIB) -SLIB += $(CATS_SLIB) -SLIB += $(ANFILES_SLIB) +SLIB := $(ENGINE_SO) CAIRO_SLIB := $(COMMON)/cairoutils.o CAIRO_SLIB += $(SLIB) @@ -131,7 +129,7 @@ resort-xylist.o BUILD_INDEX_OBJS := build-index.o uniformize-catalog.o startree2.o hpquads.o \ - quad-builder.o quad-utils.o codefile.o codetree.o unpermute-stars.o \ + quad-builder.o codefile.o codetree.o unpermute-stars.o \ unpermute-quads.o merge-index.o ENGINE_OBJS += $(BUILD_INDEX_OBJS) @@ -147,8 +145,8 @@ $(AR) rc $@ $(ENGINE_OBJS) $(RANLIB) $@ -$(ENGINE_SO): $(ENGINE_OBJS) $(SLIB) - $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 $^ $(LDLIBS) +$(ENGINE_SO): $(ENGINE_LIB) $(CATS_SLIB) $(ANFILES_SLIB) + $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 -Wl,--whole-archive $^ -Wl,--no-whole-archive $(LDLIBS) -lpthread ln -s $@.0 $@ # old and miscellaneous executables that aren't part of the pipeline. --- a/util/Makefile +++ b/util/Makefile @@ -86,8 +86,7 @@ LDFLAGS += $(LDFLAGS_DEF) -LDLIBS := $(LDLIBS_DEF) -LDLIBS += $(ANFILES_LIB) +LDLIBS := $(LDLIBS_DEF) -lm SHAREDLIBFLAGS := $(SHAREDLIBFLAGS_DEF) @@ -122,8 +121,7 @@ ANUTILS_H_PATH := $(addprefix $(INCLUDE_DIR)/,$(ANUTILS_H)) ifndef NO_QFITS -ANUTILS_OBJ += fitsioutils.o sip_qfits.o fitstable.o fitsbin.o fitsfile.o \ - tic.o +ANUTILS_OBJ += fitsioutils.o sip_qfits.o fitstable.o fitsbin.o fitsfile.o ANUTILS_DEPS += $(QFITS_LIB) endif @@ -164,7 +162,7 @@ ALL_OBJ += wcs-pv2sip.o _util$(PYTHON_SO_EXT): util.i lanczos.i $(ANFILES_SLIB) - LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" SLIB="$(ANFILES_SLIB)" \ + LDFLAGS="$(LDFLAGS)" LDLIBS="-L../blind -lastrometry" \ INC="$(ANFILES_INC)" CFLAGS="$(CFLAGS)" \ python setup.py build_ext -v --inplace --build-temp . util.py: util.i lanczos.i --- a/libkd/Makefile +++ b/libkd/Makefile @@ -90,8 +90,7 @@ PYSPHEREMATCH_OBJ := pyspherematch.o spherematch_c$(PYTHON_SO_EXT): pyspherematch.c setup.py $(SLIB) - LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" \ - SLIB="$(SLIB)" \ + LDFLAGS="$(LDFLAGS)" LDLIBS="-L../blind -lastrometry" \ INC="$(INC)" \ CFLAGS="$(CFLAGS)" \ python setup.py build_ext --inplace --force --build-temp .