Skip to content

Commit

Permalink
Autoconfiscated HDF5_SimResults.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Helfrich committed Nov 16, 2007
1 parent 8c5fe87 commit 8bd6a24
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 10 deletions.
98 changes: 98 additions & 0 deletions ac_cppunit.m4
@@ -0,0 +1,98 @@

#
# CHECK_CPPUNIT(MINIMUM-VERSION)
#

AC_DEFUN([CHECK_CPPUNIT], [
min_version=$1
AC_ARG_WITH(cppunit-prefix,
AC_HELP_STRING([--with-cppunit-prefix=PREFIX],
[find CppUnit installed under PREFIX]),
cppunit_prefix="$withval", cppunit_prefix="")
AC_ARG_WITH(cppunit-exec-prefix,
AC_HELP_STRING([--with-cppunit-exec-prefix=EPREFIX],
[the exec prefix where CppUnit binaries were installed]),
cppunit_exec_prefix="$withval", cppunit_exec_prefix="")
if test -n "$cppunit_exec_prefix"; then
AC_PATH_PROG(CPPUNIT_CONFIG_SCRIPT, cppunit-config, no,
"$cppunit_exec_prefix/bin")
else
if test -n "$cppunit_prefix"; then
AC_PATH_PROG(CPPUNIT_CONFIG_SCRIPT, cppunit-config, no,
"$cppunit_prefix/bin")
else
AC_PATH_PROG(CPPUNIT_CONFIG_SCRIPT, cppunit-config, no)
fi
fi
if test "$CPPUNIT_CONFIG_SCRIPT" = "no" ; then
echo "*** CppUnit version $min_version or later is required to build the CppUnit test"
echo "*** suite, but it was not found. Either install the latest CppUnit"
echo "*** (http://cppunit.sourceforge.net/), or"
echo "*** adjust your PATH environment variable or use the --with-cppunit-prefix or"
echo "*** --with-cppunit-exec-prefix options so that the cppunit-config script for"
echo "*** your installation can be found, or don't specify the --enable-cppunit-tests"
echo "*** option."
exit -1
else
#
# Check version
#
AC_MSG_CHECKING(for CppUnit version >= $min_version)
found_lib_version=`$CPPUNIT_CONFIG_SCRIPT --version`
found_major_version=`echo $found_lib_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)[[a-z]]*/\1/'`
found_minor_version=`echo $found_lib_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)[[a-z]]*/\2/'`
found_micro_version=`echo $found_lib_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)[[a-z]]*/\3/'`
min_major_version=`echo "$min_version" | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
min_minor_version=`echo "$min_version" | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
min_micro_version=`echo "$min_version" | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
version_ok=no
if test $found_major_version -gt $min_major_version; then
version_ok=yes
elif test $found_major_version -eq $min_major_version && \
test $found_minor_version -gt $min_minor_version; then
version_ok=yes
elif test $found_major_version -eq $min_major_version && \
test $found_minor_version -eq $min_minor_version && \
test $found_micro_version -ge $min_micro_version; then
version_ok=yes
fi
if test "$version_ok" = "no"; then
AC_MSG_RESULT(no)
echo "*** CppUnit version $min_version or later is required, but an old version"
echo "*** was found ($found_lib_version). Please install the latest CppUnit"
echo "*** (http://cppunit.sourceforge.net/)."
exit -1
else
AC_MSG_RESULT(yes)
fi
#
# Check libs
#
libs_result=`$CPPUNIT_CONFIG_SCRIPT --libs`
if test "x$libs_result" != "x"; then
AC_SUBST(CPPUNIT_LIBS, "$libs_result")
fi
#
# Check includes
#
includes_result=`$CPPUNIT_CONFIG_SCRIPT --cflags`
if test "x$includes_result" != "x"; then
AC_SUBST(CPPUNIT_CFLAGS, "$includes_result")
fi
fi
])

1 change: 1 addition & 0 deletions bootstrap
Expand Up @@ -10,6 +10,7 @@ cat ./ac_numpy.m4 >> ./acinclude.m4
cat ./ac_ctypes.m4 >> ./acinclude.m4
cat ./ac_pyopengl.m4 >> ./acinclude.m4
cat ./ac_pil.m4 >> ./acinclude.m4
cat ./ac_cppunit.m4 >> ./acinclude.m4

aclocal
autoheader
Expand Down
3 changes: 3 additions & 0 deletions cad/plugins/HDF5_SimResults/Makefile.am
@@ -0,0 +1,3 @@

SUBDIRS = src

18 changes: 18 additions & 0 deletions cad/plugins/HDF5_SimResults/src/Makefile.am
@@ -0,0 +1,18 @@

INCLUDES = -I../include

lib_LTLIBRARIES = libHDF5_SimResults.la

#libHDF5_SimReslts_la_CPPFLAGS = @LOG4CPP_CFLAGS@ @NSPR_CFLAGS@ @ZLIB_CFLAGS@
libHDF5_SimResults_la_LIBADD = -lhdf5
libHDF5_SimResults_la_LDFLAGS = -version-info 1:0:0

#nanohiveutildir = $(includedir)/NanoHiveUtil
#nanohiveutil_HEADERS = \
# $(top_builddir)/../include/NanoHiveUtil/CmdLine.h \
# $(top_builddir)/../include/NanoHiveUtil/ZipUnzip/zip.h

libHDF5_SimResults_la_SOURCES = \
HDF5_SimResults.cpp \
SimResultsDataStore.cpp

11 changes: 11 additions & 0 deletions cad/plugins/HDF5_SimResults/src/Testing/Makefile.am
@@ -0,0 +1,11 @@

INCLUDES = -I../../include -I..

bin_PROGRAMS = hdf5CppUnit

hdf5CppUnit_SOURCES = CppUnit.cpp ../HDF5_SimResultsTest.cpp

hdf5CppUnit_CPPFLAGS = @CPPUNIT_CFLAGS@
hdf5CppUnit_LDFLAGS = -L../.libs
hdf5CppUnit_LDADD = @CPPUNIT_LIBS@ -lHDF5_SimResults -lhdf5

2 changes: 1 addition & 1 deletion cad/plugins/Makefile.am
@@ -1,3 +1,3 @@

SUBDIRS = DNA
SUBDIRS = DNA HDF5_SimResults

41 changes: 32 additions & 9 deletions configure.ac
Expand Up @@ -50,7 +50,21 @@ fi
AM_CONDITIONAL([RUN_FREEZEPYTHON], [test -n "$freezepython_prefix"])


#
# Check if we're building the CppUnit tests
#
AC_ARG_ENABLE(cppunit-tests,
AC_HELP_STRING([--enable-cppunit-tests],
[build the CppUnit test suites]))
if test -z "$enable_cppunit_tests"; then
enable_cppunit_tests="no"
fi
AM_CONDITIONAL([ENABLE_CPPUNIT_TESTS], [test "$enable_cppunit_tests" = "yes"])


#
# Checks for libraries.
#
CHECK_FREEZEPYTHON([3.0.3])
CHECK_QT([4.2.3])
CHECK_PYQT([4.2])
Expand All @@ -61,6 +75,12 @@ CHECK_CTYPES([1.0.2])
CHECK_PYOPENGL([3.0.0a6])
CHECK_PIL([1.1.6])

# CppUnit Tests (CppUnit)
if test "$enable_cppunit_tests" = "yes"; then
CHECK_CPPUNIT([1.10.0])
fi


# Checks for header files.
#AC_HEADER_STDC
#AC_CHECK_HEADERS([limits.h stdlib.h string.h sys/time.h unistd.h])
Expand Down Expand Up @@ -90,14 +110,17 @@ CHECK_PIL([1.1.6])
AC_SUBST(UNAME_A, "$(uname -a)")

AC_CONFIG_FILES([Makefile
cad/Makefile
cad/doc/Makefile
cad/src/Makefile
cad/partlib/Makefile
cad/plugins/Makefile
cad/plugins/DNA/Makefile
debian/postinst
sim/Makefile
sim/src/Makefile])
cad/Makefile
cad/doc/Makefile
cad/src/Makefile
cad/partlib/Makefile
cad/plugins/Makefile
cad/plugins/DNA/Makefile
cad/plugins/HDF5_SimResults/Makefile
cad/plugins/HDF5_SimResults/src/Makefile
cad/plugins/HDF5_SimResults/src/Testing/Makefile
debian/postinst
sim/Makefile
sim/src/Makefile])
AC_OUTPUT

2 changes: 2 additions & 0 deletions debian/postinst
Expand Up @@ -22,6 +22,8 @@ case "$1" in
configure)
rm -f /usr/bin/NanoEngineer-1_0.9.2.app/partlib
ln -s /usr/share/NanoEngineer-1_0.9.2/partlib /usr/bin/NanoEngineer-1_0.9.2.app/partlib
echo '#!/bin/sh' > /usr/bin/NanoEngineer-$(PACKAGE_VERSION)
echo /usr/bin/NanoEngineer-$(PACKAGE_VERSION).app/program/NanoEngineer-1 >> /usr/bin/NanoEngineer-$(PACKAGE_VERSION)
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down

0 comments on commit 8bd6a24

Please sign in to comment.