aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac256
1 files changed, 227 insertions, 29 deletions
diff --git a/configure.ac b/configure.ac
index 31ae78ec..1b6310da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3048,8 +3048,8 @@ AC_MSG_RESULT([[$enable_bauth]])
3048AC_MSG_CHECKING([[whether to support HTTP Digest authentication]]) 3048AC_MSG_CHECKING([[whether to support HTTP Digest authentication]])
3049AC_ARG_ENABLE([dauth], 3049AC_ARG_ENABLE([dauth],
3050 [AS_HELP_STRING([--disable-dauth], [disable HTTP Digest Authentication support])], 3050 [AS_HELP_STRING([--disable-dauth], [disable HTTP Digest Authentication support])],
3051 [enable_dauth=${enableval}], 3051 [enable_dauth="${enableval}"],
3052 [enable_dauth=yes]) 3052 [enable_dauth="yes"])
3053AS_IF([[test "x$enable_dauth" != "xno"]], 3053AS_IF([[test "x$enable_dauth" != "xno"]],
3054 [ enable_dauth=yes 3054 [ enable_dauth=yes
3055 AC_DEFINE([DAUTH_SUPPORT],[1],[Define to 1 if libmicrohttpd is compiled with Digest Auth support.]) ]) 3055 AC_DEFINE([DAUTH_SUPPORT],[1],[Define to 1 if libmicrohttpd is compiled with Digest Auth support.]) ])
@@ -3084,57 +3084,249 @@ AC_MSG_RESULT([[$enable_cookie]])
3084 3084
3085# optional: MD5 support for Digest Auth. Enabled by default. 3085# optional: MD5 support for Digest Auth. Enabled by default.
3086AC_ARG_ENABLE([[md5]], 3086AC_ARG_ENABLE([[md5]],
3087 [AS_HELP_STRING([[--disable-md5]],[disable MD5 hashing support for Digest Authentication]) 3087 [AS_HELP_STRING([[--enable-md5=TYPE]],[enable TYPE of MD5 hashing code (yes, no, builtin, tlslib) [yes if dauth enabled]])
3088 ], 3088 ],
3089 [ 3089 [
3090 AS_VAR_IF([[enable_md5]],[["yes"]], 3090 AS_VAR_IF([enable_md5],["internal"],[enable_md5='builtin'])
3091 AS_VAR_IF([enable_md5],["built-in"],[enable_md5='builtin'])
3092 AS_VAR_IF([enable_dauth],["yes"],[],
3091 [ 3093 [
3092 AS_VAR_IF([enable_dauth],["yes"],[], 3094 AS_VAR_IF([enable_md5],["no"],[],
3093 [ 3095 [
3094 AC_MSG_WARN([The parameter --enable-md5 is ignored as Digest Authentication is disabled]) 3096 AC_MSG_WARN([The parameter --enable-md5=${enable_md5} is ignored as Digest Authentication is disabled])
3095 enable_md5='no' 3097 enable_md5='no'
3096 ] 3098 ]
3097 ) 3099 )
3098 ],[[enable_md5='no']] 3100 ]
3099 ) 3101 )
3100 ], [[enable_md5="${enable_dauth}"]] 3102 ], [[enable_md5="${enable_dauth}"]]
3101) 3103)
3104AS_CASE([${enable_md5}],[yes|tlslib],
3105 [
3106 AS_IF([test "x${enable_compact_code}" != "xno" || test "x$enable_md5" = "xtlslib"],
3107 [
3108 AS_IF([test "x$enable_https" = "xyes"],
3109 [
3110 AC_CACHE_CHECK([whether GnuTLS supports MD5 hashing],[mhd_cv_gnutls_md5],
3111 [
3112 CFLAGS="${CFLAGS_ac} ${GNUTLS_CFLAGS} ${user_CFLAGS}"
3113 CPPFLAGS="${CPPFLAGS_ac} ${MHD_TLS_LIB_CPPFLAGS} ${user_CPPFLAGS}"
3114 CFLAGS="${CFLAGS_ac} ${MHD_TLS_LIB_CFLAGS} ${user_CFLAGS}"
3115 LDFLAGS="${LDFLAGS_ac} ${MHD_TLS_LIB_LDFLAGS} ${user_LDFLAGS}"
3116 save_LIBS="$LIBS"
3117 LIBS="${MHD_TLS_LIBDEPS} ${LIBS}"
3118 AC_LINK_IFELSE(
3119 [
3120 AC_LANG_PROGRAM(
3121 [[
3122#include <gnutls/crypto.h>
3123 ]],
3124 [[
3125 gnutls_hash_hd_t hash_handle;
3126 unsigned char digest[16];
3127 int exit_code;
3128
3129 if (0 == gnutls_hash_init(&hash_handle, GNUTLS_DIG_MD5))
3130 {
3131 if (0 == gnutls_hash(hash_handle, "", 1))
3132 {
3133 gnutls_hash_output(hash_handle, digest);
3134 if (0x93 == digest[0])
3135 exit_code = 0;
3136 else
3137 exit_code = 7;
3138 }
3139 else
3140 exit_code = 5;
3141 gnutls_hash_deinit(hash_handle, (void *)0);
3142 }
3143 else
3144 exit_code = 2;
3145 if (exit_code)
3146 return exit_code;
3147 ]]
3148 )
3149 ],
3150 [mhd_cv_gnutls_md5='yes'],[mhd_cv_gnutls_md5='no']
3151 )
3152 LIBS="${save_LIBS}"
3153 CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
3154 CPPFLAGS="${CPPFLAGS_ac} ${user_CPPFLAGS}"
3155 CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
3156 LDFLAGS="${LDFLAGS_ac} ${user_LDFLAGS}"
3157 ]
3158 )
3159 AS_VAR_IF([mhd_cv_gnutls_md5],["no"],
3160 [
3161 AS_VAR_IF([enable_md5],["tlslib"],
3162 [AC_MSG_FAILURE([TLS library MD5 implementation is not available])]
3163 )
3164 enable_md5="builtin"
3165 ],
3166 [enable_md5="tlslib"]
3167 )
3168 ],
3169 [
3170 AS_VAR_IF([enable_md5],["tlslib"],
3171 [AC_MSG_ERROR([HTTPS is not enabled, TLS library MD5 implementation cannot be used])]
3172 )
3173 enable_md5="builtin"
3174 ]
3175 )
3176 ],
3177 [
3178 enable_md5="builtin"
3179 ]
3180 )
3181 ]
3182)
3102AC_MSG_CHECKING([[whether to support MD5]]) 3183AC_MSG_CHECKING([[whether to support MD5]])
3103AS_VAR_IF([[enable_md5]],[["yes"]], 3184AS_UNSET([enable_md5_MSG])
3185AS_CASE([${enable_md5}],
3186 [builtin],[enable_md5_MSG='yes, built-in'],
3187 [tlslib],[enable_md5_MSG='yes, external (TLS library)'],
3188 [no],[enable_md5_MSG='no'],
3189 [yes],[AC_MSG_ERROR([configure internal error: unexpected variable value])],
3190 [AC_MSG_ERROR([Unrecognized parameter --enable-md5=${enable_md5}])]
3191)
3192AS_IF([test "x${enable_md5}" = "xbuiltin" || test "x${enable_md5}" = "xtlslib" ],
3104 [ 3193 [
3105 AC_DEFINE([[MHD_MD5_SUPPORT]],[[1]], 3194 AC_DEFINE([[MHD_MD5_SUPPORT]],[[1]],
3106 [Define to 1 if libmicrohttpd is compiled with MD5 hashing support.]) 3195 [Define to 1 if libmicrohttpd is compiled with MD5 hashing support.])
3107 ] 3196 ]
3108) 3197)
3109AM_CONDITIONAL([ENABLE_MD5], [[test "x${enable_md5}" = "xyes"]]) 3198AS_IF([test "x${enable_md5}" = "xtlslib" ],
3110AC_MSG_RESULT([[${enable_md5}]]) 3199 [
3200 AC_DEFINE([[MHD_MD5_TLSLIB]],[[1]],
3201 [Define to 1 if libmicrohttpd is compiled with MD5 hashing by TLS library.])
3202 ]
3203)
3204AM_CONDITIONAL([ENABLE_MD5], [[test "x${enable_md5}" = "xbuiltin" || test "x${enable_md5}" = "xtlslib" ]])
3205AM_CONDITIONAL([ENABLE_MD5_EXT], [[test "x${enable_md5}" = "xtlslib" ]])
3206AC_MSG_RESULT([[${enable_md5_MSG}]])
3111 3207
3112# optional: SHA-256 support for Digest Auth. Enabled by default. 3208# optional: SHA-256 support for Digest Auth. Enabled by default.
3113AC_ARG_ENABLE([[sha256]], 3209AC_ARG_ENABLE([[sha256]],
3114 [AS_HELP_STRING([[--disable-sha256]],[disable SHA-256 hashing support for Digest Authentication]) 3210 [AS_HELP_STRING([[--enable-sha256=TYPE]],[enable TYPE of SHA-256 hashing code (yes, no, builtin, tlslib) [yes if dauth enabled]])
3115 ], 3211 ],
3116 [ 3212 [
3117 AS_VAR_IF([[enable_sha256]],[["yes"]], 3213 AS_VAR_IF([enable_sha256],["internal"],[enable_sha256='builtin'])
3214 AS_VAR_IF([enable_sha256],["built-in"],[enable_sha256='builtin'])
3215 AS_VAR_IF([enable_dauth],["yes"],[],
3118 [ 3216 [
3119 AS_VAR_IF([enable_dauth],["yes"],[], 3217 AS_VAR_IF([enable_sha256],["no"],[],
3120 [ 3218 [
3121 AC_MSG_WARN([The parameter --enable-sha256 is ignored as Digest Authentication is disabled]) 3219 AC_MSG_WARN([The parameter --enable-sha256=${enable_sha256} is ignored as Digest Authentication is disabled])
3122 enable_sha256='no' 3220 enable_sha256='no'
3123 ] 3221 ]
3124 ) 3222 )
3125 ],[[enable_sha256='no']] 3223 ]
3126 ) 3224 )
3127 ], [[enable_sha256="${enable_dauth}"]] 3225 ], [[enable_sha256="${enable_dauth}"]]
3128) 3226)
3227AS_CASE([${enable_sha256}],[yes|tlslib],
3228 [
3229 AS_IF([test "x${enable_compact_code}" != "xno" || test "x$enable_sha256" = "xtlslib"],
3230 [
3231 AS_IF([test "x$enable_https" = "xyes"],
3232 [
3233 AC_CACHE_CHECK([whether GnuTLS supports sha256 hashing],[mhd_cv_gnutls_sha256],
3234 [
3235 CFLAGS="${CFLAGS_ac} ${GNUTLS_CFLAGS} ${user_CFLAGS}"
3236 CPPFLAGS="${CPPFLAGS_ac} ${MHD_TLS_LIB_CPPFLAGS} ${user_CPPFLAGS}"
3237 CFLAGS="${CFLAGS_ac} ${MHD_TLS_LIB_CFLAGS} ${user_CFLAGS}"
3238 LDFLAGS="${LDFLAGS_ac} ${MHD_TLS_LIB_LDFLAGS} ${user_LDFLAGS}"
3239 save_LIBS="$LIBS"
3240 LIBS="${MHD_TLS_LIBDEPS} ${LIBS}"
3241 AC_LINK_IFELSE(
3242 [
3243 AC_LANG_PROGRAM(
3244 [[
3245#include <gnutls/crypto.h>
3246 ]],
3247 [[
3248 gnutls_hash_hd_t hash_handle;
3249 unsigned char digest[32];
3250 int exit_code;
3251
3252 if (0 == gnutls_hash_init(&hash_handle, GNUTLS_DIG_SHA256))
3253 {
3254 if (0 == gnutls_hash(hash_handle, "", 1))
3255 {
3256 gnutls_hash_output(hash_handle, digest);
3257 if (0x6e == digest[0])
3258 exit_code = 0;
3259 else
3260 exit_code = 7;
3261 }
3262 else
3263 exit_code = 5;
3264 gnutls_hash_deinit(hash_handle, (void *)0);
3265 }
3266 else
3267 exit_code = 2;
3268 if (exit_code)
3269 return exit_code;
3270 ]]
3271 )
3272 ],
3273 [mhd_cv_gnutls_sha256='yes'],[mhd_cv_gnutls_sha256='no']
3274 )
3275 LIBS="${save_LIBS}"
3276 CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
3277 CPPFLAGS="${CPPFLAGS_ac} ${user_CPPFLAGS}"
3278 CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
3279 LDFLAGS="${LDFLAGS_ac} ${user_LDFLAGS}"
3280 ]
3281 )
3282 AS_VAR_IF([mhd_cv_gnutls_sha256],["no"],
3283 [
3284 AS_VAR_IF([enable_sha256],["tlslib"],
3285 [AC_MSG_FAILURE([TLS library SHA-256 implementation is not available])]
3286 )
3287 enable_sha256="builtin"
3288 ],
3289 [enable_sha256="tlslib"]
3290 )
3291 ],
3292 [
3293 AS_VAR_IF([enable_sha256],["tlslib"],
3294 [AC_MSG_ERROR([HTTPS is not enabled, TLS library SHA-256 implementation cannot be used])]
3295 )
3296 enable_sha256="builtin"
3297 ]
3298 )
3299 ],
3300 [
3301 enable_sha256="builtin"
3302 ]
3303 )
3304 ]
3305)
3129AC_MSG_CHECKING([[whether to support SHA-256]]) 3306AC_MSG_CHECKING([[whether to support SHA-256]])
3130AS_VAR_IF([[enable_sha256]],[["yes"]], 3307AS_UNSET([enable_sha256_MSG])
3308AS_CASE([${enable_sha256}],
3309 [builtin],[enable_sha256_MSG='yes, built-in'],
3310 [tlslib],[enable_sha256_MSG='yes, external (TLS library)'],
3311 [no],[enable_sha256_MSG='no'],
3312 [yes],[AC_MSG_ERROR([configure internal error: unexpected variable value])],
3313 [AC_MSG_ERROR([Unrecognized parameter --enable-sha256=${enable_sha256}])]
3314)
3315AS_IF([test "x${enable_sha256}" = "xbuiltin" || test "x${enable_sha256}" = "xtlslib" ],
3131 [ 3316 [
3132 AC_DEFINE([[MHD_SHA256_SUPPORT]],[[1]], 3317 AC_DEFINE([[MHD_SHA256_SUPPORT]],[[1]],
3133 [Define to 1 if libmicrohttpd is compiled with SHA-256 hashing support.]) 3318 [Define to 1 if libmicrohttpd is compiled with SHA-256 hashing support.])
3134 ] 3319 ]
3135) 3320)
3136AM_CONDITIONAL([ENABLE_SHA256], [[test "x${enable_sha256}" = "xyes"]]) 3321AS_IF([test "x${enable_sha256}" = "xtlslib" ],
3137AC_MSG_RESULT([[${enable_sha256}]]) 3322 [
3323 AC_DEFINE([[MHD_SHA256_TLSLIB]],[[1]],
3324 [Define to 1 if libmicrohttpd is compiled with SHA-256 hashing by TLS library.])
3325 ]
3326)
3327AM_CONDITIONAL([ENABLE_SHA256], [[test "x${enable_sha256}" = "xbuiltin" || test "x${enable_sha256}" = "xtlslib" ]])
3328AM_CONDITIONAL([ENABLE_SHA256_EXT], [[test "x${enable_sha256}" = "xtlslib" ]])
3329AC_MSG_RESULT([[${enable_sha256_MSG}]])
3138 3330
3139# optional: SHA-512/256 support for Digest Auth. Enabled by default. 3331# optional: SHA-512/256 support for Digest Auth. Enabled by default.
3140AC_ARG_ENABLE([[sha512-256]], 3332AC_ARG_ENABLE([[sha512-256]],
@@ -3154,6 +3346,12 @@ AC_ARG_ENABLE([[sha512-256]],
3154 ], [[enable_sha512_256="${enable_dauth}"]] 3346 ], [[enable_sha512_256="${enable_dauth}"]]
3155) 3347)
3156AC_MSG_CHECKING([[whether to support SHA-512/256]]) 3348AC_MSG_CHECKING([[whether to support SHA-512/256]])
3349AS_UNSET([enable_sha512_256_MSG])
3350AS_CASE([${enable_sha512_256}],
3351 [yes],[enable_sha512_256_MSG='yes, built-in'],
3352 [no],[enable_sha512_256_MSG='no'],
3353 [AC_MSG_ERROR([Unrecognized parameter --enable-sha512-256=${enable_sha512_256}])]
3354)
3157AS_VAR_IF([[enable_sha512_256]],[["yes"]], 3355AS_VAR_IF([[enable_sha512_256]],[["yes"]],
3158 [ 3356 [
3159 AC_DEFINE([[MHD_SHA512_256_SUPPORT]],[[1]], 3357 AC_DEFINE([[MHD_SHA512_256_SUPPORT]],[[1]],
@@ -3161,11 +3359,11 @@ AS_VAR_IF([[enable_sha512_256]],[["yes"]],
3161 ] 3359 ]
3162) 3360)
3163AM_CONDITIONAL([ENABLE_SHA512_256], [[test "x${enable_sha512_256}" = "xyes"]]) 3361AM_CONDITIONAL([ENABLE_SHA512_256], [[test "x${enable_sha512_256}" = "xyes"]])
3164AC_MSG_RESULT([[${enable_sha512_256}]]) 3362AC_MSG_RESULT([[${enable_sha512_256_MSG}]])
3165 3363
3166AS_IF([test "x$enable_dauth" != "xno"], 3364AS_IF([test "x$enable_dauth" != "xno"],
3167 [ 3365 [
3168 AS_IF([test "x${enable_md5}" != "xyes" && test "x${enable_sha256}" != "xyes" && test "x${enable_sha512_256}" != "xyes"], 3366 AS_IF([test "x${enable_md5}" = "xno" && test "x${enable_sha256}" = "xno" && test "x${enable_sha512_256}" != "xyes"],
3169 [AC_MSG_ERROR([At least one hashing algorithm must be enabled if Digest Auth is enabled])] 3367 [AC_MSG_ERROR([At least one hashing algorithm must be enabled if Digest Auth is enabled])]
3170 ) 3368 )
3171 ] 3369 ]
@@ -4052,9 +4250,9 @@ AC_MSG_NOTICE([GNU libmicrohttpd ${PACKAGE_VERSION} Configuration Summary:
4052 Messages: ${enable_messages} 4250 Messages: ${enable_messages}
4053 Basic auth.: ${enable_bauth} 4251 Basic auth.: ${enable_bauth}
4054 Digest auth.: ${enable_dauth} 4252 Digest auth.: ${enable_dauth}
4055 MD5: ${enable_md5} 4253 MD5: ${enable_md5_MSG}
4056 SHA-256: ${enable_sha256} 4254 SHA-256: ${enable_sha256_MSG}
4057 SHA-512/256: ${enable_sha512_256} 4255 SHA-512/256: ${enable_sha512_256_MSG}
4058 HTTP "Upgrade": ${enable_httpupgrade} 4256 HTTP "Upgrade": ${enable_httpupgrade}
4059 Cookie parsing: ${enable_cookie} 4257 Cookie parsing: ${enable_cookie}
4060 Postproc: ${enable_postprocessor} 4258 Postproc: ${enable_postprocessor}
@@ -4075,8 +4273,8 @@ AS_IF([test "x$enable_https" = "xyes"],
4075 4273
4076AS_IF([test "x$enable_bauth" != "xyes" || \ 4274AS_IF([test "x$enable_bauth" != "xyes" || \
4077 test "x$enable_dauth" != "xyes" || \ 4275 test "x$enable_dauth" != "xyes" || \
4078 test "x${enable_md5}" != "xyes" || \ 4276 test "x${enable_md5}" = "xno" || \
4079 test "x${enable_sha256}" != "xyes" || \ 4277 test "x${enable_sha256}" = "xno" || \
4080 test "x${enable_sha512_256}" != "xyes" || \ 4278 test "x${enable_sha512_256}" != "xyes" || \
4081 test "x$enable_httpupgrade" != "xyes" || \ 4279 test "x$enable_httpupgrade" != "xyes" || \
4082 test "x$enable_cookie" != "xyes" || \ 4280 test "x$enable_cookie" != "xyes" || \