Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* configure.in: check for the whether crt_externs.h is present when c…

…ompiling

  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
  • Loading branch information...
commit af35f2a61d8027df2e70012ae736f91ee0e41b85 1 parent 80b0c6c
Charlie Somerville authored December 28, 2012
11  ChangeLog
... ...
@@ -1,3 +1,14 @@
  1
+Fri Dec 28 23:12:44 2012  Charlie Somerville  <charlie@charliesomerville.com>
  2
+
  3
+	* configure.in: check for the whether crt_externs.h is present when compiling
  4
+	  for darwin (this header is missing in the iOS SDK)
  5
+	* eval_intern.h: check HAVE_CRT_EXTERNS_H before including crt_externs.h, if
  6
+	  not defined, include missing/crt_externs.h instead
  7
+	* hash.c: ditto
  8
+	* missing/setproctitle.c: ditto
  9
+	* missing/crt_externs.h: declare _NSGetEnviron() function and define environ
  10
+	  for iOS
  11
+
1 12
 Fri Dec 28 21:40:36 2012  Keiju Ishitsuka  <keiju@ishitsuka.com>
2 13
 
3 14
 	* lib/irb/context.rb: IRB::Context#new: Check from JobManager
6  configure.in
@@ -1220,6 +1220,12 @@ main()
1220 1220
 		    LINK_SO="$LINK_SO
1221 1221
 $POSTLINK"
1222 1222
 		fi
  1223
+		AC_CACHE_CHECK(whether crt_externs.h is present for extern macro, rb_cv_crt_externs,
  1224
+		    [AC_TRY_COMPILE([ #include <crt_externs.h> ], [return 0;],
  1225
+		    rb_cv_crt_externs=yes, rb_cv_crt_externs=no)])
  1226
+		if test "$rb_cv_crt_externs" = yes; then
  1227
+		    AC_DEFINE(HAVE_CRT_EXTERNS_H)
  1228
+		fi
1223 1229
 		],
1224 1230
 [hpux*], [	LIBS="-lm $LIBS"
1225 1231
 		ac_cv_c_inline=no],
6  eval_intern.h
@@ -28,7 +28,11 @@
28 28
 #include <setjmp.h>
29 29
 
30 30
 #ifdef __APPLE__
31  
-#include <crt_externs.h>
  31
+# ifdef HAVE_CRT_EXTERNS_H
  32
+#  include <crt_externs.h>
  33
+# else
  34
+#  include "missing/crt_externs.h"
  35
+# endif
32 36
 #endif
33 37
 
34 38
 #ifndef HAVE_STRING_H
6  hash.c
@@ -20,7 +20,11 @@
20 20
 #include "probes.h"
21 21
 
22 22
 #ifdef __APPLE__
23  
-#include <crt_externs.h>
  23
+# ifdef HAVE_CRT_EXTERNS_H
  24
+#  include <crt_externs.h>
  25
+# else
  26
+#  include "missing/crt_externs.h"
  27
+# endif
24 28
 #endif
25 29
 
26 30
 static VALUE rb_hash_s_try_convert(VALUE, VALUE);
8  missing/crt_externs.h
... ...
@@ -0,0 +1,8 @@
  1
+#ifndef MISSING_CRT_EXTERNS_H
  2
+#define MISSING_CRT_EXTERNS_H
  3
+
  4
+char ***_NSGetEnviron();
  5
+#undef environ
  6
+#define environ (*_NSGetEnviron())
  7
+
  8
+#endif
10  missing/setproctitle.c
@@ -49,9 +49,13 @@
49 49
 #include <string.h>
50 50
 
51 51
 #if defined(__APPLE__)
52  
-#include <crt_externs.h>
53  
-#undef environ
54  
-#define environ (*_NSGetEnviron())
  52
+# ifdef HAVE_CRT_EXTERNS_H
  53
+#  include <crt_externs.h>
  54
+#  undef environ
  55
+#  define environ (*_NSGetEnviron())
  56
+# else
  57
+#  include "crt_externs.h"
  58
+# endif
55 59
 #endif
56 60
 
57 61
 #define SPT_NONE	0	/* don't use it at all */

0 notes on commit af35f2a

Please sign in to comment.
Something went wrong with that request. Please try again.