slxfig-pre0.2.0-35/0002755000175000000620000000000011210170555012556 5ustar johnstaffslxfig-pre0.2.0-35/doc/0002755000175000000620000000000011076540262013331 5ustar johnstaffslxfig-pre0.2.0-35/doc/tm/0002755000175000000620000000000011076540262013751 5ustar johnstaffslxfig-pre0.2.0-35/doc/tm/fixtex.sl0000644000175000000620000000450511076540262015622 0ustar johnstaff#!/usr/bin/env jed-script private variable Version = "0.3.2-0"; if (__argc != 2) { message ("Version $Version Usage: ./fixtex.sl "$); quit_jed (); } variable file = __argv[1]; () = read_file (file); % Patch up the >,< signs bob (); replace ("$<$", "<"); replace ("$>$", ">"); % It appears that sgml2tex screws up _for in section titles, producing \_{for}. replace ("ion\\_{", "ion{\\_"); % Make the first chapter a preface bob (); if (bol_fsearch ("\\chapter{Preface}")) { push_spot (); push_mark (); go_right (8); insert ("*"); % \chapter{ --> \chapter*{ () = bol_fsearch ("\\chapter{"); push_spot (); insert("\\tableofcontents\n"); eol (); insert ("\n\\pagenumbering{arabic}"); pop_spot (); narrow (); bob (); replace ("\\section{", "\\section*{"); widen (); if (bol_bsearch ("\\tableofcontents")) delete_line (); pop_spot (); if (bol_bsearch ("\\maketitle")) insert ("\\pagenumbering{roman}\n"); } static define fixup_urldefs () { % pdflatex cannot grok urldef bob (); while (bol_fsearch("\\urldef{") and ffind ("\\url{")) { variable line = line_as_string (); bol (); insert ("\\ifpdf\n"); deln (7); insert ("\\newcommand"); push_mark (); ()=ffind ("}"); variable macro = bufsubstr (); () = ffind ("\\url"); go_left (1); trim (); insert("{"); % pdflatex cannot grok # in urls. Nuke em. if (ffind ("#")) { del_eol (); insert ("}"); } eol (); insert ("}\n\\else\n"); insert (line); newline (); insert ("\\fi\n"); } } static define remove_repeated_urls () { variable name, url; variable names = Assoc_Type[Int_Type, 0]; while (bol_fsearch ("{\\em ")) { go_right (4); skip_white (); push_mark (); () = ffind ("}"); !if (looking_at ("} {\\tt ")) { pop_mark(0); continue; } name = bufsubstr (); if (names[name]) { go_right(1); push_mark (); () = ffind ("}"); go_right(1); del_region (); } else { names[name] = 1; go_right(1); () = ffind ("}"); go_right (1); } % Now remove empty lines inserted by the broken sgml2latex program. skip_white (); !if (eolp ()) continue; go_right(1); skip_white (); if (eolp ()) del (); } } fixup_urldefs (); remove_repeated_urls (); save_buffer (); quit_jed (); slxfig-pre0.2.0-35/doc/tm/slxfig.tm0000644000175000000620000000254611076540262015614 0ustar johnstaff#% -*- mode: tm; mode: fold -*- #%{{{Macros #i linuxdoc.tm #d it#1 $1 #d slang \bf{S-lang} #d exmp#1 \tt{$1} #d var#1 \tt{$1} #d ivar#1 \tt{$1} #d ifun#1 \tt{$1} #d cvar#1 \tt{$1} #d cfun#1 \tt{$1} #d svar#1 \tt{$1} #d sfun#1 \tt{$1} #d icon#1 \tt{$1} #d chapter#1 $1

#d preface #d tag#1 $1 #d function#1 \sect1{$1\label{$1}} #d variable#1 \sect1{$1\label{$1}} #d function_sect#1 \sect{$1} #d begin_constant_sect#1 \sect{$1} #d constant#1 $1 #d end_constant_sect #d synopsis#1 Synopsis $1 #d keywords#1 Keywords $1 #d usage#1 Usage $1 #d description Description #d example Example #d notes Notes #d seealso#1 See Also \linuxdoc_list_to_ref{$1} #d done

