Source

gd-libgd / src / configure

Diff from to

File src/configure

 #Frequently Changed Settings
 
 #Correct include directories for freetype, zlib, libpng, XPM, JPEG, etc. 
-#If your include directories are different, add them here.
+#If your include directories are different, add them here. *Extra*
+#directories that don't happen to exist on your system shouldn't
+#cause an error (if they do, let me know).
 
-$includeDirs = "-I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include"; 
+$includeDirs = "-I/usr/include/freetype2 -I/usr/local/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.
+#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. 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";
+$libDirs = "-L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/local/lib";
 
 #If you don't have gcc, get it. If you really must, you can change this; 
 #but if you do, you must specify not only your compiler but options 
 } elsif ($os =~ /^(sunos)/i) {
 	$sharedLinkHead = "/usr/ccs/bin/ld -G";
 	$sharedLinkTail = "-ldl";
+	$socketLibForXpm = 1;
 	print "Found OS with sunos-like shared library link command\n";
 } elsif ($os =~ /^(darwin)/i) {
 	$sharedLinkHead = "ld -dynamic -flat_namespace -undefined suppress";
 	print "Warning: freetype 2.x library not found, freetype will not be supported.\n";
 }
 
-if (&testLibrary("xpm", "XpmReadFileToXpmImage(0, 0, 0)")) {
-	push @options, "xpm";
-	print "xpm library found.\n";
+#2.0.4 thanks to Len Makin: need optional libraries and uppercase X,
+#also -lsocket under Solaris
+
+if ($socketLibNeededForXpm) {
+	$xpmLibs = "-lX11 -lsocket";
 } else {
-	print "xpm library not found. That's OK. Almost no one needs xpm in gd.\n";
+	$xpmLibs = "-lX11";
+}
+
+if (&testLibrary("Xpm", "XpmReadFileToXpmImage(0, 0, 0)", $xpmLibs)) {
+	push @options, "Xpm";
+	push @options, "X11";
+	if ($socketLibNeededForXpm) {
+		push @options, "socket";
+	}
+	print "Xpm library found.\n";
+} else {
+	print "Xpm library not found. That's OK. Almost no one needs Xpm in gd.\n";
 }
 
 for $o (@options) {
 # Update these with each release!
 
 MAJOR_VERSION=2
-VERSION=2.0.3
+VERSION=2.0.4
 
 COMPILER=$compiler
 
 
 PROGRAMS=$safePrograms \$(TEST_PROGRAMS)
 
-TEST_PROGRAMS=gdtest gddemo gd2time gdtestft testac
+TEST_PROGRAMS=gdtest gddemo gd2time gdtestft testac fontwheeltest fontsizetest
 
 default: instructions
 
 gdtestft: gdtestft.o
 	\$(CC) --verbose gdtestft.o -o gdtestft \$(LIBDIRS) \$(LIBS)
 
+fontwheeltest: fontwheeltest.o
+	\$(CC) --verbose fontwheeltest.o -o fontwheeltest \$(LIBDIRS) \$(LIBS)
+
+fontsizetest: fontsizetest.o
+	\$(CC) --verbose fontsizetest.o -o fontsizetest \$(LIBDIRS) \$(LIBS)
+
 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 \\
 	-ranlib libgd.a
 
 clean:
-	rm -f *.o *.a *.so *.so.* \${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp test/fttest.png test/fttest.jpg *test.errors
+	rm -f *.o *.a *.so *.so.* \${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp test/fttest.png test/fttest.jpg *test.errors font*test?.png
 veryclean: clean
 	rm Makefile
 EOM