summaryrefslogtreecommitdiff
blob: d9f3edb849474cba5e48b80b53f1409372fdb796 (plain)
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
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
 
 all:
-	cd sources; make
+	cd sources && $(MAKE)
 
 clean:
-	cd sources; make clean
+	cd sources && $(MAKE) clean
 
 install:
-	cd sources; make install
+	cd sources && $(MAKE) install
--- a/makes/generic.mak
+++ b/makes/generic.mak
@@ -30,11 +30,11 @@
 CP       = cp
 MKINFO   = makeinfo
 RMCMD    = rm -f
-STRIP    = strip
+STRIP    = true
 
 # Installation sites (GNU conventions):
 #
-prefix   = /usr/local
+prefix   = /usr
 bindir   = $(prefix)/bin
 includedir = $(prefix)/include
 mandir   = $(prefix)/man
@@ -44,10 +44,10 @@
 # CC and CFLAGS set for gcc, but any ANSI-C compiler should work.
 # For non-gcc compilers, simply set CFLAGS = -O (to start with)
 #
-CC       = gcc
-CFLAGS   = -O2 -Wall -finline-functions
+#CC       = gcc
+#CFLAGS   = -O2 -Wall -finline-functions
 
-LFLAGS   =                # only sometimes needed; see below for examples
+LFLAGS   = $(LDFLAGS)     # only sometimes needed; see below for examples
 CPPFLAGS = -I.            # only sometimes needed; see below for examples
 BINDCMD  =                # only needed for EMX and DJGPP DOS extenders
 
@@ -62,7 +62,7 @@
 #
 DEFINES   = -DUNIX -DHAS_UNIX_X11
 PREVIEWER = to_x11
-ALL_LIBS  = -lX11 -lm     #  Maybe -lX instead of -lX11 is needed?
+ALL_LIBS  = -L/usr/X11R6/lib/ -lX11 -lm     #  Maybe -lX instead of -lX11 is needed?
 #
 # Generic UNIX, no previewer
 #
@@ -195,31 +195,41 @@
 EX_SRC	=
 EX_OBJ	=
 EX_DEFS	=
+EX_LIBS = -lz
 #
 # PNG support (requires -lpng and -lz on the ALL_LIBS line)
-#EX_SRC	= png.c to_png.c
-#EX_OBJ	= png.o to_png.o 
-#EX_DEFS= -DPNG
+EX_SRC	+= png.c to_png.c
+EX_OBJ	+= png.o to_png.o 
+EX_DEFS += -DPNG
+EX_LIBS += -lpng
 #
 # TIFF support (requires -ltiff and possibly -lz on the ALL_LIBS line)
-#EX_SRC	= to_tif.c
-#EX_OBJ	= to_tif.o
-#EX_DEFS	= -DTIF
+EX_SRC	+= to_tif.c
+EX_OBJ	+= to_tif.o
+EX_DEFS	+= -DTIF
+EX_LIBS += -ltiff
 #
 # JPEG support (requires -ljpeg)
-#EX_SRC = to_jpg.c
-#EX_OBJ = to_jpg.o
-#EX_DEFS = -DJPG
+EX_SRC  += to_jpg.c
+EX_OBJ  += to_jpg.o
+EX_DEFS += -DJPG
+EX_LIBS += -ljpeg
 #
 # PDF support (requires -lpdf)
-#EX_SRC = to_pdf.c
-#EX_OBJ = to_pdf.o
-#EX_DEFS = -DUSEPDF
+#EX_SRC  += to_pdf.c
+#EX_OBJ  += to_pdf.o
+#EX_DEFS += -DUSEPDF
+#EX_LIBS += -lpdf
 #
 # Include extras:
-# EX_SRC	= to_pic.c to_pac.c
-# EX_OBJ	= to_pic.o to_pac.o
-# EX_DEFS	= -DPIC_PAC
+EX_SRC	 += to_pic.c to_pac.c
+EX_OBJ	 += to_pic.o to_pac.o
+EX_DEFS += -DPIC_PAC
+#
+# Epson Esc/P2 support 
+EX_SRC	+= to_escp2.c
+EX_OBJ	+= to_escp2.o
+EX_DEFS += -DEPSON
 #
 #############################################################################
 # No user-serviceable parts below!
@@ -245,8 +255,8 @@
 PROGRAM	= hp2xx
 
 default:
-	@echo "This makefile needs manual configuration! Edit it now!
-	@echo "After configuration, you may use the following commands:
+	@echo "This makefile needs manual configuration! Edit it now!"
+	@echo "After configuration, you may use the following commands:"
 	@echo   ""
 	@echo   "make all             Compile everything"
 	@echo   "make check           Run a color application in preview mode"
@@ -267,7 +277,7 @@
 #########################################################################
 
 all: $(OBJS)
-	$(CC) $(LFLAGS) $(OBJS) $(ALL_LIBS) -o $(PROGRAM)
+	$(CC) $(LFLAGS) $(OBJS) $(ALL_LIBS) $(EX_LIBS) -o $(PROGRAM)
 	$(BINDCMD)
 
 
--- a/sources/png.c
+++ b/sources/png.c
@@ -5,6 +5,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "to_png.h"
+#include <zlib.h>
 #include <png.h>
 
 #define PDNCOL 256
@@ -36,7 +37,7 @@
 	}
 
 	/* set up error handlimg for libpng */
-	if (setjmp(png_ptr->jmpbuf)) {
+	if (setjmp(png_jmpbuf(png_ptr))) {
 		png_destroy_write_struct(&png_ptr, &info_ptr);
 		return;
 	}