configure.ac 2.25 KB
Newer Older
Philip Carns's avatar
Philip Carns committed
1
2
3
4
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
5
AC_INIT([abt-io], [0.2], [],[],[]) 
Philip Carns's avatar
Philip Carns committed
6
7
AC_CONFIG_MACRO_DIRS([m4])
LT_INIT
Philip Carns's avatar
Philip Carns committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

AC_CANONICAL_TARGET
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST

AM_INIT_AUTOMAKE([foreign subdir-objects -Wall])

# we should remove this soon, only needed for automake 1.10 and older
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_CONFIG_SRCDIR([README.md])
AC_CONFIG_HEADERS([abt-io-config.h])

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CXXCPP

AC_PROG_MKDIR_P

AC_REQUIRE_CPP

AC_CHECK_SIZEOF([long int])

33
34
35
36
37
38
AC_MSG_CHECKING([for openssl])
AX_CHECK_OPENSSL(
AC_MSG_RESULT(yes)
,
AC_MSG_ERROR([Could not find openssl]))

Philip Carns's avatar
Philip Carns committed
39
40
41
42
dnl
dnl Verify pkg-config
dnl
PKG_PROG_PKG_CONFIG
43
44
45
if test "x$PKG_CONFIG" == "x"; then
   AC_MSG_ERROR([Could not find pkg-config utility!])
fi
Philip Carns's avatar
Philip Carns committed
46

47
PKG_CHECK_MODULES([ARGOBOTS],[argobots],[],
Philip Carns's avatar
Philip Carns committed
48
49
50
51
52
   [AC_MSG_ERROR([Could not find working argobots installation!])])
LIBS="$ARGOBOTS_LIBS $LIBS"
CPPFLAGS="$ARGOBOTS_CFLAGS $CPPFLAGS"
CFLAGS="$ARGOBOTS_CFLAGS $CFLAGS"

Philip Carns's avatar
Philip Carns committed
53
54
55
56
57
58
59
60
61
62
63
64
AC_MSG_CHECKING([for fallocate])
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <fcntl.h>
], [
int ret = fallocate(0, 0, 0, 0);
],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_FALLOCATE], [], [Define if fallocate available])
,
AC_MSG_RESULT(no))

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
NONCOMPLIANT_IO=""

AC_MSG_CHECKING([for O_DIRECT])
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
], [
int fd = open(NULL, O_DIRECT);
], 
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_ODIRECT], [], [Define if able to open files with O_DIRECT])
,
NONCOMPLIANT_IO=1
AC_MSG_RESULT(no))

AC_MSG_CHECKING([for mkostemp])
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <stdlib.h>
], [
int fd = mkostemp(NULL, 0);
], 
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_MKOSTEMP], [], [Define if mkostemp available])
,
NONCOMPLIANT_IO=1
AC_MSG_RESULT(no))

Philip Carns's avatar
Philip Carns committed
97
98
99
AC_CONFIG_FILES([Makefile maint/abt-io.pc])
AC_OUTPUT
 
100
101
102
103
104
if test "x$NONCOMPLIANT_IO" = "x1" ; then
    AC_MSG_WARN([This platform lacks O_DIRECT and/or mkostemp().  All code
    should still compile and pass make check tests, but behavior and
    performance results in example programs may not match other platforms.])
fi