diff --git a/configure b/configure
index d74a83e23925188a56c24b4ae42a67b102c677b1..706f1073ee334d4c6cccc74fbc044e6d0b692fee 100755
--- a/configure
+++ b/configure
@@ -4147,12 +4147,11 @@ EOF
         eval ${pfx}libc_type=default
         add_${pfx}cppflags -D_DEFAULT_SOURCE
     fi
+    eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
 }
 
 probe_libc
-test -n "$libc_type" && enable libc_$libc_type
 probe_libc host_
-test -n "$host_libc_type" && enable host_libc_$host_libc_type
 
 # hacks for compiler/libc/os combinations