Extend configure script to check for environ declaration in stdlib.h.
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sun, 10 May 2009 20:10:11 +0000 (20:10 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sun, 10 May 2009 20:10:11 +0000 (20:10 +0000)
Patch contributed by Martin Thomas <mthomas@rhrk.uni-kl.de>.

git-svn-id: svn://svn.berlios.de/openocd/trunk@1693 b42882b7-edfa-0310-969c-e2dbd0fdcd60

configure.in

index bbd22d1efd23a06d838199e1af64d4b5a2485b57..a6177e1d9d60fb9c46e942f470c25fba4ed0ff2d 100644 (file)
@@ -788,11 +788,12 @@ AC_PROG_CC_C99
 AM_PROG_CC_C_O
 AC_PROG_RANLIB
 
-# Look for environ alternatives.  Possibility #1: is environ in unistd.h?
-AC_MSG_CHECKING([for environ in unistd.h])
+# Look for environ alternatives.  Possibility #1: is environ in unistd.h or stdlib.h?
+AC_MSG_CHECKING([for environ in unistd.h and stdlib.h])
 AC_COMPILE_IFELSE([
 #define _GNU_SOURCE
 #include <unistd.h>
+#include <stdlib.h>
 int main(int argc, char **argv) { char **ep = environ; }
   ], [
     AC_MSG_RESULT([yes])