fix compilation on mac os x
authorVincent Torri <vincent.torri@gmail.com>
Sat, 6 Mar 2010 16:46:08 +0000 (16:46 +0000)
committerVincent Torri <vincent.torri@gmail.com>
Sat, 6 Mar 2010 16:46:08 +0000 (16:46 +0000)
based on a patch by Leif Middelschulte

SVN revision: 46911

configure.ac
src/lib/elm_main.c

index 96df07c..f94b1fd 100644 (file)
@@ -94,6 +94,12 @@ dnl managed by evil
       have_socket="yes"
       AC_CHECK_LIB([socket], [connect], [], [have_socket="no"])
       ;;
+   darwin*)
+      ELM_UNIX_DEF="#define"
+      have_socket="yes"
+      AC_CHECK_HEADERS([crt_externs.h])
+      AC_DEFINE([environ], [(*_NSGetEnviron())], [apple doesn't follow POSIX in this case.])
+      ;;
    *)
       ELM_UNIX_DEF="#define"
       AC_CHECK_FUNCS(dlopen, res=yes, res=no)
index 657c14b..28b2e83 100644 (file)
@@ -1,11 +1,15 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE
 #endif
 
 #include <dlfcn.h>      /* dlopen,dlclose,etc */
 
-#ifdef HAVE_CONFIG_H
-# include "elementary_config.h"
+#ifdef HAVE_CRT_EXTERNS_H
+# include <crt_externs.h>
 #endif
 
 #ifdef HAVE_EVIL