ext/DynaLoader/Makefile.PL
ext/DynaLoader/README
ext/DynaLoader/dl_aix.xs aix
-ext/DynaLoader/dl_cygwin.xs cygwin
ext/DynaLoader/dl_dld.xs rsanders
ext/DynaLoader/dl_dlopen.xs timb
ext/DynaLoader/dl_hpux.xs hpux
ext/DynaLoader/XSLoader_pm.PL Simple XS Loader perl module
ext/DynaLoader/dl_aix.xs AIX implementation
ext/DynaLoader/dl_beos.xs BeOS implementation
-ext/DynaLoader/dl_cygwin.xs Cygwin implementation
ext/DynaLoader/dl_dld.xs GNU dld style implementation
ext/DynaLoader/dl_dlopen.xs BSD/SunOS4&5 dlopen() style implementation
ext/DynaLoader/dl_hpux.xs HP-UX implementation
+++ /dev/null
-/* dl_cygwin.xs
- *
- * Platform: Win32 (Windows NT/Windows 95)
- * Author: Wei-Yuen Tan (wyt@hip.com)
- * Created: A warm day in June, 1995
- *
- * Modified:
- * August 23rd 1995 - rewritten after losing everything when I
- * wiped off my NT partition (eek!)
- */
-/* Modified from the original dl_win32.xs to work with cygwin
- -John Cerney 3/26/97
-*/
-/* Porting notes:
-
-I merely took Paul's dl_dlopen.xs, took out extraneous stuff and
-replaced the appropriate SunOS calls with the corresponding Win32
-calls.
-
-*/
-
-#define WIN32_LEAN_AND_MEAN
-// Defines from windows needed for this function only. Can't include full
-// Cygwin windows headers because of problems with CONTEXT redefinition
-// Removed logic to tell not dynamically load static modules. It is assumed that all
-// modules are dynamically built. This should be similar to the behavoir on sunOS.
-// Leaving in the logic would have required changes to the standard perlmain.c code
-//
-#include <stdio.h>
-
-//#include <windows.h>
-#define LOAD_WITH_ALTERED_SEARCH_PATH (8)
-typedef void *HANDLE;
-typedef HANDLE HINSTANCE;
-#define STDCALL __attribute__ ((stdcall))
-typedef int STDCALL (*FARPROC)();
-#define MAX_PATH 260
-
-HINSTANCE
-STDCALL
-LoadLibraryExA(
- char* lpLibFileName,
- HANDLE hFile,
- unsigned int dwFlags
- );
-unsigned int
-STDCALL
-GetLastError(
- void
- );
-FARPROC
-STDCALL
-GetProcAddress(
- HINSTANCE hModule,
- char* lpProcName
- );
-
-#include <string.h>
-
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-#include "dlutils.c" /* SaveError() etc */
-
-static void
-dl_private_init(pTHX)
-{
- (void)dl_generic_private_init(aTHX);
-}
-
-
-MODULE = DynaLoader PACKAGE = DynaLoader
-
-BOOT:
- (void)dl_private_init(aTHX);
-
-void *
-dl_load_file(filename,flags=0)
- char * filename
- int flags
- PREINIT:
- CODE:
- {
- char win32_path[MAX_PATH];
- cygwin_conv_to_full_win32_path(filename, win32_path);
- filename = win32_path;
-
- DLDEBUG(1,PerlIO_printf(Perl_debug_log,"dl_load_file(%s):\n", filename));
-
- RETVAL = (void*) LoadLibraryExA(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ) ;
-
- DLDEBUG(2,PerlIO_printf(Perl_debug_log," libref=%x\n", RETVAL));
- ST(0) = sv_newmortal() ;
- if (RETVAL == NULL){
- SaveError(aTHX_ "%d",GetLastError()) ;
- } else {
- sv_setiv( ST(0), PTR2IV(RETVAL) );
- }
- }
-
-
-
-void *
-dl_find_symbol(libhandle, symbolname)
- void * libhandle
- char * symbolname
- CODE:
- DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_find_symbol(handle=%x, symbol=%s)\n",
- libhandle, symbolname));
- RETVAL = (void*) GetProcAddress((HINSTANCE) libhandle, symbolname);
- DLDEBUG(2,PerlIO_printf(Perl_debug_log," symbolref = %x\n", RETVAL));
- ST(0) = sv_newmortal() ;
- if (RETVAL == NULL)
- SaveError(aTHX_ "%d",GetLastError()) ;
- else
- sv_setiv( ST(0), PTR2IV(RETVAL));
-
-
-void
-dl_undef_symbols()
- PPCODE:
-
-
-
-# These functions should not need changing on any platform:
-
-void
-dl_install_xsub(perl_name, symref, filename="$Package")
- char * perl_name
- void * symref
- char * filename
- CODE:
- DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_install_xsub(name=%s, symref=%x)\n",
- perl_name, symref));
- ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
- (void(*)(pTHX_ CV *))symref,
- filename)));
-
-
-char *
-dl_error()
- CODE:
- RETVAL = LastError ;
- OUTPUT:
- RETVAL
-
-# end.
#else
#if defined (CYGWIN)
# define tzname _tzname
-# undef MB_CUR_MAX /* XXX: bug in b20.1 */
#endif
#if defined (WIN32)
# undef mkfifo
#endif
#ifdef HAS_TZNAME
-# ifndef WIN32
+# if !defined(WIN32) && !defined(CYGWIN)
extern char *tzname[];
# endif
#else
#include "config.h"
#ifdef CYGWIN
-# define EXT extern
# define EXTCONST extern const
#else
# include "EXTERN.h"
#! /bin/sh
# cygwin.sh - hints for building perl using the Cygwin environment for Win32
#
-# Many of these inflexible settings should be changed to allow command-
-# line overrides and allow for variations in local set-ups.
-# I have made first guesses at some of these, but would welcome
-# corrections from someone actually using Cygwin.
-# Andy Dougherty <doughera@lafayette.edu> Tue Sep 28 12:39:38 EDT 1999
-_exe='.exe'
+# not otherwise settable
exe_ext='.exe'
-# work around case-insensitive file names
firstmakefile='GNUmakefile'
-sharpbang='#!'
-startsh='#!/bin/sh'
+case "$ldlibpthname" in
+'') ldlibpthname=PATH ;;
+esac
-archname='cygwin'
+# mandatory (overrides defaults)
test -z "$cc" && cc='gcc'
-libpth='/usr/i586-cygwin32/lib /usr/lib /usr/local/lib'
+if test -z "$libpth"
+then
+ libpth=`gcc -print-file-name=libc.a`
+ libpth=`dirname $libpth`
+ libpth=`cd $libpth && pwd`
+fi
so='dll'
libs='-lcygwin -lm -lkernel32'
-#optimize='-g'
-# Is -I/usr/include *really* needed?
-# Is -I/usr/local/include *really* needed? I thought gcc always looked there.
-ccflags="$ccflags -DCYGWIN -I/usr/include -I/usr/local/include"
-# Is -L/usr/lib *really* needed?
-ldflags="$ldflags -L/usr/i586-cygwin32/lib -L/usr/lib -L/usr/local/lib"
-test -z "$usemymalloc" && usemymalloc='n'
-dlsrc='dl_cygwin.xs'
+ccflags="$ccflags -DCYGWIN"
+archname='cygwin'
cccdlflags=' '
ld='ld2'
-# Is -L/usr/local/lib *really* needed?
-lddlflags="$lddlflags -L/usr/local/lib"
+
+# optional(ish)
+# - perl malloc needs to be unpolluted
+bincompat5005='undef'
+# - build shared libperl.dll
useshrplib='true'
libperl='libperl.a'
-dlext='dll'
-dynamic_ext=' '
-
-# What if they aren't using $prefix=/usr/local ??
-# Why is this needed at all? Doesn't Configure suggest this?
-test -z "$man1dir" && man1dir=/usr/local/man/man1
-test -z "$man3dir" && man3dir=/usr/local/man/man3
-case "$ldlibpthname" in
-'') ldlibpthname=PATH ;;
-esac
+# strip exe's and dll's
+#ldflags="$ldflags -s"
+#ccdlflags="$ccdlflags -s"
+#lddlflags="$lddlflags -s"
if ($dlsrc ne "dl_none.xs") {
-f $perldll || die "No perl DLL built\n";
-
+ }
# Install the DLL
- safe_unlink("$installbin/$perldll");
- copy("$perldll", "$installbin/$perldll");
- chmod(0755, "$installbin/$perldll");
- }
+ safe_unlink("$installbin/$perldll");
+ copy("$perldll", "$installbin/$perldll");
+ chmod(0755, "$installbin/$perldll");
+
} # if ($Is_W32 or $Is_Cygwin)
# This will be used to store the packlist
# ifdef CYGWIN
I32 i;
for (i = 0; environ[i]; i++)
- Safefree(environ[i]);
+ safesysfree(environ[i]);
# else
# ifndef PERL_USE_SAFE_PUTENV
I32 i;
will modify the Registry to associate the C<.pl> extension with the
perl interpreter. If you install another port, perhaps even building
your own Win95/NT Perl from the standard sources by using a Windows port
-of gcc (e.g., with cygwin32 or mingw32), then you'll have to modify
+of gcc (e.g., with cygwin or mingw32), then you'll have to modify
the Registry yourself. In addition to associating C<.pl> with the
interpreter, NT people can use: C<SET PATHEXT=%PATHEXT%;.PL> to let them
run the program C<install-linux.pl> merely by typing C<install-linux>.
$Is_MSWin32 = $^O eq 'MSWin32';
$Is_Dos = $^O eq 'dos';
$Is_Dosish = $Is_Dos || $^O eq 'os2' || $Is_MSWin32;
+$Is_Cygwin = $^O =~ /cygwin/;
chop($cwd = ($Is_MSWin32 ? `cd` : `pwd`));
-$DEV = `ls -l /dev` unless $Is_Dosish;
+$DEV = `ls -l /dev` unless $Is_Dosish or $Is_Cygwin;
unlink "Op.stat.tmp";
if (open(FOO, ">Op.stat.tmp")) {
{print "not ok 33\n";}
if (! -b '.') {print "ok 34\n";} else {print "not ok 34\n";}
-if ($^O eq 'amigaos' or $Is_Dosish) {
+if ($^O eq 'amigaos' or $Is_Dosish or $Is_Cygwin) {
print "ok 35 # skipped: no -u\n"; goto tty_test;
}
}
void
-my_setenv(char *nam, char *val)
+Perl_my_setenv(char *nam, char *val)
{
/* You can not directly manipulate the environ[] array because
* the routines do some additional work that syncs the Cygwin
if (!oldstr)
return;
unsetenv(nam);
- Safefree(oldstr);
+ safesysfree(oldstr);
return;
}
setenv(nam, val, 1);
environ = *Perl_main_environ; /* environ realloc can occur in setenv */
if(oldstr && environ[setenv_getix(nam)] != oldstr)
- Safefree(oldstr);
+ safesysfree(oldstr);
}
#else /* if WIN32 */