SLD_FLAVOR := $(S1_RF_FLAVOR)
$(call inc-one,../stdlibdirs.mk)

$(call setup-stamp-file,UFSN_STAMP)
UFSN_LIBNSS_FILES_LINK := libnss_files.so.2
UFSN_LIB_PATH := $(shell for l in $(SLD_LOCATIONS); do if [[ -e $${l}/$(UFSN_LIBNSS_FILES_LINK) ]]; then echo $${l}; break; fi; done)

UFSN_ACI_LIB_PATH := $(S1_RF_ACIROOTFSDIR)$(UFSN_LIB_PATH)

UFSN_LIBNSS_FILES_PATH := $(UFSN_LIB_PATH)/$(UFSN_LIBNSS_FILES_LINK)
UFSN_LIBNSS_FILES_REALPATH := $(shell realpath $(UFSN_LIBNSS_FILES_PATH))
UFSN_LIBNSS_FILES := $(shell basename $(UFSN_LIBNSS_FILES_REALPATH))
UFSN_LIBNSS_FILES_ON_ACI := $(UFSN_ACI_LIB_PATH)/$(UFSN_LIBNSS_FILES)

S1_RF_SECONDARY_STAMPS += $(UFSN_STAMP)
S1_RF_INSTALL_FILES += $(UFSN_LIBNSS_FILES_REALPATH):$(UFSN_LIBNSS_FILES_ON_ACI):-
S1_RF_INSTALL_SYMLINKS += $(UFSN_LIBNSS_FILES):$(UFSN_ACI_LIB_PATH)/$(UFSN_LIBNSS_FILES_LINK)

$(call generate-stamp-rule,$(UFSN_STAMP),$(UFSN_LIBNSS_FILES_ON_ACI),$(UFSN_ACI_LIB_PATH)/$(UFSN_LIBNSS_FILES_LINK))

$(call undefine-namespaces,UFSN)
