File: 0PORTING

package info (click to toggle)
gnuplot 3.5beta6.347-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 5,032 kB
  • ctags: 4,235
  • sloc: ansic: 42,086; makefile: 561; asm: 539; sh: 386; objc: 379; csh: 297; pascal: 194; perl: 138; lisp: 88
file content (254 lines) | stat: -rw-r--r-- 10,976 bytes parent folder | download
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254

 The following information is mainly geared towards people who want
to port gnuplot to new platforms. Please do also read the file CodeStyle.

Preprocessor Defines
********************

 These #defines should be checked before compilation. There are many
makefiles provided as templates. You probably need these only if porting
to a new machine. The HAVE_XXX and NO_XXX defines should be taken care
of by configure if your platform supports GNU autoconf generated
configure shell scripts.

THIS LIST IS SOMEWHAT OUT OF DATE NOW - CHECK configure.in, acconfig.h
and config.hin

define      file            note
------      ----            --------
HAVE_BCOPY  Makefile        define if you have bcopy() and no memcpy()
HAVE_LGAMMA Makefile        define if you've got lgamma(3)
HAVE_GAMMA  Makefile        define if you've got gamma(3)
NO_MEMCPY   Makefile        define if your memcpy() is called bcopy()
NO_MEMSET   Makefile        define if you have bzero() but not memset()
PC          Makefile        define if compiling on a PClone
MSDOS       Makefile        define if compiling under MSDOS;
                              automatically defined by Microsoft C 5.10
DOS32       Makefile        define for a 32-bit DOS extender (djgpp/emx)
WIN32       Makefile        define for a 32-bit MS-Windows version
HELPFILE    Makefile        name including path of gnuplot.gih file.
VERYLARGE   plot.h          define to be largest coordinate number.
SHELL       plot.h          default shell to spawn if SHELL environment
                              variable not found at run-time
NOCWDRC     Makefile        define to inhibit check of ./.gnuplot
READLINE    Makefile        define if you want command-line editing
GNU_READLINE Makefile       define if you are linking with gnu readline

Header File Availability
========================

 Generally, it is assumed that standard ANSI/ISO header files are available.
The code is protected against missing standard header files with
NO_XXX_H defines:

NO_STRING_H     string.h absent
NO_STDLIB_H     stdlib.h absent
NO_ERRNO_H      errno.h  absent
NO_LIMITS_H     limits.h absent
NO_LOCALE_H     locale.h absent
NO_TIME_H       time.h   absent
NO_SYS_TYPES_H  sys/types.h absent (not ANSI/ISO, but pretty standard)

 If non-standard header files are required, HAVE_XXX_H defines are used:

HAVE_UNISTD_H
HAVE_LIBC_H    (unistd.h alternative on NEXT)
HAVE_SGTTY_H             needed if there is no termios.h
HAVE_SYS_BSDTYPES_H
HAVE_SYS_SELECT_H        (needed for FD_* macros)
HAVE_SYS_SYSTEMINFO_H
HAVE_TERMIOS_H
HAVE_VALUES_H            needed if there is no limits.h

Function Availability
=====================

 It is generally assumed that standard ANSI/ISO functions are available.
The code is protected against missing standard funktions with NO_XXX defines:

NO_ATEXIT   - atexit() not available
NO_MEMCPY   - memcpy() not available
NO_MEMSET   - memset() not available
NO_SETVBUF  - setvbuf() not available
NO_STRCHR   - strchr() not available
NO_STRERROR - strerror() not available
NO_STRSTR   - strstr() not available
NO_TEMPNAM  - tempnam() not available

 If certain standard ANSI/ISO C functions are not available, two alternatives
come to mind: either try to achieve the same functionality without the
missing function, or provide a portable implementation. Examples for this
are in stdfn.c. See also stdfn.h. 

 The following defines are used to ensure availability of certain
non-standard functions.

 #define          function       see file        comments
