diff options
author | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-28 14:23:25 +0000 |
---|---|---|
committer | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-28 14:23:25 +0000 |
commit | af35f2a61d8027df2e70012ae736f91ee0e41b85 (patch) | |
tree | fa349978c1ead289859a0ff7f9119a627d09a86a | |
parent | 80b0c6ca3b15a621dbbe129f4770c7a2f404eebe (diff) |
* configure.in: check for the whether crt_externs.h is present when compiling
for darwin (this header is missing in the iOS SDK)
* eval_intern.h: check HAVE_CRT_EXTERNS_H before including crt_externs.h, if
not defined, include missing/crt_externs.h instead
* hash.c: ditto
* missing/setproctitle.c: ditto
* missing/crt_externs.h: declare _NSGetEnviron() function and define environ
for iOS
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | eval_intern.h | 6 | ||||
-rw-r--r-- | hash.c | 6 | ||||
-rw-r--r-- | missing/crt_externs.h | 8 | ||||
-rw-r--r-- | missing/setproctitle.c | 10 |
6 files changed, 42 insertions, 5 deletions
@@ -1,3 +1,14 @@ +Fri Dec 28 23:12:44 2012 Charlie Somerville <charlie@charliesomerville.com> + + * configure.in: check for the whether crt_externs.h is present when compiling + for darwin (this header is missing in the iOS SDK) + * eval_intern.h: check HAVE_CRT_EXTERNS_H before including crt_externs.h, if + not defined, include missing/crt_externs.h instead + * hash.c: ditto + * missing/setproctitle.c: ditto + * missing/crt_externs.h: declare _NSGetEnviron() function and define environ + for iOS + Fri Dec 28 21:40:36 2012 Keiju Ishitsuka <keiju@ishitsuka.com> * lib/irb/context.rb: IRB::Context#new: Check from JobManager diff --git a/configure.in b/configure.in index 3648814a9f..9e97d6113d 100644 --- a/configure.in +++ b/configure.in @@ -1220,6 +1220,12 @@ main() LINK_SO="$LINK_SO $POSTLINK" fi + AC_CACHE_CHECK(whether crt_externs.h is present for extern macro, rb_cv_crt_externs, + [AC_TRY_COMPILE([ #include <crt_externs.h> ], [return 0;], + rb_cv_crt_externs=yes, rb_cv_crt_externs=no)]) + if test "$rb_cv_crt_externs" = yes; then + AC_DEFINE(HAVE_CRT_EXTERNS_H) + fi ], [hpux*], [ LIBS="-lm $LIBS" ac_cv_c_inline=no], diff --git a/eval_intern.h b/eval_intern.h index ed27b8ba85..334b8d439a 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -28,7 +28,11 @@ #include <setjmp.h> #ifdef __APPLE__ -#include <crt_externs.h> +# ifdef HAVE_CRT_EXTERNS_H +# include <crt_externs.h> +# else +# include "missing/crt_externs.h" +# endif #endif #ifndef HAVE_STRING_H @@ -20,7 +20,11 @@ #include "probes.h" #ifdef __APPLE__ -#include <crt_externs.h> +# ifdef HAVE_CRT_EXTERNS_H +# include <crt_externs.h> +# else +# include "missing/crt_externs.h" +# endif #endif static VALUE rb_hash_s_try_convert(VALUE, VALUE); diff --git a/missing/crt_externs.h b/missing/crt_externs.h new file mode 100644 index 0000000000..cc96d46738 --- /dev/null +++ b/missing/crt_externs.h @@ -0,0 +1,8 @@ +#ifndef MISSING_CRT_EXTERNS_H +#define MISSING_CRT_EXTERNS_H + +char ***_NSGetEnviron(); +#undef environ +#define environ (*_NSGetEnviron()) + +#endif diff --git a/missing/setproctitle.c b/missing/setproctitle.c index d35e70d534..9dcf37560b 100644 --- a/missing/setproctitle.c +++ b/missing/setproctitle.c @@ -49,9 +49,13 @@ #include <string.h> #if defined(__APPLE__) -#include <crt_externs.h> -#undef environ -#define environ (*_NSGetEnviron()) +# ifdef HAVE_CRT_EXTERNS_H +# include <crt_externs.h> +# undef environ +# define environ (*_NSGetEnviron()) +# else +# include "crt_externs.h" +# endif #endif #define SPT_NONE 0 /* don't use it at all */ |