configure.ac 1.86 KB
Newer Older
1
AC_INIT([ftimings], [0.1])
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
2
3
4
5
6
7
8
AC_PREREQ([2.59])
AC_CONFIG_MACRO_DIR([m4])

AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([foreign -Wall -Werror])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
9
10

AC_LANG([C])
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
11
AM_PROG_CC_C_O
12
AC_OPENMP
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
13

14
AC_ARG_ENABLE([papi],
15
16
17
	[AS_HELP_STRING([--disable-papi],[Do not use PAPI to also measure flop count])],
	[want_papi=$enableval],[want_papi="yes"])
if test "$want_papi" = "yes" ; then
18
  AC_CHECK_LIB([papi],[PAPI_library_init],[papi_found="yes"],[papi_found="no"])
19
20
  if test "$papi_found" = "no" ; then
    AC_MSG_ERROR(["Could not find usable PAPI installation, please adjust CFLAGS, LDFLAGS"])
21
22
23
24
  fi
  AC_DEFINE([HAVE_LIBPAPI], [1], [Use the PAPI library])
  LIBS="-lpapi $LIBS"
fi
25
26
27
28
29
30
31
32
33
34
35
36
37
AM_CONDITIONAL([HAVE_LIBPAPI],[test "$want_papi" = "yes"])

AC_ARG_ENABLE([perf],
	[AS_HELP_STRING([--disable-perf],[Do not use the Linux perf API to measure amount of DRAM memory accesses])],
	[want_perf=$enableval],[want_perf="yes"])
if test "$want_perf" = "yes" ; then
  AC_CHECK_HEADERS([linux/perf_event.h],[perf_found="yes"],[perf_found="no"])
  if test "$perf_found" = "no" ; then
    AC_MSG_ERROR(["Could not find linux/perf_event.h, please adjust CPPFLAGS"])
  fi
  AC_DEFINE([HAVE_PERF], [1], [Use Linux perf API])
fi
AM_CONDITIONAL([HAVE_PERF],[test "$want_perf" = "yes"])
38

39
AC_LANG([Fortran])
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
40
41
42
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
AC_FC_FREEFORM
43
44
AC_OPENMP

Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
45
46

LT_INIT
47
48
AC_ENABLE_SHARED
AC_ENABLE_STATIC
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
49
50
51

PKG_PROG_PKG_CONFIG

52
53
54
55
56
57
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_MAN_FEATURE(ON)
DX_HTML_FEATURE(ON)
DX_INIT_DOXYGEN([ftimings], [Doxyfile], [docs])

58
AC_SUBST([FTIMINGS_SO_VERSION], [1:0:0])
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
59
AC_SUBST([FTIMINGS_API_VERSION], [0.1])
60
AC_SUBST([AM_CFLAGS])
61
AC_SUBST([AM_FCFLAGS])
62
AC_SUBST([AM_LDFLAGS])
63
AC_SUBST([DOXYGEN_OUTPUT_DIR], [docs])
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
64
65

AC_CONFIG_FILES([Makefile
66
		 Doxyfile
67
		 ftimings-${FTIMINGS_API_VERSION}-${FC}.pc:ftimings.pc.in
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
68
69
		 ])
AC_OUTPUT
70
71

grep "^#define" config.h > config-f90.h