On Fri, 3 Dec 2010, Enlightenment SVN wrote:

> Log:
>       * embryo: fix binary path detection on MacOsX.
>
>
> Author:       cedric
> Date:         2010-12-03 09:48:17 -0800 (Fri, 03 Dec 2010)
> New Revision: 55208
> Trac:         http://trac.enlightenment.org/e/changeset/55208
>
> Modified:
>  trunk/embryo/src/bin/embryo_cc_prefix.c
>
> Modified: trunk/embryo/src/bin/embryo_cc_prefix.c
> ===================================================================
> --- trunk/embryo/src/bin/embryo_cc_prefix.c   2010-12-03 17:28:18 UTC (rev 
> 55207)
> +++ trunk/embryo/src/bin/embryo_cc_prefix.c   2010-12-03 17:48:17 UTC (rev 
> 55208)
> @@ -29,6 +29,10 @@
> # include <glob.h>
> #endif /* ! HAVE_EVIL */
>
> +#ifdef __MacOSX__

are you sure it exists on all mac os x platform ?

maybe we should detect it at configure time. It would be safer (same for 
eina_cpu)

Vincent

> +# include <mach-o/dyld.h>
> +#endif
> +
> #include "embryo_cc_prefix.h"
>
> /* local subsystem functions */
> @@ -36,6 +40,9 @@
> 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 @@
>      {
>       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,7 +328,22 @@
>    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)
> {
>    FILE *f;
>
>
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
> Tap into the largest installed PC base & get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>
>

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to