- rm "${ED}"/usr/lib/libmissing.la \
- "$(use static-libs || echo "${ED}"/usr/lib/libmissing.a)" || die
+ rm -f "${ED}"/usr/lib/libmissing.la || die
+
+ cd "${ED}/usr/include" || die
+
+ # fix config.h dependency so we can can distribute it without
+ local f
+ for f in $(grep "_GL_INLINE_HEADER_BEGIN" -l *.h */*.h) ; do
+ cat "${T}"/missing-include.h "${f}" > "${f}.new"
+ [[ -s "${f}.new" ]] && mv "${f}.new" "${f}"
+ done
+
+ # modify all header-files so we can disable them and that they won't
+ # clash with gnulib-based packages
+ for f in *.h */*.h ; do
+ sed -i \
+ -e '1i#ifdef DISABLE_LIBMISSING\n# include_next <'"${f}"'>\n#else' \
+ -e '$a#endif /* DISABLE_LIBMISSING */' \
+ -e 's/_GL_/_LIBMISSING_/g' \
+ "${f}" || die
+ done