blob: 3fda70585eedba0fbbedd95499a2707ab7f0b8ac [file] [log] [blame]
Jeff Thompsonff092f52013-06-19 13:38:12 -07001AC_PREREQ([2.59])
Jeff Thompson93a24162013-09-27 13:28:13 -07002AC_INIT([ndn-cpp], [0.2], [ndn-lib@lists.cs.ucla.edu], [ndn-cpp], [https://github.com/named-data/ndn-cpp])
Jeff Thompsonff092f52013-06-19 13:38:12 -07003AM_INIT_AUTOMAKE([1.10 -Wall no-define foreign])
4
Jeff Thompson93a24162013-09-27 13:28:13 -07005AC_CONFIG_SRCDIR([config.h.in])
Jeff Thompsonff092f52013-06-19 13:38:12 -07006AC_CONFIG_HEADERS([config.h])
Jeff Thompson47053ad2013-08-05 10:36:53 -07007AM_MAINTAINER_MODE
Jeff Thompson3b3aabf2013-06-21 16:50:20 -07008AM_PROG_AR
Jeff Thompson4f031642013-08-05 11:03:16 -07009AC_PROG_LIBTOOL
10AC_PROG_CXX
Jeff Thompson1a1b4c02013-06-28 22:28:51 -070011AM_PROG_CC_C_O
Jeff Thompsonfcc4daa2013-10-01 14:52:23 -070012AC_PROG_OBJCXX
Jeff Thompsonff092f52013-06-19 13:38:12 -070013AC_LANG([C++])
Jeff Thompson965a3242013-10-02 09:59:35 -070014AX_LIB_SQLITE3()
Jeff Thompson3b3aabf2013-06-21 16:50:20 -070015
Jeff Thompson1b8f4c92013-06-19 16:18:46 -070016AX_CXX_COMPILE_STDCXX_11(, optional)
Jeff Thompson8a055e02013-08-09 10:44:28 -070017AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
18 [AC_MSG_FAILURE([can't find openssl crypto lib])])
Jeff Thompsonff092f52013-06-19 13:38:12 -070019
20AC_MSG_CHECKING([for std::shared_ptr])
21AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
22 [[#include <memory>]]
23 [[std::shared_ptr<int> have_shared_ptr;]])
24], [
25 AC_MSG_RESULT([yes])
26 AC_DEFINE_UNQUOTED([HAVE_STD_SHARED_PTR], 1, [1 if have the `std::shared_ptr' class.])
27], [
28 AC_MSG_RESULT([no])
29 AC_DEFINE_UNQUOTED([HAVE_STD_SHARED_PTR], 0, [1 if have the `std::shared_ptr' class.])
30])
Jeff Thompson9e9ea9f2013-06-22 10:31:18 -070031AC_MSG_CHECKING([for boost::shared_ptr])
Jeff Thompsonff092f52013-06-19 13:38:12 -070032AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
33 [[#include <boost/shared_ptr.hpp>]]
34 [[boost::shared_ptr<int> have_shared_ptr;]])
35], [
36 AC_MSG_RESULT([yes])
37 AC_DEFINE_UNQUOTED([HAVE_BOOST_SHARED_PTR], 1, [1 if have the `boost::shared_ptr' class.])
38], [
39 AC_MSG_RESULT([no])
40 AC_DEFINE_UNQUOTED([HAVE_BOOST_SHARED_PTR], 0, [1 if have the `boost::shared_ptr' class.])
41])
42
Jeff Thompsona28eed82013-08-22 16:21:10 -070043AC_MSG_CHECKING([for std::function])
44AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
45 [[#include <functional>]]
46 [[std::function<int> have_function();]])
47], [
48 AC_MSG_RESULT([yes])
49 AC_DEFINE_UNQUOTED([HAVE_STD_FUNCTION], 1, [1 if have the `std::function' class.])
50], [
51 AC_MSG_RESULT([no])
52 AC_DEFINE_UNQUOTED([HAVE_STD_FUNCTION], 0, [1 if have the `std::function' class.])
53])
54AC_MSG_CHECKING([for boost::function])
55AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
56 [[#include <boost/function.hpp>]]
57 [[boost::function<int> have_function();]])
58], [
59 AC_MSG_RESULT([yes])
60 AC_DEFINE_UNQUOTED([HAVE_BOOST_FUNCTION], 1, [1 if have the `boost::function' class.])
61], [
62 AC_MSG_RESULT([no])
63 AC_DEFINE_UNQUOTED([HAVE_BOOST_FUNCTION], 0, [1 if have the `boost::function' class.])
64])
65
Jeff Thompsond4a1e162013-07-11 12:41:31 -070066AC_MSG_CHECKING([for memcmp])
67AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
68 [[#include <memory.h>]]
69 [[void test() { unsigned char buffer[1]; memcmp(buffer, buffer, 1); }]])
70], [
71 AC_MSG_RESULT([yes])
72 AC_DEFINE_UNQUOTED([HAVE_MEMCMP], 1, [1 if have memcmp in memory.h.])
73], [
74 AC_MSG_RESULT([no])
75 AC_DEFINE_UNQUOTED([HAVE_MEMCMP], 0, [1 if have memcmp in memory.h.])
76])
Jeff Thompsonc804d522013-06-27 16:54:27 -070077AC_MSG_CHECKING([for memcpy])
78AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
79 [[#include <memory.h>]]
80 [[void test() { unsigned char buffer[1]; memcpy(buffer, buffer, 1); }]])
81], [
82 AC_MSG_RESULT([yes])
83 AC_DEFINE_UNQUOTED([HAVE_MEMCPY], 1, [1 if have memcpy in memory.h.])
84], [
85 AC_MSG_RESULT([no])
86 AC_DEFINE_UNQUOTED([HAVE_MEMCPY], 0, [1 if have memcpy in memory.h.])
87])
88AC_MSG_CHECKING([for memset])
89AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
90 [[#include <memory.h>]]
91 [[void test() { unsigned char buffer[1]; memset(buffer, 0, 1); }]])
92], [
93 AC_MSG_RESULT([yes])
94 AC_DEFINE_UNQUOTED([HAVE_MEMSET], 1, [1 if have memset in memory.h.])
95], [
96 AC_MSG_RESULT([no])
97 AC_DEFINE_UNQUOTED([HAVE_MEMSET], 0, [1 if have memset in memory.h.])
98])
99
Jeff Thompson0c13a532013-09-24 15:43:41 -0700100AC_MSG_CHECKING([for stdint])
101AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
102 [[#include <stdint.h>]]
103 [[void test() { uint8_t x; }]])
104], [
105 AC_MSG_RESULT([yes])
106 AC_DEFINE_UNQUOTED([HAVE_STDINT], 1, [1 if have stdint.h.])
107], [
108 AC_MSG_RESULT([no])
109 AC_DEFINE_UNQUOTED([HAVE_STDINT], 0, [1 if have stdint.h.])
110])
111
Jeff Thompsonca45e552013-06-26 17:40:06 -0700112DX_HTML_FEATURE(ON)
113DX_CHM_FEATURE(OFF)
114DX_CHI_FEATURE(OFF)
115DX_MAN_FEATURE(OFF)
116DX_RTF_FEATURE(OFF)
117DX_XML_FEATURE(OFF)
118DX_PDF_FEATURE(OFF)
119DX_PS_FEATURE(OFF)
120DX_INIT_DOXYGEN([$PACKAGE_NAME],[Doxyfile])
121
Jeff Thompsonff092f52013-06-19 13:38:12 -0700122AC_CONFIG_FILES([Makefile])
123AC_OUTPUT