* Makeconfig (soversions.i): New target, input-reading parts of

soversions.mk generation moved here; result is a canonicalized
	list "LIB VERSION [SET]" for this configuration.
	(soversions.mk): Use that as input.  Don't emit map-firstversions.
	* Makerules (version-renames.def): New target, generated from
	soversions.i with contents that was in $(map-firstversions).
	(Versions.all): Don't depend on soversions.mk, depend on
	version-renames.def instead; just cat it into the input.
This commit is contained in:
Roland McGrath 2000-03-19 23:33:48 +00:00
parent 6b3c3a3525
commit ba7e89ec33
3 changed files with 43 additions and 35 deletions

View File

@ -1,5 +1,14 @@
2000-03-19 Roland McGrath <roland@baalperazim.frob.com>
* Makeconfig (soversions.i): New target, input-reading parts of
soversions.mk generation moved here; result is a canonicalized
list "LIB VERSION [SET]" for this configuration.
(soversions.mk): Use that as input. Don't emit map-firstversions.
* Makerules (version-renames.def): New target, generated from
soversions.i with contents that was in $(map-firstversions).
(Versions.all): Don't depend on soversions.mk, depend on
version-renames.def instead; just cat it into the input.
* Makerules (Versions.all): Use $(foreach ...) instead of sh for loop
for $(map-firstversions), which better handles it being empty.

View File

@ -676,36 +676,32 @@ ifeq (yes, $(build-shared))
ifeq ($(sysd-sorted-done),t)
-include $(common-objpfx)soversions.mk
ifndef avoid-generated
$(common-objpfx)soversions.mk: $(..)shlib-versions $(..)Makeconfig \
$(wildcard $(patsubst %, $(..)%/shlib-versions,\
$(add-ons) \
$(subdirs))) \
$(common-objpfx)config.make
(file="$(wildcard $(patsubst %,$(..)%/shlib-versions,$(add-ons))) \
$(wildcard $(patsubst %,$(..)%/shlib-versions,$(subdirs))) \
$(..)shlib-versions"; \
for f in $$file; do \
sed 's/#.*$$//;s/^[ ]*%/#/' $$f \
| $(CC) -include $(common-objpfx)config.h -E -x c - \
| while read conf version setname; do \
test -n "$$version" && \
test `expr '$(config-machine)-$(config-vendor)-$(config-os)' \
: "$$conf"` != 0 || continue; \
lib=`echo $$version | sed 's/=.*$$//'`; \
if eval "test -z \"\$$versioners_lib$$lib\""; then \
eval vers_lib$${lib}=yes; \
number=`echo $$version | sed "s/^.*=//"`; \
case $$number in \
[0-9]*) echo "$$lib.so-version=.$$number"; \
echo "all-sonames+=$$lib.so\$$($$lib.so-version)";;\
*) echo "$$lib.so-version=$$number"; \
echo "all-sonames+=\$$($$lib.so-version)";; \
esac; \
test -z "$$setname" || \
echo "map-firstversions+=$${lib}:$${setname}"; \
fi; \
done; \
done;) > $@T; exit 0
$(common-objpfx)soversions.i: $(..)shlib-versions $(..)Makeconfig \
$(wildcard $(patsubst %, $(..)%/shlib-versions,\
$(add-ons) \
$(subdirs))) \
$(common-objpfx)config.make
sed -e 's/#.*$$//;s/^[ ]*%/#/' \
$(filter-out $(..)Makeconfig $(common-objpfx)config.make,$^) \
| $(CC) -include $(common-objpfx)config.h -E -x c - \
| while read conf version setname; do \
test -n "$$version" && \
test `expr '$(config-machine)-$(config-vendor)-$(config-os)' \
: "$$conf"` != 0 || continue; \
lib=`echo $$version | sed 's/=.*$$//'`; \
number=`echo $$version | sed "s/^.*=//"`; \
echo $$lib $$number $$setname; \
done > $@T; exit 0
mv -f $@T $@
$(common-objpfx)soversions.mk: $(common-objpfx)soversions.i
while read lib number setname; do \
case $$number in \
[0-9]*) echo "$$lib.so-version=.$$number"; \
echo "all-sonames+=$$lib.so\$$($$lib.so-version)";;\
*) echo "$$lib.so-version=$$number"; \
echo "all-sonames+=\$$($$lib.so-version)";;\
esac; \
done < $< > $@T; exit 0
mv -f $@T $@
endif
endif

View File

@ -290,13 +290,16 @@ ifneq ($(sysd-versions-subdirs),$(all-subdirs) $(config-sysdirs))
sysd-versions-force = FORCE
FORCE:
endif
$(common-objpfx)version-renames.def: $(common-objpfx)soversions.i
while read lib version setname; do \
test -z "$$setname" || echo "$$lib : $$setname"; \
done < $< > $@T; exit 0
mv -f $@T $@
$(common-objpfx)Versions.all: $(..)scripts/firstversions.awk \
$(common-objpfx)version-renames.def \
$(..)Versions.def \
$(wildcard $(add-ons:%=$(..)%/Versions.def)) \
$(common-objpfx)soversions.mk
{ $(foreach map,$(map-firstversions),echo '$(subst :, : ,$(map))';) \
cat $(filter-out $< $(common-objpfx)soversions.mk,$^); \
} | LC_ALL=C $(AWK) -f $< > $@T
$(wildcard $(add-ons:%=$(..)%/Versions.def))
cat $(filter-out $<,$^) | LC_ALL=C $(AWK) -f $< > $@T
mv -f $@T $@
$(common-objpfx)sysd-versions: $(common-objpfx)Versions.all \
$(..)scripts/versions.awk \