def get_aclocal_files(d):
    fpath = oe.path.join(d.getVar("S"), "/gettext-tools/m4/Makefile.am")
    with open(fpath) as f:
        content = f.read()
        for l in content.replace("\\\n","").split("\n"):
            if l.startswith("aclocal_DATA"):
                aclocal_files = l.split("=")[1]
                with open(oe.path.join(d.getVar("WORKDIR"),"aclocal-files"),'w') as outf:
                    outf.write(aclocal_files)
                break
        else:
            bb.error("Could not obtain list of installed aclocal files from {}".format(fpath))

get_aclocal_files(d)

