From 8d60e7b0f0b463d9d4e07eb243fe32fb02a99ddf Mon Sep 17 00:00:00 2001
From: Claus-Justus Heine <Claus-Justus.Heine@IANS.Uni-Stuttgart.DE>
Date: Thu, 18 Nov 2010 17:12:14 +0000
Subject: [PATCH] Distcheck might run now, maybe ...

---
 Makefile.am          |  3 ++-
 configure.ac         | 34 ++++++++++++++++++++--------------
 install-pkgheader.sh |  2 +-
 3 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ddbf06b..4d03eb0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,8 @@ SUBDIRS = gnu-compat alberta_util alberta add_ons
 ACLOCAL_AMFLAGS  = -I m4
 
 EXTRA_DIST = gen-assemble-fcts.sh mkdoffreemasks.sh\
- Makefile.am.template generate-alberta-automakefiles.sh
+ Makefile.am.template generate-alberta-automakefiles.sh\
+ install-pkgheader.sh
 
 #
 # install the libtool-script in the libexecdir s.t. Makefile.alberta
diff --git a/configure.ac b/configure.ac
index 9135b38..8c11433 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,20 +96,6 @@ else
 fi],
 [BITS=$(( ${ac_cv_sizeof_long} * 8 ))])
 
-AC_CONFIG_COMMANDS([packageheaders],
-[${RM} -r include
-for m in `find . -name Makefile`
-do
-	AS_IF(
-	   [${FGREP} -q nodist_pkginclude_HEADERS ${m}],
-	      [d=`AS_DIRNAME(["${m}"])`
-	      ${MAKE-make} -C "${d}" INSTALL_HEADER="${ac_top_srcdir}/install-pkgheader.sh" includedir="${ac_abs_top_builddir}/include" install-nodist_pkgincludeHEADERS],
-	   [${FGREP} -q pkginclude_HEADERS ${m}],
-	      [d=`AS_DIRNAME(["${m}"])`
-	      ${MAKE-make} -C "${d}" INSTALL_HEADER="${ac_top_srcdir}/install-pkgheader.sh" includedir="${ac_abs_top_builddir}/include" install-pkgincludeHEADERS],
-           [])
-done])
-
 # Collect the demo programs
 DEMOSOURCES=
 escsrcdir="`echo ${srcdir}|sed -e 's|\.|\\\\.|g'`"
@@ -827,6 +813,26 @@ if test "z${EXPERIMENTAL}" = "z1"; then
   AC_MSG_RESULT([])
 fi
 
+#
+# Should come last to make sure we can already use the Makefiles.
+#
+AC_CONFIG_COMMANDS([packageheaders],
+#AC_CONFIG_COMMANDS_POST(
+[${RM} -rf include
+for m in `find . -name Makefile`
+do
+#	my_top_srcdir=`cd ${srcdir}; pwd`
+#	my_top_builddir=`pwd`
+	AS_IF(
+	   [${FGREP} -q nodist_pkginclude_HEADERS ${m}],
+	      [d=`AS_DIRNAME(["${m}"])`
+	      ${MAKE-make} -C "${d}" INSTALL_HEADER="${ac_abs_top_srcdir}/install-pkgheader.sh" includedir="${ac_abs_top_builddir}/include" install-nodist_pkgincludeHEADERS],
+	   [${FGREP} -q pkginclude_HEADERS ${m}],
+	      [d=`AS_DIRNAME(["${m}"])`
+	      ${MAKE-make} -C "${d}" INSTALL_HEADER="${ac_abs_top_srcdir}/install-pkgheader.sh" includedir="${ac_abs_top_builddir}/include" install-pkgincludeHEADERS],
+           [])
+done])
+
 #
 # flush everything to disk
 #
diff --git a/install-pkgheader.sh b/install-pkgheader.sh
index e15f3c6..c3ab230 100755
--- a/install-pkgheader.sh
+++ b/install-pkgheader.sh
@@ -18,6 +18,6 @@ done
 
 DST="$1"
 
-ln -s ${SOURCES} "${DST}"
+ln -sf ${SOURCES} "${DST}"
 
 
-- 
GitLab