blob: c422503e2b983883609a72fdaa94aef613482009 [file] [log] [blame]
Jeff Thompsonb7523002013-10-09 10:25:00 -07001# To build using autotools on OS X:
2# $ sudo port install autoconf
3# $ sudo port install automake
4# $ sudo port install doxygen
5# Enter the following to show directory for m4 macros, and download the the following into there (use sudo):
6# $ aclocal --print
7# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_cxx_compile_stdcxx_11.m4
8# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_prog_doxygen.m4
9# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_openssl.m4
10# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_lib_sqlite3.m4
11# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_prefix_config_h.m4
12
Jeff Thompsonff092f52013-06-19 13:38:12 -070013AC_PREREQ([2.59])
Jeff Thompson93a24162013-09-27 13:28:13 -070014AC_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 -070015AM_INIT_AUTOMAKE([1.10 -Wall no-define foreign])
16
Jeff Thompson93a24162013-09-27 13:28:13 -070017AC_CONFIG_SRCDIR([config.h.in])
Jeff Thompsonb7523002013-10-09 10:25:00 -070018# Create config.h without prefixes.
19AC_CONFIG_HEADERS(config.h)
20# Add prefixes and output to a unique file name.
21AX_PREFIX_CONFIG_H(ndn-cpp/ndn-cpp-config.h)
Jeff Thompson47053ad2013-08-05 10:36:53 -070022AM_MAINTAINER_MODE
Jeff Thompson3b3aabf2013-06-21 16:50:20 -070023AM_PROG_AR
Jeff Thompson4f031642013-08-05 11:03:16 -070024AC_PROG_LIBTOOL
25AC_PROG_CXX
Jeff Thompson1a1b4c02013-06-28 22:28:51 -070026AM_PROG_CC_C_O
Jeff Thompsonfcc4daa2013-10-01 14:52:23 -070027AC_PROG_OBJCXX
Jeff Thompsonff092f52013-06-19 13:38:12 -070028AC_LANG([C++])
Jeff Thompson965a3242013-10-02 09:59:35 -070029AX_LIB_SQLITE3()
Jeff Thompson32a23332013-10-07 18:39:00 -070030AC_TYPE_SIZE_T
31AC_TYPE_INT8_T
32AC_TYPE_INT16_T
33AC_TYPE_INT32_T
34AC_TYPE_INT64_T
35AC_TYPE_UINT8_T
36AC_TYPE_UINT16_T
37AC_TYPE_UINT32_T
38AC_TYPE_UINT64_T
39AC_CHECK_FUNCS([memcmp])
40AC_CHECK_FUNCS([memcpy])
41AC_CHECK_FUNCS([memset])
Jeff Thompson3b3aabf2013-06-21 16:50:20 -070042
Jeff Thompson1b8f4c92013-06-19 16:18:46 -070043AX_CXX_COMPILE_STDCXX_11(, optional)
Jeff Thompson8a055e02013-08-09 10:44:28 -070044AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
45 [AC_MSG_FAILURE([can't find openssl crypto lib])])
Jeff Thompsonff092f52013-06-19 13:38:12 -070046
47AC_MSG_CHECKING([for std::shared_ptr])
48AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
49 [[#include <memory>]]
50 [[std::shared_ptr<int> have_shared_ptr;]])
51], [
52 AC_MSG_RESULT([yes])
53 AC_DEFINE_UNQUOTED([HAVE_STD_SHARED_PTR], 1, [1 if have the `std::shared_ptr' class.])
54], [
55 AC_MSG_RESULT([no])
56 AC_DEFINE_UNQUOTED([HAVE_STD_SHARED_PTR], 0, [1 if have the `std::shared_ptr' class.])
57])
Jeff Thompson9e9ea9f2013-06-22 10:31:18 -070058AC_MSG_CHECKING([for boost::shared_ptr])
Jeff Thompsonff092f52013-06-19 13:38:12 -070059AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
60 [[#include <boost/shared_ptr.hpp>]]
61 [[boost::shared_ptr<int> have_shared_ptr;]])
62], [
63 AC_MSG_RESULT([yes])
64 AC_DEFINE_UNQUOTED([HAVE_BOOST_SHARED_PTR], 1, [1 if have the `boost::shared_ptr' class.])
65], [
66 AC_MSG_RESULT([no])
67 AC_DEFINE_UNQUOTED([HAVE_BOOST_SHARED_PTR], 0, [1 if have the `boost::shared_ptr' class.])
68])
69
Jeff Thompsona28eed82013-08-22 16:21:10 -070070AC_MSG_CHECKING([for std::function])
71AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
72 [[#include <functional>]]
73 [[std::function<int> have_function();]])
74], [
75 AC_MSG_RESULT([yes])
76 AC_DEFINE_UNQUOTED([HAVE_STD_FUNCTION], 1, [1 if have the `std::function' class.])
77], [
78 AC_MSG_RESULT([no])
79 AC_DEFINE_UNQUOTED([HAVE_STD_FUNCTION], 0, [1 if have the `std::function' class.])
80])
81AC_MSG_CHECKING([for boost::function])
82AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
83 [[#include <boost/function.hpp>]]
84 [[boost::function<int> have_function();]])
85], [
86 AC_MSG_RESULT([yes])
87 AC_DEFINE_UNQUOTED([HAVE_BOOST_FUNCTION], 1, [1 if have the `boost::function' class.])
88], [
89 AC_MSG_RESULT([no])
90 AC_DEFINE_UNQUOTED([HAVE_BOOST_FUNCTION], 0, [1 if have the `boost::function' class.])
91])
92
Jeff Thompson9cf9dfb2013-10-04 16:36:52 -070093AC_MSG_CHECKING([for OSX SecKeychain])
94AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
95 [[#include <CoreFoundation/CoreFoundation.h>]]
96 [[#include <Security/Security.h>]]
97 [[#include <CoreServices/CoreServices.h>]]
98 [[void test() { SecKeychainRef x; }]])
99], [
100 AC_MSG_RESULT([yes])
101 AC_DEFINE_UNQUOTED([HAVE_OSX_SECKEYCHAIN], 1, [1 if have OSX SecKeychain.])
102], [
103 AC_MSG_RESULT([no])
104 AC_DEFINE_UNQUOTED([HAVE_OSX_SECKEYCHAIN], 0, [1 if have OSX SecKeychain.])
105])
106
Jeff Thompsonca45e552013-06-26 17:40:06 -0700107DX_HTML_FEATURE(ON)
108DX_CHM_FEATURE(OFF)
109DX_CHI_FEATURE(OFF)
110DX_MAN_FEATURE(OFF)
111DX_RTF_FEATURE(OFF)
112DX_XML_FEATURE(OFF)
113DX_PDF_FEATURE(OFF)
114DX_PS_FEATURE(OFF)
115DX_INIT_DOXYGEN([$PACKAGE_NAME],[Doxyfile])
116
Jeff Thompsonff092f52013-06-19 13:38:12 -0700117AC_CONFIG_FILES([Makefile])
118AC_OUTPUT