Commits

Anonymous committed 79a3ad3

- sync to 2.0.0

Comments (0)

Files changed (2)

-#Depending on your system, you will need to modify this makefile.
+#Depending on your system and the libraries and features you have
+#and want, you WILL need to modify this Makefile!
 
 #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). 
+#compiler; get gcc if you are still using that). 
 COMPILER=gcc
 
 #If the ar command fails on your system, consult the ar manpage
 #If you don't have FreeType, libjpeg and/or Xpm installed, including the
 #header files, uncomment this (default). You really must install
 #libpng and zlib to get anywhere if you wish to create PNG images.
-CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG
+#CFLAGS=-O -DHAVE_LIBPNG
 
-#If you do have FreeType, libjpeg and/or Xpm fully installed, uncomment a
+#If you do have FreeType 2.x, libjpeg and/or Xpm fully installed, uncomment a
 #variation of this and comment out the line above. See also LIBS below.
-#CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG \
-#	-DHAVE_LIBFREETYPE -DHAVE_LIBTTF 
-
-#To use the old FreeType 1.x library, add this additional #define
-#to the line above
-#-DHAVE_LIBTTF 
+CFLAGS=-g -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG \
+	-DHAVE_LIBFREETYPE
 
 #If you don't have FreeType Xpm fully installed, uncomment this
 #(default).
 
 #PLEASE NOTE: YOU MAY HAVE TO JUGGLE THE ORDER OF THE LIBRARIES.
 #Some systems are very picky about link order. They don't all agree
-#on the right order, either.
+#on the right order, either. 
 
-LIBS=-lgd -lpng -lz -lm
+#LIBS=-lgd -lpng -lz -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
 #Xpm requires X11. See also CFLAGS above.
 
-#LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm -lttf
-
-#Note: for Freetype 1.x, use DHAVE_LIBTTF and -lttf instead.
+LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm
 
-#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.
+#Typical install locations for freetype 2.0, 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.
 
 INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include 
 
 #Typical install locations for freetype, zlib, xpm and libpng libraries.
 #If yours are somewhere else, other than a standard location
-#such as /lib or /usr/lib, then change this. Be sure to keep
-#-L. as this allows the gd library itself to be found.
-#Put -L. first so that old versions of the gd library elsewhere
-#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
+#such as /lib or /usr/lib, then change this. This line shouldn't hurt 
+#if you don't actually have some of the optional libraries and directories.
+LIBDIRS=-L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib
 
-#Location where libgd.a should be installed by "make install".
-INSTALL_LIB=/usr/local/lib
+#Location where libgd.so should be installed by "make install".
+#THIS MUST BE ONE OF YOUR STANDARD SHARED LIBRARY LOCATIONS, unless
+#you add a new directory to your LD_LIBRARY_PATH environment setting.
+#Otherwise applications will NOT find libgd.so and will produce an 
+#error.  
+INSTALL_LIB=/usr/lib
 
 #Location where .h files should be installed by "make install".
-INSTALL_INCLUDE=/usr/local/include
+INSTALL_INCLUDE=/usr/include
 
 #Location where useful non-test programs should be installed by "make install".
 INSTALL_BIN=/usr/local/bin
 #
 #
 
-VERSION=1.8.4
+# Update these with each release!
+
+MAJOR_VERSION=2
+VERSION=2.0.0
 
 CC=$(COMPILER) $(INCLUDEDIRS)
 LINK=$(CC) $(LIBDIRS) $(LIBS)
 PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS)
 
 BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng
-TEST_PROGRAMS=gdtest gddemo gd2time gdtestft gdtestttf
-
-all: libgd.a $(PROGRAMS)
-
-install: libgd.a $(BIN_PROGRAMS)
-	sh ./install-item 644 libgd.a $(INSTALL_LIB)/libgd.a
+TEST_PROGRAMS=gdtest gddemo gd2time gdtestft gdtestttf testac
+
+default: instructions
+
+instructions:
+	@echo First, edit this Makefile. Read the comments at
+	@echo the beginning thoroughly.
+	@echo
+	@echo Second, type \'make install\' as root.
+	@echo
+	@echo This installs the GD ${VERSION} shared library,
+	@echo which is required in order to use the included
+	@echo utility programs, such as webpng, pngtogd, etc.
+	@echo 
+	@echo OPTIONAL third step: type \'make test\' to build 
+	@echo the optional test programs. Type \'make install\' FIRST.
+
+test: $(TEST_PROGRAMS)
+
+install: libgd.so.${VERSION} $(BIN_PROGRAMS)
 	sh ./install-item 755 pngtogd $(INSTALL_BIN)/pngtogd
 	sh ./install-item 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
 	sh ./install-item 755 gdtopng $(INSTALL_BIN)/gdtopng
 	sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
 	sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
 
