README: add a note about additional variables in the generated code
[ppcg.git] / configure.ac
blob53d766be9ca752e3b70c553f9cb54e0bc53853d2
1 AC_INIT([ppcg], [0.01], [isl-development@googlegroups.com])
2 AC_CONFIG_AUX_DIR([.])
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_LIBTOOL
9 PKG_PROG_PKG_CONFIG
11 AX_CHECK_OPENCL
13 AX_SUBMODULE(isl,build|bundled|system,bundled)
14 AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
16 AC_SUBST(ISL_CFLAGS)
17 AC_SUBST(ISL_LIBS)
18 case "$with_isl" in
19 bundled)
20         ISL_CFLAGS="-I\$(top_srcdir)/isl/include -I\$(top_builddir)/isl/include"
21         ISL_CFLAGS="$ISL_CFLAGS"
22         ppcg_configure_args="$ppcg_configure_args --with-isl-builddir=../isl"
23         ppcg_configure_args="$ppcg_configure_args --with-isl=build"
24         ;;
25 build)
26         ISL_BUILDDIR=`echo @abs_builddir@ | $with_isl_builddir/config.status --file=-`
27         ppcg_configure_args="$ppcg_configure_args --with-isl-builddir=$ISL_BUILDDIR"
28         ISL_CFLAGS="-I$isl_srcdir/include -I$ISL_BUILDDIR/include"
29         ISL_CFLAGS="$ISL_CFLAGS"
30         ISL_LIBS="$with_isl_builddir/libisl.la"
31         ;;
32 system)
33         PKG_CHECK_MODULES([ISL], [isl])
34 esac
36 AX_SUBMODULE(pet,bundled|system,bundled)
37 AM_CONDITIONAL(BUNDLED_PET, test $with_pet = bundled)
39 AC_SUBST(PET_CFLAGS)
40 AC_SUBST(PET_LIBS)
41 case "$with_pet" in
42 bundled)
43         PET_CFLAGS="$PET_CFLAGS -I\$(top_srcdir)/pet/include"
44         ;;
45 system)
46         PKG_CHECK_MODULES([PET], [pet])
47         ;;
48 esac
50 AC_SUBST(POLYBENCH_DIR)
51 AC_SUBST(extra_tests)
52 AC_ARG_WITH([polybench],
53         [AS_HELP_STRING([--with-polybench=DIR], [PolyBench location])],
54         [
55         if test -f "$with_polybench/utilities/benchmark_list"; then
56                 POLYBENCH_DIR=$with_polybench
57                 extra_tests="$extra_tests polybench_test.sh"
58         fi
59         ])
61 AX_DETECT_GIT_HEAD
62 echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > gitversion.h
64 AC_CONFIG_FILES(Makefile)
65 AC_CONFIG_FILES([polybench_test.sh], [chmod +x polybench_test.sh])
66 if test $with_isl = bundled; then
67         AC_CONFIG_SUBDIRS(isl)
69 if test $with_pet = bundled; then
70         AC_CONFIG_SUBDIRS(pet)
72 AC_CONFIG_COMMANDS_POST([
73         dnl pass on arguments to subdir configures, but don't
74         dnl add them to config.status
75         ac_configure_args="$ac_configure_args $ppcg_configure_args"
77 AC_OUTPUT