-rw-r--r-- | configure.ac | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 48a5efb..c28141c 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,128 +1,211 @@ | |||
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 | if test -z "$tr1_mem" ; then | ||
42 | AC_MSG_RESULT([none found]) | ||
43 | else | ||
44 | AC_MSG_RESULT([$tr1_mem]) | ||
45 | fi | ||
46 | case "$tr1_mem" in | ||
47 | std) | ||
48 | $tr1_mem_std || AC_MSG_ERROR([std implementation requested, but not found]) | ||
49 | OPKELE_TR1_MEM_NS=std::tr1 | ||
50 | OPKELE_TR1_MEM_HEADER=tr1/memory | ||
51 | ;; | ||
52 | boost) | ||
53 | $tr1_mem_boost || AC_MSG_ERROR([boost implementation requested, but not found]) | ||
54 | OPKELE_TR1_MEM_NS=boost | ||
55 | OPKELE_TR1_MEM_HEADER=boost/shared_ptr.hpp | ||
56 | ;; | ||
57 | *) | ||
58 | AC_MSG_ERROR([no shared_ptr<> implementation found]) | ||
59 | ;; | ||
60 | esac | ||
61 | AC_SUBST([OPKELE_TR1_MEM_NS]) | ||
62 | AC_SUBST([OPKELE_TR1_MEM_HEADER]) | ||
63 | |||
29 | PKG_CHECK_MODULES([OPENSSL],[openssl],,[ | 64 | PKG_CHECK_MODULES([OPENSSL],[openssl],,[ |
30 | AC_MSG_ERROR([no openssl library found. get one from http://www.openssl.org/]) | 65 | AC_MSG_ERROR([no openssl library found. get one from http://www.openssl.org/]) |
31 | ]) | 66 | ]) |
32 | 67 | ||
33 | WANT_KONFORKA="yes" | 68 | WANT_KONFORKA="yes" |
34 | AC_ARG_ENABLE([konforka], | 69 | AC_ARG_ENABLE([konforka], |
35 | AC_HELP_STRING([--disable-konforka],[do not use konforka library (default: use if found)]), | 70 | AC_HELP_STRING([--disable-konforka],[do not use konforka library (default: use if found)]), |
36 | [ | 71 | [ |
37 | test "${enableval}" = "no" && WANT_KONFORKA="no" | 72 | test "${enableval}" = "no" && WANT_KONFORKA="no" |
38 | ] | 73 | ] |
39 | ) | 74 | ) |
40 | if test "${WANT_KONFORKA}" = "yes" ; then | 75 | if test "${WANT_KONFORKA}" = "yes" ; then |
41 | PKG_CHECK_MODULES([KONFORKA],[konforka],[ | 76 | PKG_CHECK_MODULES([KONFORKA],[konforka],[ |
42 | AC_SUBST([KONFORKA_CFLAGS]) | 77 | AC_SUBST([KONFORKA_CFLAGS]) |
43 | AC_SUBST([KONFORKA_LIBS]) | 78 | AC_SUBST([KONFORKA_LIBS]) |
44 | AC_DEFINE([HAVE_KONFORKA],,[defined in presence of konforka library]) | 79 | AC_DEFINE([HAVE_KONFORKA],,[defined in presence of konforka library]) |
45 | AC_DEFINE([OPKELE_HAVE_KONFORKA],,[defined in presence of konforka library]) | 80 | AC_DEFINE([OPKELE_HAVE_KONFORKA],,[defined in presence of konforka library]) |
46 | AC_SUBST([KONFORKA_KONFORKA],[konforka]) | 81 | AC_SUBST([KONFORKA_KONFORKA],[konforka]) |
47 | ],[true]) | 82 | ],[true]) |
48 | fi | 83 | fi |
49 | 84 | ||
50 | WANT_DOXYGEN="yes" | 85 | WANT_DOXYGEN="yes" |
51 | AC_ARG_ENABLE([doxygen], | 86 | AC_ARG_ENABLE([doxygen], |
52 | AC_HELP_STRING([--disable-doxygen],[do not generate documentation]), | 87 | AC_HELP_STRING([--disable-doxygen],[do not generate documentation]), |
53 | [ | 88 | [ |
54 | test "${enableval}" = "no" && WANT_DOXYGEN="no" | 89 | test "${enableval}" = "no" && WANT_DOXYGEN="no" |
55 | ] | 90 | ] |
56 | ) | 91 | ) |
57 | if test "${WANT_DOXYGEN}" = "yes" ; then | 92 | if test "${WANT_DOXYGEN}" = "yes" ; then |
58 | AC_WITH_DOXYGEN | 93 | AC_WITH_DOXYGEN |
59 | AC_WITH_DOT | 94 | AC_WITH_DOT |
60 | else | 95 | else |
61 | AM_CONDITIONAL([HAVE_DOXYGEN],[false]) | 96 | AM_CONDITIONAL([HAVE_DOXYGEN],[false]) |
62 | AM_CONDITIONAL([HAVE_DOT],[false]) | 97 | AM_CONDITIONAL([HAVE_DOT],[false]) |
63 | fi | 98 | fi |
64 | 99 | ||
65 | LIBCURL_CHECK_CONFIG(,,,[ | 100 | LIBCURL_CHECK_CONFIG(,,,[ |
66 | AC_MSG_ERROR([no required libcurl library. get one from http://curl.haxx.se/]) | 101 | AC_MSG_ERROR([no required libcurl library. get one from http://curl.haxx.se/]) |
67 | ]) | 102 | ]) |
68 | 103 | ||
104 | AC_CHECK_HEADER([expat.h],[ | ||
105 | AC_CHECK_LIB([expat],[XML_ParserCreate],[ | ||
106 | EXPAT_LIBS=-lexpat | ||
107 | EXPAT_CFLAGS= | ||
108 | AC_SUBST([EXPAT_LIBS]) | ||
109 | AC_SUBST([EXPAT_CFLAGS]) | ||
110 | ],[ | ||
111 | AC_MSG_ERROR([no required expat library. get one from http://expat.sourceforge.net/]) | ||
112 | ]) | ||
113 | ],[ | ||
114 | AC_MSG_ERROR([no required expat library. get one from http://expat.sourceforge.net/]) | ||
115 | ]) | ||
116 | |||
117 | AC_CHECK_HEADER([tidy.h],[ | ||
118 | AC_CHECK_LIB([tidy],[tidyParseBuffer],[ | ||
119 | TIDY_LIBS=-ltidy | ||
120 | TIDY_CFLAGS= | ||
121 | AC_SUBST([TIDY_LIBS]) | ||
122 | AC_SUBST([TIDY_CFLAGS]) | ||
123 | ],[ | ||
124 | AC_MSG_ERROR([no required htmltidy library found. get one from http://tidy.sourceforge.net/]) | ||
125 | ]) | ||
126 | ],[ | ||
127 | AC_MSG_ERROR([no required htmltidy library found. get one from http://tidy.sourceforge.net/]) | ||
128 | ]) | ||
129 | |||
69 | if test -n "$PCRE_LIBS" -a -n "$PCRE_CFLAGS" ; then | 130 | if test -n "$PCRE_LIBS" -a -n "$PCRE_CFLAGS" ; then |
70 | AC_SUBST([PCRE_CFLAGS]) | 131 | AC_SUBST([PCRE_CFLAGS]) |
71 | AC_SUBST([PCRE_LIBS]) | 132 | AC_SUBST([PCRE_LIBS]) |
72 | : | 133 | : |
73 | else | 134 | else |
74 | PKG_CHECK_MODULES([PCRE],[libpcre],,[ | 135 | PKG_CHECK_MODULES([PCRE],[libpcre],,[ |
75 | AC_MSG_ERROR([no libpcre found, go get it at http://www.pcre.org/]) | 136 | AC_MSG_ERROR([no libpcre found, go get it at http://www.pcre.org/]) |
76 | ]) | 137 | ]) |
77 | fi | 138 | fi |
78 | 139 | ||
79 | curl_ssl_verify_host="true" | 140 | curl_ssl_verify_host="true" |
80 | AC_ARG_ENABLE([ssl-verify-host], | 141 | AC_ARG_ENABLE([ssl-verify-host], |
81 | AC_HELP_STRING([--disable-ssl-verify-host],[disable cURL cert/host relationships verification]), | 142 | AC_HELP_STRING([--disable-ssl-verify-host],[disable cURL cert/host relationships verification]), |
82 | [ test "${enableval}" = "no" && curl_ssl_verify_host="false" ] | 143 | [ test "${enableval}" = "no" && curl_ssl_verify_host="false" ] |
83 | ) | 144 | ) |
84 | ${curl_ssl_verify_host} || AC_DEFINE([DISABLE_CURL_SSL_VERIFYHOST],,[defined if cURL is not to verify cert/host]) | 145 | ${curl_ssl_verify_host} || AC_DEFINE([DISABLE_CURL_SSL_VERIFYHOST],,[defined if cURL is not to verify cert/host]) |
85 | 146 | ||
86 | curl_ssl_verify_peer="true" | 147 | curl_ssl_verify_peer="true" |
87 | AC_ARG_ENABLE([ssl-verify-peer], | 148 | AC_ARG_ENABLE([ssl-verify-peer], |
88 | AC_HELP_STRING([--disable-ssl-verify-peer],[disable cURL cert validity verification]), | 149 | AC_HELP_STRING([--disable-ssl-verify-peer],[disable cURL cert validity verification]), |
89 | [ test "${enableval}" = "no" && curl_ssl_verify_peer="false" ] | 150 | [ test "${enableval}" = "no" && curl_ssl_verify_peer="false" ] |
90 | ) | 151 | ) |
91 | ${curl_ssl_verify_peer} || AC_DEFINE([DISABLE_CURL_SSL_VERIFYPEER],,[defined if cURL is not to verify cert validity]) | 152 | ${curl_ssl_verify_peer} || AC_DEFINE([DISABLE_CURL_SSL_VERIFYPEER],,[defined if cURL is not to verify cert validity]) |
92 | 153 | ||
93 | postels_law=true | 154 | postels_law=true |
94 | AC_ARG_ENABLE([postels-law], | 155 | AC_ARG_ENABLE([postels-law], |
95 | 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)]), | 156 | 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)]), |
96 | [ test "${enableval}" = "no" && postels_law=false ] | 157 | [ test "${enableval}" = "no" && postels_law=false ] |
97 | ) | 158 | ) |
98 | $postels_law && AC_DEFINE([POSTELS_LAW],,[defined if we want to adhere to Postel's Law]) | 159 | $postels_law && AC_DEFINE([POSTELS_LAW],,[defined if we want to adhere to Postel's Law]) |
99 | 160 | ||
100 | AC_DEFINE_UNQUOTED([OPKELE_SRC_DIR],["$PWD"],[source directory]) | 161 | AC_DEFINE_UNQUOTED([OPKELE_SRC_DIR],["$PWD"],[source directory]) |
101 | 162 | ||
102 | nitpick=false | 163 | nitpick=false |
103 | AC_ARG_ENABLE([nitpicking], | 164 | AC_ARG_ENABLE([nitpicking], |
104 | AC_HELP_STRING([--enable-nitpicking],[make compiler somewhat overly fastidious about the code it deals with]), | 165 | AC_HELP_STRING([--enable-nitpicking],[make compiler somewhat overly fastidious about the code it deals with]), |
105 | [ test "$enableval" = "no" || nitpick=true ] | 166 | [ test "$enableval" = "no" || nitpick=true ] |
106 | ) | 167 | ) |
107 | if $nitpick ; then | 168 | if $nitpick ; then |
108 | CPP_NITPICK="-pedantic -Wall -Wextra -Wundef -Wshadow \ | 169 | CPP_NITPICK="-pedantic -Wall -Wextra -Wundef -Wshadow \ |
109 | -Wunsafe-loop-optimizations -Wconversion -Wmissing-format-attribute \ | 170 | -Wunsafe-loop-optimizations -Wconversion -Wmissing-format-attribute \ |
110 | -Wredundant-decls -ansi" | 171 | -Wredundant-decls -ansi" |
111 | # -Wlogical-op -Wmissing-noreturn | 172 | # -Wlogical-op -Wmissing-noreturn |
112 | C_NITPICK="$CPP_NITPICK" | 173 | C_NITPICK="$CPP_NITPICK" |
113 | CXX_NITPICK="$C_NITPICK" | 174 | CXX_NITPICK="$C_NITPICK" |
114 | 175 | ||
115 | CPPFLAGS="$CPPFLAGS $CPP_NITPICK" | 176 | CPPFLAGS="$CPPFLAGS $CPP_NITPICK" |
116 | CFLAGS="$CFLAGS $C_NITPICK" | 177 | CFLAGS="$CFLAGS $C_NITPICK" |
117 | CXXFLAGS="$CXXFLAGS $CXX_NITPICK" | 178 | CXXFLAGS="$CXXFLAGS $CXX_NITPICK" |
118 | fi | 179 | fi |
119 | 180 | ||
181 | ndebug=true | ||
182 | AC_ARG_ENABLE([debug], | ||
183 | AC_HELP_STRING([--enable-debug],[enable debugging code]), | ||
184 | [ test "$enableval" = "no" || ndebug=false ] | ||
185 | ) | ||
186 | if $ndebug ; then | ||
187 | CPPFLAGS_DEBUG="-DNDEBUG" | ||
188 | else | ||
189 | CPPFLAGS_DEBUG="" | ||
190 | fi | ||
191 | AC_SUBST([CPPFLAGS_DEBUG]) | ||
192 | |||
193 | xri_proxy_url="http://beta.xri.net/" | ||
194 | AC_MSG_CHECKING([for XRI resolver proxy]) | ||
195 | AC_ARG_ENABLE([xri-proxy], | ||
196 | AC_HELP_STRING([--with-xri-proxy=url],[set xri proxy for use when resolving xri identities, default is http://xr_proxy_url]), | ||
197 | [ xri_proxy_url="$withval" ] | ||
198 | ) | ||
199 | AC_MSG_RESULT([$xri_proxy_url]) | ||
200 | AC_DEFINE_UNQUOTED([XRI_PROXY_URL],["$xri_proxy_url"],[XRI proxy resolver URL]) | ||
201 | |||
120 | AC_CONFIG_FILES([ | 202 | AC_CONFIG_FILES([ |
121 | Makefile | 203 | Makefile |
122 | libopkele.pc | 204 | libopkele.pc |
123 | Doxyfile | 205 | Doxyfile |
124 | include/Makefile | 206 | include/Makefile |
207 | include/opkele/tr1-mem.h | ||
125 | lib/Makefile | 208 | lib/Makefile |
126 | test/Makefile | 209 | test/Makefile |
127 | ]) | 210 | ]) |
128 | AC_OUTPUT | 211 | AC_OUTPUT |