configure.ac 1.42 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
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
AC_ARG_ENABLE([papi],
	[AS_HELP_STRING([--disable-papi],[Do not use PAPI to also measure flop count, autodetected by default])],
	[want_papi=$enableval],[want_papi="auto"])
papi_found=unknown
if test x"$want_papi" != x"no" ; then
  AC_CHECK_LIB([papi],[PAPI_library_init],[papi_found="yes"],[papi_found="no"])
  if test x"$want_papi" = x"yes" ; then
    if test x"$papi_found" = x"no" ; then
      AC_MSG_ERROR(["Could not find usable PAPI installation, please adjust CFLAGS, LDFLAGS"])
    fi
  fi
fi
if test x"$papi_found" = x"yes"; then
  AC_DEFINE([HAVE_LIBPAPI], [1], [Use the PAPI library])
  LIBS="-lpapi $LIBS"
fi

31
AC_LANG([Fortran])
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
32
33
34
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
AC_FC_FREEFORM
35
36
AC_OPENMP

Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
37
38

LT_INIT
39
40
AC_ENABLE_SHARED
AC_ENABLE_STATIC
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
41
42
43

PKG_PROG_PKG_CONFIG

44
45
46
47
48
49
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_MAN_FEATURE(ON)
DX_HTML_FEATURE(ON)
DX_INIT_DOXYGEN([ftimings], [Doxyfile], [docs])

Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
50
51
AC_SUBST([FTIMINGS_SO_VERSION], [0:1:0])
AC_SUBST([FTIMINGS_API_VERSION], [0.1])
52
AC_SUBST([AM_CFLAGS])
53
AC_SUBST([AM_FCFLAGS])
54
AC_SUBST([AM_LDFLAGS])
55
AC_SUBST([DOXYGEN_OUTPUT_DIR], [docs])
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
56
57

AC_CONFIG_FILES([Makefile
58
		 Doxyfile
59
		 ftimings-${FTIMINGS_API_VERSION}-${FC}.pc:ftimings.pc.in
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
60
61
		 ])
AC_OUTPUT
62
63

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