diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-05-13 09:22:52 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-05-13 09:22:52 +0200 |
commit | 8588d6da95f73f04f49013ec54654975ffab9f7b (patch) | |
tree | 23b8642d832783c9036e307164054445c5e557be /configure.ac | |
parent | d0e81c8e0fb9676602db14a4120235f1524b1306 (diff) | |
download | libmicrohttpd-8588d6da95f73f04f49013ec54654975ffab9f7b.tar.gz libmicrohttpd-8588d6da95f73f04f49013ec54654975ffab9f7b.zip |
use AS_CASE/AS_IF
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 111 |
1 files changed, 51 insertions, 60 deletions
diff --git a/configure.ac b/configure.ac index c977f746..e61b28e1 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -267,58 +267,50 @@ CFLAGS="$save_CFLAGS" | |||
267 | # Check system type | 267 | # Check system type |
268 | shutdown_trig_select='no' | 268 | shutdown_trig_select='no' |
269 | AC_MSG_CHECKING([[for target host OS]]) | 269 | AC_MSG_CHECKING([[for target host OS]]) |
270 | case "$host_os" in | 270 | AS_CASE(["$host_os"], |
271 | *darwin* | *rhapsody* | *macosx*) | 271 | [*darwin* | *rhapsody* | *macosx*], |
272 | AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system]) | 272 | [AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system]) |
273 | CFLAGS="-no-cpp-precomp -fno-common $CFLAGS" | 273 | CFLAGS="-no-cpp-precomp -fno-common $CFLAGS" |
274 | mhd_host_os='Darwin' | 274 | mhd_host_os='Darwin' |
275 | AC_MSG_RESULT([[$mhd_host_os]]) | 275 | AC_MSG_RESULT([[$mhd_host_os]])], |
276 | ;; | 276 | [freebsd*], |
277 | freebsd*) | 277 | [AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) |
278 | AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) | ||
279 | AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system]) | 278 | AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system]) |
280 | mhd_host_os='FreeBSD' | 279 | mhd_host_os='FreeBSD' |
281 | AC_MSG_RESULT([[$mhd_host_os]]) | 280 | AC_MSG_RESULT([[$mhd_host_os]])], |
282 | ;; | 281 | [openbsd*], |
283 | openbsd*) | 282 | [AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) |
284 | AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) | ||
285 | AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system]) | 283 | AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system]) |
286 | mhd_host_os='OpenBSD' | 284 | mhd_host_os='OpenBSD' |
287 | AC_MSG_RESULT([[$mhd_host_os]]) | 285 | AC_MSG_RESULT([[$mhd_host_os]])], |
288 | ;; | 286 | [netbsd*], |
289 | netbsd*) | 287 | [AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) |
290 | AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) | ||
291 | AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system]) | 288 | AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system]) |
292 | mhd_host_os='NetBSD' | 289 | mhd_host_os='NetBSD' |
293 | AC_MSG_RESULT([[$mhd_host_os]]) | 290 | AC_MSG_RESULT([[$mhd_host_os]])], |
294 | ;; | 291 | [*solaris*], |
295 | *solaris*) | 292 | [AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system]) |
296 | AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system]) | ||
297 | AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work]) | 293 | AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work]) |
298 | mhd_host_os='Solaris' | 294 | mhd_host_os='Solaris' |
299 | AC_MSG_RESULT([[$mhd_host_os]]) | 295 | AC_MSG_RESULT([[$mhd_host_os]]) |
300 | AC_SEARCH_LIBS(gethostbyname, nsl) | 296 | AC_SEARCH_LIBS(gethostbyname, nsl) |
301 | AC_SEARCH_LIBS(socket, socket) | 297 | AC_SEARCH_LIBS(socket, socket)], |
302 | ;; | 298 | [*arm-linux*], |
303 | *arm-linux*) | 299 | [AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel]) |
304 | AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel]) | ||
305 | mhd_host_os='ARM Linux' | 300 | mhd_host_os='ARM Linux' |
306 | AC_MSG_RESULT([[$mhd_host_os]]) | 301 | AC_MSG_RESULT([[$mhd_host_os]]) |
307 | CFLAGS="-fPIC -pipe $CFLAGS" | 302 | CFLAGS="-fPIC -pipe $CFLAGS"], |
308 | ;; | 303 | [*linux*], |
309 | *linux*) | 304 | [AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel]) |
310 | AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel]) | ||
311 | mhd_host_os='Linux' | 305 | mhd_host_os='Linux' |
312 | AC_MSG_RESULT([[$mhd_host_os]]) | 306 | AC_MSG_RESULT([[$mhd_host_os]])], |
313 | ;; | 307 | [*cygwin*], |
314 | *cygwin*) | 308 | [AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system]) |
315 | AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system]) | ||
316 | mhd_host_os='Windows (Cygwin)' | 309 | mhd_host_os='Windows (Cygwin)' |
317 | AC_MSG_RESULT([[$mhd_host_os]]) | 310 | AC_MSG_RESULT([[$mhd_host_os]]) |
318 | os_is_windows=yes | 311 | os_is_windows=yes], |
319 | ;; | 312 | [*mingw*], |
320 | *mingw*) | 313 | [AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) |
321 | AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) | ||
322 | AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) | 314 | AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) |
323 | mhd_host_os='Windows (MinGW)' | 315 | mhd_host_os='Windows (MinGW)' |
324 | AC_MSG_RESULT([[$mhd_host_os]]) | 316 | AC_MSG_RESULT([[$mhd_host_os]]) |
@@ -338,24 +330,22 @@ netbsd*) | |||
338 | AC_SUBST([lt_cv_objdir]) | 330 | AC_SUBST([lt_cv_objdir]) |
339 | os_is_windows=yes | 331 | os_is_windows=yes |
340 | os_is_native_w32=yes | 332 | os_is_native_w32=yes |
341 | ;; | 333 | ], |
342 | *openedition*) | 334 | [*openedition*], |
343 | AC_DEFINE_UNQUOTED(OS390,1,[This is a OS/390 system]) | 335 | [AC_DEFINE_UNQUOTED(OS390,1,[This is a OS/390 system]) |
344 | mhd_host_os='OS/390' | 336 | mhd_host_os='OS/390' |
345 | AC_MSG_RESULT([[$mhd_host_os]]) | 337 | AC_MSG_RESULT([[$mhd_host_os]])], |
346 | ;; | 338 | [gnu*], |
347 | gnu*) | 339 | [AC_DEFINE([[GNU_HURD]], [[1]], [Define to `1' if host machine runs on GNU Hurd.]) |
348 | AC_DEFINE([[GNU_HURD]], [[1]], [Define to `1' if host machine runs on GNU Hurd.]) | ||
349 | mhd_host_os='GNU Hurd' | 340 | mhd_host_os='GNU Hurd' |
350 | AC_MSG_RESULT([[$mhd_host_os]]) | 341 | AC_MSG_RESULT([[$mhd_host_os]]) |
351 | ;; | 342 | ], |
352 | *) | 343 | [ |
353 | mhd_host_os='unrecognised OS' | 344 | mhd_host_os='unrecognised OS' |
354 | AC_MSG_RESULT([[$mhd_host_os]]) | 345 | AC_MSG_RESULT([[$mhd_host_os]]) |
355 | AC_MSG_WARN([Unrecognised OS $host_os]) | 346 | AC_MSG_WARN([Unrecognised OS $host_os]) |
356 | AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) | 347 | AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) |
357 | ;; | 348 | ]) |
358 | esac | ||
359 | 349 | ||
360 | AM_CONDITIONAL([CYGWIN_TARGET], [[test "x$os_is_windows" = "xyes" && \ | 350 | AM_CONDITIONAL([CYGWIN_TARGET], [[test "x$os_is_windows" = "xyes" && \ |
361 | test "x${os_is_native_w32}" != "xyes"]]) | 351 | test "x${os_is_native_w32}" != "xyes"]]) |
@@ -1220,24 +1210,23 @@ AC_ARG_ENABLE([curl], | |||
1220 | [AS_HELP_STRING([--disable-curl],[disable cURL based testcases])], | 1210 | [AS_HELP_STRING([--disable-curl],[disable cURL based testcases])], |
1221 | [enable_curl=${enableval}]) | 1211 | [enable_curl=${enableval}]) |
1222 | curl=0 | 1212 | curl=0 |
1223 | if test "$enable_curl" != "no" | 1213 | AS_IF([test "$enable_curl" != "no"], |
1224 | then | 1214 | [LIBCURL_CHECK_CONFIG([yes],[7.16.4],[enable_curl=yes], |
1225 | LIBCURL_CHECK_CONFIG([yes],[7.16.4],[enable_curl=yes], | ||
1226 | [ | 1215 | [ |
1227 | if test "x$enable_curl" = "xyes"; then | 1216 | if test "x$enable_curl" = "xyes"; then |
1228 | AC_MSG_WARN([[cURL-based tests cannot be enabled because libcurl is missing]]) | 1217 | AC_MSG_WARN([[cURL-based tests cannot be enabled because libcurl is missing]]) |
1229 | fi | 1218 | fi |
1230 | enable_curl=no | 1219 | enable_curl=no |
1231 | ]) | 1220 | ]) |
1232 | fi | 1221 | ]) |
1233 | if test "$enable_curl" != "no" | 1222 | AS_IF([test "$enable_curl" != "no"], |
1234 | then | 1223 | [ |
1235 | # Lib cURL & cURL - OpenSSL versions | 1224 | # Lib cURL & cURL - OpenSSL versions |
1236 | AC_DEFINE([MHD_REQ_CURL_VERSION], ["7.16.4"], [required cURL version to run tests]) | 1225 | AC_DEFINE([MHD_REQ_CURL_VERSION], ["7.16.4"], [required cURL version to run tests]) |
1237 | AC_DEFINE([MHD_REQ_CURL_OPENSSL_VERSION], ["0.9.8"], [required cURL SSL version to run tests]) | 1226 | AC_DEFINE([MHD_REQ_CURL_OPENSSL_VERSION], ["0.9.8"], [required cURL SSL version to run tests]) |
1238 | AC_DEFINE([MHD_REQ_CURL_GNUTLS_VERSION], ["2.8.6"], [gnuTLS lib version - used in conjunction with cURL]) | 1227 | AC_DEFINE([MHD_REQ_CURL_GNUTLS_VERSION], ["2.8.6"], [gnuTLS lib version - used in conjunction with cURL]) |
1239 | AC_DEFINE([MHD_REQ_CURL_NSS_VERSION], ["3.12.0"], [NSS lib version - used in conjunction with cURL]) | 1228 | AC_DEFINE([MHD_REQ_CURL_NSS_VERSION], ["3.12.0"], [NSS lib version - used in conjunction with cURL]) |
1240 | fi | 1229 | ]) |
1241 | AM_CONDITIONAL([HAVE_CURL], [test "x$enable_curl" = "xyes"]) | 1230 | AM_CONDITIONAL([HAVE_CURL], [test "x$enable_curl" = "xyes"]) |
1242 | 1231 | ||
1243 | mhd_have_libmagic="no" | 1232 | mhd_have_libmagic="no" |
@@ -1501,8 +1490,7 @@ AC_ARG_ENABLE([https], | |||
1501 | [AS_HELP_STRING([--enable-https], | 1490 | [AS_HELP_STRING([--enable-https], |
1502 | [enable HTTPS support (yes, no, auto)[auto]])], | 1491 | [enable HTTPS support (yes, no, auto)[auto]])], |
1503 | [enable_https=${enableval}]) | 1492 | [enable_https=${enableval}]) |
1504 | if test "x$enable_https" != "xno" | 1493 | AS_IF([test "x$enable_https" != "xno"],[ |
1505 | then | ||
1506 | # | 1494 | # |
1507 | # Next block is large unindented block | 1495 | # Next block is large unindented block |
1508 | # | 1496 | # |
@@ -1693,9 +1681,6 @@ AS_IF([test "x$with_gnutls" != "xno" && test "x$have_gnutls" != "xyes"], | |||
1693 | ) | 1681 | ) |
1694 | AS_IF([test "x$have_gnutls" != "xyes" && test "x$with_gnutls" = "xyes"], | 1682 | AS_IF([test "x$have_gnutls" != "xyes" && test "x$with_gnutls" = "xyes"], |
1695 | [AC_MSG_ERROR([[can't find usable libgnutls]])]) | 1683 | [AC_MSG_ERROR([[can't find usable libgnutls]])]) |
1696 | # | ||
1697 | # End of large unindented block | ||
1698 | # | ||
1699 | 1684 | ||
1700 | AS_IF([test "x$have_gnutls" = "xyes"], | 1685 | AS_IF([test "x$have_gnutls" = "xyes"], |
1701 | [ | 1686 | [ |
@@ -1843,9 +1828,15 @@ choke me now | |||
1843 | AS_UNSET([GNUTLS_LIBS]) | 1828 | AS_UNSET([GNUTLS_LIBS]) |
1844 | ] | 1829 | ] |
1845 | ) | 1830 | ) |
1846 | else | 1831 | ],[ |
1847 | MSG_HTTPS="no (disabled)" | 1832 | MSG_HTTPS="no (disabled)" |
1848 | fi | 1833 | ]) |
1834 | |||
1835 | # | ||
1836 | # End of large unindented block | ||
1837 | # | ||
1838 | |||
1839 | |||
1849 | AC_MSG_CHECKING(whether to support HTTPS) | 1840 | AC_MSG_CHECKING(whether to support HTTPS) |
1850 | AC_MSG_RESULT([$MSG_HTTPS]) | 1841 | AC_MSG_RESULT([$MSG_HTTPS]) |
1851 | 1842 | ||