ThirdParty: fix compilation of ParMGridGen-1.0 on Mac OS X
[OpenFOAM-1.6-ext.git] / ThirdParty / rpmBuild / SOURCES / ParMGridGen-1.0.patch_darwin
blob29a9db97c5c22b62cf935502fa217c769198382b
1 diff -ruN ParMGridGen-1.0_orig/MGridGen/IMlib/IMlib.h ParMGridGen-1.0/MGridGen/IMlib/IMlib.h
2 --- ParMGridGen-1.0_orig/MGridGen/IMlib/IMlib.h 2001-11-08 18:41:25.000000000 -0500
3 +++ ParMGridGen-1.0/MGridGen/IMlib/IMlib.h      2011-12-24 13:46:41.000000000 -0500
4 @@ -43,7 +43,7 @@
5  #ifdef DMALLOC
6  #include <dmalloc.h>
7  #else
8 -#include <malloc.h>
9 +#include <sys/malloc.h>
10  #endif
12  /*************************************************************************
13 diff -ruN ParMGridGen-1.0_orig/MGridGen/IMlib/Makefile ParMGridGen-1.0/MGridGen/IMlib/Makefile
14 --- ParMGridGen-1.0_orig/MGridGen/IMlib/Makefile        2001-12-04 17:46:56.000000000 -0500
15 +++ ParMGridGen-1.0/MGridGen/IMlib/Makefile     2011-12-24 13:24:17.000000000 -0500
16 @@ -33,7 +33,7 @@
17  .c.o:
18         $(CC) $(CFLAGS) -c $*.c
20 -./libIMlib.a: $(OBJS)
21 +libIMlib.$(LIBEXT): $(OBJS)
22         $(AR) $@ $(OBJS)
23         $(RANLIB) $@
25 @@ -41,4 +41,4 @@
26         rm -f *.o
28  realclean:
29 -       rm -f *.o ; rm -f ./libIMlib.a
30 +       rm -f *.o ; rm -f ./libIMlib.$(LIBEXT)
31 diff -ruN ParMGridGen-1.0_orig/MGridGen/Lib/Makefile ParMGridGen-1.0/MGridGen/Lib/Makefile
32 --- ParMGridGen-1.0_orig/MGridGen/Lib/Makefile  2001-12-04 18:01:00.000000000 -0500
33 +++ ParMGridGen-1.0/MGridGen/Lib/Makefile       2011-12-24 13:24:17.000000000 -0500
34 @@ -22,7 +22,7 @@
35  INCLUDES = -I./ -I$(IMLIBDIR) $(INCDIR)
36  CFLAGS = $(COPTIONS) $(OPTFLAGS) $(DEBUGFLAGS) $(INCLUDES)
38 -OBJS = coarsen.o kwayfm.o match.o merge.o mgridgen.o refine.o setup.o 
39 +OBJS = aratio.o coarsen.o kwayfm.o match.o merge.o mgridgen.o refine.o setup.o 
40  IOBJS = blas.o dfkeysort.o dkeysort.o file.o ifkeysort.o ifloatsort.o \
41         iintsort.o ikeysort.o memory.o  sort.o util.o
42  IMOBJS = $(addprefix ../IMlib/, $(IOBJS)) 
43 @@ -31,7 +31,7 @@
44  .c.o:
45         $(CC) $(CFLAGS) -c $*.c
47 -../../libmgrid.a: $(OBJS) $(IMOBJS)
48 +libMGridGen.$(LIBEXT): $(OBJS) $(IMOBJS)
49         $(AR) $@  $(OBJS) $(IMOBJS)
50         $(RANLIB) $@
52 @@ -39,4 +39,4 @@
53         rm -f *.o
55  realclean:
56 -       rm -f *.o ; rm -f ../../libmgrid.a
57 +       rm -f *.o ; rm -f ./libMGridGen.$(LIBEXT)
58 diff -ruN ParMGridGen-1.0_orig/MGridGen/Lib/mgridgen.h ParMGridGen-1.0/MGridGen/Lib/mgridgen.h
59 --- ParMGridGen-1.0_orig/MGridGen/Lib/mgridgen.h        2001-11-08 18:41:25.000000000 -0500
60 +++ ParMGridGen-1.0/MGridGen/Lib/mgridgen.h     2011-12-24 13:48:18.000000000 -0500
61 @@ -26,7 +26,7 @@
62  #ifdef DMALLOC
63  #include <dmalloc.h>
64  #else
65 -#include <malloc.h>
66 +#include <sys/malloc.h>
67  #endif
69  #include "defs.h"
70 diff -ruN ParMGridGen-1.0_orig/MGridGen/Programs/Makefile ParMGridGen-1.0/MGridGen/Programs/Makefile
71 --- ParMGridGen-1.0_orig/MGridGen/Programs/Makefile     2001-12-04 18:02:26.000000000 -0500
72 +++ ParMGridGen-1.0/MGridGen/Programs/Makefile  2011-12-24 13:24:17.000000000 -0500
73 @@ -1,6 +1,6 @@
74  include ../../Makefile.in
76 -MGRIDLIB  = ../../libmgrid.a
77 +MGRIDLIB  = ../Lib/libMGridGen.$(LIBEXT)
79  ifeq ($(ddmalloc),yes)
80    DEBUGFLAGS := $(DEBUGFLAGS) -DDMALLOC -DDEBUG
81 diff -ruN ParMGridGen-1.0_orig/Makefile.in ParMGridGen-1.0/Makefile.in
82 --- ParMGridGen-1.0_orig/Makefile.in    2011-12-24 13:54:44.000000000 -0500
83 +++ ParMGridGen-1.0/Makefile.in 2011-12-24 13:49:26.000000000 -0500
84 @@ -1,6 +1,6 @@
85  #--------------------------------------------------------------------------
86  # Which make to use 
87 -make = gmake
88 +make = make
90  # Which compiler to use
91  #  CC is the compiler for the serial code
92 @@ -12,7 +12,7 @@
93  OPTFLAGS = -O3
95  # What options to be used by the compiler
96 -COPTIONS = 
97 +COPTIONS = -fPIC
99  # Which loader to use
100  LD = cc
101 @@ -33,22 +33,25 @@
103  # In which directories to look for any additional libraries
104  LIBDIR = -L../.. \
105 -         -L/usr/lib32/
106 +         -L../Lib \
107 +         -L/usr/lib/
109  # Set some flags
110  DEBUGFLAGS =
112  # What additional libraries to link the programs with (eg., -lmpi)
113 -LIBS = -lmgrid -lm
114 -PARLIBS = -lparmgrid -lmgrid -lmpi -lm
115 +LIBEXT = dylib
117 +LIBS = -lMGridGen -lm
118 +PARLIBS = -lparmgrid -lMGridGen -lmpi -lm
121  # What archiving to use
122 -AR = ar rv
123 +AR = gcc -dynamiclib -undefined dynamic_lookup -shared -o
125  # What to use for indexing the archive
126  #RANLIB = ranlib
127 -RANLIB = ar -ts
128 +RANLIB = true
130  #--------------------------------------------------------------------------
131  #