aboutsummaryrefslogtreecommitdiff
path: root/graphics/xmorph/files/patch-aa
blob: d8b57ca0846b58ab01cdaff1fcf9908bf14c7911 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
--- Makefile.orig	Sat Apr 29 08:26:30 2000
+++ Makefile	Sat Aug  5 04:52:50 2000
@@ -121,7 +121,6 @@
 #CC=gcc
 #CC=/bin/cc
 #CC=cc
-CC=cc
 
 
 
@@ -142,7 +141,7 @@
 #
 
 #INCLUDE=-I/usr/local/include -I/usr/openwin/include
-INCLUDE=-I/usr/local/include
+INCLUDE=-I${X11BASE}/include
 
 
 
@@ -179,7 +178,7 @@
 #DEBUG=-O -g -Wall -DVERBOSE -DDEBUG
 #DEBUG=-O
 #DEBUG=-g3 -O -fullwarn -DVERBOSE -DDEBUG
-DEBUG=-g3 -O -fullwarn
+#DEBUG=-g3 -O -fullwarn
 
 
 
@@ -268,7 +267,10 @@
 #XLIBS=-L/usr/X11R6/lib -lXaw -lXmu -lXext -lXt -lX11
 
 # SGI IRIX:
-XLIBS=              -lXaw -lXmu -lXext -lXt -lcvt -lX11
+#XLIBS=              -lXaw -lXmu -lXext -lXt -lcvt -lX11
+
+# FreeBSD:
+XLIBS=-L${X11BASE}/lib -lXaw -lXmu -lXext -lXt -lX11
 
 
 
@@ -313,10 +315,10 @@
 #
 #   -lmalloc_cv has more robust memory checking
 
-#NON_GUI_LIBS = -lm
+NON_GUI_LIBS = -lm
 #NON_GUI_LIBS = -lm -ldl
 #NON_GUI_LIBS = -lm /usr/lib/debug/malloc.o
-NON_GUI_LIBS = -lm -lmalloc
+#NON_GUI_LIBS = -lm -lmalloc
 
 
 
@@ -344,7 +346,7 @@
 
 # SHLIB_EXT: filename extension for shared libraries
 # --------------------------------------------------
-SHLIB_EXT=so
+SHLIB_EXT=so.1
 
 
 
@@ -353,7 +355,7 @@
 ## -----------------------
 #
 
-LDFLAGS=-L/usr/local/lib
+LDFLAGS=
 
 
 
@@ -378,14 +380,14 @@
 
 #CFLAGS=$(DEBUG) $(DEFINES) $(INCLUDE) -DSUNOS
 
-CFLAGS=$(DEBUG) $(DEFINES) $(INCLUDE)
+CFLAGS+=$(DEBUG) $(DEFINES) $(INCLUDE)
 
 
 
 
 ## INSTALL_BASE: Directory base to install files
 ## ---------------------------------------------
-INSTALL_BASE=/usr/local
+INSTALL_BASE=${PREFIX}
 
 
 
@@ -450,15 +452,19 @@
      xmorph.o
 
 #all: morph.$(SHLIB_EXT)
-all: xmorph morph xmorph.man xmorph.info
+#all: xmorph morph xmorph.man xmorph.info
+all: libmorph.a libmorph.so xmorph
 
 libmorph.a: $(LIB_OBJS)
 	ar cr $@ $(LIB_OBJS)
 
 libmorph.$(SHLIB_EXT): $(LIB_OBJS)
-	ld $(SHLIB_FLAG) $(LDFLAGS) $(LIB_OBJS) -o $@
+	$(CC) $(SHLIB_FLAG) -Wl,-soname,$@ $(LDFLAGS) $(LIB_OBJS) -o $@
+
+libmorph.so: libmorph.$(SHLIB_EXT)
+	ln -sf libmorph.$(SHLIB_EXT) libmorph.so
 
-xmorph: main-x.o libmorph.a $(GUI_OBJS)
+xmorph: main-x.o libmorph.so $(GUI_OBJS)
 	@echo ""
 	@echo ""
 	@echo ""
@@ -471,14 +477,17 @@
 	@echo ""
 	@echo ""
 	@echo ""
-	$(CC) $(CFLAGS) -o $@ main-x.o $(GUI_OBJS) libmorph.a $(LIBS)
+	$(CC) $(CFLAGS) -o $@ main-x.o $(GUI_OBJS) -L. -lmorph $(LIBS)
 
-morph: main-cl.o libmorph.a
-	$(CC) $(CFLAGS) -o $@ main-cl.o libmorph.a $(NON_GUI_LIBS)
+morph: main-cl.o libmorph.so
+	$(CC) $(CFLAGS) -o $@ main-cl.o -L. -lmorph $(NON_GUI_LIBS)
 
 .c$(OBJ): $(SRCS) Makefile
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
 
+$(LIB_OBJS): $(LIB_OBJS:.o=.c) Makefile
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fpic -DPIC -c $<
+
 main-x.o: main.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -DX_GUI main.c -o $@
 
@@ -498,11 +507,12 @@
 
 
 
-install: xmorph xmorph.man libmorph.a libmorph.$(SHLIB_EXT)
-	cp xmorph $(INSTALL_BASE)/bin
-	cp xmorph.1 $(INSTALL_BASE)/man/man1
-	cp libmorph.a $(INSTALL_BASE)/lib
-	cp libmorph.$(SHLIB_EXT) $(INSTALL_BASE)/lib
+install: xmorph xmorph.man libmorph.a libmorph.so
+	${BSD_INSTALL_PROGRAM} xmorph $(INSTALL_BASE)/bin
+	${BSD_INSTALL_MAN} xmorph.1 $(INSTALL_BASE)/man/man1
+	${BSD_INSTALL_DATA} libmorph.a $(INSTALL_BASE)/lib
+	${BSD_INSTALL_DATA} libmorph.$(SHLIB_EXT) $(INSTALL_BASE)/lib
+	ln -sf libmorph.$(SHLIB_EXT) $(INSTALL_BASE)/lib/libmorph.so