diff -Naur scilab-4.1.2.orig/configure scilab-4.1.2/configure
--- scilab-4.1.2.orig/configure	2007-09-10 10:46:20.000000000 +0200
+++ scilab-4.1.2/configure	2008-01-11 17:45:19.000000000 +0100
@@ -24924,6 +24924,7 @@
    ;;
 # Darwin/MacOSX (Not supported by INRIA)
   *-*-darwin*)
+     SONAME=dylib
      STRIP=echo
      PERIX11NOPT=periX11
      GCC=yes
@@ -24935,7 +24936,7 @@
      FC=g77
      FC_OPTIONS='-O2'
      FC_OPTIONS_O0=
-     FC_LDFLAGS='-L/sw/lib -ldl -lcc_dynamic'
+     FC_LDFLAGS='-L/sw/lib -ldl'
      FC_PICFLAGS='-fPIC'
      LD=ld
      LD_LDFLAGS=
diff -Naur scilab-4.1.2.orig/routines/console/dynamic_menus.c scilab-4.1.2/routines/console/dynamic_menus.c
--- scilab-4.1.2.orig/routines/console/dynamic_menus.c	2006-11-21 16:43:28.000000000 +0100
+++ scilab-4.1.2/routines/console/dynamic_menus.c	2008-01-11 17:44:35.000000000 +0100
@@ -3,6 +3,9 @@
  *    jpc@cermics.enpc.fr 
  *    Changed: steer, jpc 2004 
  *--------------------------------------------------------------------------*/
+#ifdef __APPLE__
+#include <stdio.h>
+#endif
 #ifdef WIN32
 #include <windows.h>
 #include <stdio.h>
diff -Naur scilab-4.1.2.orig/routines/interf/intgraphics.c scilab-4.1.2/routines/interf/intgraphics.c
--- scilab-4.1.2.orig/routines/interf/intgraphics.c	2006-07-12 11:11:20.000000000 +0200
+++ scilab-4.1.2/routines/interf/intgraphics.c	2008-01-11 17:44:36.000000000 +0100
@@ -85,7 +85,7 @@
 extern int sci_delete    _PARAMS((char *fname, unsigned long fname_len));
 extern int addcb         _PARAMS((char *fname, unsigned long fname_len));
 extern int copy          _PARAMS((char *fname, unsigned long subwinparenttarget));
-extern int move          _PARAMS((char *fname, unsigned long fname_len));
+extern int scimove          _PARAMS((char *fname, unsigned long fname_len));
 extern int glue _PARAMS((char *fname, unsigned long fname_len));
 extern int unglue _PARAMS((char *fname, unsigned long fname_len));
 extern int drawnow _PARAMS((char *fname, unsigned long fname_len));
@@ -182,7 +182,7 @@
   {sci_delete,"delete"},
   {addcb,"addcb"},
   {copy,"copy"},
-  {move,"move"},
+  {scimove,"move"},
   {glue,"glue"},
   {unglue,"unglue"}, 
   {drawnow,"drawnow"},
diff -Naur scilab-4.1.2.orig/routines/interf/intinterp.c scilab-4.1.2/routines/interf/intinterp.c
--- scilab-4.1.2.orig/routines/interf/intinterp.c	2006-07-11 18:06:00.000000000 +0200
+++ scilab-4.1.2/routines/interf/intinterp.c	2008-01-11 17:44:35.000000000 +0100
@@ -10,6 +10,9 @@
 #if WIN32|| defined (linux)
 #include <string.h>
 #endif
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #include <math.h>
 
 
diff -Naur scilab-4.1.2.orig/routines/interf/matdes.c scilab-4.1.2/routines/interf/matdes.c
--- scilab-4.1.2.orig/routines/interf/matdes.c	2007-10-16 11:30:34.000000000 +0200
+++ scilab-4.1.2/routines/interf/matdes.c	2008-01-11 17:44:36.000000000 +0100
@@ -5221,7 +5221,7 @@
 
 
 /*-----------------------------------------------------------------------------------*/
