-rw-r--r-- | configure.ac | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 1bd1873..c4e9a74 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,150 +1,182 @@ | |||
1 | AC_INIT([libopkele], [0.4], [libopkele-bugs@klever.net]) | 1 | AC_INIT([libopkele], [0.4], [libopkele-bugs@klever.net]) |
2 | AC_CONFIG_SRCDIR([include/opkele/opkele-config.h]) | 2 | AC_CONFIG_SRCDIR([include/opkele/opkele-config.h]) |
3 | AC_CONFIG_HEADERS([config.h include/opkele/acconfig.h]) | 3 | AC_CONFIG_HEADERS([config.h include/opkele/acconfig.h]) |
4 | AM_INIT_AUTOMAKE([dist-bzip2]) | 4 | AM_INIT_AUTOMAKE([dist-bzip2]) |
5 | 5 | ||
6 | AC_PROG_INSTALL | 6 | AC_PROG_INSTALL |
7 | AC_PROG_CXX | 7 | AC_PROG_CXX |
8 | AC_PROG_CC | 8 | AC_PROG_CC |
9 | AC_PROG_LIBTOOL | 9 | AC_PROG_LIBTOOL |
10 | PKG_PROG_PKG_CONFIG | 10 | PKG_PROG_PKG_CONFIG |
11 | 11 | ||
12 | AC_HEADER_STDC | 12 | AC_HEADER_STDC |
13 | 13 | ||
14 | AC_PATH_PROG([XSLTPROC],[xsltproc],[true]) | 14 | AC_PATH_PROG([XSLTPROC],[xsltproc],[true]) |
15 | 15 | ||
16 | AC_MSG_CHECKING([for source tree version]) | 16 | AC_MSG_CHECKING([for source tree version]) |
17 | if headrev=$(cd $srcdir && git rev-parse --verify HEAD 2>/dev/null) ; then | 17 | if headrev=$(cd $srcdir && git rev-parse --verify HEAD 2>/dev/null) ; then |
18 | PACKAGE_SRC_VERSION="$(cd $srcdir && git describe --tags $headrev)" | 18 | PACKAGE_SRC_VERSION="$(cd $srcdir && git describe --tags $headrev)" |
19 | test "$PACKAGE_SRC_VERSION" = "$PACKAGE_VERSION" \ | 19 | test "$PACKAGE_SRC_VERSION" = "$PACKAGE_VERSION" \ |
20 | -o "${PACKAGE_SRC_VERSION#${PACKAGE_VERSION}-}" != "$PACKAGE_SRC_VERSION" || PACKAGE_SRC_VERSION="${PACKAGE_VERSION}:${PACKAGE_SRC_VERSION}" | 20 | -o "${PACKAGE_SRC_VERSION#${PACKAGE_VERSION}-}" != "$PACKAGE_SRC_VERSION" || PACKAGE_SRC_VERSION="${PACKAGE_VERSION}:${PACKAGE_SRC_VERSION}" |
21 | ( cd $srcdir && git diff-index $headrev | read dirt ) && PACKAGE_SRC_VERSION="${PACKAGE_SRC_VERSION}-dirty" | 21 | ( cd $srcdir && git diff-index $headrev | read dirt ) && PACKAGE_SRC_VERSION="${PACKAGE_SRC_VERSION}-dirty" |
22 | else | 22 | else |
23 | PACKAGE_SRC_VERSION="$PACKAGE_VERSION" | 23 | PACKAGE_SRC_VERSION="$PACKAGE_VERSION" |
24 | fi | 24 | fi |
25 | AC_MSG_RESULT([$PACKAGE_SRC_VERSION]) | 25 | AC_MSG_RESULT([$PACKAGE_SRC_VERSION]) |
26 | AC_SUBST([PACKAGE_SRC_VERSION]) | 26 | AC_SUBST([PACKAGE_SRC_VERSION]) |
27 | AC_DEFINE_UNQUOTED([PACKAGE_SRC_VERSION],["$PACKAGE_SRC_VERSION"],[more or less precise source tree version]) | 27 | AC_DEFINE_UNQUOTED([PACKAGE_SRC_VERSION],["$PACKAGE_SRC_VERSION"],[more or less precise source tree version]) |
28 | 28 | ||
29 | tr1_mem_std="false" | ||
30 | tr1_mem_boost="false" | ||
31 | AC_CHECK_SHAREDPTR(std::tr1,tr1/memory,[ tr1_mem_std=true ]) | ||
32 | AC_CHECK_SHAREDPTR(boost,boost/shared_ptr.hpp,[ tr1_mem_boost=true ]) | ||
33 | tr1_mem="" | ||
34 | AC_ARG_WITH([tr1-memory], | ||
35 | AC_HELP_STRING([--with-tr1-memory=<boost|std>],[select tr1/memory (shared_ptr<>) implementation to use]), | ||
36 | [ tr1_mem="$withval" ] | ||
37 | ) | ||
38 | AC_MSG_CHECKING([for tr1/memory implementation to use]) | ||
39 | test -z "$tr1_mem" && $tr1_mem_std && tr1_mem=std | ||
40 | test -z "$tr1_mem" && $tr1_mem_boost && tr1_mem=boost | ||
41 | test -z "$tr1_mem" && AC_MSG_RESULT([none found]) || AC_MSG_RESULT([$tr1_mem]) | ||
42 | case "$tr1_mem" in | ||
43 | std) | ||
44 | $tr1_mem_std || AC_MSG_ERROR([std implementation requested, but not found]) | ||
45 | OPKELE_TR1_MEM_NS=std::tr1 | ||
46 | OPKELE_TR1_MEM_HEADER=tr1/memory | ||
47 | ;; | ||
48 | boost) | ||
49 | $tr1_mem_boost || AC_MSG_ERROR([boost implementation requested, but not found]) | ||
50 | OPKELE_TR1_MEM_NS=boost | ||
51 | OPKELE_TR1_MEM_HEADER=boost/shared_ptr.hpp | ||
52 | ;; | ||
53 | *) | ||
54 | AC_MSG_ERROR([no shared_ptr<> implementation found]) | ||
55 | ;; | ||
56 | esac | ||
57 | AC_SUBST([OPKELE_TR1_MEM_NS]) | ||
58 | AC_SUBST([OPKELE_TR1_MEM_HEADER]) | ||
59 | |||
29 | PKG_CHECK_MODULES([OPENSSL],[openssl],,[ | 60 | PKG_CHECK_MODULES([OPENSSL],[openssl],,[ |
30 | AC_MSG_ERROR([no openssl library found. get one from http://www.openssl.org/]) | 61 | AC_MSG_ERROR([no openssl library found. get one from http://www.openssl.org/]) |
31 | ]) | 62 | ]) |
32 | 63 | ||
33 | WANT_KONFORKA="yes" | 64 | WANT_KONFORKA="yes" |
34 | AC_ARG_ENABLE([konforka], | 65 | AC_ARG_ENABLE([konforka], |
35 | AC_HELP_STRING([--disable-konforka],[do not use konforka library (default: use if found)]), | 66 | AC_HELP_STRING([--disable-konforka],[do not use konforka library (default: use if found)]), |
36 | [ | 67 | [ |
37 | test "${enableval}" = "no" && WANT_KONFORKA="no" | 68 | test "${enableval}" = "no" && WANT_KONFORKA="no" |
38 | ] | 69 | ] |
39 | ) | 70 | ) |
40 | if test "${WANT_KONFORKA}" = "yes" ; then | 71 | if test "${WANT_KONFORKA}" = "yes" ; then |
41 | PKG_CHECK_MODULES([KONFORKA],[konforka],[ | 72 | PKG_CHECK_MODULES([KONFORKA],[konforka],[ |
42 | AC_SUBST([KONFORKA_CFLAGS]) | 73 | AC_SUBST([KONFORKA_CFLAGS]) |
43 | AC_SUBST([KONFORKA_LIBS]) | 74 | AC_SUBST([KONFORKA_LIBS]) |
44 | AC_DEFINE([HAVE_KONFORKA],,[defined in presence of konforka library]) | 75 | AC_DEFINE([HAVE_KONFORKA],,[defined in presence of konforka library]) |
45 | AC_DEFINE([OPKELE_HAVE_KONFORKA],,[defined in presence of konforka library]) | 76 | AC_DEFINE([OPKELE_HAVE_KONFORKA],,[defined in presence of konforka library]) |
46 | AC_SUBST([KONFORKA_KONFORKA],[konforka]) | 77 | AC_SUBST([KONFORKA_KONFORKA],[konforka]) |
47 | ],[true]) | 78 | ],[true]) |
48 | fi | 79 | fi |
49 | 80 | ||
50 | WANT_DOXYGEN="yes" | 81 | WANT_DOXYGEN="yes" |
51 | AC_ARG_ENABLE([doxygen], | 82 | AC_ARG_ENABLE([doxygen], |
52 | AC_HELP_STRING([--disable-doxygen],[do not generate documentation]), | 83 | AC_HELP_STRING([--disable-doxygen],[do not generate documentation]), |
53 | [ | 84 | [ |
54 | test "${enableval}" = "no" && WANT_DOXYGEN="no" | 85 | test "${enableval}" = "no" && WANT_DOXYGEN="no" |
55 | ] | 86 | ] |
56 | ) | 87 | ) |
57 | if test "${WANT_DOXYGEN}" = "yes" ; then | 88 | if test "${WANT_DOXYGEN}" = "yes" ; then |
58 | AC_WITH_DOXYGEN | 89 | AC_WITH_DOXYGEN |
59 | AC_WITH_DOT | 90 | AC_WITH_DOT |
60 | else | 91 | else |
61 | AM_CONDITIONAL([HAVE_DOXYGEN],[false]) | 92 | AM_CONDITIONAL([HAVE_DOXYGEN],[false]) |
62 | AM_CONDITIONAL([HAVE_DOT],[false]) | 93 | AM_CONDITIONAL([HAVE_DOT],[false]) |
63 | fi | 94 | fi |
64 | 95 | ||
65 | LIBCURL_CHECK_CONFIG(,,,[ | 96 | LIBCURL_CHECK_CONFIG(,,,[ |
66 | AC_MSG_ERROR([no required libcurl library. get one from http://curl.haxx.se/]) | 97 | AC_MSG_ERROR([no required libcurl library. get one from http://curl.haxx.se/]) |
67 | ]) | 98 | ]) |
68 | 99 | ||
69 | AC_CHECK_HEADER([expat.h],[ | 100 | AC_CHECK_HEADER([expat.h],[ |
70 | AC_CHECK_LIB([expat],[XML_ParserCreate],[ | 101 | AC_CHECK_LIB([expat],[XML_ParserCreate],[ |
71 | EXPAT_LIBS=-lexpat | 102 | EXPAT_LIBS=-lexpat |
72 | EXPAT_CFLAGS= | 103 | EXPAT_CFLAGS= |
73 | AC_SUBST([EXPAT_LIBS]) | 104 | AC_SUBST([EXPAT_LIBS]) |
74 | AC_SUBST([EXPAT_CFLAGS]) | 105 | AC_SUBST([EXPAT_CFLAGS]) |
75 | ],[ | 106 | ],[ |
76 | AC_MSG_ERROR([no required expat library. get one from http://expat.sourceforge.net/]) | 107 | AC_MSG_ERROR([no required expat library. get one from http://expat.sourceforge.net/]) |
77 | ]) | 108 | ]) |
78 | ],[ | 109 | ],[ |
79 | AC_MSG_ERROR([no required expat library. get one from http://expat.sourceforge.net/]) | 110 | AC_MSG_ERROR([no required expat library. get one from http://expat.sourceforge.net/]) |
80 | ]) | 111 | ]) |
81 | 112 | ||
82 | if test -n "$PCRE_LIBS" -a -n "$PCRE_CFLAGS" ; then | 113 | if test -n "$PCRE_LIBS" -a -n "$PCRE_CFLAGS" ; then |
83 | AC_SUBST([PCRE_CFLAGS]) | 114 | AC_SUBST([PCRE_CFLAGS]) |
84 | AC_SUBST([PCRE_LIBS]) | 115 | AC_SUBST([PCRE_LIBS]) |
85 | : | 116 | : |
86 | else | 117 | else |
87 | PKG_CHECK_MODULES([PCRE],[libpcre],,[ | 118 | PKG_CHECK_MODULES([PCRE],[libpcre],,[ |
88 | AC_MSG_ERROR([no libpcre found, go get it at http://www.pcre.org/]) | 119 | AC_MSG_ERROR([no libpcre found, go get it at http://www.pcre.org/]) |
89 | ]) | 120 | ]) |
90 | fi | 121 | fi |
91 | 122 | ||
92 | curl_ssl_verify_host="true" | 123 | curl_ssl_verify_host="true" |
93 | AC_ARG_ENABLE([ssl-verify-host], | 124 | AC_ARG_ENABLE([ssl-verify-host], |
94 | AC_HELP_STRING([--disable-ssl-verify-host],[disable cURL cert/host relationships verification]), | 125 | AC_HELP_STRING([--disable-ssl-verify-host],[disable cURL cert/host relationships verification]), |
95 | [ test "${enableval}" = "no" && curl_ssl_verify_host="false" ] | 126 | [ test "${enableval}" = "no" && curl_ssl_verify_host="false" ] |
96 | ) | 127 | ) |
97 | ${curl_ssl_verify_host} || AC_DEFINE([DISABLE_CURL_SSL_VERIFYHOST],,[defined if cURL is not to verify cert/host]) | 128 | ${curl_ssl_verify_host} || AC_DEFINE([DISABLE_CURL_SSL_VERIFYHOST],,[defined if cURL is not to verify cert/host]) |
98 | 129 | ||
99 | curl_ssl_verify_peer="true" | 130 | curl_ssl_verify_peer="true" |
100 | AC_ARG_ENABLE([ssl-verify-peer], | 131 | AC_ARG_ENABLE([ssl-verify-peer], |
101 | AC_HELP_STRING([--disable-ssl-verify-peer],[disable cURL cert validity verification]), | 132 | AC_HELP_STRING([--disable-ssl-verify-peer],[disable cURL cert validity verification]), |
102 | [ test "${enableval}" = "no" && curl_ssl_verify_peer="false" ] | 133 | [ test "${enableval}" = "no" && curl_ssl_verify_peer="false" ] |
103 | ) | 134 | ) |
104 | ${curl_ssl_verify_peer} || AC_DEFINE([DISABLE_CURL_SSL_VERIFYPEER],,[defined if cURL is not to verify cert validity]) | 135 | ${curl_ssl_verify_peer} || AC_DEFINE([DISABLE_CURL_SSL_VERIFYPEER],,[defined if cURL is not to verify cert validity]) |
105 | 136 | ||
106 | postels_law=true | 137 | postels_law=true |
107 | AC_ARG_ENABLE([postels-law], | 138 | AC_ARG_ENABLE([postels-law], |
108 | AC_HELP_STRING([--disable-postels-law],[Be strict, do not adhere to Postel's Law ("be conservative in what you do, be liberal in what you accept from others", RFC 793)]), | 139 | AC_HELP_STRING([--disable-postels-law],[Be strict, do not adhere to Postel's Law ("be conservative in what you do, be liberal in what you accept from others", RFC 793)]), |
109 | [ test "${enableval}" = "no" && postels_law=false ] | 140 | [ test "${enableval}" = "no" && postels_law=false ] |
110 | ) | 141 | ) |
111 | $postels_law && AC_DEFINE([POSTELS_LAW],,[defined if we want to adhere to Postel's Law]) | 142 | $postels_law && AC_DEFINE([POSTELS_LAW],,[defined if we want to adhere to Postel's Law]) |
112 | 143 | ||
113 | AC_DEFINE_UNQUOTED([OPKELE_SRC_DIR],["$PWD"],[source directory]) | 144 | AC_DEFINE_UNQUOTED([OPKELE_SRC_DIR],["$PWD"],[source directory]) |
114 | 145 | ||
115 | nitpick=false | 146 | nitpick=false |
116 | AC_ARG_ENABLE([nitpicking], | 147 | AC_ARG_ENABLE([nitpicking], |
117 | AC_HELP_STRING([--enable-nitpicking],[make compiler somewhat overly fastidious about the code it deals with]), | 148 | AC_HELP_STRING([--enable-nitpicking],[make compiler somewhat overly fastidious about the code it deals with]), |
118 | [ test "$enableval" = "no" || nitpick=true ] | 149 | [ test "$enableval" = "no" || nitpick=true ] |
119 | ) | 150 | ) |
120 | if $nitpick ; then | 151 | if $nitpick ; then |
121 | CPP_NITPICK="-pedantic -Wall -Wextra -Wundef -Wshadow \ | 152 | CPP_NITPICK="-pedantic -Wall -Wextra -Wundef -Wshadow \ |
122 | -Wunsafe-loop-optimizations -Wconversion -Wmissing-format-attribute \ | 153 | -Wunsafe-loop-optimizations -Wconversion -Wmissing-format-attribute \ |
123 | -Wredundant-decls -ansi" | 154 | -Wredundant-decls -ansi" |
124 | # -Wlogical-op -Wmissing-noreturn | 155 | # -Wlogical-op -Wmissing-noreturn |
125 | C_NITPICK="$CPP_NITPICK" | 156 | C_NITPICK="$CPP_NITPICK" |
126 | CXX_NITPICK="$C_NITPICK" | 157 | CXX_NITPICK="$C_NITPICK" |
127 | 158 | ||
128 | CPPFLAGS="$CPPFLAGS $CPP_NITPICK" | 159 | CPPFLAGS="$CPPFLAGS $CPP_NITPICK" |
129 | CFLAGS="$CFLAGS $C_NITPICK" | 160 | CFLAGS="$CFLAGS $C_NITPICK" |
130 | CXXFLAGS="$CXXFLAGS $CXX_NITPICK" | 161 | CXXFLAGS="$CXXFLAGS $CXX_NITPICK" |
131 | fi | 162 | fi |
132 | 163 | ||
133 | xri_proxy_url="http://beta.xri.net/" | 164 | xri_proxy_url="http://beta.xri.net/" |
134 | AC_MSG_CHECKING([for XRI resolver proxy]) | 165 | AC_MSG_CHECKING([for XRI resolver proxy]) |
135 | AC_ARG_ENABLE([xri-proxy], | 166 | AC_ARG_ENABLE([xri-proxy], |
136 | AC_HELP_STRING([--with-xri-proxy=url],[set xri proxy for use when resolving xri identities, default is http://xr_proxy_url]), | 167 | AC_HELP_STRING([--with-xri-proxy=url],[set xri proxy for use when resolving xri identities, default is http://xr_proxy_url]), |
137 | [ xri_proxy_url="$withval" ] | 168 | [ xri_proxy_url="$withval" ] |
138 | ) | 169 | ) |
139 | AC_MSG_RESULT([$xri_proxy_url]) | 170 | AC_MSG_RESULT([$xri_proxy_url]) |
140 | AC_DEFINE_UNQUOTED([XRI_PROXY_URL],["$xri_proxy_url"],[XRI proxy resolver URL]) | 171 | AC_DEFINE_UNQUOTED([XRI_PROXY_URL],["$xri_proxy_url"],[XRI proxy resolver URL]) |
141 | 172 | ||
142 | AC_CONFIG_FILES([ | 173 | AC_CONFIG_FILES([ |
143 | Makefile | 174 | Makefile |
144 | libopkele.pc | 175 | libopkele.pc |
145 | Doxyfile | 176 | Doxyfile |
146 | include/Makefile | 177 | include/Makefile |
178 | include/opkele/tr1-mem.h | ||
147 | lib/Makefile | 179 | lib/Makefile |
148 | test/Makefile | 180 | test/Makefile |
149 | ]) | 181 | ]) |
150 | AC_OUTPUT | 182 | AC_OUTPUT |