diff -ur --exclude=CVS --exclude=.DS_Store parrot/config/auto/headers.pl parrot-dlcompat/config/auto/headers.pl
--- parrot/config/auto/headers.pl	Sun Jul 13 20:52:36 2003
+++ parrot-dlcompat/config/auto/headers.pl	Thu Oct  9 16:48:49 2003
@@ -28,7 +28,7 @@
     # some headers may not be probed-for by perl 5, or might not be
     # properly reflected in %Config (i_fcntl seems to be wrong on my machine,
     # for instance).
-    my @extra_headers = qw(malloc.h fcntl.h setjmp.h pthread.h signal.h);
+    my @extra_headers = qw(malloc.h fcntl.h setjmp.h pthread.h signal.h dlfcn.h);
 
     foreach my $header (@extra_headers) {
         my $flag = "i_$header";
diff -ur --exclude=CVS --exclude=.DS_Store parrot/config/gen/makefiles/root.in parrot-dlcompat/config/gen/makefiles/root.in
--- parrot/config/gen/makefiles/root.in	Wed Oct  8 12:14:03 2003
+++ parrot-dlcompat/config/gen/makefiles/root.in	Thu Oct  9 20:28:58 2003
@@ -839,8 +839,8 @@
 ###### OS depend targets ##########
 # libnci.so used by t/pmc/nci.t
 
-libnci.so: nci_test.c
-	$(LD) $(LD_SHARED) $(LD_SHARED_FLAGS) $(LDFLAGS) $< -o $@
+libnci: nci_test.c
+	$(LD) $(LD_SHARED) $(LD_SHARED_FLAGS) $(LDFLAGS) $< -o $@$(SO)
 
 # ctags
 
diff -ur --exclude=CVS --exclude=.DS_Store parrot/config/gen/platform/darwin.c parrot-dlcompat/config/gen/platform/darwin.c
--- parrot/config/gen/platform/darwin.c	Sat Aug 16 19:51:56 2003
+++ parrot-dlcompat/config/gen/platform/darwin.c	Thu Oct  9 16:50:35 2003
@@ -21,6 +21,10 @@
 
 #include "parrot/parrot.h"
 
+#ifdef PARROT_HAS_HEADER_DLFCN
+#  include <dlfcn.h>
+#endif
+
 #define PARROT_DLOPEN_FLAGS RTLD_LAZY
 
 /*
@@ -111,80 +115,84 @@
 void *
 Parrot_dlopen(const char *filename)
 {
+#ifdef PARROT_HAS_HEADER_DLFCN
+    return dlopen(filename, PARROT_DLOPEN_FLAGS);
+#else
     int dyld_result;
     NSObjectFileImage ofile;
     NSModule handle = NULL;
-
-    dyld_result = NSCreateObjectFileImageFromFile(filename, &ofile);
-    if (NSObjectFileImageSuccess != dyld_result) {
-        switch(dyld_result) {
-        case NSObjectFileImageFailure:
-            fprintf(stderr, "open result was Failure (%i)\n", dyld_result);
-            break;
-        case NSObjectFileImageInappropriateFile:
-            fprintf(stderr, "open result was InappropriateFile (%i)\n", dyld_result);
-            break;
-        case NSObjectFileImageArch:
-            fprintf(stderr, "open result was Arch (%i)\n", dyld_result);
-            break;
-        case NSObjectFileImageFormat:
-            fprintf(stderr, "open result was Format (%i)\n", dyld_result);
-            break;
-        case NSObjectFileImageAccess:
-            fprintf(stderr, "open result was Access (%i)\n", dyld_result);
-            break;
-        default:
-            fprintf(stderr, "open result was unknown (%i)\n", dyld_result);
-            break;
+        dyld_result = NSCreateObjectFileImageFromFile(filename, &ofile);
+        if (NSObjectFileImageSuccess != dyld_result) {
+            switch(dyld_result) {
+                case NSObjectFileImageFailure:
+                    fprintf(stderr, "open result was Failure (%i)\n", dyld_result);
+                    break;
+                case NSObjectFileImageInappropriateFile:
+                    fprintf(stderr, "open result was InappropriateFile (%i)\n", dyld_result);
+                    break;
+                case NSObjectFileImageArch:
+                    fprintf(stderr, "open result was Arch (%i)\n", dyld_result);
+                    break;
+                case NSObjectFileImageFormat:
+                    fprintf(stderr, "open result was Format (%i)\n", dyld_result);
+                    break;
+                case NSObjectFileImageAccess:
+                    fprintf(stderr, "open result was Access (%i)\n", dyld_result);
+                    break;
+                default:
+                    fprintf(stderr, "open result was unknown (%i)\n", dyld_result);
+                    break;
+            }
+            exit(1);
         }
-        exit(1);
-    }
-    handle = NSLinkModule(ofile, filename, TRUE);
-    NSDestroyObjectFileImage(ofile);
-
-    return handle;
-
+        handle = NSLinkModule(ofile, filename, TRUE);
+        NSDestroyObjectFileImage(ofile);
+            return handle;
+#endif
 }
 
-
 /*
-** Parrot_dlerror()
-*/
-
+ ** Parrot_dlerror()
+ */
 const char *
 Parrot_dlerror(void)
 {
+#ifdef PARROT_HAS_HEADER_DLFCN
+    return dlerror();
+#else
     return NULL;
+#endif
 }
 
-
 /*
-** Parrot_dlsym()
-*/
-
+ ** Parrot_dlsym()
+ */
 void *
 Parrot_dlsym(void *handle, const char *symbol)
 {
+#ifdef PARROT_HAS_HEADER_DLFCN
+    return dlsym(handle, symbol);
+#else
     void *addr;
-
-    if (NSIsSymbolNameDefined(symbol))
-        addr = NSAddressOfSymbol(NSLookupAndBindSymbol(symbol));
+        if (NSIsSymbolNameDefined(symbol))
+            addr = NSAddressOfSymbol(NSLookupAndBindSymbol(symbol));
     else
         addr = NULL;
-
-    return addr;
-
+        return addr;
+#endif
 }
 
-
 /*
-** Parrot_dlclose()
-*/
-
+ ** Parrot_dlclose()
+ */
 int
 Parrot_dlclose(void *handle)
 {
+#ifdef PARROT_HAS_HEADER_DLFCN
+    return dlclose(handle);
+#else
     return 0;
+#endif
 }
 
 /*
diff -ur --exclude=CVS --exclude=.DS_Store parrot/config/init/hints/darwin.pl parrot-dlcompat/config/init/hints/darwin.pl
--- parrot/config/init/hints/darwin.pl	Fri Sep 12 23:45:43 2003
+++ parrot-dlcompat/config/init/hints/darwin.pl	Thu Oct  9 16:51:12 2003
@@ -1,12 +1,15 @@
-my($ccflags, $ldflags)=Configure::Data->get(qw(ccflags ldflags));
+my($ccflags, $ldflags, $libs, $so)=Configure::Data->get(qw(ccflags ldflags libs));
 
 $ccflags .= " -pipe -fno-common -Wno-long-double ";
 $ccflags =~ s/-flat_namespace\s*//;
 $ldflags =~ s/-flat_namespace\s*//;
 $ldflags .= " -flat_namespace ";
+$libs .= " -ldl";
 
 Configure::Data->set(
   ccflags => $ccflags,
   ldflags => $ldflags,
   ccwarn => "-Wno-shadow",
+  libs => $libs,
+  so => ".dylib",
 );
diff -ur --exclude=CVS --exclude=.DS_Store parrot/dynext.c parrot-dlcompat/dynext.c
--- parrot/dynext.c	Tue Sep 30 12:21:50 2003
+++ parrot-dlcompat/dynext.c	Thu Oct  9 18:34:56 2003
@@ -35,20 +35,16 @@
 
     UNUSED(initializer);
     /* TODO runtime path for dynamic extensions */
-    /* TODO $SO extension */
 #ifndef RUNTIME_DYNEXT
 #  define RUNTIME_DYNEXT "runtime/parrot/dynext/"
 #endif
-#ifndef SO_EXTENSION
-#  define SO_EXTENSION ".so"
-#endif
 
     /*
      * first look in current dir
      */
     path = Parrot_sprintf_c(interpreter, "%Ss%s",
             lib,
-            SO_EXTENSION);
+            PARROT_DLL_EXTENSION);
     cpath = string_to_cstring(interpreter, path);
     handle = Parrot_dlopen(cpath);
     if (!handle) {
@@ -60,7 +56,7 @@
         path = Parrot_sprintf_c(interpreter, "%s%Ss%s",
                 RUNTIME_DYNEXT,
                 lib,
-                SO_EXTENSION);
+                PARROT_DLL_EXTENSION);
         cpath = string_to_cstring(interpreter, path);
         handle = Parrot_dlopen(cpath);
     }
