Debian Codegraph @

LspCpp/third_party/asio/configure.ac

raw
1 AC_INIT([asio],[1.36.0])
2 AC_CONFIG_SRCDIR(include/asio.hpp)
3 AM_MAINTAINER_MODE
4 AM_INIT_AUTOMAKE([tar-pax])
5
6 AC_CANONICAL_HOST
7 AM_PROG_CC_C_O
8 AC_PROG_CXX
9 AC_LANG(C++)
10 AC_PROG_RANLIB
11 PKG_NOARCH_INSTALLDIR
12
13 AC_DEFINE(_REENTRANT, [1], [Define this])
14
15 AC_ARG_WITH(boost,
16 AS_HELP_STRING([--with-boost=DIR],[location of boost distribution]),
17 [
18 if test "${withval}" = no; then
19 STANDALONE="yes"
20 else
21 if test "${withval}" != system; then
22 CPPFLAGS="$CPPFLAGS -I${withval}"
23 LIBS="$LIBS -L${withval}/stage/lib"
24 fi
25 CPPFLAGS="$CPPFLAGS -DASIO_ENABLE_BOOST -DBOOST_CHRONO_HEADER_ONLY -DBOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING"
26 fi
27 ],
28 [
29 STANDALONE="yes"
30 ])
31
32 AC_ARG_ENABLE(separate-compilation,
33 [ --enable-separate-compilation separate compilation of asio source],
34 [
35 SEPARATE_COMPILATION=yes
36 ])
37
38 AC_ARG_ENABLE(boost-coroutine,
39 [ --enable-boost-coroutine use Boost.Coroutine to implement stackful coroutines],
40 [
41 HAVE_BOOST_COROUTINE=yes
42 ])
43
44 if test "$STANDALONE" != yes; then
45 AC_CHECK_HEADER([boost/noncopyable.hpp],,
46 [
47 echo "Can't find boost headers. Please check the location of the boost"
48 echo "distribution and rerun configure using the --with-boost=DIR option."
49 echo "Alternatively, run with --without-boost to enable standalone build."
50 exit 1
51 ],[])
52 fi
53
54 AC_ARG_WITH(openssl,
55 AS_HELP_STRING([--with-openssl=DIR],[location of openssl]),
56 [
57 CPPFLAGS="$CPPFLAGS -I${withval}/include"
58 LIBS="$LIBS -L${withval}/lib"
59 ],[])
60
61 AC_CHECK_HEADER([openssl/ssl.h],,
62 [
63 OPENSSL_FOUND=no
64 ],[])
65
66 if test x$OPENSSL_FOUND != xno; then
67 LIBS="$LIBS -lssl -lcrypto"
68 fi
69
70 AM_CONDITIONAL(HAVE_OPENSSL,test x$OPENSSL_FOUND != xno)
71
72 WINDOWS=no
73 case $host in
74 *-*-linux*)
75 CXXFLAGS="$CXXFLAGS -pthread"
76 LDFLAGS="$LDFLAGS -pthread"
77 LIBS="$LIBS -lrt"
78 ;;
79 *-*-solaris*)
80 if test "$GXX" = yes; then
81 CXXFLAGS="$CXXFLAGS -D_PTHREADS"
82 else
83 # We'll assume Sun's CC.
84 CXXFLAGS="$CXXFLAGS -mt"
85 fi
86 LIBS="$LIBS -lsocket -lnsl -lpthread"
87 ;;
88 *-*-mingw32*)
89 CXXFLAGS="$CXXFLAGS -mthreads"
90 LDFLAGS="$LDFLAGS -mthreads"
91 LIBS="$LIBS -lws2_32 -lmswsock"
92 WINDOWS=yes
93 ;;
94 *-*-mingw64*)
95 CXXFLAGS="$CXXFLAGS -mthreads"
96 LDFLAGS="$LDFLAGS -mthreads"
97 LIBS="$LIBS -lws2_32 -lmswsock"
98 WINDOWS=yes
99 ;;
100 *-pc-cygwin*)
101 CXXFLAGS="$CXXFLAGS -D__USE_W32_SOCKETS -D_WIN32_WINNT=0x0601"
102 LIBS="$LIBS -lws2_32 -lmswsock"
103 WINDOWS=yes
104 ;;
105 *-apple-darwin*)
106 CXXFLAGS="$CXXFLAGS"
107 LDFLAGS="$LDFLAGS"
108 ;;
109 *-*-freebsd*)
110 CXXFLAGS="$CXXFLAGS -pthread"
111 LDFLAGS="$LDFLAGS -pthread"
112 ;;
113 *-*-netbsd*)
114 CXXFLAGS="$CXXFLAGS -pthread"
115 LDFLAGS="$LDFLAGS -pthread"
116 ;;
117 *-*-haiku*)
118 CXXFLAGS="$CXXFLAGS -lnetwork"
119 LDFLAGS="$LDFLAGS -lnetwork"
120
121 esac
122
123 if test "$GXX" = yes; then
124 CXXFLAGS="$CXXFLAGS -ftemplate-depth-256"
125 fi
126
127 if test "$STANDALONE" = yes; then
128 CPPFLAGS="$CPPFLAGS -DASIO_STANDALONE"
129 fi
130
131 if test "$SEPARATE_COMPILATION" = yes; then
132 CPPFLAGS="$CPPFLAGS -DASIO_SEPARATE_COMPILATION"
133 fi
134
135 AC_MSG_CHECKING([whether C++11 is enabled])
136 AC_COMPILE_IFELSE(
137 [AC_LANG_PROGRAM(
138 [[#if __cplusplus < 201103L]]
139 [[#error C++11 not available]]
140 [[#endif]])],
141 [AC_MSG_RESULT([yes])
142 HAVE_CXX11=yes;],
143 [AC_MSG_RESULT([no])
144 HAVE_CXX11=no;])
145
146 AC_MSG_CHECKING([whether C++14 is enabled])
147 AC_COMPILE_IFELSE(
148 [AC_LANG_PROGRAM(
149 [[#if defined(__GNUC__) && !defined(__clang__)]]
150 [[# if (__GNUC__ <= 6)]]
151 [[# error C++14 support on this compiler not sufficiently compliant]]
152 [[# endif]]
153 [[#endif]]
154 [[#if __cplusplus < 201402L]]
155 [[#error C++14 not available]]
156 [[#endif]])],
157 [AC_MSG_RESULT([yes])
158 HAVE_CXX14=yes;],
159 [AC_MSG_RESULT([no])
160 HAVE_CXX14=no;])
161
162 AC_MSG_CHECKING([whether C++17 is enabled])
163 AC_COMPILE_IFELSE(
164 [AC_LANG_PROGRAM(
165 [[#if __cplusplus < 201703L]]
166 [[#error C++17 not available]]
167 [[#endif]])],
168 [AC_MSG_RESULT([yes])
169 HAVE_CXX17=yes;],
170 [AC_MSG_RESULT([no])
171 HAVE_CXX17=no;])
172
173 AC_MSG_CHECKING([whether C++20 is enabled])
174 AC_COMPILE_IFELSE(
175 [AC_LANG_PROGRAM(
176 [[#if __cplusplus < 202002L]]
177 [[#error C++20 not available]]
178 [[#endif]])],
179 [AC_MSG_RESULT([yes])
180 HAVE_CXX20=yes;],
181 [AC_MSG_RESULT([no])
182 HAVE_CXX20=no;])
183
184 AC_MSG_CHECKING([whether coroutines are enabled])
185 AC_COMPILE_IFELSE(
186 [AC_LANG_PROGRAM(
187 [[#if defined(__clang__)]]
188 [[# if (__clang_major__ >= 14)]]
189 [[# if (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)]]
190 [[# if __has_include(<coroutine>)]]
191 [[# define ASIO_HAS_CO_AWAIT 1]]
192 [[# endif]]
193 [[# elif (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)]]
194 [[# if __has_include(<experimental/coroutine>)]]
195 [[# define ASIO_HAS_CO_AWAIT 1]]
196 [[# endif]]
197 [[# endif]]
198 [[# else]]
199 [[# if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)]]
200 [[# if __has_include(<experimental/coroutine>)]]
201 [[# define ASIO_HAS_CO_AWAIT 1]]
202 [[# endif]]
203 [[# endif]]
204 [[# endif]]
205 [[#elif defined(__GNUC__)]]
206 [[# if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)]]
207 [[# if __has_include(<coroutine>)]]
208 [[# define ASIO_HAS_CO_AWAIT 1]]
209 [[# endif]]
210 [[# endif]]
211 [[#endif]]
212 [[#ifndef ASIO_HAS_CO_AWAIT]]
213 [[# error coroutines not available]]
214 [[#endif]])],
215 [AC_MSG_RESULT([yes])
216 HAVE_COROUTINES=yes;],
217 [AC_MSG_RESULT([no])
218 HAVE_COROUTINES=no;])
219
220 if test "$GXX" = yes; then
221 if test "$STANDALONE" = yes; then
222 if test "$HAVE_CXX11" = no; then
223 HAVE_CXX11=yes
224 CPPFLAGS="-std=c++0x $CPPFLAGS"
225 fi
226 fi
227 fi
228
229 AM_CONDITIONAL(STANDALONE,test x$STANDALONE = xyes)
230
231 AM_CONDITIONAL(SEPARATE_COMPILATION,test x$SEPARATE_COMPILATION = xyes)
232
233 AM_CONDITIONAL(HAVE_BOOST_COROUTINE,test x$HAVE_BOOST_COROUTINE = xyes)
234
235 AM_CONDITIONAL(WINDOWS_TARGET,test x$WINDOWS != xno)
236
237 AM_CONDITIONAL(HAVE_CXX11,test x$HAVE_CXX11 = xyes)
238
239 AM_CONDITIONAL(HAVE_CXX14,test x$HAVE_CXX14 = xyes)
240
241 AM_CONDITIONAL(HAVE_CXX17,test x$HAVE_CXX17 = xyes)
242
243 AM_CONDITIONAL(HAVE_CXX20,test x$HAVE_CXX20 = xyes)
244
245 AM_CONDITIONAL(HAVE_COROUTINES,test x$HAVE_COROUTINES = xyes)
246
247 AC_CONFIG_FILES([asio.pc])
248
249 AC_CONFIG_FILES([
250 Makefile
251 include/Makefile
252 src/Makefile
253 src/tests/Makefile
254 src/tests/properties/Makefile
255 src/examples/cpp11/Makefile
256 src/examples/cpp14/Makefile
257 src/examples/cpp17/Makefile
258 src/examples/cpp20/Makefile])
259 AC_OUTPUT