From ae045e63eebc1d37aeba01a0cc3430eafdbb9117 Mon Sep 17 00:00:00 2001 From: Claus-Justus Heine <Claus-Justus.Heine@IANS.Uni-Stuttgart.DE> Date: Thu, 18 Nov 2010 15:45:16 +0000 Subject: [PATCH] Change the standard include stuff from `#include <alberta.h>' to `#include <alberta/alberta.h>' --- Makefile.am | 3 +++ configure.ac | 31 +++++++++++++++++-------------- install-pkgheader.sh | 23 +++++++++++++++++++++++ m4/grapeiface.m4 | 5 +---- 4 files changed, 44 insertions(+), 18 deletions(-) create mode 100755 install-pkgheader.sh diff --git a/Makefile.am b/Makefile.am index db958c6..ddbf06b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -63,11 +63,14 @@ clean-local: -rm -rf $(DEMO) -rm -f $(DEMO).tar.gz +# Make sure distclean remove all configure-generated stuff, otherwise +# "make distcheck" would fail. distclean-local: if ! test "$(srcdir)" = "."; then\ chmod -R u+rwX demo;\ rm -rf demo;\ fi + rm -rf include rm -f libtool.@PACKAGE@-@VERSION@ diff --git a/configure.ac b/configure.ac index 114fcec..9135b38 100644 --- a/configure.ac +++ b/configure.ac @@ -10,6 +10,7 @@ AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET +AS_SHELL_SANITIZE AS_CASE([${target}],[*apple-darwin*],[OSX=true],[OSX=false]) AM_INIT_AUTOMAKE([1.10 dist-bzip2 tar-pax]) @@ -95,18 +96,19 @@ else fi], [BITS=$(( ${ac_cv_sizeof_long} * 8 ))]) -dnl AC_CONFIG_COMMANDS([dof_stride_free_bit.h], -dnl [: ${TMPDIR=/tmp} -dnl TARGET_NEW=${TMPDIR}/dof_stride_free_bit.h -dnl TARGET=alberta/src/Common/dof_stride_free_bit.h -dnl ${SHELL} ${srcdir}/mkdoffreemasks.sh ${BITS} ${BITS} > ${TARGET_NEW} -dnl if test -f ${TARGET} && cmp ${TARGET} ${TARGET_NEW} > /dev/null 2>&1 ; then -dnl AC_MSG_NOTICE([${TARGET} is unchanged]) -dnl else -dnl AC_MSG_NOTICE([Creating ${TARGET}]) -dnl mv -f ${TARGET_NEW} ${TARGET} -dnl fi], -dnl [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= @@ -248,7 +250,8 @@ AC_PROG_CPP AC_C_INLINE AC_PROG_CPP AC_PROG_CXX -AC_PATH_PROG([CPP], [cpp], [], [/usr/bin:/lib:$PATH]) +#AC_PATH_PROG([CPP], [cpp], [], [/usr/bin:/lib:$PATH]) +AC_PATH_PROG([CPP], [cpp]) AC_DEFINE_UNQUOTED([CPP],["$CPP"],["Command which runs the C preprecessor"]) # @@ -637,7 +640,7 @@ else fi AC_SUBST([USE_LIBBLAS]) ALBERTA_CHECK_PACKAGE([gpskca],[gpskca], - [${GPSKCA_F77_FUNC}],[],[${FLIBS}],[],[],[],[optional enabled]) + ${GPSKCA_F77_FUNC},[],[${FLIBS}],[],[],[],[optional enabled]) # # Only support linking with fortran stuff if needed. diff --git a/install-pkgheader.sh b/install-pkgheader.sh new file mode 100755 index 0000000..e15f3c6 --- /dev/null +++ b/install-pkgheader.sh @@ -0,0 +1,23 @@ +#! /bin/sh +# +# invocation with +# +# SCRIPT SRC DST +# + +SOURCES="" +while test "$#" != "1" +do + SRC="$1" + DIR=`dirname "${SRC}"` + SRC=`basename "${SRC}"` + DIR=`cd "${DIR}"; pwd` + SOURCES="${SOURCES} ${DIR}/${SRC}" + shift +done + +DST="$1" + +ln -s ${SOURCES} "${DST}" + + diff --git a/m4/grapeiface.m4 b/m4/grapeiface.m4 index e092e99..60bc08f 100644 --- a/m4/grapeiface.m4 +++ b/m4/grapeiface.m4 @@ -8,10 +8,7 @@ dnl ALBERTA_CHECK_PACKAGE([grape],[gr],[grape],[],[${OPENGL_ALL_LIBS}], [grape.h],[],[],[optional]) ALBERTA_LIB_PATHS='$prefix/lib' -ALBERTA_ALL_INCLUDES='-I$(top_srcdir)/alberta/src/Common/ -I$(top_srcdir)/alberta_util/src/ -I$(top_builddir)/alberta_util/src/' -if test ! "x${ac_cv_func_obstack}" = "xyes" || [test "x${NEED_GETOPT}" = "x1"]; then - ALBERTA_ALL_INCLUDES="${ALBERTA_ALL_INCLUDES} "'-I$(top_srcdir)/gnu-compat/' -fi +ALBERTA_ALL_INCLUDES='-I${top_builddir}/include -I${top_builddir}/include/alberta' # # ordinary libraries -- GitLab