1AROPT = cr
2
3ifdef ELF_SYSTEM
4export_dynamic = -Wl,-export-dynamic
5rpath = -Wl,-R'$(rpathdir)'
6endif
7
8DLSUFFIX = .so
9
10# extra stuff for $(with_temp_install)
11# we need this to get LD_LIBRARY_PATH searched ahead of the compiled-in
12# rpath, if no DT_RUNPATH is present in the executable. The conditions
13# under which DT_RUNPATH are added seem unpredictable, so be safe.
14
15define with_temp_install_extra
16LD_LIBRARY_PATH_RPATH=1
17endef
18
19# Rule for building a shared library from a single .o file
20%.so: %.o
21ifdef ELF_SYSTEM
22	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
23else
24	$(LD) $(LDREL) $(LDOUT) $<.obj -x $<
25	@echo building shared object $@
26	@rm -f $@.pic
27	@${AR} cq $@.pic $<.obj
28	${RANLIB} $@.pic
29	@rm -f $@
30	$(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
31endif
32