add pet_expr_map_op
[pet.git] / configure.ac
blob91e8eae3bc6ac525aa39ff21255f20407e24429c
1 AC_INIT([pet], [0.08], [isl-development@googlegroups.com])
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])])
6 AC_SUBST(versioninfo)
7 versioninfo=8:0:0
9 AC_PROG_CC
10 AC_PROG_CXX
11 AC_PROG_GREP
12 AC_PROG_LIBTOOL
13 AC_PROG_SED
15 AX_DETECT_CLANG
17 AX_SUBMODULE(isl,build|bundled|system,bundled)
18 AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
20 AC_SUBST(ISL_CFLAGS)
21 AC_SUBST(ISL_LIBS)
22 AC_SUBST(ISL_SRCDIR)
23 AC_SUBST(ISL_BUILDDIR)
24 case "$with_isl" in
25 bundled)
26         ISL_CFLAGS="-I\$(top_srcdir)/isl/include -I\$(top_builddir)/isl/include"
27         ISL_CFLAGS="$ISL_CFLAGS"
28         ISL_SRCDIR="$srcdir/isl"
29         ISL_BUILDDIR=isl
30         ;;
31 build)
32         ISL_SRCDIR="$isl_srcdir"
33         ISL_BUILDDIR=`echo @abs_builddir@ | $with_isl_builddir/config.status --file=-`
34         ISL_CFLAGS="-I$isl_srcdir/include -I$ISL_BUILDDIR/include"
35         ISL_CFLAGS="$ISL_CFLAGS"
36         ISL_LIBS="$with_isl_builddir/libisl.la"
37         ;;
38 system)
39         PKG_CHECK_MODULES([ISL], [isl])
40         PACKAGE_CFLAGS_ISL="$ISL_CFLAGS"
41 esac
43 AX_SUBMODULE(libyaml,system|no,system)
44 AC_SUBST(LIBYAML_CPPFLAGS)
45 AC_SUBST(LIBYAML_LDFLAGS)
46 if test "x$with_libyaml_prefix" != "x"; then
47         LIBYAML_CPPFLAGS="-I$with_libyaml_prefix/include"
49 if test "x$with_libyaml_exec_prefix" != "x"; then
50         LIBYAML_LDFLAGS="-L$with_libyaml_exec_prefix/lib"
53 if test "$with_libyaml" = "system"; then
54         SAVE_CPPFLAGS=$CPPFLAGS
55         CPPFLAGS="$CPPFLAGS $LIBYAML_CPPFLAGS"
56         AC_CHECK_HEADER([yaml.h],[],[with_libyaml="no"])
57         CPPFLAGS="$SAVE_CPPFLAGS"
60 AC_SUBST(extra_bin_programs)
61 AC_SUBST(extra_noinst_programs)
62 AC_SUBST(extra_tests)
64 if test "$with_libyaml" != "no"; then
65         extra_bin_programs="pet"
66         extra_noinst_programs="pet_scop_cmp"
67         extra_tests="pet_test.sh"
69 if test "$with_isl" != "system"; then
70         extra_tests="$extra_tests codegen_test.sh"
73 PACKAGE_CFLAGS="$PACKAGE_CFLAGS_ISL"
74 PACKAGE_LIBS="-lpet -lisl"
75 AX_CREATE_PKGCONFIG_INFO
77 AX_DETECT_GIT_HEAD
79 AC_CONFIG_HEADERS(config.h)
80 AC_CONFIG_FILES(Makefile)
81 AC_CONFIG_FILES([pet_test.sh], [chmod +x pet_test.sh])
82 AC_CONFIG_FILES([codegen_test.sh], [chmod +x codegen_test.sh])
83 if test $with_isl = bundled; then
84         AC_CONFIG_SUBDIRS(isl)
86 AC_CONFIG_COMMANDS_POST([
87         dnl pass on arguments to subdir configures, but don't
88         dnl add them to config.status
89         ac_configure_args="$ac_configure_args --with-clang=system"
91 AC_OUTPUT