1616
1717PLATFORM := $(shell uname | sed -e 's/_.*//')
1818
19+ ifeq ($(LIBTOOL),rlibtool)
20+ TGTLIBTOOL:=slibtool-shared
21+ endif
22+
1923ifndef LIBTOOL
2024 ifeq ($(PLATFORM), Darwin)
2125 LIBTOOL:=glibtool
2226 else
2327 LIBTOOL:=libtool
2428 endif
29+ TGTLIBTOOL=$(LIBTOOL)
2530endif
2631ifeq ($(PLATFORM), CYGWIN)
2732 NO_UNDEFINED:=-no-undefined
2833endif
29- LTCOMPILE = $(LIBTOOL ) --mode=compile --tag=CC $(CC)
30- INSTALL_CMD = $(LIBTOOL ) --mode=install install
31- UNINSTALL_CMD = $(LIBTOOL ) --mode=uninstall rm
34+ LTCOMPILE = $(TGTLIBTOOL ) --mode=compile --tag=CC $(CC)
35+ INSTALL_CMD = $(TGTLIBTOOL ) --mode=install install
36+ UNINSTALL_CMD = $(TGTLIBTOOL ) --mode=uninstall rm
3237
3338#Output filenames for various targets.
3439ifndef LIBNAME
@@ -49,15 +54,15 @@ src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
4954LOBJECTS = $(OBJECTS:.o=.lo)
5055
5156$(LIBNAME): $(OBJECTS)
52- $(LIBTOOL ) --mode=link --tag=CC $(CC) $(LTC_LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) $(NO_UNDEFINED)
57+ $(TGTLIBTOOL ) --mode=link --tag=CC $(CC) $(LTC_LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) $(NO_UNDEFINED)
5358
5459test: $(call print-help,test,Builds the library and the 'test' application to run all self-tests) $(LIBNAME) $(TOBJECTS)
55- $(LIBTOOL ) --mode=link --tag=CC $(CC) $(LTC_LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS)
60+ $(TGTLIBTOOL ) --mode=link --tag=CC $(CC) $(LTC_LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS)
5661
5762# build the demos from a template
5863define DEMO_template
5964$(1): $(call print-help,$(1),Builds the library and the '$(1)' demo) demos/$(1).o $$(LIBNAME)
60- $$(LIBTOOL ) --mode=link --tag=CC $$(CC) $$(LTC_LDFLAGS) $$^ $$(EXTRALIBS) -o $(1)
65+ $$(TGTLIBTOOL ) --mode=link --tag=CC $$(CC) $$(LTC_LDFLAGS) $$^ $$(EXTRALIBS) -o $(1)
6166endef
6267
6368$(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
0 commit comments