2 # Process this file with autoconf to produce a configure script.
6 AC_INIT(BlackBoxCellML, 0.1, [[ak.miller@auckland.ac.nz]])
8 AC_CONFIG_SRCDIR([sources/BlaBoC/BlaBoCImpl.cpp])
10 AC_CONFIG_HEADER([blaboc_config.h])
12 AM_INIT_AUTOMAKE([-Wno-portability])
15 AC_ARG_WITH(cellml_api,
16 [ --with-cellml_api=/path/to/API Path to the CellML API],
17 [if test -d ${withval}; then
18 if test ! -f ${withval}/libcellml.la; then
19 AC_MSG_ERROR(The path given in --with-cellml-api=$cellml_api doesn't contain a compiled CellML API)
21 CELLML_API_DIR=$withval
23 AC_MSG_ERROR(The path given in --with-cellml-api=$cellml_api doesn't exist or isn't a directory)
24 fi],[AC_MSG_ERROR(You didn't specify the path to the CellML API)])
26 # Checks for programs.
33 AC_LIBLTDL_CONVENIENCE
39 AC_SUBST([LIBTOOL_DEPS])
48 # Checks for typedefs, structures, and compiler characteristics.
53 # Checks for library functions.
56 # Check for size of wchar_t...
57 AC_CHECK_SIZEOF(wchar_t*)
60 [\\/]* | ?:[\\/]* ) # Absolute
65 abssrcdir=`pwd`/$srcdir
66 testdir=`pwd`/$srcdir/tests ;;
70 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*w32*)
71 testdir=`$srcdir/build/cygwin-wrapper echo $testdir`
77 dnl Borrowed from glibc configure.in
78 dnl ===============================================================
79 if test "$GCC" = "yes"; then
80 AC_CACHE_CHECK(for visibility(hidden) attribute,
81 ac_cv_visibility_hidden,
82 [cat > conftest.c <<EOF
83 int foo __attribute__ ((visibility ("hidden"))) = 1;
85 ac_cv_visibility_hidden=no
86 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
87 if grep '\.hidden.*foo' conftest.s >/dev/null; then
88 ac_cv_visibility_hidden=yes
93 if test "$ac_cv_visibility_hidden" = "yes"; then
94 AC_DEFINE([HAVE_VISIBILITY_ATTRIBUTE], [], [Define if gcc visibility attributes supported])
95 VISIBILITY_FLAGS=-fvisibility=hidden
97 EXTRA_OPTIMISATION="-O2 -ffast-math"
100 AM_CXXFLAGS="$AM_CXXFLAGS $VISIBILITY_FLAGS"
102 CXXFLAGS="$CXXFLAGS $EXTRA_OPTIMISATION"
103 CFLAGS="$CFLAGS $EXTRA_OPTIMISATION"
105 # Host specific peculiarities...
109 if test "$with_gnu_ld" = yes; then
110 # Catch unresolved symbols on all platforms, because they will break the
111 # build when we try on Win32.
112 STLLINK="$STLLINK -Wl,--unresolved-symbols=ignore-in-shared-libs"
117 STLLINK=-no-undefined
118 CYGWIN_WRAPPER="${abssrcdir}/build/cygwin-wrapper"
120 *cygwin*|*mks*|*mingw*)
122 *cygwin*|*mks*|*msvc*|*wince|*mingw*)
123 STLLINK="-lstlport.5.0 -no-undefined"
124 CYGWIN_WRAPPER="${abssrcdir}/build/cygwin-wrapper"
127 STLLINK=-no-undefined
132 STLLINK="$STLLINK -lpthread"
137 AC_SUBST([CYGWIN_WRAPPER])
139 AC_SUBST([AM_CXXFLAGS])
140 AC_SUBST([THREADFLAGS])
141 AC_SUBST([CELLML_API_DIR])
143 AC_DEFINE_UNQUOTED(TESTDIR, L"$testdir",
144 [Define TESTDIR to path of test sources.])