Пример #1
0
static const char *
darwin_default_min_version (void)
{
  /* Try to retrieve the deployment target from the environment.  */
  const char *new_flag = getenv ("MACOSX_DEPLOYMENT_TARGET");

  /* Apparently, an empty string for MACOSX_DEPLOYMENT_TARGET means
     "use the default".  Or, possibly "use 10.1".  We choose
     to ignore the environment variable, as if it was never set.  */
  if (new_flag == NULL || new_flag[0] == 0)
#ifndef CROSS_DIRECTORY_STRUCTURE
    /* Try to find the version from the kernel, if we fail - we print a
       message and give up.  */
    new_flag = darwin_find_version_from_kernel ();
#else
    /* For cross-compilers, default to a minimum version determined by
       the configuration. */
    new_flag = DEF_MIN_OSX_VERSION;
#endif /* CROSS_DIRECTORY_STRUCTURE */

  if (new_flag != NULL)
    {
      size_t len = strlen (new_flag);
      if (len > 128) { /* Arbitrary limit, number should be like xx.yy.zz */
	warning (0, "couldn%'t understand version %s\n", new_flag);
	return NULL;
      }
      new_flag = xstrndup (new_flag, len);
    }
  return new_flag;
}
Пример #2
0
	*decoded_options = XNEWVEC (struct cl_decoded_option,
				    *decoded_options_count);
	(*decoded_options)[0] = argv[0];
	generate_option (OPT_mmacosx_version_min_, macosx_deployment_target,
			 1, CL_DRIVER, &(*decoded_options)[1]);
	memcpy (*decoded_options + 2, argv + 1,
		(argc - 1) * sizeof (struct cl_decoded_option));
	return;
      }
  }

#ifndef CROSS_DIRECTORY_STRUCTURE

  /* Try to find the version from the kernel, if we fail - we print a message 
     and give up.  */
  new_flag = darwin_find_version_from_kernel ();
  if (!new_flag)
    return;

#else

  /* For cross-compilers, default to the target OS version. */
  new_flag = DEF_MIN_OSX_VERSION;

#endif /* CROSS_DIRECTORY_STRUCTURE */

  /* Add the new flag.  */
  ++*decoded_options_count;
  *decoded_options = XNEWVEC (struct cl_decoded_option,
			      *decoded_options_count);
  (*decoded_options)[0] = argv[0];