diff --git a/configure.ac b/configure.ac index f5c8d7924..051055d35 100644 --- a/configure.ac +++ b/configure.ac @@ -984,6 +984,13 @@ dnl AC_SUBST_DIR([bindir]) RB_DEFINE_UNQUOTED([BIN_DIR], ["$bindir"], [Directory where binary executables are to be found.]) +dnl +dnl includedir +dnl + +AC_SUBST_DIR([includedir]) +RB_DEFINE_UNQUOTED([INCLUDE_DIR], ["$includedir"], [Prefix where headers are installed.]) + dnl dnl libdir dnl diff --git a/include/ircd/Makefile.am b/include/ircd/Makefile.am index f7540bd03..5b6bb66cd 100644 --- a/include/ircd/Makefile.am +++ b/include/ircd/Makefile.am @@ -50,6 +50,8 @@ endif DEPS = *.h */*.h */*/*.h */*/*/*.h +# includedir = @includedir@/$(PACKAGE_TARNAME) +includedir = @includedir@/ircd nobase_include_HEADERS = $(DEPS) noinst_HEADERS = *.gch @@ -69,3 +71,18 @@ clean-local: rm -f ircd.pic.h.gch rm -f spirit.h.gch rm -f *.gch.tmp + +install-mkdirs: $(DEPS) spirit.h.gch ircd.pic.h.gch ircd.h.gch + -@if test ! -d $(DESTDIR)$(includedir); then \ + echo "mkdir -p $(DESTDIR)$(includedir)"; \ + mkdir -p $(DESTDIR)$(includedir); \ + fi + +install: install-mkdirs + @echo "ircd: installing headers" + @for i in $(srcdir)/*; do \ + if [[ "$$i" != "./Makefile"* ]] && [[ "$$i" != *.h.gch ]]; then \ + echo "installing $$i to $(DESTDIR)$(includedir)"; \ + cp -r $$i $(DESTDIR)$(includedir); \ + fi \ + done