FFI-Raw
view release on metacpan or search on metacpan
deps/libffi/ltmain.sh view on Meta::CPAN
/* declarations of non-ANSI functions */
#if defined(__MINGW32__)
# ifdef __STRICT_ANSI__
int _putenv (const char *);
# endif
#elif defined(__CYGWIN__)
# ifdef __STRICT_ANSI__
char *realpath (const char *, char *);
int putenv (char *);
int setenv (const char *, const char *, int);
# endif
/* #elif defined (other platforms) ... */
#endif
/* portability defines, excluding path handling macros */
#if defined(_MSC_VER)
# define setmode _setmode
# define stat _stat
# define chmod _chmod
# define getcwd _getcwd
deps/libffi/ltmain.sh view on Meta::CPAN
const char *base_name (const char *name);
char *find_executable (const char *wrapper);
char *chase_symlinks (const char *pathspec);
int make_executable (const char *path);
int check_executable (const char *path);
char *strendzap (char *str, const char *pat);
void lt_debugprintf (const char *file, int line, const char *fmt, ...);
void lt_fatal (const char *file, int line, const char *message, ...);
static const char *nonnull (const char *s);
static const char *nonempty (const char *s);
void lt_setenv (const char *name, const char *value);
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
void lt_update_exe_path (const char *name, const char *value);
void lt_update_lib_path (const char *name, const char *value);
char **prepare_spawn (char **argv);
void lt_dump_script (FILE *f);
EOF
cat <<EOF
volatile const char * MAGIC_EXE = "$magic_exe";
const char * LIB_PATH_VARNAME = "$shlibpath_var";
deps/libffi/ltmain.sh view on Meta::CPAN
}
EOF
;;
esac
cat <<"EOF"
XFREE (target_name);
XFREE (actual_cwrapper_path);
XFREE (actual_cwrapper_name);
lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
lt_setenv ("DUALCASE", "1"); /* for MSK sh */
/* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
because on Windows, both *_VARNAMEs are PATH but uninstalled
libraries must come first. */
lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
nonnull (lt_argv_zero));
for (i = 0; i < newargc; i++)
deps/libffi/ltmain.sh view on Meta::CPAN
return s ? s : "(null)";
}
static const char *
nonempty (const char *s)
{
return (s && !*s) ? "(empty)" : nonnull (s);
}
void
lt_setenv (const char *name, const char *value)
{
lt_debugprintf (__FILE__, __LINE__,
"(lt_setenv) setting '%s' to '%s'\n",
nonnull (name), nonnull (value));
{
#ifdef HAVE_SETENV
/* always make a copy, for consistency with !HAVE_SETENV */
char *str = xstrdup (value);
setenv (name, str, 1);
#else
int len = strlen (name) + 1 + strlen (value) + 1;
char *str = XMALLOC (char, len);
sprintf (str, "%s=%s", name, value);
if (putenv (str) != EXIT_SUCCESS)
{
XFREE (str);
}
#endif
}
deps/libffi/ltmain.sh view on Meta::CPAN
if (name && *name && value && *value)
{
char *new_value = lt_extend_str (getenv (name), value, 0);
/* some systems can't cope with a ':'-terminated path #' */
int len = strlen (new_value);
while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
{
new_value[len-1] = '\0';
}
lt_setenv (name, new_value);
XFREE (new_value);
}
}
void
lt_update_lib_path (const char *name, const char *value)
{
lt_debugprintf (__FILE__, __LINE__,
"(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
nonnull (name), nonnull (value));
if (name && *name && value && *value)
{
char *new_value = lt_extend_str (getenv (name), value, 0);
lt_setenv (name, new_value);
XFREE (new_value);
}
}
EOF
case $host_os in
mingw*)
cat <<"EOF"
/* Prepares an argument vector before calling spawn().
deps/libffi/testsuite/lib/target-libpath.exp view on Meta::CPAN
global orig_ld_libraryn32_path
global orig_ld_library64_path
global orig_ld_library_path_32
global orig_ld_library_path_64
global orig_dyld_library_path
global orig_path
global GCC_EXEC_PREFIX
# Set the relocated compiler prefix, but only if the user hasn't specified one.
if { [info exists GCC_EXEC_PREFIX] && ![info exists env(GCC_EXEC_PREFIX)] } {
setenv GCC_EXEC_PREFIX "$GCC_EXEC_PREFIX"
}
# Setting the ld library path causes trouble when testing cross-compilers.
if { [is_remote target] } {
return
}
if { $orig_environment_saved == 0 } {
global env
deps/libffi/testsuite/lib/target-libpath.exp view on Meta::CPAN
# called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
# (for the 64-bit ABI). The same applies to Darwin (DYLD_LIBRARY_PATH),
# Solaris 32 bit (LD_LIBRARY_PATH_32), Solaris 64 bit (LD_LIBRARY_PATH_64),
# and HP-UX (SHLIB_PATH). In some cases, the variables are independent
# of LD_LIBRARY_PATH, and in other cases LD_LIBRARY_PATH is used if the
# variable is not defined.
#
# Doing this is somewhat of a hack as ld_library_path gets repeated in
# SHLIB_PATH and LD_LIBRARY_PATH when unix_load sets these variables.
if { $orig_ld_library_path_saved } {
setenv LD_LIBRARY_PATH "$ld_library_path:$orig_ld_library_path"
} else {
setenv LD_LIBRARY_PATH "$ld_library_path"
}
if { $orig_ld_run_path_saved } {
setenv LD_RUN_PATH "$ld_library_path:$orig_ld_run_path"
} else {
setenv LD_RUN_PATH "$ld_library_path"
}
# The default shared library dynamic path search for 64-bit
# HP-UX executables searches LD_LIBRARY_PATH before SHLIB_PATH.
# LD_LIBRARY_PATH isn't used for 32-bit executables. Thus, we
# set LD_LIBRARY_PATH and SHLIB_PATH as if they were independent.
if { $orig_shlib_path_saved } {
setenv SHLIB_PATH "$ld_library_path:$orig_shlib_path"
} else {
setenv SHLIB_PATH "$ld_library_path"
}
if { $orig_ld_libraryn32_path_saved } {
setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_libraryn32_path"
} elseif { $orig_ld_library_path_saved } {
setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_library_path"
} else {
setenv LD_LIBRARYN32_PATH "$ld_library_path"
}
if { $orig_ld_library64_path_saved } {
setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library64_path"
} elseif { $orig_ld_library_path_saved } {
setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library_path"
} else {
setenv LD_LIBRARY64_PATH "$ld_library_path"
}
if { $orig_ld_library_path_32_saved } {
setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path_32"
} elseif { $orig_ld_library_path_saved } {
setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path"
} else {
setenv LD_LIBRARY_PATH_32 "$ld_library_path"
}
if { $orig_ld_library_path_64_saved } {
setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path_64"
} elseif { $orig_ld_library_path_saved } {
setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path"
} else {
setenv LD_LIBRARY_PATH_64 "$ld_library_path"
}
if { $orig_dyld_library_path_saved } {
setenv DYLD_LIBRARY_PATH "$ld_library_path:$orig_dyld_library_path"
} else {
setenv DYLD_LIBRARY_PATH "$ld_library_path"
}
if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } {
if { $orig_path_saved } {
setenv PATH "$ld_library_path:$orig_path"
} else {
setenv PATH "$ld_library_path"
}
}
verbose -log "set_ld_library_path_env_vars: ld_library_path=$ld_library_path"
}
#######################################
# proc restore_ld_library_path_env_vars { }
#######################################
deps/libffi/testsuite/lib/target-libpath.exp view on Meta::CPAN
global orig_ld_library_path_32
global orig_ld_library_path_64
global orig_dyld_library_path
global orig_path
if { $orig_environment_saved == 0 } {
return
}
if { $orig_ld_library_path_saved } {
setenv LD_LIBRARY_PATH "$orig_ld_library_path"
} elseif [info exists env(LD_LIBRARY_PATH)] {
unsetenv LD_LIBRARY_PATH
}
if { $orig_ld_run_path_saved } {
setenv LD_RUN_PATH "$orig_ld_run_path"
} elseif [info exists env(LD_RUN_PATH)] {
unsetenv LD_RUN_PATH
}
if { $orig_shlib_path_saved } {
setenv SHLIB_PATH "$orig_shlib_path"
} elseif [info exists env(SHLIB_PATH)] {
unsetenv SHLIB_PATH
}
if { $orig_ld_libraryn32_path_saved } {
setenv LD_LIBRARYN32_PATH "$orig_ld_libraryn32_path"
} elseif [info exists env(LD_LIBRARYN32_PATH)] {
unsetenv LD_LIBRARYN32_PATH
}
if { $orig_ld_library64_path_saved } {
setenv LD_LIBRARY64_PATH "$orig_ld_library64_path"
} elseif [info exists env(LD_LIBRARY64_PATH)] {
unsetenv LD_LIBRARY64_PATH
}
if { $orig_ld_library_path_32_saved } {
setenv LD_LIBRARY_PATH_32 "$orig_ld_library_path_32"
} elseif [info exists env(LD_LIBRARY_PATH_32)] {
unsetenv LD_LIBRARY_PATH_32
}
if { $orig_ld_library_path_64_saved } {
setenv LD_LIBRARY_PATH_64 "$orig_ld_library_path_64"
} elseif [info exists env(LD_LIBRARY_PATH_64)] {
unsetenv LD_LIBRARY_PATH_64
}
if { $orig_dyld_library_path_saved } {
setenv DYLD_LIBRARY_PATH "$orig_dyld_library_path"
} elseif [info exists env(DYLD_LIBRARY_PATH)] {
unsetenv DYLD_LIBRARY_PATH
}
if { $orig_path_saved } {
setenv PATH "$orig_path"
} elseif [info exists env(PATH)] {
unsetenv PATH
}
}
#######################################
# proc get_shlib_extension { }
#######################################
proc get_shlib_extension { } {
global shlib_ext
magic_regdata_cnt|||
magic_regdatum_get|||
magic_regdatum_set|||
magic_scalarpack|||
magic_set_all_env|||
magic_setamagic|||
magic_setarylen|||
magic_setcollxfrm|||
magic_setdbline|||
magic_setdefelem|||
magic_setenv|||
magic_sethint|||
magic_setisa|||
magic_setmglob|||
magic_setnkeys|||
magic_setpack|||
magic_setpos|||
magic_setregexp|||
magic_setsig|||
magic_setsubstr|||
magic_settaint|||
my_letohl|||n
my_letohs|||n
my_lstat_flags|||
my_lstat||5.014000|
my_memcmp||5.004000|n
my_memset|||n
my_ntohl|||
my_pclose||5.004000|
my_popen_list||5.007001|
my_popen||5.004000|
my_setenv|||
my_snprintf|5.009004||pvn
my_socketpair||5.007003|n
my_sprintf|5.009003||pvn
my_stat_flags|||
my_stat||5.014000|
my_strftime||5.007002|
my_strlcat|5.009004||pn
my_strlcpy|5.009004||pn
my_swabn|||n
my_swap|||
( run in 0.412 second using v1.01-cache-2.11-cpan-3989ada0592 )