#d -1 -1 #d 0 0 #d 1 1 #d 2 2 #d 3 3 #d 4 4 #d 5 5 #d 6 6 #d 7 7 #d 8 8 #d 9 9 #d NULL NULL #d file#1 $1 #d documentstyle book #%}}} #d module#1 \tt{$1} \linuxdoc \begin{\documentstyle} \title SLxfig Reference \author John E. Davis, \tt{jed@jedsoft.org} \date \__today__ \toc \chapter{Introduction} \sect{Function Reference} #i slxfigfuns.tm \end{\documentstyle} slxfig-pre0.2.0-35/doc/tm/Makefile0000644000175000000620000000545411076540262015417 0ustar johnstaff# -*- sh -*- # # To create the SGML files, you will need to install the tm-utils # package. See http://www.jedsoft.org/ for more information. # TMEXPAND = /aluche/d1/web/tm-dist/bin/tmexpand SL2TM = sl2tm MACRODIR = /aluche/d1/web/tm-dist/macros MODULE = slxfig HLPFUNS_TM = AUTOGEN_TM = slxfigfuns.tm MODULE_DEPS = $(AUTOGEN_TM) TXT_FILES = $(MODULE).txt SGML_FILES = $(MODULE).sgml HTML_FILES = $(MODULE).html TEX_FILES = $(MODULE).tex PS_FILES = $(MODULE).ps PDF_FILES = $(MODULE).pdf HLP_FILE = $(MODULE).hlp SGML2LATEX = sgml2latex -p letter -o tex SGML2HTML = sgml2html SGML2TXT = sgml2txt -f LATEX = latex PDFLATEX = pdflatex TEXTDIR = ../text PSDIR = ../ps HTMLDIR = ../html SGMLDIR = ../sgml PDFDIR = ../pdf HELPDIR = ../help SUBDIRS = $(TEXTDIR) $(HTMLDIR) $(PSDIR) $(SGMLDIR) $(PDFDIR) $(HELPDIR) SRCDIR = `pwd` text-files: $(TXT_FILES) $(HLP_FILE) all: $(SGML_FILES) $(HTML_FILES) $(TEX_FILES) $(TXT_FILES) slxfigfuns.tm: ../../src/xfig/*.sl $(SL2TM) ../../src/xfig/*.sl > slxfigfuns.tm #----- SGML Files ----------------------------------------------------------- $(MODULE).sgml : $(MODULE).tm $(MODULE_DEPS) $(TMEXPAND) -I$(MACRODIR) $(MODULE).tm $(MODULE).sgml #----- HTML Files ----------------------------------------------------------- $(MODULE).html : $(MODULE).sgml $(SGML2HTML) $(MODULE).sgml #----- TeX Files ------------------------------------------------------------ $(MODULE).tex : $(MODULE).sgml $(SGML2LATEX) $(MODULE).sgml jed -script ./fixtex.sl $(MODULE).tex #----- PDF Files ----------------------------------------------------------- $(MODULE).pdf : $(MODULE).tex $(MAKE) texclean $(PDFLATEX) $(MODULE).tex $(PDFLATEX) $(MODULE).tex $(PDFLATEX) $(MODULE).tex #----- PS Files ----------------------------------------------------------- $(MODULE).ps : $(MODULE).tex texclean $(LATEX) $(MODULE).tex $(LATEX) $(MODULE).tex $(LATEX) $(MODULE).tex dvips -o $(MODULE).ps $(MODULE).dvi #----- Text Files ----------------------------------------------------------- $(MODULE).txt: $(MODULE).sgml $(SGML2TXT) $(MODULE).sgml #---------------------------------------------------------------------------- help-files: $(HLP_FILE) $(HLP_FILE): slxfigfuns.tm $(TMEXPAND) -I$(MACRODIR) -Mslhlp slxfigfuns.tm $(HLP_FILE) texclean: -rm -f *.dvi *.log *.aux *.toc *.out clean: texclean -rm -f *~ rtl/*.BAK rtl/*~ *.tmp *-error distclean: clean -rm -f *.html *.ps $(HLP_FILE) $(TXT_FILES) $(TEX_FILES) $(SGML_FILES) $(PDF_FILES) $(AUTOGEN_TM) install-txt: $(TXT_FILES) -mv $(TXT_FILES) ../text install-help: $(HLP_FILE) -mkdir -p $(HELPDIR) -mv $(HLP_FILE) $(HELPDIR) install-all: all install-help install-txt $(PS_FILES) $(PDF_FILES) -mkdir -p $(HTMLDIR) $(PSDIR) $(SGMLDIR) $(PDFDIR) -mv *.html $(HTMLDIR) -mv $(PS_FILES) ../ps -mv $(SGML_FILES) ../sgml -mv $(PDF_FILES) ../pdf install: install-txt install-help slxfig-pre0.2.0-35/doc/text/0002755000175000000620000000000011076540262014315 5ustar johnstaffslxfig-pre0.2.0-35/doc/text/slxfig.txt0000644000175000000620000002653711076540262016365 0ustar johnstaff SLxfig Reference John E. Davis, jed@jedsoft.org Apr 30, 2007 ____________________________________________________________ Table of Contents Introduction 1. Function Reference 1.1 xfig_clip_polyline2d 1.2 xfig_set_output_driver 1.3 xfig_render_object 1.4 xfig_justify_object 1.5 xfig_new_text 1.6 xfig_new_legend 1.7 xfig_plot_new 1.8 xfig_plot_add_symbol 1.9 xfig_plot_add_object 1.10 xfig_plot_text 1.11 xfig_plot_title 1.12 xfig_plot_png 1.13 xfig_plot_new_png 1.14 xfig_meshgrid 1.15 xfig_scale_pict 1.16 xfig_center_pict_in_box ______________________________________________________________________ 1. Introduction 1.1. Function Reference 1.1.1. xfig_clip_polyline2d Synopsis Clip a list of 2d line segments Usage list = xfig_clip_polyline2d (x[], y[], xmin, xmax, ymin, ymax) Description This function clips a polyline composed individual line segments that run from (x_i,y_i) to (x_{i+1},y_{i+1}) at the boundaries of the window defined by the xmin, xmax, ymin, and ymax parameters. The result is returned as an xfig polyline object. Notes This function should be used if the order of the line segments does not matter. Otherwise, the xfig_clip_polygon2d function should be used. See Also ``xfig_clip_polygon2d'', ``xfig_new_polyline_list'' 1.1.2. xfig_set_output_driver Synopsis Associate an output driver to a file extension Usage xfig_set_output_driver (String_Type ext, String_Type cmd) Description This may may be used to define the command that runs to created the specified output format (dictated by the extension) from the corresponding .fig file. The ext parameter specifies the filename extension and cmd is the shell command that will be used to generate the file. The cmd may contain the following format descriptors that will be replace by the corresponding objects before being passed to the shell: %I Input .fig file %O Output file %P paper-size %B basename of the file Example The default driver for postscript output is given by: xfig_set_output_driver ("ps", "fig2dev -L ps -c -z %P %I %O"); The ps2ps command may result in a smaller file size at a slight cost of resolution. It may be used as follows: xfig_set_output_driver ("ps", "fig2dev -L ps -c -z %P %I %B-tmp.ps" + ";ps2ps %B-tmp.ps %O; rm -f %B-tmp.ps"); See Also ``xfig_set_paper_size'' 1.1.3. xfig_render_object Synopsis Render an object to a device Usage xfig_render_object (obj, device) Description This function renders the specified object to a specified device. If the device parameter is a string, then a device will be opened with the specified name. See Also ``xfig_create_file'', ``xfig_close_file'' 1.1.4. xfig_justify_object Synopsis Justify an object at a specified position Usage xfig_justify_object (obj, X, dX) Description This function moves the object to the specified position X (a vector) and justifies it at that position according to the offsets specified by the vector dX. The components of dX are normally in the range -0.5 to 0.5 and represent offsets relative to the size of the object. If the components of dX are 0, then the object will be centered at X. See Also ``xfig_translate_object'' 1.1.5. xfig_new_text Synopsis Create a text object by running LaTeX Usage obj = xfig_new_text (String_Type text [,font_object]) Description This function runs LaTeX on the specified text string and returns the resulting object. The text string must be formatted according to the LaTeX rules. The optional parameter is a structure that may be used to specify the font, color, pointsize, etc to use when calling LaTeX. This structure may be instantiated using the xfig_font_new. See Also ``xfig_font_new'' 1.1.6. xfig_new_legend Synopsis Create a plot legend object Usage legend = xfig_new_legend (labels[], colors[], linestyles[], thicknesses[], width Description The xfig_new_legend function creates a legend object suitable for adding to a plot. The legend will consist of ... 1.1.7. xfig_plot_new Synopsis Create a new plot object Usage w = xfig_plot_new ( [Int_Type width, Int_Type height] ); Description This function creates a new plot object of the specified width and height. If the width and height parameters are not given, defaults will be used. The width and height values specify the size of the plotting area and do not include the space for tic marks and labels. Example w = xfig_plot_new (); See Also ``xfig_plot_define_world'', ``xfig_render_object'' 1.1.8. xfig_plot_add_symbol Synopsis Add a plot symbol Usage xfig_plot_add_symbol (String_Type name, Ref_Type funct) Description This function may be used to add a new plot symbol of the specified name. The funct parameter specifies a function to be called to create the symbol. It will be called with a single parameter: a value representing the scale size of the symbol in fig units. The function must return two arrays representing the X and Y coordinates of the polygons that represent the symbol. The center of the object is taken to be (0,0). If more than one polygon is require to represent the object, an array of arrays may be returned. 1.1.9. xfig_plot_add_object Synopsis Add an object to a plot at a world coordinate position Usage xfig_plot_add_object (plot_win, obj [,x,y [,dx,dy]]) Description This function may be used to add an object to a plot window at a specified world coordinate. The dx and dy arguments control the justification of the object. The values of these parameters are offsets relative to the size of the object, and as such ordinarily have values in the interval [-0.5,0.5]. For example, 0,0 will center the object on (x,y), and (-0.5,-0.5) will move the lower left corner of the object to the specified coordinate. See Also ``xfig_plot_define_world1'' 1.1.10. xfig_plot_text Synopsis Add text to the plot Usage xfig_plot_text (w, text, x, y [,dx, dy]) w: plot object x, y: world coordinates dx, dy: justification Description This function creates a text object at the specified location on the plot. By default, the text will be centered on the specified world coordinates. The justification parameters dx and dy may be used to specify the justifcation of the text. See the documentation for xfig_plot_add_object for more information. Example xfig_plot_text (w, "$cos(\omega t)$"R, 3.2, 6.0, -0.5, 0); will left justify the text at the position (3.2,6.0). See Also ``xfig_plot_add_object'', ``xfig_new_text'' 1.1.11. xfig_plot_title Synopsis Add a title to a plot Usage xfig_plot_title (w, title) 1.1.12. xfig_plot_png Synopsis Add a png file to a plot, scaling it to the window Usage xfig_plot_png (w, file) 1.1.13. xfig_plot_new_png Synopsis Create a new plot window for a png file Usage w = xfig_plot_new_png (file) 1.1.14. xfig_meshgrid Synopsis Produce grid points for an image Usage (xx,yy) = xfig_meshgrid (xx, yy) Description This function takes two 1-d vectors representing the orthogonal grids for a rectangular region in the (x,y) plane and returns two 2-d arrays corresponding to the (x,y) coordinates of each intersecting grid point. Suppose that one wants to evaluate a function f(x,y) at each point defined by the two grid vectors. Simply calling f(x,y) using the grid vectors would lead to either a type-mismatch error or produce a 1-d result. The correct way to do this is to use the xfig_meshgrid function: result = f(xfig_meshgrid(x,y)); 1.1.15. xfig_scale_pict Synopsis Scale a pict object Usage xfig_scale_pict (pict, sx [,sy]) 1.1.16. xfig_center_pict_in_box Synopsis Center a pict object in a box Usage xfig_center_pict_in_box (pict_object, X, dx, dy Description This function takes a pict object and centers it in a box whose width is dx and whose height is dy. The vector X denotes the position of the lower-left corner of the box. If the pict object is too big to fit in the box, then its lower-left corner will coincide with the lower-left corner of the box. See Also ``xfig_translate_object'' Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Function Reference . . . . . . . . . . . . . . . . . . . . . 2 1.1.1. xfig_clip_polyline2d . . . . . . . . . . . . . . . . . . . 2 1.1.2. xfig_set_output_driver . . . . . . . . . . . . . . . . . . 2 1.1.3. xfig_render_object . . . . . . . . . . . . . . . . . . . . 3 1.1.4. xfig_justify_object . . . . . . . . . . . . . . . . . . . . 3 1.1.5. xfig_new_text . . . . . . . . . . . . . . . . . . . . . . . 3 1.1.6. xfig_new_legend . . . . . . . . . . . . . . . . . . . . . . 4 1.1.7. xfig_plot_new . . . . . . . . . . . . . . . . . . . . . . . 4 1.1.8. xfig_plot_add_symbol . . . . . . . . . . . . . . . . . . . 4 1.1.9. xfig_plot_add_object . . . . . . . . . . . . . . . . . . . 5 1.1.10. xfig_plot_text . . . . . . . . . . . . . . . . . . . . . . 5 1.1.11. xfig_plot_title . . . . . . . . . . . . . . . . . . . . . 6 1.1.12. xfig_plot_png . . . . . . . . . . . . . . . . . . . . . . 6 1.1.13. xfig_plot_new_png . . . . . . . . . . . . . . . . . . . . 6 1.1.14. xfig_meshgrid . . . . . . . . . . . . . . . . . . . . . . 6 1.1.15. xfig_scale_pict . . . . . . . . . . . . . . . . . . . . . 6 1.1.16. xfig_center_pict_in_box . . . . . . . . . . . . . . . . . 7 slxfig-pre0.2.0-35/doc/help/0002755000175000000620000000000011076540262014261 5ustar johnstaffslxfig-pre0.2.0-35/doc/help/slxfig.hlp0000644000175000000620000002050711076540262016264 0ustar johnstaffxfig_clip_polyline2d SYNOPSIS Clip a list of 2d line segments USAGE list = xfig_clip_polyline2d (x[], y[], xmin, xmax, ymin, ymax) DESCRIPTION This function clips a polyline composed individual line segments that run from (x_i,y_i) to (x_{i+1},y_{i+1}) at the boundaries of the window defined by the `xmin', `xmax', `ymin', and `ymax' parameters. The result is returned as an xfig polyline object. NOTES This function should be used if the order of the line segments does not matter. Otherwise, the `xfig_clip_polygon2d' function should be used. SEE ALSO xfig_clip_polygon2d, xfig_new_polyline_list -------------------------------------------------------------- xfig_set_output_driver SYNOPSIS Associate an output driver to a file extension USAGE xfig_set_output_driver (String_Type ext, String_Type cmd) DESCRIPTION This may may be used to define the command that runs to created the specified output format (dictated by the extension) from the corresponding .fig file. The `ext' parameter specifies the filename extension and `cmd' is the shell command that will be used to generate the file. The `cmd' may contain the following format descriptors that will be replace by the corresponding objects before being passed to the shell: %I Input .fig file %O Output file %P paper-size %B basename of the file EXAMPLE The default driver for postscript output is given by: xfig_set_output_driver ("ps", "fig2dev -L ps -c -z %P %I %O"); The `ps2ps' command may result in a smaller file size at a slight cost of resolution. It may be used as follows: xfig_set_output_driver ("ps", "fig2dev -L ps -c -z %P %I %B-tmp.ps" + ";ps2ps %B-tmp.ps %O; rm -f %B-tmp.ps"); SEE ALSO xfig_set_paper_size -------------------------------------------------------------- xfig_render_object SYNOPSIS Render an object to a device USAGE xfig_render_object (obj, device) DESCRIPTION This function renders the specified object to a specified device. If the device parameter is a string, then a device will be opened with the specified name. SEE ALSO xfig_create_file, xfig_close_file -------------------------------------------------------------- xfig_justify_object SYNOPSIS Justify an object at a specified position USAGE xfig_justify_object (obj, X, dX) DESCRIPTION This function moves the object to the specified position X (a vector) and justifies it at that position according to the offsets specified by the vector `dX'. The components of `dX' are normally in the range -0.5 to 0.5 and represent offsets relative to the size of the object. If the components of dX are 0, then the object will be centered at `X'. SEE ALSO xfig_translate_object -------------------------------------------------------------- xfig_new_text SYNOPSIS Create a text object by running LaTeX USAGE obj = xfig_new_text (String_Type text [,font_object]) DESCRIPTION This function runs LaTeX on the specified text string and returns the resulting object. The text string must be formatted according to the LaTeX rules. The optional parameter is a structure that may be used to specify the font, color, pointsize, etc to use when calling LaTeX. This structure may be instantiated using the xfig_font_new. SEE ALSO xfig_font_new -------------------------------------------------------------- xfig_new_legend SYNOPSIS Create a plot legend object USAGE legend = xfig_new_legend (labels[], colors[], linestyles[], thicknesses[], width DESCRIPTION The `xfig_new_legend' function creates a legend object suitable for adding to a plot. The legend will consist of ... -------------------------------------------------------------- xfig_plot_new SYNOPSIS Create a new plot object USAGE w = xfig_plot_new ( [Int_Type width, Int_Type height] ); DESCRIPTION This function creates a new plot object of the specified width and height. If the width and height parameters are not given, defaults will be used. The width and height values specify the size of the plotting area and do not include the space for tic marks and labels. EXAMPLE w = xfig_plot_new (); SEE ALSO xfig_plot_define_world, xfig_render_object -------------------------------------------------------------- xfig_plot_add_symbol SYNOPSIS Add a plot symbol USAGE xfig_plot_add_symbol (String_Type name, Ref_Type funct) DESCRIPTION This function may be used to add a new plot symbol of the specified name. The `funct' parameter specifies a function to be called to create the symbol. It will be called with a single parameter: a value representing the scale size of the symbol in fig units. The function must return two arrays representing the X and Y coordinates of the polygons that represent the symbol. The center of the object is taken to be (0,0). If more than one polygon is require to represent the object, an array of arrays may be returned. -------------------------------------------------------------- xfig_plot_add_object SYNOPSIS Add an object to a plot at a world coordinate position USAGE xfig_plot_add_object (plot_win, obj [,x,y [,dx,dy]]) DESCRIPTION This function may be used to add an object to a plot window at a specified world coordinate. The `dx' and `dy' arguments control the justification of the object. The values of these parameters are offsets relative to the size of the object, and as such ordinarily have values in the interval `[-0.5,0.5]'. For example, `0,0' will center the object on `(x,y)', and `(-0.5,-0.5)' will move the lower left corner of the object to the specified coordinate. SEE ALSO xfig_plot_define_world1 -------------------------------------------------------------- xfig_plot_text SYNOPSIS Add text to the plot USAGE xfig_plot_text (w, text, x, y [,dx, dy]) w: plot object x, y: world coordinates dx, dy: justification DESCRIPTION This function creates a text object at the specified location on the plot. By default, the text will be centered on the specified world coordinates. The justification parameters `dx' and `dy' may be used to specify the justifcation of the text. See the documentation for `xfig_plot_add_object' for more information. EXAMPLE xfig_plot_text (w, "$cos(\omega t)$"R, 3.2, 6.0, -0.5, 0); will left justify the text at the position (3.2,6.0). SEE ALSO xfig_plot_add_object, xfig_new_text -------------------------------------------------------------- xfig_plot_title SYNOPSIS Add a title to a plot USAGE xfig_plot_title (w, title) -------------------------------------------------------------- xfig_plot_png SYNOPSIS Add a png file to a plot, scaling it to the window USAGE xfig_plot_png (w, file) -------------------------------------------------------------- xfig_plot_new_png SYNOPSIS Create a new plot window for a png file USAGE w = xfig_plot_new_png (file) -------------------------------------------------------------- xfig_meshgrid SYNOPSIS Produce grid points for an image USAGE (xx,yy) = xfig_meshgrid (xx, yy) DESCRIPTION This function takes two 1-d vectors representing the orthogonal grids for a rectangular region in the (x,y) plane and returns two 2-d arrays corresponding to the (x,y) coordinates of each intersecting grid point. Suppose that one wants to evaluate a function `f(x,y)' at each point defined by the two grid vectors. Simply calling `f(x,y)' using the grid vectors would lead to either a type-mismatch error or produce a 1-d result. The correct way to do this is to use the `xfig_meshgrid' function: result = f(xfig_meshgrid(x,y)); -------------------------------------------------------------- xfig_scale_pict SYNOPSIS Scale a pict object USAGE xfig_scale_pict (pict, sx [,sy]) -------------------------------------------------------------- xfig_center_pict_in_box SYNOPSIS Center a pict object in a box USAGE xfig_center_pict_in_box (pict_object, X, dx, dy DESCRIPTION This function takes a pict object and centers it in a box whose width is `dx' and whose height is `dy'. The vector `X' denotes the position of the lower-left corner of the box. If the pict object is too big to fit in the box, then its lower-left corner will coincide with the lower-left corner of the box. SEE ALSO xfig_translate_object -------------------------------------------------------------- slxfig-pre0.2.0-35/src/0002755000175000000620000000000011210170554013344 5ustar johnstaffslxfig-pre0.2.0-35/src/xfig/0002755000175000000620000000000011210170554014301 5ustar johnstaffslxfig-pre0.2.0-35/src/xfig/png.sl0000644000175000000620000000323511076540262015435 0ustar johnstaffprivate variable Magic_Bytes = "\d137\d80\d78\d71\d13\d10\d26\d10"; private define read_exactly_n_bytes (fd, n) { variable buf; variable nbytes = read (fd, &buf, n); if (nbytes != n) verror ("Error reading png file"); return buf; } private define open_png (png) { variable fd = open (png, O_RDONLY); if (fd == NULL) verror ("Unable to open png file %S", png); variable magic = read_exactly_n_bytes (fd, strlen (Magic_Bytes)); if (magic != Magic_Bytes) verror ("%s is not a PNG file", png); return fd; } private define read_4byte_uint (fd) { variable buf = read_exactly_n_bytes (fd, 4); return unpack (">K", buf); } private define read_png_chunk (fd) { variable length, type, data, crc; length = read_4byte_uint (fd); type = read_exactly_n_bytes (fd, 4); %type = read_4byte_uint (fd); data = read_exactly_n_bytes (fd, length); crc = read_4byte_uint (fd); return length, type, data, crc; } % The IHDR chunk must appear FIRST. It contains: % Width: 4 bytes % Height: 4 bytes % Bit depth: 1 byte % Color type: 1 byte % Compression method: 1 byte % Filter method: 1 byte % Interlace method: 1 byte define xfig_new_png (file) { variable fd = open_png (file); variable length, type, data, crc; (length, type, data, crc) = read_png_chunk (fd); if (type != "IHDR") verror ("Expecting an IHDR header in %s", file); variable width, height; (width, height) = unpack (">k>k", data); () = close (fd); width *= xfig_get_display_pix_size (); height *= xfig_get_display_pix_size (); return xfig_new_pict (file, width, height); } slxfig-pre0.2.0-35/src/xfig/text.sl0000644000175000000620000001347211076540262015641 0ustar johnstaff% This file is obsolete and has been replaced by the functions in latex.sl private variable Text_Type = struct { object, %int (always 4) sub_type, %int (0: Left justified, 1: Center justified, 2: Right justified) color, %int (enumeration type) depth, %int (enumeration type) pen_style, %int (enumeration , not used) font, %int (enumeration type) font_size, %float (font size in points) angle, %float (radians, the angle of the text) font_flags, %int --- bitmapped, see below height, %float (Fig units) length, %float (Fig units) X, % vector, projected x, y, %int (Fig units, coordinate of the origin % of the string. If sub_type = 0, it is the lower left corner of % the string. If sub_type = 1, it is the lower center. Otherwise % it is the lower right corner of the string.) string, %char (ASCII characters; starts after a blank %character following the last number and ends before the sequence %'\001'. This sequence is not part of the string. Characters %above octal 177 are represented by \xxx where xxx is the octal %value. This permits fig files to be edited with 7-bit editors %and sent by e-mail without data loss. Note that the string may %contain '\n'. }; private variable XFIG_FONT_FLAGS_RIGID = 0x1; % no scaling in compound private variable XFIG_FONT_FLAGS_SPECIAL = 0x2; % for LaTeX private variable XFIG_FONT_FLAGS_PS = 0x4; % Postscript private variable XFIG_FONT_FLAGS_HIDDEN = 0x4; % Hidden % The font field depends upon the value of bit 2. If 0, latex fonts are used: private variable Font_Table = Assoc_Type[Int_Type]; Font_Table["default"] = 0; Font_Table["roman"] = 1; Font_Table["bold"] = 2; Font_Table["italic"] = 3; Font_Table["sansserif"] = 4; Font_Table["typewriter"] = 5; %If bit 2 isset, Postscript fonts are used: Font_Table["psdefault"] = -1; Font_Table["pstimesroman"] = 0; Font_Table["pstimesitalic"] = 1; Font_Table["pstimesbold"] = 2; Font_Table["pstimesbolditalic"] = 3; Font_Table["psavantgardebook"] = 4; Font_Table["psavantgardebookoblique"] = 5; Font_Table["psavantgardedemi"] = 6; Font_Table["psavantgardedemioblique"] = 7; Font_Table["psbookmanlight"] = 8; Font_Table["psbookmanlightitalic"] = 9; Font_Table["psbookmandemi"] = 10; Font_Table["psbookmandemiitalic"] = 11; Font_Table["pscourier"] = 12; Font_Table["pscourieroblique"] = 13; Font_Table["pscourierbold"] = 14; Font_Table["pscourierboldoblique"] = 15; Font_Table["pshelvetica"] = 16; Font_Table["pshelveticaoblique"] = 17; Font_Table["pshelveticabold"] = 18; Font_Table["pshelveticaboldoblique"] = 19; Font_Table["pshelveticanarrow"] = 20; Font_Table["pshelveticanarrowoblique"] = 21; Font_Table["pshelveticanarrowbold"] = 22; Font_Table["pshelveticanarrowboldoblique"] = 23; Font_Table["psnewcenturyschoolbookroman"] = 24; Font_Table["psnewcenturyschoolbookitalic"] = 25; Font_Table["psnewcenturyschoolbookbold"] = 26; Font_Table["psnewcenturyschoolbookbolditalic"] = 27; Font_Table["pspalatinoroman"] = 28; Font_Table["pspalatinoitalic"] = 29; Font_Table["pspalatinobold"] = 30; Font_Table["pspalatinobolditalic"] = 31; Font_Table["pssymbol"] = 32; Font_Table["pszapfchancerymediumitalic"] = 33; Font_Table["pszapfdingbats"] = 34; % usage: (isps, font) = lookup_font (name); define xfig_lookup_font (name) { if (typeof (name) != String_Type) return XFIG_FONT_FLAGS_PS, name; variable str = strlow (strtrans (name, " \t_", "")); if (0 == assoc_key_exists (Font_Table, str)) { str = "ps" + str; if (0 == assoc_key_exists (Font_Table, str)) { () = fprintf (stderr, "*** Warning: font %s is not supported\n", name); return 0,0; } } variable flags = 0; if (0 == strncmp (str, "ps", 2)) flags |= XFIG_FONT_FLAGS_PS; return flags, Font_Table[str]; } define xfig_make_xfig_text (fontname, str) { variable flags, font; variable t = @Text_Type; t.object = 4; t.sub_type = 0; % left-justified t.color = xfig_lookup_color ("default"); t.depth = 50; t.pen_style = 0; (t.font_flags, t.font) = xfig_lookup_font (fontname); t.font_size = 12; t.angle = 0.0; t.height = NULL; t.length = NULL; t.X = vector (0, 0, 0); t.string = str; return t; } private define text_render (f, fp) { variable x, y; variable height = f.height, length = f.length; variable font = xfig_lookup_font (f.font); % There is no way to compute the width and height without knowing % information about the specific font. A crude estimate is used below. if (height == NULL) height = xfig_convert_inches (1.5*f.font_size/80.0); else height = xfig_convert_units (height); if (length == NULL) length = 0.75*xfig_convert_inches (f.font_size/80.0)*strlen (f.string); else length = xfig_convert_units (length); xfig_vwrite (fp, "%d %d %d %d %d %d %g %g %d %g %g ", f.object, f.sub_type, f.color, f.depth, f.pen_style, font, f.font_size, f.angle, f.font_flags, height, length); (x, y) = xfig_project_to_xfig_plane (f.X); xfig_vwrite (fp, "%d %d ", xfig_convert_units (x), xfig_convert_units (y)); xfig_vwrite (fp, "%s\\001\n",f.string); } private define text_translate (f, dX) { f.X = vector_sum (f.X, dX); } private define text_rotate (f, axis, theta) { f.X = vector_rotate (f.X, axis, theta); } private define text_scale (f, sx, sy, sz) { variable X = f.X; X.x *= sx; X.y *= sy; X.z *= sz; } private define text_set_depth (obj, depth) { obj.depth = depth; } define xfig_new_xfig_text (fontname, str) { variable text = xfig_make_xfig_text (fontname, str); variable obj = xfig_new_object (text); obj.render = &text_render; obj.translate = &text_translate; obj.rotate = &text_rotate; obj.scale = &text_scale; obj.set_depth = &text_set_depth; return obj; } slxfig-pre0.2.0-35/src/xfig/clip.sl0000644000175000000620000001673411210170554015601 0ustar johnstaff% clipping routines private define intersect (x0, dx, y0, dy, a, da, b, db) { variable s = Double_Type[length(x0)], t = @s; variable den = dx*db - dy*da; variable i = where (den == 0); s[i] = -1; t[i] = -1; i = where (den != 0); variable alpha = a-x0; variable beta = b-y0; den = den[i]; s[i] = (dy*alpha-dx*beta)[i]/den; t[i] = (db*alpha-da*beta)[i]/den; return s, t; } %!%+ %\function{xfig_clip_polyline2d} %\synopsis{Clip a list of 2d line segments} %\usage{list = xfig_clip_polyline2d (x[], y[], xmin, xmax, ymin, ymax)} %\description % This function clips a polyline composed individual line segments that run from % (x_i,y_i) to (x_{i+1},y_{i+1}) at the boundaries of the window defined by the % \exmp{xmin}, \exmp{xmax}, \exmp{ymin}, and \exmp{ymax} parameters. The result % is returned as an xfig polyline object. %\notes % This function should be used if the order of the line segments does not matter. % Otherwise, the \sfun{xfig_clip_polygon2d} function should be used. %\seealso{xfig_clip_polygon2d, xfig_new_polyline_list} %!%- define xfig_clip_polyline2d (x, y, xmin, xmax, ymin, ymax) { variable is_outside; is_outside = ((x < xmin) or (x > xmax) or (y < ymin) or (y > ymax)); if (length (where(is_outside)) == 0) return xfig_new_polyline (vector(x,y,0*x)); variable list = xfig_new_polyline_list (); % Suppose is_outside looks like: % 00001000110000111 % Separate the line segments into those that lie in the region and those % that are outside. variable len = length (x); if (len < 2) return list; variable bad = where (is_outside); variable i, j, i0; i0 = 0; variable line; foreach (bad) { i = (); if (i - i0 >= 2) { j = [i0:i-1]; list.insert (vector (x[j],y[j],0.0*j)); } i0 = i + 1; } % This segment was not picked up by the above loop if (is_outside[len-1] == 0) { if (i0 != len-1) { j = [i0:len-1]; list.insert (vector(x[j],y[j],0.0*j)); } } % Now deal with the segments that involve outside points i = [0:len-2]; variable x0 = x[i], y0 = y[i]; variable is_outside0 = is_outside[i]; i = [1:len-1]; variable x1 = x[i], y1 = y[i]; variable is_outside1 = is_outside[i]; % Suppose is_outside looks like: % is_outside: 00001000110000111 % Then: % is_outside0: 0000100011000011 % is_outside1: 0001000110000111 % The segments that we want to deal with are: % 0001100111000111 bad = where (is_outside0 or is_outside1); x0 = x0[bad]; x1 = x1[bad]; y0 = y0[bad]; y1 = y1[bad]; is_outside0 = is_outside0[bad]; is_outside1 = is_outside1[bad]; #iffalse % swap 0 <--> 1 such that 0 represents the inside point i = where (0 == is_outside1); (x0[i], x1[i]) = (x1[i], x0[i]); (y0[i], y1[i]) = (y1[i], y0[i]); (is_outside0[i], is_outside1[i]) = (is_outside1[i], is_outside0[i]); #endif variable dx = x1 - x0; variable dy = y1 - y0; variable a = [xmin, xmax, xmax, xmin]; variable b = [ymin, ymin, ymax, ymax]; variable da = [xmax-xmin, 0, xmin-xmax, 0]; variable db = [0, ymax-ymin, 0, ymin-ymax]; variable s = Array_Type[4], t = Array_Type[4], is_intersect = Array_Type[4]; variable ss, tt; _for (0, 3, 1) { i = (); (ss, tt) = intersect (x0, dx, y0, dy, a[i], da[i], b[i], db[i]); is_intersect[i] = ((ss>=0)and (ss<=1)and (tt>=0)and(tt<=1)); s[i] = ss; t[i] = tt; } _for (0, length(x0)-1, 1) { i = (); variable min_t = 2, max_t = -1; if (is_outside0[i] == 0) min_t = 0; if (is_outside1[i] == 0) max_t = 1; if ((is_outside0[i] == 0) and (is_outside1[i] == 0)) vmessage ("NO"); variable num_intersects = 0; _for (0, 3, 1) { j = (); if (is_intersect[j][i] == 0) continue; tt = t[j][i]; if (tt < min_t) min_t = tt; if (tt > max_t) max_t = tt; num_intersects++; } if ((min_t < 0) or (min_t > 1) or (max_t < 0) or (max_t > 1)) continue; variable x0_i = x0[i]; variable y0_i = y0[i]; variable dx_i = dx[i]; variable dy_i = dy[i]; variable x1_i = x0_i + dx_i*max_t; variable y1_i = y0_i + dy_i*max_t; x0_i += dx_i*min_t; y0_i += dy_i*min_t; if (x0_i > xmax) x0_i = xmax; if (x0_i < xmin) x0_i = xmin; if (y0_i > ymax) y0_i = ymax; if (y0_i < ymin) y0_i = ymin; if (x1_i > xmax) x1_i = xmax; if (x1_i < xmin) x1_i = xmin; if (y1_i > ymax) y1_i = ymax; if (y1_i < ymin) y1_i = ymin; if (length (where ((x0_i < xmin-0.001) or (x0_i > xmax+0.001) or (x1_i < xmin-0.001) or (x1_i > xmax+0.001) or (y0_i < ymin-0.001) or (y0_i > ymax+0.001) or (y1_i < ymin-0.001) or (y1_i > ymax+0.001)))) { vmessage ("Uh oh--- line not clipped: min_t = %g, max_t=%g, is_outside0=%d, is_outside1=%d, num_intersects=%d", min_t, max_t, is_outside0[i], is_outside1[i], num_intersects); message ("box from ($xmin,$ymin)->($xmax,$ymax)"$); message ("($x0_i,$y0_i)->($x1_i,$y1_i)"$); vmessage ("Orig coords: %g,%g -> %g,%g",x0[i],y0[i],x1[i],y1[i]); } list.insert (vector ([x0_i, x1_i], [y0_i, y1_i], [0,0])); } return list; } % This algorithm is based uses the Sutherland-Hodgman method private define intersect_x (x0, y0, x1, y1, x) { variable d0 = x - x0; variable d1 = x1 - x; variable den = d0+d1; if (den == 0) return (x, y0); return x, (d0*y1 + d1*y0)/den; } private define intersect_y (x0, y0, x1, y1, y) { variable d0 = y - y0; variable d1 = y1 - y; variable den = d0+d1; if (den == 0) return (x0, y); return (d0*x1 + d1*x0)/den, y; } private define clip_1 (x, y, is_outside, intersect, a) { variable fx, fy, sx, sy, xi, yi, xx, yy; variable n = length (x); if (n == 0) return x, y; variable new_x = {}; variable new_y = {}; variable last_outside = is_outside[0]; fx = x[0]; fy = y[0]; sx = fx, sy = fy; _for (0, n-1, 1) { variable i = (); variable io = is_outside[i]; if (io == last_outside) { sx = x[i]; sy = y[i]; } else { last_outside = io; xi = x[i]; yi = y[i]; (xx, yy) = (@intersect) (sx, sy, xi, yi, a); list_append (new_x, xx); list_append (new_y, yy); sx = xi; sy = yi; } if (last_outside == 0) { list_append (new_x, sx); list_append (new_y, sy); } } if (length (new_x) and (last_outside != is_outside[0])) { (xx, yy) = (@intersect) (sx, sy, fx, fy, a); list_append (new_x, xx); list_append (new_y, yy); } return new_x, new_y; } #ifnexists list_to_array private define list_to_array (x) { variable i, n = length (x); variable xx = Double_Type[n]; _for i (0, n-1, 1) { xx[i] = x[i]; } return xx; } #endif define _xfig_clip_polygon2d (x, y, xmin, xmax, ymin, ymax) { variable is_outside = (x < xmin); !if (any (is_outside or (x > xmax) or (y < ymin) or (y > ymax))) return (x, y); (x, y) = clip_1 (x, y, is_outside, &intersect_x, xmin); y = list_to_array (y); is_outside = (y < ymin); (x, y) = clip_1 (x, y, is_outside, &intersect_y, ymin); x = list_to_array (x); is_outside = (x > xmax); (x, y) = clip_1 (x, y, is_outside, &intersect_x, xmax); y = list_to_array (y); is_outside = (y > ymax); (x, y) = clip_1 (x, y, is_outside, &intersect_y, ymax); x = list_to_array (x); y = list_to_array (y); return x, y; } define xfig_clip_polygon2d (x, y, xmin, xmax, ymin, ymax) { (x, y) = _xfig_clip_polygon2d (x, y, xmin, xmax, ymin, ymax); return xfig_new_polyline (vector(x,y,0*x)); } slxfig-pre0.2.0-35/src/xfig/core.sl0000644000175000000620000005466211210170554015604 0ustar johnstaffrequire ("vector"); private variable Eye; private variable PIX_PER_INCH = 1200.0; % xfig units per inch private variable XFig_Origin_X = 10.795;% [cm] private variable XFig_Origin_Y = 13.97; % [cm] private variable Origin = vector (0, 0, 0); private variable Focus = vector (0, 0, 0); % XFig has a strange notion about what a cm is--- not 1200/2.54. private variable PIX_PER_CM = 450.0; private variable DISPLAY_PIX_PER_INCH = 80; private variable Scale_Factor; private variable Display_Pixel_Size; define xfig_get_focus () { return Focus; } define xfig_set_eye (dist, theta, phi) { theta *= PI/180.0; phi *= PI/180.0; variable x = dist * sin(theta)*cos(phi); variable y = dist * sin(theta)*sin(phi); variable z = dist * cos(theta); Eye = vector_sum (vector(x,y,z), xfig_get_focus ()); %exit (0); } define xfig_set_focus (X) { Focus = X; } define xfig_get_eye () { return Eye; } define xfig_convert_inches (x) { return int (PIX_PER_INCH * x + 0.5); } define xfig_convert_cm (x) { return int (PIX_PER_CM*x + 0.5); } define xfig_convert_units (x) { return nint (Scale_Factor * x + 0.5); } define xfig_use_inches () { Scale_Factor = PIX_PER_INCH; Display_Pixel_Size = 1.0/DISPLAY_PIX_PER_INCH; } define xfig_use_cm () { Scale_Factor = PIX_PER_CM; Display_Pixel_Size = 2.54/DISPLAY_PIX_PER_INCH; } % Scale from inches to user system define xfig_scale_from_inches (x) { return x*(PIX_PER_INCH/Scale_Factor); } define xfig_scale_to_inches (x) { return (x * Scale_Factor)/PIX_PER_INCH; } % Xfig scales the image pixels (e.g., png) to its pixel system using the factor % PIX_PER_INCH/DISPLAY_PIX_PER_INCH % when inches are used, and % (2.54*PIX_PER_CM)/DISPLAY_PIX_PER_INCH % when cm are used. % where DISPLAY_PIX_PER_INCH is 80. Note also that in Xfig, % PIX_PER_INCH/PIX_PER_CM is _not_ 2.54. The scale factor represents % the number of Xfig pixels per image-pixel. % The function below supplies the correct scaling for images that have no % predefined units. define xfig_get_display_pix_size () { return Display_Pixel_Size; } define xfig_set_origin (x, y) { XFig_Origin_X = x; XFig_Origin_Y = y; } define xfig_transform_vector (X, xhat, yhat, zhat, X0, scale) { X = vector_change_basis (X, xhat, yhat, zhat); return vector_sum (X0, vector_mul (scale, X)); } private define intersect_focal_plane (X, n) { %variable dX = vector_diff (X, Focus); variable X_E = vector_diff (X, Eye); %variable t = -dotprod (de, de)/dotprod (de, X_E); %return vector_sum (de, vector_mul (t, X_E)); %variable t = -dotprod (de, dX)/dotprod (de, X_E); %return vector_sum (X, vector_mul (t, X_E)); variable t = -dotprod(n, Eye)/dotprod(n, X_E); return vector_a_plus_bt (Eye, X_E, t); %return vector_sum (Eye, vector_mul (t, X_E)); } define xfig_project_to_xfig_plane (X) { variable origin = Focus; variable zhat = vector_diff (Eye, origin); normalize_vector (zhat); X = intersect_focal_plane (X, zhat); variable yhat = vector_sum (origin, vector (0, 1, 0)); yhat = intersect_focal_plane (yhat, zhat); origin = intersect_focal_plane (origin, zhat); yhat = vector_diff (yhat, origin); normalize_vector (yhat); variable xhat = crossprod (yhat, zhat); variable x = dotprod (X,xhat); variable y = dotprod (X,yhat); y = -y; x += XFig_Origin_X; y += XFig_Origin_Y; return (x, y); } private variable XFig_Header = struct { orientation, justification, units, papersize, magnification, multiple_page, transparant_color, resolution_coord_system, }; XFig_Header.orientation = "Portrait"; XFig_Header.justification = "Center"; XFig_Header.units = "Metric"; XFig_Header.papersize = "Letter"; XFig_Header.magnification = 100; % percent XFig_Header.multiple_page = "Single"; XFig_Header.transparant_color = -1; % default XFig_Header.resolution_coord_system = [PIX_PER_INCH, 2]; define xfig_vwrite () { variable args = __pop_list (_NARGS); () = fprintf (__push_list (args)); } define xfig_write (fp, x) { () = fputs (x, fp); } define xfig_write_header (fp, h) { if (h == NULL) h = @XFig_Header; xfig_write (fp, "#FIG 3.2\n"); xfig_vwrite (fp, "%s\n", h.orientation); xfig_vwrite (fp, "%s\n", h.justification); xfig_vwrite (fp, "%s\n", h.units); xfig_vwrite (fp, "%s\n", h.papersize); xfig_vwrite (fp, "%g\n", h.magnification); xfig_vwrite (fp, "%s\n", h.multiple_page); xfig_vwrite (fp, "%d\n", h.transparant_color); xfig_vwrite (fp, "%g %g\n", h.resolution_coord_system[0], h.resolution_coord_system[1]); } private variable Fig2dev_Formats = Assoc_Type[String_Type]; %!%+ %\function{xfig_set_output_driver} %\synopsis{Associate an output driver to a file extension} %\usage{xfig_set_output_driver (String_Type ext, String_Type cmd)} %\description % This may may be used to define the command that runs to created the specified % output format (dictated by the extension) from the corresponding .fig file. % The \exmp{ext} parameter specifies the filename extension and \exmp{cmd} is % the shell command that will be used to generate the file. % % The \exmp{cmd} may contain the following format descriptors that will be % replace by the corresponding objects before being passed to the shell: %#v+ % %I Input .fig file % %O Output file % %P paper-size % %B basename of the file %#v- %\example % The default driver for postscript output is given by: %#v+ % xfig_set_output_driver ("ps", "fig2dev -L ps -c -z %P %I %O"); %#v- % The \var{ps2ps} command may result in a smaller file size at a slight cost % of resolution. It may be used as follows: %#v+ % xfig_set_output_driver ("ps", "fig2dev -L ps -c -z %P %I %B-tmp.ps" % + ";ps2ps %B-tmp.ps %O; rm -f %B-tmp.ps"); %#v- %\seealso{xfig_set_paper_size} %!%- define xfig_set_output_driver (ext, cmd) { Fig2dev_Formats[ext] = cmd; } xfig_set_output_driver("eps", "fig2dev -L eps -z %P %I %O"); xfig_set_output_driver("ps", "fig2dev -L ps -c -z %P %I %O"); xfig_set_output_driver("png", "fig2dev -L png %I %O"); xfig_set_output_driver("gif", "fig2dev -L gif %I %O"); % Colors private variable Color_Type = struct { name, id, rgb, xfigid }; private variable Color_Table = Assoc_Type[Struct_Type]; private variable Color_List = {}; private variable LAST_XFIG_COLOR_ID = 31; private variable Next_Color_Id; private variable Next_XFig_Color_Id = LAST_XFIG_COLOR_ID+1; private define new_color (name, rgb, xfigid, id) { variable s = @Color_Type; name = strlow (name); s.name = name; s.rgb = rgb; s.xfigid = xfigid; s.id = id; Color_Table[name] = s; if (id >= 0) list_append (Color_List, s); } private define add_color (name, rgb, xfigid) { new_color (name, rgb, xfigid, Next_Color_Id); Next_Color_Id++; } % These are the built-in xfig colors. % They are ordered for the purpose of plotting via a color index. Next_Color_Id = -2; add_color ("default", 0xFFFFFF, -1); add_color ("white", 0xFFFFFF, 7); add_color ("black", 0x000000, 0); add_color ("red", 0xFF0000, 4); add_color ("green", 0x00FF00, 2); add_color ("blue", 0x0000FF, 1); add_color ("magenta", 0xFF00FF, 5); add_color ("cyan", 0x00FFFF, 3); add_color ("brown4", 0x803000, 24); add_color ("red4", 0x900000, 18); add_color ("green4", 0x009000, 12); add_color ("blue4", 0x000090, 8); add_color ("magenta4", 0x900090, 21); add_color ("cyan4", 0x009090, 15); add_color ("brown3", 0xa04000, 25); add_color ("red3", 0xb00000, 19); add_color ("green3", 0x00b000, 13); add_color ("blue3", 0x0000d0, 10); add_color ("magenta3", 0xb000b0, 22); add_color ("cyan3", 0x00b0b0, 16); add_color ("brown2", 0xc06000, 26); add_color ("red2", 0xd00000, 20); add_color ("green2", 0x00d000, 14); add_color ("blue2", 0x0000b0, 9); add_color ("magenta2", 0xd000d0, 23); add_color ("cyan2", 0x00d0d0, 17); add_color ("gold", 0xffd700, 31); add_color ("pink4", 0xff8080, 27); add_color ("yellow", 0xFFFF00, 6); add_color ("blue1", 0x87ceff, 11); add_color ("pink3", 0xffa0a0, 28); add_color ("pink2", 0xffc0c0, 29); add_color ("pink", 0xffe0e0, 30); private define find_color (color) { if (typeof (color) == String_Type) { color = strlow (color); if (assoc_key_exists (Color_Table, color)) return Color_Table[color]; return NULL; } else { if (color > 0) return Color_List[2 + (color mod (length (Color_List)-2))]; if (color) return Color_List[0]; return Color_List[1]; } } define xfig_lookup_color (color) { variable s = find_color (color); if (s != NULL) return s.xfigid; () = fprintf (stderr, "color %S is unknown-- using default\n", color); return -1; } define xfig_lookup_color_rgb (color) { variable s = find_color (color); if (s == NULL) { () = fprintf (stderr, "color %S is unknown-- using black\n", color); return 0; } return s.rgb; } %!%+ %\function{xfig_new_color} %\synopsis{Add a new color definition} %\usage{xfig_new_color (name, RGB [,&id]} %\description % This function may be used to add a new color called \exmp{name} % with the specified RGB (24 bit integer) value. If the optional % third parameter is provided, it must be a reference to a variable % whose value upon return will be set to the integer index of the color. %\seealso{xfig_lookup_color_rgb, xfig_lookup_color} %!%- define xfig_new_color () { variable name, rgb, id, idp = &id; if (_NARGS == 3) idp = (); (name, rgb) = (); if (assoc_key_exists (Color_Table, name)) { variable s = Color_Table[name]; if (rgb != s.rgb) { s.rgb = rgb; if (s.xfigid <= LAST_XFIG_COLOR_ID) s.xfigid = Next_XFig_Color_Id; } @idp = s.id; return; } new_color (name, rgb, Next_XFig_Color_Id, Next_Color_Id); @idp = Next_Color_Id; Next_Color_Id++; Next_XFig_Color_Id++; } % Some additional colors private define to_rgb (r, g, b) { return (r << 16) | (g << 8) | b; } xfig_new_color ("orange", to_rgb(255,165,0)); xfig_new_color ("orange2",to_rgb(238,154,0)); xfig_new_color ("orange3",to_rgb(205,133,0)); xfig_new_color ("orange4",to_rgb(139,90,0)); private define write_colors (fp) { foreach (assoc_get_values (Color_Table)) { variable s = (); if (s.xfigid < 32) continue; if (-1 == fprintf (fp, "0 %d #%06X\n", s.xfigid, s.rgb)) throw IOError, "Write to .fig file failed"; } } private define get_fig2dev_cmd (ext) { ext = ext[[1:]]; ifnot (assoc_key_exists (Fig2dev_Formats, ext)) { () = fprintf (stderr, "Unsupported device: %s\n", ext); return NULL; } variable fmt = Fig2dev_Formats[ext]; if (fmt == NULL) { vmessage ("*** Warning: %s format may not be supported by fig2dev", ext); return fmt; } return fmt; } define xfig_create_file (file) { variable dev = struct { fp, figfile, devfile, papersize, fig2dev_fmt }; variable cwd = getcwd (); file = path_concat (cwd, file); variable ext = path_extname (file); variable base = path_sans_extname (file); variable figfile = strcat (base, ".fig"); if (ext != ".fig") { dev.devfile = file; dev.fig2dev_fmt = get_fig2dev_cmd (ext); } dev.figfile = figfile; variable fp = fopen (figfile, "w"); if (fp == NULL) verror ("Unable to open %s\n", figfile); dev.fp = fp; dev.papersize = XFig_Header.papersize; xfig_write_header (fp, NULL); write_colors (fp); return dev; } define xfig_close_file (dev) { if (-1 == fclose (dev.fp)) throw WriteError, sprintf ("xfig_close_file failed: %S", errno_string (errno)); variable fmt = dev.fig2dev_fmt; if (fmt == NULL) return; (fmt,) = strreplace (fmt, "%P", dev.papersize, strlen(fmt)); (fmt,) = strreplace (fmt, "%I", dev.figfile, strlen(fmt)); (fmt,) = strreplace (fmt, "%O", dev.devfile, strlen(fmt)); (fmt,) = strreplace (fmt, "%B", path_sans_extname(dev.figfile), strlen(fmt)); () = system (fmt); } #iffalse define xfig_primative_set_attr (p, attr, val) { variable names = get_struct_field_names (p); if (0 == length (where (names == attr))) return; set_struct_field (p, attr, val); } #endif private define default_render_to_fp (object, fp) { } private define begin_render_as_compound (obj, fp) { variable x0, x1, y0, y1, z0, z1, x, y; (x0, x1, y0, y1, z0, z1) = obj.get_bbox (); (x, y) = xfig_project_to_xfig_plane (vector ([x0,x0,x0,x0,x1,x1,x1,x1], [y0,y0,y1,y1,y0,y0,y1,y1], [z0,z1,z0,z1,z0,z1,z0,z1])); x = xfig_convert_units (x); y = xfig_convert_units (y); xfig_write (fp, sprintf ("6 %d %d %d %d\n", min(x), min(y), max(x), max(y))); } private define end_render_as_compound (obj, fp) { xfig_write (fp, "-6\n"); } % Bitmapped values for flags parameter variable XFIG_RENDER_AS_COMPOUND = 1; private define default_render (obj, dev) { variable rac; variable do_close = 0; if (obj == NULL) return; if (typeof (dev) == String_Type) { do_close = 1; dev = xfig_create_file (dev); } variable fp = dev; if (typeof (dev) == Struct_Type) fp = dev.fp; rac = (obj.flags & XFIG_RENDER_AS_COMPOUND); if (rac) { rac = obj.count_objects (); if (rac) begin_render_as_compound (obj, fp); } obj.render_to_fp (fp); if (rac) end_render_as_compound (obj, fp); if (do_close) xfig_close_file (dev); } private define default_method1 (obj, arg1); private define default_method2 (obj, arg1, arg2); private define default_method3 (obj, arg1, arg2, arg3); private define default_get_bbox (object) { verror ("*** Warning: %S has no get_bbox method", object); return (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); } private define default_count_objects (object) { return 1; } private variable XFig_Object = struct { render_to_fp = &default_render_to_fp,% define this one rotate = &default_method2, translate = &default_method1, scale = &default_method3, get_bbox = &default_get_bbox, set_depth = &default_method1, set_pen_color = &default_method1, set_thickness = &default_method1, set_line_style = &default_method1, set_area_fill = &default_method1, set_fill_color = &default_method1, render = &default_render, % do not override flags = 0, count_objects = &default_count_objects, % Private below }; define xfig_new_object () { variable args = __pop_args (_NARGS); variable root = @XFig_Object; return struct_combine (root, __push_args (args)); } #iffalse define xfig_translate_object () { variable obj, dX; switch (_NARGS) { case 3: dX = __pop_args (2); dX = vector (__push_args (dX), 0); obj = (); } { case 4: dX = __pop_args (3); dX = vector (__push_args (dX)); obj = (); } { (obj, dX) = (); } return obj.translate (dX); } define xfig_rotate_object (obj, axis, theta) { return obj.rotate (axis, theta); } define xfig_scale_object (obj, sx, sy, sz) { return obj.scale(sx, sy, sz); } define xfig_get_object_bbox (obj) { return obj.get_bbox (); } #endif private define translate_compound (c, dX) { foreach (c.list) { variable obj = (); obj.translate (dX); } } private define rotate_compound (c, axis, theta) { foreach (c.list) { variable obj = (); obj.rotate (axis, theta); } } private define count_objects_compound (c) { variable count = 0; foreach (c.list) { variable obj = (); count += obj.count_objects (); } return count; } private define scale_compound (c, sx, sy, sz) { foreach (c.list) { variable obj = (); obj.scale (sx, sy, sz); } } private define set_depth_compound (c, depth) { foreach (c.list) { variable obj = (); obj.set_depth (depth); } } private define set_thickness_compound (c, thick) { foreach (c.list) { variable obj = (); obj.set_thickness (thick); } } private define set_line_style_compound (c, ls) { foreach (c.list) { variable obj = (); obj.set_line_style (ls); } } private define set_pen_color_compound (c, pc) { pc = xfig_lookup_color (pc); foreach (c.list) { variable obj = (); obj.set_pen_color (pc); } } private define set_area_fill_compound (c, x) { foreach (c.list) { variable obj = (); obj.set_area_fill (x); } } private define set_fill_color_compound (c, x) { x = xfig_lookup_color (x); foreach (c.list) { variable obj = (); obj.set_fill_color (x); } } private variable Infinity = 1e38; private define get_bbox_compound (c) { variable x0, x1, y0, y1, z0, z1; variable xmin = Infinity, ymin = Infinity, zmin = Infinity; variable xmax = -Infinity, ymax = -Infinity, zmax = -Infinity; foreach (c.list) { variable obj = (); (x0, x1, y0, y1, z0, z1) = obj.get_bbox (); if (x0 < xmin) xmin = x0; if (x1 > xmax) xmax = x1; if (y0 < ymin) ymin = y0; if (y1 > ymax) ymax = y1; if (z0 < zmin) zmin = z0; if (z1 > zmax) zmax = z1; } return xmin, xmax, ymin, ymax, zmin, zmax; } private define render_compound_to_fp (c, fp) { foreach (c.list) { variable obj = (); obj.render_to_fp (fp); } } private define compound_insert (obj, item) { list_insert (obj.list, item); } define xfig_new_compound_list () { variable obj = xfig_new_object ("insert", "list"); obj.render_to_fp = &render_compound_to_fp; obj.rotate = &rotate_compound; obj.translate = &translate_compound; obj.scale = &scale_compound; obj.set_depth = &set_depth_compound; obj.get_bbox = &get_bbox_compound; obj.set_thickness = &set_thickness_compound; obj.set_line_style = &set_line_style_compound; obj.set_pen_color = &set_pen_color_compound; obj.set_area_fill = &set_area_fill_compound; obj.set_fill_color = &set_fill_color_compound; obj.flags |= XFIG_RENDER_AS_COMPOUND; obj.insert = &compound_insert; obj.count_objects = &count_objects_compound; obj.list = {}; return obj; } % Usage: c = xfig_new_compound (obj, ...); define xfig_new_compound () { variable c = xfig_new_compound_list (); loop (_NARGS) { variable obj = (); if (obj != NULL) c.insert (obj); } return c; } %!%+ %\function{xfig_justify_object} %\synopsis{Justify an object at a specified position} %\usage{xfig_justify_object (obj, X, dX)} %\description % This function moves the object to the specified position X (a vector) % and justifies it at that position according to the offsets specified by % the vector \exmp{dX}. The components of \exmp{dX} are normally in the % range -0.5 to 0.5 and represent offsets relative to the size of the object. % If the components of dX are 0, then the object will be centered at \exmp{X}. %\seealso{xfig_translate_object} %!%- define xfig_justify_object (obj, X, dX) { variable x0, x1, y0, y1, z0, z1; (x0, x1, y0, y1, z0, z1) = obj.get_bbox (); obj.translate (vector (X.x - 0.5*(x0+x1) - dX.x*(x1-x0), X.y - 0.5*(y0+y1) - dX.y*(y1-y0), X.z - 0.5*(z0+z1) - dX.z*(z1-z0))); } % Usage: xfig_new_vbox_compound (o1, o2, ,,, [optional-space]); define xfig_new_vbox_compound () { variable objs = __pop_args (_NARGS); variable ymin; variable y0, y1; variable space = 0; variable num = length (objs); if (0 == is_struct_type (objs[-1].value)) { space = objs[-1].value; num--; objs = objs[[0:num-1]]; } if (num > 1) { (,,ymin,,,) = objs[0].value.get_bbox (); variable v0 = vector (0, ymin, 0); foreach (objs[[1:]]) { variable obj = (); obj = obj.value; (,,y0,y1,,) = obj.get_bbox (); variable v = vector (0, y1+space, 0); variable dv = vector_diff (v0, v); obj.translate (dv); v0 = vector_sum (vector (0, y0, 0), dv); } } return xfig_new_compound (__push_args (objs)); } % Usage: xfig_new_hbox_compound (o1, o2, ,,, [optional-space]); define xfig_new_hbox_compound () { variable objs = __pop_args (_NARGS); variable xmax; variable x0, x1; variable space = 0; variable num = length (objs); if (0 == is_struct_type (objs[-1].value)) { space = objs[-1].value; num--; objs = objs[[0:num-1]]; } if (num > 1) { (,xmax,,,,) = objs[0].value.get_bbox (); variable v0 = vector (xmax, 0, 0); foreach (objs[[1:]]) { variable obj = (); obj = obj.value; (x0,x1,,,,) = obj.get_bbox (); variable v = vector (x0-space, 0, 0); variable dv = vector_diff (v0, v); obj.translate (dv); v0 = vector_sum (vector (x1, 0, 0), dv); } } return xfig_new_compound (__push_args (objs)); } #iffalse define xfig_object_set_attr (obj, attr, val) { (@obj.set_attr)(obj.object, attr, val); } define xfig_set_depth (p, val) { xfig_object_set_attr (p, "depth", val); } define xfig_set_line_style (p, val) { xfig_object_set_attr (p, "line_style", val); } define xfig_set_thickness (p, val) { xfig_object_set_attr (p, "thickness", val); } define xfig_set_pen_color (p, val) { if (typeof (val) == String_Type) val = xfig_lookup_color (val); xfig_object_set_attr (p, "pen_color", val); } define xfig_set_fill_color (p, val) { if (typeof (val) == String_Type) val = xfig_lookup_color (val); xfig_object_set_attr (p, "fill_color", val); } define xfig_set_pen_style (p, val) { xfig_object_set_attr (p, "pen_style", val); } define xfig_set_area_fill (p, val) { xfig_object_set_attr (p, "area_fill", val); } define xfig_set_style_val (p, val) { xfig_object_set_attr (p, "style_val", val); } define xfig_set_join_style (p, val) { xfig_object_set_attr (p, "join_style", val); } define xfig_set_cap_style (p, val) { xfig_object_set_attr (p, "cap_style", val); } define xfig_set_radius (p, val) { xfig_object_set_attr (p, "radius", val); } define xfig_set_font (p, val) { xfig_object_set_attr (p, "font", val); } define xfig_set_font_size (p, val) { xfig_object_set_attr (p, "font_size", val); } #endif %!%+ %\function{xfig_render_object} %\synopsis{Render an object to a device} %\usage{xfig_render_object (obj, device)} %\description % This function renders the specified object to a specified device. % If the device parameter is a string, then a device will be opened with % the specified name. %\seealso{xfig_create_file, xfig_close_file} %!%- define xfig_render_object (obj, fp) { if (obj == NULL) return; return obj.render (fp); } %Letter (8.5" x 11"), %Legal (8.5" x 14"), %Ledger ( 17" x 11"), %Tabloid ( 11" x 17"), %A (8.5" x 11"), %B ( 11" x 17"), %C ( 17" x 22"), %D ( 22" x 34"), %E ( 34" x 44"), %A4 (21 cm x 29.7cm), %A3 (29.7cm x 42 cm), %A2 (42 cm x 59.4cm), %A1 (59.4cm x 84.1 cm), %A0 (84.1 cm x 118.9cm), %B5 (18.2cm x 25.7cm) define xfig_set_paper_size (paper) { XFig_Header.papersize = paper; } % Use CM as the default system xfig_use_cm (); xfig_set_eye (1e6, 0, 0); xfig_set_paper_size ("Letter"); slxfig-pre0.2.0-35/src/xfig/objects.sl0000644000175000000620000001162011076540262016277 0ustar johnstaff% -*- mode: slang; mode: fold; -*- % Creates a rectangle with the LL corner at the origin define xfig_new_rectangle (dx, dy) { return xfig_new_polygon (vector([0,dx,dx,0,0], [0,0,dy,dy,0], [0,0,0,0,0])); } define xfig_new_grid (nx, ny, dx, dy) { variable lenx, leny; variable X; leny = ny * dy; lenx = nx * dx; variable border = xfig_new_rectangle (lenx, leny); variable list = xfig_new_polyline_list (); nx++; ny++; variable xs, ys, zs, x, y; x = 0; ys = [0,leny]; zs = [0,0]; loop (nx) { X = vector ([x,x], ys, zs); list.insert (X); x += dx; } xs = [0, lenx]; y = 0; loop (ny) { X = vector (xs, [y,y], zs); list.insert (X); y += dy; } %return list; return xfig_new_compound (border, list); } %}}} define xfig_new_block (dx, dy, dz) { variable block = xfig_new_polygon_list (); variable X, p, obj; variable zeros = [0,0,0,0,0]; % Bottom X = vector ([0, 0, dx, dx, 0], [0, dy, dy, 0, 0], zeros); block.insert (xfig_new_polygon(X)); % Top X = vector ([0, dx, dx, 0, 0], [0, 0, dy, dy, 0], [dz, dz, dz, dz, dz]); block.insert (xfig_new_polygon(X)); % Left X = vector ([0, dx, dx, 0, 0], zeros, [0, 0, dz, dz, 0]); block.insert (xfig_new_polygon(X)); % Front X = vector ([dx, dx, dx, dx, dx], [0, dy, dy, 0, 0], [0, 0, dz, dz, 0]); block.insert (xfig_new_polygon(X)); % Back X = vector (zeros, [0, 0, dy, dy, 0], [0, dz, dz, 0, 0]); block.insert (xfig_new_polygon(X)); % Right X = vector ([0, 0, dx, dx, 0], [dy, dy, dy, dy, dy], [0, dz, dz, 0, 0]); block.insert (xfig_new_polygon(X)); return block; } #ifnexists urand private variable Fast_Random = _time (); private define urand (n) { variable x = Double_Type[n]; _for (0, n-1, 1) { variable i = (); Fast_Random = Fast_Random * 69069U + 1013904243U; x[i] = Fast_Random/4294967296.0; } return x; } #endif define xfig_new_random_polyline (dx, dy, dz, max_points) { return xfig_new_ellipse (dx, dy); variable x, y, z; x = 2*(0.5-urand(max_points)); y = 2*(0.5-urand(max_points)); z = 2*(0.5-urand(max_points)); variable i = where (x*x + y*y + z*z < 1.0); return xfig_new_polyline (vector (dx*x[i], dy*y[i], dz*z[i])); } % Created photon will have head at the origin and tail at dX define xfig_new_photon (dX, amp, period) { dX = vector_chs (dX); variable x, y, z, t; variable len = vector_norm (dX); z = [0:len:period/(10*len)]; t = z*(2*PI/period); % For the arrow to look ok, make the amp fall off near the end amp *= (1.0 - exp ((z-len)/(3*period))); x = amp*cos (t); y = amp*sin (t); variable v = vector (x, y, z); variable n = crossprod(vector(0,0,1), dX); normalize_vector (n); variable cos_theta = dX.z/len; v = vector_rotate (v, n, acos (cos_theta)); variable photon = xfig_new_polyline (v); variable a = xfig_new_arrow_head (0.5*period, period, dX); dX = vector_chs (dX); photon.translate (dX); a.translate (dX*(period/len)); return xfig_new_compound (photon, a); } % Neither of these functions work too well --- avoid them define xfig_new_labeled_arrow (dX, label) { variable height = 0.1, width = 0.05; variable p = xfig_new_polyline (vector([0,dX.x], [0,dX.y], [0,dX.z]) ;; __qualifiers); variable a = xfig_new_arrow_head (width, height, dX;; __qualifiers); a.translate ((1.0-height)*dX); if (label != NULL) { label = xfig_new_text (label ;;__qualifiers); variable dx, dy; (dx, dy) = label.get_pict_bbox (); label.translate (1.05*dX + vector (dX.x*dx, dy, 0)); } return xfig_new_compound (p, a, label); } define xfig_new_3d_axis (xlabel, ylabel, zlabel) { variable e1 = xfig_new_labeled_arrow (vector(1,0,0), xlabel;; __qualifiers); variable e2 = xfig_new_labeled_arrow (vector(0,1,0), ylabel;; __qualifiers); variable e3 = xfig_new_labeled_arrow (vector(0,0,1), zlabel;; __qualifiers); return xfig_new_compound (e1, e2, e3); } define xfig_new_hedgehog (radius, n) { variable h = xfig_new_polyline_list (); variable phis = 2*PI*urand (n); variable thetas = acos (2.0*urand (n)-1); variable xs = sin(thetas); variable ys = xs*sin(phis); xs *= cos(phis); variable zs = cos(thetas); _for (0, n-1, 1) { variable i = (); variable x = xs[i], y = ys[i], z = zs[i]; h.insert (vector ([-x,x], [-y,y], [-z,z])); } return h; } define xfig_new_polyline_with_arrow (X, width, height) { variable x = X.x, y = X.y, z = X.z; if (length (x) < 2) verror ("xfig_new_arrow: need at least 2 points"); variable line = xfig_new_polyline (X); X = vector (x[-1], y[-1], z[-1]); variable dX = vector_diff (X, vector (x[-2], y[-2], z[-2])); variable a = xfig_new_arrow_head (width, height, dX); normalize_vector (dX); %xfig_translate_object (a, X); a.translate (vector_diff (X, vector_mul (height, dX))); return xfig_new_compound (line, a); } slxfig-pre0.2.0-35/src/xfig/polyline.sl0000644000175000000620000004525111107765375016521 0ustar johnstaff% -*- mode:slang; mode:fold -*- % FIXME: % It would be better to put the polyline stuff in a separate structure to % produce something like: % { basic methods... % attribute_methods % { attributes } % } % Then the polyline list would look like: % % { basic methods % attribute_methods % { attributes } % list ... % } % Polygon List would look like: % % { basic methods % } % % private variable Polyline_Type = struct { X, % vertices % Methods set_line_style, set_thickness, set_pen_color, set_fill_color, set_depth, set_area_fill, set_join_style, set_cap_style, object_code, % int (always 2) sub_type, % (1: polyline, 2: box, 3: polygon, 4: arc-box, 5: imported-picture bounding-box) line_style, % int (enumeration type) thickness, % int (1/80 inch) pen_color, % int (enumeration type, pen color) fill_color, % int (enumeration type, fill color) depth, % int (enumeration type) pen_style, % int (pen style, not used) area_fill, % int (enumeration type, -1 = no fill) style_val, % float (1/80 inch) of on/off dashes, etc... join_style, % int (enumeration type) cap_style, % int (enumeration type, only used for POLYLINE) radius, % int (1/80 inch, radius of arc-boxes) forward_arrow, % backward_arrow % int (0: off, 1: on) }; private variable SUBTYPE_POLYLINE = 1; private variable SUBTYPE_BOX = 2; private variable SUBTYPE_POLYGON = 3; private variable SUBTYPE_ARCBOX = 4; private variable SUBTYPE_IMPPICT = 5; private define set_line_style (obj, val) { obj.line_style = val; } private define set_thickness (obj, val) { obj.thickness = val; } private define set_pen_color (obj, val) { obj.pen_color = xfig_lookup_color (val); } private define set_fill_color (obj, val) { obj.fill_color = xfig_lookup_color (val); } private define set_depth (obj, val) { obj.depth = val; } private define set_area_fill (obj, val) { obj.area_fill = val; } private define set_join_style (obj, val) { obj.join_style = val; } private define set_cap_style (obj, val) { obj.cap_style = val; } Polyline_Type.set_line_style = &set_line_style; Polyline_Type.set_thickness = &set_thickness; Polyline_Type.set_pen_color = &set_pen_color; Polyline_Type.set_fill_color = &set_fill_color; Polyline_Type.set_depth = &set_depth; Polyline_Type.set_area_fill = &set_area_fill; Polyline_Type.set_join_style = &set_join_style; Polyline_Type.set_cap_style = &set_cap_style; Polyline_Type.sub_type = 1; Polyline_Type.line_style = 0; Polyline_Type.thickness = 1; Polyline_Type.pen_color = 0; Polyline_Type.fill_color = 0; Polyline_Type.depth = 50; Polyline_Type.pen_style = 0; Polyline_Type.area_fill = -1; Polyline_Type.style_val = 4.0; Polyline_Type.join_style = 1; Polyline_Type.cap_style = 0; Polyline_Type.radius = 10; Polyline_Type.forward_arrow = NULL; Polyline_Type.backward_arrow = NULL; private define write_arrow (fp, a, X, i1, i2) { variable X1, X2; X1 = vector (X.x[i1], X.y[i1], X.z[i1]); X2 = vector (X.x[i2], X.y[i2], X.z[i2]); variable dX = vector_diff (X2,X1); normalize_vector (dX); variable x1, x2, y1, y2, width, height; width = a.arrow_width; height = a.arrow_height; (x1,y1) = xfig_project_to_xfig_plane (X2); (x2,y2) = xfig_project_to_xfig_plane (vector_sum (X2, vector_mul(height, dX))); height = sqrt ((x2-x1)^2+(y2-y1)^2); % Now make a vector normal to dX to project the width. This one will work % for this purpose dX = vector (-dX.y, dX.x, 0); normalize_vector (dX); (x2,y2) = xfig_project_to_xfig_plane (vector_sum (X2, vector_mul(width, dX))); width = sqrt ((x2-x1)^2+(y2-y1)^2); width = xfig_convert_units (width); height = xfig_convert_units (height); xfig_vwrite (fp, " %d %d %g %g %g\n", a.arrow_type, a.arrow_style, a.arrow_thickness, width, height); } private define write_polyline_header (fp, p, n) { xfig_vwrite (fp, "%d %d %d %d %d %d %d %d %d %g %d %d %d %d %d %d\n", 2, p.sub_type, p.line_style, p.thickness, p.pen_color, p.fill_color, p.depth, p.pen_style, p.area_fill, p.style_val, p.join_style, p.cap_style, p.radius, (p.forward_arrow != NULL), (p.backward_arrow != NULL), n); } private define write_polyline_data (fp, x, y) { _for (0, length(x)-1, 1) { variable i = (); xfig_vwrite (fp, " %d %d", x[i], y[i]); } xfig_write (fp, "\n"); } private define prune(x,y) { variable dx = (x!=shift(x,-1)); variable dy = (y!=shift(y,-1)); dx[0]=1; variable i = where (dx or dy); if (length (i) != length(x)) return x[i], y[i]; return x, y; } private define write_one_polyline (fp, p, X) { variable x, y; variable n; (x,y) = xfig_project_to_xfig_plane (X); n = length (x); if (n < 2) return; x = xfig_convert_units (__tmp(x)); y = xfig_convert_units (__tmp(y)); #iftrue (x,y) = prune (__tmp(x), __tmp(y)); n = length (x); if (n < 2) return; #endif write_polyline_header (fp, p, n); if (p.forward_arrow != NULL) write_arrow (fp, p.forward_arrow, X, -2, -1); if (p.backward_arrow != NULL) write_arrow (fp, p.backward_arrow, X, 1, 0); write_polyline_data (fp, x, y); } private define polyline_render_to_fp (p, fp) { write_one_polyline (fp, p, p.X); } private define polyline_rotate (obj, axis, theta) { obj.X = vector_rotate (obj.X, axis, theta); } private define polyline_translate (obj, dX) { obj.X = vector_sum (obj.X, dX); } private define polyline_scale (obj, sx, sy, sz) { variable X = obj.X; X.x *= sx; X.y *= sy; X.z *= sz; obj.X = X; } private define polyline_get_bbox (obj) { variable X = obj.X; return min(X.x), max(X.x), min(X.y), max(X.y), min(X.z), max(X.z); } define xfig_new_polyline (X) { variable p = @Polyline_Type; p.object_code = SUBTYPE_POLYLINE; p.X = X; variable obj = xfig_new_object (p); obj.render_to_fp = &polyline_render_to_fp; obj.rotate = &polyline_rotate; obj.translate = &polyline_translate; obj.scale = &polyline_scale; obj.get_bbox = &polyline_get_bbox; return obj; } %------------------------------------------------------------------------ % Polyline_List % % All objects in the polyline list have the same attributes. %------------------------------------------------------------------------ %{{{ private define polyline_list_render_to_fp (p, fp) { foreach (p.list) { variable X = (); write_one_polyline (fp, p, X); } } private define polyline_list_rotate (obj, axis, theta) { variable list = obj.list; _for (0, length(list)-1, 1) { variable i = (); list[i] = vector_rotate (list[i], axis, theta); } } private define polyline_list_translate (obj, dX) { variable list = obj.list; _for (0, length(list)-1, 1) { variable i = (); list[i] = vector_sum (list[i], dX); } } private define polyline_list_scale (obj, sx, sy, sz) { variable list = obj.list; _for (0, length(list)-1, 1) { variable i = (); variable X = list[i]; X.x *= sx; X.y *= sy; X.z *= sz; list[i] = X; } } private define polyline_list_get_bbox (obj) { variable x0, x1, y0, y1, z0, z1; variable xmin = _Inf, ymin = _Inf, zmin = _Inf; variable xmax = -_Inf, ymax = -_Inf, zmax = -_Inf; foreach (obj.list) { variable X = (); variable tmp; tmp = X.x; x0 = min (tmp); if (x0 < xmin) xmin = x0; x1 = max (tmp); if (x1 > xmax) xmax = x1; tmp = X.y; y0 = min (tmp); if (y0 < ymin) ymin = y0; y1 = max (tmp); if (y1 > ymax) ymax = y1; tmp = X.z; z0 = min (tmp); if (z0 < zmin) zmin = z0; z1 = max (tmp); if (z1 > zmax) zmax = z1; } return xmin, xmax, ymin, ymax, zmin, zmax; } private define polyline_list_insert (p, X) { list_insert (p.list, X); } define xfig_new_polyline_list () { variable p = xfig_new_polyline (vector(0,0,0)); p = struct_combine (p, "insert", "list"); p.list = {}; p.insert = &polyline_list_insert; p.render_to_fp = &polyline_list_render_to_fp; p.rotate = &polyline_list_rotate; p.translate = &polyline_list_translate; p.scale = &polyline_list_scale; p.get_bbox = &polyline_list_get_bbox; return p; } %}}} %------------------------------------------------------------------------ % Polygon_Type % %------------------------------------------------------------------------ %{{{ private define polygon_render_to_fp (obj, fp) { variable eye = xfig_get_eye (); variable n = obj.n; variable X = obj.X; variable dX = vector_diff (eye, vector(X.x[0],X.y[0],X.z[0])); if (dotprod (dX, n) < 0) return; write_one_polyline (fp, obj, X); } define xfig_new_polygon (X) { variable p = xfig_new_polyline (X); p = struct_combine (p, "n"); p.object_code = SUBTYPE_POLYGON; variable x = X.x, y = X.y, z = X.z; variable x0 = vector (x[0], y[0], z[0]); variable x1 = vector (x[1], y[1], z[1]); variable x2 = vector (x[2], y[2], z[2]); p.n = crossprod (vector_diff (x1, x0), vector_diff (x2, x1)); normalize_vector (p.n); return p; } %}}} %------------------------------------------------------------------------ % Polygon_List % % A Polygon_List_Type consists of a linked list of (closed) polygons. % When rendered, it properly takes into account the position of the polygons % with respect to the viewer. % % If drawing 3d objects, then use polygons and not polylines. %------------------------------------------------------------------------ %{{{ private define poly_sort (a, b) { variable za, zb; za = max (a.X.z); zb = max (b.X.z); if (za > zb) return +1; if (za < zb) return -1; variable na = a.n; variable nb = b.n; if (na == NULL) { if (nb != NULL) return 1; } else if (nb == NULL) return -1; % Using the length has the feature that a single line will get drawn % after something more complex. return (length (a.X) < length (b.X)); } private define sort_polygons (list) { variable count = length (list); variable ps = Struct_Type[count]; variable i; _for (0, count-1, 1) { i = (); ps[i] = list[i]; } return ps[array_sort (ps, &poly_sort)]; } private define polygon_list_render_to_fp (obj, fp) { variable ps = sort_polygons (obj.list); variable eye = xfig_get_eye (); foreach (ps) { variable p = (); variable n = p.n; variable X = p.X; variable dX = vector_diff (eye, vector(X.x[0],X.y[0],X.z[0])); if (dotprod (dX, n) < 0) continue; write_one_polyline (fp, p, p.X); } } private define polygon_list_set_line_style (obj, val) { foreach (obj.list) { obj = (); obj.line_style = val; } } private define polygon_list_set_thickness (obj, val) { foreach (obj.list) { obj = (); obj.thickness = val; } } private define polygon_list_set_pen_color (obj, val) { val = xfig_lookup_color (val); foreach (obj.list) { obj = (); obj.pen_color = val; } } private define polygon_list_set_fill_color (obj, val) { val = xfig_lookup_color (val); foreach (obj.list) { obj = (); obj.fill_color = val; } } private define polygon_list_set_area_fill (obj, val) { foreach (obj.list) { obj = (); obj.area_fill = val; } } define xfig_new_polygon_list () { variable list = xfig_new_compound_list (); list = struct_combine (list, "set_line_style", "set_thickness", "set_pen_color", "set_fill_color", "set_area_fill"); list.set_line_style = &polygon_list_set_line_style; list.set_thickness = &polygon_list_set_thickness; list.set_pen_color = &polygon_list_set_pen_color; list.set_fill_color = &polygon_list_set_fill_color; list.set_area_fill = &polygon_list_set_area_fill; list.render_to_fp = &polygon_list_render_to_fp; return list; } %}}} %----------------------------------------------------------------------- % Pict_Type % %----------------------------------------------------------------------- %{{{ private define pict_render_to_fp (p, fp) { variable flipped = 0; variable x0, y0, x1, y1, x, y; (x0,y0) = xfig_project_to_xfig_plane (p.X); % This point must correspond to the lower left corner of the picture % or, in fig units the corner with the smallest x and the largest y. variable bbox_x = p.bbox_x + (x0 - 0.5*max(p.bbox_x)); variable bbox_y = p.bbox_y; bbox_y = bbox_y + (y0 - 0.5*max(bbox_y)); bbox_x = xfig_convert_units (bbox_x); bbox_y = xfig_convert_units (bbox_y); write_polyline_header (fp, p, 5); xfig_vwrite (fp, " %d %s\n", p.flipped, p.pict_file); write_polyline_data (fp, bbox_x, bbox_y); } private define pict_get_bbox (p) { variable X = p.X; variable dx, dy, dz, x, y, z; dx = 0.5*max(abs(p.bbox_x)); dy = 0.5*max(abs(p.bbox_y)); dz = 0.0; x = X.x; y = X.y; z = X.z; return x-dx, x+dx, y-dy, y+dy, z, z+dz; } private define pict_scale (p, sx, sy, sz) { variable X = p.X; X.x *= sx; X.y *= sy; X.z *= sz; p.bbox_x *= sx; p.bbox_y *= sy; %polyline_list_scale (p, sx, sy, sz); } private define pict_rotate (p, axis, theta) { p.X = vector_rotate (p.X, axis, theta); } private define pict_translate (p, dX) { p.X += dX; } define pict_rotate_pict (pict, theta_degrees) { % The convention adopted here is that the location of the picture is % specified by the lower left corner of the box, rotated or % otherwise. In fig units, this corner will have the largest y % value and smallest x value (UL in diagram below, displayed in fig % system): % % UL UR % LL LR % % The rotation of the figure itself is encoded by how the box is % written out: % % 0 degrees: LL LR UR UL LL (dx>0, dy>0) % 90 degrees: LR UR UL LL LR (dx<0, dy>0) % 180 degrees: UR UL LL LR UR (dx<0, dy<0) % 270 degrees: UL LL LR UR UL (dx>0, dy<0) variable bbox_x = pict.bbox_x; variable bbox_y = pict.bbox_y; theta_degrees = theta_degrees mod 360.0; if (theta_degrees < 0) theta_degrees += 360; variable n = int(theta_degrees / 90.0 + 0.5); loop (n) { bbox_x[[0:3]] = bbox_x[[1:4]]; bbox_x[4] = bbox_x[0]; bbox_y[[0:3]] = bbox_y[[1:4]]; bbox_y[4] = bbox_y[0]; (bbox_x, bbox_y) = (bbox_y, bbox_x); } pict.bbox_x = bbox_x; pict.bbox_y = bbox_y; } %!%+ %\function{xfig_scale_pict} %\synopsis{} %\usage{xfig_scale_pict (pict, sx [,sy])} %\description %\example %\notes %\seealso{} %!%- private define pict_scale_pict () { variable pict, sx, sy; if (_NARGS == 2) { (pict, sx) = (); sy = sx; } else { (pict, sx, sy) = (); } pict.bbox_x *= sx; pict.bbox_y *= sy; } % FIXME: This does not look right define pict_get_pict_bbox (pict) { return max(abs(pict.bbox_x)), max(abs(pict.bbox_y)); } %!%+ %\function{xfig_center_pict_in_box} %\synopsis{Center a pict object in a box} %\usage{xfig_center_pict_in_box (pict_object, X, dx, dy} %\description % This function takes a pict object and centers it in a box whose width % is \var{dx} and whose height is \var{dy}. The vector \var{X} denotes the % position of the lower-left corner of the box. If the pict object is too % big to fit in the box, then its lower-left corner will coincide with the % lower-left corner of the box. %\seealso{xfig_translate_object} %!%- private define pict_center_pict (pict, X, dx, dy) { variable w, h; (w, h) = pict_get_pict_bbox (pict); variable yoff = 0.5*(dy - h); if (yoff < 0) yoff = 0.0*dy; variable xoff = 0.5*(dx - w); if (xoff < 0) xoff = 0.0*dx; % used to be 0.1*dx pict_translate (pict, vector_sum(X, vector (xoff, yoff, 0))); } %!%+ %\function{xfig_new_pict} %\synopsis{Create an object that encapsulates an image file} %\usage{obj = xfig_new_pict(filename, width, height [; qualifiers])} %\description % This function creates an object containing the specified image file % and scales it to the specified width an height. The resulting % object containing the image will be centered at (0,0,0). % %\qualifiers % The \exmp{just} qualifier may be used to indicate how the object is % to be justified with respect to the origin. Its value must be a 2d % numeric array [dx,dy] that gives the offset of the center of the % image scaled with respect to the bounding box. Examples include: %#v+ % just=[0,0] Center object upon the origin (default) % just=[-0.5,-0.5] Put the lower-left corner at the origin % just=[0.5,-0.5] Put the lower-right corner at the origin % just=[0.5,0.5] Put the upper-right corner at the origin % just=[-0.5,-0.5] Put the upper-left corner at the origin %#v- %\seealso{xfig_new_text, xfig_justify_object} %!%- define xfig_new_pict (file, dx, dy) { variable X = vector(0,0,0); variable p = xfig_new_polyline (X); p.sub_type = SUBTYPE_IMPPICT; p = struct_combine (p, "pict_file", "flipped", "bbox_x", "bbox_y", "rotate_pict", "scale_pict", "get_pict_bbox", "center_pict"); % Use the corners for the polyline p.flipped = 0; if (dy < 0) { p.flipped = 1; dy = -dy; } p.bbox_x = [0, dx, dx, 0, 0]; p.bbox_y = [0, 0, dy, dy, 0]; p.pict_file = file; p.rotate_pict = &pict_rotate_pict; p.scale_pict = &pict_scale_pict; p.get_pict_bbox = &pict_get_pict_bbox; p.center_pict = &pict_center_pict; p.render_to_fp = &pict_render_to_fp; p.scale = &pict_scale; p.rotate = &pict_rotate; p.get_bbox = &pict_get_bbox; variable just = qualifier ("just"); if (just != NULL) { if (length (just) == 2) just = [just, 0]; xfig_justify_object (p, X, vector(just[0], just[1], just[2])); } return p; } %}}} define xfig_new_pyramid (n, radius, height) { variable a = xfig_new_polygon_list (); variable thetas = [n:0:-1]*(2*PI)/n; variable xs = radius * cos (thetas); variable ys = radius * sin (thetas); % base variable X = vector (xs, ys, Double_Type[n+1]); a.insert (xfig_new_polygon (X)); _for (0, n-1, 1) { variable i = (); variable j = i+1; X = vector ([xs[i], 0, xs[j], xs[i]], [ys[i], 0, ys[j], ys[i]], [0, height, 0, 0]); a.insert (xfig_new_polygon (X)); } return a; } define xfig_new_arrow_head (w, h, dX) { dX = @dX; normalize_vector (dX); variable a = xfig_new_pyramid (6, w*0.5, h); variable theta = acos (dX.z); if (theta != 0.0) { variable axis = unit_vector (crossprod (vector (0,0,1), dX)); a.rotate (axis, theta); } a.set_area_fill (20); a.set_fill_color ("default"); return a; } private variable XFig_Arrow_Type = struct { arrow_type, % int (enumeration type) arrow_style, % int (enumeration type) arrow_thickness, % float (1/80 inch) arrow_width, % float (Fig units) arrow_height, % float (Fig units) }; define xfig_create_arrow () { variable a = @XFig_Arrow_Type; a.arrow_type = 2; a.arrow_style = 3; a.arrow_thickness = 1; a.arrow_width = (1.0/80.0)*4 * 2.54; a.arrow_height = (1.0/80.0)*8 * 2.54; return a; } slxfig-pre0.2.0-35/src/xfig/ellipse.sl0000644000175000000620000000715511076540262016313 0ustar johnstaffprivate variable XFig_Ellipse_Type = struct { object_code, % int (always 1) sub_type, % int (1: ellipse defined by radii % 2: ellipse defined by diameters % 3: circle defined by radius % 4: circle defined by diameter) line_style, % int (enumeration type) thickness, % int (1/80 inch) pen_color, % int (enumeration type, pen color) fill_color, % int (enumeration type, fill color) depth, % int (enumeration type) pen_style, % int (pen style, not used) area_fill, % int (enumeration type, -1 = no fill) style_val, % float (1/80 inch) direction, % int (always 1) % These quantities describe the shape of the ellipse: % angle, % float (radians, the angle of the x-axis) % center_x, center_y, % int (Fig units) % radius_x, radius_y, % int (Fig units) % start_x, start_y, % int (Fig units; the 1st point entered) % end_x, end_y, %int (Fig units; the last point entered) % They are represented below as 3 points that specify the center, major, % and minor axes X, next, }; set_struct_fields (XFig_Ellipse_Type, 1, 1, 0, 1, -1, -1, 50, -1, -1, 1.0, 1); private define make_ellipse (a, b) { variable e = @XFig_Ellipse_Type; e.X = vector ([0,a,0], [0,0,b], [0,0,0]); return e; } private define render_ellipse_to_fp (e, fp) { variable x, y; (x,y) = xfig_project_to_xfig_plane (e.X); variable center_x = x[0]; variable center_y = y[0]; x -= center_x; y -= center_y; variable a_x = x[1], b_x = x[2], a_y = y[1], b_y = y[2]; variable a = sqrt (a_x^2 + a_y^2); variable b = sqrt (b_x^2 + b_y^2); % Make a the major axis, and b the minor if (b > a) { (a, a_x, a_y, b, b_x, b_y) = (b, b_x, b_y, a, a_x, a_y); } if (a == 0) return; % Note the sign of the angle. I may need to change this variable angle = -acos (a_x/a); if (b != 0) { variable cos_theta = (a_x*b_x+a_y*b_y)/(a*b); variable den = 1.0 - (b/a*cos_theta)^2; if (den != 0) b *= sqrt ((1-cos_theta*cos_theta)/(den)); } xfig_vwrite (fp, "%d %d %d %d %d %d %d %d %d %g %d ", e.object_code, e.sub_type, e.line_style, e.thickness, e.pen_color, e.fill_color, e.depth, e.pen_style, e.area_fill, e.style_val, e.direction); center_x = xfig_convert_units (center_x); center_y = xfig_convert_units (center_y); a = xfig_convert_units (a); b = xfig_convert_units (b); xfig_vwrite (fp, "%g %g %g %g %g %g %g %g %g\n", angle, center_x, center_y, a, b, center_x, center_y, a, b); } private define rotate_ellipse (e, axis, theta) { e.X = vector_rotate (e.X, axis, theta); } private define translate_ellipse (e, dX) { e.X = vector_sum (e.X, dX); } private define scale_ellipse (e, sx, sy, sz) { variable X = e.X; X.x *= sx; X.y *= sy; X.z *= sz; } % FIXME: This may be too simplistic private define get_bbox_ellipse (e) { variable X = e.X; return min(X.x), max(X.x), min(X.y), max(X.y), min(X.z), max(X.z); } private define set_depth (obj, depth) { obj.depth = depth; } private define set_pen_color (obj, pc) { obj.pen_color = xfig_lookup_color (pc); } private define set_thickness (obj, th) { obj.thickness = th; } define xfig_new_ellipse (a, b) { variable obj = xfig_new_object (make_ellipse (a,b)); obj.render_to_fp = &render_ellipse_to_fp; obj.set_depth = &set_depth; obj.rotate = &rotate_ellipse; obj.translate = &translate_ellipse; obj.scale = &scale_ellipse; obj.get_bbox = &get_bbox_ellipse; obj.set_thickness = &set_thickness; obj.set_pen_color = &set_pen_color; return obj; } slxfig-pre0.2.0-35/src/xfig/latex.sl0000644000175000000620000002561411076540262015773 0ustar johnstaff% -*- mode: slang; mode: fold -*- % LaTeX and EPS interface %{{{ Tmpfile and Dir handling Functions private variable Latex_Tmp_Dir = NULL; private variable Latex_Packages = {"amsmath", "bm", "color"}; private variable Latex_Font_Size = 12; private variable Latex_Default_Color = "black"; private variable Latex_Default_Font_Style = "\bf\boldmath"R; private variable Supported_Font_Sizes = [ "\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large","\\Large", "\\LARGE", "\\huge", "\\Huge" ]; private variable EPS_Dir = NULL; private define mkdir_recurse (); private define mkdir_recurse (dir) { variable topdir = path_dirname (dir); if (NULL == stat_file (topdir)) mkdir_recurse (topdir); if ((-1 == mkdir (dir, 0777)) and (errno != EEXIST)) verror ("Unable to mkdir(%s): %s", dir, errno_string(errno)); } private define make_tmp_filename (base, ext) { base = sprintf ("%s_%d", base, getpid ()); variable file = strcat (base, ext); variable count = 0; while (NULL != stat_file (file)) { file = sprintf ("%s_%X%s", base, count, ext); count++; } return file; } define xfig_set_tmp_dir (tmp) { mkdir_recurse (tmp); Latex_Tmp_Dir = tmp; } define xfig_get_tmp_dir () { if (Latex_Tmp_Dir == NULL) xfig_set_tmp_dir (make_tmp_filename ("tmp", "")); return Latex_Tmp_Dir; } define xfig_make_tmp_file (base, ext) { base = path_concat (xfig_get_tmp_dir (), base); return make_tmp_filename (base, ext); } define xfig_set_autoeps_dir (dir) { mkdir_recurse (dir); EPS_Dir = dir; } define xfig_get_autoeps_dir () { if (EPS_Dir == NULL) xfig_set_autoeps_dir ("autoeps"); return EPS_Dir; } private define make_autoeps_file (base) { base = path_concat (xfig_get_autoeps_dir (), base); return make_tmp_filename (base, ".eps"); } private define make_tmp_latex_file (base) { base = path_concat (xfig_get_tmp_dir (), base); return make_tmp_filename (base, ".tex"); } %}}} %{{{ Running LaTeX and dvips private variable LaTeX_Pgm = "latex"; private variable Dvips_Pgm = "dvips -E"; private define run_cmd (cmd) { if (-1 == system (cmd)) vmessage ("****WARNING: %s failed\n", cmd); } private define run_latex (file) { run_cmd (sprintf ("cd %s; %s %s", path_dirname (file), LaTeX_Pgm, path_basename (file))); } private define run_dvips (dvi, eps) { run_cmd (sprintf ("%s %s -o %s", Dvips_Pgm, dvi, eps)); } %}}} define xfig_get_eps_bbox (file) { variable x0, y0, x1, y1; variable fp = fopen (file, "r"); if (fp == NULL) verror ("Unable to open %s", file); variable inside = 0; foreach (fp) using ("line") { variable line = (); if (line[0] != '%') continue; if (0 == strncmp ("%%Begin", line, 7)) { inside++; continue; } if (0 == strncmp ("%%End", line, 5)) { if (inside) inside--; continue; } if (inside) continue; if (strncmp ("%%BoundingBox:", line, 14)) continue; if (is_substr (line, "(atend)")) continue; line = strchop (line, ':', 0)[1]; if (4 != sscanf (line, "%f %f %f %f", &x0, &y0, &x1, &y1)) break; return (x0, y0, x1, y1); } verror ("Bad or no bounding box in EPS file %s", file); } private variable Equation_Number = 0; private define output (fp, s) { if (-1 == fputs (s, fp)) verror ("Write to latex file failed"); } private define open_latex_file (file) { variable fp = fopen (file, "w"); if (fp == NULL) verror ("Unable to open %s", file); return fp; } private define check_font_struct (s) { variable f = s.size; if (f == NULL) f = "\\normalsize"; if (f[0] != '\\') f = strcat ("\\", f); if (0 == length (where (f == Supported_Font_Sizes))) { () = fprintf (stderr, "*** Warning: font size %s not supported\n", f); f = "\\normalsize"; } s.size = f; f = s.color; if (f == NULL) f = 0; if (typeof (f) == String_Type) { (f,) = strreplace (strlow (f), " ", "", strlen (f)); f = xfig_lookup_color_rgb (f); } s.color = f; f = s.style; if (f != NULL) { if (f[0] != '\\') f = strcat ("\\", f); #iffalse if (0 == length (where (f == Supported_Styles))) { () = fprintf (stderr, "*** Warning: font style %s not supported\n", f); f = NULL; } #endif } s.style = f; } private define make_font_struct () { return struct { color = qualifier ("color", Latex_Default_Color), style = qualifier ("style", Latex_Default_Font_Style), size = qualifier ("size", "\\normalsize"), }; } define xfig_make_font () { variable s = make_font_struct (;;__qualifiers); if (_NARGS == 0) return s; if (_NARGS != 3) { usage ("font = %s (style, size, color)", _function_name ()); } variable style, size, color; if (style != NULL) s.style = style; if (size != NULL) s.size = size; if (color != NULL) s.color = color; return s; } private define make_preamble (font) { variable str; str = sprintf ("\\documentclass[%dpt]{article}\n", Latex_Font_Size); foreach (Latex_Packages) { variable package = (); str = strcat (str, sprintf ("\\usepackage{%s}\n", package)); } if (font == NULL) font = xfig_make_font (NULL, NULL, NULL); check_font_struct (font); if (font.color != 0) { variable rgb = font.color; variable r = (rgb & 0xFF0000) shr 16; variable g = (rgb & 0xFF00) shr 8; variable b = (rgb & 0xFF); str = sprintf ("%s\\definecolor{defaultcolor}{rgb}{%.3g,%.3g,%.3g}\n", str, r / 255.0, g/255.0, b/255.0); str = strcat (str, "\\color{defaultcolor}\n"); } % End of preamble str = strcat (str, "\\begin{document}\n\\pagestyle{empty}\n"); if (font.style != NULL) str = strcat (str, font.style, "\n"); if ((font.size != NULL) && (font.size != "\\normalsize")) str = strcat (str, font.size, "\n"); return str; } private define close_latex_file (fp) { output (fp, "\n\\end{document}\n"); if (-1 == fclose (fp)) verror ("Error closing latex file"); } private define make_latex_env (env, envargs, body) { if (env != NULL) body = sprintf ("\\begin{%s}%s\n%s\n\\end{%s}", env, envargs, body, env); return body; } private define write_latex_file (file, str) { variable fp = open_latex_file (file); output (fp, str); close_latex_file (fp); } private define make_latex_string (env, envargs, text, fontstruct) { variable str = make_preamble (fontstruct); return strcat (str, make_latex_env (env, envargs, text)); } private variable Latex_Cache = NULL; private define escape_latex_string (str) { return strtrans (str, "\n\t", "\001\002"); } private define add_to_cache (epsfile, escaped_str) { if (NULL == stat_file (epsfile)) return; variable c = struct { escaped_str, file, next }; c.escaped_str = escaped_str; c.file = epsfile; c.next = Latex_Cache; Latex_Cache = c; } private define open_cache_data (mode) { variable dir = xfig_get_autoeps_dir (); variable file = path_concat (dir, "epscache.dat"); return fopen (file, mode); } private define load_cache () { if (Latex_Cache != NULL) return; variable fp = open_cache_data ("r"); if (fp == NULL) return; foreach (fp) using ("line") { variable line = (); line = strtok (line, "\t\n"); if (length (line) != 2) continue; add_to_cache (line[0], line[1]); } } private define save_cache () { if (Latex_Cache == NULL) return; variable fp = open_cache_data ("w"); variable c = Latex_Cache; while (c != NULL) { () = fprintf (fp, "%s\t%s\n", c.file, c.escaped_str); c = c.next; } } private define find_cached_file (str) { load_cache (); variable c = Latex_Cache; while (c != NULL) { if (c.escaped_str == str) { if (NULL != stat_file (c.file)) return c.file; } c = c.next; } return NULL; } private define latex_xxx2eps (env, envargs, xxx, base, fontstruct) { variable str = make_latex_string (env, envargs, xxx, fontstruct); variable hash = escape_latex_string (str); variable epsfile = find_cached_file (hash); if (epsfile != NULL) return epsfile; variable tex = make_tmp_latex_file (base); epsfile = make_autoeps_file (base); write_latex_file (tex, str); run_latex (tex); run_dvips (path_sans_extname (tex) + ".dvi", epsfile); add_to_cache (epsfile, hash); save_cache (); return epsfile; } private define xfig_text2eps (text, fontstruct) { return latex_xxx2eps (NULL, NULL, text, "text", fontstruct); } private define equation_function_env (eq, env, fontstruct) { Equation_Number++; variable base = sprintf ("eq_%d", Equation_Number); eq += " \\nonumber"; return latex_xxx2eps (env, "", eq, base, fontstruct); } define xfig_eq2eps () { variable fontstruct = NULL; if (_NARGS == 2) fontstruct = (); if (fontstruct == NULL) fontstruct = make_font_struct (;;__qualifiers); variable eq = (); return equation_function_env (eq, "equation*", fontstruct); } define xfig_eqnarray2eps () { variable fontstruct = NULL; if (_NARGS == 2) fontstruct = (); if (fontstruct == NULL) fontstruct = make_font_struct (;;__qualifiers); variable eq = (); return equation_function_env (eq, "eqnarray*", fontstruct); } define xfig_new_eps (file) { variable x0, x1, y0, y1; (x0, y0, x1, y1) = xfig_get_eps_bbox (file); variable dx = xfig_scale_from_inches ((x1 - x0)/72.0); variable dy = xfig_scale_from_inches ((y1 - y0)/72.0); return xfig_new_pict (file, dx, dy;; __qualifiers); } private define do_xfig_new_xxx (fun, text, fontstruct) { variable eps = (@fun) (text, fontstruct;; __qualifiers); return xfig_new_eps (eps;; __qualifiers); } define xfig_new_eq (eq) { variable fontstruct = NULL; if (_NARGS == 2) fontstruct = (); if (fontstruct == NULL) fontstruct = make_font_struct (;;__qualifiers); do_xfig_new_xxx (&xfig_eq2eps, eq, fontstruct;; __qualifiers); } %!%+ %\function{xfig_new_text (text [,font_object])} %\synopsis{Create a text object by running LaTeX} %\usage{obj = xfig_new_text (String_Type text [,font_object])} %\description % This function runs LaTeX on the specified text string and returns the % resulting object. The text string must be formatted according to the LaTeX % rules. The optional parameter is a structure that may be used to specify % the font, color, pointsize, etc to use when calling LaTeX. This structure % may be instantiated using the xfig_font_new. %\seealso{xfig_font_new} %!%- define xfig_new_text () { variable fontstruct = NULL; if (_NARGS == 2) fontstruct = (); if (fontstruct == NULL) fontstruct = make_font_struct (;;__qualifiers); variable text = (); do_xfig_new_xxx (&xfig_text2eps, text, fontstruct;; __qualifiers); } define xfig_set_font_style (style) { Latex_Default_Font_Style = style; } define xfig_add_latex_package (package) { list_append (Latex_Packages, package, -1); } slxfig-pre0.2.0-35/src/xfig/plot.sl0000644000175000000620000020514711210170554015626 0ustar johnstaff% -*- mode: slang; mode: fold; -*- private variable DEFAULT_IMAGE_DEPTH = 89; private variable DEFAULT_TIC_DEPTH = DEFAULT_IMAGE_DEPTH-10; private variable DEFAULT_LINE_DEPTH = DEFAULT_TIC_DEPTH-10; private variable DEFAULT_POINT_DEPTH = DEFAULT_LINE_DEPTH-10; private variable DEFAULT_FRAME_DEPTH = DEFAULT_POINT_DEPTH-10; private variable ERRBAR_TERMINAL_SIZE = 0.1; % convert a scalar to an array of size n private define convert_to_array (s, n) { variable type = typeof (s); if (type == Array_Type) return s; variable a = type[n]; a[*] = s; return a; } %!%+ %\function{xfig_new_legend} %\synopsis{Create a plot legend object} %\usage{legend = xfig_new_legend (labels[], colors[], linestyles[], thicknesses[], width} %\description % The \var{xfig_new_legend} function creates a legend object suitable for adding % to a plot. The legend will consist of ... %!%- % FIXME: allow any object, not just a line... define xfig_new_legend (labels, colors, linestyles, thicknesses, width) { variable num = length(labels); colors = convert_to_array (colors, num); linestyles = convert_to_array (linestyles, num); thicknesses = convert_to_array (thicknesses, num); variable legend = xfig_new_compound_list (); variable height = 0; variable x = width + 0.2; variable x0, x1, y0, y1; variable y = 0; _for (0, num-1, 1) { variable i = (); variable obj = xfig_new_text (labels[i]); xfig_justify_object (obj, vector (x,y,0), vector (-0.5, 0.5, 0)); legend.insert (obj); (,,y0,y1,,) = obj.get_bbox (); y = 0.5*(y0+y1); obj = xfig_new_polyline (vector([0,width], [y,y], [0,0])); obj.set_pen_color (colors[i]); obj.set_thickness (thicknesses[i]); obj.set_line_style (linestyles[i]); legend.insert (obj); y = y0 - 0.1 * (y1-y0); } (x0, x1, y0, y1,,) = legend.get_bbox (); variable border = (0.5 * (y1-y0))/num; legend.translate (vector (border-x0, border-y0, 0)); variable box = xfig_new_rectangle ((x1-x0)+2*border, (y1-y0)+2*border); box.set_area_fill (qualifier("areafill", 20)); box.set_fill_color (qualifier("fillcolor", "white")); legend.insert (box); return legend; } %{{{ Plot_Axis_Type, etc % A "Plot" consists of a plotting area surrounded by a box, with optional tic % marks and labels: % % X2 axis label % X2 tic labels % +-----+-----+-----+-----+-----+-----+ % y1 + + y2 % Y1-label tic + + tic Y2 label % labels + + labels % +-----+-----+-----+-----+-----+-----+ % X1 tic labels % X1 axis label % % % The X1 axis label is placed below the X axis by an amount depending upon the % size of the X1 tic labels. Similar considerations apply to the other axes. % The Y1/Y2 labels will be rotated 90 degrees % private variable Plot_Axis_Type = struct { X, dX, dY, % position of axis, direction, tic dir xmin = 0.1, xmax = 1.0, wcs_transform, islog = 0, % if non-zero, is a log axis. if < 0 format tics as non-log major_tics, minor_tics, maxtics, %tic_label_format, tic_labels, tic_labels_dX, % from tic tic_label_format, tic_label_strings, tic_labels_font_struct = xfig_make_font (), tic_label_objects, tic_labels_tweak, % from tic tic_labels_just, % justification for tic labels and axis_label max_tic_h=0.0, max_tic_w=0.0, % max width and height of tic label bbox geom, % geometric parameters line, major_tic_marks, minor_tic_marks, minor_tic_len = 0.15, major_tic_len = 0.25, major_tic_color = "black", minor_tic_color = "black", major_tic_linestyle = 0, minor_tic_linestyle = 0, major_tic_thickness = 1, minor_tic_thickness = 1, axis_color = "black", axis_linestyle = 0, axis_thickness = 1, axis_label, axis_label_rotated = 0, draw_line=1, draw_major_tics=1, draw_minor_tics=1, draw_tic_labels=1, inited = 0, needs_setup = 1, axis_depth = DEFAULT_FRAME_DEPTH, tic_depth = DEFAULT_TIC_DEPTH, }; private variable XFig_Plot_Legend_Type = struct { X, width, names, objects }; private variable XFig_Plot_Data_Type = struct { X, plot_width, plot_height, % plot window, does not include labels x1axis, y1axis, x2axis, y2axis, % Plot_Axis_Type world1_inited = 0, world2_inited = 0, line_color, line_style, thickness, point_color, point_size, object_list, title_object, num_plots = 0, % methods title, line_depth, point_depth, axis_depth, image_depth, legend }; %}}} %{{{ Coordinate transforms: linear, log, etc private variable WCS_Transforms = Assoc_Type[]; private define setup_axis_wcs (axis, wcs_type) { if (0 == assoc_key_exists (WCS_Transforms, wcs_type)) { vmessage ("*** Warning: axis transform %s not supported. Using linear"); wcs_type = "linear"; } axis.islog = (wcs_type == "log"); axis.wcs_transform = WCS_Transforms[wcs_type]; } define xfig_plot_add_transform (name, world_to_normalized, normalized_to_world) { variable s = struct { world_to_normalized, normalized_to_world, }; s.world_to_normalized = world_to_normalized; s.normalized_to_world = normalized_to_world; WCS_Transforms[name] = s; } private define linear_world_to_normalized (x, xmin, xmax) { return (x-xmin)/(xmax-xmin); } private define linear_normalized_to_world (t, xmin, xmax) { return xmin + t * (xmax - xmin); } xfig_plot_add_transform ("linear", &linear_world_to_normalized, &linear_normalized_to_world); private define check_xmin_xmax_for_log (xmin, xmax) { variable tweaked = 0; if (xmax <= 0.0) { xmax = 1.0; tweaked++; } if (xmin <= 0.0) { tweaked++; xmin = 0.1*xmax; } if (xmin == 0.0) { xmax = 1.0; xmin = 0.1; } if (tweaked) () = fprintf (stderr, "*** Warning: Invalid world coordinates for log axis\n"); return xmin, xmax; } private define log_world_to_normalized (x, xmin, xmax) { (xmin, xmax) = check_xmin_xmax_for_log (xmin, xmax); variable i = where (x <= 0.0); if (length (i)) { if (typeof (x) == Array_Type) { x = @x; x[i] = 0.1*xmin; x[where(x == 0.0)] = xmin; } else if (x == 0.0) x = xmin; else x = 0.1*xmin; } return linear_world_to_normalized (log10(x), log10(xmin), log10(xmax)); } private define log_normalized_to_world (t, xmin, xmax) { variable x = linear_normalized_to_world (t, log10(xmin), log10(xmax)); return 10.0^x; } xfig_plot_add_transform ("log", &log_world_to_normalized, &log_normalized_to_world); private define resid_mapping (x, n) { variable y = Double_Type[length(x)]; variable i = where (x >= 1); y[i] = 2.0 - 1.0/(x[i]^n); i = where (x < 1.0); y[i] = x[i]^n; if (typeof (x) != Array_Type) y = y[0]; return y; } private define resid_world_to_normalized (x, xmin, xmax) { variable n = 4.0; x = resid_mapping (x, n); xmin = resid_mapping (xmin, n); xmax = resid_mapping (xmax, n); return linear_world_to_normalized (x, xmin, xmax); } private define resid_normalized_to_world (t, xmin, xmax) { xmin = resid_mapping (xmin); xmax = resid_mapping (xmax); variable x = linear_normalized_to_world (t, xmin, xmax); % FIXME return x; } xfig_plot_add_transform ("resid", &resid_world_to_normalized, &resid_normalized_to_world); %}}} private define compute_major_tics (xmin, xmax, maxtics, tic_intervals) %{{{ { variable diff = xmax - xmin; variable multiplier = 1.0; variable factor = 10.0; variable last_diff; variable max_diff = tic_intervals[-1]*maxtics; while (diff <= max_diff) { multiplier *= factor; last_diff = diff; diff *= factor; if (last_diff == diff) return [xmin,xmax], 0; } while (diff > max_diff) { multiplier *= 1.0/factor; last_diff = diff; diff *= 1.0/factor; if (last_diff == diff) return [xmin,xmax], 0; } variable tic_interval; variable nth_chosen = 0; foreach (tic_intervals) { tic_interval = (); if (diff/tic_interval <= maxtics) break; nth_chosen++; } tic_interval /= multiplier; variable nmin = xmin / tic_interval; if (abs(nmin) > 0x7FFFFFFF) return [xmin,xmax]; nmin = int(nmin); if (xmin < 0) nmin--; variable nmax = xmax/tic_interval; if (abs(nmin) > 0x7FFFFFFE) return [xmin,xmax]; nmax = int(nmax); if (xmax > 0) nmax++; tic_intervals = [nmin:nmax]*tic_interval; return tic_intervals, nth_chosen; } %}}} private define get_major_tics (xmin, xmax, islog, maxtics) %{{{ { variable tic_intervals = [1.0,2.0,5.0]; % 1, 1.2,1.4,1.6,1.8, 2 % 2, 3.0, 4 % 5, 6.0,7.0,8.0,9.0, 10, ... variable num_minor = [4, 1, 4]; variable ti, n; if (islog) { xmin = log10(xmin); xmax = log10(xmax); if (xmin < 0) xmin -= 1.0; xmin = int(xmin); if (xmax > 0) xmax += 1.0; xmax = int(xmax); num_minor = [0:5]; tic_intervals = num_minor+1.0; if ((xmax - xmin + 1) <= maxtics) { num_minor = 0; tic_intervals = [1.0]; } } (ti, n) = compute_major_tics (xmin, xmax, maxtics, tic_intervals); if (islog) { % For a log axis, only integer valued major tics are meaningful ti = ti[where (feqs (ti, int(ti)))]; } return ti, num_minor[n]; } %}}} private define make_tic_objects (axis, tics, X, xmin, xmax, dX, dY, ticlen) %{{{ { xmin = double(xmin); xmax = double(xmax); variable den = (xmax - xmin); variable list = xfig_new_polyline_list (); variable world_to_normalized = axis.wcs_transform.world_to_normalized; dY = vector_mul (ticlen, dY); variable Xmax = vector_sum (X, dX); _for (0, length(tics)-1, 1) { variable i = (); variable x = tics[i]; x = (@world_to_normalized)(double (x), xmin, xmax); variable X0 = vector_sum (X, vector_mul(x, dX)); variable X1 = vector_sum (X0, dY); list.insert (vector ([X0.x, X1.x], [X0.y, X1.y], [X0.z, X1.z])); } return list; } %}}} private define make_tic_marks (axis) %{{{ { if (axis == NULL) return; variable X = axis.X, dX = axis.dX, dY = axis.dY; variable xmin = axis.xmin; variable xmax = axis.xmax; variable islog = axis.islog; variable X1 = vector_sum (X, dX); if (axis.draw_line) { variable line = xfig_new_polyline (vector ([X.x, X1.x],[X.y,X1.y],[X.z,X1.z])); line.set_pen_color (axis.axis_color); line.set_line_style (axis.axis_linestyle); line.set_thickness (axis.axis_thickness); line.set_depth (axis.axis_depth); axis.line = line; } axis.minor_tic_marks = NULL; axis.major_tic_marks = NULL; variable ticlen; variable tics; tics = axis.major_tics; if ((tics != NULL) && axis.draw_major_tics) { tics = make_tic_objects (axis, tics, X, xmin, xmax, dX, dY, axis.major_tic_len); tics.set_pen_color (axis.major_tic_color); tics.set_line_style (axis.major_tic_linestyle); tics.set_thickness (axis.major_tic_thickness); tics.set_depth (axis.tic_depth); axis.major_tic_marks = tics; } tics = axis.minor_tics; if ((tics != NULL) && (axis.draw_minor_tics)) { tics = make_tic_objects (axis, tics, X, xmin, xmax, dX, dY, axis.minor_tic_len); tics.set_pen_color (axis.minor_tic_color); tics.set_line_style (axis.minor_tic_linestyle); tics.set_thickness (axis.minor_tic_thickness); tics.set_depth (axis.tic_depth); axis.minor_tic_marks = tics; } } private define format_labels_using_scientific_notation (tics) { variable log10_tics = log10 (abs(tics)); % x = a*10^b ==> log10(x) = log10(a) + b; % = log10(10a) + (b-1) variable b = int (log10_tics); variable a = log10_tics - b; variable j = where (a < 0.0); a[j] += 1; b[j] -= 1; a = nint(10^a); j = where (a == 10); a[j] = 1; b[j] += 1; a[where(tics<0)] *= -1; return array_map (String_Type, &sprintf, "$\bm%g{\times}10^{%d}$"R, a, b); } private define construct_tic_label_strings (axis, tics) %{{{ { variable format = axis.tic_label_format; variable fixed_format = (format != NULL); variable i, j, alt_fmt = NULL; variable tic_labels; variable a, b; if (axis.islog > 0) { if (format == NULL) { format = "\\bf 10$\\bm^{%g}$"; alt_fmt = "\\bf %.5g"; } variable log10_tics = log10 (tics); variable frac, whole; variable is_frac = fneqs (log10_tics, nint(log10_tics)); frac = where (is_frac, &whole); tic_labels = String_Type[length(tics)]; tic_labels[whole] = array_map (String_Type, &sprintf, format, log10_tics[whole]); variable is_small = (0.01 <= tics < 99999.5); ifnot (fixed_format) { if (all(is_small)) tic_labels = array_map (String_Type, &sprintf, alt_fmt, tics); else { i = where (is_small and not is_frac); tic_labels[i] = array_map (String_Type, &sprintf, alt_fmt, tics[i]); if ((length(whole) <= 1) && any(is_frac)) { i = where (is_small and is_frac); tic_labels[i] = array_map (String_Type, &sprintf, alt_fmt, tics[i]); i = where (is_frac and (not is_small)); tic_labels[i] = format_labels_using_scientific_notation (tics[i]); } } } } else { if (format == NULL) format = "\\bf %.5g"; tic_labels = array_map (String_Type, &sprintf, format, tics); ifnot (fixed_format) { variable abs_tics = abs(tics); % 1.5e-4 = 0.00015 % = 1.5*10-4 % > 0.00001 i = where (((abs_tics > 0) and (abs_tics < 1e-4)) or (abs_tics >= 99999.5)); if (length(i)) tic_labels[i] = format_labels_using_scientific_notation (tics[i]); } } return tic_labels; } %}}} private define position_tic_label_objects (axis, tic_pos, tic_label_objects) { ifnot (axis.draw_tic_labels) return; variable X = axis.X, dX = axis.dX; variable xmin = double(axis.xmin); variable xmax = double(axis.xmax); variable world_to_normalized = axis.wcs_transform.world_to_normalized; variable Xmax = vector_sum (X, dX); _for (0, length(tic_label_objects)-1, 1) { variable i = (); variable x = tic_pos[i]; x = (@world_to_normalized)(double (x), xmin, xmax); variable X0 = vector_sum (X, vector_mul(x, dX)); xfig_justify_object (tic_label_objects[i], X0 + axis.tic_labels_tweak, axis.tic_labels_just); if (dX.y != 0) { % y tic variable y0, y1, dy = 0; (,,y0,y1,,) = tic_label_objects[i].get_bbox(); if (y1 > Xmax.y) dy = Xmax.y - y1; if (y0 < X.y) dy = X.y - y0; if (dy != 0) tic_label_objects[i].translate (vector (0,dy,0)); } } % Convert the tic labels to a compound object for ease of manipulation variable compound = xfig_new_compound_list (); foreach (axis.tic_label_objects) { variable label = (); compound.insert(label); } axis.tic_label_objects = compound; } private define make_tic_label_objects (axis, tic_labels_just, tweakx, tweaky) %{{{ { variable major_tics = axis.major_tics; variable tics = major_tics; variable max_tic_h = 0, max_tic_w = 0; variable num_tics = length (tics); if ((tics == NULL) || (num_tics == 0) || (axis.draw_tic_labels == 0)) { axis.tic_label_objects = NULL; return; } if (axis.islog && (1 <= num_tics <= 2)) { variable major_tic = major_tics[0]; variable new_tics = [major_tic/5.0,major_tic/2.0, major_tic*2.0,major_tic*5.0]; if (num_tics == 2) { major_tic = major_tics[1]; new_tics = [new_tics, major_tic*2,major_tic*5]; } new_tics = new_tics[where (axis.xmin <= new_tics <= axis.xmax)]; tics = [tics, new_tics]; } variable tic_label_strings = construct_tic_label_strings (axis, tics); variable i = wherenot (_isnull (tic_label_strings)); tic_label_strings = tic_label_strings[i]; tics = tics[i]; variable tic_label_objects = array_map (Struct_Type, &xfig_new_text, tic_label_strings, axis.tic_labels_font_struct); variable tic_labels_dX = Struct_Type[length(tic_label_objects)]; foreach (tic_label_objects) { variable obj = (); variable w, h; (w,h) = obj.get_pict_bbox (); if (max_tic_w < w) max_tic_w = w; if (max_tic_h < h) max_tic_h = h; } axis.max_tic_h = max_tic_h + 2*abs(tweaky); axis.max_tic_w = max_tic_w + 2*abs(tweakx); axis.tic_labels_tweak = vector (tweakx, tweaky, 0); axis.tic_labels_just = tic_labels_just; axis.tic_label_objects = tic_label_objects; axis.tic_label_strings = tic_label_strings; position_tic_label_objects (axis, tics, tic_label_objects); } %}}} private define make_major_minor_tic_positions (axis, major_tics, minor_tics) %{{{ { variable xmin = axis.xmin; variable xmax = axis.xmax; if (xmax < xmin) (xmin, xmax) = (xmax, xmin); if (major_tics != NULL) { axis.major_tics = major_tics[where ((major_tics >= xmin) and (major_tics <= xmax))]; if (minor_tics != NULL) minor_tics = minor_tics[where ((minor_tics >= xmin) and (minor_tics <= xmax))]; axis.minor_tics = minor_tics; return; } variable islog = axis.islog; variable num_minor, num_major; if (islog) { (xmin, xmax) = check_xmin_xmax_for_log (xmin, xmax); } (major_tics, num_minor) = get_major_tics (xmin, xmax, islog, axis.maxtics); if (islog) { num_major = length (where (log10(xmin) <= major_tics <= log10(xmax))); #ifnfalse if ((num_major < 1) %&& (0.001 <= xmin <= xmax <= 100.0) ) { % 0 or 1 major tic. Format as non-log (linear) variable maxtics = (2*axis.maxtics)/3; (major_tics, num_minor) = get_major_tics (xmin, xmax, 0, maxtics); axis.islog = -1; islog = 0; } #endif } variable major_tic_interval = major_tics[1] - major_tics[0]; variable minor_tic_interval; variable j = [1:num_minor]; variable i = j-1; if (islog && (num_minor == 0)) { num_minor = 8; i = [0:num_minor-1]; j = log10 ([2:9]); % log10([2:9]) minor_tic_interval = 1.0; } else minor_tic_interval = major_tic_interval/(num_minor+1.0); minor_tics = Double_Type[num_minor*length(major_tics)]; foreach (major_tics) { variable major_tic = (); minor_tics[i] = major_tic + j*minor_tic_interval; i += num_minor; } if (islog) { minor_tics = 10.0^minor_tics; major_tics = 10.0^major_tics; } axis.major_tics = major_tics[where ((major_tics >= xmin) and (major_tics <= xmax))]; axis.minor_tics = minor_tics[where ((minor_tics >= xmin) and (minor_tics <= xmax))]; } %}}} private define setup_axis_tics (p, axis) %{{{ { variable geom = axis.geom; make_tic_label_objects (axis, axis.tic_labels_just, geom.tic_tweak_x, geom.tic_tweak_y); %make_tic_marks_and_tic_labels (axis); make_tic_marks (axis); } %}}} % Usage: xfig_plot_set_*_tics (win, major_tics [,tic_labels,[minor_tics]]) % If tic_labels is NULL or not present then they will be generated. % If tic_labels is "", then none will be generated. private define pop_set_tic_args (fun, nargs) %{{{ { variable win, major_tics, tic_labels = NULL, minor_tics = NULL; switch (nargs) { case 4: (tic_labels,minor_tics) = (); } { case 3: tic_labels = (); } { if (_NARGS != 2) usage ("%s (win, major_tics [,major_tic_labels [,minor_tics]])", fun); } (win, major_tics) = (); return win, major_tics, tic_labels, minor_tics; } %}}} #iffalse private define set_xx_axis_tics (axis_name, fun, nargs) %{{{ { variable obj, major_tics, tic_labels, minor_tics; (obj, major_tics, tic_labels, minor_tics) = pop_set_tic_args (fun, nargs); variable axis = get_struct_field (obj, axis_name); variable want_tic_labels = (tic_labels != NULL); if (typeof (tic_labels) == String_Type) { want_tic_labels = (tic_labels != ""); !if (want_tic_labels) tic_labels = NULL; } variable xmin = axis.xmin, xmax = axis.xmax; variable i; if (major_tics != NULL) { i = where ((major_tics >= xmin) and (major_tics <= xmax)); major_tics = major_tics[i]; if (typeof (tic_labels) == Array_Type) tic_labels = tic_labels[i]; } if (minor_tics != NULL) minor_tics = minor_tics[where ((minor_tics >= xmin) and (minor_tics <= xmax))]; axis.tic_labels = tic_labels; axis.major_tics = major_tics; axis.minor_tics = minor_tics; setup_axis_tics (obj, axis); } %}}} define xfig_plot_set_x1_tics () { set_xx_axis_tics ("x1axis", _function_name, _NARGS); } define xfig_plot_set_x2_tics () { set_xx_axis_tics ("x2axis", _function_name, _NARGS); } define xfig_plot_set_y1_tics () { set_xx_axis_tics ("y1axis", _function_name, _NARGS); } define xfig_plot_set_y2_tics () { set_xx_axis_tics ("y2axis", _function_name, _NARGS); } define xfig_plot_set_x_tics () { variable win, major_tics, tic_labels, minor_tics; (win, major_tics, tic_labels, minor_tics) = pop_set_tic_args (_function_name, _NARGS); xfig_plot_set_x1_tics (win, major_tics, tic_labels, minor_tics); xfig_plot_set_x2_tics (win, major_tics, "", minor_tics); } define xfig_plot_set_y_tics () { variable win, major_tics, tic_labels, minor_tics; (win, major_tics, tic_labels, minor_tics) = pop_set_tic_args (_function_name, _NARGS); xfig_plot_set_y1_tics (win, major_tics, tic_labels, minor_tics); xfig_plot_set_y2_tics (win, major_tics, "", minor_tics); } #endif private define position_axis_label (axis) { variable label = axis.axis_label; if (label == NULL) return; variable geom = axis.geom; variable theta = geom.theta; % This routine may have already been called if the label was added % before the axis. ifnot (axis.axis_label_rotated) { if (theta != 0) label.rotate_pict (theta); axis.axis_label_rotated = 1; } variable X = 0.5 * (2*axis.X + axis.dX); X += vector (geom.tx*axis.max_tic_w, geom.ty*axis.max_tic_h, 0); xfig_justify_object (axis.axis_label, X, axis.tic_labels_just); } private define add_axis_label (p, axis, label) { if (label == NULL) return; axis.axis_label = xfig_new_text (label ;; __qualifiers); position_axis_label (axis); } private define add_axis (p, axis, wcs_type, major_tics, minor_tics) %{{{ { setup_axis_wcs (axis, wcs_type); make_major_minor_tic_positions (axis, major_tics, minor_tics); setup_axis_tics (p, axis); position_axis_label (axis); axis.needs_setup = 0; } %}}} private define render_tics_for_axis (axis, fp) %{{{ { if (axis == NULL) return; if (axis.line != NULL) axis.line.render (fp); if (axis.major_tic_marks != NULL) axis.major_tic_marks.render (fp); if (axis.tic_label_objects != NULL) axis.tic_label_objects.render (fp); if (axis.minor_tic_marks != NULL) axis.minor_tic_marks.render (fp); if (axis.axis_label != NULL) axis.axis_label.render (fp); %xfig_render_object (axis.axis_label, fp); } %}}} private define render_plot_axes (p, fp) %{{{ { variable axis; variable w = p.plot_width; variable h = p.plot_height; variable tic, ticlen; variable dX, dY, xmin, xmax; axis = p.x1axis; render_tics_for_axis (axis, fp); axis = p.y1axis; render_tics_for_axis (axis, fp); axis = p.x2axis; render_tics_for_axis (axis, fp); axis = p.y2axis; render_tics_for_axis (axis, fp); } %}}} private define translate_axis (axis, X) %{{{ { axis.X = vector_sum (axis.X, X); if (axis.line != NULL) axis.line.translate(X); if (axis.major_tic_marks != NULL) axis.major_tic_marks.translate(X); if (axis.minor_tic_marks != NULL) axis.minor_tic_marks.translate(X); if (axis.tic_label_objects != NULL) axis.tic_label_objects.translate(X); if (axis.axis_label != NULL) axis.axis_label.translate(X); } %}}} private define plot_translate (p, X) %{{{ { p = p.plot_data; p.X = vector_sum (p.X, X); translate_axis (p.x1axis, X); translate_axis (p.x2axis, X); translate_axis (p.y1axis, X); translate_axis (p.y2axis, X); p.object_list.translate(X); if (p.title_object != NULL) p.title_object.translate(X); } private define rotate_axis (axis, normal, theta) { axis.X = vector_rotate (axis.X, normal, theta); axis.line.rotate(normal, theta); axis.major_tic_marks.rotate(normal, theta); axis.minor_tic_marks.rotate(normal, theta); axis.tic_label_objects.rotate(normal, theta); axis.axis_label.rotate(normal, theta); } %}}} private define plot_rotate (p, normal, theta) %{{{ { p.X = vector_rotate (p.X, normal, theta); rotate_axis (p.x1axis, normal, theta); rotate_axis (p.x2axis, normal, theta); rotate_axis (p.y1axis, normal, theta); rotate_axis (p.y2axis, normal, theta); p.object_list.rotate(normal, theta); if (p.title_object != NULL) p.title_object.rotate(normal, theta); } %}}} private define plot_scale (p, sx, sy, sz) %{{{ { variable X = p.X; X.x *= sx; X.y *= sy; X.z *= sz; } %}}} private define plot_set_attr (p, attr, val) { } private define get_axis_bbox (axis) { variable x0, x1, y0, y1, z0, z1; (x0, x1, y0, y1, z0, z1) = xfig_new_compound (axis.line, axis.tic_label_objects, axis.axis_label).get_bbox (); variable X0 = axis.X, X1 = X0+axis.dX; variable x = [X0.x, X1.x]; variable y = [X0.y, X1.y]; variable z = [X0.z, X1.z]; return min([x,x0]), max([x,x1]), min([y,y0]), max([y,y1]), min([z,z0]), max([z,z1]); } private define plot_get_bbox (p) %{{{ { if (0) vmessage ("Warning: plot bounding box not fully supported"); p = p.plot_data; variable xmin, xmax, ymin, ymax, zmin, zmax; variable x0, x1, y0, y1, z0, z1; (xmin, xmax, ymin, ymax, zmin, zmax) = get_axis_bbox (p.x1axis); foreach ([p.x2axis, p.y1axis, p.y2axis]) { variable axis = (); (x0, x1, y0, y1, z0, z1) = get_axis_bbox (axis); if (x0 < xmin) xmin = x0; if (x1 > xmax) xmax = x1; if (y0 < ymin) ymin = y0; if (y1 > ymax) ymax = y1; if (z0 < zmin) zmin = z0; if (z1 > zmax) zmax = z1; } foreach (p.object_list) { variable obj = (); (x0, x1, y0, y1, z0, z1) = obj.get_bbox (); if (x0 < xmin) xmin = x0; if (x1 > xmax) xmax = x1; if (y0 < ymin) ymin = y0; if (y1 > ymax) ymax = y1; if (z0 < zmin) zmin = z0; if (z1 > zmax) zmax = z1; } obj = p.title_object; if (obj != NULL) { (x0, x1, y0, y1, z0, z1) = obj.get_bbox (); if (x0 < xmin) xmin = x0; if (x1 > xmax) xmax = x1; if (y0 < ymin) ymin = y0; if (y1 > ymax) ymax = y1; if (z0 < zmin) zmin = z0; if (z1 > zmax) zmax = z1; } return xmin, xmax, ymin, ymax, zmin, zmax; } %}}} private define plot_render (p, fp) %{{{ { p = p.plot_data; %variable plot_width = p.plot_width; %variable plot_height= p.plot_height; p.object_list.render (fp); if (p.title_object != NULL) p.title_object.render (fp); % It looks better when the axes are rendered after the plot object render_plot_axes (p, fp); } %}}} private variable X1_Axis_Geom = struct { ticofs_x = 0.0, ticofs_y = 0.5, tic_tweak_x = 0.0, tic_tweak_y = -0.1, tx = 0.0, ty = -1.0, theta = 0.0 }; private variable X2_Axis_Geom = struct { ticofs_x = 0.0, ticofs_y = -0.5, tic_tweak_x = 0.0, tic_tweak_y = 0.1, tx = 0.1, ty = 1.0, theta = 0.0 }; private variable Y1_Axis_Geom = struct { ticofs_x = 0.5, ticofs_y = 0.0, tic_tweak_x = -0.1, tic_tweak_y = 0.0, tx = -1.0, ty = 0.0, theta = 90.0 }; private variable Y2_Axis_Geom = struct { ticofs_x = -0.5, ticofs_y = 0.0, tic_tweak_x = 0.1, tic_tweak_y = 0.0, tx = 1.0, ty = 0.0, theta = -90.0 }; private define allocate_axis_type (len, maxtics, has_tic_labels, xpos, ypos, dirx, diry, ticdirx, ticdiry, geom) %{{{ { variable a = @Plot_Axis_Type; setup_axis_wcs (a, "linear"); a.maxtics = maxtics; a.X = vector (xpos, ypos, 0); a.dX = vector (dirx*len, diry*len, 0); a.dY = vector (ticdirx, ticdiry,0); a.geom = geom; a.tic_labels_just = vector (geom.ticofs_x, geom.ticofs_y, 0); a.draw_tic_labels = has_tic_labels; return a; } %}}} private define get_log_qualifier (name) { if (0 == qualifier_exists (name)) return 0; variable q = qualifier (name); if (q == NULL) return 1; return q; } private define get_log_qualifiers () { return (get_log_qualifier ("xlog" ;; __qualifiers) || get_log_qualifier ("logx" ;; __qualifiers) || qualifier_exists ("loglog") , get_log_qualifier ("ylog" ;; __qualifiers) || get_log_qualifier ("logy" ;; __qualifiers) || qualifier_exists ("loglog")); } private define do_axis_method (name, grid_axis) { variable p; switch (_NARGS-2) { case 1: p = (); } { _pop_n (_NARGS-2); usage (".axis ( [;qualifiers] )\n", + "Qualifiers:\n", + " off, on, color=val, line=val, major=array, minor=array,\n" + " width=val, depth=val, ticlabels=0|1, maxtics=val\n" + "wcs=val, lin, log\n" ); } p = p.plot_data; variable axis = get_struct_field (p, name); variable q = not qualifier_exists("off"); if (qualifier_exists("on")) q = 1; axis.draw_major_tics = q; axis.draw_line = q; axis.draw_minor_tics = q; axis.draw_tic_labels = q; variable minor_tics = NULL; q = qualifier ("minor"); if (typeof (q) == Int_Type) axis.draw_minor_tics = q; else minor_tics = q; variable major_tics = NULL; q = qualifier ("major"); if (typeof (q) == Int_Type) axis.draw_major_tics = q; else major_tics = q; q = qualifier ("color"); if (q != NULL) { axis.axis_color = q; axis.major_tic_color = q; axis.minor_tic_color = q; } axis.major_tic_color = qualifier ("major_color", axis.major_tic_color); axis.minor_tic_color = qualifier ("minor_color", axis.major_tic_color); q = qualifier ("width"); if (q != NULL) { axis.axis_thickness = q; axis.major_tic_thickness = q; axis.minor_tic_thickness = q; } axis.minor_tic_thickness = qualifier ("minor_width", axis.minor_tic_thickness); axis.major_tic_thickness = qualifier ("major_width", axis.major_tic_thickness); q = qualifier ("line"); if (q != NULL) { axis.axis_linestyle = q; axis.major_tic_linestyle = q; axis.minor_tic_linestyle = q; } if (grid_axis) { axis.major_tic_linestyle = qualifier ("major_line", axis.major_tic_linestyle); axis.minor_tic_linestyle = qualifier ("minor_line", axis.minor_tic_linestyle); } axis.major_tic_len = qualifier ("major_len", axis.major_tic_len); axis.minor_tic_len = qualifier ("minor_len", axis.minor_tic_len); axis.axis_depth = qualifier ("depth", axis.axis_depth); axis.tic_depth = qualifier ("tic_depth", axis.tic_depth); axis.maxtics = qualifier ("maxtics", axis.maxtics); variable f = axis.tic_labels_font_struct; f.style = qualifier ("ticlabel_style", f.style); f.color = qualifier ("ticlabel_color", f.color); f.size = qualifier ("ticlabel_size", f.size); % .islog already has a default value. Don't muck with it unless % requested. if (qualifier_exists ("linear")) axis.islog = 0; if (qualifier_exists ("log")) axis.islog = get_log_qualifier ("log";;__qualifiers); % FIXME: Allow ticlabels to be an array of strings q = qualifier ("ticlabels"); if (typeof (q) == Int_Type) axis.draw_tic_labels = q; if (axis.draw_major_tics == 0) axis.draw_tic_labels = 0; if (grid_axis) { variable len = p.plot_height; if (grid_axis == 2) len = p.plot_width; q = qualifier ("grid"); if (q == 1) { axis.major_tic_len = len; axis.minor_tic_len = len; } q = qualifier ("major_grid", qualifier("majorgrid")); if (q == 1) axis.major_tic_len = len; q = qualifier ("minor_grid", qualifier("minorgrid")); if (q == 1) axis.minor_tic_len = len; } variable wcs = qualifier ("wcs"); if (wcs == NULL) { wcs = "linear"; if (axis.islog) wcs = "log"; } axis.inited = 1; add_axis (p, axis, wcs, major_tics, minor_tics); } private define xaxis_method () { variable args = __pop_args (_NARGS); do_axis_method (__push_args (args), "x1axis", 1 ;; __qualifiers); do_axis_method (__push_args (args), "x2axis", 0 ;; __qualifiers); } private define yaxis_method () { variable args = __pop_args (_NARGS); do_axis_method (__push_args (args), "y1axis", 2 ;; __qualifiers); do_axis_method (__push_args (args), "y2axis", 0 ;; __qualifiers); } private define x1axis_method () { variable args = __pop_args (_NARGS); do_axis_method (__push_args (args), "x1axis", 1 ;; __qualifiers); } private define x2axis_method () { variable args = __pop_args (_NARGS); do_axis_method (__push_args (args), "x2axis", 1 ;; __qualifiers); } private define y1axis_method () { variable args = __pop_args (_NARGS); do_axis_method (__push_args (args), "y1axis", 2 ;; __qualifiers); } private define y2axis_method () { variable args = __pop_args (_NARGS); do_axis_method (__push_args (args), "y2axis", 2 ;; __qualifiers); } private define axis_method () { variable args = __pop_args (_NARGS); xaxis_method (__push_args (args);; __qualifiers); yaxis_method (__push_args (args);; __qualifiers); } private define get_world_min_max (x0, x1, islog, pad) %{{{ { if (isnan (x0) or isnan (x1) or isinf (x0) or isinf (x1)) { () = fprintf (stderr, "xfig_plot_define_world: Axis limits must be finite.\n"); return 0.1, 1.0; } if (x0 == x1) { x0 = 0.5*x0; x1 = 2.0*x0; if (x0 == x1) { () = fprintf (stderr, "xfig_plot_define_world: invalid world limits"); x0 = 0.0; x1 = 1.0; } } if (islog) (x0, x1) = check_xmin_xmax_for_log (x0, x1); if (pad == 0.0) return x0, x1; variable save_x0 = x0; variable save_x1 = x1; if (islog) { x0 = log10 (x0); x1 = log10 (x1); } variable dx = pad*(x1 - x0); x0 -= dx; x1 += dx; if (islog) { x0 = 10^x0; x1 = 10^x1; if (x0 == 0) x0 = save_x0; if (isinf(x1)) x1 = save_x1; } return x0, x1; } %}}} private define do_world_method (nth, nargs) %{{{ { variable xdata, ydata; variable w, x0, x1, y0, y1; variable pad = 0.0; switch (nargs) { case 3: (w, xdata, ydata) = (); x0 = NULL; pad = 0.05; } { case 5: (w, x0, x1, y0, y1) = (); } { usage (".world ([x0, x1], [y0, y1] ; xlog, ylog, loglog)"); } variable p = w.plot_data; variable xaxis = get_struct_field (p, "x${nth}axis"$); variable yaxis = get_struct_field (p, "y${nth}axis"$); variable xlog, ylog; (xlog, ylog) = get_log_qualifiers (;;__qualifiers); xlog = xlog or xaxis.islog; ylog = ylog or yaxis.islog; if (x0 == NULL) { if (xlog) xdata = xdata[where (xdata>0)]; if (ylog) ydata = ydata[where (ydata>0)]; (x0, x1) = (min(xdata), max(xdata)); (y0, y1) = (min(ydata), max(ydata)); } (x0, x1) = get_world_min_max (x0, x1, xlog, qualifier ("padx", pad)); (y0, y1) = get_world_min_max (y0, y1, ylog, qualifier ("pady", pad)); xaxis.xmin = double(x0); xaxis.xmax = double(x1); xaxis.islog = xlog; yaxis.xmin = double(y0); yaxis.xmax = double(y1); yaxis.islog = ylog; yaxis.needs_setup = 1; xaxis.needs_setup = 1; set_struct_field (p, "world${nth}_inited"$, 1); } %}}} private define world1_method () %{{{ { return do_world_method (1, _NARGS ;; __qualifiers); } %}}} % This function is not to be called implictly. Use do_world_method % instead. private define world2_method () %{{{ { variable w, args; args = __pop_args (_NARGS-1); w = (); w.plot_data.x2axis.draw_tic_labels = 1; w.plot_data.y2axis.draw_tic_labels = 1; return do_world_method (w, __push_args(args), 2, _NARGS ;; __qualifiers); } %}}} private define world_method () %{{{ { variable args = __pop_args (_NARGS); do_world_method (__push_args (args), 1, _NARGS ;; __qualifiers); do_world_method (__push_args (args), 2, _NARGS ;; __qualifiers); } %}}} private define get_world_axes (p) { variable world = qualifier ("world"); variable x_axes = [NULL, p.x1axis, p.x2axis]; variable y_axes = [NULL, p.y1axis, p.y2axis]; variable a = 0; loop (3) { variable b = 0; loop (3) { if (qualifier_exists ("world${a}${b}"$)) return x_axes[a], y_axes[b]; b++; } if (qualifier_exists ("world${a}"$)) return x_axes[a], y_axes[a]; a++; } return p.x1axis, p.y1axis; } private define scale_coords_for_axis (axis, axis_len, x) { if (axis == NULL) { % device coordinate, x runs from 0 to 1 return double(x*axis_len); } variable x0 = axis.xmin, x1 = axis.xmax; return axis_len * (@axis.wcs_transform.world_to_normalized) (double(x), x0, x1); } private define make_nsided_polygon (n, x0, y0, radius) { variable theta = [0:n]*(2*PI/n); theta = [theta, 0]; variable x = x0 + radius * cos (theta); variable y = y0 + radius * sin (theta); return x, y; } private define plot_lines (p, x, y) { p = p.plot_data; variable ax, ay; (ax, ay) = get_world_axes (p ;; __qualifiers); variable w = p.plot_width, h = p.plot_height; if (length (x) < 2) return; x = scale_coords_for_axis (ax, w, x); y = scale_coords_for_axis (ay, h, y); variable bad = Int_Type [length(x)+1]; bad[-1] = 1; variable i = where (isnan (x) or isnan (y)); bad[i] = 1; variable depth = qualifier ("depth", p.line_depth); variable thickness = qualifier ("width", p.thickness); variable color = qualifier ("color", p.line_color); variable linestyle = qualifier ("line", p.line_style); variable i0 = 0; variable list = xfig_new_polyline_list (); foreach (where (bad)) { i = (); if (i != i0) { variable ii = [i0:i-1]; variable lines = xfig_clip_polyline2d (x[ii], y[ii], 0, w, 0, h); lines.translate (p.X); lines.set_depth (depth); lines.set_thickness (thickness); lines.set_pen_color (color); lines.set_line_style (linestyle); p.object_list.insert(lines); } i0 = i+1; } } private define pop_plot_err_parms (nargs) { variable p, x, y, dy, term_factor = 1; if (nargs == 5) term_factor = (); (p, x, y, dy) = (); variable i = where (not (isnan(x) or isnan(y) or isnan (dy))); if (length (i) != length (x)) { x = x[i]; y = y[i]; if (typeof(dy) == Array_Type) dy = dy[i]; else if (isnan (dy)) dy = dy[i]; } return p.plot_data, x, y, dy, term_factor; } private define insert_errbar_list (p, lines) { variable depth = qualifier ("depth", p.line_depth); variable width = qualifier ("width", p.thickness); variable color = qualifier ("color", p.line_color); variable style = qualifier ("eb_line", p.line_style); color = qualifier ("eb_color", color); width = qualifier ("eb_width", width); lines.translate(p.X); lines.set_depth(depth); lines.set_thickness (width); lines.set_pen_color (color); lines.set_line_style (style); p.object_list.insert(lines); } private define plot_erry () { variable p, x, y, dy, term_factor; (p, x, y, dy, term_factor) = pop_plot_err_parms (_NARGS); variable ax, ay; (ax, ay) = get_world_axes (p ;; __qualifiers); variable w = p.plot_width, h = p.plot_height; x = scale_coords_for_axis (ax, w, x); variable y0 = scale_coords_for_axis (ay, h, y-dy); variable y1 = scale_coords_for_axis (ay, h, y+dy); variable dt = abs (ERRBAR_TERMINAL_SIZE * term_factor); variable dz = [0.0,0.0]; variable lines = xfig_new_polyline_list (); variable i; _for i (0, length (x)-1, 1) { variable x_i = x[i]; variable x0_i = x_i - dt; variable x1_i = x_i + dt; variable y0_i = y0[i]; variable y1_i = y1[i]; if (x1_i <= 0) continue; if (x0_i >= w) continue; if (y0_i >= h) continue; if (y1_i <= 0) continue; x0_i = _max (x0_i, 0); x1_i = _min (x1_i, w); variable obj; variable dx = [x0_i, x1_i]; if (y1_i < h) { if (term_factor) lines.insert (vector (dx, [y1_i, y1_i], dz)); } else y1_i = h; if (y0_i > 0) { if (term_factor) lines.insert (vector (dx, [y0_i, y0_i], dz)); } else y0_i = 0; lines.insert (vector ([x_i, x_i], [y0_i,y1_i], dz)); } insert_errbar_list (p, lines ;; __qualifiers); } private define plot_errx () { variable p, x, y, dx, term_factor; (p, x, y, dx, term_factor) = pop_plot_err_parms (_NARGS); variable ax, ay; (ax, ay) = get_world_axes (p ;; __qualifiers); variable w = p.plot_width, h = p.plot_height; y = scale_coords_for_axis (ay, h, y); variable x0 = scale_coords_for_axis (ax, w, x-dx); variable x1 = scale_coords_for_axis (ax, w, x+dx); variable dt = abs (ERRBAR_TERMINAL_SIZE * term_factor); variable dz = [0.0,0.0]; variable lines = xfig_new_polyline_list (); variable i; _for i (0, length (x)-1, 1) { variable y_i = y[i]; variable y0_i = y_i - dt; variable y1_i = y_i + dt; variable x0_i = x0[i]; variable x1_i = x1[i]; if (x1_i <= 0) continue; if (x0_i >= w) continue; if (y0_i >= h) continue; if (y1_i <= 0) continue; y0_i = _max (y0_i, 0); y1_i = _min (y1_i, h); variable obj; variable dy = [y0_i, y1_i]; if (x1_i < w) { if (term_factor) lines.insert (vector ([x1_i, x1_i], dy, dz)); } else x1_i = w; if (x0_i > 0) { if (term_factor) lines.insert (vector ([x0_i, x0_i], dy, dz)); } else x0_i = 0; lines.insert (vector ([x0_i, x1_i], [y_i,y_i], dz)); } insert_errbar_list (p, lines ;; __qualifiers); } %{{{ Routines that define and create the plot symbols private variable Make_Symbol_Funs = {}; %!%+ %\function{xfig_plot_add_symbol} %\synopsis{Add a plot symbol} %\usage{xfig_plot_add_symbol (String_Type name, Ref_Type funct)} %\description % This function may be used to add a new plot symbol of the specified name. % The \exmp{funct} parameter specifies a function to be called to create the % symbol. It will be called with a single parameter: a value representing the % scale size of the symbol in fig units. The function must return two arrays % representing the X and Y coordinates of the polygons that represent % the symbol. The center of the object is taken to be (0,0). If more than one % polygon is required to represent the object, an array of arrays may be % returned. %!%- define xfig_plot_add_symbol (name, fun) { list_append (Make_Symbol_Funs, struct{name=name, fun=fun}); } define xfig_plot_get_symbol_names () { variable num = length (Make_Symbol_Funs); variable names = String_Type[num]; _for (0, num-1, 1) { variable i = (); names[i] = Make_Symbol_Funs[i].name; } return names; } private define find_symbol (symp) { variable sym = @symp; variable s; if (typeof (sym) != String_Type) { s = Make_Symbol_Funs[sym mod length(Make_Symbol_Funs)]; @symp = s.name; return s.fun; } foreach s (Make_Symbol_Funs) { if (s.name == sym) return s.fun; } return NULL; } private define make_circle (radius) { variable point_size = xfig_scale_to_inches (radius) * 80.0; variable nsides; if (point_size == 0) nsides = 1; else if (point_size < 16) nsides = 4 + (point_size-1)*2; else nsides = 32; return make_nsided_polygon (nsides, 0, 0, radius); } private define make_point (radius) { return make_circle (radius/6.0); } xfig_plot_add_symbol ("point", &make_point); private define make_triangle_up (radius) { variable t = [-30, 90, 210, -30] * (PI/180.0); return radius * cos (t), radius * sin(t); } xfig_plot_add_symbol ("triangle", &make_triangle_up); private define make_square (radius) { variable t = [-45, 45, 135, 225, -45] * (PI/180.0); return radius * cos (t), radius * sin(t); } xfig_plot_add_symbol ("square", &make_square); private define make_diamond (radius) { variable t = [0, 90, 180, 270, 0] * (PI/180.0); return 0.5*radius * cos (t), radius * sin(t); } xfig_plot_add_symbol ("diamond", &make_diamond); private define make_plus (radius) { variable x = Array_Type[2]; variable y = Array_Type[2]; x[0] = [-radius, radius]; y[0] = [0,0]; x[1] = [0, 0]; y[1] = [-radius, radius]; return x,y; } xfig_plot_add_symbol ("+", &make_plus); private define make_cross (radius) { variable x = Array_Type[2]; variable y = Array_Type[2]; radius *= sqrt(0.5); x[0] = [-radius, radius]; y[0] = [-radius, radius]; x[1] = [-radius, radius]; y[1] = [radius, -radius]; return x,y; } xfig_plot_add_symbol ("x", &make_cross); private define make_asterisk (radius) { variable x = Array_Type[3]; variable y = Array_Type[3]; variable r1 = radius * cos (PI/3); variable r2 = radius * cos (PI/6); x[0] = [-radius, radius]; y[0] = [0,0]; x[1] = [-r1, r1]; y[1] = [-r2, r2]; x[2] = [-r1, r1]; y[2] = [r2, -r2]; return x,y; } xfig_plot_add_symbol ("*", &make_asterisk); xfig_plot_add_symbol ("circle", &make_circle); private define make_triangle_down (radius) { variable t = [30, 150, 270, 30] * (PI/180.0); return radius * cos (t), radius * sin(t); } xfig_plot_add_symbol ("triangle1", &make_triangle_down); private define make_triangle_left (radius) { variable t = [60, 180, 300, 60] * (PI/180.0); return radius * cos (t), radius * sin(t); } xfig_plot_add_symbol ("triangle2", &make_triangle_left); private define make_triangle_right (radius) { variable t = [0, 120, 240, 0] * (PI/180.0); return radius * cos (t), radius * sin(t); } xfig_plot_add_symbol ("triangle3", &make_triangle_right); private define make_arrow_internal (size, a, b, c) { variable xs = Array_Type[2]; variable ys = Array_Type[2]; xs[0] = [0, 0]; ys[0] = [0,b]*size; xs[1] = [0, a, -a, 0]*size; ys[1] = [c, b, b, c]*size; return xs, ys; } private define make_darrow (size) { return make_arrow_internal (size, 0.3, -1.4, -2); } private define make_uarrow (size) { return make_arrow_internal (size, 0.3, 1.4, 2); } private define make_larrow (size) { return exch (make_arrow_internal (size, 0.3, -1.4, -2)); } private define make_rarrow (size) { return exch (make_arrow_internal (size, 0.3, 1.4, 2)); } xfig_plot_add_symbol ("darr", &make_darrow); xfig_plot_add_symbol ("uarr", &make_uarrow); xfig_plot_add_symbol ("larr", &make_larrow); xfig_plot_add_symbol ("rarr", &make_rarrow); private define make_star (size) { variable thetas = PI/10.0*(1+2*[0:10]); variable y0 = sin(thetas[0]); variable small_r = hypot (y0, y0*tan(thetas[2]-thetas[1])); variable xs = cos(thetas), ys = sin(thetas); xs[[1::2]] *= small_r; ys[[1::2]] *= small_r; return size*xs, size*ys; } xfig_plot_add_symbol ("star", &make_star); %}}} private define plot_symbols (p, x, y) %{{{ { p = p.plot_data; variable ax, ay; (ax, ay) = get_world_axes (p ;; __qualifiers); variable bad = Int_Type [length(x)+1]; bad[-1] = 1; variable w = p.plot_width, h = p.plot_height; x = scale_coords_for_axis (ax, w, x); y = scale_coords_for_axis (ay, h, y); variable point_size = qualifier ("size", p.point_size); variable symbol = qualifier ("sym", "point"); variable fun = find_symbol (&symbol); if (fun == NULL) { () = fprintf (stderr, "***Warning: symbol %s does not exist-- using point\n", symbol); symbol = "point"; fun = &make_point; } point_size *= 10; if (point_size == 0) point_size++; variable radius = xfig_scale_from_inches (0.5*point_size/80.0); variable color = qualifier ("color", p.point_color); color = qualifier ("symcolor", color); variable fill_color = qualifier ("fillcolor", color); variable depth = qualifier ("depth", p.point_depth); depth = qualifier ("symdepth", depth); variable area_fill = qualifier ("fill", -1); variable size = qualifier ("width", p.thickness); size = qualifier ("symwidth",size); variable linestyle = qualifier ("symlinestyle", p.line_style); variable list = xfig_new_polyline_list (); variable x0 = p.X.x; variable y0 = p.X.y; variable z0 = p.X.z; variable sym_xs, sym_ys; (sym_xs, sym_ys) = (@fun)(radius); variable is_array = (_typeof(sym_xs) == Array_Type); foreach (where (bad == 0)) { variable i = (); variable lines; if (is_array) { _for (0, length (sym_xs)-1, 1) { variable j = (); variable xx_j = sym_xs[j]; variable yy_j = sym_ys[j]; xx_j += x[i]; yy_j += y[i]; (xx_j, yy_j) = _xfig_clip_polygon2d (__tmp(xx_j), __tmp(yy_j), 0, w, 0, h); if (length(xx_j) == 0) continue; list.insert (vector(xx_j+x0,yy_j+y0,0*xx_j+z0)); } continue; } variable xx = sym_xs + x[i]; variable yy = sym_ys + y[i]; (xx, yy) = _xfig_clip_polygon2d (__tmp(xx), __tmp(yy), 0, w, 0, h); if (length (xx) == 0) continue; list.insert (vector(xx+x0,yy+y0,0*xx+z0)); } list.set_pen_color (color); list.set_fill_color (fill_color); list.set_line_style (linestyle); list.set_area_fill (area_fill); list.set_thickness (size); list.set_depth(depth); p.object_list.insert(list); } %}}} define plot_points (p, x, y) %{{{ { p = p.plot_data; variable ax, ay; (ax, ay) = get_world_axes (p ;; __qualifiers); variable w = p.plot_width, h = p.plot_height; variable bad = isnan (x) or isnan(y); x = scale_coords_for_axis (ax, w, x); y = scale_coords_for_axis (ay, h, y); variable nsides; variable point_size = p.point_size; if (point_size == 0) nsides = 1; else if (point_size < 16) nsides = 4 + (point_size-1)*2; else nsides = 32; variable radius = xfig_scale_from_inches (0.5*point_size/80.0); variable points = xfig_new_polygon_list (); variable count = 0; foreach (where (bad == 0)) { variable i = (); variable xx, yy; (xx,yy) = make_nsided_polygon (nsides, x[i], y[i], radius); (xx, yy) = _xfig_clip_polygon2d (xx, yy, 0, w, 0, h); if (length (xx) == 0) continue; variable point = xfig_new_polygon (vector (xx, yy, 0*xx)); point.set_fill_color (p.point_color); point.set_pen_color (p.point_color); point.set_area_fill (20); point.set_depth (p.point_depth); point.translate (p.X); points.insert (point); count++; } if (count) p.object_list.insert (points); } %}}} private define check_axis (p, axis, init_fun, ticlabels, has_log_qualifier) { ifnot (axis.inited) { if (has_log_qualifier) (@init_fun)(p; log, ticlabels=axis.draw_tic_labels); else (@init_fun)(p; ticlabels=axis.draw_tic_labels); return; } if (has_log_qualifier && (axis.islog == 0)) add_axis (p.plot_data, axis, "log", NULL, NULL); } private define initialize_plot (p, x, y) { variable d = p.plot_data; d.num_plots++; if (d.num_plots > 1) return; variable x1axis = d.x1axis; variable x2axis = d.x2axis; variable y1axis = d.y1axis; variable y2axis = d.y2axis; variable logx, logy; (logx, logy) = get_log_qualifiers (;;__qualifiers); variable xmin = NULL, xmax = NULL; if ((x != NULL) && (y != NULL)) { if (not d.world1_inited || (logx && ((x1axis.xmin <= 0) || (x1axis.xmax <= 0))) || (logy && ((y1axis.xmin <= 0) || (y1axis.xmax <= 0)))) do_world_method (p, x, y, 1, 3;; __qualifiers); if (not d.world2_inited || (logx && ((x2axis.xmin <= 0) || (x2axis.xmax <= 0))) || (logy && ((y2axis.xmin <= 0) || (y2axis.xmax <= 0)))) do_world_method (p, x, y, 2, 3;; __qualifiers); } check_axis (p, d.x1axis, &x1axis_method, 1, logx); check_axis (p, d.x2axis, &x2axis_method, 0, logx); check_axis (p, d.y1axis, &y1axis_method, 1, logy); check_axis (p, d.y2axis, &y2axis_method, 0, logy); } private define plot_method () %{{{ { variable x, y, dx = NULL, dy = NULL, p; switch (_NARGS) { case 2: y = (); x = [1:length(y)]; } { case 3: (x,y) = (); } { case 4: (x,y,dy) = (); } { case 5: (x,y,dx,dy) = (); } { _pop_n (_NARGS); usage (".plot (x [, y [, dy | dx, dy]] ; qualifiers\n" + "Common qualifiers:\n" + " color=val, line=val, width=val, sym=val, symcolor=val\n" ); } p = (); initialize_plot (p, x, y ;;__qualifiers); % If a symbol is specified, then do not draw lines unless line is % also specified. variable line = qualifier ("line"); variable sym = qualifier ("sym"); if ((line != NULL) || (sym == NULL)) { plot_lines (p, x, y ;; __qualifiers); } if (sym != NULL) { plot_symbols (p, x, y ;; __qualifiers); } if (dx != NULL) { plot_errx (p, x, y, dx ;; __qualifiers); } if (dy != NULL) { plot_erry (p, x, y, dy ;; __qualifiers); } } %}}} % Usage: xfig_plot_histogram (w, x, y [,fill_color, area_fill]) define xfig_plot_histogram (w, xpts, ypts) { variable len = length(xpts); variable len2 = 2 + 2*len; variable x = Double_Type[len2]; variable y = Double_Type[len2]; variable i; y[0] = 0; x[[0:len2-3:2]] = xpts; x[[1:len2-2:2]] = xpts; y[[1:len2-3:2]] = ypts; y[[2:len2-2:2]] = ypts; x[-1] = xpts[-1] + (xpts[-1]-xpts[-2]); x[-2] = x[-1]; y[where (isnan (y))] = 0.0; #iffalse y[-1] = ypts[-1]; #else y[-1] = 0; #endif initialize_plot (w, x, y ;;__qualifiers); plot_lines (w, x, y ;; __qualifiers); } define xfig_plot_shaded_histogram (p, x, y) { initialize_plot (p, x, y ;;__qualifiers); p = p.plot_data; variable ax, ay; (ax, ay) = get_world_axes (p ;; __qualifiers); variable w = p.plot_width, h = p.plot_height; x = scale_coords_for_axis (ax, w, x); y = scale_coords_for_axis (ay, h, y); variable depth = qualifier ("depth", p.line_depth); variable thickness = qualifier ("width", p.thickness); variable color = qualifier ("color", p.line_color); variable linestyle = qualifier ("line", p.line_style); variable area_fill = qualifier ("fill", 20); variable fillcolor = qualifier ("fillcolor", color); variable y0 = scale_coords_for_axis (ay, h, 0.0); if (y0 < 0.0) y0 = 0.0; x = @x; variable i0 = wherelast (x <= 0); if (i0 == NULL) i0 = 0; variable i1 = wherefirst (x >= w); if (i1 == NULL) i1 = length(x); variable i = [i0:i1]; %variable i = where ((x>= 0) and (x <= w)); x = x[i]; y = y[i]; x[where(x<0)] = 0; x[where(x>w)] = w; y[where(isnan(y))] = y0; y[where (y < y0)] = y0; y[where (y > h)] = h; variable list = xfig_new_polyline_list (); _for (0, length (x)-2, 1) { i = (); variable x0 = x[i]; variable x1 = x[i+1]; variable y1 = y[i]; list.insert (vector([x0, x0, x1, x1], [y0,y1,y1,y0], [0.0,0.0,0.0,0.0])); } list.translate (p.X); list.set_depth (p.line_depth+1); list.set_pen_color (color); list.set_line_style (linestyle); list.set_fill_color (fillcolor); list.set_area_fill (area_fill); p.object_list.insert (list); } private define hplot_method () %{{{ { variable x, y, dy = NULL, p; switch (_NARGS) { case 2: y = (); x = [1:length(y)]; } { case 3: (x,y) = (); } { case 4: (x,y,dy) = (); } { _pop_n (_NARGS); usage (".hplot (x [, y [, dy ]] ; qualifiers\n" + "Common qualifiers:\n" + " color=val, line=val, width=val\n" ); } p = (); if (NULL != qualifier ("fill")) xfig_plot_shaded_histogram (p, x, y;; __qualifiers); else xfig_plot_histogram (p, x, y;; __qualifiers); if (dy != NULL) { plot_erry (p, x, y, dy ;; __qualifiers); } } %}}} define xfig_plot_set_line_color (p, color) { p.plot_data.line_color = color; } define xfig_plot_set_line_style (p, style) { p.plot_data.line_style = style; } define xfig_plot_set_line_thickness (p, thickness) { p.plot_data.thickness = thickness; } define xfig_plot_set_line_depth (p, depth) { p.plot_data.line_depth = depth; } define xfig_plot_set_axis_depth (p, depth) { p.plot_data.axis_depth = depth; } define xfig_plot_set_point_depth (p, depth) { p.plot_data.point_depth = depth; } define xfig_plot_inc_line_depth (p, depth) { p.plot_data.line_depth += depth; } define xfig_plot_inc_axis_depth (p, depth) { p.plot_data.axis_depth += depth; } define xfig_plot_inc_point_depth (p, depth) { p.plot_data.point_depth += depth; } define xfig_plot_get_line_depth (p) { return p.plot_data.line_depth; } define xfig_plot_get_axis_depth (p) { return p.plot_data.axis_depth; } define xfig_plot_get_point_depth (p) { return p.plot_data.point_depth; } define xfig_plot_inc_image_depth (p, depth) { p.plot_data.image_depth += depth; } define xfig_plot_get_image_depth (p) { return p.plot_data.image_depth; } define xfig_plot_set_image_depth (p, depth) { p.plot_data.image_depth = depth; } define xfig_plot_set_point_size (p, point_size) { if (point_size < 0) point_size = 0; p.plot_data.point_size = point_size; } define xfig_plot_set_point_color (p, color) { p.plot_data.point_color = color; } %!%+ %\function{xfig_plot_add_object} %\synopsis{Add an object to a plot at a world coordinate position} %\usage{xfig_plot_add_object (plot_win, obj [,x,y [,dx,dy]])} %\description % This function may be used to add an object to a plot window at a specified % world coordinate. The \exmp{dx} and \exmp{dy} arguments control the % justification of the object. The values of these parameters are offsets % relative to the size of the object, and as such ordinarily have values % in the interval \exmp{[-0.5,0.5]}. For example, \exmp{0,0} will center % the object on \exmp{(x,y)}, and \exmp{(-0.5,-0.5)} will move the lower left % corner of the object to the specified coordinate. %\seealso{xfig_plot_define_world1} %!%- private define add_object_method () { variable p, obj, x=NULL, y=NULL, dx=0, dy=0; switch (_NARGS) { case 6: (x,y,dx,dy) = (); } { case 4: (x,y) = (); } { if (_NARGS != 2) usage ("%s(plot_win, obj [x, y [, dx, dy]])", _function_name); } (p, obj) = (); p = p.plot_data; if ((x != NULL) and (y != NULL)) { variable ax, ay; (ax, ay) = get_world_axes (p ;; __qualifiers); x = scale_coords_for_axis (ax, p.plot_width, x); y = scale_coords_for_axis (ay, p.plot_height, y); xfig_justify_object (obj, p.X + vector (x,y,0), vector(dx, dy, 0)); } p.object_list.insert(obj); } %!%+ %\function{xfig_plot_text} %\synopsis{Add text to the plot} %\usage{xfig_plot_text (w, text, x, y [,dx, dy])} %#v+ % w: plot object % x, y: world coordinates % dx, dy: justification %#v- %\description % This function creates a text object at the specified location on the plot. % By default, the text will be centered on the specified world coordinates. % The justification parameters \exmp{dx} and \exmp{dy} may be used to specify % the justifcation of the text. See the documentation for \sfun{xfig_plot_add_object} % for more information. %\example %#v+ % xfig_plot_text (w, "$cos(\omega t)$"R, 3.2, 6.0, -0.5, 0); %#v- % will left justify the text at the position (3.2,6.0). %\seealso{xfig_plot_add_object, xfig_new_text} %!%- define xfig_plot_text () { variable w, text, x, y, dx = 0, dy = 0; if (_NARGS == 6) (dx, dy) = (); else if (_NARGS != 4) usage ("%s (win, text, x, y [dx, dy])", _function_name); (w, text, x, y) = (); text = xfig_new_text (text); add_object_method (w, text, x, y, dx, dy ;; __qualifiers); } private define xlabel_method () { if (_NARGS != 2) { usage (".xlabel (label [; qualifiers])"); } variable p, label; (p, label) = (); p = p.plot_data; add_axis_label (p, p.x1axis, label ;; __qualifiers); } private define ylabel_method () { if (_NARGS != 2) { usage (".ylabel (label [; qualifiers])"); } variable p, label; (p, label) = (); p = p.plot_data; add_axis_label (p, p.y1axis, label ;; __qualifiers); } private define x2label_method () { if (_NARGS != 2) { usage (".x2label (label [; qualifiers])"); } variable w, p, label; (w, label) = (); p = w.plot_data; add_axis_label (p, p.x2axis, label ;; __qualifiers); % re-adjust the title position if (p.title_object != NULL) w.title (p.title_object); } private define y2label_method () { if (_NARGS != 2) { usage (".y2label (label [; qualifiers])"); } variable p, label; (p, label) = (); p = p.plot_data; add_axis_label (p, p.y2axis, label ;; __qualifiers); } %!%+ %\function{xfig_plot_title} %\synopsis{Add a title to a plot} %\usage{xfig_plot_title (w, title)} %!%- private define title_method (w, title) { variable x0, x1, y, z; variable p = w.plot_data; % remove the existing title p.title_object = NULL; (,,,y,,z) = w.get_bbox (); x0 = p.X.x; x1 = x0 + p.plot_width; if (typeof (title) == String_Type) title = xfig_new_text (title ;; __qualifiers); xfig_justify_object (title, vector(0.5*(x0+x1), y, z), vector(0,-1.0,0)); p.title_object = title; } private define add_pict_to_plot (w, png) { variable dx, dy; (dx, dy) = png.get_pict_bbox (); variable p = w.plot_data; variable width = p.plot_width; variable height = p.plot_height; png.scale_pict (width/dx, height/dy); png.center_pict (p.X + 0.5*vector (width,height,0), width, height); w.add_object (png); png.set_depth (p.image_depth); } %!%+ %\function{xfig_plot_png} %\synopsis{Add a png file to a plot, scaling it to the window} %\usage{xfig_plot_png (w, file)} %!%- define plot_png_method () { variable w, png; if (_NARGS != 2) usage (".plot_png (img)"); (w, png) = (); png = xfig_new_png (png); initialize_plot (w, NULL, NULL ;;__qualifiers); add_pict_to_plot (w, png); } private define shade_region_method () { variable p, w, xs, ys, xmin, xmax, ymin, ymax; switch (_NARGS) { case 3: (w, xs, ys) = (); } { case 5: (w, xmin, xmax, ymin, ymax) = (); xs = [xmin, xmax, xmax, xmin, xmin]; ys = [ymin, ymin, ymax, ymax, ymin]; } { usage ("Usage forms:\n" + " .shade_region (xs, ys; qualifiers);\n" + " .shade_region (xmin, ymin, xmax, ymax; qualifiers);\n" + "Qualifiers\n" + " world[012][012], fill=value, color=value, fillcolor=value"); } if (length (xs) < 3) return; initialize_plot (w, xs, ys ;;__qualifiers); p = w.plot_data; variable ax, ay; (ax, ay) = get_world_axes (p ;; __qualifiers); variable width = p.plot_width, height = p.plot_height; xs = scale_coords_for_axis (ax, width, xs); ys = scale_coords_for_axis (ay, height, ys); xs[where(xs>width)]=width; xs[where(xs<0)] = 0; ys[where(ys>height)]=height; ys[where(ys<0)] = 0; xs[where(isnan(xs))] = 0; ys[where(isnan(ys))] = 0; variable obj = xfig_new_polyline (vector (xs, ys, 0*xs)); obj.translate (p.X); obj.set_depth (qualifier ("depth", p.image_depth)); obj.set_thickness (qualifier ("width", p.thickness)); variable color = qualifier ("color", p.line_color); obj.set_pen_color (color); obj.set_line_style (qualifier ("line", p.line_style)); obj.set_area_fill(qualifier ("fill", 20)); obj.set_fill_color (qualifier ("fillcolor", color)); w.add_object (obj); } private variable XFig_Plot_Type = struct { plot_data, % Methods title = &title_method, add_object = &add_object_method, world = &world_method, world1 = &world1_method, world2 = &world2_method, plot = &plot_method, hplot = &hplot_method, xlabel = &xlabel_method, ylabel = &ylabel_method, x2label = &x2label_method, y2label = &y2label_method, x1axis = &x1axis_method, y1axis = &y1axis_method, x2axis = &x2axis_method, y2axis = &y2axis_method, xaxis = &xaxis_method, yaxis = &yaxis_method, axis = &axis_method, axes = &axis_method, plot_png = &plot_png_method, shade_region= &shade_region_method, }; %!%+ %\function{xfig_plot_new} %\synopsis{Create a new plot object} %\usage{w = xfig_plot_new ( [Int_Type width, Int_Type height] );} %\description % This function creates a new plot object of the specified width and height. % If the width and height parameters are not given, defaults will be used. % The width and height values specify the size of the plotting area and do not % include the space for tic marks and labels. %\example %#v+ % w = xfig_plot_new (); %#v- %\seealso{xfig_plot_define_world, xfig_render_object} %!%- define xfig_plot_new () { variable w, h; if (_NARGS == 0) (14, 10); (w, h) = (); variable p = @XFig_Plot_Data_Type; p.plot_width = w; p.plot_height = h; variable maxticsx = int(w*0.5 + 1.5); variable maxticsy = int(h+1.5); p.x1axis = allocate_axis_type (w, maxticsx, 1, (0,0), (1,0), (0,1), X1_Axis_Geom); p.y1axis = allocate_axis_type (h, maxticsy, 1, (0,0), (0,1), (1,0), Y1_Axis_Geom); p.x2axis = allocate_axis_type (w, maxticsx, 0, (0,h), (1,0), (0,-1), X2_Axis_Geom); p.y2axis = allocate_axis_type (h, maxticsy, 0, (w,0), (0,1), (-1,0), Y2_Axis_Geom); p.line_color = "black"; p.line_style = 0; p.thickness = 2; p.point_color = "black"; p.point_size = 1; p.line_depth = DEFAULT_LINE_DEPTH; p.point_depth = DEFAULT_POINT_DEPTH; p.axis_depth = DEFAULT_FRAME_DEPTH; p.image_depth = DEFAULT_IMAGE_DEPTH; p.X = vector(0,0,0); p.object_list = xfig_new_compound_list (); variable obj = xfig_new_object (@XFig_Plot_Type); obj.plot_data = p; obj.render_to_fp = &plot_render; obj.rotate = &plot_rotate; obj.translate = &plot_translate; obj.scale = &plot_scale; obj.get_bbox = &plot_get_bbox; obj.flags |= XFIG_RENDER_AS_COMPOUND; return obj; } %!%+ %\function{xfig_plot_new_png} %\synopsis{Create a new plot window for a png file} %\usage{w = xfig_plot_new_png (file)} %\description %\example %\notes %\seealso{} %!%- define xfig_plot_new_png (png) { png = xfig_new_png (png); variable dx, dy; (dx, dy) = png.get_pict_bbox (); variable w = xfig_plot_new (dx, dy); add_pict_to_plot (w, png); return w; } private define ones() { !if (_NARGS) return 1; variable a = __pop_args (_NARGS); return 1 + Int_Type[__push_args (a)]; } %!%+ %\function{xfig_meshgrid} %\synopsis{Produce grid points for an image} %\usage{(xx,yy) = xfig_meshgrid (xx, yy)} %\description % This function takes two 1-d vectors representing the orthogonal % grids for a rectangular region in the (x,y) plane and returns two % 2-d arrays corresponding to the (x,y) coordinates of each % intersecting grid point. % % Suppose that one wants to evaluate a % function \exmp{f(x,y)} at each point defined by the two grid % vectors. Simply calling \exmp{f(x,y)} using the grid vectors would % lead to either a type-mismatch error or produce a 1-d result. The % correct way to do this is to use the \sfun{xfig_meshgrid} function: %#v+ % result = f(xfig_meshgrid(x,y)); %#v- %!%- define xfig_meshgrid () { variable x,y; if (_NARGS != 2) usage ("(xx,yy)=xfig_meshgrid (x,y) ==> produces grid vectors for an image"); (x,y) = (); variable nx, ny, xx, yy, i; nx = length (x); ny = length (y); xx = x # ones(1,ny); yy = ones(nx) # transpose(y); return xx, yy; } % %------------------------------------------------------------------------ % define xfig_plot_add_object () { message ("xfig_plot_add_object is obsolete"); variable args = __pop_list (_NARGS); variable w = args[0]; (@w.add_object) (__push_list (args)); } define xfig_plot_title () { message ("xfig_plot_title is obsolete"); variable args = __pop_list (_NARGS); (@args[0].title) (__push_list (args)); } define xfig_plot_define_world () { message ("xfig_plot_define_world is obsolete"); variable args = __pop_list (_NARGS); (@args[0].world)(__push_list (args)); } slxfig-pre0.2.0-35/src/vector.sl0000644000175000000620000001045411210170554015210 0ustar johnstaff% This routine implements some 3-vector operations. % Copyright (c) 2004-2008 John E. Davis % You may distribute this file under the terms the GNU General Public % License. See the file COPYING for more information. % % Version 0.1.0 if (0 == is_defined ("Vector_Type")) typedef struct { x,y,z } Vector_Type; define vector (x,y,z) { variable v = @Vector_Type; if (__is_numeric (x) != 2) x = typecast (x, Double_Type); if (__is_numeric (y) != 2) y = typecast (y, Double_Type); if (__is_numeric (z) != 2) z = typecast (z, Double_Type); v.x = x; v.y = y; v.z = z; return v; } define dotprod (a,b) { return a.x*b.x + a.y*b.y + a.z*b.z; } define crossprod (a,b) { variable ax=a.x,ay=a.y,az=a.z,bx=b.x,by=b.y,bz=b.z; return vector (ay*bz-by*az, az*bx-bz*ax, ax*by-bx*ay); } define vector_sqr (v) { return dotprod (v,v); } define vector_norm (v) { return sqrt (v.x^2 + v.y^2 + v.z^2); %return sqrt (vector_sqr (v)); } define normalize_vector (v) { variable len = sqrt (v.x^2 + v.y^2 + v.z^2); v.x /= len; v.y /= len; v.z /= len; } define unit_vector (v) { v = @v; % ok if normalize_vector creates new fields normalize_vector (v); return v; } define vector_sum (a,b) { variable c = @Vector_Type; c.x = a.x+b.x; c.y = a.y+b.y; c.z = a.z+b.z; return c; } define vector_a_plus_bt (a, b, t) { variable c = @Vector_Type; c.x = a.x+t*b.x; c.y = a.y+t*b.y; c.z = a.z+t*b.z; return c; } define vector_diff (a,b) { variable c = @Vector_Type; c.x = a.x-b.x; c.y = a.y-b.y; c.z = a.z-b.z; return c; } define vector_mul (a, v) { variable c = @Vector_Type; c.x = a*v.x; c.y = a*v.y; c.z = a*v.z; return c; } private define vector_times_scalar (v, a) { return vector_mul (a, v); } private define vector_eqs (a, b) { return (a.x == b.x) and (a.y == b.y) and (a.z == b.z); } private define vector_neqs (a, b) { return not vector_eqs (a, b); } % returns X.x*e1 + X.y*e2 + X.z*e3 define vector_change_basis (X, e1, e2, e3) { return vector_sum (vector_mul (X.x, e1), vector_sum (vector_mul(X.y, e2), vector_mul(X.z, e3))); } % Rotate p about n by angle theta. define vector_rotate (p, n, theta) { variable pn = dotprod (p, n); variable c = cos (theta); return vector_sum (vector_mul (c,p), vector_sum (vector_mul (pn*(1.0-c),n), vector_mul (sin(theta), crossprod(n,p)))); } % Given an orthonormal basis x1_hat, y1_hat, and x1_hat cross y1_hat, % find a rotation axis and angle that will produce this basis define vector_get_transformation (x1_hat, x2_hat) { variable x3_hat = crossprod (x1_hat, x2_hat); variable a1, a2, a3; variable b1, b2, b3; variable c1, c2, c3; a1 = x1_hat.x; % m11 a2 = x2_hat.y; % m22 a3 = x3_hat.z; % m33 b1 = x2_hat.z; % m23 b2 = x3_hat.x; % m31 b3 = x1_hat.y; % m12 c1 = x3_hat.y; % m32 c2 = x1_hat.z; % m13 c3 = x2_hat.x; % m21 % Matrix is: % % [a1 b3 c2] % [c3 a2 b1] % [b2 c1 a3] % variable cos_theta = 0.5*(a1+a2+a3-1.0); variable sin_theta = sqrt (1.0 - cos_theta*cos_theta); if (sin_theta < 1e-12) return vector (0, 0, 1), 0.0; variable den = 2.0*sin_theta; return vector ((b1-c1)/den, (b2-c2)/den, (b3-c3)/den), asin(sin_theta); } define vector_chs (a) { variable v = @Vector_Type; v.x = -a.x; v.y = -a.y; v.z = -a.z; return v; } #ifexists __add_unary % Operator overloading __add_unary ("sqr", Double_Type, &vector_sqr, Vector_Type); __add_unary ("abs", Double_Type, &vector_norm, Vector_Type); __add_unary ("-", Vector_Type, &vector_chs, Vector_Type); __add_binary ("+", Vector_Type, &vector_sum, Vector_Type, Vector_Type); __add_binary ("-", Vector_Type, &vector_diff, Vector_Type, Vector_Type); __add_binary ("*", Double_Type, &dotprod, Vector_Type, Vector_Type); %__add_binary ("*", Vector_Type, &vector_mul, Array_Type, Vector_Type); __add_binary ("*", Vector_Type, &vector_mul, Any_Type, Vector_Type); __add_binary ("*", Vector_Type, &vector_times_scalar, Vector_Type, Any_Type); __add_binary ("^", Vector_Type, &crossprod, Vector_Type, Vector_Type); __add_binary ("==", Char_Type, &vector_eqs, Vector_Type, Vector_Type); __add_binary ("!=", Char_Type, &vector_neqs, Vector_Type, Vector_Type); #endif slxfig-pre0.2.0-35/src/Makefile.in0000644000175000000620000000760611076540262015427 0ustar johnstaff# -*- sh -*- #--------------------------------------------------------------------------- # List of modules and associated .sl files to install #--------------------------------------------------------------------------- MODULES = gcontour-module.so SL_FILES = gcontour.sl xfig.sl vector.sl XFIG_SL_FILES = xfig/*.sl MODULE_VERSION = `./mkversion.sh` #--------------------------------------------------------------------------- # Installation Directories #--------------------------------------------------------------------------- prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ MODULE_INSTALL_DIR = @MODULE_INSTALL_DIR@ SL_FILES_INSTALL_DIR = @SL_FILES_INSTALL_DIR@ #--------------------------------------------------------------------------- # C Compiler to create a shared library #--------------------------------------------------------------------------- CC_SHARED = @CC_SHARED@ #--------------------------------------------------------------------------- # Location of the S-Lang library and its include file #--------------------------------------------------------------------------- SLANG_INC = @SLANG_INC@ SLANG_LIB = @SLANG_LIB@ -lslang #--------------------------------------------------------------------------- # Additional Libraries required by the module #--------------------------------------------------------------------------- RPATH = @RPATH@ #--------------------------------------------------------------------------- # Misc Programs required for installation #--------------------------------------------------------------------------- INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSDIR = ../autoconf/mkinsdir.sh RM = rm -f LN = ln -s #--------------------------------------------------------------------------- # DESTDIR is designed to facilitate making packages. Normally it is empty #--------------------------------------------------------------------------- DESTDIR = DEST_MODULE_INSTALL_DIR = $(DESTDIR)$(MODULE_INSTALL_DIR) DEST_SL_FILES_INSTALL_DIR = $(DESTDIR)$(SL_FILES_INSTALL_DIR) #--------------------------------------------------------------------------- LIBS = $(SLANG_LIB) $(RPATH) $(DL_LIB) -lm INCS = $(SLANG_INC) all: $(MODULES) #--------------------------------------------------------------------------- # Put Rules to create the modules here #--------------------------------------------------------------------------- gcontour-module.so: gcontour-module.c $(CC_SHARED) $(INCS) gcontour-module.c -o gcontour-module.so $(LIBS) #--------------------------------------------------------------------------- # Regression tests #--------------------------------------------------------------------------- test: @for X in tests/test_*.sl; \ do \ slsh $$X; \ done #--------------------------------------------------------------------------- # Installation Rules #--------------------------------------------------------------------------- install_directories: $(MKINSDIR) $(DEST_MODULE_INSTALL_DIR) $(MKINSDIR) $(DEST_SL_FILES_INSTALL_DIR)/xfig install_modules: @for X in $(MODULES); \ do \ Y=$$X.$(MODULE_VERSION); \ YDEST=$(DEST_MODULE_INSTALL_DIR)/$$Y; \ echo $(INSTALL_DATA) $$X $$YDEST; \ $(INSTALL_DATA) $$X $$YDEST; \ if [ "$$?" != "0" ]; then \ exit 1; \ fi; \ $(RM) $(DEST_MODULE_INSTALL_DIR)/$$X; \ $(LN) $$Y $(DEST_MODULE_INSTALL_DIR)/$$X; \ done install_slfiles: @for X in $(SL_FILES); \ do \ echo $(INSTALL_DATA) $$X $(DEST_SL_FILES_INSTALL_DIR); \ $(INSTALL_DATA) $$X $(DEST_SL_FILES_INSTALL_DIR); \ if [ "$$?" != "0" ]; then \ exit 1; \ fi; \ done @for X in $(XFIG_SL_FILES); \ do \ echo $(INSTALL_DATA) $$X $(DEST_SL_FILES_INSTALL_DIR)/xfig/; \ $(INSTALL_DATA) $$X $(DEST_SL_FILES_INSTALL_DIR)/xfig/; \ if [ "$$?" != "0" ]; then \ exit 1; \ fi; \ done install: all install_directories install_modules install_slfiles clean: -/bin/rm -f $(MODULES) *~ \#* distclean: clean -/bin/rm -f config.h Makefile slxfig-pre0.2.0-35/src/config.hin0000644000175000000620000000042411076540262015316 0ustar johnstaff/* -*- c -*- */ /* Define this if have stdlib.h */ #undef HAVE_STDLIB_H /* Define this if you have unistd.h */ #undef HAVE_UNISTD_H /* Set these to the appropriate values */ #undef SIZEOF_SHORT #undef SIZEOF_INT #undef SIZEOF_LONG #undef SIZEOF_FLOAT #undef SIZEOF_DOUBLE slxfig-pre0.2.0-35/src/gcontour-module.c0000644000175000000620000005253511076540262016652 0ustar johnstaff/* Copyright (C) 2005, 2006, 2007 John E. Davis This file is part of SLxfig. SLxfig is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SLxfig is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include #include #include SLANG_MODULE(gcontour); #include "version.h" #define IS_NAN(x) isnan(x) typedef struct { int flag; int zlevel; float *xpts; float *ypts; unsigned int npts; unsigned int nmalloced; SLang_Name_Type *nt; SLang_Any_Type *client_data; } Contour_Type; static void free_contour_type (Contour_Type *ct) { if (ct == NULL) return; if (ct->xpts != NULL) SLfree ((char *) ct->xpts); if (ct->ypts != NULL) SLfree ((char *) ct->ypts); SLfree ((char *) ct); } static Contour_Type *alloc_contour_type (SLang_Name_Type *nt, SLang_Any_Type *cd) { unsigned int num; Contour_Type *ct = (Contour_Type *)SLcalloc (1, sizeof (Contour_Type)); if (ct == NULL) return NULL; num = 2048; if ((NULL == (ct->xpts = (float *)SLmalloc (num * sizeof (float)))) || (NULL == (ct->ypts = (float *)SLmalloc (num * sizeof (float))))) { free_contour_type (ct); return NULL; } ct->nmalloced = num; ct->npts = 0; ct->flag = 0; ct->nt = nt; ct->client_data = cd; return ct; } #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define ISIGN(a,b) (((b) < 0) ? (-a) : (a)) /* FILL THE FIRST N BITS OF BITMAP WITH ZEROES. */ static void fill0 (unsigned char *bitmap, unsigned int n) { unsigned int i; unsigned char ch; unsigned char mask; i = n / 8; memset ((char *) bitmap, 0, i); n = n % 8; if (n == 0) return; ch = bitmap[i]; mask = 1; for (i = 0; i < n; i++) { ch &= ~mask; mask = mask << 1; } bitmap[i] = ch; } /* PUT A ONE IN THE NTH BIT OF BITMAP */ static void mark1 (unsigned char *bitmap, unsigned int n) { unsigned int i = n/8; n = n % 8; bitmap[i] |= (1 << n); } /* IGET=0 IF THE NTH BIT OF BITMAP IS ZERO, ELSE IGET IS ONE. */ static int iget (unsigned char *bitmap, unsigned int n) { unsigned int i = n/8; n = n % 8; return bitmap[i] & (1 << n); } /* C C THIS SUBROUTINE DRAWS A CONTOUR THROUGH EQUAL VALUES OF AN ARRAY. C C ***** FORMAL ARGUMENTS *********************************** C C Z IS THE ARRAY FOR WHICH CONTOURS ARE TO BE DRAWN. THE ELEMENTS C OF Z ARE ASSUMED TO LIE UPON THE NODES OF A TOPOLOGICALLY C RECTANGULAR COORDINATE SYSTEM - E.G. CARTESIAN, POLAR (EXCEPT C THE ORIGIN), ETC. C C NRZ IS THE NUMBER OF ROWS DECLARED FOR Z IN THE CALLING PROGRAM. C C NX IS THE LIMIT FOR THE FIRST SUBSCRIPT OF Z. C C NY IS THE LIMIT FOR THE SECOND SUBSCRIPT OF Z. C C CV ARE THE VALUES OF THE CONTOURS TO BE DRAWN. C C NCV IS THE NUMBER OF CONTOUR VALUES IN CV. C C ZMAX IS THE MAXIMUM VALUE OF Z FOR CONSIDERATION. A VALUE OF C Z(I,J) GREATER THAN ZMAX IS A SIGNAL THAT THAT POINT AND THE C GRID LINE SEGMENTS RADIATING FROM THAT POINT TO IT'S NEIGHBORS C ARE TO BE EXCLUDED FROM CONTOURING. C C BITMAP IS A WORK AREA LARGE ENOUGH TO HOLD 2*NX*NY*NCV BITS. IT C IS ACCESSED BY LOW-LEVEL ROUTINES, WHICH ARE DESCRIBED BELOW. C LET J BE THE NUMBER OF USEFUL BITS IN EACH WORD OF BITMAP, C AS DETERMINED BY THE USER MACHINE AND IMPLEMENTATION OF C THE BITMAP MANIPULATION SUBPROGRAMS DESCRIBED BELOW. THEN C THE NUMBER OF WORDS REQUIRED FOR THE BITMAP IS THE FLOOR OF C (2*NX*NY*NCV+J-1)/J. C C DRAW IS A USER-PROVIDED SUBROUTINE USED TO DRAW CONTOURS. C THE CALLING SEQUENCE FOR DRAW IS: C C CALL DRAW (X,Y,IFLAG) C LET NX = INTEGER PART OF X, FX = FRACTIONAL PART OF X. C THEN X SHOULD BE INTERPRETED SUCH THAT INCREASES IN NX C CORRESPOND TO INCREASES IN THE FIRST SUBSCRIPT OF Z, AND C FX IS THE FRACTIONAL DISTANCE FROM THE ABSCISSA CORRESPONDING C TO NX TO THE ABSCISSA CORRESPONDING TO NX+1, C AND Y SHOULD BE INTERPRETED SIMILARLY FOR THE SECOND C SUBSCRIPT OF Z. C THE LOW-ORDER DIGIT OF IFLAG WILL HAVE ONE OF THE VALUES: C 1 - CONTINUE A CONTOUR, C 2 - START A CONTOUR AT A BOUNDARY, C 3 - START A CONTOUR NOT AT A BOUNDARY, C 4 - FINISH A CONTOUR AT A BOUNDARY, C 5 - FINISH A CLOSED CONTOUR (NOT AT A BOUNDARY). C NOTE THAT REQUESTS 1, 4 AND 5 ARE FOR PEN-DOWN C MOVES, AND THAT REQUESTS 2 AND 3 ARE FOR PEN-UP C MOVES. C 6 - SET X AND Y TO THE APPROXIMATE 'PEN' POSITION, USING C THE NOTATION DISCUSSED ABOVE. THIS CALL MAY BE C IGNORED, THE RESULT BEING THAT THE 'PEN' POSITION C IS TAKEN TO CORRESPOND TO Z(1,1). C IFLAG/10 IS THE CONTOUR NUMBER. C C ***** EXTERNAL SUBPROGRAMS ******************************* C C DRAW IS THE USER-SUPPLIED LINE DRAWING SUBPROGRAM DESCRIBED ABOVE. C DRAW MAY BE SENSITIVE TO THE HOST COMPUTER AND TO THE PLOT DEVICE. C FILL0 IS USED TO FILL A BITMAP WITH ZEROES. CALL FILL0 (BITMAP,N) C FILLS THE FIRST N BITS OF BITMAP WITH ZEROES. C MARK1 IS USED TO PLACE A 1 IN A SPECIFIC BIT OF THE BITMAP. C CALL MARK1 (BITMAP,N) PUTS A 1 IN THE NTH BIT OF THE BITMAP. C IGET IS USED TO DETERMINE THE SETTING OF A PARTICULAR BIT IN THE C BITMAP. I=IGET(BITMAP,N) SETS I TO ZERO IF THE NTH BIT OF THE C BITMAP IS ZERO, AND SETS I TO ONE IF THE NTH BIT IS ONE. C FILL0, MARK1 AND IGET ARE MACHINE SENSITIVE. C C ****************************************************************** C */ static int gcontr (VOID_STAR z, unsigned int nx, unsigned int ny, double (*to_double_fun)(VOID_STAR, unsigned int), double *cv, unsigned int ncv, double zmax, unsigned char *bitmap, int (*draw)(double, double, int, Contour_Type *), Contour_Type *ct) { int l1[4]; int l2[4]; int ij[2]; /* C L1 AND L2 CONTAIN LIMITS USED DURING THE SPIRAL SEARCH FOR THE C BEGINNING OF A CONTOUR. C IJ STORES SUBCRIPTS USED DURING THE SPIRAL SEARCH. */ int i1[2]; int i2[2]; int i3[6]; /* C C I1, I2 AND I3 ARE USED FOR SUBSCRIPT COMPUTATIONS DURING THE C EXAMINATION OF LINES FROM Z(I,J) TO IT'S NEIGHBORS. C */ double xint[4]; /* C C XINT IS USED TO MARK INTERSECTIONS OF THE CONTOUR UNDER C CONSIDERATION WITH THE EDGES OF THE CELL BEING EXAMINED. C */ double xy[2]; /* C C XY IS USED TO COMPUTE COORDINATES FOR THE DRAW SUBROUTINE. C */ double zz; int icur, jcur; /* 1 based */ int ibkey; int jump = 0; double cval, z1, z2; int l, iedge, icv; /* 0-based index */ int idir, nxidir; int k; /* 0-based indices */ int ix; int ii, jj; /* 1-based */ int iflag; #define I ij[0] #define J ij[1] #define X xy[0] #define Y xy[1] l1[0] = nx; l1[1] = ny; l1[2] = -1; l1[3] = -1; i1[0] = 1; i1[1] = 0; i2[0] = 1; i2[1] = -1; i3[0] = 1; i3[1] = 0; i3[2] = 0; i3[3] = 1; i3[4] = 1; i3[5] = 0; /* C C SET THE CURRENT PEN POSITION. THE DEFAULT POSITION CORRESPONDS C TO Z(1,1). C */ X = 1.0; Y = 1.0; if (-1 == (*draw) (X-1, Y-1, 6, ct)) return -1; icur = 1; jcur = 1; fill0 (bitmap, 2*nx*ny*ncv); /* C C SEARCH ALONG A RECTANGULAR SPIRAL PATH FOR A LINE SEGMENT HAVING C THE FOLLOWING PROPERTIES: C 1. THE END POINTS ARE NOT EXCLUDED, C 2. NO MARK HAS BEEN RECORDED FOR THE SEGMENT, C 3. THE VALUES OF Z AT THE ENDS OF THE SEGMENT ARE SUCH THAT C ONE Z IS LESS THAN THE CURRENT CONTOUR VALUE, AND THE C OTHER IS GREATER THAN OR EQUAL TO THE CURRENT CONTOUR C VALUE. C C SEARCH ALL BOUNDARIES FIRST, THEN SEARCH INTERIOR LINE SEGMENTS. C NOTE THAT THE INTERIOR LINE SEGMENTS NEAR EXCLUDED POINTS MAY BE C BOUNDARIES. C */ ibkey = 0; while (1) /* label 10 */ { I = icur; J = jcur; label_20: l2[0] = I; l2[1] = J; l2[2] = -I; l2[3] = -J; /* C DIRECTION ZERO IS +I, 1 IS +J, 2 IS -I, 3 IS -J. */ idir = 0; label_30: nxidir = idir + 1; k = idir; /* FORTRAN: k = nxidir; */ if (nxidir > 3) nxidir = 0; label_40: I = abs(I); J = abs(J); #define Z(i,j) ((*to_double_fun)(z, (i)*(ny) + (j))) zz = Z(I-1,J-1); if ((zz > zmax) || IS_NAN(zz)) goto label_140; /* label_50 */ for (l = 0; l < 2; l++) { /* C L=1 MEANS HORIZONTAL LINE, L=2 MEANS VERTICAL LINE. */ if (ij[l] >= l1[l]) continue; ii = I + i1[l]; jj = J + i1[1-l]; zz = Z(ii-1,jj-1); if ((zz > zmax) || IS_NAN(zz)) continue; jump = 100; /* C THE NEXT 15 STATEMENTS (OR SO) DETECT BOUNDARIES. */ label_60: ix = 1; if (ij[1-l] != 1) { ii = I - i1[1-l]; jj = J - i1[l]; if (Z(ii-1,jj-1) <= zmax) { ii = I + i2[l]; jj = J + i2[1-l]; if (Z(ii-1,jj-1) < zmax) ix = 0; } if (ij[1-l] >= l1[1-l]) goto label_90; } ii = I + i1[1-l]; jj = J + i1[l]; if (Z(ii-1, jj-1) <= zmax) { if (Z(I,J) < zmax) { if (jump == 100) goto label_100; goto label_280; } } label_90: ix += 2; if (jump != 100) goto label_280; label_100: if ((ix != 3) && (ix + ibkey != 0)) { /* C NOW DETERMINE WHETHER THE LINE SEGMENT IS CROSSED BY THE CONTOUR. */ unsigned int offset; ii = I + i1[l]; jj = J + i1[1-l]; z1 = Z(I-1,J-1); z2 = Z(ii-1, jj-1); offset = ncv*(2*(ny*(I-1) + (J-1)) + l); for (icv = 0; icv < (int)ncv; icv++) { if (0 == iget (bitmap, offset)) { if ((cv[icv] > MIN(z1, z2)) && (cv[icv] <= MAX(z1,z2))) goto label_190; /* uses icv */ mark1 (bitmap, offset); } offset++; } } } label_140: l = idir % 2; ij[l] = ISIGN(ij[l],l1[k]); /* C */ /* C LINES FROM Z(I,J) TO Z(I+1,J) AND Z(I,J+1) ARE NOT SATISFACTORY. */ /* C CONTINUE THE SPIRAL. */ /* C */ while (1) /* label_150 */ { if (ij[l] < l1[k]) { ij[l]++; if (ij[l] <= l2[k]) goto label_40; l2[k] = ij[l]; idir = nxidir; goto label_30; } if (idir == nxidir) break; nxidir++; ij[l] = l1[k]; k = nxidir-1; l = 1 - l; ij[l] = l2[k]; if (nxidir > 3) nxidir = 0; } if (ibkey != 0) return 0; /* ??? */ ibkey = 1; } /* goto label_10 */ /* C */ /* C AN ACCEPTABLE LINE SEGMENT HAS BEEN FOUND. */ /* C FOLLOW THE CONTOUR UNTIL IT EITHER HITS A BOUNDARY OR CLOSES. */ /* C */ label_190: iedge = l; cval = cv[icv]; if (ix != 1) iedge += 2; iflag = 2 + ibkey; xint[iedge] = (cval-z1)/(z2-z1); while (1) /* label_200 */ { unsigned int offset; int ni; int ks; /* 0 based */ xy[l] = ij[l] + xint[iedge]; xy[1-l] = ij[1-l]; offset = ncv*(2*(ny*(I-1) + (J-1)) + l)+icv; mark1 (bitmap, offset); if (-1 == (*draw)(X-1,Y-1,iflag + 10*icv, ct)) return -1; if (iflag >= 4) { icur = I; jcur = J; goto label_20; } /* C */ /* C CONTINUE A CONTOUR. THE EDGES ARE NUMBERED CLOCKWISE WITH */ /* C THE BOTTOM EDGE BEING EDGE NUMBER ONE. */ /* C */ ni = 1; if (iedge >= 2) { I = I - i3[iedge]; J = J - i3[iedge+2]; } for (k = 0; k < 4; k++) { if (k == iedge) continue; ii = I + i3[k]; jj = J + i3[k+1]; z1 = Z(ii-1,jj-1); ii = I + i3[k+1]; jj = J + i3[k+2]; z2 = Z(ii-1,jj-1); if (cval <= MIN(z1,z2)) continue; if (cval > MAX(z1,z2)) continue; if ((k == 0) || (k == 3)) { zz = z1; z1 = z2; z2 = zz; } xint[k] = (cval-z1)/(z2-z1); ni++; ks = k; } if (ni != 2) { /* C */ /* C THE CONTOUR CROSSES ALL FOUR EDGES OF THE CELL BEING EXAMINED. */ /* C CHOOSE THE LINES TOP-TO-LEFT AND BOTTOM-TO-RIGHT IF THE */ /* C INTERPOLATION POINT ON THE TOP EDGE IS LESS THAN THE INTERPOLATION */ /* C POINT ON THE BOTTOM EDGE. OTHERWISE, CHOOSE THE OTHER PAIR. THIS */ /* C METHOD PRODUCES THE SAME RESULTS IF THE AXES ARE REVERSED. THE */ /* C CONTOUR MAY CLOSE AT ANY EDGE, BUT MUST NOT CROSS ITSELF INSIDE */ /* C ANY CELL. */ /* C */ ks = (5 - iedge)-2; if (xint[2] >= xint[0]) { ks = 1 - iedge; if (ks < 0) ks += 4; } } /* C */ /* C DETERMINE WHETHER THE CONTOUR WILL CLOSE OR RUN INTO A BOUNDARY */ /* C AT EDGE KS OF THE CURRENT CELL. */ /* C */ l = ks; iflag = 1; jump = 280; if (ks >= 2) { I = I + i3[ks]; J = J + i3[ks+2]; l = ks - 2; } offset = ncv*(2*(ny*(I-1) + (J-1)) + l)+icv; if (iget (bitmap, offset) == 0) goto label_60; iflag = 5; goto label_290; label_280: if (ix != 0) iflag = 4; label_290: iedge = ks + 2; if (iedge > 3) iedge -= 4; xint[iedge] = xint[ks]; } } /* C 1 - CONTINUE A CONTOUR, C 2 - START A CONTOUR AT A BOUNDARY, C 3 - START A CONTOUR NOT AT A BOUNDARY, C 4 - FINISH A CONTOUR AT A BOUNDARY, C 5 - FINISH A CLOSED CONTOUR (NOT AT A BOUNDARY). C NOTE THAT REQUESTS 1, 4 AND 5 ARE FOR PEN-DOWN C MOVES, AND THAT REQUESTS 2 AND 3 ARE FOR PEN-UP C MOVES. C 6 - SET X AND Y TO THE APPROXIMATE 'PEN' POSITION, USING C THE NOTATION DISCUSSED ABOVE. THIS CALL MAY BE C IGNORED, THE RESULT BEING THAT THE 'PEN' POSITION C IS TAKEN TO CORRESPOND TO Z(1,1). */ static SLang_Array_Type *make_float_array (float *x, unsigned int npts) { SLindex_Type inpts = (SLindex_Type) npts; SLang_Array_Type *at; if (NULL == (at = SLang_create_array (SLANG_FLOAT_TYPE, 0, NULL, &inpts, 1))) return NULL; memcpy ((char *) at->data, (char *)x, npts * sizeof (float)); return at; } static int push_contour (Contour_Type *ct) { SLang_Array_Type *at_x, *at_y; int ret = 0; if (NULL == (at_x = make_float_array (ct->xpts, ct->npts))) return -1; if (NULL == (at_y = make_float_array (ct->ypts, ct->npts))) { SLang_free_array (at_x); return -1; } if ((-1 == SLang_start_arg_list ()) || (-1 == SLang_push_array (at_x, 0)) || (-1 == SLang_push_array (at_y, 0)) || (-1 == SLang_push_int (ct->zlevel)) || ((ct->client_data != NULL) && (-1 == SLang_push_anytype (ct->client_data))) || (-1 == SLang_end_arg_list ()) || (-1 == SLexecute_function (ct->nt))) ret = -1; SLang_free_array (at_y); SLang_free_array (at_x); return ret; } static int resize_contour (Contour_Type *ct) { unsigned int new_num = ct->npts + 512; float *tmp; if (NULL == (tmp = (float *)SLrealloc ((char *)ct->xpts, new_num*sizeof(float)))) return -1; ct->xpts = tmp; if (NULL == (tmp = (float *)SLrealloc ((char *)ct->ypts, new_num*sizeof(float)))) return -1; ct->ypts = tmp; ct->nmalloced = new_num; return 0; } static int draw_callback (double x, double y, int flag, Contour_Type *ct) { int zlevel = flag / 10; flag = flag % 10; if (flag == 6) return 0; if (ct->npts + 1 >= ct->nmalloced) { if (-1 == resize_contour (ct)) return -1; } ct->xpts[ct->npts] = (float) x; ct->ypts[ct->npts] = (float) y; ct->npts++; switch (flag) { default: SLang_verror (SL_INTERNAL_ERROR, "Error in gcont module: Unexpected flag %d", flag); return -1; case 2: case 3: /* start */ ct->zlevel = zlevel; break; case 1: /* continuation */ break; case 5: /* finish closed */ ct->xpts[ct->npts] = ct->xpts[0]; ct->ypts[ct->npts] = ct->ypts[0]; ct->npts++; /* drop */ case 4: /* finish at boundary */ if (-1 == push_contour (ct)) return -1; ct->npts = 0; break; } return 0; } static double char_to_double (VOID_STAR p, unsigned int offset) { return (double) *((char *)p + offset); } static double uchar_to_double (VOID_STAR p, unsigned int offset) { return (double) *((unsigned char *)p + offset); } static double int_to_double (VOID_STAR p, unsigned int offset) { return (double) *((int *)p + offset); } static double uint_to_double (VOID_STAR p, unsigned int offset) { return (double) *((unsigned int *)p + offset); } static double short_to_double (VOID_STAR p, unsigned int offset) { return (double) *((short *)p + offset); } static double ushort_to_double (VOID_STAR p, unsigned int offset) { return (double) *((unsigned short *)p + offset); } static double long_to_double (VOID_STAR p, unsigned int offset) { return (double) *((long *)p + offset); } static double ulong_to_double (VOID_STAR p, unsigned int offset) { return (double) *((unsigned long *)p + offset); } static double float_to_double (VOID_STAR p, unsigned int offset) { return (double) *((float *)p + offset); } static double double_to_double (VOID_STAR p, unsigned int offset) { return (double) *((double *)p + offset); } static void gcontr_intrin (void) { SLang_Name_Type *nt; SLang_Array_Type *image = NULL; SLang_Array_Type *zvals = NULL; unsigned int nx, ny, nz; double (*to_double_fun)(VOID_STAR, unsigned int); Contour_Type *ct; SLang_Any_Type *client_data = NULL; int nargs; nargs = SLang_Num_Function_Args; if (nargs == 4) { if (-1 == SLang_pop_anytype (&client_data)) return; nargs--; } if (nargs != 3) { SLang_verror (SL_USAGE_ERROR, "gcontour (image, zlevels, &callback [,clientdata])"); if (client_data != NULL) SLang_free_anytype (client_data); return; } if (NULL == (nt = SLang_pop_function ())) { if (client_data != NULL) SLang_free_anytype (client_data); return; } if (-1 == SLang_pop_array_of_type (&zvals, SLANG_DOUBLE_TYPE)) goto free_return; if (zvals->num_dims != 1) { SLang_verror (SL_INVALID_PARM, "Expecting a 1-d array of contour levels"); goto free_return; } nz = zvals->num_elements; if (-1 == SLang_pop_array (&image, 0)) goto free_return; if (image->num_dims != 2) { SLang_verror (SL_INVALID_PARM, "gcontr requires a 2-d image"); goto free_return; } nx = image->dims[0]; ny = image->dims[1]; if ((nx < 2) || (ny < 2)) { SLang_verror (SL_INVALID_PARM, "gcontr requires at least a 2x2 image"); goto free_return; } switch (image->data_type) { case SLANG_CHAR_TYPE: to_double_fun = char_to_double; break; case SLANG_UCHAR_TYPE: to_double_fun = uchar_to_double; break; case SLANG_SHORT_TYPE: to_double_fun = short_to_double; break; case SLANG_USHORT_TYPE: to_double_fun = ushort_to_double; break; case SLANG_INT_TYPE: to_double_fun = int_to_double; break; case SLANG_UINT_TYPE: to_double_fun = uint_to_double; break; case SLANG_LONG_TYPE: to_double_fun = long_to_double; break; case SLANG_ULONG_TYPE: to_double_fun = ulong_to_double; break; case SLANG_FLOAT_TYPE: to_double_fun = float_to_double; break; case SLANG_DOUBLE_TYPE: to_double_fun = double_to_double; break; default: SLang_verror (SL_NOT_IMPLEMENTED, "Unsupported image type"); goto free_return; } if (NULL != (ct = alloc_contour_type (nt, client_data))) { double zmax = 1e10; unsigned char *bitmap = (unsigned char *)SLmalloc ((1 + (2*nx*ny*nz)/8)); if (bitmap == NULL) { free_contour_type (ct); goto free_return; } (void) gcontr (image->data, nx, ny, to_double_fun, (double *)zvals->data, zvals->num_elements, zmax, bitmap, draw_callback, ct); SLfree ((char *) bitmap); free_contour_type (ct); } /* drop */ free_return: if (client_data != NULL) SLang_free_anytype (client_data); SLang_free_function (nt); SLang_free_array (image); SLang_free_array (zvals); } static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("_gcontour", gcontr_intrin, SLANG_VOID_TYPE), SLANG_END_INTRIN_FUN_TABLE }; static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gcontour_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gcontour_module_version", MODULE_VERSION_NUMBER), SLANG_END_ICONST_TABLE }; int init_gcontour_module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if ((-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL))) return -1; return 0; } /* This function is optional */ void deinit_gcontour_module (void) { } slxfig-pre0.2.0-35/src/mkversion.sh0000755000175000000620000000034411076540262015726 0ustar johnstaff#version 1.0 # The initial echo is necessary because the solaris version of sed cannot # grok input without a trailing newline. echo `grep "^#define MODULE_[MP]" version.h | sed -e 's/[^0-9]*//' | tr '\012' .` | sed -e 's/.$//' slxfig-pre0.2.0-35/src/xfig.sl0000644000175000000620000000104611076540262014647 0ustar johnstaff$1 = 0; $2 = 1; $3 = 1; variable _xfig_version = $1*10000 + $2*100 + $3; variable _xfig_version_string = "$1.$2.$3"$; ()=evalfile ("xfig/core"); ()=evalfile ("xfig/polyline"); ()=evalfile ("xfig/ellipse"); ()=evalfile ("xfig/text"); ()=evalfile ("xfig/latex.sl"); ()=evalfile ("xfig/objects"); ()=evalfile ("xfig/png.sl"); ()=evalfile ("xfig/clip.sl"); ()=evalfile ("xfig/plot.sl"); $1 = getenv ("HOME"); if ($1 != NULL) { $1 = path_concat ($1, ".slxfigrc"); if (NULL != stat_file ($1)) { () = evalfile ($1); } } provide ("xfig"); slxfig-pre0.2.0-35/src/version.h0000644000175000000620000000057511076540262015216 0ustar johnstaff#define MODULE_MAJOR_VERSION 0 #define MODULE_MINOR_VERSION 1 #define MODULE_PATCH_LEVEL 0 #define MKSTR1(x) #x #define MKSTR(x) MKSTR1(x) static char *Module_Version_String = MKSTR(MODULE_MAJOR_VERSION) "." \ MKSTR(MODULE_MINOR_VERSION) "." MKSTR(MODULE_PATCH_LEVEL); #define MODULE_VERSION_NUMBER \ (MODULE_MAJOR_VERSION*10000+MODULE_MINOR_VERSION*100+MODULE_PATCH_LEVEL) slxfig-pre0.2.0-35/src/gcontour.sl0000644000175000000620000000745411076540262015563 0ustar johnstaffimport ("gcontour"); if (0 == is_defined ("Polygon_List_Type")) typedef struct { polygons } Polygon_List_Type; define polygon_list_new () { variable ndims = 2; if (_NARGS == 1) ndims = (); variable c = @Polygon_List_Type; variable polygons = List_Type[ndims]; _for (0, ndims-1, 1) { variable i = (); polygons[i] = {}; } c.polygons = polygons; return c; } define polygon_list_put () { variable args = __pop_args (_NARGS-1); variable c = (); variable polygons = c.polygons; variable n = length (polygons); if (n != length (args)) throw InvalidParmError, "A $n-d polygon is required"$; _for (0, n-1, 1) { variable i = (); list_append (polygons[i], args[i].value); } } define polygon_list_get (c, n) { variable polygons = c.polygons; _for (0, length (polygons)-1, 1) { variable i = (); polygons[i][n]; } } define polygon_list_length (c) { return length (c.polygons[0]); } %!%+ %\function{polygon_list_apply} %\synopsis{Apply a function to a polygon list} %\usage{polygon_list_apply (plist, fun [,fun_args...])} %\description % This function will call the specified function for each polygon in the % list using %#v+ % fun (x,y,fun_args...); %#v- %\seealso{polygon_list_bbox} %!%- define polygon_list_apply () { variable args = __pop_args (_NARGS-2); variable fun = (); variable c = (); variable n = polygon_list_length (c); _for (0, n-1, 1) { variable i = (); variable x, y; (@fun)(polygon_list_get (c, i), __push_args(args)); } } private define bbox_callback () { variable maxs = (); variable mins = (); _for (length (mins)-1, 0, -1) { variable i = (); variable x_i = (); variable min_x = min (x_i); variable max_x = max (x_i); if (min_x < mins[i]) mins[i] = min_x; if (max_x > maxs[i]) maxs[i] = max_x; } } %!%+ %\function{polygon_list_bbox} %\synopsis{Get the bounding box of a polygon list} %\usage{(mins, maxs) = polygon_list_bbox (plist)} %\description % This function returns two arrays giving the bounding box of the specified % polygon list. %\seealso{polygon_list_apply} %!%- define polygon_list_bbox (c) { variable n = length (c.polygons); variable mins = _Inf[Int_Type[n]]; variable maxs = -_Inf[Int_Type[n]]; polygon_list_apply (c, &bbox_callback, mins, maxs); return mins, maxs; } private define do_gcontour_callback (xvals, yvals, zlevel, s) { return (@s.fun)(xvals, yvals, zlevel, __push_args (s.args)); } define gcontour () { variable nargs = _NARGS; variable args = NULL; if (nargs > 3) { args = __pop_args (nargs - 3); nargs = 3; } if (nargs != 3) usage ("gcontour (2d-array, 1d-levels, &callback-fun [, callback-args...])"); variable img, zvals, fun; (img, zvals, fun) = (); if (args == NULL) return _gcontour (img, zvals, &fun); variable s = struct { fun, args }; s.fun = fun; s.args = args; _gcontour (img, zvals, &do_gcontour_callback, s); } private define gcontour_compute_callback (xvals, yvals, zlevel, list) { polygon_list_put (list[zlevel], xvals, yvals); } % This function returns an array of lists. Each list in the array contains % the contours for the corresponding z level. Each list element contains % an array of 2 arrays. So, the 3rd contour for the 5th zlevel is given % by % icoords = contour[5][3][0]; % jcoords = contour[5][3][1]; define gcontour_compute () { if (_NARGS != 2) usage ("contour_list = %s (2d-array, 1d-levels)", _function_name); variable img, zvals; (img, zvals) = (); variable nz = length (zvals); variable contours = Struct_Type[nz]; _for (0, nz-1, 1) { variable i = (); contours[i] = polygon_list_new (2); } _gcontour (img, zvals, &gcontour_compute_callback, contours); return contours; } slxfig-pre0.2.0-35/autoconf/0002755000175000000620000000000011076540262014402 5ustar johnstaffslxfig-pre0.2.0-35/autoconf/install.sh0000755000175000000620000001273611076540262016416 0ustar johnstaff#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 slxfig-pre0.2.0-35/autoconf/Makefile.in0000644000175000000620000000127211076540262016447 0ustar johnstaff# -*- sh -*- @SET_MAKE@ SHELL = /bin/sh all: cd src; $(MAKE) all clean: cd src; $(MAKE) clean cd examples/plot; $(MAKE) clean /bin/rm -f *~ \#* distclean: clean cd src; $(MAKE) distclean /bin/rm -f config.log config.cache config.status Makefile install: cd src; $(MAKE) install # configure: autoconf/aclocal.m4 autoconf/configure.ac cd autoconf && autoconf && mv ./configure .. update: autoconf/config.sub autoconf/config.guess autoconf/config.guess: /usr/share/misc/config.guess /bin/cp -f /usr/share/misc/config.guess autoconf/config.guess autoconf/config.sub: /usr/share/misc/config.sub /bin/cp -f /usr/share/misc/config.sub autoconf/config.sub # .PHONY: all install clean update # slxfig-pre0.2.0-35/autoconf/configure.ac0000644000175000000620000000250111076540262016664 0ustar johnstaffdnl -*- sh -*- AC_INIT(src/gcontour-module.c) AC_PREFIX_DEFAULT(/usr/local) AC_CONFIG_AUX_DIR(autoconf) AC_CANONICAL_HOST AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_MAKE_SET JD_INIT JD_ANSI_CC JD_ELF_COMPILER JD_IEEE_CFLAGS AC_PATH_XTRA JD_WITH_LIBRARY(slang) dnl# This macro inits the module installation dir JD_SLANG_MODULE_INSTALL_DIR if test "X$slang_major_version" = "X1" then AC_MSG_ERROR("This software will not work with slang-1. Specify a path to slang-2") fi dnl Check these header since they cause trouble AC_CHECK_HEADERS( \ stdlib.h \ unistd.h \ ) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(float, 4) AC_CHECK_SIZEOF(double, 8) JD_SET_RPATH($libdir) ELF_CFLAGS="$ELF_CFLAGS $IEEE_CFLAGS" CFLAGS="$CFLAGS $IEEE_CFLAGS" AC_CONFIG_HEADER(src/config.h:src/config.hin) AC_OUTPUT(Makefile:autoconf/Makefile.in src/Makefile) echo "" echo "You are compiling with the following compiler configuration:" echo " CC =" "$CC" echo " CC_SHARED =" "$CC_SHARED" echo " CFLAGS =" "$CFLAGS" echo " LDFLAGS =" "$LDFLAGS" "$DYNAMIC_LINK_FLAGS" echo "" echo "The modules will be installed in $MODULE_INSTALL_DIR." echo "Any associated .sl files will be install in $SL_FILES_INSTALL_DIR" echo "" echo "If any of these quantities are incorrect, edit src/Makefile accordingly." echo "" slxfig-pre0.2.0-35/autoconf/mkinsdir.sh0000755000175000000620000000113611076540262016560 0ustar johnstaff#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || errstatus=$? fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here slxfig-pre0.2.0-35/autoconf/config.guess0000755000175000000620000011310611076540262016722 0ustar johnstaff#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. timestamp='2002-03-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 c99 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; esac fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:3*) echo i386-pc-interix3 exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` rm -f $dummy.c test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` rm -f $dummy.c test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: slxfig-pre0.2.0-35/autoconf/Makefile0000644000175000000620000000047311076540262016044 0ustar johnstaff../configure: aclocal.m4 configure.ac /bin/rm -rf autom4te.cache autoconf && mv ./configure .. update: config.sub config.guess config.guess: /usr/share/misc/config.guess /bin/cp -f /usr/share/misc/config.guess config.guess config.sub: /usr/share/misc/config.sub /bin/cp -f /usr/share/misc/config.sub config.sub slxfig-pre0.2.0-35/autoconf/aclocal.m40000644000175000000620000006267711076540262016262 0ustar johnstaffdnl# -*- mode: sh; mode: fold -*- dnl# 0.2.3-2: X was missing in a "test" statement (Joerg Sommer) dnl# 0.2.3-1: AC_AIX needs to be called before running the compiler (Miroslav Lichvar) dnl# 0.2.3: rewrote JD_CHECK_FOR_LIBRARY to loop over include/lib pairs dnl# 0.2.2-1: JD_WITH_LIBRARY bug-fix dnl# 0.2.2: Use ncurses5-config to search for terminfo dirs. dnl# 0.2.1: Add .dll.a to list of extensions to when searching for libs (cygwin) dnl# 0.2.0: Added install target name and more fixes for cygwin dnl# 0.1.12: Improved support for cygwin dnl# 0.1.11: Fixed elf linking on freebsd (Renato Botelho (garga at freebsd, org) dnl# Version 0.1.10: rpath support for netbsd dnl# Version 0.1.9: When searching for libs, use dylib on darwin dnl# Version 0.1.8: Add rpath support for OpenBSD dnl# Version 0.1.7: removed "-K pic" from IRIX compiler lines dnl# Version 0.1.6: Added cygwin module support dnl# Version 0.1.5: Added gcc version-script support. AC_DEFUN(JD_INIT, dnl#{{{ [ #These variable are initialized by JD init function CONFIG_DIR=`pwd` cd $srcdir if test "`pwd`" != "$CONFIG_DIR" then AC_MSG_ERROR("This software does not support configuring from another directory. See the INSTALL file") fi dnl# if test "X$PWD" != "X" dnl# then dnl# CONFIG_DIR="$PWD" dnl# fi AC_SUBST(CONFIG_DIR)dnl # Note: these will differ if one is a symbolic link if test -f /usr/bin/dirname; then JD_Above_Dir=`dirname $CONFIG_DIR` else # system is a loser JD_Above_Dir=`cd ..;pwd` fi JD_Above_Dir2=`cd ..;pwd` ]) dnl#}}} dnl# This function expand the "prefix variables. For example, it will expand dnl# values such as ${exec_prefix}/foo when ${exec_prefix} itself has a dnl# of ${prefix}. This function produces the shell variables: dnl# jd_prefix_libdir, jd_prefix_incdir AC_DEFUN(JD_EXPAND_PREFIX, dnl#{{{ [ if test "X$jd_prefix" = "X" then jd_prefix=$ac_default_prefix if test "X$prefix" != "XNONE" then jd_prefix="$prefix" fi jd_exec_prefix="$jd_prefix" if test "X$exec_prefix" != "XNONE" then jd_exec_prefix="$exec_prefix" fi dnl#Unfortunately, exec_prefix may have a value like ${prefix}, etc. dnl#Let the shell expand those. Yuk. eval `sh <>)dnl define(<<$2>>, translit($1, [a-z], [A-Z]))dnl changequote([, ])dnl ]) #}}} AC_DEFUN(JD_SIMPLE_LIB_DIR, dnl#{{{ [ JD_UPPERCASE($1,JD_UP_NAME) JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/libsrc/"$ARCH"objs JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/libsrc if test ! -d "[$]JD_UP_NAME[]_INCLUDE" then JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/src/"$ARCH"objs JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/src if test ! -d "[$]JD_UP_NAME[]_INCLUDE" then echo "" echo WARNING------Unable to find the JD_UP_NAME directory echo You may have to edit $CONFIG_DIR/src/Makefile. echo "" fi fi AC_SUBST(JD_UP_NAME[]_LIB_DIR)dnl AC_SUBST(JD_UP_NAME[]_INCLUDE)dnl undefine([JD_UP_NAME])dnl ]) dnl#}}} AC_DEFUN(JD_FIND_GENERIC, dnl#{{{ [ AC_REQUIRE([JD_EXPAND_PREFIX])dnl changequote(<<, >>)dnl define(<>, translit($1, [a-z], [A-Z]))dnl changequote([, ])dnl # Look for the JD_UP_NAME package #JD_UP_NAME[]_INCLUDE="" #JD_UP_NAME[]_LIB_DIR="" # This list consists of "include,lib include,lib ..." JD_Search_Dirs="$JD_Above_Dir2/$1/libsrc,$JD_Above_Dir2/$1/libsrc/"$ARCH"objs \ $JD_Above_Dir/$1/libsrc,$JD_Above_Dir/$1/libsrc/"$ARCH"objs \ $JD_Above_Dir2/$1/src,$JD_Above_Dir2/$1/src/"$ARCH"objs \ $JD_Above_Dir/$1/src,$JD_Above_Dir/$1/src/"$ARCH"objs" JD_Search_Dirs="$JD_Search_Dirs \ $jd_prefix_incdir,$jd_prefix_libdir \ $HOME/include,$HOME/lib" if test -n "$ARCH" then JD_Search_Dirs="$JD_Search_Dirs $HOME/include,$HOME/$ARCH/lib" JD_Search_Dirs="$JD_Search_Dirs $HOME/include,$HOME/sys/$ARCH/lib" fi # Now add the standard system includes. The reason for doing this is that # the other directories may have a better chance of containing a more recent # version. JD_Search_Dirs="$JD_Search_Dirs \ /usr/local/include,/usr/local/lib \ /usr/include,/usr/lib \ /usr/include/$1,/usr/lib \ /usr/include/$1,/usr/lib/$1" echo looking for the JD_UP_NAME library for include_and_lib in $JD_Search_Dirs do # Yuk. Is there a better way to set these variables?? generic_include=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]1}'` generic_lib=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]2}'` echo Looking for $1.h in $generic_include echo and lib$1.a in $generic_lib if test -r $generic_include/$1.h && test -r $generic_lib/lib$1.a then echo Found it. JD_UP_NAME[]_LIB_DIR="$generic_lib" JD_UP_NAME[]_INCLUDE="$generic_include" break else if test -r $generic_include/$1.h && test -r $generic_lib/lib$1.so then echo Found it. JD_UP_NAME[]_LIB_DIR="$generic_lib" JD_UP_NAME[]_INCLUDE="$generic_include" break fi fi done if test -n "[$]JD_UP_NAME[]_LIB_DIR" then jd_have_$1="yes" else echo Unable to find the $JD_UP_NAME library. echo You may have to edit $CONFIG_DIR/src/Makefile. JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/src JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/src/"$ARCH"objs jd_have_$1="no" fi JD_UP_NAME[]_INC="-I[$]JD_UP_NAME[]_INCLUDE" JD_UP_NAME[]_LIB="-L[$]JD_UP_NAME[]_LIB_DIR" JD_SET_RPATH([$]JD_UP_NAME[]_LIB_DIR) dnl if test "X$GCC" = Xyes dnl then dnl RPATH_[]JD_UP_NAME="-Wl,-R[$]JD_UP_NAME[]_LIB_DIR" dnl else dnl RPATH_[]JD_UP_NAME="-R[$]JD_UP_NAME[]_LIB_DIR" dnl fi # gcc under solaris is often not installed correctly. Avoid specifying # -I/usr/include. if test "[$]JD_UP_NAME[]_INC" = "-I/usr/include" then JD_UP_NAME[]_INC="" fi if test "[$]JD_UP_NAME[]_LIB" = "-L/usr/lib" then JD_UP_NAME[]_LIB="" RPATH_[]JD_UP_NAME="" fi AC_SUBST(JD_UP_NAME[]_LIB)dnl AC_SUBST(JD_UP_NAME[]_INC)dnl AC_SUBST(JD_UP_NAME[]_LIB_DIR)dnl AC_SUBST(JD_UP_NAME[]_INCLUDE)dnl dnl AC_SUBST(RPATH_[]JD_UP_NAME)dnl undefine([JD_UP_NAME])dnl ]) dnl#}}} AC_DEFUN(JD_FIND_SLANG, dnl#{{{ [ JD_FIND_GENERIC(slang) ]) dnl#}}} AC_DEFUN(JD_GCC_WARNINGS, dnl#{{{ [ AC_ARG_ENABLE(warnings, [ --enable-warnings turn on GCC compiler warnings], [gcc_warnings=$enableval]) if test -n "$GCC" then #CFLAGS="$CFLAGS -fno-strength-reduce" if test -n "$gcc_warnings" then CFLAGS="$CFLAGS -Wall -W -pedantic -Winline -Wmissing-prototypes \ -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes" # Now trim excess whitespace CFLAGS=`echo $CFLAGS` fi fi ]) dnl#}}} IEEE_CFLAGS="" AC_DEFUN(JD_IEEE_CFLAGS, dnl#{{{ [ case "$host_cpu" in *alpha* ) if test "$GCC" = yes then IEEE_CFLAGS="-mieee" else IEEE_CFLAGS="-ieee_with_no_inexact" fi ;; * ) IEEE_CFLAGS="" esac ]) dnl#}}} AC_DEFUN(JD_CREATE_ORULE, dnl#{{{ [ PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES \$(OBJDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$("$1"_O_DEP) cd \$(OBJDIR); \$(COMPILE_CMD) \$("$1"_C_FLAGS) \$(SRCDIR)/$1.c " ]) dnl#}}} AC_DEFUN(JD_CREATE_ELFORULE, dnl#{{{ [ PROGRAM_ELF_ORULES="$PROGRAM_ELF_ORULES \$(ELFDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$("$1"_O_DEP) cd \$(ELFDIR); \$(ELFCOMPILE_CMD) \$("$1"_C_FLAGS) \$(SRCDIR)/$1.c " ]) dnl#}}} AC_DEFUN(JD_CREATE_EXEC_RULE, dnl#{{{ [ PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES $1 : \$(OBJDIR)/$1 @echo $1 created in \$(OBJDIR) \$(OBJDIR)/$1 : \$(OBJDIR)/$1.o \$("$1"_DEPS) \$(EXECDEPS) \$(CC) -o \$(OBJDIR)/$1 \$(LDFLAGS) \$(OBJDIR)/$1.o \$("$1"_LIBS) \$(EXECLIBS) \$(OBJDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$("$1"_O_DEP) cd \$(OBJDIR); \$(COMPILE_CMD) \$("$1"_INC) \$(EXECINC) \$(SRCDIR)/$1.c " ]) dnl#}}} AC_DEFUN(JD_CREATE_MODULE_ORULES, dnl#{{{ [ for program_module in $Program_Modules; do JD_CREATE_ORULE($program_module) JD_CREATE_ELFORULE($program_module) done ]) dnl#}}} AC_DEFUN(JD_GET_MODULES, dnl#{{{ [ PROGRAM_HFILES="" PROGRAM_OFILES="" PROGRAM_CFILES="" PROGRAM_OBJECTS="" PROGRAM_ELFOBJECTS="" PROGRAM_OBJECT_RULES="" PROGRAM_ELF_ORULES="" if test -z "$1" then Program_Modules="" else comment_re="^#" Program_Modules=`grep -v '$comment_re' $1 | awk '{print [$]1}'` Program_H_Modules=`grep -v '$comment_re' $1 | awk '{print [$]2}'` for program_module in $Program_H_Modules; do PROGRAM_HFILES="$PROGRAM_HFILES $program_module" done fi for program_module in $Program_Modules; do PROGRAM_OFILES="$PROGRAM_OFILES $program_module.o" PROGRAM_CFILES="$PROGRAM_CFILES $program_module.c" PROGRAM_OBJECTS="$PROGRAM_OBJECTS \$(OBJDIR)/$program_module.o" PROGRAM_ELFOBJECTS="$PROGRAM_ELFOBJECTS \$(ELFDIR)/$program_module.o" done dnl echo $PROGRAM_OFILES dnl echo $PROGRAM_HFILES AC_SUBST(PROGRAM_OFILES)dnl AC_SUBST(PROGRAM_CFILES)dnl AC_SUBST(PROGRAM_HFILES)dnl AC_SUBST(PROGRAM_OBJECTS)dnl AC_SUBST(PROGRAM_ELFOBJECTS)dnl ]) dnl#}}} AC_DEFUN(JD_APPEND_RULES, dnl#{{{ [ echo "$PROGRAM_OBJECT_RULES" >> $1 ]) dnl#}}} AC_DEFUN(JD_APPEND_ELFRULES, dnl#{{{ [ echo "$PROGRAM_ELF_ORULES" >> $1 ]) dnl#}}} AC_DEFUN(JD_CREATE_MODULE_EXEC_RULES, dnl#{{{ [ for program_module in $Program_Modules; do JD_CREATE_EXEC_RULE($program_module) done ]) dnl#}}} AC_DEFUN(JD_TERMCAP, dnl#{{{ [ AC_PATH_PROG(nc5config, ncurses5-config, no) if test "$nc5config" = "no" then AC_PATH_PROG(nc5config, ncurses5w-config, no) fi AC_MSG_CHECKING(for terminfo) if test "$nc5config" != "no" then MISC_TERMINFO_DIRS=`$nc5config --terminfo` else MISC_TERMINFO_DIRS="" fi JD_Terminfo_Dirs="$MISC_TERMINFO_DIRS \ /usr/lib/terminfo \ /usr/share/terminfo \ /usr/share/lib/terminfo \ /usr/local/lib/terminfo" TERMCAP=-ltermcap for terminfo_dir in $JD_Terminfo_Dirs do if test -d $terminfo_dir then AC_MSG_RESULT(yes) TERMCAP="" break fi done if test "$TERMCAP"; then AC_MSG_RESULT(no) AC_DEFINE(USE_TERMCAP) fi AC_SUBST(TERMCAP)dnl AC_SUBST(MISC_TERMINFO_DIRS)dnl ]) dnl#}}} AC_DEFUN(JD_ANSI_CC, dnl#{{{ [ AC_AIX AC_PROG_CC AC_PROG_CPP AC_PROG_GCC_TRADITIONAL AC_ISC_POSIX dnl #This stuff came from Yorick config script dnl dnl # HPUX needs special stuff dnl AC_EGREP_CPP(yes, [#ifdef hpux yes #endif ], [ AC_DEFINE(_HPUX_SOURCE) if test "$CC" = cc; then CC="cc -Ae"; fi ])dnl dnl dnl #Be sure we've found compiler that understands prototypes dnl AC_MSG_CHECKING(C compiler that understands ANSI prototypes) AC_TRY_COMPILE([ ],[ extern int silly (int);], [ AC_MSG_RESULT($CC looks ok. Good.)], [ AC_MSG_RESULT($CC is not a good enough compiler) AC_MSG_ERROR(Set env variable CC to your ANSI compiler and rerun configure.) ])dnl ])dnl dnl#}}} AC_DEFUN(JD_ELF_COMPILER, dnl#{{{ [ dnl #------------------------------------------------------------------------- dnl # Check for dynamic linker dnl #------------------------------------------------------------------------- DYNAMIC_LINK_LIB="" AC_CHECK_HEADER(dlfcn.h,[ AC_DEFINE(HAVE_DLFCN_H) AC_CHECK_LIB(dl,dlopen,[ DYNAMIC_LINK_LIB="-ldl" AC_DEFINE(HAVE_DLOPEN) ],[ AC_CHECK_FUNC(dlopen,AC_DEFINE(HAVE_DLOPEN)) if test "$ac_cv_func_dlopen" != yes then AC_MSG_WARN(cannot perform dynamic linking) fi ])]) AC_SUBST(DYNAMIC_LINK_LIB) if test "$GCC" = yes then if test X"$CFLAGS" = X then CFLAGS="-O2" fi fi dnl #Some defaults ELFLIB="lib\$(THIS_LIB).so" ELFLIB_MAJOR="\$(ELFLIB).\$(ELF_MAJOR_VERSION)" ELFLIB_MAJOR_MINOR="\$(ELFLIB_MAJOR).\$(ELF_MINOR_VERSION)" ELFLIB_MAJOR_MINOR_MICRO="\$(ELFLIB_MAJOR_MINOR).\$(ELF_MICRO_VERSION)" dnl# This specifies the target to use in the makefile to install the shared library INSTALL_ELFLIB_TARGET="install-elf-and-links" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR_MINOR_MICRO)" INSTALL_MODULE="\$(INSTALL_DATA)" SLANG_DLL_CFLAGS="" case "$host_os" in *linux*|*gnu*|k*bsd*-gnu ) DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *solaris* ) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-ztext -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K PIC" ELF_LINK="\$(CC) \$(LDFLAGS) -G -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -K PIC" fi ;; # osr5 or unixware7 with current or late autoconf *sco3.2v5* | *unixware-5* | *sco-sysv5uw7*) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K pic" # ELF_LINK="ld -G -z text -h#" ELF_LINK="\$(CC) \$(LDFLAGS) -G -z text -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -K pic" fi ;; *irix6.5* ) echo "Note: ELF compiler for host_os=$host_os may not be correct" echo "double-check: 'mode_t', 'pid_t' may be wrong!" if test "$GCC" = yes then # not tested DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS)" # default anyhow ELF_LINK="\$(CC) \$(LDFLAGS) -shared -o \$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared" fi ;; *darwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fno-common" ELF_LINK="\$(CC) \$(LDFLAGS) -dynamiclib -install_name \$(install_lib_dir)/\$(ELFLIB_MAJOR) -compatibility_version \$(ELF_MAJOR_VERSION) -current_version \$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION)" ELF_DEP_LIBS="\$(LDFLAGS) \$(DL_LIB)" CC_SHARED="\$(CC) -bundle -flat_namespace -undefined suppress \$(CFLAGS) -fno-common" ELFLIB="lib\$(THIS_LIB).dylib" ELFLIB_MAJOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).dylib" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).dylib" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).\$(ELF_MICRO_VERSION).dylib" ;; *freebsd* ) ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" #if test "X$PORTOBJFORMAT" = "Xelf" ; then # ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" #else # ELF_LINK="ld -Bshareable -x" #fi ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *cygwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" SLANG_DLL_CFLAGS="-DSLANG_DLL=1" ELF_CFLAGS="\$(CFLAGS) -DBUILD_DLL=1" DLL_IMPLIB_NAME="lib\$(THIS_LIB)\$(ELFLIB_MAJOR_VERSION).dll.a" #ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME) -Wl,-export-all-symbols -Wl,-enable-auto-import" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED="\$(CC) \$(CFLAGS) -shared -DSLANG_DLL=1" dnl# CYGWIN prohibits undefined symbols when linking shared libs SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang" INSTALL_MODULE="\$(INSTALL)" INSTALL_ELFLIB_TARGET="install-elf-cygwin" ELFLIB="lib\$(THIS_LIB).dll" ELFLIB_MAJOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION).dll" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION).dll" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION)_\$(ELF_MICRO_VERSION).dll" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR)" ;; * ) echo "Note: ELF compiler for host_os=$host_os may be wrong" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" esac AC_SUBST(ELF_CC) AC_SUBST(ELF_CFLAGS) AC_SUBST(ELF_LINK) AC_SUBST(ELF_LINK_CMD) AC_SUBST(ELF_DEP_LIBS) AC_SUBST(DYNAMIC_LINK_FLAGS) AC_SUBST(CC_SHARED) AC_SUBST(ELFLIB) AC_SUBST(ELFLIB_MAJOR) AC_SUBST(ELFLIB_MAJOR_MINOR) AC_SUBST(ELFLIB_MAJOR_MINOR_MICRO) AC_SUBST(SLANG_LIB_FOR_MODULES) AC_SUBST(DLL_IMPLIB_NAME) AC_SUBST(INSTALL_MODULE) AC_SUBST(INSTALL_ELFLIB_TARGET) AC_SUBST(ELFLIB_BUILD_NAME) AC_SUBST(SLANG_DLL_CFLAGS) ]) dnl#}}} AC_DEFUN(JD_F77_COMPILER, dnl#{{{ [ case "$host_os" in *linux* ) F77="g77" F77_LIBS="-lg2c" ;; *solaris*) F77=f77 #F77_LIBS="-lF77 -lM77 -L/opt/SUNWspro/SC4.0/lib -lsunmath" F77_LIBS="-lF77 -lM77 -lsunmath" ;; *) echo "" echo "WARNING: Assuming f77 as your FORTRAN compiler" echo "" F77=f77 F77_LIBS="" esac AC_SUBST(F77) AC_SUBST(F77_LIBS) ]) dnl#}}} dnl# This macro process the --with-xxx, --with-xxxinc, and --with-xxxlib dnl# command line arguments and returns the values as shell variables dnl# jd_xxx_include_dir and jd_xxx_library_dir. It does not perform any dnl# substitutions, nor check for the existence of the supplied values. AC_DEFUN(JD_WITH_LIBRARY_PATHS, dnl#{{{ [ JD_UPPERCASE($1,JD_ARG1) jd_$1_include_dir="" jd_$1_library_dir="" if test X"$jd_with_$1_library" = X then jd_with_$1_library="" fi AC_ARG_WITH($1, [ --with-$1=DIR Use DIR/lib and DIR/include for $1], [jd_with_$1_arg=$withval], [jd_with_$1_arg=unspecified]) case "x$jd_with_$1_arg" in xno) jd_with_$1_library="no" ;; x) dnl# AC_MSG_ERROR(--with-$1 requires a value-- try yes or no) jd_with_$1_library="yes" ;; xunspecified) ;; xyes) jd_with_$1_library="yes" ;; *) jd_with_$1_library="yes" jd_$1_include_dir="$jd_with_$1_arg"/include jd_$1_library_dir="$jd_with_$1_arg"/lib ;; esac AC_ARG_WITH($1lib, [ --with-$1lib=DIR $1 library in DIR], [jd_with_$1lib_arg=$withval], [jd_with_$1lib_arg=unspecified]) case "x$jd_with_$1lib_arg" in xunspecified) ;; xno) ;; x) AC_MSG_ERROR(--with-$1lib requres a value) ;; *) jd_with_$1_library="yes" jd_$1_library_dir="$jd_with_$1lib_arg" ;; esac AC_ARG_WITH($1inc, [ --with-$1inc=DIR $1 include files in DIR], [jd_with_$1inc_arg=$withval], [jd_with_$1inc_arg=unspecified]) case "x$jd_with_$1inc_arg" in x) AC_MSG_ERROR(--with-$1inc requres a value) ;; xunspecified) ;; xno) ;; *) jd_with_$1_library="yes" jd_$1_include_dir="$jd_with_$1inc_arg" ;; esac ]) dnl#}}} dnl# This function checks for the existence of the specified library $1 with dnl# header file $2. If the library exists, then the shell variables will dnl# be created: dnl# jd_with_$1_library=yes/no, dnl# jd_$1_inc_file dnl# jd_$1_include_dir dnl# jd_$1_library_dir AC_DEFUN(JD_CHECK_FOR_LIBRARY, dnl#{{{ [ AC_REQUIRE([JD_EXPAND_PREFIX])dnl dnl JD_UPPERCASE($1,JD_ARG1) JD_WITH_LIBRARY_PATHS($1) AC_MSG_CHECKING(for the $1 library and header files $2) if test X"$jd_with_$1_library" != Xno then jd_$1_inc_file=$2 dnl# jd_with_$1_library="yes" if test "X$jd_$1_inc_file" = "X" then jd_$1_inc_file=$1.h fi if test X"$jd_$1_include_dir" = X then inc_and_lib_dirs="\ $jd_prefix_incdir,$jd_prefix_libdir \ /usr/local/$1/include,/usr/local/$1/lib \ /usr/local/include/$1,/usr/local/lib \ /usr/local/include,/usr/local/lib \ /usr/include/$1,/usr/lib \ /usr/$1/include,/usr/$1/lib \ /usr/include,/usr/lib \ /opt/include/$1,/opt/lib \ /opt/$1/include,/opt/$1/lib \ /opt/include,/opt/lib" case "$host_os" in *darwin* ) exts="dylib so a" ;; *cygwin* ) exts="dll.a so a" ;; * ) exts="so a" esac xincfile="$jd_$1_inc_file" xlibfile="lib$1" jd_with_$1_library="no" for include_and_lib in $inc_and_lib_dirs do # Yuk. Is there a better way to set these variables?? xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]1}'` xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]2}'` found=0 if test -r $xincdir/$xincfile then for E in $exts do if test -r "$xlibdir/$xlibfile.$E" then jd_$1_include_dir="$xincdir" jd_$1_library_dir="$xlibdir" jd_with_$1_library="yes" found=1 break fi done fi if test $found -eq 1 then break fi done fi fi if test X"$jd_$1_include_dir" != X -a X"$jd_$1_library_dir" != X then AC_MSG_RESULT(yes: $jd_$1_library_dir and $jd_$1_include_dir) jd_with_$1_library="yes" dnl# Avoid using /usr/lib and /usr/include because of problems with dnl# gcc on some solaris systems. JD_ARG1[]_LIB=-L$jd_$1_library_dir if test "X$jd_$1_library_dir" = "X/usr/lib" then JD_ARG1[]_LIB="" else JD_SET_RPATH($jd_$1_library_dir) fi JD_ARG1[]_INC=-I$jd_$1_include_dir if test "X$jd_$1_include_dir" = "X/usr/include" then JD_ARG1[]_INC="" fi else AC_MSG_RESULT(no) jd_with_$1_library="no" JD_ARG1[]_INC="" JD_ARG1[]_LIB="" fi AC_SUBST(JD_ARG1[]_LIB) AC_SUBST(JD_ARG1[]_INC) ]) dnl#}}} AC_DEFUN(JD_WITH_LIBRARY, dnl#{{{ [ JD_CHECK_FOR_LIBRARY($1, $2) if test "$jd_with_$1_library" = "no" then AC_MSG_ERROR(unable to find the $1 library and header file $jd_$1_inc_file) fi ]) dnl#}}} AC_DEFUN(JD_SLANG_VERSION, dnl#{{{ [ slang_h=$jd_slang_include_dir/slang.h AC_MSG_CHECKING(SLANG_VERSION in $slang_h) slang_version=`grep "^#define *SLANG_VERSION " $slang_h | awk '{ print [$]3 }'` slang_major_version=`echo $slang_version | awk '{ print int([$]1/10000) }'` slang_minor_version=`echo $slang_version $slang_major_version | awk '{ print int(([$]1 - [$]2*10000)/100) }'` slang_patchlevel_version=`echo $slang_version $slang_major_version $slang_minor_version | awk '{ print ([$]1 - [$]2*10000 - [$]3*100) }'` AC_MSG_RESULT($slang_major_version.$slang_minor_version.$slang_patchlevel_version) AC_SUBST(slang_version) AC_SUBST(slang_major_version) AC_SUBST(slang_minor_version) AC_SUBST(slang_patchlevel_version) ]) #}}} AC_DEFUN(JD_SLANG_MODULE_INSTALL_DIR, dnl#{{{ [ AC_REQUIRE([JD_SLANG_VERSION]) if test "X$slang_major_version" = "X1" then MODULE_INSTALL_DIR="$libdir/slang/modules" else MODULE_INSTALL_DIR="$libdir/slang/v$slang_major_version/modules" fi SL_FILES_INSTALL_DIR=$datadir/slsh/local-packages AC_SUBST(MODULE_INSTALL_DIR) AC_SUBST(SL_FILES_INSTALL_DIR) ]) #}}} AC_DEFUN(JD_CHECK_LONG_LONG, dnl#{{{ [ AC_CHECK_TYPES(long long) AC_CHECK_SIZEOF(long long) ]) dnl#}}} AC_DEFUN(JD_LARGE_FILE_SUPPORTXXX, dnl#{{{ [ AC_REQUIRE([JD_CHECK_LONG_LONG]) AC_MSG_CHECKING(whether to explicitly activate long file support) AC_DEFINE(_LARGEFILE_SOURCE, 1) AC_DEFINE(_FILE_OFFSET_BITS, 64) jd_large_file_support=no if test X$ac_cv_type_long_long = Xyes then if test $ac_cv_sizeof_long_long -ge 8 then jd_large_file_support=yes fi fi if test $jd_large_file_support = yes then AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ]) dnl#}}} AC_DEFUN(JD_LARGE_FILE_SUPPORT, dnl#{{{ [ AC_SYS_LARGEFILE AC_FUNC_FSEEKO AC_TYPE_OFF_T AC_CHECK_SIZEOF(off_t) ]) #}}} AC_DEFUN(JD_HAVE_ISINF, dnl#{{{ [ AC_MSG_CHECKING([for isinf]) AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[isinf (0.0);]])], [AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_ISINF, 1)]) ]) #}}} slxfig-pre0.2.0-35/autoconf/config.sub0000755000175000000620000007054311076540262016374 0ustar johnstaff#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. timestamp='2002-03-07' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dsp16xx \ | fr30 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mipsisa32 | mipsisa64 \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3d) basic_machine=alpha-cray os=-unicos ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; windows32) basic_machine=i386-pc os=-windows32-msvcrt ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; c4x*) basic_machine=c4x-none os=-coff ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: slxfig-pre0.2.0-35/examples/0002755000175000000620000000000011076540262014402 5ustar johnstaffslxfig-pre0.2.0-35/examples/plot/0002755000175000000620000000000011210170554015351 5ustar johnstaffslxfig-pre0.2.0-35/examples/plot/image.sl0000644000175000000620000000222111076540262016775 0ustar johnstaffrequire ("xfig"); require ("png"); require ("maplib"); static define func (x, y) { (x, y) = maplib_meshgrid (x, y); return 3*(1-x)^2*exp(-x^2 - (y+1)^2) - 10*(x/5 - x^3 - y^5)*exp(-x^2-y^2) -0.5*exp(-(x+1)^2 - y^2); } define slsh_main () { variable x = [-3:3:0.05]; variable y = [-3:3:0.05]; variable z = func (x, y); variable colormap = "drywet"; png_write_flipped ("tmp1.png", png_gray_to_rgb (z, colormap)); variable scale = png_gray_to_rgb (_reshape([0:255],[256,1]), colormap); png_write_flipped ("tmp2.png", scale); variable width = 14, height = 14; variable w1 = xfig_plot_new (width, height); w1.world(x, y); w1.plot_png ("tmp1.png"); w1.xlabel ("$x$"; size="Large"); w1.ylabel ("$y$"; size="Large"); w1.title ("$f(x,y)=3(1-x)^2 e^{-x^2-(y+1)^2} +\ldots$"R; size="Large",color="blue"); variable w2 = xfig_plot_new (1, height); w2.world (0, 1, min(z), max(z)); w2.xaxis (;off); w2.y1axis (;off); w2.y2axis (;on); w2.y2label ("$f(x,y)$"); w2.plot_png ("tmp2.png"); xfig_new_hbox_compound (w1, w2, 2).render ("image.png"); () = remove ("tmp1.png"); () = remove ("tmp2.png"); } slxfig-pre0.2.0-35/examples/plot/run.sl0000755000175000000620000000063111172311150016512 0ustar johnstaff#!/usr/bin/env slsh prepend_to_slang_load_path (path_concat (getcwd (), "../../src")); require ("xfig"); %sldb ("xfig"); _traceback = 1; private define main () { if (__argc != 2) { () = fprintf (stderr, "Usage: ./%s \n", path_basename (__argv[0])); exit (1); } () = evalfile (path_concat ("./", __argv[1])); } main (); if (is_defined ("slsh_main")) slsh_main (); slxfig-pre0.2.0-35/examples/plot/scatter.sl0000644000175000000620000000055111107765375017375 0ustar johnstaffrequire ("xfig"); require ("gslrand"); public define slsh_main () { variable w = xfig_plot_new (14,14); variable x = ran_gaussian (1.0, 10000); variable y = ran_gaussian (1.0, 10000); w.world (-5,5,-5,5); w.plot (x,y;sym="point",size=0.1); w.add_object (xfig_new_text ("\\large points"), 0.25, 0.75 ; world00); w.render ("scatter.png"); } slxfig-pre0.2.0-35/examples/plot/symbol.sl0000644000175000000620000000150011100305155017203 0ustar johnstaffrequire ("xfig"); require ("rand"); public define slsh_main () { variable w = xfig_plot_new (); variable symbols = xfig_plot_get_symbol_names (); variable num = length (symbols); w.world (0, 1, 0, num+1); w.xaxis (;color="green3", width=2); w.yaxis (;color="green3", width=2); variable color = "blue"; variable dx = 0.1; _for (0, num-1, 1) { variable i = (); variable sym = symbols[i]; variable text = xfig_new_text (sym; size="Large"); w.plot (0.25, i+1; sym=sym, size=1, width=1, color=color, fill=20, fillcolor=color); w.add_object (text, 0.5, i+1); w.plot (0.8+dx, i+1; sym=sym, size=3, width=1, color="red"); dx = -dx; } w.title (w, "A plot with symbols"); w.xlabel ("Time [s]"R; color=0xFFCC00, size="Huge"); w.ylabel ("Voltage [mV]"R); w.render ("symbol.png"); } slxfig-pre0.2.0-35/examples/plot/project.sl0000644000175000000620000000173111076540262017366 0ustar johnstaff#!/usr/bin/env slsh () = fprintf (stderr, "This example is a work-in-progress\n"); exit (1); require ("xfig"); private define project_image (img, X, xhat, yhat, pixel_size) { xfig_set_eye (1000, 60, 0); variable nx, ny, dims; dims = array_shape (img); nx = dims[1]; ny = dims[0]; variable xll, xlr, xul, xur; variable dx = (nx*pixel_size)*xhat; variable dy = (ny*pixel_size)*yhat; Xll = X - 0.5*dx - 0.5*dy; Xlr = X + 0.5*dx - 0.5*dy; Xul = X - 0.5*dx + 0.5*dy; Xur = X + 0.5*dx + 0.5*dy; variable xll, xlr, xul, xur, yll, ylr, yul, yur; (xll, yll) = xfig_project_to_xfig_plane (Xll); (xlr, ylr) = xfig_project_to_xfig_plane (Xlr); (xur, yur) = xfig_project_to_xfig_plane (Xur); (xul, yul) = xfig_project_to_xfig_plane (Xul); variable xmin, ymin, xmax, ymax; xmin = min ([xll, xlr, xur, xul]); xmax = max ([xll, xlr, xur, xul]); ymin = min ([yll, ylr, yur, yul]); ymax = max ([yll, ylr, yur, yul]); } slxfig-pre0.2.0-35/examples/plot/histplt.sl0000644000175000000620000000123611210170554017400 0ustar johnstaffrequire ("xfig"); require ("rand"); require ("histogram"); private define gauss_pdf (x, sigma) { return 1.0/sqrt(2*PI*sigma^2) * exp(-0.5*x^2/sigma^2); } public define slsh_main () { variable mu = 100, sigma = 15, dx = 1.0; variable data = mu + rand_gauss (sigma, 10000); variable x = [min(data):max(data):dx]; variable h = hist1d (data, x)/(dx*length(data)); variable w = xfig_plot_new (); w.world (x,h); w.hplot (x, h; fillcolor="red", fill=20); h = gauss_pdf (x-mu,sigma); w.plot (x,h; color="blue"); w.xlabel ("IQ"); w.ylabel ("Probability [bin$^{-1}$]"); w.title ("IQ; $\sigma=100;\mu=15$"R); w.render ("histplt.png"); } slxfig-pre0.2.0-35/examples/plot/subplot.sl0000644000175000000620000000127411076540262017412 0ustar johnstaffrequire ("xfig"); public define slsh_main () { variable t = [0:5:#1000]; variable y = cos (2*PI*t)*exp(-t); variable w1 = xfig_plot_new (14, 6); variable w2 = xfig_plot_new (14, 3); variable w1w2 = xfig_new_vbox_compound (w1, w2, 0); w1.world (t, y;xlog); w1.x1axis(;ticlabels=0); w1.plot (t, y; color="blue3"); w1.plot (t[[::10]], y[[::10]]; sym="diamond", color="green2", line=0, fill=1); w1.title ("\Huge Two subplots"R); y = cos (2*PI*t); w2.world (t, y;xlog); w2.xlabel("\bf Time [s]"R); w2.plot (t, y); w1.ylabel("\bf Damped Oscillation"R); w2.ylabel("\bf\begin{center}Undamped\\Oscillation\end{center}"R); w1w2.render ("subplot.png"); } slxfig-pre0.2.0-35/examples/plot/simple.sl0000644000175000000620000000061411171567543017217 0ustar johnstaffrequire ("xfig"); public define slsh_main () { variable x = 10^[-0.5:1.5:#200]; variable y = sin (1/x)*exp(-x); variable w = xfig_plot_new (); w.plot (x, y;logx); variable legend = xfig_new_legend (["Damped"], ["black"], 0, 3, 2); w.add_object (legend, 2, 0); w.xlabel ("Time[s]"R); w.ylabel ("Voltage [mV]"R); w.title ("Simple Example"); w.render("simple.png"); } slxfig-pre0.2.0-35/examples/plot/errbar.sl0000644000175000000620000000137411076540262017200 0ustar johnstaffrequire ("xfig"); require ("gslrand"); require ("histogram"); define slsh_main () { variable mu = 5, sigma = 1; variable data = mu + ran_gaussian (sigma, 100); variable dx = 0.4; variable x = [min(data):max(data):dx]; variable y = hist1d (data, x); variable dy = sqrt (y); variable xx = [mu-5*sigma:mu+5*sigma:0.1*dx]; variable yy = (dx*length (data)) * gaussian_pdf (xx-mu, sigma); variable w = xfig_plot_new (); w.world (min(x), max(x), 0.9, max(y)*1.1); w.plot (xx, yy); x += 0.5*dx; w.plot (x,y, dx, dy ; line=0, sym="diamond", color="blue1", width=3, size=5, fill=10); w.title ("Example with error bars"); w.xlabel("$\lambda$ [\AA]"R); w.ylabel("Counts per bin"R); xfig_render_object (w, "errbar.png"); } slxfig-pre0.2.0-35/examples/plot/color.sl0000644000175000000620000000210311172311150017015 0ustar johnstaffrequire ("xfig"); public define slsh_main () { variable t = 10^[-1:1:#20]; variable y = cos (2*PI*t)*exp(-t); variable dy = 0.2 + 0.1*abs(y); variable w = xfig_plot_new (14, 10); w.title("Example with colors and fonts"; color="red4", size="Huge"); w.world (0.09, 12, -1.0, 1.0; xlog); w.axis (;grid=1, major_line=1, minor_line=2); w.xaxis (;color="magenta4",major_color="green2"); w.yaxis (;color="magenta4"); w.x1axis (;ticlabel_color="blue2"); w.y1axis (;ticlabel_color="green2"); w.plot (t, y, dy; line=2, color="red3", sym="triangle", symcolor="blue", symsize=2, fill=20, eb_color="green4"); w.xlabel ("Time [s]"R; color="cyan4", size="large"); w.ylabel ("Voltage [mV]"; color="red"); w.x2label ("This is the x2label";size="large", color="orange"); xfig_new_color ("aquamarine3", (102 shl 16)|(205 shl 8)|170); variable text = xfig_new_text ("Equation: \bf $e^{-t}\cos(2\pi t)$"R; color="black", size="Huge", style="sc"); text.set_depth(1); w.add_object (text, 10, 0.75, 0.5, 0); w.render ("color.png"); } slxfig-pre0.2.0-35/examples/plot/Makefile0000644000175000000620000000057611107765375017037 0ustar johnstaff# -*- sh -*- SL_FILES = simple.sl subplot.sl color.sl histplt.sl image.sl errbar.sl \ overlay.sl symbol.sl scatter.sl world.sl PNG_FILES = simple.png subplot.png color.png histplt.png image.png \ errbar.png symbol.png scatter.png world.png png: $(PNG_FILES) %.png: %.sl ./run.sl ./$< clean: /bin/rm -f $(PNG_FILES) *.fig *~ /bin/rm -rf slxfigtmp /bin/rm -rf tmp_* autoeps slxfig-pre0.2.0-35/examples/plot/overlay.sl0000644000175000000620000000410311076540262017375 0ustar johnstaffrequire ("xfig"); require ("png"); require ("gslrand"); require ("histogram"); private define make_hist_image (x, h, xmin, xmax, ymin, ymax, color) { variable w = xfig_plot_new (); w.world (xmin, xmax, ymin, ymax); xfig_plot_set_line_color (w, color); xfig_plot_shaded_histogram (w, x, h, color, 20); w.plot ([xmin, xmax], [ymin, ymax]; line=0, sym="point"); variable tmp = "tmp.png"; w.render (tmp); variable img = png_read (tmp); ()=remove (tmp); return img; } public define slsh_main () { variable mu = 100, sigma = 15; variable data = mu + ran_gaussian (sigma, 10000); variable x = [int(min(data)):1+int(max(data)):1]; variable h = hist1d (data, x)/(1.0*length(data)); variable xmin = min(x), xmax = max(x), ymin = 0, ymax = max(h); variable img1 = make_hist_image (x, h, xmin, xmax, ymin, ymax, "red"); data = 10 + mu + ran_gaussian (sigma, 10000); x = [int(min(data)):1+int(max(data)):1]; h = hist1d (data, x)/(1.0*length(data)); variable img2 = make_hist_image (x, h, xmin, xmax, ymin, ymax, "blue"); variable img1_r = png_rgb_get_r (img1); variable img1_g = png_rgb_get_g (img1); variable img1_b = png_rgb_get_b (img1); variable img2_r = png_rgb_get_r (img2); variable img2_g = png_rgb_get_g (img2); variable img2_b = png_rgb_get_b (img2); variable w1 = 0.5 + img1_r*0.0; variable i = where ((img1 == 0xFFFFFF) and (img2 != 0xFFFFFF)); w1[i] = 0.0; i = where ((img2 == 0xFFFFFF) and (img1 != 0xFFFFFF)); w1[i] = 1.0; variable w2 = 1.0 - w1; variable img12_r = typecast (w1*img1_r + w2*img2_r, UChar_Type); variable img12_g = typecast (w1*img1_g + w2*img2_g, UChar_Type); variable img12_b = typecast (w1*img1_b + w2*img2_b, UChar_Type); variable img12 = (img12_r shl 16)|(img12_g shl 8)|(img12_b); variable png = "tmp.png"; png_write (png, img12); variable w = xfig_plot_new (); w.world (xmin, ymin, xmax, ymax); xfig_plot_png (w, png); w.xlabel ("IQ"); w.ylabel ("Probability [bin$^{-1}$]"); w.title ("IQ; $\sigma=100;\mu=15$"R); w.render("overlay.png"); } slxfig-pre0.2.0-35/examples/plot/world.sl0000644000175000000620000000153011111501171017026 0ustar johnstaffrequire ("xfig"); require ("rand"); private define f2c (f) { return 5.0/9.0 * (f-32.0); } define slsh_main () { variable w = xfig_plot_new (); w.xlabel ("Length [inches]"); w.x2label ("Length [cm]"); w.ylabel ("Temperature [F]"); w.y2label ("Temperature [C]"); % Fake some data variable npts = 30; variable sigma_l = 0.2; variable sigma_t = 20.0; variable lengths = [3.0:12.0:#npts] + rand_gauss (sigma_l, npts); variable temps = [-200:120:#npts] + rand_gauss (sigma_t, npts); w.world1 (lengths, temps); w.world2 (2.54*lengths, f2c(temps)); % For fun, plot the data as inches-vs-C, which is world12 w.plot (lengths, f2c(temps), sigma_l, 5.0/9.0*sigma_t; world12, sym="x", color="blue"); w.shade_region (6, 8, 0, 1; world10, fillcolor="black", fill=5); w.render ("world.png"); } slxfig-pre0.2.0-35/examples/slxfigrc0000644000175000000620000000133711076540262016150 0ustar johnstaff%-*- slang -*- % This file should be copied to $HOME/.slxfigrc. It gets loaded each % time slxfig is loaded. % % slxfig autogenerates eps files by running latex. The xfig_set_autoeps_dir % function specifies the directory where these files are to be placed. xfig_set_autoeps_dir ("$HOME/.slxfig/autoeps"$); % Directory where temporary files are to be placed. xfig_set_tmp_dir ("slxfigtmp"); xfig_set_paper_size ("Letter"); % A4, .... xfig_add_latex_package ("mathpazo"); % If you have ps2ps installed, you might try using this command to % create the postscript files: % % xfig_set_output_driver ("ps", "fig2dev -L ps -c -z %P %I %B-tmp.ps" % + ";ps2ps %B-tmp.ps %O; rm -f %B-tmp.ps"); slxfig-pre0.2.0-35/configure0000755000175000000620000104541411076540262014502 0ustar johnstaff#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="src/gcontour-module.c" ac_default_prefix=/usr/local # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='RPATH SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE CONFIG_DIR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP DYNAMIC_LINK_LIB ELF_CC ELF_CFLAGS ELF_LINK ELF_LINK_CMD ELF_DEP_LIBS DYNAMIC_LINK_FLAGS CC_SHARED ELFLIB ELFLIB_MAJOR ELFLIB_MAJOR_MINOR ELFLIB_MAJOR_MINOR_MICRO SLANG_LIB_FOR_MODULES DLL_IMPLIB_NAME INSTALL_MODULE INSTALL_ELFLIB_TARGET ELFLIB_BUILD_NAME SLANG_DLL_CFLAGS XMKMF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS SLANG_LIB SLANG_INC slang_version slang_major_version slang_minor_version slang_patchlevel_version MODULE_INSTALL_DIR SL_FILES_INSTALL_DIR LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-x use the X Window System --with-slang=DIR Use DIR/lib and DIR/include for slang --with-slanglib=DIR slang library in DIR --with-slanginc=DIR slang include files in DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in autoconf "$srcdir"/autoconf; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&5 echo "$as_me: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi #These variable are initialized by JD init function CONFIG_DIR=`pwd` cd $srcdir if test "`pwd`" != "$CONFIG_DIR" then { { echo "$as_me:$LINENO: error: \"This software does not support configuring from another directory. See the INSTALL file\"" >&5 echo "$as_me: error: \"This software does not support configuring from another directory. See the INSTALL file\"" >&2;} { (exit 1); exit 1; }; } fi # Note: these will differ if one is a symbolic link if test -f /usr/bin/dirname; then JD_Above_Dir=`dirname $CONFIG_DIR` else # system is a loser JD_Above_Dir=`cd ..;pwd` fi JD_Above_Dir2=`cd ..;pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f conftest* ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_cv_c_compiler_gnu = yes; then { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_strerror+set}" = set; then break fi done if test "${ac_cv_search_strerror+set}" = set; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef hpux yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define _HPUX_SOURCE 1 _ACEOF if test "$CC" = cc; then CC="cc -Ae"; fi fi rm -f conftest* { echo "$as_me:$LINENO: checking C compiler that understands ANSI prototypes" >&5 echo $ECHO_N "checking C compiler that understands ANSI prototypes... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern int silly (int); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { echo "$as_me:$LINENO: result: $CC looks ok. Good." >&5 echo "${ECHO_T}$CC looks ok. Good." >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: $CC is not a good enough compiler" >&5 echo "${ECHO_T}$CC is not a good enough compiler" >&6; } { { echo "$as_me:$LINENO: error: Set env variable CC to your ANSI compiler and rerun configure." >&5 echo "$as_me: error: Set env variable CC to your ANSI compiler and rerun configure." >&2;} { (exit 1); exit 1; }; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done DYNAMIC_LINK_LIB="" if test "${ac_cv_header_dlfcn_h+set}" = set; then { echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; } if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; } if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; } fi if test $ac_cv_header_dlfcn_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DLFCN_H 1 _ACEOF { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then DYNAMIC_LINK_LIB="-ldl" cat >>confdefs.h <<\_ACEOF #define HAVE_DLOPEN 1 _ACEOF else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DLOPEN 1 _ACEOF fi if test "$ac_cv_func_dlopen" != yes then { echo "$as_me:$LINENO: WARNING: cannot perform dynamic linking" >&5 echo "$as_me: WARNING: cannot perform dynamic linking" >&2;} fi fi fi if test "$GCC" = yes then if test X"$CFLAGS" = X then CFLAGS="-O2" fi fi ELFLIB="lib\$(THIS_LIB).so" ELFLIB_MAJOR="\$(ELFLIB).\$(ELF_MAJOR_VERSION)" ELFLIB_MAJOR_MINOR="\$(ELFLIB_MAJOR).\$(ELF_MINOR_VERSION)" ELFLIB_MAJOR_MINOR_MICRO="\$(ELFLIB_MAJOR_MINOR).\$(ELF_MICRO_VERSION)" INSTALL_ELFLIB_TARGET="install-elf-and-links" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR_MINOR_MICRO)" INSTALL_MODULE="\$(INSTALL_DATA)" SLANG_DLL_CFLAGS="" case "$host_os" in *linux*|*gnu*|k*bsd*-gnu ) DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *solaris* ) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-ztext -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K PIC" ELF_LINK="\$(CC) \$(LDFLAGS) -G -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -K PIC" fi ;; # osr5 or unixware7 with current or late autoconf *sco3.2v5* | *unixware-5* | *sco-sysv5uw7*) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K pic" # ELF_LINK="ld -G -z text -h#" ELF_LINK="\$(CC) \$(LDFLAGS) -G -z text -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -K pic" fi ;; *irix6.5* ) echo "Note: ELF compiler for host_os=$host_os may not be correct" echo "double-check: 'mode_t', 'pid_t' may be wrong!" if test "$GCC" = yes then # not tested DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS)" # default anyhow ELF_LINK="\$(CC) \$(LDFLAGS) -shared -o \$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared" fi ;; *darwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fno-common" ELF_LINK="\$(CC) \$(LDFLAGS) -dynamiclib -install_name \$(install_lib_dir)/\$(ELFLIB_MAJOR) -compatibility_version \$(ELF_MAJOR_VERSION) -current_version \$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION)" ELF_DEP_LIBS="\$(LDFLAGS) \$(DL_LIB)" CC_SHARED="\$(CC) -bundle -flat_namespace -undefined suppress \$(CFLAGS) -fno-common" ELFLIB="lib\$(THIS_LIB).dylib" ELFLIB_MAJOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).dylib" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).dylib" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).\$(ELF_MICRO_VERSION).dylib" ;; *freebsd* ) ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" #if test "X$PORTOBJFORMAT" = "Xelf" ; then # ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" #else # ELF_LINK="ld -Bshareable -x" #fi ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *cygwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" SLANG_DLL_CFLAGS="-DSLANG_DLL=1" ELF_CFLAGS="\$(CFLAGS) -DBUILD_DLL=1" DLL_IMPLIB_NAME="lib\$(THIS_LIB)\$(ELFLIB_MAJOR_VERSION).dll.a" #ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME) -Wl,-export-all-symbols -Wl,-enable-auto-import" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED="\$(CC) \$(CFLAGS) -shared -DSLANG_DLL=1" SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang" INSTALL_MODULE="\$(INSTALL)" INSTALL_ELFLIB_TARGET="install-elf-cygwin" ELFLIB="lib\$(THIS_LIB).dll" ELFLIB_MAJOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION).dll" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION).dll" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION)_\$(ELF_MICRO_VERSION).dll" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR)" ;; * ) echo "Note: ELF compiler for host_os=$host_os may be wrong" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" esac case "$host_cpu" in *alpha* ) if test "$GCC" = yes then IEEE_CFLAGS="-mieee" else IEEE_CFLAGS="-ieee_with_no_inexact" fi ;; * ) IEEE_CFLAGS="" esac { echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 echo "$as_me: error: Cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >>confdefs.h <<\_ACEOF #define X_DISPLAY_MISSING 1 _ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS="$ac_xsave_LIBS -R $x_libraries" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: neither works" >&5 echo "${ECHO_T}neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. { echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_gethostbyname || defined __stub___gethostbyname choke me #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. { echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_connect || defined __stub___connect choke me #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. { echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6; } if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define remove to an innocuous variant, in case declares remove. For example, HP-UX 11i declares gettimeofday. */ #define remove innocuous_remove /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef remove /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_remove || defined __stub___remove choke me #endif int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. { echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shmat to an innocuous variant, in case declares shmat. For example, HP-UX 11i declares gettimeofday. */ #define shmat innocuous_shmat /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shmat /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shmat || defined __stub___shmat choke me #endif int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi if test "X$jd_prefix" = "X" then jd_prefix=$ac_default_prefix if test "X$prefix" != "XNONE" then jd_prefix="$prefix" fi jd_exec_prefix="$jd_prefix" if test "X$exec_prefix" != "XNONE" then jd_exec_prefix="$exec_prefix" fi eval `sh <&5 echo "$as_me: error: --with-slanglib requres a value" >&2;} { (exit 1); exit 1; }; } ;; *) jd_with_slang_library="yes" jd_slang_library_dir="$jd_with_slanglib_arg" ;; esac # Check whether --with-slanginc was given. if test "${with_slanginc+set}" = set; then withval=$with_slanginc; jd_with_slanginc_arg=$withval else jd_with_slanginc_arg=unspecified fi case "x$jd_with_slanginc_arg" in x) { { echo "$as_me:$LINENO: error: --with-slanginc requres a value" >&5 echo "$as_me: error: --with-slanginc requres a value" >&2;} { (exit 1); exit 1; }; } ;; xunspecified) ;; xno) ;; *) jd_with_slang_library="yes" jd_slang_include_dir="$jd_with_slanginc_arg" ;; esac { echo "$as_me:$LINENO: checking for the slang library and header files " >&5 echo $ECHO_N "checking for the slang library and header files ... $ECHO_C" >&6; } if test X"$jd_with_slang_library" != Xno then jd_slang_inc_file= if test "X$jd_slang_inc_file" = "X" then jd_slang_inc_file=slang.h fi if test X"$jd_slang_include_dir" = X then inc_and_lib_dirs="\ $jd_prefix_incdir,$jd_prefix_libdir \ /usr/local/slang/include,/usr/local/slang/lib \ /usr/local/include/slang,/usr/local/lib \ /usr/local/include,/usr/local/lib \ /usr/include/slang,/usr/lib \ /usr/slang/include,/usr/slang/lib \ /usr/include,/usr/lib \ /opt/include/slang,/opt/lib \ /opt/slang/include,/opt/slang/lib \ /opt/include,/opt/lib" case "$host_os" in *darwin* ) exts="dylib so a" ;; *cygwin* ) exts="dll.a so a" ;; * ) exts="so a" esac xincfile="$jd_slang_inc_file" xlibfile="libslang" jd_with_slang_library="no" for include_and_lib in $inc_and_lib_dirs do # Yuk. Is there a better way to set these variables?? xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'` xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'` found=0 if test -r $xincdir/$xincfile then for E in $exts do if test -r "$xlibdir/$xlibfile.$E" then jd_slang_include_dir="$xincdir" jd_slang_library_dir="$xlibdir" jd_with_slang_library="yes" found=1 break fi done fi if test $found -eq 1 then break fi done fi fi if test X"$jd_slang_include_dir" != X -a X"$jd_slang_library_dir" != X then { echo "$as_me:$LINENO: result: yes: $jd_slang_library_dir and $jd_slang_include_dir" >&5 echo "${ECHO_T}yes: $jd_slang_library_dir and $jd_slang_include_dir" >&6; } jd_with_slang_library="yes" SLANG_LIB=-L$jd_slang_library_dir if test "X$jd_slang_library_dir" = "X/usr/lib" then SLANG_LIB="" else if test "X$jd_slang_library_dir" != "X" then if test "X$RPATH" = "X" then case "$host_os" in *linux*|*solaris* ) if test "X$GCC" = Xyes then if test "X$ac_R_nospace" = "Xno" then RPATH="-Wl,-R," else RPATH="-Wl,-R" fi else if test "X$ac_R_nospace" = "Xno" then RPATH="-R " else RPATH="-R" fi fi ;; *osf*|*openbsd*) if test "X$GCC" = Xyes then RPATH="-Wl,-rpath," else RPATH="-rpath " fi ;; *netbsd*) if test "X$GCC" = Xyes then RPATH="-Wl,-R" fi ;; esac if test "X$RPATH" != "X" then RPATH="$RPATH$jd_slang_library_dir" fi else RPATH="$RPATH:$jd_slang_library_dir" fi fi fi SLANG_INC=-I$jd_slang_include_dir if test "X$jd_slang_include_dir" = "X/usr/include" then SLANG_INC="" fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } jd_with_slang_library="no" SLANG_INC="" SLANG_LIB="" fi if test "$jd_with_slang_library" = "no" then { { echo "$as_me:$LINENO: error: unable to find the slang library and header file $jd_slang_inc_file" >&5 echo "$as_me: error: unable to find the slang library and header file $jd_slang_inc_file" >&2;} { (exit 1); exit 1; }; } fi slang_h=$jd_slang_include_dir/slang.h { echo "$as_me:$LINENO: checking SLANG_VERSION in $slang_h" >&5 echo $ECHO_N "checking SLANG_VERSION in $slang_h... $ECHO_C" >&6; } slang_version=`grep "^#define *SLANG_VERSION " $slang_h | awk '{ print $3 }'` slang_major_version=`echo $slang_version | awk '{ print int($1/10000) }'` slang_minor_version=`echo $slang_version $slang_major_version | awk '{ print int(($1 - $2*10000)/100) }'` slang_patchlevel_version=`echo $slang_version $slang_major_version $slang_minor_version | awk '{ print ($1 - $2*10000 - $3*100) }'` { echo "$as_me:$LINENO: result: $slang_major_version.$slang_minor_version.$slang_patchlevel_version" >&5 echo "${ECHO_T}$slang_major_version.$slang_minor_version.$slang_patchlevel_version" >&6; } if test "X$slang_major_version" = "X1" then MODULE_INSTALL_DIR="$libdir/slang/modules" else MODULE_INSTALL_DIR="$libdir/slang/v$slang_major_version/modules" fi SL_FILES_INSTALL_DIR=$datadir/slsh/local-packages if test "X$slang_major_version" = "X1" then { { echo "$as_me:$LINENO: error: \"This software will not work with slang-1. Specify a path to slang-2\"" >&5 echo "$as_me: error: \"This software will not work with slang-1. Specify a path to slang-2\"" >&2;} { (exit 1); exit 1; }; } fi for ac_header in \ stdlib.h \ unistd.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for short" >&5 echo $ECHO_N "checking for short... $ECHO_C" >&6; } if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_short=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF { echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF { echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF { echo "$as_me:$LINENO: checking for float" >&5 echo $ECHO_N "checking for float... $ECHO_C" >&6; } if test "${ac_cv_type_float+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_float=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_float=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 echo "${ECHO_T}$ac_cv_type_float" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of float" >&5 echo $ECHO_N "checking size of float... $ECHO_C" >&6; } if test "${ac_cv_sizeof_float+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; '') if test "$ac_cv_type_float" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_float=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_float=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_float" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_float=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 echo "${ECHO_T}$ac_cv_sizeof_float" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_FLOAT $ac_cv_sizeof_float _ACEOF { echo "$as_me:$LINENO: checking for double" >&5 echo $ECHO_N "checking for double... $ECHO_C" >&6; } if test "${ac_cv_type_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_double=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 echo "${ECHO_T}$ac_cv_type_double" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of double" >&5 echo $ECHO_N "checking size of double... $ECHO_C" >&6; } if test "${ac_cv_sizeof_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') if test "$ac_cv_type_double" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_double=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_double=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_double" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_double=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 echo "${ECHO_T}$ac_cv_sizeof_double" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_DOUBLE $ac_cv_sizeof_double _ACEOF if test "X$libdir" != "X" then if test "X$RPATH" = "X" then case "$host_os" in *linux*|*solaris* ) if test "X$GCC" = Xyes then if test "X$ac_R_nospace" = "Xno" then RPATH="-Wl,-R," else RPATH="-Wl,-R" fi else if test "X$ac_R_nospace" = "Xno" then RPATH="-R " else RPATH="-R" fi fi ;; *osf*|*openbsd*) if test "X$GCC" = Xyes then RPATH="-Wl,-rpath," else RPATH="-rpath " fi ;; *netbsd*) if test "X$GCC" = Xyes then RPATH="-Wl,-R" fi ;; esac if test "X$RPATH" != "X" then RPATH="$RPATH$libdir" fi else RPATH="$RPATH:$libdir" fi fi ELF_CFLAGS="$ELF_CFLAGS $IEEE_CFLAGS" CFLAGS="$CFLAGS $IEEE_CFLAGS" ac_config_headers="$ac_config_headers src/config.h:src/config.hin" ac_config_files="$ac_config_files Makefile:autoconf/Makefile.in src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:src/config.hin" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:autoconf/Makefile.in" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF RPATH!$RPATH$ac_delim SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim RANLIB!$RANLIB$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim SET_MAKE!$SET_MAKE$ac_delim CONFIG_DIR!$CONFIG_DIR$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim DYNAMIC_LINK_LIB!$DYNAMIC_LINK_LIB$ac_delim ELF_CC!$ELF_CC$ac_delim ELF_CFLAGS!$ELF_CFLAGS$ac_delim ELF_LINK!$ELF_LINK$ac_delim ELF_LINK_CMD!$ELF_LINK_CMD$ac_delim ELF_DEP_LIBS!$ELF_DEP_LIBS$ac_delim DYNAMIC_LINK_FLAGS!$DYNAMIC_LINK_FLAGS$ac_delim CC_SHARED!$CC_SHARED$ac_delim ELFLIB!$ELFLIB$ac_delim ELFLIB_MAJOR!$ELFLIB_MAJOR$ac_delim ELFLIB_MAJOR_MINOR!$ELFLIB_MAJOR_MINOR$ac_delim ELFLIB_MAJOR_MINOR_MICRO!$ELFLIB_MAJOR_MINOR_MICRO$ac_delim SLANG_LIB_FOR_MODULES!$SLANG_LIB_FOR_MODULES$ac_delim DLL_IMPLIB_NAME!$DLL_IMPLIB_NAME$ac_delim INSTALL_MODULE!$INSTALL_MODULE$ac_delim INSTALL_ELFLIB_TARGET!$INSTALL_ELFLIB_TARGET$ac_delim ELFLIB_BUILD_NAME!$ELFLIB_BUILD_NAME$ac_delim SLANG_DLL_CFLAGS!$SLANG_DLL_CFLAGS$ac_delim XMKMF!$XMKMF$ac_delim X_CFLAGS!$X_CFLAGS$ac_delim X_PRE_LIBS!$X_PRE_LIBS$ac_delim X_LIBS!$X_LIBS$ac_delim X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim SLANG_LIB!$SLANG_LIB$ac_delim SLANG_INC!$SLANG_INC$ac_delim slang_version!$slang_version$ac_delim slang_major_version!$slang_major_version$ac_delim slang_minor_version!$slang_minor_version$ac_delim slang_patchlevel_version!$slang_patchlevel_version$ac_delim MODULE_INSTALL_DIR!$MODULE_INSTALL_DIR$ac_delim SL_FILES_INSTALL_DIR!$SL_FILES_INSTALL_DIR$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi echo "" echo "You are compiling with the following compiler configuration:" echo " CC =" "$CC" echo " CC_SHARED =" "$CC_SHARED" echo " CFLAGS =" "$CFLAGS" echo " LDFLAGS =" "$LDFLAGS" "$DYNAMIC_LINK_FLAGS" echo "" echo "The modules will be installed in $MODULE_INSTALL_DIR." echo "Any associated .sl files will be install in $SL_FILES_INSTALL_DIR" echo "" echo "If any of these quantities are incorrect, edit src/Makefile accordingly." echo "" slxfig-pre0.2.0-35/slxfig.lis0000644000175000000620000000164111076540262014571 0ustar johnstaff@slxfig.lis @INSTALL @Makefile @README @COPYING @configure 0755 @autoconf/Makefile.in @autoconf/aclocal.m4 @autoconf/config.guess 0755 @autoconf/config.sub 0755 @autoconf/configure.ac @autoconf/install.sh 0755 @autoconf/mkinsdir.sh 0755 @doc/tm/Makefile @doc/tm/fixtex.sl @doc/tm/slxfig.tm @doc/help/slxfig.hlp @doc/text/slxfig.txt @examples/slxfigrc @examples/plot/Makefile @examples/plot/color.sl @examples/plot/errbar.sl @examples/plot/histplt.sl @examples/plot/image.sl @examples/plot/overlay.sl @examples/plot/project.sl @examples/plot/simple.sl @examples/plot/subplot.sl @examples/plot/symbol.sl @src/Makefile.in @src/config.hin @src/gcontour-module.c @src/gcontour.sl @src/mkversion.sh 0755 @src/version.h @src/xfig.sl @src/vector.sl @src/xfig/NOTES @src/xfig/clip.sl @src/xfig/core.sl @src/xfig/ellipse.sl @src/xfig/latex.sl @src/xfig/objects.sl @src/xfig/plot.sl @src/xfig/png.sl @src/xfig/polyline.sl @src/xfig/text.sl slxfig-pre0.2.0-35/INSTALL0000644000175000000620000000303011076540262013607 0ustar johnstaff-*- text -*- To use this package you need to have slang-2, LaTeX, and xfig installed. Installing the package involves running the configure script, then running `make`, followed by `make install`. The configure script has two important options: --prefix=/installation-path-prefix This specifies path-prefix for the slxfig package --with-slang=/prefix-for-slang-2 This option is used to specify where slang-2 is located. If this option is unspecified, the argument specified for --prefix will be used. For example, suppose that slang-2 is installed under /usr/local, and that you wish to install the slxfig package under /home/bob/soft/. Then run the configure script via: ./configure --prefix=/home/bob/soft --with-slang=/usr/local This will cause the slxfig package to be installed in /home/bob/soft/lib/slang/v2/modules/ /home/bob/soft/share/slsh/local-packages/ Since in this case the installation directory is different from the slang location, slsh will not be able to find the slxfig package unless told where to look. The standard mechanism for doing this is to add: append_to_slang_load_path("/home/bob/soft/share/slsh/local-packages"); set_import_module_path (get_import_module_path() + ":/home/bob/soft/lib/slang/v2/modules); to your ~/.slshrc file. Now type make to create the package: make Assuming this step was successful, install it: make install To test the installation, try building some of the examples in the examples directory. slxfig-pre0.2.0-35/changes.txt0000644000175000000620000000643411210170554014733 0ustar johnstaffChanges since 0.1.0 1. src/xfig/plot.sl: modified major/minor axis routines to better deal with tic marks that span many orders of magnitude for log plots. 2. src/xfig/plot.sl: If a log-axis does not include a point 10^n, then use linear tics-marks. 3. src/xfig/plot.sl: Allow major/minor tic positions to be specified. 4. src/xfig/core.sl: Changed the way the colors are indexed to allow and allow colors to be specified by index. 5. src/xfig/polyline.sl: pict_scale was using the wrong object. 6. src/xfig/plot.sl: Use \times instead of \cdot for labels in the alt format 7. src/xfig/plot.sl: If a sym qualifier is given, do not draw lines unless line is also specified. 8. src/xfig/plot.sl: hplot method added for plotting histograms. 9. src/xfig/plot.sl: get_*_depth functions included a depth argument 10. src/xfig/plot.sl: Avoid the use of (@Array_Type) to create an array. 11. src/xfig/core.sl: Added orange, orange2-4 colors. 12. src/xfig/core.sl: All objects get set_pen_color, set_area_fill, set_thickness, set_lines_style, and set_fill_color methods. 13. src/xfig/objects.sl: Added qualifier support to a few functions. 14. src/xfig/polyline.sl: Added "just" qualifier to the xfig_new_pict function to specify its local coordinate system origin. 15. src/xfig/ellipse.sl: Fixed some bugs that surfaced when porting old code to use this version of xfig. 16. src/xfig/latex.sl: Added qualifier support to allow the "just" qualifier to propagate into the xfig_new_pict function. 17. examples/plot.sl: Tweaked some of the examples 18. src/xfig/plot.sl: plot_symbols now uses a polyline_list instead of individual polylines. This makes it run faster when many points are involved. 19. src/xfig/core.sl: If an integer is passed to xfig_lookup_color, the value returned will be modulo num_colors. 20. src/xfig/polyline.sl: Use xfig_lookup_color in set_color methods. 21. src/xfig/plot.sl: Added "star", "larr", "rarr", "uarr", and "darr" symbols. Also added xfig_plot_get_symbol_names functions. 22. examples/plot/symbol.sl: Rewrote this example. 23. src/vector.c: Modified the "vector" function to avoid an extra function when converting numeric value to a double. 24. src/xfig/polyline.sl: Tweaked the polyline_list_bbox method to improve performance. 25. src/xfig/plot.sl: added areafill and fillcolor qualifiers to the xfig_new_legend function. 26. src/xfig/polyline.sl: pict_scale was not accounting for the absolute position of the pict. 27. src/xfig/plot.sl: Added support for plotting via mixed world systems, e.g., world12, world21, etc. Also, world0 may be used to refer to device coordinates, which run from 0 to 1. 28. src/xfig/plot.sl: The hplot method will call the shaded histogram routine if a fill qualifier is given. 29. examples/plot/world.sl: A new example. Also some other examples were updated. 30. src/xfig/plot.sl: Added shade_region method and updated the world.sl example to illustrate its use. 31. src/xfig/plot.sl: When placing the title, account for the x2label. 32. src/xfig/plot.sl: Ignore tic_linestyle qualifier unless gridding. 33. src/xfig/plot.sl: Cleaned up the tic labeling code and added some minor tic labels when using log scaling. 34. src/vector.sl: small optimizations 35. src/xfig/clip.sl: Use slang2.2.0 list_to_array. slxfig-pre0.2.0-35/COPYING0000644000175000000620000004312711076540262013624 0ustar johnstaff GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. slxfig-pre0.2.0-35/README0000644000175000000620000000056311076540262013446 0ustar johnstaffslxfig is a package that implements a number of slang routines that interface with fig2dev and LaTeX to produce drawings. Examples include publication quality plots, etc. INSTALLATION: Read the INSTALL file. DOCUMENTATION: Currently, there is very little documentation. Eventually it will be in the doc/ directory. See examples/slxfigrc for an example setup file.