Only in parrot-dlcompat/include/parrot: exec_dep.h
Only in parrot-dlcompat/languages/imcc: imcc.y.flag
Only in parrot-dlcompat/languages/tcl: Makefile
Only in parrot-dlcompat: libnci.dylib
Only in parrot-dlcompat: libnci.so
diff -ur --exclude=CVS --exclude=.DS_Store parrot/nci_test.c parrot-dlcompat/nci_test.c
--- parrot/nci_test.c	Sat Oct  4 13:57:10 2003
+++ parrot-dlcompat/nci_test.c	Thu Oct  9 18:40:40 2003
@@ -1,5 +1,5 @@
 #include <stdio.h>
-#include <malloc.h>
+
 /*
  * cc -shared -fpic nci_test.c -o libnci.so -g
  * export LD_LIBRARY_PATH=.
diff -ur --exclude=CVS --exclude=.DS_Store parrot/t/pmc/nci.t parrot-dlcompat/t/pmc/nci.t
--- parrot/t/pmc/nci.t	Sat Oct  4 13:57:16 2003
+++ parrot-dlcompat/t/pmc/nci.t	Thu Oct  9 18:41:27 2003
@@ -5,7 +5,7 @@
 print STDERR $PConfig{so}, " SO extension\n";
 
 SKIP: {
-if ($PConfig{jitcpuarch} eq 'i386' && -e "libnci" . $PConfig{so}) {
+if (-e "libnci" . $PConfig{so}) {
     $ENV{LD_LIBRARY_PATH} = '.';
 }
 else {
