www.pudn.com > giflib12.zip > COMPILE.ME


The gif_lib library and utilities has been successfully compiled on the 
following platforms (you will need ansi c compiler for that): 
 
1. IBM-PC, using Turbo C version 2.0/Borland C++ 2.0. 
2. Sun 3, with O.S. 3.5 and O.S. 4.0.3, using gcc (gnu c compiler). 
3. Sun 4, with O.S. 4.1.1, using gcc (gnu c compiler). 
4. HP workstations, running unix BSD4.3, using gcc (gnu c compiler). 
5. SGI personal iris (iris4d) running IRIX 4.3, using its cc. 
6. IBM R6000 running aix, using xlc (Ansi C compiler). 
 
The first one (IBM-PC) was the main target of this package. The unix version 
compiles all the device independent utilities and more (such as gif to rle 
conversions, gif2x11 etc.). The IBM-PC compilation and testing is different 
from the unix ones, and are described in seperated section below. 
 
Compile and test - IBM PC 
------------------------- 
 
O.k. if you have TC/BC you are in good shape (otherwise you are on your own) 
and compilation will be simple: 
 
1. Goto to the makefiles in .\lib and .\util (called makefile.tc in both 
   places) and change the variable CC_LIBS to the exact place you have your 
   cc libraries. I use to put them in ram disk (disk f:) for fast access. 
   Make sure this is short variable or otherwise dos will complain about 
   lines too long (the stupid 128 chars per line), in linkage... 
2. Few of the utilities on .\util needs the TC graphic libraries (the gif2xxxx 
   utilities). You need to create a library named graphbgi.lib that holds all 
   the BGI drivers and CHR fonts. You do so by a sequence similar to: 
 
   a. bgiobj herc       (bgiobj.exe is on one of your TC 2.0 diskettes). 
   b. bgiobj egavga 
   c. bgiobj cga 
   d. bgiobj ibm8514 
   e. bgiobj pc3270 
   f. bgiobj goth 
   g. bgiobj litt 
   h. bgiobj sans 
   i. bgiobj trip 
 
     This will convert all this drivers/fonts into .OBJ files, which can be all 
   linked to creat the library: 
 
   tlib graphbgi.lib +herc.obj +egavga.obj ... +trip.obj, graphbgi.lst 
 
     Copy this library to the same directory as specified by CC_LIBS in 1. 
 
3. Decide what directory you want the executables to br copied to and create 
   it if it is new. Goto .\util and set the DEST variable in the makefile  
   (makefile.tc) to that directory. 
4. Fire the compilation by executing make-ibm.bat 
 
 
To test most of the utilities reconfigure test-ibm.bat as follows: 
1. make sure the new exectuables directory is in your path variable. 
2. The default display program is gif2bgi (in this package). If may want 
   to change its setup. See ./doc/gif2bgi.doc for more. 
3. Set the GIF_DIR variable in the batch file to the absolute path of 
   ./pic directory (hold some gif examples). 
 
Run test-ibm.bat. You will want to print gif2bgi.doc in ./doc so you will 
know how to use it (at list how to exit...). 
 
 
Compile and test - UNIX 
----------------------- 
 
Compiling are testing under unix is simpler than the IBMPC: 
 
1. If you are to use the unix unzip utility to unpack this library, you 
   need to use the -d flag to enforce creation of subdirectories. The 
   following subdirectories are to be created: bin doc lib pic util. 
   But I guess you are after this if you are reading this file now... 
2. You need to convert all files (almost - gif2X11.* has X capitalized), from 
   MSDOS convension to unix one. This involves converting to lower case, and 
   stripping off ^Z from end of file and CR from CR/LF end of line. 
   You can do it manually, However the DOS2UNIX script will do %99 of the job. 
   It will convert ALL files found in subdirectories of the current working 
   directory from upper case to lower case, and strip the CR from the CR/LF 
   end of line used by MSDOS and ^Z from end of file. It does not check if 
   the file is binary or a text one, and it will DESTROY the gif images in 
   ./pic/*.gif, as it will strip off any CR or ^Z in them. You better move 
   the ./pic directory to someplace else before invoking DOS2UNIX and move it 
   back afterwords. Also you will probably need to issue 'chmod +x dos2unix' 
   to make it executable. 
   MAKE SURE no other files but from this unpacked library, exists in the 
   current and sub directories, and execute dos2unix. 
3. Go to the ./lib and ./util directories (they should be lower case, after 
   dos2unix has been executed), and edit the unix makefiles (makefile.unx) 
   for the following: 
   a. Set CC to your c compiler name (usually cc but can be gcc - see in the 
      makefile.unx). 
   b. Select the right flags to the c compilers. Flags for SGI cc, and gcc are 
      provided. 
4. Fire the compilation using make-unx. This will leave the executables in 
   ./bin. 
 
Test the package by adding ./bin to your path and firing the 'test-unx' script. 
This assumes the display is X11, and the environment variable DISPLAY is set 
properly - uses gif2X11 as display utility. 
 
 
 
 
Gershon Elber 
gershon@cs.utah.edu