allow specification of output file name
[ppcg.git] / configure.ac
blob20f3d5bcc3c55ec391ad7fbc81ca97b263e88cea
1 AC_INIT([ppcg], [0.00])
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
10 AX_SUBMODULE(isl,build|bundled|system,bundled)
11 AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
13 AC_SUBST(ISL_CFLAGS)
14 AC_SUBST(ISL_LIBS)
15 case "$with_isl" in
16 bundled)
17         ISL_CFLAGS="-I\$(top_srcdir)/isl/include -I\$(top_builddir)/isl/include"
18         ppcg_configure_args="$ppcg_configure_args --with-isl-builddir=../isl"
19         ppcg_configure_args="$ppcg_configure_args --with-isl=build"
20         ;;
21 build)
22         ISL_BUILDDIR=`echo @abs_builddir@ | $with_isl_builddir/config.status --file=-`
23         ppcg_configure_args="$ppcg_configure_args --with-isl-builddir=$ISL_BUILDDIR"
24         ISL_CFLAGS="-I$isl_srcdir/include -I$ISL_BUILDDIR/include"
25         ISL_LIBS="$with_isl_builddir/libisl.la -lgmp"
26         ;;
27 system)
28         PKG_CHECK_MODULES([ISL], [isl])
29 esac
31 AX_SUBMODULE(pet,bundled|system,bundled)
32 AM_CONDITIONAL(BUNDLED_PET, test $with_pet = bundled)
34 AC_SUBST(PET_CFLAGS)
35 AC_SUBST(PET_LIBS)
36 case "$with_pet" in
37 bundled)
38         PET_CFLAGS="$PET_CFLAGS -I\$(top_srcdir)/pet/include"
39         ;;
40 system)
41         PKG_CHECK_MODULES([PET], [pet])
42         ;;
43 esac
45 AC_SUBST(POLYBENCH_DIR)
46 AC_SUBST(extra_tests)
47 AC_ARG_WITH([polybench],
48         [AS_HELP_STRING([--with-polybench=DIR], [PolyBench location])],
49         [
50         if test -f "$with_polybench/utilities/benchmark_list"; then
51                 POLYBENCH_DIR=$with_polybench
52                 extra_tests="$extra_tests polybench_test.sh"
53         fi
54         ])
56 AX_DETECT_GIT_HEAD
57 echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > gitversion.h
59 AC_CONFIG_FILES(Makefile)
60 AC_CONFIG_FILES([polybench_test.sh], [chmod +x polybench_test.sh])
61 if test $with_isl = bundled; then
62         AC_CONFIG_SUBDIRS(isl)
64 if test $with_pet = bundled; then
65         AC_CONFIG_SUBDIRS(pet)
67 AC_CONFIG_COMMANDS_POST([
68         dnl pass on arguments to subdir configures, but don't
69         dnl add them to config.status
70         ac_configure_args="$ac_configure_args $ppcg_configure_args"
72 AC_OUTPUT