aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-06-07 08:30:36 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-06-07 08:30:36 +0000
commit18dd8154e26aac133001a7f4d9cc59b81700c4a8 (patch)
tree30e176ea2636b5ba65867f05ff14938042e391d7
parent4c587976079feab63c1ecf55c6e13c689d5cbaa1 (diff)
Reverted the previous change and redid it differently as it seemed to not
work. This is supposed to detect cross-compiling and alert the user, and not do the POSIX-check for strerror_r() if it already detected a glibc-compatible strerror_r().
-rw-r--r--acinclude.m434
1 files changed, 18 insertions, 16 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 805e8b6e3..719f65d23 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -423,14 +423,18 @@ main () {
return 0;
}
],
- dnl if it worked fine
+ GLIBC_STRERROR_R="1"
AC_DEFINE(HAVE_GLIBC_STRERROR_R, 1, [we have a glibc-style strerror_r()])
AC_MSG_RESULT([yes]),
- dnl this didn't work!
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no]),
+ dnl cross-compiling!
+ AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!])
+ )
- AC_MSG_CHECKING([for a POSIX strerror_r API])
- AC_TRY_RUN([
+ if test -z "$GLIBC_STRERROR_R"; then
+
+ AC_MSG_CHECKING([for a POSIX strerror_r API])
+ AC_TRY_RUN([
#include <string.h>
#include <errno.h>
int
@@ -445,18 +449,16 @@ main () {
return 0;
}
],
- dnl it worked, we have POSIX-style strerror()
- AC_DEFINE(HAVE_POSIX_STRERROR_R, 1, [we have a POSIX-style strerror_r()])
- AC_MSG_RESULT([yes]),
- dnl it failed, we don't have POSIX-style
- AC_MSG_RESULT([no])
- ) dnl end of AC_TRY_RUN() for POSIX strerror_r()
+ AC_DEFINE(HAVE_POSIX_STRERROR_R, 1, [we have a POSIX-style strerror_r()])
+ AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([no]) ,
+ dnl cross-compiling!
+ AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!])
+ )
- dnl cross-compiling!
- ,
- AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!])
- ) dnl end of AC_TRY_RUN() for glibc strerror_r()
- fi
+ fi dnl if not using glibc API
+
+ fi dnl we have a strerror_r
])