Ticket #17659: patch-src-dynlibs.diff

File patch-src-dynlibs.diff, 6.0 KB (added by ian.grant@…, 16 years ago)

Patch for mosml and new mosml-dynlibs port

  • include/config.h

    diff -urN ../mosml.orig/include/config.h ./include/config.h
    old new  
    22#define _config_
    33
    44
    5 #if defined(__MWERKS__) || defined(THINK_C)
     5#if defined(__MWERKS__) || defined(THINK_C) || defined(LSB)
    66#include "m.h"
    77#include "s.h"
    88#else
  • src/Makefile

    diff -urN ../mosml.orig/src/Makefile ./src/Makefile
    old new  
    2525        cd lex; make all
    2626        cd launch; make all
    2727
     28world-dyn:
     29        cd dynlibs/msocket; make
     30        cd dynlibs/crypt; make
     31        cd dynlibs/munix; make
     32        cd dynlibs/mregex; make
     33        cd dynlibs/mgdbm; make
     34        cd dynlibs/mgd; make
     35        cd dynlibs/intinf; make
     36
     37install-world-dyn: dirs
     38        cd dynlibs/msocket; make install
     39        cd dynlibs/crypt; make install
     40        cd dynlibs/munix; make install
     41        cd dynlibs/mregex; make install
     42        cd dynlibs/mgdbm; make install
     43        cd dynlibs/mgd; make install
     44        cd dynlibs/intinf; make install
     45
    2846uptodate:
    2947        cd runtime; make all
    3048        cp runtime/camlrunm$(EXE) .
     
    4260        cd toolssrc; make clean all
    4361        cd lex; make clean all
    4462
    45 # Install the Mosml system
    46 install:
     63dirs:
    4764        test -d $(BINDIR) || mkdir -p $(BINDIR)
    4865        test -d $(LIBDIR) || mkdir -p $(LIBDIR)
    4966        test -d $(INCDIR) || mkdir -p $(INCDIR)
    5067        test -d $(DOCDIR) || mkdir -p $(DOCDIR)
    5168        test -d $(TOOLDIR) || mkdir -p $(TOOLDIR)
     69
     70# Install the Mosml system
     71install: dirs
    5272        cd runtime; make install
    5373        cd config; make install
    5474        cd launch; make all install
  • src/Makefile.inc

    diff -urN ../mosml.orig/src/Makefile.inc ./src/Makefile.inc
    old new  
    3030# For Linux (x86 or Alpha), use:
    3131# ------------------------------
    3232CPP=/usr/bin/cpp -P -traditional -Dunix -Umsdos
    33 STRIP=strip
    34 LD=gcc -rdynamic
    35 DYNLD=ld -shared
     33STRIP=echo
     34LD=gcc -Wl,-rpath -Wl,${DESTROOT}/lib/mosml
     35DYNLD=gcc -bundle -bundle_loader ${DESTROOT}/bin/camlrunm
     36ADDRUNLIBS=
     37ADDRUNCFLAGS=
     38ADDDYNLIBCFLAGS=-DLSB
    3639
    3740# For Cygwin 20.1, use:
    3841# ---------------------
  • src/dynlibs/crypt/Makefile

    diff -urN ../mosml.orig/src/dynlibs/crypt/Makefile ./src/dynlibs/crypt/Makefile
    old new  
    1313        $(CC) $(CFLAGS) -c -o crypt.o crypt.c
    1414
    1515libcrypt.so: crypt.o
    16         $(DYNLD) -lcrypt -o libcrypt.so crypt.o
    17 #       $(DYNLD)         -o libcrypt.so crypt.o
     16        $(DYNLD)         -o libcrypt.so crypt.o
     17
     18install:
     19        cp libcrypt.so $(LIBDIR)
    1820
    1921clean:
    2022        rm -f *.o
  • src/dynlibs/intinf/Makefile

    diff -urN ../mosml.orig/src/dynlibs/intinf/Makefile ./src/dynlibs/intinf/Makefile
    old new  
    55
    66# Where to find GMP header file and compiled library
    77
    8 GMPDIR=${HOME}/c/gmp-2.0.2
     8GMPDIR=/opt/local
     9GMPINCDIR=${GMPDIR}/include
     10GMPLIBDIR=${GMPDIR}/lib
    911
    1012include ../../Makefile.inc
    1113
    1214OPTS=-fno-defer-pop
    13 CFLAGS=-Dunix -O2 $(OPTS) $(ADDDYNLIBCFLAGS) -I$(INCDIR) -I ${GMPDIR}
     15CFLAGS=-Dunix -O2 $(OPTS) $(ADDDYNLIBCFLAGS) -I$(INCDIR) -I ${GMPINCDIR}
    1416
    1517MOSMLTOOLS=camlrunm $(MOSMLHOME)/tools
    1618MOSMLC=mosmlc -c
     
    1820MOSMLLEX=mosmllex
    1921MOSMLYACC=mosmlyac
    2022
    21 all: libmgmp.so IntInf.uo
     23all: libmgmp.so IntInf.uo IntInf.ui
    2224
    23 install:
     25install: all
    2426        cp libmgmp.so $(LIBDIR)
     27        cp IntInf.uo $(LIBDIR)
     28        cp IntInf.ui $(LIBDIR)
     29        cp IntInf.sig $(LIBDIR)
    2530
    2631intinf.o: intinf.c
    2732        $(CC) $(CFLAGS) -c -o intinf.o intinf.c
    2833
    2934libmgmp.so: intinf.o
    30         $(DYNLD) -o libmgmp.so intinf.o ${GMPDIR}/libgmp.a
     35        $(DYNLD) -o libmgmp.so intinf.o ${GMPLIBDIR}/libgmp.a
    3136
    3237test:
    3338        mosml testintinf.sml
  • src/dynlibs/mgd/Makefile

    diff -urN ../mosml.orig/src/dynlibs/mgd/Makefile ./src/dynlibs/mgd/Makefile
    old new  
    55
    66# Where to find gd header file and compiled library
    77
    8 GDDIR=${HOME}/c/gd-1.7.3
     8GDINCDIR=/opt/local/include
     9GDLIBDIR=/opt/local/lib
    910
    1011include ../../Makefile.inc
    1112
    1213OPTS=-fno-defer-pop
    13 CFLAGS=-Dunix -O2 $(OPTS) $(ADDDYNLIBCFLAGS) -I$(INCDIR) -I ${GDDIR}
     14CFLAGS=-Dunix -O2 $(OPTS) $(ADDDYNLIBCFLAGS) -I$(INCDIR) -I ${GDINCDIR}
    1415
    1516MOSMLTOOLS=camlrunm $(MOSMLHOME)/tools
    1617MOSMLC=mosmlc -c
     
    2425        $(CC) $(CFLAGS) -c -o mgd.o mgd.c
    2526
    2627libmgd.so: mgd.o
    27         $(DYNLD) -o libmgd.so mgd.o ${GDDIR}/libgd.a -L/usr/X11R6/lib -lpng -lz
     28        $(DYNLD) -o libmgd.so mgd.o ${GDLIBDIR}/libgd.a -L/usr/X11R6/lib -lpng -lz
    2829#       $(DYNLD) -o libmgd.so mgd.o ${GDDIR}/libgd.a -R/pack/libs/lib -L/pack/libs/lib -lpng -lz
    2930
    3031test: Graphs.uo
  • src/dynlibs/mgdbm/Makefile

    diff -urN ../mosml.orig/src/dynlibs/mgdbm/Makefile ./src/dynlibs/mgdbm/Makefile
    old new  
    55
    66# Where to find GDBM header file and compiled library
    77
    8 GDBMLIBDIR=${HOME}/c/gdbm-1.7.3
    9 GDBMINCDIR=${HOME}/c/gdbm-1.7.3
    10 #GDBMLIBDIR=/usr/lib
    11 #GDBMINCDIR=/usr/include
     8GDBMLIBDIR=/opt/local/lib
     9GDBMINCDIR=/opt/local/include
    1210
    1311include ../../Makefile.inc
    1412
  • src/dynlibs/munix/munix.c

    diff -urN ../mosml.orig/src/dynlibs/munix/munix.c ./src/dynlibs/munix/munix.c
    old new  
    5959    failwith("EINVAL"); break;
    6060  case EISDIR:
    6161    failwith("EISDIR"); break;
    62   case ELIBBAD:
    63     failwith("ELIBBAD"); break;
     62/*  case ELIBBAD:
     63    failwith("ELIBBAD"); break; */
    6464  case ECHILD:
    6565    failwith("ECHILD"); break;
    6666  case EINTR:
  • src/runtime/config.h

    diff -urN ../mosml.orig/src/runtime/config.h ./src/runtime/config.h
    old new  
    22#define _config_
    33
    44
    5 #if defined(__MWERKS__) || defined(THINK_C)
     5#if defined(__MWERKS__) || defined(THINK_C) || defined(LSB)
    66#include "m.h"
    77#include "s.h"
    88#else