-gddemo: gddemo.o libgd.a
+gddemo: gddemo.o
 	$(CC) gddemo.o -o gddemo	$(LIBDIRS) $(LIBS)
 
-pngtogd: pngtogd.o libgd.a
+testac: testac.o
+	$(CC) testac.o -o testac	$(LIBDIRS) $(LIBS)
+
+pngtogd: pngtogd.o
 	$(CC) pngtogd.o -o pngtogd	$(LIBDIRS) $(LIBS) 
 
-webpng: webpng.o libgd.a
+webpng: webpng.o
 	$(CC) webpng.o -o webpng	$(LIBDIRS) $(LIBS)
 
-pngtogd2: pngtogd2.o libgd.a
+pngtogd2: pngtogd2.o
 	$(CC) pngtogd2.o -o pngtogd2	$(LIBDIRS) $(LIBS)
 
-gdtopng: gdtopng.o libgd.a
+gdtopng: gdtopng.o
 	$(CC) gdtopng.o -o gdtopng	$(LIBDIRS) $(LIBS)
 
-gd2topng: gd2topng.o libgd.a
+gd2topng: gd2topng.o
 	$(CC) gd2topng.o -o gd2topng	$(LIBDIRS) $(LIBS)
 
-gd2copypal: gd2copypal.o libgd.a
+gd2copypal: gd2copypal.o
 	$(CC) gd2copypal.o -o gd2copypal	$(LIBDIRS) $(LIBS)
 
-gdparttopng: gdparttopng.o libgd.a
+gdparttopng: gdparttopng.o
 	$(CC) gdparttopng.o -o gdparttopng	$(LIBDIRS) $(LIBS)
 
-gdtest: gdtest.o libgd.a
+gdtest: gdtest.o
 	$(CC) gdtest.o -o gdtest	$(LIBDIRS) $(LIBS)
 
-gd2time: gd2time.o libgd.a
+gd2time: gd2time.o
 	$(CC) gd2time.o -o gd2time	$(LIBDIRS) $(LIBS)
 
-gdtestft: gdtestft.o libgd.a
+gdtestft: gdtestft.o
 	$(CC) --verbose gdtestft.o -o gdtestft $(LIBDIRS) $(LIBS)
-gdtestttf: gdtestttf.o libgd.a
+gdtestttf: gdtestttf.o
 	$(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 \
-	gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o \
-	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 \
-	gdfontg.h gdhelpers.h
-	rm -f libgd.a
-	$(AR) rc libgd.a gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \
+LIBOBJS=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 gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \
-		gd_wbmp.o gdhelpers.o
+		gdtables.o gdft.o gdcache.o gdkanji.o wbmp.o \
+		gd_wbmp.o gdhelpers.o gd_topal.o gd_arc_f.o
+
+#Shared library. This should work fine on any ELF platform (Linux, etc.) with
+#GNU ld or something similarly intelligent. To avoid the chicken-and-egg
+#problem, this target also installs the library so that applications can
+#actually find it.
+
+libgd.so.${VERSION}: ${LIBOBJS}
+	-rm -f libgd.so.${VERSION} 2>/dev/null
+	ld -shared -o libgd.so.${VERSION} ${LIBOBJS}
+	sh ./install-item 644 libgd.so.${VERSION} \
+		$(INSTALL_LIB)/libgd.so.${VERSION}
+	-rm $(INSTALL_LIB)/libgd.so.${MAJOR_VERSION} 2>/dev/null
+	ln -s $(INSTALL_LIB)/libgd.so.${VERSION} \
+		$(INSTALL_LIB)/libgd.so.${MAJOR_VERSION}	
+	-rm $(INSTALL_LIB)/libgd.so 2>/dev/null
+	ln -s $(INSTALL_LIB)/libgd.so.${VERSION} \
+		$(INSTALL_LIB)/libgd.so	
+
+#Static library, if you really need one for some reason.
+libgd.a: ${LIBOBJS}
+	rm -f libgd.a
+	$(AR) rc ${LIBOBJS}
 	-ranlib libgd.a
 
 clean:
-	rm -f *.o *.a ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp
+	rm -f *.o *.a *.so ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp
 
 #NMAKE makefile for Windows 95/98/NT developers.
 #Produces a static library (libgd.lib). Thanks to Joe Gregorio.
-#This is out of date.
+#THIS IS OUT OF DATE.
 
 COMPILER=cl
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.