Update to 1.8.4.

Add MASTER_SITE_RINGSERVER to MASTER_SITES.

Add a couple of patches to complete GD's Japanese support.

PR:		ports/24930
Submitted by:	KATO Tsuguru <tkato@prontomail.ne.jp>, knu
Approved by:	billf (MAINTAINER)
This commit is contained in:
Akinori MUSHA 2001-02-12 09:34:33 +00:00
parent 4c79d198a3
commit a128c373e6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=38245
18 changed files with 606 additions and 282 deletions

View file

@ -1,4 +1,4 @@
# New ports collection makefile for: gd
# New ports collection makefile for: gd
# Date created: 27 Mar 1998
# Whom: jeff@cetlink.net
#
@ -6,17 +6,19 @@
#
PORTNAME= gd
PORTVERSION= 1.8.3
PORTVERSION= 1.8.4
CATEGORIES= graphics
MASTER_SITES= http://www.boutell.com/gd/http/ \
ftp://ftp.boutell.com/pub/boutell/gd/
ftp://ftp.boutell.com/pub/boutell/gd/ \
${MASTER_SITE_RINGSERVER}
MASTER_SITE_SUBDIR= graphics/gd
MAINTAINER= billf@FreeBSD.org
LIB_DEPENDS= png.4:${PORTSDIR}/graphics/png \
jpeg.9:${PORTSDIR}/graphics/jpeg
jpeg.9:${PORTSDIR}/graphics/jpeg \
freetype.6:${PORTSDIR}/print/freetype2
USE_FREETYPE= yes
.if defined(WITH_X11)
USE_XLIB= yes
USE_XPM= yes
@ -24,13 +26,13 @@ USE_XPM= yes
INSTALLS_SHLIB= yes
pre-fetch:
pre-everything:
.if !defined(WITH_X11)
@${ECHO} -n "If you want to compile in X support use "
@${ECHO} "'make -DWITH_X11' instead"
@${ECHO_MSG} "If you want to compile in X support use "
@${ECHO_MSG} "'make -DWITH_X11' instead"
.endif
pre-install:
${MKDIR} ${PREFIX}/include/gd
post-extract:
@${RM} -f ${WRKSRC}/*.o
.include <bsd.port.mk>

View file

@ -1 +1 @@
MD5 (gd-1.8.3.tar.gz) = ad0e7dd1dda2812dbaeaa9706c4be536
MD5 (gd-1.8.4.tar.gz) = 813625508e31f5c205904a305bdc8669

View file

@ -1,6 +1,6 @@
--- Makefile.orig Sun Jun 4 03:26:12 2000
+++ Makefile Thu Nov 9 14:53:41 2000
@@ -3,18 +3,22 @@
--- Makefile.orig Fri Feb 2 05:23:56 2001
+++ Makefile Sat Feb 3 09:24:57 2001
@@ -3,11 +3,11 @@
#If you do not have gcc, change the setting for COMPILER, but you must
#use an ANSI standard C compiler (NOT the old SunOS 4.1.3 cc
#compiler; get gcc if you are still using it).
@ -13,101 +13,92 @@
+#AR=ar
#If you don't have FreeType, libjpeg and/or Xpm installed, including the
#header files, uncomment this (default).
-CFLAGS=-O
+#CFLAGS=-O
#header files, uncomment this (default). You really must install
@@ -16,8 +16,10 @@
#If you do have FreeType, libjpeg and/or Xpm fully installed, uncomment a
#variation of this and comment out the line above. See also LIBS below.
-#CFLAGS=-O -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF
-CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG \
- -DHAVE_LIBFREETYPE -DHAVE_LIBTTF
+CFLAGS+=-DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE
+.if defined(WITH_X11)
+CFLAGS+=-DHAVE_XPM -DHAVE_JPEG
+.else
+CFLAGS+=-DHAVE_JPEG -DHAVE_LIBTTF
+CFLAGS+=-DHAVE_LIBXPM
+.endif
#If you don't have FreeType and/or Xpm fully installed, uncomment this
#(default).
@@ -23,7 +27,7 @@
#To use the old FreeType 1.x library, add this additional #define
#to the line above
@@ -30,13 +32,15 @@
#Some systems are very picky about link order. They don't all agree
#on the right order, either.
-LIBS=-lm -lgd -lpng -lz
+LIBS=-lm -lgd -lpng -lz -ljpeg -lttf
-#LIBS=-lgd -lpng -lz
+LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm
#If you do have FreeType, JPEG and/or Xpm fully installed, uncomment a
#variation of this and comment out the line above. Note that
@@ -33,14 +37,19 @@
#Some systems are very picky about link order. They don't all agree
#on the right order, either.
#Xpm requires X11. See also CFLAGS above.
-#LIBS=-lm -lgd -lpng -lz -ljpeg -lttf -lXpm -lX11
-LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm -lttf
+.if defined(WITH_X11)
+LIBS+= -lXpm -lX11
+LIBS+=-lXpm -lX11
+.endif
#Typical install locations for freetype, zlib, xpm, libjpeg and libpng header files.
#If yours are somewhere else, change this.
#-I. is important to ensure that the version of gd you are installing
#is used, and not an older release in your directory tree somewhere.
#Note: for Freetype 1.x, use DHAVE_LIBTTF and -lttf instead.
-INCLUDEDIRS=-I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11
+INCLUDEDIRS=-I. -I${LOCALBASE}/include -I${LOCALBASE}/include/freetype
@@ -45,7 +49,10 @@
#ensure that the version of gd you are installing is used, and not an
#older release in your directory tree somewhere.
-INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include
+INCLUDEDIRS=-I. -I${LOCALBASE}/include/freetype2 -I${LOCALBASE}/include
+.if defined(WITH_X11)
+INCLUDEDIRS+=-I${X11BASE}/include/X11 -I${X11BASE}/include
+.endif
#Typical install locations for freetype, zlib, xpm and libpng libraries.
#If yours are somewhere else, other than a standard location
@@ -48,16 +57,19 @@
#-L. as this allows the gd library itself to be found.
#Put -L. first so that old versions of the gd library elsewhere
@@ -55,16 +62,19 @@
#on your system can't cause conflicts while building a new one.
#This line shouldn't hurt if you don't actually have some of the
#optional libraries and directories.
-LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib
+LIBDIRS=-L. -L$(LOCALBASE)/lib
+LIBDIRS=-L. -L${LOCALBASE}/lib -Wl,--rpath,${LOCALBASE}/lib
+.if defined(WITH_X11)
+LIBDIRS+=-L$(X11BASE)/lib
+LIBDIRS+=-L${X11BASE}/lib -Wl,--rpath,${X11BASE}/lib
+.endif
#Location where libgd.a should be installed by "make install".
-INSTALL_LIB=/usr/local/lib
+INSTALL_LIB=$(PREFIX)/lib
+INSTALL_LIB=${PREFIX}/lib
#Location where .h files should be installed by "make install".
-INSTALL_INCLUDE=/usr/local/include
+INSTALL_INCLUDE=$(PREFIX)/include/gd
+INSTALL_INCLUDE=${PREFIX}/include/gd
#Location where useful non-test programs should be installed by "make install".
-INSTALL_BIN=/usr/local/bin
+INSTALL_BIN=$(PREFIX)/bin
+INSTALL_BIN=${PREFIX}/bin
#
#
@@ -65,36 +77,43 @@
#
#
@@ -74,34 +84,44 @@
-VERSION=1.8.1
+VERSION=1.8.2
VERSION=1.8.4
-CC=$(COMPILER) $(INCLUDEDIRS)
-LINK=$(CC) $(LIBDIRS) $(LIBS)
+CC+= $(INCLUDEDIRS)
+CC+=$(INCLUDEDIRS)
+#LINK=$(CC) $(LIBDIRS) $(LIBS)
PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS)
BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng
TEST_PROGRAMS=gdtest gddemo gd2time gdtestttf
TEST_PROGRAMS=gdtest gddemo gd2time gdtestft gdtestttf
-all: libgd.a $(PROGRAMS)
+.SUFFIXES: .c .so .o
+
+.c.so:
+ ${CC} -fpic -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+
+all: libgd.a libgd.so.1 $(PROGRAMS)
+SOVER=2
install: libgd.a $(BIN_PROGRAMS)
-install: libgd.a $(BIN_PROGRAMS)
- sh ./install-item 644 libgd.a $(INSTALL_LIB)/libgd.a
- sh ./install-item 755 pngtogd $(INSTALL_BIN)/pngtogd
- sh ./install-item 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
@ -125,52 +116,63 @@
- sh ./install-item 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
- sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
- sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
+ $(INSTALL) -c -m 644 libgd.a $(INSTALL_LIB)/libgd.a
+ $(INSTALL) -c -m 755 pngtogd $(INSTALL_BIN)/pngtogd
+ $(INSTALL) -c -m 755 libgd.so.1 $(INSTALL_LIB)/libgd.so.1
+ ln -sf libgd.so.1 $(INSTALL_LIB)/libgd.so
+ $(INSTALL) -c -m 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
+ $(INSTALL) -c -m 755 gdtopng $(INSTALL_BIN)/gdtopng
+ $(INSTALL) -c -m 755 gd2topng $(INSTALL_BIN)/gd2topng
+ $(INSTALL) -c -m 755 gd2copypal $(INSTALL_BIN)/gd2copypal
+ $(INSTALL) -c -m 755 gdparttopng $(INSTALL_BIN)/gdparttopng
+ $(INSTALL) -c -m 755 webpng $(INSTALL_BIN)/webpng
+ $(INSTALL) -c -m 755 bdftogd $(INSTALL_BIN)/bdftogd
+ $(INSTALL) -c -m 644 gd.h $(INSTALL_INCLUDE)/gd.h
+ $(INSTALL) -c -m 644 gdcache.h $(INSTALL_INCLUDE)/gdcache.h
+ $(INSTALL) -c -m 644 gd_io.h $(INSTALL_INCLUDE)/gd_io.h
+ $(INSTALL) -c -m 644 gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h
+ $(INSTALL) -c -m 644 gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h
+ $(INSTALL) -c -m 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
+ $(INSTALL) -c -m 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
+ $(INSTALL) -c -m 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
+.SUFFIXES: .c .so .o
+
+.c.so:
+ $(CC) -fpic -DPIC $(CFLAGS) -o $@ -c $<
+
+all: libgd.a libgd.so.$(SOVER) $(PROGRAMS)
+
+install: libgd.a libgd.so.$(SOVER) $(BIN_PROGRAMS)
+ -mkdir -p $(INSTALL_LIB) $(INSTALL_INCLUDE) $(INSTALL_BIN)
+ ${BSD_INSTALL_DATA} libgd.a $(INSTALL_LIB)/libgd.a
+ ${BSD_INSTALL_DATA} libgd.so.$(SOVER) $(INSTALL_LIB)/libgd.so.$(SOVER)
+ -ln -sf libgd.so.$(SOVER) $(INSTALL_LIB)/libgd.so
+ ${BSD_INSTALL_PROGRAM} pngtogd $(INSTALL_BIN)/pngtogd
+ ${BSD_INSTALL_PROGRAM} pngtogd2 $(INSTALL_BIN)/pngtogd2
+ ${BSD_INSTALL_PROGRAM} gdtopng $(INSTALL_BIN)/gdtopng
+ ${BSD_INSTALL_PROGRAM} gd2topng $(INSTALL_BIN)/gd2topng
+ ${BSD_INSTALL_PROGRAM} gd2copypal $(INSTALL_BIN)/gd2copypal
+ ${BSD_INSTALL_PROGRAM} gdparttopng $(INSTALL_BIN)/gdparttopng
+ ${BSD_INSTALL_PROGRAM} webpng $(INSTALL_BIN)/webpng
+ ${BSD_INSTALL_SCRIPT} bdftogd $(INSTALL_BIN)/bdftogd
+ ${BSD_INSTALL_DATA} gd.h $(INSTALL_INCLUDE)/gd.h
+ ${BSD_INSTALL_DATA} gdcache.h $(INSTALL_INCLUDE)/gdcache.h
+ ${BSD_INSTALL_DATA} gd_io.h $(INSTALL_INCLUDE)/gd_io.h
+ ${BSD_INSTALL_DATA} gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h
+ ${BSD_INSTALL_DATA} gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h
+ ${BSD_INSTALL_DATA} gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
+ ${BSD_INSTALL_DATA} gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
+ ${BSD_INSTALL_DATA} gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
gddemo: gddemo.o libgd.a
$(CC) gddemo.o -o gddemo $(LIBDIRS) $(LIBS)
@@ -129,16 +148,19 @@
@@ -138,18 +158,21 @@
gdtestttf: gdtestttf.o libgd.a
$(CC) gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
$(CC) --verbose gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
-libgd.a: gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
+OBJS= gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
+OBJS= gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o \
- gdfontg.o gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o \
- gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h gdfontg.h
+ gdfontg.o gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o
+INCS= gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h gdfontg.h
gdfontg.o gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \
- gd_wbmp.o gdhelpers.o gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h \
+ gd_wbmp.o gdhelpers.o
+INCS= gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h \
gdfontg.h gdhelpers.h
+
+libgd.a: $(INCS) $(OBJS)
rm -f libgd.a
- $(AR) rc libgd.a gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \
- gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o \
- gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \
- gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o
- gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \
- gd_wbmp.o gdhelpers.o
+ $(AR) rc libgd.a $(OBJS)
-ranlib libgd.a
+
+libgd.so.1: $(INCS) $(OBJS:.o=.so)
+ $(CC) -shared -Wl,-x -Wl,-assert -Wl,pure-text -Wl,-soname,$@ -o $@ $(OBJS:.o=.so) $(LIBDIRS) $(LIBS)
+ ln -sf libgd.so.1 libgd.so
+libgd.so.$(SOVER): $(INCS) $(OBJS:.o=.so)
+ $(CC) -shared -Wl,-x,-soname,$@ -o $@ $(OBJS:.o=.so) $(LIBDIRS) $(LIBS)
+ ln -sf libgd.so.$(SOVER) libgd.so
clean:
rm -f *.o *.a ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp

View file

@ -0,0 +1,87 @@
--- gdkanji.c.orig Fri Feb 2 05:23:56 2001
+++ gdkanji.c Wed Feb 7 20:59:08 2001
@@ -103,14 +103,18 @@
unsigned char *str;
#endif
{
- static int whatcode;
+ static int whatcode = ASCII;
+ int oldcode = ASCII;
int c, i;
char *lang = NULL;
c = '\1';
i = 0;
- if (whatcode == 0) whatcode = ASCII;
+ if (whatcode != EUCORSJIS && whatcode != ASCII) {
+ oldcode = whatcode;
+ whatcode = ASCII;
+ }
while ((whatcode == EUCORSJIS || whatcode == ASCII) && c != '\0') {
if ((c = str[i++]) != '\0') {
@@ -167,7 +171,7 @@
if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160))
whatcode = SJIS;
else
- if (c >= 253 && c >= 254) whatcode = EUC;
+ if (c >= 253 && c <= 254) whatcode = EUC;
else
if (c >= 161 && c <= 252) whatcode = EUCORSJIS;
}
@@ -184,6 +188,8 @@
debug("Kanji code detected at %d byte.", i);
#endif
+ if (whatcode == EUCORSJIS && oldcode != ASCII) whatcode = oldcode;
+
if (whatcode == EUCORSJIS) {
if (getenv ("LC_ALL")) lang = getenv ("LC_ALL");
else
@@ -310,7 +316,7 @@
error("invalid code specification: \"%s\" or \"%s\"",
EUCSTR, code);
#endif
- strcpy(to, from);
+ ustrcpy(to, from);
return;
}
@@ -328,7 +334,7 @@
else
#endif
error("something happen");
- strcpy(to, from);
+ ustrcpy(to, from);
return;
}
@@ -526,11 +532,10 @@
t = (unsigned char *)gdMalloc(BUFSIZ);
any2eucjp(t, s, BUFSIZ);
- i = strlen(t);
+ i = strlen((const char *)t);
gdFree(t);
return i;
}
-#endif
#ifdef DEBUG
int main()
@@ -543,7 +548,7 @@
while ( (c = fgetc(stdin)) != '\n' && i < BUFSIZ ) input[i++] = c;
input[i] = '\0';
- printf("input : %d bytes\n", strlen(input));
+ printf("input : %d bytes\n", strlen((const char *)input));
printf("output: %d bytes\n", strwidth(input));
output = (unsigned char *)gdMalloc(BUFSIZ);
@@ -555,4 +560,5 @@
return 0;
}
+#endif
#endif

View file

@ -0,0 +1,17 @@
--- gdttf.c.orig Fri Feb 2 05:23:56 2001
+++ gdttf.c Wed Feb 7 20:57:34 2001
@@ -221,11 +221,10 @@
byte = *((unsigned char *) str);
#ifdef JISX0208
if (0xA1 <= byte && byte <= 0xFE) {
- int jiscode, ku, ten;
+ int ku, ten;
- jiscode = 0x100 * (byte & 0x7F) + (str[1] & 0x7F);
- ku = (jiscode >> 8) - 0x20;
- ten = (jiscode % 256) - 0x20;
+ ku = (byte & 0x7F) - 0x20;
+ ten = (str[1] & 0x7F) - 0x20;
if ( (ku < 1 || ku > 92) || (ten < 1 || ten > 94) ) {
*chPtr = (Tcl_UniChar) byte;
return 1;

View file

@ -1,10 +1,10 @@
bin/bdftogd
bin/gd2copypal
bin/gd2topng
bin/gdparttopng
bin/gdtopng
bin/pngtogd
bin/pngtogd2
bin/gdtopng
bin/gd2topng
bin/gd2copypal
bin/gdparttopng
bin/webpng
include/gd/gd.h
include/gd/gd_io.h
@ -16,5 +16,5 @@ include/gd/gdfonts.h
include/gd/gdfontt.h
lib/libgd.a
lib/libgd.so
lib/libgd.so.1
lib/libgd.so.2
@dirrm include/gd

View file

@ -1,4 +1,4 @@
# New ports collection makefile for: gd
# New ports collection makefile for: gd
# Date created: 27 Mar 1998
# Whom: jeff@cetlink.net
#
@ -6,17 +6,19 @@
#
PORTNAME= gd
PORTVERSION= 1.8.3
PORTVERSION= 1.8.4
CATEGORIES= graphics
MASTER_SITES= http://www.boutell.com/gd/http/ \
ftp://ftp.boutell.com/pub/boutell/gd/
ftp://ftp.boutell.com/pub/boutell/gd/ \
${MASTER_SITE_RINGSERVER}
MASTER_SITE_SUBDIR= graphics/gd
MAINTAINER= billf@FreeBSD.org
LIB_DEPENDS= png.4:${PORTSDIR}/graphics/png \
jpeg.9:${PORTSDIR}/graphics/jpeg
jpeg.9:${PORTSDIR}/graphics/jpeg \
freetype.6:${PORTSDIR}/print/freetype2
USE_FREETYPE= yes
.if defined(WITH_X11)
USE_XLIB= yes
USE_XPM= yes
@ -24,13 +26,13 @@ USE_XPM= yes
INSTALLS_SHLIB= yes
pre-fetch:
pre-everything:
.if !defined(WITH_X11)
@${ECHO} -n "If you want to compile in X support use "
@${ECHO} "'make -DWITH_X11' instead"
@${ECHO_MSG} "If you want to compile in X support use "
@${ECHO_MSG} "'make -DWITH_X11' instead"
.endif
pre-install:
${MKDIR} ${PREFIX}/include/gd
post-extract:
@${RM} -f ${WRKSRC}/*.o
.include <bsd.port.mk>

View file

@ -1 +1 @@
MD5 (gd-1.8.3.tar.gz) = ad0e7dd1dda2812dbaeaa9706c4be536
MD5 (gd-1.8.4.tar.gz) = 813625508e31f5c205904a305bdc8669

View file

@ -1,6 +1,6 @@
--- Makefile.orig Sun Jun 4 03:26:12 2000
+++ Makefile Thu Nov 9 14:53:41 2000
@@ -3,18 +3,22 @@
--- Makefile.orig Fri Feb 2 05:23:56 2001
+++ Makefile Sat Feb 3 09:24:57 2001
@@ -3,11 +3,11 @@
#If you do not have gcc, change the setting for COMPILER, but you must
#use an ANSI standard C compiler (NOT the old SunOS 4.1.3 cc
#compiler; get gcc if you are still using it).
@ -13,101 +13,92 @@
+#AR=ar
#If you don't have FreeType, libjpeg and/or Xpm installed, including the
#header files, uncomment this (default).
-CFLAGS=-O
+#CFLAGS=-O
#header files, uncomment this (default). You really must install
@@ -16,8 +16,10 @@
#If you do have FreeType, libjpeg and/or Xpm fully installed, uncomment a
#variation of this and comment out the line above. See also LIBS below.
-#CFLAGS=-O -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF
-CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG \
- -DHAVE_LIBFREETYPE -DHAVE_LIBTTF
+CFLAGS+=-DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE
+.if defined(WITH_X11)
+CFLAGS+=-DHAVE_XPM -DHAVE_JPEG
+.else
+CFLAGS+=-DHAVE_JPEG -DHAVE_LIBTTF
+CFLAGS+=-DHAVE_LIBXPM
+.endif
#If you don't have FreeType and/or Xpm fully installed, uncomment this
#(default).
@@ -23,7 +27,7 @@
#To use the old FreeType 1.x library, add this additional #define
#to the line above
@@ -30,13 +32,15 @@
#Some systems are very picky about link order. They don't all agree
#on the right order, either.
-LIBS=-lm -lgd -lpng -lz
+LIBS=-lm -lgd -lpng -lz -ljpeg -lttf
-#LIBS=-lgd -lpng -lz
+LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm
#If you do have FreeType, JPEG and/or Xpm fully installed, uncomment a
#variation of this and comment out the line above. Note that
@@ -33,14 +37,19 @@
#Some systems are very picky about link order. They don't all agree
#on the right order, either.
#Xpm requires X11. See also CFLAGS above.
-#LIBS=-lm -lgd -lpng -lz -ljpeg -lttf -lXpm -lX11
-LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm -lttf
+.if defined(WITH_X11)
+LIBS+= -lXpm -lX11
+LIBS+=-lXpm -lX11
+.endif
#Typical install locations for freetype, zlib, xpm, libjpeg and libpng header files.
#If yours are somewhere else, change this.
#-I. is important to ensure that the version of gd you are installing
#is used, and not an older release in your directory tree somewhere.
#Note: for Freetype 1.x, use DHAVE_LIBTTF and -lttf instead.
-INCLUDEDIRS=-I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11
+INCLUDEDIRS=-I. -I${LOCALBASE}/include -I${LOCALBASE}/include/freetype
@@ -45,7 +49,10 @@
#ensure that the version of gd you are installing is used, and not an
#older release in your directory tree somewhere.
-INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include
+INCLUDEDIRS=-I. -I${LOCALBASE}/include/freetype2 -I${LOCALBASE}/include
+.if defined(WITH_X11)
+INCLUDEDIRS+=-I${X11BASE}/include/X11 -I${X11BASE}/include
+.endif
#Typical install locations for freetype, zlib, xpm and libpng libraries.
#If yours are somewhere else, other than a standard location
@@ -48,16 +57,19 @@
#-L. as this allows the gd library itself to be found.
#Put -L. first so that old versions of the gd library elsewhere
@@ -55,16 +62,19 @@
#on your system can't cause conflicts while building a new one.
#This line shouldn't hurt if you don't actually have some of the
#optional libraries and directories.
-LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib
+LIBDIRS=-L. -L$(LOCALBASE)/lib
+LIBDIRS=-L. -L${LOCALBASE}/lib -Wl,--rpath,${LOCALBASE}/lib
+.if defined(WITH_X11)
+LIBDIRS+=-L$(X11BASE)/lib
+LIBDIRS+=-L${X11BASE}/lib -Wl,--rpath,${X11BASE}/lib
+.endif
#Location where libgd.a should be installed by "make install".
-INSTALL_LIB=/usr/local/lib
+INSTALL_LIB=$(PREFIX)/lib
+INSTALL_LIB=${PREFIX}/lib
#Location where .h files should be installed by "make install".
-INSTALL_INCLUDE=/usr/local/include
+INSTALL_INCLUDE=$(PREFIX)/include/gd
+INSTALL_INCLUDE=${PREFIX}/include/gd
#Location where useful non-test programs should be installed by "make install".
-INSTALL_BIN=/usr/local/bin
+INSTALL_BIN=$(PREFIX)/bin
+INSTALL_BIN=${PREFIX}/bin
#
#
@@ -65,36 +77,43 @@
#
#
@@ -74,34 +84,44 @@
-VERSION=1.8.1
+VERSION=1.8.2
VERSION=1.8.4
-CC=$(COMPILER) $(INCLUDEDIRS)
-LINK=$(CC) $(LIBDIRS) $(LIBS)
+CC+= $(INCLUDEDIRS)
+CC+=$(INCLUDEDIRS)
+#LINK=$(CC) $(LIBDIRS) $(LIBS)
PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS)
BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng
TEST_PROGRAMS=gdtest gddemo gd2time gdtestttf
TEST_PROGRAMS=gdtest gddemo gd2time gdtestft gdtestttf
-all: libgd.a $(PROGRAMS)
+.SUFFIXES: .c .so .o
+
+.c.so:
+ ${CC} -fpic -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+
+all: libgd.a libgd.so.1 $(PROGRAMS)
+SOVER=2
install: libgd.a $(BIN_PROGRAMS)
-install: libgd.a $(BIN_PROGRAMS)
- sh ./install-item 644 libgd.a $(INSTALL_LIB)/libgd.a
- sh ./install-item 755 pngtogd $(INSTALL_BIN)/pngtogd
- sh ./install-item 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
@ -125,52 +116,63 @@
- sh ./install-item 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
- sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
- sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
+ $(INSTALL) -c -m 644 libgd.a $(INSTALL_LIB)/libgd.a
+ $(INSTALL) -c -m 755 pngtogd $(INSTALL_BIN)/pngtogd
+ $(INSTALL) -c -m 755 libgd.so.1 $(INSTALL_LIB)/libgd.so.1
+ ln -sf libgd.so.1 $(INSTALL_LIB)/libgd.so
+ $(INSTALL) -c -m 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
+ $(INSTALL) -c -m 755 gdtopng $(INSTALL_BIN)/gdtopng
+ $(INSTALL) -c -m 755 gd2topng $(INSTALL_BIN)/gd2topng
+ $(INSTALL) -c -m 755 gd2copypal $(INSTALL_BIN)/gd2copypal
+ $(INSTALL) -c -m 755 gdparttopng $(INSTALL_BIN)/gdparttopng
+ $(INSTALL) -c -m 755 webpng $(INSTALL_BIN)/webpng
+ $(INSTALL) -c -m 755 bdftogd $(INSTALL_BIN)/bdftogd
+ $(INSTALL) -c -m 644 gd.h $(INSTALL_INCLUDE)/gd.h
+ $(INSTALL) -c -m 644 gdcache.h $(INSTALL_INCLUDE)/gdcache.h
+ $(INSTALL) -c -m 644 gd_io.h $(INSTALL_INCLUDE)/gd_io.h
+ $(INSTALL) -c -m 644 gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h
+ $(INSTALL) -c -m 644 gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h
+ $(INSTALL) -c -m 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
+ $(INSTALL) -c -m 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
+ $(INSTALL) -c -m 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
+.SUFFIXES: .c .so .o
+
+.c.so:
+ $(CC) -fpic -DPIC $(CFLAGS) -o $@ -c $<
+
+all: libgd.a libgd.so.$(SOVER) $(PROGRAMS)
+
+install: libgd.a libgd.so.$(SOVER) $(BIN_PROGRAMS)
+ -mkdir -p $(INSTALL_LIB) $(INSTALL_INCLUDE) $(INSTALL_BIN)
+ ${BSD_INSTALL_DATA} libgd.a $(INSTALL_LIB)/libgd.a
+ ${BSD_INSTALL_DATA} libgd.so.$(SOVER) $(INSTALL_LIB)/libgd.so.$(SOVER)
+ -ln -sf libgd.so.$(SOVER) $(INSTALL_LIB)/libgd.so
+ ${BSD_INSTALL_PROGRAM} pngtogd $(INSTALL_BIN)/pngtogd
+ ${BSD_INSTALL_PROGRAM} pngtogd2 $(INSTALL_BIN)/pngtogd2
+ ${BSD_INSTALL_PROGRAM} gdtopng $(INSTALL_BIN)/gdtopng
+ ${BSD_INSTALL_PROGRAM} gd2topng $(INSTALL_BIN)/gd2topng
+ ${BSD_INSTALL_PROGRAM} gd2copypal $(INSTALL_BIN)/gd2copypal
+ ${BSD_INSTALL_PROGRAM} gdparttopng $(INSTALL_BIN)/gdparttopng
+ ${BSD_INSTALL_PROGRAM} webpng $(INSTALL_BIN)/webpng
+ ${BSD_INSTALL_SCRIPT} bdftogd $(INSTALL_BIN)/bdftogd
+ ${BSD_INSTALL_DATA} gd.h $(INSTALL_INCLUDE)/gd.h
+ ${BSD_INSTALL_DATA} gdcache.h $(INSTALL_INCLUDE)/gdcache.h
+ ${BSD_INSTALL_DATA} gd_io.h $(INSTALL_INCLUDE)/gd_io.h
+ ${BSD_INSTALL_DATA} gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h
+ ${BSD_INSTALL_DATA} gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h
+ ${BSD_INSTALL_DATA} gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
+ ${BSD_INSTALL_DATA} gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
+ ${BSD_INSTALL_DATA} gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
gddemo: gddemo.o libgd.a
$(CC) gddemo.o -o gddemo $(LIBDIRS) $(LIBS)
@@ -129,16 +148,19 @@
@@ -138,18 +158,21 @@
gdtestttf: gdtestttf.o libgd.a
$(CC) gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
$(CC) --verbose gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
-libgd.a: gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
+OBJS= gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
+OBJS= gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o \
- gdfontg.o gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o \
- gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h gdfontg.h
+ gdfontg.o gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o
+INCS= gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h gdfontg.h
gdfontg.o gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \
- gd_wbmp.o gdhelpers.o gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h \
+ gd_wbmp.o gdhelpers.o
+INCS= gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h \
gdfontg.h gdhelpers.h
+
+libgd.a: $(INCS) $(OBJS)
rm -f libgd.a
- $(AR) rc libgd.a gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \
- gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o \
- gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \
- gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o
- gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \
- gd_wbmp.o gdhelpers.o
+ $(AR) rc libgd.a $(OBJS)
-ranlib libgd.a
+
+libgd.so.1: $(INCS) $(OBJS:.o=.so)
+ $(CC) -shared -Wl,-x -Wl,-assert -Wl,pure-text -Wl,-soname,$@ -o $@ $(OBJS:.o=.so) $(LIBDIRS) $(LIBS)
+ ln -sf libgd.so.1 libgd.so
+libgd.so.$(SOVER): $(INCS) $(OBJS:.o=.so)
+ $(CC) -shared -Wl,-x,-soname,$@ -o $@ $(OBJS:.o=.so) $(LIBDIRS) $(LIBS)
+ ln -sf libgd.so.$(SOVER) libgd.so
clean:
rm -f *.o *.a ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp

View file

@ -0,0 +1,87 @@
--- gdkanji.c.orig Fri Feb 2 05:23:56 2001
+++ gdkanji.c Wed Feb 7 20:59:08 2001
@@ -103,14 +103,18 @@
unsigned char *str;
#endif
{
- static int whatcode;
+ static int whatcode = ASCII;
+ int oldcode = ASCII;
int c, i;
char *lang = NULL;
c = '\1';
i = 0;
- if (whatcode == 0) whatcode = ASCII;
+ if (whatcode != EUCORSJIS && whatcode != ASCII) {
+ oldcode = whatcode;
+ whatcode = ASCII;
+ }
while ((whatcode == EUCORSJIS || whatcode == ASCII) && c != '\0') {
if ((c = str[i++]) != '\0') {
@@ -167,7 +171,7 @@
if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160))
whatcode = SJIS;
else
- if (c >= 253 && c >= 254) whatcode = EUC;
+ if (c >= 253 && c <= 254) whatcode = EUC;
else
if (c >= 161 && c <= 252) whatcode = EUCORSJIS;
}
@@ -184,6 +188,8 @@
debug("Kanji code detected at %d byte.", i);
#endif
+ if (whatcode == EUCORSJIS && oldcode != ASCII) whatcode = oldcode;
+
if (whatcode == EUCORSJIS) {
if (getenv ("LC_ALL")) lang = getenv ("LC_ALL");
else
@@ -310,7 +316,7 @@
error("invalid code specification: \"%s\" or \"%s\"",
EUCSTR, code);
#endif
- strcpy(to, from);
+ ustrcpy(to, from);
return;
}
@@ -328,7 +334,7 @@
else
#endif
error("something happen");
- strcpy(to, from);
+ ustrcpy(to, from);
return;
}
@@ -526,11 +532,10 @@
t = (unsigned char *)gdMalloc(BUFSIZ);
any2eucjp(t, s, BUFSIZ);
- i = strlen(t);
+ i = strlen((const char *)t);
gdFree(t);
return i;
}
-#endif
#ifdef DEBUG
int main()
@@ -543,7 +548,7 @@
while ( (c = fgetc(stdin)) != '\n' && i < BUFSIZ ) input[i++] = c;
input[i] = '\0';
- printf("input : %d bytes\n", strlen(input));
+ printf("input : %d bytes\n", strlen((const char *)input));
printf("output: %d bytes\n", strwidth(input));
output = (unsigned char *)gdMalloc(BUFSIZ);
@@ -555,4 +560,5 @@
return 0;
}
+#endif
#endif

View file

@ -0,0 +1,17 @@
--- gdttf.c.orig Fri Feb 2 05:23:56 2001
+++ gdttf.c Wed Feb 7 20:57:34 2001
@@ -221,11 +221,10 @@
byte = *((unsigned char *) str);
#ifdef JISX0208
if (0xA1 <= byte && byte <= 0xFE) {
- int jiscode, ku, ten;
+ int ku, ten;
- jiscode = 0x100 * (byte & 0x7F) + (str[1] & 0x7F);
- ku = (jiscode >> 8) - 0x20;
- ten = (jiscode % 256) - 0x20;
+ ku = (byte & 0x7F) - 0x20;
+ ten = (str[1] & 0x7F) - 0x20;
if ( (ku < 1 || ku > 92) || (ten < 1 || ten > 94) ) {
*chPtr = (Tcl_UniChar) byte;
return 1;

View file

@ -1,10 +1,10 @@
bin/bdftogd
bin/gd2copypal
bin/gd2topng
bin/gdparttopng
bin/gdtopng
bin/pngtogd
bin/pngtogd2
bin/gdtopng
bin/gd2topng
bin/gd2copypal
bin/gdparttopng
bin/webpng
include/gd/gd.h
include/gd/gd_io.h
@ -16,5 +16,5 @@ include/gd/gdfonts.h
include/gd/gdfontt.h
lib/libgd.a
lib/libgd.so
lib/libgd.so.1
lib/libgd.so.2
@dirrm include/gd

View file

@ -1,4 +1,4 @@
# New ports collection makefile for: gd
# New ports collection makefile for: gd
# Date created: 27 Mar 1998
# Whom: jeff@cetlink.net
#
@ -6,17 +6,19 @@
#
PORTNAME= gd
PORTVERSION= 1.8.3
PORTVERSION= 1.8.4
CATEGORIES= graphics
MASTER_SITES= http://www.boutell.com/gd/http/ \
ftp://ftp.boutell.com/pub/boutell/gd/
ftp://ftp.boutell.com/pub/boutell/gd/ \
${MASTER_SITE_RINGSERVER}
MASTER_SITE_SUBDIR= graphics/gd
MAINTAINER= billf@FreeBSD.org
LIB_DEPENDS= png.4:${PORTSDIR}/graphics/png \
jpeg.9:${PORTSDIR}/graphics/jpeg
jpeg.9:${PORTSDIR}/graphics/jpeg \
freetype.6:${PORTSDIR}/print/freetype2
USE_FREETYPE= yes
.if defined(WITH_X11)
USE_XLIB= yes
USE_XPM= yes
@ -24,13 +26,13 @@ USE_XPM= yes
INSTALLS_SHLIB= yes
pre-fetch:
pre-everything:
.if !defined(WITH_X11)
@${ECHO} -n "If you want to compile in X support use "
@${ECHO} "'make -DWITH_X11' instead"
@${ECHO_MSG} "If you want to compile in X support use "
@${ECHO_MSG} "'make -DWITH_X11' instead"
.endif
pre-install:
${MKDIR} ${PREFIX}/include/gd
post-extract:
@${RM} -f ${WRKSRC}/*.o
.include <bsd.port.mk>

View file

@ -1 +1 @@
MD5 (gd-1.8.3.tar.gz) = ad0e7dd1dda2812dbaeaa9706c4be536
MD5 (gd-1.8.4.tar.gz) = 813625508e31f5c205904a305bdc8669

View file

@ -1,6 +1,6 @@
--- Makefile.orig Sun Jun 4 03:26:12 2000
+++ Makefile Thu Nov 9 14:53:41 2000
@@ -3,18 +3,22 @@
--- Makefile.orig Fri Feb 2 05:23:56 2001
+++ Makefile Sat Feb 3 09:24:57 2001
@@ -3,11 +3,11 @@
#If you do not have gcc, change the setting for COMPILER, but you must
#use an ANSI standard C compiler (NOT the old SunOS 4.1.3 cc
#compiler; get gcc if you are still using it).
@ -13,101 +13,92 @@
+#AR=ar
#If you don't have FreeType, libjpeg and/or Xpm installed, including the
#header files, uncomment this (default).
-CFLAGS=-O
+#CFLAGS=-O
#header files, uncomment this (default). You really must install
@@ -16,8 +16,10 @@
#If you do have FreeType, libjpeg and/or Xpm fully installed, uncomment a
#variation of this and comment out the line above. See also LIBS below.
-#CFLAGS=-O -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF
-CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG \
- -DHAVE_LIBFREETYPE -DHAVE_LIBTTF
+CFLAGS+=-DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE
+.if defined(WITH_X11)
+CFLAGS+=-DHAVE_XPM -DHAVE_JPEG
+.else
+CFLAGS+=-DHAVE_JPEG -DHAVE_LIBTTF
+CFLAGS+=-DHAVE_LIBXPM
+.endif
#If you don't have FreeType and/or Xpm fully installed, uncomment this
#(default).
@@ -23,7 +27,7 @@
#To use the old FreeType 1.x library, add this additional #define
#to the line above
@@ -30,13 +32,15 @@
#Some systems are very picky about link order. They don't all agree
#on the right order, either.
-LIBS=-lm -lgd -lpng -lz
+LIBS=-lm -lgd -lpng -lz -ljpeg -lttf
-#LIBS=-lgd -lpng -lz
+LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm
#If you do have FreeType, JPEG and/or Xpm fully installed, uncomment a
#variation of this and comment out the line above. Note that
@@ -33,14 +37,19 @@
#Some systems are very picky about link order. They don't all agree
#on the right order, either.
#Xpm requires X11. See also CFLAGS above.
-#LIBS=-lm -lgd -lpng -lz -ljpeg -lttf -lXpm -lX11
-LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm -lttf
+.if defined(WITH_X11)
+LIBS+= -lXpm -lX11
+LIBS+=-lXpm -lX11
+.endif
#Typical install locations for freetype, zlib, xpm, libjpeg and libpng header files.
#If yours are somewhere else, change this.
#-I. is important to ensure that the version of gd you are installing
#is used, and not an older release in your directory tree somewhere.
#Note: for Freetype 1.x, use DHAVE_LIBTTF and -lttf instead.
-INCLUDEDIRS=-I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11
+INCLUDEDIRS=-I. -I${LOCALBASE}/include -I${LOCALBASE}/include/freetype
@@ -45,7 +49,10 @@
#ensure that the version of gd you are installing is used, and not an
#older release in your directory tree somewhere.
-INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include
+INCLUDEDIRS=-I. -I${LOCALBASE}/include/freetype2 -I${LOCALBASE}/include
+.if defined(WITH_X11)
+INCLUDEDIRS+=-I${X11BASE}/include/X11 -I${X11BASE}/include
+.endif
#Typical install locations for freetype, zlib, xpm and libpng libraries.
#If yours are somewhere else, other than a standard location
@@ -48,16 +57,19 @@
#-L. as this allows the gd library itself to be found.
#Put -L. first so that old versions of the gd library elsewhere
@@ -55,16 +62,19 @@
#on your system can't cause conflicts while building a new one.
#This line shouldn't hurt if you don't actually have some of the
#optional libraries and directories.
-LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib
+LIBDIRS=-L. -L$(LOCALBASE)/lib
+LIBDIRS=-L. -L${LOCALBASE}/lib -Wl,--rpath,${LOCALBASE}/lib
+.if defined(WITH_X11)
+LIBDIRS+=-L$(X11BASE)/lib
+LIBDIRS+=-L${X11BASE}/lib -Wl,--rpath,${X11BASE}/lib
+.endif
#Location where libgd.a should be installed by "make install".
-INSTALL_LIB=/usr/local/lib
+INSTALL_LIB=$(PREFIX)/lib
+INSTALL_LIB=${PREFIX}/lib
#Location where .h files should be installed by "make install".
-INSTALL_INCLUDE=/usr/local/include
+INSTALL_INCLUDE=$(PREFIX)/include/gd
+INSTALL_INCLUDE=${PREFIX}/include/gd
#Location where useful non-test programs should be installed by "make install".
-INSTALL_BIN=/usr/local/bin
+INSTALL_BIN=$(PREFIX)/bin
+INSTALL_BIN=${PREFIX}/bin
#
#
@@ -65,36 +77,43 @@
#
#
@@ -74,34 +84,44 @@
-VERSION=1.8.1
+VERSION=1.8.2
VERSION=1.8.4
-CC=$(COMPILER) $(INCLUDEDIRS)
-LINK=$(CC) $(LIBDIRS) $(LIBS)
+CC+= $(INCLUDEDIRS)
+CC+=$(INCLUDEDIRS)
+#LINK=$(CC) $(LIBDIRS) $(LIBS)
PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS)
BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng
TEST_PROGRAMS=gdtest gddemo gd2time gdtestttf
TEST_PROGRAMS=gdtest gddemo gd2time gdtestft gdtestttf
-all: libgd.a $(PROGRAMS)
+.SUFFIXES: .c .so .o
+
+.c.so:
+ ${CC} -fpic -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+
+all: libgd.a libgd.so.1 $(PROGRAMS)
+SOVER=2
install: libgd.a $(BIN_PROGRAMS)
-install: libgd.a $(BIN_PROGRAMS)
- sh ./install-item 644 libgd.a $(INSTALL_LIB)/libgd.a
- sh ./install-item 755 pngtogd $(INSTALL_BIN)/pngtogd
- sh ./install-item 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
@ -125,52 +116,63 @@
- sh ./install-item 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
- sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
- sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
+ $(INSTALL) -c -m 644 libgd.a $(INSTALL_LIB)/libgd.a
+ $(INSTALL) -c -m 755 pngtogd $(INSTALL_BIN)/pngtogd
+ $(INSTALL) -c -m 755 libgd.so.1 $(INSTALL_LIB)/libgd.so.1
+ ln -sf libgd.so.1 $(INSTALL_LIB)/libgd.so
+ $(INSTALL) -c -m 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
+ $(INSTALL) -c -m 755 gdtopng $(INSTALL_BIN)/gdtopng
+ $(INSTALL) -c -m 755 gd2topng $(INSTALL_BIN)/gd2topng
+ $(INSTALL) -c -m 755 gd2copypal $(INSTALL_BIN)/gd2copypal
+ $(INSTALL) -c -m 755 gdparttopng $(INSTALL_BIN)/gdparttopng
+ $(INSTALL) -c -m 755 webpng $(INSTALL_BIN)/webpng
+ $(INSTALL) -c -m 755 bdftogd $(INSTALL_BIN)/bdftogd
+ $(INSTALL) -c -m 644 gd.h $(INSTALL_INCLUDE)/gd.h
+ $(INSTALL) -c -m 644 gdcache.h $(INSTALL_INCLUDE)/gdcache.h
+ $(INSTALL) -c -m 644 gd_io.h $(INSTALL_INCLUDE)/gd_io.h
+ $(INSTALL) -c -m 644 gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h
+ $(INSTALL) -c -m 644 gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h
+ $(INSTALL) -c -m 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
+ $(INSTALL) -c -m 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
+ $(INSTALL) -c -m 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
+.SUFFIXES: .c .so .o
+
+.c.so:
+ $(CC) -fpic -DPIC $(CFLAGS) -o $@ -c $<
+
+all: libgd.a libgd.so.$(SOVER) $(PROGRAMS)
+
+install: libgd.a libgd.so.$(SOVER) $(BIN_PROGRAMS)
+ -mkdir -p $(INSTALL_LIB) $(INSTALL_INCLUDE) $(INSTALL_BIN)
+ ${BSD_INSTALL_DATA} libgd.a $(INSTALL_LIB)/libgd.a
+ ${BSD_INSTALL_DATA} libgd.so.$(SOVER) $(INSTALL_LIB)/libgd.so.$(SOVER)
+ -ln -sf libgd.so.$(SOVER) $(INSTALL_LIB)/libgd.so
+ ${BSD_INSTALL_PROGRAM} pngtogd $(INSTALL_BIN)/pngtogd
+ ${BSD_INSTALL_PROGRAM} pngtogd2 $(INSTALL_BIN)/pngtogd2
+ ${BSD_INSTALL_PROGRAM} gdtopng $(INSTALL_BIN)/gdtopng
+ ${BSD_INSTALL_PROGRAM} gd2topng $(INSTALL_BIN)/gd2topng
+ ${BSD_INSTALL_PROGRAM} gd2copypal $(INSTALL_BIN)/gd2copypal
+ ${BSD_INSTALL_PROGRAM} gdparttopng $(INSTALL_BIN)/gdparttopng
+ ${BSD_INSTALL_PROGRAM} webpng $(INSTALL_BIN)/webpng
+ ${BSD_INSTALL_SCRIPT} bdftogd $(INSTALL_BIN)/bdftogd
+ ${BSD_INSTALL_DATA} gd.h $(INSTALL_INCLUDE)/gd.h
+ ${BSD_INSTALL_DATA} gdcache.h $(INSTALL_INCLUDE)/gdcache.h
+ ${BSD_INSTALL_DATA} gd_io.h $(INSTALL_INCLUDE)/gd_io.h
+ ${BSD_INSTALL_DATA} gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h
+ ${BSD_INSTALL_DATA} gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h
+ ${BSD_INSTALL_DATA} gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
+ ${BSD_INSTALL_DATA} gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
+ ${BSD_INSTALL_DATA} gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
gddemo: gddemo.o libgd.a
$(CC) gddemo.o -o gddemo $(LIBDIRS) $(LIBS)
@@ -129,16 +148,19 @@
@@ -138,18 +158,21 @@
gdtestttf: gdtestttf.o libgd.a
$(CC) gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
$(CC) --verbose gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
-libgd.a: gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
+OBJS= gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
+OBJS= gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o \
- gdfontg.o gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o \
- gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h gdfontg.h
+ gdfontg.o gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o
+INCS= gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h gdfontg.h
gdfontg.o gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \
- gd_wbmp.o gdhelpers.o gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h \
+ gd_wbmp.o gdhelpers.o
+INCS= gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h \
gdfontg.h gdhelpers.h
+
+libgd.a: $(INCS) $(OBJS)
rm -f libgd.a
- $(AR) rc libgd.a gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \
- gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o \
- gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \
- gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o
- gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \
- gd_wbmp.o gdhelpers.o
+ $(AR) rc libgd.a $(OBJS)
-ranlib libgd.a
+
+libgd.so.1: $(INCS) $(OBJS:.o=.so)
+ $(CC) -shared -Wl,-x -Wl,-assert -Wl,pure-text -Wl,-soname,$@ -o $@ $(OBJS:.o=.so) $(LIBDIRS) $(LIBS)
+ ln -sf libgd.so.1 libgd.so
+libgd.so.$(SOVER): $(INCS) $(OBJS:.o=.so)
+ $(CC) -shared -Wl,-x,-soname,$@ -o $@ $(OBJS:.o=.so) $(LIBDIRS) $(LIBS)
+ ln -sf libgd.so.$(SOVER) libgd.so
clean:
rm -f *.o *.a ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp

View file

@ -0,0 +1,87 @@
--- gdkanji.c.orig Fri Feb 2 05:23:56 2001
+++ gdkanji.c Wed Feb 7 20:59:08 2001
@@ -103,14 +103,18 @@
unsigned char *str;
#endif
{
- static int whatcode;
+ static int whatcode = ASCII;
+ int oldcode = ASCII;
int c, i;
char *lang = NULL;
c = '\1';
i = 0;
- if (whatcode == 0) whatcode = ASCII;
+ if (whatcode != EUCORSJIS && whatcode != ASCII) {
+ oldcode = whatcode;
+ whatcode = ASCII;
+ }
while ((whatcode == EUCORSJIS || whatcode == ASCII) && c != '\0') {
if ((c = str[i++]) != '\0') {
@@ -167,7 +171,7 @@
if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160))
whatcode = SJIS;
else
- if (c >= 253 && c >= 254) whatcode = EUC;
+ if (c >= 253 && c <= 254) whatcode = EUC;
else
if (c >= 161 && c <= 252) whatcode = EUCORSJIS;
}
@@ -184,6 +188,8 @@
debug("Kanji code detected at %d byte.", i);
#endif
+ if (whatcode == EUCORSJIS && oldcode != ASCII) whatcode = oldcode;
+
if (whatcode == EUCORSJIS) {
if (getenv ("LC_ALL")) lang = getenv ("LC_ALL");
else
@@ -310,7 +316,7 @@
error("invalid code specification: \"%s\" or \"%s\"",
EUCSTR, code);
#endif
- strcpy(to, from);
+ ustrcpy(to, from);
return;
}
@@ -328,7 +334,7 @@
else
#endif
error("something happen");
- strcpy(to, from);
+ ustrcpy(to, from);
return;
}
@@ -526,11 +532,10 @@
t = (unsigned char *)gdMalloc(BUFSIZ);
any2eucjp(t, s, BUFSIZ);
- i = strlen(t);
+ i = strlen((const char *)t);
gdFree(t);
return i;
}
-#endif
#ifdef DEBUG
int main()
@@ -543,7 +548,7 @@
while ( (c = fgetc(stdin)) != '\n' && i < BUFSIZ ) input[i++] = c;
input[i] = '\0';
- printf("input : %d bytes\n", strlen(input));
+ printf("input : %d bytes\n", strlen((const char *)input));
printf("output: %d bytes\n", strwidth(input));
output = (unsigned char *)gdMalloc(BUFSIZ);
@@ -555,4 +560,5 @@
return 0;
}
+#endif
#endif

View file

@ -0,0 +1,17 @@
--- gdttf.c.orig Fri Feb 2 05:23:56 2001
+++ gdttf.c Wed Feb 7 20:57:34 2001
@@ -221,11 +221,10 @@
byte = *((unsigned char *) str);
#ifdef JISX0208
if (0xA1 <= byte && byte <= 0xFE) {
- int jiscode, ku, ten;
+ int ku, ten;
- jiscode = 0x100 * (byte & 0x7F) + (str[1] & 0x7F);
- ku = (jiscode >> 8) - 0x20;
- ten = (jiscode % 256) - 0x20;
+ ku = (byte & 0x7F) - 0x20;
+ ten = (str[1] & 0x7F) - 0x20;
if ( (ku < 1 || ku > 92) || (ten < 1 || ten > 94) ) {
*chPtr = (Tcl_UniChar) byte;
return 1;

View file

@ -1,10 +1,10 @@
bin/bdftogd
bin/gd2copypal
bin/gd2topng
bin/gdparttopng
bin/gdtopng
bin/pngtogd
bin/pngtogd2
bin/gdtopng
bin/gd2topng
bin/gd2copypal
bin/gdparttopng
bin/webpng
include/gd/gd.h
include/gd/gd_io.h
@ -16,5 +16,5 @@ include/gd/gdfonts.h
include/gd/gdfontt.h
lib/libgd.a
lib/libgd.so
lib/libgd.so.1
lib/libgd.so.2
@dirrm include/gd