[SVN's EFL Migration] embryo in SLP is merged with SVN r55238.
authorDaniel Juyung Seo <juyung.seo@samsung.com>
Mon, 13 Dec 2010 07:02:20 +0000 (16:02 +0900)
committerDaniel Juyung Seo <juyung.seo@samsung.com>
Mon, 13 Dec 2010 07:02:20 +0000 (16:02 +0900)
configure.ac
src/bin/embryo_cc_prefix.c

index ef0ac50..b82271a 100644 (file)
@@ -18,7 +18,7 @@ m4_define([lt_age], v_min)
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 
-AC_INIT([embryo], [v_ver.beta2], [enlightenment-devel@lists.sourceforge.net])
+AC_INIT([embryo], [v_ver.beta3], [enlightenment-devel@lists.sourceforge.net])
 AC_PREREQ([2.52])
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_MACRO_DIR([m4])
index 028376d..2f24a5a 100644 (file)
 # include <glob.h>
 #endif /* ! HAVE_EVIL */
 
+#ifdef __MacOSX__
+# include <mach-o/dyld.h>
+#endif
+
 #include "embryo_cc_prefix.h"
 
 /* local subsystem functions */
@@ -36,6 +40,9 @@ static int _e_prefix_share_hunt(void);
 static int _e_prefix_fallbacks(void);
 static int _e_prefix_try_proc(void);
 static int _e_prefix_try_argv(char *argv0);
+#ifdef __MacOSX__
+static int _e_prefix_try_dyld(void);
+#endif
 
 /* local subsystem globals */
 static char *_exe_path = NULL;
@@ -89,8 +96,16 @@ e_prefix_determine(char *argv0)
      {
        if (!_e_prefix_try_argv(argv0))
          {
-            _e_prefix_fallbacks();
-            return 0;
+#ifdef __MacOSX__
+                 if (!_e_prefix_try_dyld())
+                 {
+#endif
+                         _e_prefix_fallbacks();
+                         return 0;
+#ifdef __MacOSX__
+                 }
+#endif
+
          }
      }
    /* _exe_path is now a full absolute path TO this exe - figure out rest */
@@ -313,6 +328,21 @@ _e_prefix_fallbacks(void)
    return 1;
 }
 
+#ifdef __MacOSX__
+static int
+_e_prefix_try_dyld(void)
+{
+       char path[PATH_MAX];
+       uint32_t size = sizeof (path);
+
+       if (_NSGetExecutablePath(path, &size) != 0)
+               return 0;
+
+       _exe_path = strdup(path);
+       return 1;
+}
+#endif
+
 static int
 _e_prefix_try_proc(void)
 {