-int move(char *fname,unsigned long fname_len)
+int scimove(char *fname,unsigned long fname_len)
 {
   long hdl;
   integer m1,n1,l1,m2,n2,l2,m3,n3,l3,n;
diff -Naur scilab-4.1.2.orig/routines/interf/matelm.f scilab-4.1.2/routines/interf/matelm.f
--- scilab-4.1.2.orig/routines/interf/matelm.f	2007-09-10 10:55:36.000000000 +0200
+++ scilab-4.1.2/routines/interf/matelm.f	2008-01-11 17:44:36.000000000 +0100
@@ -5091,7 +5091,7 @@
          tiniest = dlamch('u')
          if ( tiniest/b .ne. 0.d0 ) then
 c     denormalised number are used
-            do i = 1, dlamch('n') - 1
+            do i = 1, int(dlamch('n')) - 1
                tiniest = tiniest / b
             enddo
          endif
diff -Naur scilab-4.1.2.orig/routines/os_specific/link_SYSV.c scilab-4.1.2/routines/os_specific/link_SYSV.c
--- scilab-4.1.2.orig/routines/os_specific/link_SYSV.c	2003-02-04 22:16:08.000000000 +0100
+++ scilab-4.1.2/routines/os_specific/link_SYSV.c	2008-01-11 17:44:35.000000000 +0100
@@ -34,7 +34,7 @@
 #endif
 
 
-#if defined(linux) || defined(netbsd) || defined(freebsd)
+#if defined(linux) || defined(netbsd) || defined(freebsd) || defined(__APPLE__)
 #include <unistd.h>
 #include <sys/wait.h>
 #endif 
diff -Naur scilab-4.1.2.orig/routines/scicos/matscicos.c scilab-4.1.2/routines/scicos/matscicos.c
--- scilab-4.1.2.orig/routines/scicos/matscicos.c	2007-10-08 08:29:51.000000000 +0200
+++ scilab-4.1.2/routines/scicos/matscicos.c	2008-01-11 17:44:36.000000000 +0100
@@ -3,6 +3,9 @@
 /* INRIA 2005 */
 /* Allan CORNET */
 /*-----------------------------------------------------------------------------------*/
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #if WIN32
 #include <Windows.h>
 #include "../os_specific/win_mem_alloc.h"
diff -Naur scilab-4.1.2.orig/routines/wintools/intOEMconvert.h scilab-4.1.2/routines/wintools/intOEMconvert.h
--- scilab-4.1.2.orig/routines/wintools/intOEMconvert.h	2005-05-10 16:52:08.000000000 +0200
+++ scilab-4.1.2/routines/wintools/intOEMconvert.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTOEMCONVERT__
 #define __INTOEMCONVERT__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/intabout.h scilab-4.1.2/routines/wintools/intabout.h
--- scilab-4.1.2.orig/routines/wintools/intabout.h	2005-03-02 16:47:56.000000000 +0100
+++ scilab-4.1.2/routines/wintools/intabout.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTABOUT__
 #define __INTABOUT__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/intconsoledos.h scilab-4.1.2/routines/wintools/intconsoledos.h
--- scilab-4.1.2.orig/routines/wintools/intconsoledos.h	2005-03-02 16:47:56.000000000 +0100
+++ scilab-4.1.2/routines/wintools/intconsoledos.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTCONSOLEDOS__
 #define __INTCONSOLEDOS__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/intfileassociationbox.h scilab-4.1.2/routines/wintools/intfileassociationbox.h
--- scilab-4.1.2.orig/routines/wintools/intfileassociationbox.h	2005-09-18 21:19:52.000000000 +0200
+++ scilab-4.1.2/routines/wintools/intfileassociationbox.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTFILEASSOCIATIONBOX__
 #define __INTFILEASSOCIATIONBOX__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include "../wsci/FilesAssociationBox.h"
   #include "../wsci/wgnuplib.h"
diff -Naur scilab-4.1.2.orig/routines/wintools/intihmcolor.h scilab-4.1.2/routines/wintools/intihmcolor.h
--- scilab-4.1.2.orig/routines/wintools/intihmcolor.h	2005-08-05 23:26:45.000000000 +0200
+++ scilab-4.1.2/routines/wintools/intihmcolor.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTIHMCOLOR__
 #define __INTIHMCOLOR__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/intmcisendstring.h scilab-4.1.2/routines/wintools/intmcisendstring.h
--- scilab-4.1.2.orig/routines/wintools/intmcisendstring.h	2005-05-02 20:35:23.000000000 +0200
+++ scilab-4.1.2/routines/wintools/intmcisendstring.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTMCISENDSTRING__
 #define __INTMCISENDSTRING__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/intpathname.h scilab-4.1.2/routines/wintools/intpathname.h
--- scilab-4.1.2.orig/routines/wintools/intpathname.h	2005-03-02 16:47:56.000000000 +0100
+++ scilab-4.1.2/routines/wintools/intpathname.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTPATHNAME__
 #define __INTPATHNAME__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/intprintbox.h scilab-4.1.2/routines/wintools/intprintbox.h
--- scilab-4.1.2.orig/routines/wintools/intprintbox.h	2005-08-03 15:26:51.000000000 +0200
+++ scilab-4.1.2/routines/wintools/intprintbox.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTPRINTBOX__
 #define __INTPRINTBOX__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/intsetlanguagemenu.h scilab-4.1.2/routines/wintools/intsetlanguagemenu.h
--- scilab-4.1.2.orig/routines/wintools/intsetlanguagemenu.h	2005-03-02 16:47:56.000000000 +0100
+++ scilab-4.1.2/routines/wintools/intsetlanguagemenu.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTSETLANGUAGEMENU__
 #define __INTSETLANGUAGEMENU__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/inttoolbar.h scilab-4.1.2/routines/wintools/inttoolbar.h
--- scilab-4.1.2.orig/routines/wintools/inttoolbar.h	2005-03-02 16:47:56.000000000 +0100
+++ scilab-4.1.2/routines/wintools/inttoolbar.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTTOOLBAR__
 #define __INTTOOLBAR__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/inttoprint.h scilab-4.1.2/routines/wintools/inttoprint.h
--- scilab-4.1.2.orig/routines/wintools/inttoprint.h	2005-08-04 14:12:02.000000000 +0200
+++ scilab-4.1.2/routines/wintools/inttoprint.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTTOPRINT__
 #define __INTTOPRINT__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/intwinopen.h scilab-4.1.2/routines/wintools/intwinopen.h
--- scilab-4.1.2.orig/routines/wintools/intwinopen.h	2005-03-02 16:47:56.000000000 +0100
+++ scilab-4.1.2/routines/wintools/intwinopen.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTWINOPEN__
 #define __INTWINOPEN__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
 #endif
diff -Naur scilab-4.1.2.orig/routines/wintools/intwintools.h scilab-4.1.2/routines/wintools/intwintools.h
--- scilab-4.1.2.orig/routines/wintools/intwintools.h	2005-03-02 16:47:56.000000000 +0100
+++ scilab-4.1.2/routines/wintools/intwintools.h	2008-01-11 17:44:36.000000000 +0100
@@ -5,6 +5,9 @@
 #ifndef __INTWINTOOLS__
 #define __INTWINTOOLS__
 
+#ifdef __APPLE__
+#include <string.h>
+#endif
 #ifdef WIN32
   #include <windows.h>
   #include <stdio.h>