-------------------------------------------------------------------
HAVE_ERF          erf()          specfun.c
HAVE_GAMMA        gamma()        specfun.c
HAVE_GETCWD       getcwd()       stdfn.h
HAVE_GETWD        getwd()        stdfn.h
HAVE_INDEX        index()        stdfn.h         pre-ANSI version of strchr()
HAVE_LGAMMA       lgamma()       specfun.c       prefered over gamma()
HAVE_ON_EXIT      on_exit()      term/x11.trm    atexit() substitute on SunOS
HAVE_RINDEX       rindex()       stdfn.h         pre-ANSI version of strrchr()
HAVE_SLEEP        sleep()        command.c
HAVE_SYSINFO      sysinfo()      gplt_x11.c      SysV version of gethostname()
HAVE_STRNCASECMP  strncasecmp()  stdfn.c
HAVE_STRNICMP     strnicmp()     stdfn.c
HAVE_TCGETATTR    tcgetattr()    readline.c


Terminal Selection Options
==========================

   These defines are used to include the drivers for various plotting 
terminals, printers, and protocols that a given version of gnuplot can 
access and the description of such for the help file.  {T


define      file            note
------      ----            --------
TERMFLAGS   Makefile        the set of terminals you want, from below
            or term.h
NO_ALL_TERM_H  term.h          edit term.h to specify desired devices at
                               the beginning (instead of to comment out, 
                               throughout the file, devices not desired.) 
                                       
ALL_TERM_DOC   docs/termdoc.c  on-line help documentation for all devices
                               rather than only for the drivers selected
                               in term.h.


   The following, non-authoritative, list serves as a guide to the range 
of devices that may be selected/deselected by editing term.h.

   AED         AED 512 and AED 767
   AIFM        Adobe Illustrator Format
   AMIGASCREEN Amiga custom screen
   APOLLO      Apollo Graphics Primitive Resource (resizable window)
   ATARI       AES, VDI, MultoTOS
   ATT6300     PC with AT&T 6300 graphics
   BITGRAPH    BBN BitGraph
   CGI         SCO CGI, hcgi
   COREL       COREL! Draw Format
   CORONA      PC with Corona graphics 325
   DEBUG       Voluminous output for debugging to terminal
   DJSVGA      MSDOS SVGA with DJGPP compiler
   DXY800A     Roland DXY800A plotter
   DUMB        Printer or glass dumb terminal
   DXF         AutoCad (Release 10.x) dxf file format
   EEPIC       EEPIC-extended LaTeX driver, for EEPIC users
   EGALIB      PC with EGA/VGA graphics.
   EMTEX       LaTeX picture environment with emTeX specials
   EMXVGA      PC with VGA running DOS or OS/2
   EPS180      Epson-LQ style 24-pin 180-dot per inch printers
   EPS60       Epson-style 60-dot per inch printers
   EPSONP      Epson LX-800, Star NL-10, NX-1000 and lots of others
   EXCL        Talaris EXCL laser printer format
   FIG         Fig graphics language (requires object.h from TransFig)
   GIF         Gif output, requires special library
   GPIC        Gpic for groff
   GPR         Apollo Graphics Primitive Resource (fixed-size window)
   HERCULES    IBM PC/Clone with Hercules graphics board
   HP2648      HP2648, HP2647
   HP26        HP2623A and maybe others
   HP500C      HP Deskjet 500 C and maybe other Color Deskjets
   HP75        HP7580, and probably other HPs
   HPGL        HP7475 and (hopefully) lots of others
   HPLJII      HP Laserjet II
   HPPJ        HP PaintJet
   IMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
   IRIS4D      IRIS4D series computer
   KERMIT      MS-DOS Kermit Tektronix 4010 emulator
   LATEX       LaTeX picture environment
   LINUXVGA    Linux PC with (s)vgalib
   MF          Metafont Format
   MGR         MGR window manager
   MIF         FrameMaker MIF 3.00 Format
   MTOS        Atari MiNT/MULTITOS/Magic Terminal
   NEC         NEC CP6 pinwriter printer
   NEXT        NeXTStep Window System (only grey scale)
   OS2PM       OS/2 Presentation Manager
   PBM         PBMPLUS pbm, pgm, ppm formats
   PCL         HP PCL5 (actually  HPGL/2)
   PNG         Portable Network Graphics, requires separate library
   POSTSCRIPT  PostScript
   PRESCRIBE   Kyocera Laser printer
   PSLATEX     Postscript graphics, LaTeX labels and titles
   PSTRICKS    PSTRICKS 0.91 format
   QMS         QMS/QUIC laserprinter (Talaris 1200 and others)
   REGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
   RGIP        Redwood Graphics Interface Protocol
   SELANAR     Selanar
   STARC       Star Color Printer
   SUN         Sun Microsystems Workstation
   T410X       Tektronix 4106, 4107, 4109 and 420x terminals
   TABLE       Text output
   TANDY60     Tandy DMP-130 series 60-dot per inch graphics
   TEK         Tektronix 4010, and probably others
   TEXDRAW     TeXDraw format (for LaTeX)
   TGIF        TGIF X11 Drawing Tool
   TPIC        Tpic specials for TeX
   UNIXPC      unixpc (ATT 3b1 or ATT 7300)
   UNIXPLOT    unixplot
   V384        Vectrix 384 and tandy color printer
   VTTEK       VT like Tektronix 4010 emulator
   VWS         VAX Windowing System  (UIS libraries)
   X11         X11R4 window system


Platform Related Defines
========================

 These #defines are defined automatically by various compilers or
makefile, some gnuplot routines check these defines to implement
features found in the various environments. This list is certainly
incomplete.

define        note
------        --------
ANSI_C        if the compiler can handle ANSI prototypes
AMIGA_AC_5    defined for Manx Aztec C 5.2a on the Amiga.
AMIGA_SC_6_1  defined for SAS/C 6.1 or later versions on the Amiga.
__amigaos__   defined by gcc on AmigaOS.
AMIGA         defined for all Amiga compilers.
apollo        defined by Apollo's C compilers.
_CRAY         defined by CRAY's C compiler.
__DECC        defined by DEC C compiler under VMS (?)
__TURBOC__    defined automatically by  Borland C++ 3.x.
unix          defined by most unix C compilers.
vms           (and VMS) defined by VMS C compilers.
__ZTC__       Zortech C compiler under MSDOS.
_Windows      defined by Borland C++ 3.0 compiling for MS-Windows.
__EMX__       defined by EMX gcc (available on DOS & OS/2).
OS2           defined by compilers under OS/2.

Defines Used in Gnuplot
=======================

 The following defines are used to achieve better portability. Most of
them are wrappers.

 #define          wraps/redefines            see file    comments
------------------------------------------------------------------
GP_GETCWD         getwd()/getcwd() alikes    stdfn.h
GP_FARMALLOC      faralloc()/malloc()        alloc.c     Windows environment
GP_FARREALLOC     farrealloc()/realloc()     alloc.c     Windows environment
GP_SLEEP          sleep()                    command.c
GP_SYSTEMINFO     sysinfo()/gethostname()    gplt_X11.c
GPFAR             `far' compiler directive   plot.h      MSDOS and Win16
GPHUGE            `huge' compiler directive  plot.h      MSDOS and Win16
GP_INLINE         `__inline' directive       plot.h
GPMAX             max (a,b)                  plot.h
GPMIN             min (a,b)                  plot.h

 The following symbols are defined when using DEBUG:

DEBUG_WHERE       prints filename and line number to stderr *without* linefeed
FPRINTF(a)        uses DEBUG_WHERE, passes a to fprintf

 Usage example: FPRINTF((stderr, "function foo returned %d\n", bar));
 Result:        readline.c:620 function foo returned -1