initial version of pet
[pet.git] / configure.ac
blob4a407290aa38cbcc3a18ff019d97193e76a03d6d
1 AC_INIT([pet], [0.00])
2 AC_CONFIG_AUX_DIR([build-aux])
3 AC_CONFIG_MACRO_DIR([m4])
4 AM_INIT_AUTOMAKE([foreign])
5 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
7 AC_PROG_CC
8 AC_PROG_CXX
9 AC_PROG_LIBTOOL
11 AC_SUBST(CLANG_CXXFLAGS)
12 AC_SUBST(CLANG_LDFLAGS)
13 AC_SUBST(CLANG_LIBS)
14 AX_SUBMODULE(clang,system,system)
15 llvm_config="llvm-config"
16 if test "x$with_clang_prefix" != "x"; then
17         llvm_config="$with_clang_prefix/bin/llvm-config"
19 CLANG_CXXFLAGS=`$llvm_config --cxxflags`
20 CLANG_LDFLAGS=`$llvm_config --ldflags`
21 CLANG_LIBS=`$llvm_config --libs`
22 CLANG_PREFIX=`$llvm_config --prefix`
23 AC_DEFINE_UNQUOTED(CLANG_PREFIX, ["$CLANG_PREFIX"], [Clang installation prefix])
25 AX_SUBMODULE(isl,build|bundled|system,bundled)
26 AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
28 AC_SUBST(ISL_CFLAGS)
29 AC_SUBST(ISL_LIBS)
30 case "$with_isl" in
31 bundled)
32         ISL_CFLAGS="-I\$(top_srcdir)/isl/include -I\$(top_builddir)/isl/include"
33         ;;
34 build)
35         ISL_BUILDDIR=`echo @abs_builddir@ | $with_isl_builddir/config.status --file=-`
36         ISL_CFLAGS="-I$isl_srcdir/include -I$ISL_BUILDDIR/include"
37         ISL_LIBS="$with_isl_builddir/libisl.la"
38         ;;
39 system)
40         PKG_CHECK_MODULES([ISL], [isl])
41         PACKAGE_CFLAGS_ISL="$ISL_CFLAGS"
42 esac
44 AX_SUBMODULE(libyaml,system,system)
45 AC_SUBST(LIBYAML_CPPFLAGS)
46 AC_SUBST(LIBYAML_LDFLAGS)
47 if test "x$with_libyaml_prefix" != "x"; then
48         LIBYAML_CPPFLAGS="-I$with_libyaml_prefix/include"
50 if test "x$with_libyaml_exec_prefix" != "x"; then
51         LIBYAML_LDFLAGS="-L$with_libyaml_exec_prefix/lib"
54 PACKAGE_CFLAGS="$PACKAGE_CFLAGS_ISL"
55 PACKAGE_LIBS="-lpet -lisl"
56 AX_CREATE_PKGCONFIG_INFO
58 AC_CONFIG_HEADERS(config.h)
59 AC_CONFIG_FILES(Makefile)
60 AC_CONFIG_FILES([pet_test.sh], [chmod +x pet_test.sh])
61 if test $with_isl = bundled; then
62         AC_CONFIG_SUBDIRS(isl)
64 AC_OUTPUT