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

4
AC_PREREQ([2.63])
5
AC_INIT([bake], [0.1], [],[],[]) 
6
AC_CONFIG_MACRO_DIR([m4])
Philip Carns's avatar
Philip Carns committed
7
LT_INIT
Philip Carns's avatar
Philip Carns committed
8 9 10 11 12 13 14 15 16 17 18

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])
19
AC_CONFIG_HEADERS([bake-config.h])
Philip Carns's avatar
Philip Carns committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

# 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])

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

Shane Snyder's avatar
Shane Snyder committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
# coreutils checks for OSX
AC_ARG_VAR([TIMEOUT], timeout program)
AC_ARG_VAR([MKTEMP], mktemp program)

if test -z "$TIMEOUT" ; then
    AC_CHECK_PROGS(TIMEOUT, [timeout gtimeout])
    if test -z "$TIMEOUT" ; then
        AC_MSG_ERROR([Could not find timeout command (can optionally provide via the TIMEOUT variable)])
    fi
else
    AC_SUBST([TIMEOUT], ["$TIMEOUT"])
fi

if test -z "$MKTEMP" ; then
    AC_CHECK_PROGS(MKTEMP, [mktemp gmktemp])
    if test -z "$MKTEMP" ; then
        AC_MSG_ERROR([Could not find mktemp command (can optionally provide via the MKTEMP variable)])
    fi
else
    AC_SUBST([MKTEMP], ["$MKTEMP"])
fi

63
PKG_CHECK_MODULES([MARGO],[margo],[],
Philip Carns's avatar
Philip Carns committed
64 65 66 67 68 69 70
   [AC_MSG_ERROR([Could not find working margo installation!])])
LIBS="$MARGO_LIBS $LIBS"
CPPFLAGS="$MARGO_CFLAGS $CPPFLAGS"
CFLAGS="$MARGO_CFLAGS $CFLAGS"

# NOTE: See README.md if the following does not work for you; some versions of
# nvml/pmem install broken .pc files
71
PKG_CHECK_MODULES([LIBPMEMOBJ],[libpmemobj],[],
Philip Carns's avatar
Philip Carns committed
72 73 74 75 76
   [AC_MSG_ERROR([Could not find working libpmemobj installation!])])
LIBS="$LIBPMEMOBJ_LIBS $LIBS"
CPPFLAGS="$LIBPMEMOBJ_CFLAGS $CPPFLAGS"
CFLAGS="$LIBPMEMOBJ_CFLAGS $CFLAGS"

77
PKG_CHECK_MODULES([UUID],[uuid],[],
78 79 80 81 82
   [AC_MSG_ERROR([Could not find working uuid installation!])])
LIBS="$UUID_LIBS $LIBS"
CPPFLAGS="$UUID_CFLAGS $CPPFLAGS"
CFLAGS="$UUID_CFLAGS $CFLAGS"

83
AC_CONFIG_FILES([Makefile maint/bake-client.pc maint/bake-server.pc])
Philip Carns's avatar
Philip Carns committed
84 85
AC_OUTPUT