summaryrefslogtreecommitdiff
path: root/ext/DynaLoader
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-06-21 21:40:27 +0100
committerNicholas Clark <nick@ccl4.org>2010-06-23 08:52:45 +0100
commitc457df0449f0dea3e420c5db9e823240ec3148a0 (patch)
tree3b4dee3c769afb62640b16db9f3e048a18bd2713 /ext/DynaLoader
parent862f843bac3434c2861e482369451dae9f8ce17c (diff)
downloadperl-c457df0449f0dea3e420c5db9e823240ec3148a0.tar.gz
Remove MacOS classic support from DynaLoader.
ExtUtils::MakeMaker removed MacOS support in 6.25, merged to blead in December 2004, so this code is vestigial, and a small maintenance penalty.
Diffstat (limited to 'ext/DynaLoader')
-rw-r--r--ext/DynaLoader/DynaLoader_pm.PL51
-rw-r--r--ext/DynaLoader/dl_mac.xs162
2 files changed, 3 insertions, 210 deletions
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index 27ccd7d6bd..776ddf9ef4 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -134,11 +134,6 @@ $Is_VMS = $^O eq 'VMS';
<</$^O-eq-VMS>>
$do_expand = <<$^O-eq-VMS>>1<<|$^O-eq-VMS>>0<</$^O-eq-VMS>>;
-<<$^O-eq-MacOS>>
-my $Mac_FS;
-$Mac_FS = eval { require Mac::FileSpec::Unixish };
-<</$^O-eq-MacOS>>
-
@dl_require_symbols = (); # names of symbols we need
@dl_resolve_using = (); # names of files to link with
@dl_library_path = (); # path to look for files
@@ -312,30 +307,20 @@ sub bootstrap {
}
<</$^O-eq-NetWare>>
- my $modpname = join(<<$^O-eq-MacOS>>':'<<|$^O-eq-MacOS>>'/'<</$^O-eq-MacOS>>,@modparts);
+ my $modpname = join('/',@modparts);
print STDERR "DynaLoader::bootstrap for $module ",
- <<$^O-eq-MacOS>> "(:auto:$modpname:$modfname.$dl_dlext)\n"
- <<|$^O-eq-MacOS>>"(auto/$modpname/$modfname.$dl_dlext)\n"<</$^O-eq-MacOS>>
+ "(auto/$modpname/$modfname.$dl_dlext)\n"
if $dl_debug;
foreach (@INC) {
<<$^O-eq-VMS>>chop($_ = VMS::Filespec::unixpath($_));<</$^O-eq-VMS>>
- <<$^O-eq-MacOS>>
- my $path = $_;
- if ($Mac_FS && ! -d $path) {
- $path = Mac::FileSpec::Unixish::nativize($path);
- }
- $path .= ":" unless /:$/;
- my $dir = "${path}auto:$modpname";
- <<|$^O-eq-MacOS>>
my $dir = "$_/auto/$modpname";
- <</$^O-eq-MacOS>>
next unless -d $dir; # skip over uninteresting directories
# check for common cases to avoid autoload of dl_findfile
- my $try = <<$^O-eq-MacOS>> "$dir:$modfname.$dl_dlext" <<|$^O-eq-MacOS>> "$dir/$modfname.$dl_dlext"<</$^O-eq-MacOS>>;
+ my $try = "$dir/$modfname.$dl_dlext";
last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try);
# no luck here, save dir for possible later dl_findfile search
@@ -439,12 +424,6 @@ sub dl_findfile {
next;
}
<</$^O-eq-VMS>>
- <<$^O-eq-MacOS>>
- if (m/:/ && -f $_) {
- push(@found,$_);
- last arg unless wantarray;
- }
- <</$^O-eq-MacOS>>
<<$^O-ne-VMS>>
if (m:/: && -f $_) {
push(@found,$_);
@@ -457,30 +436,6 @@ sub dl_findfile {
# Using a -L prefix is the preferred option (faster and more robust)
if (m:^-L:) { s/^-L//; push(@dirs, $_); next; }
- <<$^O-eq-MacOS>>
- # Otherwise we try to try to spot directories by a heuristic
- # (this is a more complicated issue than it first appears)
- if (m/:/ && -d $_) { push(@dirs, $_); next; }
- # Only files should get this far...
- my(@names, $name); # what filenames to look for
- s/^-l//;
- push(@names, $_);
- foreach $dir (@dirs, @dl_library_path) {
- next unless -d $dir;
- $dir =~ s/^([^:]+)$/:$1/;
- $dir =~ s/:$//;
- foreach $name (@names) {
- my($file) = "$dir:$name";
- print STDERR " checking in $dir for $name\n" if $dl_debug;
- if (-f $file) {
- push(@found, $file);
- next arg; # no need to look any further
- }
- }
- }
- next;
- <</$^O-eq-MacOS>>
-
# Otherwise we try to try to spot directories by a heuristic
# (this is a more complicated issue than it first appears)
if (m:/: && -d $_) { push(@dirs, $_); next; }
diff --git a/ext/DynaLoader/dl_mac.xs b/ext/DynaLoader/dl_mac.xs
deleted file mode 100644
index d06bb3b506..0000000000
--- a/ext/DynaLoader/dl_mac.xs
+++ /dev/null
@@ -1,162 +0,0 @@
-/* dl_mac.xs
- *
- * Platform: Macintosh CFM
- * Author: Matthias Neeracher <neeri@iis.ee.ethz.ch>
- * Adapted from dl_dlopen.xs reference implementation by
- * Paul Marquess (pmarquess@bfsec.bt.co.uk)
- * $Log: dl_mac.xs,v $
- * Revision 1.3 1998/04/07 01:47:24 neeri
- * MacPerl 5.2.0r4b1
- *
- * Revision 1.2 1997/08/08 16:39:18 neeri
- * MacPerl 5.1.4b1 + time() fix
- *
- * Revision 1.1 1997/04/07 20:48:23 neeri
- * Synchronized with MacPerl 5.1.4a1
- *
- */
-
-#define MAC_CONTEXT
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-#include <CodeFragments.h>
-
-typedef CFragConnectionID ConnectionID;
-
-typedef struct {
- ConnectionID ** x_connections;
-} my_cxtx_t; /* this *must* be named my_cxtx_t */
-
-#define DL_CXT_EXTRA /* ask for dl_cxtx to be defined in dlutils.c */
-#include "dlutils.c" /* SaveError() etc */
-
-#define dl_connections (dl_cxtx.x_connections)
-
-static void terminate(pTHX_ void *ptr)
-{
- dMY_CXT;
- int size = GetHandleSize((Handle) dl_connections) / sizeof(ConnectionID);
- HLock((Handle) dl_connections);
- while (size)
- CloseConnection(*dl_connections + --size);
- DisposeHandle((Handle) dl_connections);
- dl_connections = nil;
-}
-
-static void
-dl_private_init(pTHX)
-{
- (void)dl_generic_private_init(aTHX);
-}
-
-MODULE = DynaLoader PACKAGE = DynaLoader
-
-BOOT:
- (void)dl_private_init(aTHX);
-
-
-ConnectionID
-dl_load_file(filename, flags=0)
- char * filename
- int flags
- PREINIT:
- OSErr err;
- FSSpec spec;
- ConnectionID connID;
- Ptr mainAddr;
- Str255 errName;
- CODE:
- DLDEBUG(1,PerlIO_printf(Perl_debug_log,"dl_load_file(%s):\n", filename));
- err = GUSIPath2FSp(filename, &spec);
- if (!err)
- err =
- GetDiskFragment(
- &spec, 0, 0, spec.name, kLoadCFrag, &connID, &mainAddr, errName);
- if (!err) {
- dMY_CXT;
- if (!dl_connections) {
- dl_connections = (ConnectionID **)NewHandle(0);
- call_atexit(terminate, (void*)0);
- }
- PtrAndHand((Ptr) &connID, (Handle) dl_connections, sizeof(ConnectionID));
- RETVAL = connID;
- } else
- RETVAL = (ConnectionID) 0;
- DLDEBUG(2,PerlIO_printf(Perl_debug_log," libref=%d\n", RETVAL));
- ST(0) = sv_newmortal() ;
- if (err)
- SaveError(aTHX_ "DynaLoader error [%d, %#s]", err, errName) ;
- else
- sv_setiv( ST(0), (IV)RETVAL);
-
-void *
-dl_find_symbol(connID, symbol)
- ConnectionID connID
- Str255 symbol
- CODE:
- {
- OSErr err;
- Ptr symAddr;
- CFragSymbolClass symClass;
- DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_find_symbol(handle=%x, symbol=%#s)\n",
- connID, symbol));
- err = FindSymbol(connID, symbol, &symAddr, &symClass);
- if (err)
- symAddr = (Ptr) 0;
- RETVAL = (void *) symAddr;
- DLDEBUG(2,PerlIO_printf(Perl_debug_log," symbolref = %x\n", RETVAL));
- ST(0) = sv_newmortal() ;
- if (err)
- SaveError(aTHX_ "DynaLoader error [%d]!", err) ;
- else
- sv_setiv( ST(0), (IV)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
- const 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_flags(perl_name,
- (void(*)(pTHX_ CV *))symref,
- filename, NULL,
- XS_DYNAMIC_FILENAME)));
-
-
-char *
-dl_error()
- CODE:
- dMY_CXT;
- RETVAL = dl_last_error ;
- OUTPUT:
- RETVAL
-
-#if defined(USE_ITHREADS)
-
-void
-CLONE(...)
- CODE:
- MY_CXT_CLONE;
-
- /* MY_CXT_CLONE just does a memcpy on the whole structure, so to avoid
- * using Perl variables that belong to another thread, we create our
- * own for this thread.
- */
- MY_CXT.x_dl_last_error = newSVpvn("", 0);
-
-#endif
-
-# end.