cvsuser 04/10/08 06:24:37
Modified: config/init/hints darwin.pl
src dynext.c gc_ims.c
t/library parrotlib.t
Log:
fix darwin dynaic loading
Revision Changes Path
1.13 +2 -2 parrot/config/init/hints/darwin.pl
Index: darwin.pl
===================================================================
RCS file: /cvs/public/parrot/config/init/hints/darwin.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -r1.12 -r1.13
--- darwin.pl 8 Oct 2004 07:08:33 -0000 1.12
+++ darwin.pl 8 Oct 2004 13:24:35 -0000 1.13
@@ -19,8 +19,8 @@
ldflags => $ldflags,
ccwarn => "-Wno-shadow",
libs => $libs,
- so => '.dylib',
- dynmod => '.so',
+ share_ext => '.dylib',
+ load_ext => '.so',
link => 'c++',
ld_share_flags => '-dynamiclib',
ld_load_flags => '-bundle -undefined suppress',
1.34 +34 -2 parrot/src/dynext.c
Index: dynext.c
===================================================================
RCS file: /cvs/public/parrot/src/dynext.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -w -r1.33 -r1.34
--- dynext.c 8 Oct 2004 07:08:37 -0000 1.33
+++ dynext.c 8 Oct 2004 13:24:36 -0000 1.34
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: dynext.c,v 1.33 2004/10/08 07:08:37 sfink Exp $
+$Id: dynext.c,v 1.34 2004/10/08 13:24:36 leo Exp $
=head1 NAME
@@ -166,7 +166,38 @@
* then file.extension w/o prefix
*/
*handle = Parrot_dlopen(file_w_ext);
- if (handle) {
+ if (*handle) {
+ path = string_from_cstring(interpreter, file_w_ext, 0);
+ string_cstring_free(file_name);
+ string_cstring_free(file_w_ext);
+ return path;
+ }
+ string_cstring_free(file_w_ext);
+ if (strcmp(PARROT_LOAD_EXT, PARROT_SHARE_EXT)) {
+ file_w_ext = malloc(strlen(file_name) +
+ strlen(PARROT_SHARE_EXT) + 1);
+ strcpy(file_w_ext, file_name);
+ strcat(file_w_ext, PARROT_SHARE_EXT);
+ full_name = Parrot_locate_runtime_file(interpreter, file_w_ext,
+ PARROT_RUNTIME_FT_DYNEXT);
+ if (full_name) {
+ *handle = Parrot_dlopen(full_name);
+ if (*handle) {
+ path = string_from_cstring(interpreter, full_name, 0);
+ string_cstring_free(file_name);
+ string_cstring_free(file_w_ext);
+ return path;
+ }
+ err = Parrot_dlerror();
+ fprintf(stderr, "Couldn't load '%s': %s\n",
+ full_name, err ? err : "unknown reason");
+ return NULL;
+ }
+ /*
+ * then file.extension w/o prefix
+ */
+ *handle = Parrot_dlopen(file_w_ext);
+ if (*handle) {
path = string_from_cstring(interpreter, file_w_ext, 0);
string_cstring_free(file_name);
string_cstring_free(file_w_ext);
@@ -174,6 +205,7 @@
}
string_cstring_free(file_w_ext);
}
+ }
/*
* then the given file name as is
*/
1.11 +4 -3 parrot/src/gc_ims.c
Index: gc_ims.c
===================================================================
RCS file: /cvs/public/parrot/src/gc_ims.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -r1.10 -r1.11
--- gc_ims.c 2 Oct 2004 15:22:05 -0000 1.10
+++ gc_ims.c 8 Oct 2004 13:24:36 -0000 1.11
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2004 The Perl Foundation. All Rights Reserved.
-$Id: gc_ims.c,v 1.10 2004/10/02 15:22:05 jrieks Exp $
+$Id: gc_ims.c,v 1.11 2004/10/08 13:24:36 leo Exp $
=head1 NAME
@@ -694,9 +694,10 @@
*/
#if GC_IS_MALLOC
-static void
-parrot_gc_ims_collect(Interp* interpreter)
+static int
+parrot_gc_ims_collect(Interp* interpreter, int check_only)
{
+ return 0;
}
#else
1.5 +4 -4 parrot/t/library/parrotlib.t
Index: parrotlib.t
===================================================================
RCS file: /cvs/public/parrot/t/library/parrotlib.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- parrotlib.t 8 Oct 2004 07:08:39 -0000 1.4
+++ parrotlib.t 8 Oct 2004 13:24:37 -0000 1.5
@@ -1,5 +1,5 @@
# Copyright (C) 2001-2004 The Perl Foundation. All rights reserved.
-# $Id: parrotlib.t,v 1.4 2004/10/08 07:08:39 sfink Exp $
+# $Id: parrotlib.t,v 1.5 2004/10/08 13:24:37 leo Exp $
=head1 NAME
@@ -89,16 +89,16 @@
output_is( << "END_CODE", << "END_OUT", 'dynext_location' );
$template_top
location_sub = find_global "_parrotlib", "dynext_location"
- location = location_sub( 'libnci', '$PConfig{load_ext}' )
+ location = location_sub( 'libnci', '$PConfig{share_ext}' )
$template_bottom
END_CODE
-runtime/parrot/dynext/libnci$PConfig{load_ext}
+runtime/parrot/dynext/libnci$PConfig{share_ext}
END_OUT
output_is( << "END_CODE", << 'END_OUT', 'dynext_location, non-existent' );
$template_top
location_sub = find_global "_parrotlib", "imcc_compile_file_location"
- location = location_sub( 'nonexistent', '$PConfig{load_ext}' )
+ location = location_sub( 'nonexistent', '$PConfig{share_ext}' )
$template_bottom
END_CODE