autotrace-0.31.1/0000777000076400007640000000000007563015112007340 5autotrace-0.31.1/README0000664000076400007640000001454507560007451010153 AutoTrace is a utility for converting bitmap into vector graphics. Features ======== - tracing outline and midline - color reduction and despeckling - supports a lot of input and output format Licenses ======== The program can be used under the GNU General Public License. The input and output functions (input-*.[ch] and output-*.[ch]) can also be used under the GNU Lesser General Public License(LGPL). Some of code was partially derived from limn of GNU fontutils. However, almost all code is rewritten. Platforms ========= The program was tested using GNU/Linux, HP UX, Solaris, Windows98, Windows NT, Windows 2000, MAC and OS/2 4.0. It compiles with GCC, Borland C++ Builder, Visual C++ and many other compilers. If you use Visual C++ 6.0 for compilation be sure to have at least SP 5 otherwise you could get Memory access violations due to a bug in earlier versions. Requirements ============ AutoTrace can be compiled standalone, then it can import pnm, pbm, pgm, ppm, bmp and tga files. If you have installed libpng (http://www.libpng.org/pub/png/libpng.html) you can also read png files and with ImageMagick a very broad range of input formats is available. You will need at least libpng 1.0.6 and ImageMagick 5.2.1. Most output formats like dxf, emf, eps, ai, er, fig, svg, epd, dr2d and sk are directly integrated in AutoTrace, but if you need swf export you need to install Ming (http://www.opaque.net/ming/). Also you can export to the p2e format. This format can be converted by pstoedit (www.pstoedit.net) to a large number of other formats. If you have installed the latest pstoedit(3.32 or newer), autotrace uses pstoedit directly. However, direct pstoedit support is not stable enough. See INSTALL file for more detail. Installation ============ See the file INSTALL. Usage ===== Program comes from two parts: command and library. Here the options you can use in the command: Usage: autotrace.exe [options] . Options: should be a supported image. You can use `--' or `-' to start an option. You can use any unambiguous abbreviation for an option name. You can separate option names and values with `=' or ` '. background-color : the color of the background that should be ignored, for example FFFFFF; default is no background color. centerline: trace a character's centerline, rather than its outline. color-count : number of colors a color bitmap is reduced to, it does not work on gray scale, allowed are 1..256; default is 0, that means not color reduction is done. corner-always-threshold : if the angle at a pixel is less than this, it is considered a corner, even if it is within `corner-surround' pixels of another corner; default is 60. corner-surround : number of pixels on either side of a point to consider when determining if that point is a corner; default is 4. corner-threshold : if a pixel, its predecessor(s), and its successor(s) meet at an angle smaller than this, it's a corner; default is 100. despeckle-level : 0..20; default is no despeckling. despeckle-tightness : 0.0..8.0; default is 2.0. dpi : The dots per inch value in the input image, affects scaling of mif output image error-threshold : subdivide fitted curves that are off by more pixels than this; default is 2.0. filter-iterations : smooth the curve this many times before fitting; default is 4. input-format: TGA, PBM, PNM, PGM, PPM or BMP. help: print this message. line-reversion-threshold : if a spline is closer to a straight line than this, weighted by the square of the curve length, keep it a straight line even if it is a list with curves; default is .01. line-threshold : if the spline is not more than this far away from the straight line defined by its endpoints, then output a straight line; default is 1. list-output-formats: print a list of support output formats to stderr. list-input-formats: print a list of support input formats to stderr. log: write detailed progress reports to .log. output-file : write to output-format : use format for the output file output-format : use format for the output file eps, ai, p2e, sk, svg, fig, swf, emf, mif, er, dxf, epd, pdf, cgm or dr2d can be used. preserve-width: whether to preserve line width prior to thinning.\n\ remove-adjacent-corners: remove corners that are adjacent. tangent-surround : number of points on either side of a point to consider when computing the tangent at that point; default is 3. report-progress: report tracing status in real time. debug-arch: print the type of cpu. debug-bitmap: dump loaded bitmap to .bitmap. version: print the version number of this program. width-weight-factor: weight factor for fitting the line width. The library is named libautotrace. About the usage of the library see autotrace.h. Here is a sample program that uses libautotrace. To compile, invoke following commands (on posix): gcc sample.c `./autotrace-config --libs` `./autotrace-config --cflags` /* sample.c */ #include int main() { char * fname = "img/triangle.png"; at_fitting_opts_type * opts = at_fitting_opts_new(); at_input_read_func rfunc = at_input_get_handler(fname); at_bitmap_type * bitmap ; at_splines_type * splines; at_output_write_func wfunc = at_output_get_handler_by_suffix("eps"); bitmap = at_bitmap_read(rfunc, fname, NULL, NULL, NULL); splines = at_splines_new(bitmap, opts, NULL, NULL); at_splines_write(wfunc, stdout, "", NULL splines, NULL, NULL); return 0; } GUI Frontend ============ Frontline, a Gtk+/Gnome based GUI frontend, is under development. See http://autotrace.sourceforge.net/frontline autotrace mailing list is used to discuss frontline. See next. More Information ================ See http://autotrace.sourceforge.net There is a mailing list to discussion autotrace. See also http://groups.yahoo.com/group/autotrace/ Contribution ============ Programmers wanted!!! See TODO and HACKING file and contact the author. Author ====== Martin Weber (martweb@gmx.net) autotrace-0.31.1/types.h0000664000076400007640000000275607551363217010616 /* types.h: general types Copyright (C) 2000, 2001 Martin Weber The author can be contacted at 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef TYPES_H #define TYPES_H #ifndef __cplusplus /* Booleans. */ #ifndef bool typedef enum { false = 0, true = 1 } at_bool; #else #define at_bool bool #endif #else #define at_bool bool #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* The usual null-terminated string. */ typedef char *at_string; /* A generic pointer in ANSI C. */ typedef void *at_address; /* We use `real' for our floating-point variables. */ typedef float at_real; /* Cartesian points. */ typedef struct _at_coord { unsigned short x, y; } at_coord; typedef struct _at_real_coord { at_real x, y, z; } at_real_coord; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* not TYPES_H */ autotrace-0.31.1/autotrace.h0000664000076400007640000003500507562773270011440 /* autotrace.h --- Autotrace API Copyright (C) 2000, 2001, 2002 Martin Weber The author can be contacted at 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef AUTOTRACE_H #define AUTOTRACE_H #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef N_ #define N_(x) x #endif /* Not def: N_ */ /* ===================================================================== * * Typedefs * ===================================================================== */ #include "types.h" typedef struct _at_fitting_opts_type at_fitting_opts_type; typedef struct _at_input_opts_type at_input_opts_type; typedef struct _at_output_opts_type at_output_opts_type; typedef struct _at_bitmap_type at_bitmap_type; typedef struct _at_color_type at_color_type; typedef enum _at_polynomial_degree at_polynomial_degree; typedef struct _at_spline_type at_spline_type; typedef struct _at_spline_list_type at_spline_list_type; typedef struct _at_spline_list_array_type at_spline_list_array_type; #define at_splines_type at_spline_list_array_type typedef enum _at_msg_type at_msg_type; /* Color in RGB */ struct _at_color_type { unsigned char r; unsigned char g; unsigned char b; }; /* Third degree is the highest we deal with. */ enum _at_polynomial_degree { AT_LINEARTYPE = 1, AT_QUADRATICTYPE = 2, AT_CUBICTYPE = 3, AT_PARALLELELLIPSETYPE = 4, AT_ELLIPSETYPE = 5, AT_CIRCLETYPE = 6 /* not the real number of points to define a circle but to distinguish between a cubic spline */ }; /* A Bezier spline can be represented as four points in the real plane: a starting point, ending point, and two control points. The curve always lies in the convex hull defined by the four points. It is also convenient to save the divergence of the spline from the straight line defined by the endpoints. */ struct _at_spline_type { at_real_coord v[4]; /* The control points. */ at_polynomial_degree degree; at_real linearity; }; /* Each outline in a character is typically represented by many splines. So, here is a list structure for that: */ struct _at_spline_list_type { at_spline_type *data; unsigned length; at_bool clockwise; at_color_type color; at_bool open; }; /* Each character is in general made up of many outlines. So here is one more list structure. */ struct _at_spline_list_array_type { at_spline_list_type *data; unsigned length; /* splines bbox */ unsigned short height, width; /* the values for following members are inherited from at_fitting_opts_type */ at_color_type * background_color; at_bool centerline; at_bool preserve_width; at_real width_weight_factor; }; /* Fitting option. With using at_fitting_opts_doc macro, the description of each option could be get. e.g. at_fitting_opts_doc(background_color) */ struct _at_fitting_opts_type { #define at_doc__background_color \ N_("background-color : the color of the background that " \ "should be ignored, for example FFFFFF; " \ "default is no background color.") at_color_type *background_color; #define at_doc__color_count \ N_("color-count : number of colors a color bitmap is reduced to, " \ "it does not work on grayscale, allowed are 1..256; " \ "default is 0, that means not color reduction is done.") unsigned color_count; #define at_doc__corner_always_threshold \ N_("corner-always-threshold : if the angle at a pixel is " \ "less than this, it is considered a corner, even if it is within " \ "`corner-surround' pixels of another corner; default is 60. ") at_real corner_always_threshold; #define at_doc__corner_surround \ N_("corner-surround : number of pixels on either side of a " \ "point to consider when determining if that point is a corner; " \ "default is 4. ") unsigned corner_surround; #define at_doc__corner_threshold \ N_("corner-threshold : if a pixel, its predecessor(s), " \ "and its successor(s) meet at an angle smaller than this, it's a " \ "corner; default is 100. ") at_real corner_threshold; #define at_doc__error_threshold \ N_("error-threshold : subdivide fitted curves that are off by " \ "more pixels than this; default is 2.0. ") at_real error_threshold; #define at_doc__filter_iterations \ N_("filter-iterations : smooth the curve this many times " \ "before fitting; default is 4.") unsigned filter_iterations; #define at_doc__line_reversion_threshold \ N_("line-reversion-threshold : if a spline is closer to a straight " \ "line than this, weighted by the square of the curve length, keep it a " \ "straight line even if it is a list with curves; default is .01. ") at_real line_reversion_threshold; #define at_doc__line_threshold \ N_("line-threshold : if the spline is not more than this far away " \ "from the straight line defined by its endpoints," \ "then output a straight line; default is 1. ") at_real line_threshold; #define at_doc__remove_adjacent_corners \ N_("remove-adjacent-corners: remove corners that are adjacent; " \ "default doesn't remove.") at_bool remove_adjacent_corners; #define at_doc__tangent_surround \ N_("tangent-surround : number of points on either side of a " \ "point to consider when computing the tangent at that point; " \ " default is 3.") unsigned tangent_surround; #define at_doc__despeckle_level \ N_("despeckle-level : 0..20; default is no despeckling. ") unsigned despeckle_level; #define at_doc__despeckle_tightness \ N_("despeckle-tightness : 0.0..8.0; default is 2.0. ") at_real despeckle_tightness; #define at_doc__centerline \ N_("centerline: trace a character's centerline, rather than its outline. ") at_bool centerline; #define at_doc__preserve_width \ N_("preserve-width: whether to preserve linewith with centerline fitting; " \ "default doesn't preserve.") at_bool preserve_width; #define at_doc__width_weight_factor \ N_("width-weight-factor: weight factor for fitting the linewidth") at_real width_weight_factor; }; struct _at_input_opts_type { at_color_type *background_color; }; struct _at_output_opts_type { int dpi; /* DPI is used only in MIF output.*/ }; struct _at_bitmap_type { unsigned short height; unsigned short width; unsigned char *bitmap; unsigned int np; }; enum _at_msg_type { AT_MSG_FATAL = 1, AT_MSG_WARNING, }; typedef void (* at_msg_func) (at_string msg, at_msg_type msg_type, at_address client_data); /* * IO Handler typedefs */ typedef at_bitmap_type (*at_input_read_func) (at_string name, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data); typedef int (*at_output_write_func) (FILE*, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_splines_type shape, at_msg_func msg_func, at_address msg_data); /* * Progress handler typedefs * 0.0 <= percentage <= 1.0 */ typedef void (* at_progress_func) (at_real percentage, at_address client_data); /* * Test cancel * Return true if auto-tracing should be stopped. */ typedef at_bool (* at_testcancel_func) (at_address client_data); /* ===================================================================== * * Functions * ===================================================================== */ /* --------------------------------------------------------------------- * * Fitting option related * * TODO: internal data access, copy * --------------------------------------------------------------------- */ at_fitting_opts_type * at_fitting_opts_new(void); at_fitting_opts_type * at_fitting_opts_copy (at_fitting_opts_type * original); void at_fitting_opts_free(at_fitting_opts_type * opts); /* TODO: Gettextize */ #define at_fitting_opts_doc(opt) _(at_doc__##opt) /* --------------------------------------------------------------------- * * Input option related * * TODO: internal data access * --------------------------------------------------------------------- */ at_input_opts_type * at_input_opts_new(void); at_input_opts_type * at_input_opts_copy(at_input_opts_type * original); void at_input_opts_free(at_input_opts_type * opts); /* --------------------------------------------------------------------- * * Output option related * * TODO: internal data access * --------------------------------------------------------------------- */ at_output_opts_type * at_output_opts_new(void); at_output_opts_type * at_output_opts_copy(at_output_opts_type * original); void at_output_opts_free(at_output_opts_type * opts); /* --------------------------------------------------------------------- * * Bitmap related * * TODO: internal data access * --------------------------------------------------------------------- */ /* There is two way to build at_bitmap_type. 1. Using input reader Use at_bitmap_read. at_input_get_handler_by_suffix or at_input_get_handler will help you to get at_input_read_func. 2. Allocating a bitmap and rendering an image on it by yourself Use at_bitmap_new. In both case, you have to call at_bitmap_free when at_bitmap_type * data are no longer needed. */ at_bitmap_type * at_bitmap_read (at_input_read_func input_reader, at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data); at_bitmap_type * at_bitmap_new(unsigned short width, unsigned short height, unsigned int planes); at_bitmap_type * at_bitmap_copy(at_bitmap_type * src); /* We have to export functions that supports internal datum access. Such functions might be useful for at_bitmap_new user. */ unsigned short at_bitmap_get_width (at_bitmap_type * bitmap); unsigned short at_bitmap_get_height (at_bitmap_type * bitmap); unsigned short at_bitmap_get_planes (at_bitmap_type * bitmap); void at_bitmap_free (at_bitmap_type * bitmap); /* --------------------------------------------------------------------- * * Spline related * * TODO: internal data access * --------------------------------------------------------------------- */ /* at_splines_new args: BITMAP is modified in at_splines_new according to opts. Therefore if you need the original bitmap image, you have to make a backup of BITMAP with using at_bitmap_copy. MSG_FUNC and MSG_DATA are used to notify a client errors and warning from autotrace. NULL is valid value for MSG_FUNC if the client is not interested in the notifications. */ at_splines_type * at_splines_new (at_bitmap_type * bitmap, at_fitting_opts_type * opts, at_msg_func msg_func, at_address msg_data); /* at_splines_new_full args: NOTIFY_PROGRESS is called repeatedly inside at_splines_new_full to notify the progress of the execution. This might be useful for interactive applications. NOTIFY_PROGRESS is called following format: NOTIFY_PROGRESS (percentage, progress_data); test_cancel is called repeatedly inside at_splines_new_full to test whether the execution is canceled or not. If test_cancel returns TRUE, execution of at_splines_new_full is stopped as soon as possible and returns NULL. If test_cancel returns FALSE, nothing happens. test_cancel is called following format: TEST_CANCEL (testcancel_data); NULL is valid value for notify_progress and/or test_cancel if you don't need to know the progress of the execution and/or cancel the execution */ at_splines_type * at_splines_new_full (at_bitmap_type * bitmap, at_fitting_opts_type * opts, at_msg_func msg_func, at_address msg_data, at_progress_func notify_progress, at_address progress_data, at_testcancel_func test_cancel, at_address testcancel_data); void at_splines_write(at_output_write_func output_writer, FILE * writeto, at_string file_name, at_output_opts_type * opts, at_splines_type * splines, at_msg_func msg_func, at_address msg_data); void at_splines_free (at_splines_type * splines); /* --------------------------------------------------------------------- * * Color related * --------------------------------------------------------------------- */ at_color_type * at_color_new (unsigned char r, unsigned char g, unsigned char b); at_color_type * at_color_copy (at_color_type * original); at_bool at_color_equal (at_color_type * c1, at_color_type * c2); void at_color_free (at_color_type * color); /* --------------------------------------------------------------------- * * Input related * --------------------------------------------------------------------- */ at_input_read_func at_input_get_handler (at_string filename); at_input_read_func at_input_get_handler_by_suffix (at_string suffix); char ** at_input_list_new (void); void at_input_list_free(char ** list); /* at_input_shortlist return value: Do free by yourself */ char * at_input_shortlist (void); /* --------------------------------------------------------------------- * * Output related * --------------------------------------------------------------------- */ at_output_write_func at_output_get_handler (at_string filename); at_output_write_func at_output_get_handler_by_suffix (at_string suffix); char ** at_output_list_new (void); void at_output_list_free(char ** list); /* at_output_shortlist return value: Do free by yourself */ char * at_output_shortlist (void); /* --------------------------------------------------------------------- * * Misc * --------------------------------------------------------------------- */ /* at_version args: LONG_FORMAT == true: "AutoTrace version x.y" LONG_FORMAT == false: "x.y" return value: Don't free. It is allocated statically */ const char * at_version (at_bool long_format); /* at_home_site return value: Don't free. It is allocated statically */ const char * at_home_site (void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* AUTOTRACE_H */ autotrace-0.31.1/input.h0000664000076400007640000000541707551363216010605 /* input.h: interface for input handlers Copyright (C) 1999, 2000, 2001 Bernhard Herzog. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef INPUT_H #define INPUT_H #include "types.h" #include "autotrace.h" #include "exception.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Input handler should be implemented with using following functions and macros. */ /* at_input_add_handler Register an input handler to autotrace. */ extern int at_input_add_handler (at_string suffix, at_string description, at_input_read_func func); /* at_bitmap_init Return initialized at_bitmap_type value. args: AREA is used as a storage of returned value. If AREA is NULL, the storage is newly allocated by at_bitmap_init. In such case the size of storage is automatically calculated by WIDTH, HEIGHT and PLANES. PLANES must be 1(gray scale) or 3(RGB color). return value: The return value is not newly allocated. Only the storage is allocated if AREA is NULL. On the other hand, at_bitmap_new allocates mem for at_bitmap_type; and returns a pointer for the mem. at_bitmap_new is for autotrace library user. at_bitmap_init is for input-handler developer. Don't use at_bitmap_new in your input-handler. */ extern at_bitmap_type at_bitmap_init(unsigned char * area, unsigned short width, unsigned short height, unsigned int planes); /* TODO: free storage */ /* The number of color planes of each pixel */ #define AT_BITMAP_PLANES(b) ((b).np) /* The pixels, represented as an array of bytes (in contiguous storage). Each pixel is represented by np bytes. */ #define AT_BITMAP_BITS(b) ((b).bitmap) /* These are convenient abbreviations for geting inside the members. */ #define AT_BITMAP_WIDTH(b) ((b).width) #define AT_BITMAP_HEIGHT(b) ((b).height) /* This is the pixel at [ROW,COL]. */ #define AT_BITMAP_PIXEL(b, row, col) \ ((AT_BITMAP_BITS (b) + (row) * AT_BITMAP_PLANES (b) * AT_BITMAP_WIDTH (b) \ + (col) * AT_BITMAP_PLANES(b))) #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* Not def: INPUT_H */ autotrace-0.31.1/output.h0000664000076400007640000000751107551363216011003 /* output.h: interface for output handlers Copyright (C) 1999, 2000, 2001, 2002 Bernhard Herzog. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_H #define OUTPUT_H #include #include "autotrace.h" #include "types.h" #include "exception.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Data struct hierarchy: spline_list_array (splines) -> spline_list... --> spline */ /* Accessors to the Data member */ #define AT_SPLINE_START_POINT_VALUE(spl) ((spl).v[0]) #define AT_SPLINE_CONTROL1_VALUE(spl) ((spl).v[1]) #define AT_SPLINE_CONTROL2_VALUE(spl) ((spl).v[2]) #define AT_SPLINE_END_POINT_VALUE(spl) ((spl).v[3]) #define AT_SPLINE_DEGREE_VALUE(spl) ((spl).degree) #define AT_SPLINE_START_POINT(spl) (&AT_SPLINE_START_POINT_VALUE(*(spl))) #define AT_SPLINE_CONTROL1(spl) (&AT_SPLINE_CONTROL1_VALUE(*(spl))) #define AT_SPLINE_CONTROL2(spl) (&AT_SPLINE_CONTROL2_VALUE(*(spl))) #define AT_SPLINE_END_POINT(spl) (&AT_SPLINE_END_POINT_VALUE(*(spl))) #define AT_SPLINE_DEGREE(spl) AT_SPLINE_DEGREE_VALUE(*(spl)) #define AT_SPLINE_LIST_LENGTH_VALUE(spll) ((spll).length) #define AT_SPLINE_LIST_LENGTH(spll) AT_SPLINE_LIST_LENGTH_VALUE(*(spll)) #define AT_SPLINE_LIST_DATA_VALUE(spll) ((spll).data) #define AT_SPLINE_LIST_DATA(spll) AT_SPLINE_LIST_DATA_VALUE((*spll)) #define AT_SPLINE_LIST_ELT_VALUE(spll,index) AT_SPLINE_LIST_DATA_VALUE(spll)[(index)] #define AT_SPLINE_LIST_ELT(spll,index) (&(AT_SPLINE_LIST_ELT_VALUE((*spll), (index)))) #define AT_SPLINE_LIST_COLOR_VALUE(spll) ((spll).color) #define AT_SPLINE_LIST_COLOR(spll) (&(AT_SPLINE_LIST_COLOR_VALUE(*spll))) #define AT_SPLINE_LIST_IS_OPENED_VALUE(spll) ((spll).open) #define AT_SPLINE_LIST_IS_OPENED(spll) AT_SPLINE_LIST_IS_OPENED_VALUE(*(spll)) #define AT_SPLINE_LIST_ARRAY_LENGTH_VALUE AT_SPLINE_LIST_LENGTH_VALUE #define AT_SPLINE_LIST_ARRAY_LENGTH AT_SPLINE_LIST_LENGTH #define AT_SPLINE_LIST_ARRAY_ELT_VALUE AT_SPLINE_LIST_ELT_VALUE #define AT_SPLINE_LIST_ARRAY_ELT AT_SPLINE_LIST_ELT #define AT_SPLINE_LIST_ARRAY_IS_CENTERLINE_VALUE(splla) ((splla).centerline) #define AT_SPLINE_LIST_ARRAY_IS_CENTERLINE(splla) AT_SPLINE_LIST_ARRAY_IS_CENTERLINE_VALUE(*(splla)) /* * Glib style traversing */ typedef void (* AtSplineListForeachFunc) (at_spline_list_type * spline_list, at_spline_type * spline, int index, at_address user_data); typedef void (* AtSplineListArrayForeachFunc) (at_spline_list_array_type * spline_list_array, at_spline_list_type * spline_list, int index, at_address user_data); void at_spline_list_foreach (at_spline_list_type *, AtSplineListForeachFunc func, at_address user_data); void at_spline_list_array_foreach (at_spline_list_array_type *, AtSplineListArrayForeachFunc func, at_address user_data); int at_output_add_handler (at_string suffix, at_string description, at_output_write_func func); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* not OUTPUT_H */ autotrace-0.31.1/exception.h0000664000076400007640000000164507551363251011442 /* exception.h: facility to handle error in autotrace */ #ifndef AT_EXCEPTION_H #define AT_EXCEPTION_H #include "autotrace.h" #include "types.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Protocol: If a function raises a FATAL(including propagation), the function must release resources allocated by the function itself. */ typedef struct _at_exception_type at_exception_type; struct _at_exception_type { at_msg_type msg_type; at_msg_func client_func; at_address * client_data; }; at_exception_type at_exception_new(at_msg_func client_func, at_address client_data); at_bool at_exception_got_fatal(at_exception_type * exception); void at_exception_fatal(at_exception_type * exception, const at_string message); void at_exception_warning(at_exception_type * exception, const at_string message); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* Not def: AT_EXCEPTION_H */ autotrace-0.31.1/filename.h0000664000076400007640000000315607551363227011226 /* filename.h: Function manipulate file names Was: find-suffix, extend-fname, make-suffix, remove-suffix */ /* remove-suffx.h: declarations for shared routines. Copyright (C) 1992 Free Software Foundation, Inc. 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef FILENAME_H #define FILENAME_H #include "types.h" /* If NAME has a suffix, return a pointer to its first character (i.e., the one after the `.'); otherwise, return NULL. */ extern at_string find_suffix (at_string name); /* If NAME has a suffix, simply return it; otherwise, return `NAME.SUFFIX'. */ extern at_string extend_filename (at_string name, at_string suffix); /* Return S with the suffix SUFFIX, removing any suffix already present. For example, `make_suffix ("/foo/bar.baz", "karl")' returns `/foo/bar.karl'. Returns a string allocated with malloc. */ extern at_string make_suffix (at_string s, at_string suffix); /* Return NAME with any suffix removed. */ extern at_string remove_suffix (at_string name); #endif /* Not def: FILENAME_H */ autotrace-0.31.1/xstd.h0000664000076400007640000000413207551363241010417 /* xstd.h: Wrappers for functions in C standard library Was: xmem, xfile */ /* These call the corresponding function in the standard library, and abort if those routines fail. */ #ifndef XSTD_H #define XSTD_H #include "types.h" #include "message.h" #include #include #include /* * XMEM */ #ifndef __cplusplus #define XMALLOC(new_mem, size) \ do \ { \ new_mem = (at_address) malloc (size); \ assert(new_mem); \ } while (0) #define XCALLOC(new_mem, size) \ do \ { \ new_mem = (at_address) calloc (size, 1); \ assert(new_mem); \ } while (0) #define XREALLOC(old_ptr, size) \ do \ { \ at_address new_mem; \ \ if (old_ptr == NULL) \ XMALLOC (new_mem, size); \ else \ { \ new_mem = (at_address) realloc (old_ptr, size); \ assert(new_mem); \ } \ \ old_ptr = new_mem; \ } while (0) #else /* Use templates if Cplusplus... */ #define XMALLOC(new_mem, size) \ do \ { \ (at_address&)(new_mem) = (at_address) malloc (size); \ assert(new_mem); \ } while (0) #define XCALLOC(new_mem, sizex) \ do \ { \ (at_address&)(new_mem) = (void *) calloc (sizex, 1); \ assert(new_mem); \ } while (0) #define XREALLOC(old_ptr, size) \ do \ { \ at_address new_mem; \ \ if (old_ptr == NULL) \ XMALLOC (new_mem, (size)); \ else \ { \ (at_address&) new_mem = (at_address) realloc ((old_ptr), (size)); \ assert(new_mem); \ } \ \ (at_address&)old_ptr = new_mem; \ } while (0) #endif /* * XFILE */ /* Like their stdio counterparts, but abort on error, after calling perror(3) with FILENAME as its argument. */ extern FILE *xfopen (at_string filename, at_string mode); extern void xfclose (FILE *, at_string filename); extern void xfseek (FILE *, long, int, at_string filename); #endif /* Not XSTD_H */ autotrace-0.31.1/logreport.h0000664000076400007640000000212307551363231011447 /* logreport.h: status reporting routines. */ #ifndef LOGREPORT_H #define LOGREPORT_H #include #include "types.h" #ifdef _EXPORTING /* The file we write information to. */ extern FILE __declspec(dllexport) *log_file; #elif _IMPORTING /* The file we write information to. */ extern FILE __declspec(dllimport) *log_file; #else /* The file we write information to. */ extern FILE *at_log_file; #define log_file at_log_file #endif extern void flush_log_output (void); #define LOG(s) \ do { if (log_file) fputs (s, log_file); } while (0) #define LOG1(s, e) \ do { if (log_file) fprintf (log_file, s, e); } while (0) #define LOG2(s, e1, e2) \ do { if (log_file) fprintf (log_file, s, e1, e2); } while (0) #define LOG3(s, e1, e2, e3) \ do { if (log_file) fprintf (log_file, s, e1, e2, e3); } while (0) #define LOG4(s, e1, e2, e3, e4) \ do { if (log_file) fprintf (log_file, s, e1, e2, e3, e4); } while (0) #define LOG5(s, e1, e2, e3, e4, e5) \ do { if (log_file) fprintf (log_file, s, e1, e2, e3, e4, e5); } while (0) #endif /* not LOGREPORT_H */ autotrace-0.31.1/message.h0000664000076400007640000000352107551363234011064 /* message.h: extend the standard programming environment a little. This is included from config.h, which everyone includes. */ #ifndef MESSAGE_H #define MESSAGE_H #include "logreport.h" #include "types.h" #include #include /* Define common sorts of messages. */ /* This should be called only after a system call fails. */ #define FATAL_PERROR(s) do { perror (s); exit (errno); } while (0) #define START_FATAL() do { fputs ("fatal: ", stderr); LOG("fatal: ") #define END_FATAL() fputs (".\n", stderr); exit (1); } while (0) #define FATAL(s) \ START_FATAL (); fprintf (stderr, "%s", s); LOG (s); END_FATAL () #define FATAL1(s, e1) \ START_FATAL (); fprintf (stderr, s, e1); LOG1 (s, e1); END_FATAL () #define FATAL2(s, e1, e2) \ START_FATAL (); fprintf (stderr, s, e1, e2); LOG2 (s, e1, e2); END_FATAL () #define FATAL3(s, e1, e2, e3) \ START_FATAL (); fprintf (stderr, s, e1, e2, e3); LOG3 (s, e1, e2, e3); END_FATAL () #define FATAL4(s, e1, e2, e3, e4) \ START_FATAL (); fprintf (stderr, s, e1, e2, e3, e4); LOG4 (s, e1, e2, e3, e4); END_FATAL () #define START_WARNING() do { fputs ("warning: ", stderr); LOG ("warning: ") #define END_WARNING() fputs (".\n", stderr); } while (0) #define WARNING(s) \ START_WARNING (); fprintf (stderr, "%s", s); LOG (s); END_WARNING () #define WARNING1(s, e1) \ START_WARNING (); fprintf (stderr, s, e1); LOG1 (s, e1); END_WARNING () #define WARNING2(s, e1, e2) \ START_WARNING (); fprintf (stderr, s, e1, e2); LOG2 (s, e1, e2); END_WARNING () #define WARNING3(s, e1, e2, e3) \ START_WARNING (); fprintf (stderr, s, e1, e2, e3); LOG3 (s, e1, e2, e3); END_WARNING () #define WARNING4(s, e1, e2, e3, e4) \ START_WARNING (); fprintf (stderr, s, e1, e2, e3, e4); LOG4 (s, e1, e2, e3, e4); END_WARNING () #endif /* not MESSAGE_H */ autotrace-0.31.1/stamp-h.in0000664000076400007640000000001207563015074011157 timestamp autotrace-0.31.1/AUTHORS0000664000076400007640000000003407551363214010331 Martin Weber martweb@gmx.netautotrace-0.31.1/COPYING0000664000076400007640000004311507551363215010324 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111 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 Appendix: 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 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. autotrace-0.31.1/COPYING.LIB0000664000076400007640000006347607551363403010744 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 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. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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 Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! autotrace-0.31.1/ChangeLog0000664000076400007640000021716407562774115011061 2002-11-09 Masatake YAMATO * configure.in: version 0.31.1. echo building configuration at the end of configure. 2002-11-09 Masatake YAMATO * autotrace.h: Don't define _(). * configure.in: LT_CURRENT=3. See my change at 2002-10-31. 2002-11-09 Martin Weber * output-dr2d.c (BuildDRHD::FloatAsIEEEBytes): Change the position where the datum is written. Message-ID: <3DCBECAB.6198C58D@gmx.net>. 2002-11-09 Martin Weber * output-dxf.c (output_layer): move the declaration of last_color to the out of loop. Message-ID: <3DCBC646.8B714DA2@gmx.net>. 2002-11-09 Martin Weber * pxl-outline.c (find_one_centerline): search_dir, an argument, is now actual value, not a pointer. (*): passed a value to find_one_centerline at the function argument, search_dir. (*): fix a broken log fromat string. Message-ID: <3DCBBBC9.A3F8985E@gmx.net>. 2002-11-08 Martin Weber * pxl-outline.c: Big changes again that fix a bug related to centerline tracing. NOTE: A bug is still existed. Message-ID: <3DCAAAD7.F55305EA@gmx.net>. 2002-11-07 Martin Weber * filename.c: Removed some 64 and 128 bit problems. * input.c: ditto. * output-cgm.c: ditto. * output-emf.c: ditto. * output-pdf.c: ditto. * output.c: ditto. * strgicmp.c: ditto. * strgicmp.h: ditto. Message-ID: <3DC96244.A37B85BB@gmx.net>. 2002-11-07 Masatake YAMATO * spline.[ch]: Removed unused ifdefs. 2002-11-04 Martin Weber * fit.c: fix code broken by Masatake at 2002-11-04. 2002-11-04 Masatake YAMATO * fit.c (new_fitting_opts::error_threshold): Fix the default value to 2.0. 2002-11-03 Masatake YAMATO * fit.[ch]: Removed unused ifdefs. 2002-10-31 Masatake YAMATO * *: width_factor, weight_factor -> width_weight_factor. * configure.in: added -lm to the macro that checks libpng. Suggested by jlm . 2002-10-29 Martin Weber * pxl-outline.c (is_valid_dir): used COMPUTE_DELTA twice to avoid a bug. Message-ID: <3DBEDC7E.9F1FD467@gmx.net>. 2002-10-30 Masatake YAMATO * configure.in: Display more messages while checking pstoedit twice. Suggested by Markus Demleitner . 2002-10-29 Martin Weber * pxl-outline.c (num_neighbors): New function. (find_centerline_pixels): Use num_neighbors. Message-ID: <3DBEB1A2.4CC602BA@gmx.net>. 2002-10-29 Masatake YAMATO * input-magick.c (input_magick_reader): Do DestroyImage before DestroyImageInfo. * main.c (main): Put a space in a message(inputformat). (read_command_line): Fix a typo. 2002-10-26 Ralf Stubner * autotrace.c: #include "output-pstoedit.h" with ifdef. 2002-10-24 Masatake YAMATO * configure.in: version 0.31.0. 2002-10-24 Martin Weber * autotrace.dsp (RSC): Version 0.31. * autotrace.vcproj: Ditto. 2002-10-23 Martin Weber * pxl-outline.c (is_valid_dir): removed comment. * NEWS: updated. Message-ID: <21731.1035350777@www20.gmx.net>. 2002-10-23 Masatake YAMATO * output-pstoedit.c (get_symbolicname) (pstoedit_suffix_table_init): free return value of getPstoeditDriverInfo_plainC. (get_symbolicname): returned value is strdup'ed. (output_pstoedit_writer): free symbolicname. * output-pstoedit.[ch]: rewrote code that handles suffix. * autotrace.c (at_splines_write): Use output_pstoedit_invoke_writer if output_pstoedit_is_writer returns true for output_writer. * HACKING: Updated about autotools. 2002-10-22 Masatake YAMATO * output-pstoedit.c (remove_temporary_file): Renamed from remove_tmpfile. (output_pstoedit_writer): Make static. * pxl-outline.[ch]: removed unsed ifdefs. 2002-10-22 Martin Weber * pxl-outline.c: Big changes that fix a bug related to centerline tracing. 2002-10-21 Martin Weber * input-magick.c: Checked autotrace works with ImageMagick-5.5.2. Message-ID: <3DB448EA.E3A63661@gmx.net>. 2002-10-20 Masatake YAMATO * autogen.sh: checked aclocal-1.4, automake-1.4 and autoconf-2.53 are available or not. * autotrace.h: defined N_ and _ only if they are not defined. 2002-10-10 Martin Weber * autotrace.1: updated again. 2002-10-10 Masatake YAMATO * configure.in: Use ' instead of " to retrieve MAGICK_MAJOR_VERSION. 2002-10-10 Martin Weber * autotrace.1: updated. 2002-10-10 Masatake YAMATO * main.c (USAGE2): added to width-factor. 2002-10-09 Masatake YAMATO * FAQ: Fix a typo. Suggested by Martin. * configure.in: version 0.30.8. Updated cocuments. 2002-10-08 Martin Weber * input-magick.c (input_magick_reader): Use AT_ macros. antialiasing is switched off. Update comments. autotrace is ready for ImageMagick 5.4.9. Message-ID: <3DA2FFF4.5D564F9@gmx.net>. 2002-10-08 Martin Weber * fit.c (split_at_corners, fit_curve_list): handle very small objects. Message-ID: <3DA1C87D.786E8E52@gmx.net> Message-ID: <3DA1DB6F.1DDA16A1@gmx.net> 2002-10-08 Masatake YAMATO * autotrace.h (at_doc__width_factor): added label for width_factor. 2002-10-07 Masatake YAMATO * input-magick.c (input_magick_reader): removed comments. suggested by Martin. 2002-10-07 Martin Weber * output-eps.c (out_splines): Now the eps output is interpreted correctly by CorelDraw. Message-ID: <3DA063E6.32835C45@gmx.net>. 2002-10-07 Martin Weber * fit.c (find_tangent): fixed a bug in tangent calculation. Message-ID: <3DA09336.DB788C68@gmx.net>. 2002-10-06 Masatake YAMATO * pxl-outline.c (free_pixel_outline): New function. (CHECK_FATAL_DO): new macro. (find_outline_pixels): free outline_list if an exception is raised. (find_one_outline): free outline if an exception is raised. (find_centerline_pixels): free outline if an exception is raised. use free_pixel_outline. 2002-10-06 Masatake YAMATO * pxl-outline.c (find_centerline_pixels): free unused outline and partial_outline after using. * input-magick.c (input_magick_reader): freed image_info and image. * output.c (at_output_shortlist): driverdescription is freed. * median.c (quantize): removed debug print. * input*.[ch]: renamed all loader. * input-magick.c: added a forgotten argument. 2002-10-04 Masatake YAMATO * quantize.h: Added a declaration for quantize_object_free. * spline.[ch] (new_spline_list_with_spline): Renamed from init_spline_list. * fit.c (fit_curve_list): deleted temp. * median.c (quantize_object_free): New function. (quantize): Use quantize_object_free. * autotrace.c (at_bitmap_read): Set new_opts. 2002-10-03 Masatake YAMATO * README: Updated. 2002-10-03 Martin Weber * autotrace.dsp: Updated. 2002-10-02 Masatake YAMATO * exception.h: renamed a type at_exception to at_exception_type. * * (*): used at_exception_type. * autotrace.h (at_doc__preserve_width::width_factor): new member. (struct _at_spline_list_array_type): Likewise. (_, N_): New dummy macro for gettext. 2002-09-29 Masatake YAMATO * * (*): at_output_opts_type is introduced. 2002-09-29 Martin Weber README: added new option image-proc.c: removed warnings Message-ID: <3D97211D.85F25D9C@gmx.net>. 2002-09-29 Martin Weber *: now recognizes the line width median.c: bugfix Message-ID: <3D96F758.2B17DAB9@gmx.net>. 2002-09-29 Masatake YAMATO * input-png.c (read_png): my_bg.gray is multiplied by 256. * autotrace.c (at_bitmap_read): If opts is null, give dummy to a handler. (at_input_opts_copy): New function. * configure.in: update library version. LC_CURRENT=2, LT_REVISION=0, LT_AGE=0. * main.c (main): Use new input opts. * autotrace.h (at_input_read_func): added a new argrument. (at_bitmap_read): added the new argrument. * input-*.[ch] (*_load_image): added the new argrument. * input-png.c (read_png): Use background in the input option if the option is given. Otherwise, use white. * autotrace.c (at_input_opts_new, at_input_opts_free): New functions. * autotrace.h (struct _at_input_opts_type): New data type. 2002-09-29 Martin Weber * pxl-outline.c: I introduced a bug in pxl-outline.c. change back to the version used in 0.30.5. Message-ID: <3D96120F.2780C779@gmx.net>. 2002-09-28 Masatake YAMATO * input-png.c (read_png): New function that can handle transparent region (just fill with white). (load_image): use read_png. 2002-09-27 Martin Weber * pxl-outline.c (find_centerline_pixels): During speed up the code I introduced a bug. Here the fix. Message-ID: <3D94C2E7.55A7C0C3@gmx.net>. 2002-09-26 Masatake YAMATO * autotrace.m4 ($LIBS): changed the order of appending $LIBS to $AUTOTRACE_LIBS. * Makefile.am (EXTRA_DIST): Added output-pstoedit.[ch]. * configure.in (HAVE_LIBPSTOEDIT): Fix typo. 2002-09-26 Martin Weber * vector.c: Now also works with C compilers that do not define true and false in the standard way, * pxl-outline.c: Ditto. * output.c: Ditto. * fit.c: Ditto. * epsilon-equal.c: Ditto. Message-ID: <8293.1032936123@www49.gmx.net>. 2002-09-25 Masatake YAMATO * configure.in: use pstoedit.m4 instead of pkg-config. showed more message about pstoedit. 2002-09-21 Masatake YAMATO * configure.in: added -dl to LIBPSTOEDIT_LIBS. 2002-09-20 Martin Weber * output-er.c: corrected output format. * pxl-outline.c: improved speed. Message-ID: <3D89F00F.E3F18E48@gmx.net> 2002-09-20 Masatake YAMATO * autotrace.m4: did the same as frontline.m4. $autotrace_exec_prefix or $autotrace_prefix only. $autotrace_config_exec_prefix and $autotrace_config_prefix are unnecessary variables. used --exec_prefix instead of --exec-prefix. This is restriction of autofig. Fix broken a if-condition. Added "bin" to exec_prefix. (autotrace_config_args): removed. unnecessary variable. 2002-09-20 Martin Weber * color.c (GET_COLOR): Improved speed and better luminance calculation. * color.h (COLOR_LUMINANCE): Ditto. Message-ID: <32434.1032418120@www62.gmx.net> 2002-09-20 Martin Weber * thin-image.c (thin3): This fix corrects some problems with the thinning of regions that touch the image borders. Message-ID: <3D88C750.4AE643A5@gmx.net>. 2002-09-18 Masatake YAMATO * configure.in: Version 0.30.6. * configure.in: Added workarround for pstoedit-3.32.0. added c++ runtime library to LIBPSTOEDIT_LIBS. 2002-09-18 Martin Weber * autotrace.dsp: * autotrace.vcproj: Updated. Message-ID: <3D874D91.A57E8569@gmx.net>. 2002-09-12 Masatake YAMATO Martin suggested me that tmpnam is ANSI C function so we don't have to check. * acconfig.h: removed HAVE_TMPNAM. * configure.in (HAVE_LIBPSTOEDIT): Checked mkstemp only. * output-pstoedit.c (make_temporary_file): used tmpnam if mkstemp is not found. 2002-09-11 Masatake YAMATO * output-pstoedit.c (make_temporary_file): New function. (output_pstoedit_writer): used make_temporary_file. * configure.in: checked mkstemp and tmpnam if HAVE_LIBPSTOEDIT is yes. * acconfig.h: Added HAVE_MKSTEMP and HAVE_TMPNAM. 2002-09-10 Martin Weber * input.c (at_input_get_handler_by_suffix): added cast to the returned value for Visual C++. * output-pstoedit.c (output_pstoedit_get_writer): Likewise. Message-ID: <3D7D116C.68950963@gmx.net>. 2002-09-10 Martin Weber * output-pstoedit.c: Include io.h if _VISUALC_ is defined. (set_last_suffix): returned void. (output_pstoedit_writer): tmpfd is typed as char * if _VISUALC_ is defined. (output_pstoedit_writer): Use _mktemp instead of mkstemp if _VISUALC_ is defined. (output_pstoedit_writer): do fopen if _VISUALC_ is defined. (output_pstoedit_writer): did fclose instead of close. (remove_tmpfile): Added const to the 1st parameter. Message-ID: <3D7D116C.68950963@gmx.net>. 2002-09-09 Masatake YAMATO * configure.in: Version 0.30.5. 2002-09-08 Masatake YAMATO * output.c (output_is_static_member): put #ifdef HAVE_LIBPSTOEDIT - #endif arround the function. The problem is reported by Martin. * configure.in: Version 0.30.4. LT_CURRENT = 1, LT_AGE = 1. * output-pstoedit.h: Addec comments about MT unsafe. * output-pstoedit.c (get_last_suffix): New file. Use get_last_suffix in all functions in output-pstoedit.c. 2002-09-06 Masatake YAMATO * main.c: removed unnecessary '\n' in FATAL*. * output.c (at_output_get_handler_by_suffix): used output_pstoedit_get_writer. 2002-09-05 Masatake YAMATO * output-pstoedit.[ch]: Use at_string. (output_pstoedit_get_writer): New function. (output_pstoedit_set_last_suffix): deleted. * output-pstoedit.c (get_symbolicname): New function. (remove_tmpfile): Print tmp file names if BO_DEBUG is 1. (output_pstoedit_writer): Use two temporary files to keep both the command line syntax of autotrace and the pstoedit API. (output_pstoedit_suffix): New variable. * output.c (streq): New function. (at_output_get_handler_by_suffix): Call output_pstoedit_set_last_suffix. (at_output_list_new): Use both suffixes and symbolicnames. (at_output_shortlist): Likewise. (output_is_static_member): Check both suffixes and symbolicnames. * output-pstoedit.[ch] (output_pstoedit_set_last_suffix): New function. * main.c (output_list_formats): gave more spaces to the output formats. 2002-08-27 Masatake YAMATO * configure.in: 0.30.3. library version is set to 1.0.1. * logreport.h (at_log_file): Renamed from log_file. I guess the symbol `log_file' conflicts with something defined on debian libc. The bug is reported by Gerhard Gaussling . 2002-07-10 Martin Weber * output.c (at_spline_list_foreach, at_spline_list_array_foreach): Added "unsigned" to `i`. included strgicmp.h. Message-ID: <3D2B3A63.9B8AE188@gmx.net>. 2002-07-09 Masatake YAMATO * configure.in: Version 0.30.2. 2002-07-01 Masatake YAMATO * configure.in: Don't use libdir value defined in libMagick.al. * output-pstoedit.h: Include pstoedit/pstoedit.h. * Makefile.am: improved pstoedit supports. * autotrace-config.af: Refer LIBPSTOEDIT_LIBS. * autotrace.pc.in (Libs): Likewise. 2002-06-30 Masatake YAMATO * output.c (at_*_get_handler_by_suffix): Return NULL if suffix is NULL pointer or an empty string. * input.c (at_input_list_new): Pass both NULL and "*" to GetMagickInfo. Suggested by valhalla@imagemagick.org on magick-users@imagemagick.org. * Makefile.am (EXTRA_DIST): Added autotrace-config.in. * autotrace.c: Remove make_string. * configure.in: Put double quotes arount version and url. * input-magick.c (magick_load_image): Don't use msg_data as a condition. Use msg_func instead. Use exception.reason instead of exception.description. Initialize image. * autotrace.c (make_string): Put '"' around an arg. 2002-06-26 Masatake YAMATO * Makefile.am (libautotrace_la_SOURCES): Use '()' instead of "{}". 2002-06-11 Masatake YAMATO * README: Reorganized. * exception.h, input.h, output.h and types.h: Added extern "C" {} for C++ clinets. 2002-06-09 Masatake YAMATO * autotrace.c (make_string): New macro. (at_version, at_home_site): Use make_string. * configure.in (AUTOTRACE_VERSION): Remove double quotes. (AUTOTRACE_WEB): Likewise. (LT_*): Introduce libtool. Check the broken ImageMagick.la. * Makefile.am (lib_LTLIBRARIES): Introduce libtool. 2002-06-05 Masatake YAMATO * output.h (at_output_add_handler): Added stab. * output.c: Added experimental pstoedit supports. * output-pstoedit.[ch]: New files. * configure.in(AC_ARG_PROGRAM, AM_SANITY_CHECK,AC_PROG_INSTALL): Added. Added experimental pstoedit supports. * acconfig.h (HAVE_LIBPSTOEDIT): Added experimental pstoedit supports. * Makefile.am (EXTRA_DIST): Added HACKING. (autotrace_LDADD, INCLUDES): Added experimental pstoedit supports. 2002-05-12 Masatake YAMATO * configure.in: linker messages that warns symbols are multiply defined are suppressed when the host is Darwin. Suggested by Martin Kerscher . * input.c (at_input_list_new): Pass NULL to GetMagickInfo instead of empty string. * output.h (at_output_add_handler): Moved from autotrace.h. * Makefile.am: Made output.h installed. * spline.h: Use macros newly defined in output.h. * output.[ch]: Added macros and functions that supports accessing splines data. Don't include output.h. * output-*.h: Use at_spline_list_array_type as a formal argument instead of spline_list_array_type. * output-fig.c: Include spline.h. * autotrace.[ch] (at_color_equal): New function. 2002-05-06 Martin Weber * filename.c (make_suffix): length_through_dot is typed to unsigned long for 64bit arch. (remove_suffix): Likewise. * curve.c (log_curve): Cast curve to unsigned long for 64bit arch. (log_entire_curve): Likewise. * autotrace.vcproj: Added output-dr2d.[ch]. Message-ID: <3CD5A1C6.8717C29F@gmx.net>. Message-ID: <3CD5A2DB.2F467808@gmx.net>. 2002-05-04 Masatake YAMATO * *.c: include config.h. * configure.in (AM_CONFIG_HEADER): Use config.h. * acconfig.h: New file. 2002-05-01 Masatake YAMATO * configure.in: Version 0.30.1. * autotrace.1: Updated. * HACKING: Updated. 2002-04-30 Masatake YAMATO * Makefile.am (output_src): Added output-dr2d.c. * output-dr2d.c: Moved the declarations in output-dr2d.h to output-dr2d.c. Added static the declarations. 2002-04-30 Martin Weber * autotrace.dsp: updated. * autotrace.vcproj: ditto. * output.c: Added dr2d output writer. * output-dr2d.[ch]: New files. Contributed by Andrew Elia. Message-ID: <3CCE6457.AFDECB1F@gmx.net>. 2002-04-30 Masatake YAMATO * output-svg.c (out_splines): Added `;' after `:none'. * autotrace.h (_at_spline_list_array_type): Added new field background_color. * fit.c (fitted_splines): Copy background_color into splines. * autotrace.c (at_splines_free): free background_color. 2002-04-30 Martin Weber * output-*.*: fixed output generation when option background-color is active. Message-ID: <3CC4602F.75EF9AF7@gmx.net>. 2002-04-28 Masatake YAMATO * main.c, fit.c, autotrace.[ch]: Renamed bgColor to background_color. * fit.c (spline_linear_enough): Don't log distance. It is function. In stead, logging dist, at_real var. 2002-04-28 Martin Weber * input-magick.c: Now also tested with ImageMagick till 5.4.5. Wrote about it in the comment area. Message-ID: <3CC5CB34.FF990F83@gmx.net>. 2002-04-21 Masatake YAMATO * input-magick.c (magick_load_image): Don't use MagickError. Instead use msg_func. * autotrace.h (struct _at_fitting_opts_type): Rename `filter_iteration_count' to `filter_iterations' in order to make the field and its associated option name same. 2002-04-16 Masatake YAMATO * autotrace.dsp: s/VERSION/AUTOTRACE_VERSION/g. * autotrace.vcproj: ditto. Suggested by Martin. * autotrace.c (at_version): Use AUTOTRACE_VERSION instead of VERSION. (at_home_site): Use AUTOTRACE_WEB. * autotrace.m4 (AM_PATH_AUTOTRACE): Check version number. * configure.in (AUTOTRACE_VERSION, AUTOTRACE_MAJOR_VERSION, AUTOTRACE_MINOR_VERSION, AUTOTRACE_MICRO_VERSION, AUTOTRACE_WEB): New constants. 2002-04-15 Martin Weber * fit.c (find_half_tangent): (find_tangent): Fixed a bug in tangent calculation. 2002-04-15 Masatake YAMATO * COPYING.LIB: New file. * despeckle.*: Change the license to LGPL. * input*.*: Likewise. * median.c: Likewise. * output-*.*: Likewise. * quantize.h: Likewise. * thin-image.*: Likewise. 2002-04-03 Martin Weber * exception.[ch] (at_exception_fatal, at_exception_warning): added "const" to the passig parameter. * input-png.c (handle_warning, handle_error): Likewise. (init_structs): Cast handle_error and handle_warning that are passed to png_create_read_struct. (load_image): make width, height and row unsigned short. Casted values returned from png_get_image_width. Message-ID: <3CAEC662.41EEE71A@gmx.net>. 2002-04-03 Masatake YAMATO * HACKING (Tag naming scheme): Updated. * autotrace.spec.in: Updated. * configure.in: Version 0.30. * exception.c (at_exception_new): Fix wrong parameter declaration. 2002-04-03 Martin Weber * exception.h (at_exception_new): Fix wrong parameter declaration. * input-pnm.c (struct _PNMRowInfo): Removed. Message-ID: <3CA9F839.6A4C291C@gmx.net>. 2002-03-30 Martin Weber * output-swf.c (output_swf_writer): printed warning if autotrace runs on windows. * autotrace.dsp: Updated. * autotrace.vcproj: Updated. Message-ID: <3CA74273.90B1D7EF@gmx.net>. 2002-03-30 Martin Weber * main.c: fixed to remove some compiler warnings in main.c (dump): used at_bitmap_get_planes. Message-ID: <3CA737A7.40D2330D@gmx.net>. 2002-03-31 Masatake YAMATO * configure.in: Create a pre release(0.30pre2). 2002-03-30 Martin Weber * output-emf.c: Removed unnecessary #define, set pen width to zero when in outline mode. Now checking whether it should write to stdout only for Windows. Message-ID: <3CA4C008.8B921285@gmx.net>. 2002-03-30 Martin Weber * output-pdf.c (out_splines): Reduced color precision to get smaller files. * output-p2e.c (out_splines): Likewise. * output-eps.c (out_splines): Likewise. * output-epd.c (out_splines): Likewise. * main.c (main): using binary mode for dumping bitmaps. * pxl-outline.c (*): The y values of the outline were always to high by one. Message-ID: <3CA3853C.629CCFD6@gmx.net> and Message-ID: <3CA57C3F.C35F60F7@gmx.net>. 2002-03-30 Masatake YAMATO * pxl-outline.c (find_outline_pixels): moved test_cancel func to inner loop. 2002-03-28 Martin Weber * HACKING (Tools for debugging output): Updated. * README: Updated. * output.c (output_formats): Unify dxf output entry. * main.c (USAGE1): dpi is used in mif output, not emf. 2002-03-28 Martin Weber * output-emf.c: rewritten with Allen Barnett. 2002-03-28 Masatake YAMATO * HACKING (Tool for debugging output): Write about viewers. 2002-03-28 Martin Weber * despeckle.c: despeckle now also works on gray scale images. 2002-03-20 Martin Weber * main.c (main): Moved dumping of the bitmap so that quantize and despeckle are also in effect. Message-ID: <3C9A4462.47488039@gmx.net>. 2002-03-24 Ian MacPhedran * output-fig.c (out_fig_splines): Added a new local variable, fig_spline_close. 2002-03-20 Martin Weber * output-emf.c (GetEmfStats, GetEmfStats): Number of records was not counted correctly. Message-ID: <15225.1016698302@www11.gmx.net>. 2002-03-21 Masatake YAMATO * Makefile.am (libautotrace_a_SOURCES): Added strgicmp.c. This function must be in libautotrace.a because input.c uses. 2002-03-20 Martin Weber * README updated. * TODO: New file. 2002-03-20 Martin Weber * output-emf.c: Don't include output.h. Message-ID: <24692.1016622657@www46.gmx.net>. 2002-03-20 Masatake YAMATO * NEWS: Updated. * configure.in: Create a pre release(0.30pre1). 2002-03-20 Martin Weber * output-emf.c: Include output.h. Fixed bug when boundaries of the splines were larger than the boundaries of the bitmap. * output-cgm.c: removed FLOAT_TO_UI16. Message-ID: <3C97B972.12D92E49@gmx.net>. 2002-03-20 Masatake YAMATO * NEWS: Updated for 0.30. * autotrace.h: Added comments for at_splines_new. 2002-03-20 Martin Weber * fit.c (fitted_splines::total): Removed. (*): Remove `_'(underscore) from variable names to avoid conflicting with function name. Initialized local variables to avoid compiler warnings. * thin-image.c: Put cast to avoid compiler warnings. * median.c (generate_histogram_rgb): Added default: to switch-case to avoid compiler warnings. (find_nearby_colors::min_dist): Initialized. * vector.c: Rename local var, exp->excep. * pxl-outline.c: Make functions static scope. * output-mif.c: Don'e include . * output-fig.c (fig_col_init): Return nothing. (fig_col_hash): Put parentheses around the macro arg. (out_fig_splines): Removed unused variable `i'. (get_fig_colour): &->&&. Make static scope. * output-cgm.c: Don't count the return values of write16. * input.c (at_input_shortlist): removed a local var `count'. * input-tga.c (TgaSaveVals, TgaSaveInterface): Removed. * input-pnm.c: Rename local var, exp->excep. (PNMSaveVals, PNMSaveInterface): Removed. * getopt1.c: Didn't include stdlib.h. * getopt.c (exchange): Free temp. * despeckle.c (despeckle_iteration): Remove a ; that was too much at this place. (despeckle): Rename local var, exp->excep. * autotrace.[ch] (at_splines_write): Use at_string instead of char *. Message-ID: <3C926C28.61B6FBB0@gmx.net>. 2002-03-16 Masatake YAMATO * autotrace.c (at_bitmap_get_planes): New function. (at_bitmap_copy): New function. 2002-03-15 Masatake YAMATO * configure.in: Added AM_MAINTAINER_MODE. 2002-03-13 Martin Weber (Logged by Masatake.) * output-pdf.c (output_pdf_tailor): Put a space at the end of OUT_LINE and OUT1. * output-pdf.c (output_pdf_writer): Print warnings if _WINDOWS is defined. Message-ID: <3C8C7F1D.ACD14953@gmx.net>. 2002-03-13 Masatake YAMATO * output-pdf.c (output_pdf_writer): removed a garbage that I had put. Suggested by Martin. 2002-03-11 Martin Weber * output-pdf.c: Fix a bug in xref table generator. Message-ID: <3C88FA48.F3DC2CF5@gmx.net>. 2002-03-08 Masatake YAMATO * autotrace.spec.in: copyed from http://www.cs.uu.nl/~hanwen/public/software/autotrace.spec. Contributed by Han-Wen Nienhuys. * configure.in: Added autotrace.spec supports. * Masatake.am: Likewise. 2002-03-08 Martin Weber * output-pdf.c: pdf files now contain a xref table. Message-ID: <3C87C8F3.6130373F@gmx.net>. 2002-03-08 Martin Weber * fit.c (filter): Put the definition of prev_new_point out of the loop. (distance): Don't use hypot. Message-ID: <3C87B48C.82FAC8CF@gmx.net>. 2002-03-06 Martin Weber * curve.c: Corrected copyright notice * fit.c: Likewise. Message-ID: <3C84F316.2DB5B7A1@gmx.net>. 2002-03-06 Martin Weber * autotrace.vcproj: Linking with certain ImageMagick versions didn't work correctly. * autotrace.dsp: Likewise. Message-ID: <3C84F0C1.4C989134@gmx.net>. 2002-03-06 Martin Weber * fit.c (filter): fixed a bug in the filtering routine. avoid to use epsilon_equal. Message-ID: <3C84F2FD.C35ACD34@gmx.net>. 2002-02-14 Masatake YAMATO * autotrace.h (struct _at_fitting_opts_type::despeckle_level): made "unsigned". (struct _at_fitting_opts_type): Corrected wrong comments. 2001-12-24 Martin Weber * vector.c (magnitude): replaced hypot. (Message-ID: <14237.1013082801@www56.gmx.net>). 2002-02-06 Masatake YAMATO * configure.in (AC_CHECK_LIB): Put '[', ']' to nested macro invocations. 2002-02-05 Masatake YAMATO * Makefile.am (EXTRA_DIST): Removed vc++6.0.txt. 2002-02-04 Masatake YAMATO * Makefile.am (pkgconfig_DATA, pkgconfigdir): Added pkgconfig supprots. * configure.in: Likewise. * autotrace.pc.in: New file. * main.c (dot_printer): Rewrite. (main): print an input file name and newline when report_progress is true. (main::progress_stat): Make int. (dot_printer_max_column, dot_printer_char): New defs. 2002-01-31 Masatake YAMATO * Makefile.am (man_MANS): Added autotrace.1. * autotrace.1: Contributed by R. P. C. Rodgers. 2002-01-30 Masatake YAMATO * configure.in (AC_CHECK_LIB(png)): Added -lm. 2002-01-27 Masatake YAMATO * autotrace.c (at_splines_new_full): Set progress 1.0 at the end of this function. * main.c (dot_printer): Style of progress report is changed. * xstd.h (XREALLOC): Remove the last backslash at XREALLOC. This is my typo. 2002-01-23 Masatake YAMATO * xstd.h: Use assert instead of FATAL. * input-pnm.c (pnm_load_image): Use fopen instead of xfopen. Use fclose instead of xfclose. 2001-12-24 Martin Weber * vc++6.0.txt: Removed. Message-ID: <3C4C7155.934E0C5D@gmx.net>. * autotrace.vcproj: Added exception.[ch]. * autotrace.dsp: Likewise. Message-ID: <3C4C70AF.60741033@gmx.net>. 2002-01-23 Masatake YAMATO * main.c (USAGE1::dpi): Write about emf. Suggested by Stewart C. Russell . 2002-01-19 Masatake YAMATO * autotrace.c (at_bitmap_init): XMALLOC->XCALLOC again. I had a mistake at a change in 2002-01-05 Masatake YAMATO . What I did is "XMALLOC->XCALLOC" in at_bitmap_new. What I should is "XMALLOC->XCALLOC" in at_bitmap_init. I do in this time What I should. 2002-01-15 Masatake YAMATO * output.[ch]: removed fatal. use exception. * main.c (main): Pass a error handler to read and write functions. * input.h: Included exception.h. * input.c (at_input_get_handler_by_suffix): Don't cast returned value(magick_load_image). * input-*.[ch]: removed fatal. use exception. * autotrace.[ch] (at_splines_write): took new args, msg_func and msg_data. (at_bitmap_read): Likewise. (at_input_read_func,at_output_write_func): Likewise. 2002-01-14 Masatake YAMATO * main.c (exception_handler): Append newline to output. * output-fig.c (out_fig_splines): Use XMALLOC instead of malloc. 2002-01-12 Masatake YAMATO * input-bmp.c (ReadImage): Didn't close fd here. Instead closing at bmp_load_image. 2002-01-05 Masatake YAMATO * autotrace.c (at_bitmap_init): XMALLOC->XCALLOC. Found by Martin. Bug is doped by me. * vector.c (acos_d): Use exception. Return 0.0. * thin-image.c (thin_image): Fatal if wrong planes. * spline.c (print_spline): Use assert instead of FATAL macro. * pxl-outline.[hc]: Use exception instead of FATAL. * median.c (quantize): Fatal if wrong planes. * quantize.h (quantize): Likewise. * fit.c (find_corners): Pass exception context to Vangle. * autotrace.c (at_splines_new_full): Use exception in quantize and thin_image. Handle exception after find_*_pixels. * spline.c (print_spline): Use assert instead of FATAL1. 2002-01-04 Masatake YAMATO * main.c (exception_handler): New func. Passed to at_splines_new. (output_list_formats, input_list_formats): Made static. * despeckle.c (despeckle): Use exception instead of fatal. * autotrace.c: Included exception.h. (at_splines_new, at_splines_new_full): Added new args for msg. (at_splines_new_full): New local var, exp. Pass exp to despeckle. Pass exp to fitted_splines. * Makefile.am (autotraceinclude_HEADERS): Added exception.h. (libautotrace_a_SOURCES): Added exception.c. * main.c (dump): Remove unused local vars. * fit.h: Added at_ prefix to progress_func, testcancel_func and address. * input-pnm.c (pnm_load_image): Initialized bitmap if fd == NULL. 2002-01-02 Masatake YAMATO * autotrace.h (enum _at_msg_type, at_msg_func): New type. * main.c: Added code to dump loaded bitmap. "--debug-bitmap: dump loaded bitmap to .bitmap.\n\" 2001-12-29 Masatake YAMATO * main.c (read_command_line): Added debug-arch. 2001-12-28 Masatake YAMATO * Makefile.am (autotraceinclude_HEADERS): Added input.h. (noinst_HEADERS): Removed input.h. * input*.[ch]: bitmap_type -> at_bitmap_type. Use at_bitmap_init. * autotrace.c (at_bitmap_new): Use at_bitmap_init. (at_bitmap_init): New func. * bitmap.c (new_bitmap): Used at_bitmap_init. * bitmap.h: Almost all macro definitions used macros defined in input.h. Include input.h. * input.c: Include input.h. * input.h: Don't include bitmap.h. Instead, some macro defs are moved to input.h. (at_bitmap_init): New function. (at_input_add_handler): Moved from autotrace.h. 2001-12-26 Masatake YAMATO * input-magick.c (magick_load_image): Use BITMAP_PLANES. 2001-12-24 Masatake YAMATO * configure.in: Version 0.29. * autotrace.[ch]: Renamed at_bitmap_new to at_bitmap_read. * main.c (main): Likewise. 2001-12-24 Martin Weber * autotrace.[dsp,vcproj]: removed version.c * output-cgm.c: fixed a C++ issue. (Message-ID: <3C264E86.9948791C@gmx.net>). 2001-12-24 Masatake YAMATO * configure.in: Version 0.29pre1. 2001-12-23 Martin Weber * README: updated. * NEWS: updated. 2001-12-24 Masatake YAMATO * fit.[ch] (fitted_splines): Pass width and height. * autotrace.[ch] (at_splines_write): Don't pass bbox. Get bbox from splines. * main.c (main): Don't pass width and height to at_splines_write. * autotrace.h (struct _at_fitting_opts_type): Removed comments. Instead defined doc strings. (AT_DEFAULT_DPI): New def. (at_fitting_opts_doc): New macro. (struct _at_spline_list_array_type): Added height and width. * fit.c (new_fitting_opts): Remove comments. * main.c: used AT_DEFAULT_DPI. * strgicmp.c (strgnicmp): Added parentheses around conditions. (main): Added test. * output-fig.h: Move the defines to output-fig.c. 2001-12-23 Martin Weber * output-cgm.c: Fix bugs. Message-ID: <3C25CDF4.4C0CC024@gmx.net>. 2001-12-23 Masatake YAMATO * main.c (main): Use at_splines_write, at_input_shortlist and at_output_shortlist. * output.h, input.h: Remove declarations. Move them to autotrace.h. * input.c (input_format_entry, input_formats): Change the order of fields. * bitmap.c: Don't include string.h. * autotrace.[ch]: rename at_output_write to at_splines_write. (at_output_add_handler, at_input_add_handler): New stubs. * autotrace.c: Move input and output functions to input.c and output.c. * types.h (at_real_coord): Renamed from at_real_coordinate_type. (at_coord): Renamed from at_coordinate_type. Remove progress_func and testcancel_func. * *: Remove ptypes.h. 2001-12-23 Masatake YAMATO * ptypes.h: Removed. * output-emf.c (WriteHeader): Move a global variable `editor' to here. * Makefile.am (libautotrace_a_SOURCES): Removed version.c. * version.c: Removed. * autotrace.c (at_version): Move all codes in version.c to here. * output-cgm.c (output_metafiledescription): Added `const' to UI8. (*): bool->at_bool. (output_cgm_writer): version_string->at_version. * Makefile.am (output_src): Added output-cgm.*. 2001-12-23 Martin Weber * main.c (main): corrected bug that binary output was not written correctly. * autotrace.[vcproj,dsp], output.c, output-cgm.[ch], Makefile.am: added binary cgm export. (Message-ID: <3C250ADC.945F47F8@gmx.net>). 2001-12-23 Masatake YAMATO * autotrace.c (at_version): Added parameter `long_format'. * .*: Remvoe bool and address types. * input-png.c: Use at_string instead of string. * Makefile.am (EXTRA_DIST): Added autotrace.sln autotrace.vcproj libming.sln libming.vcproj. 2001-12-23 Martin Weber * libming.sln: New file. * libming.vcproj: Likewise. (Message-ID: <3C230B4F.AC6B7392@gmx.net>). 2001-12-23 Martin Weber * main.c, fit.c, autotrace.[ch]: removed unnecessary thin option. (Message-ID: <3C23097C.64BB84F8@gmx.net>, Message-ID: <3C230A3D.C0F29BE6@gmx.net>) 2001-12-23 Masatake YAMATO * input-png.h: string->at_string. 2001-12-23 Martin Weber * (.*): Remove version num in comments. Use at_string instead of string. Change the data type for number. Remove decl of version_string. (e.g. unsigned -> unsigned short) * version.c: Include ptypes.h. * ptypes.h: Declare version_string. Remove at_string. * output-emf.c (OutputEmf, GetEmfStats): Initialized last_color. * output-dxf.c (output_layer, out_splines, out_splines): Initialized local vars. * main.c (get_percent): Removed. * logreport.h: R. * logreport.c: R. * input-tga.h: P, R. * input-tga.c (tga_load_image): Remove a parameter `filename'. (tga_load_image): Likewise. * fit.c (filter_angle, find_curve_vectors): Removed. (fit_with_least_squares): Remove local variable `iteration'. * despeckle.c (recolor, despeckle_iteration): Remove a parameter, `current_size'. * autotrace.sln: New file. * autotrace.vcproj: Likewise. (Message-ID: <3C23045E.E5636FF5@gmx.net>). 2001-12-18 Per Grahn * output-emf.c (output_emf_writer): added `dpi'. 2001-12-19 Masatake YAMATO * main.c (read_command_line): Used output_get_handler_by_suffix. (main): Use at_output_get_handler. Use suffix of output_name to select output_handler. * output.c (output_get_handler): Used suffix. * output.[ch] (output_get_handler_by_suffix): New function. * autotrace.[ch] (at_output_get_handler_by_suffix): New function. 2001-12-18 Masatake YAMATO * Makefile.am (output_src): Added mif.[ch]. 2001-12-18 Per Grahn * autotrace.dsp (SOURCE): Added mif. * output-mif.[ch]: New files. * autotrace.h (at_output_write_func, at_output_write): Added dpi as a parameter. * main.c: Added new option dpi. * output-*.[ch]: Added dpi as a parameter. * output.c (output_formats): Added mif. (Message-ID: <3C1A734D.A11F290A@gmx.net>). 2001-12-18 Martin Weber * autotrace.dsp: Added swf. * strgicmp.h (strgnicmp, strgnicmp): Added const to params. (Message-ID: <3C1A36C4.C098F815@gmx.net>). 2001-12-14 Masatake YAMATO * output-swf.c (output_swf_writer): roll back to 1.4. I did wrong commit. 2001-12-01 Martin Weber Now using file instead of name so that it works also to stdout. (Message-ID: <3C02BF23.9D19CCC0@gmx.net>). 2001-12-12 Masatake YAMATO * strgicmp.h (strgnicmp, strgicmp): added type of args. * strgicmp.[hc]: removed ^M. 2001-12-11 Martin Weber Now commandline options are no more case sensitive. * Makefile.am (autotrace_SOURCES): Added strgicmp.[ch]. * autotrace.dsp: Likewise. * main.c: Use strgicmp. * getopt.c: Likewise. * input.c: Likewise. * cmdline.h: Likewise. * strgicmp.[ch]: New files. (Message-ID: <3C15248C.C9AC71C9@gmx.net>). 2001-12-08 Martin Weber * input.c (input_list): Fix a bug for magicklib support. "MagickLibVersion < 0x0538" => "MagickLibVersion < 0x0534". 2001-12-08 Masatake YAMATO * configure.in: Version 0.28. 2001-12-08 Martin Weber * output.c: * output-dxf.[ch]: DXF output is disabled. 2001-12-08 Masatake YAMATO Put a tag, "BEFORE_DISABLING_DXF" to the CVS repository. 2001-12-03 Martin Weber * input.c: We should use api.h instead of magick.h, now also works using C++. * input-magick.c: Likewise. (Message-ID: <3C0A6916.D7C47C1F@gmx.net>). 2001-12-02 Martin Weber * types.h: adopted to C++. * main.c (read_command_line): Likewise. (Message-ID: ). 2001-12-01 Masatake YAMATO * README.MING: Write about Visual C++ and libming.*. * Makefile.am (EXTRA_DIST): added libming.*. 2001-12-01 Martin Weber * input-magick.c: Fixed comments. * input.c: input_shortlist now supports ImageMagick formats. * output-pdf.c: no more a temporary file needed. (Message-ID: <3C07E7CB.42BB90D4@gmx.net>). 2001-12-01 Martin Weber * input.c, input.h, main.c, README: input_list now also lists all formats that are supported by ImageMagick, dynamic generation of input format list. (Message-ID: <3C0697FA.F9F1F974@gmx.net> is applied. Message-ID: <3C056389.A35DF08C@gmx.net> is ignored). 2001-12-01 Martin Weber * output-dxf.h (output_dxf12_writer): New function. * output.c (output_formats): Added dxf12. * output-dxf.c: Reorganized. (Message-ID: <3C053FF6.191A5F26@gmx.net>). 2001-12-01 Martin Weber * output-swf.c (output_swf_writer): Now using file instead of name so that it works also to stdout. (Message-ID: <3C02BF23.9D19CCC0@gmx.net>). 2001-12-01 Martin Weber * Makefile.am (EXTRA_DIST): Added shape_cubic.c.diff README.MING. * shape_cubic.c.diff: Patch for ming. * README.MING: About shape_cubic.c.diff. (Message-ID: <3C02B6A9.D9EF762D@gmx.net>, Message-ID: <5962.1006945825@www21.gmx.net>) 2001-11-27 Martin Weber * output-swf.c (output_swf_writer): Now using file instead of name so that it works also to stdout. (Message-ID: <3C02BF23.9D19CCC0@gmx.net>). 2001-11-27 Martin Weber * output-swf.c (output_swf_writer, out_splines): Removed some warnings. (Message-ID: <3C02B6A9.D9EF762D@gmx.net>). 2001-11-28 Ian MacPhedran * output-fig.c: centerlines were extended to complete polygons, closing shapes which should be open - thanks to Dan Mills for pointing this out (routine out_fig_splines) 2001-11-27 Martin Weber * main.c (read_command_line): output format list now freed. (Message-ID: <3C02B6D3.7FBF5057@gmx.net>). 2001-11-25 Martin Weber * output-p2e.c (output_p2e_header, output_p2e_writer): Output that is totally curve free has to be marked. (Message-ID: <3C012785.19621140@gmx.net>). 2001-11-25 Martin Weber * output-dxf.c (out_splines): Removed code that was needed due to an old bug in AutoTrace. * output-epd.c (out_splines): Removed wrong comment. * output-pdf.c (output_pdf_tailor): Removed unnecessary xref part. * output.h (output_shortlist): New declaration. * output.c (output_shortlist): New function. * main.c (read_command_line): Invoke output_shortlist. (USAGE): Remove OUTPUT_SUFFIX_LIST. (main.c, output.c, output.h: Dynamic generation of output format list.) * autotrace.dsp: output-pdf.c and output-pdf.h are added. (Message-ID: <3C0112EA.EB49E12A@gmx.net>). 2001-11-25 Masatake YAMATO * Makefile.am (output_src): Added output-pdf.[hc]. 2001-11-24 Martin Weber * output-pdf.[ch]: New files. * output.h (OUTPUT_SUFFIX_LIST): Added pdf. * NEWS: Upadted. * output.c: Added output_pdf_writer. * despeckle.c (despeckle): Use FATAL1 instead of WARNING1. * autotrace.dsp: Updated. * autotrace.c(at_splines_new_full): Validated opts->despeckle_level that is passed to despeckle. Message-ID: <3BFF770F.E7B644F3@gmx.net>, Message-ID: <3BFECAB0.A3FFDC52@gmx.net>. 2001-11-24 Martin Weber * despeckle.c: Almost Rewrote. * output-dxf.c: "ps_file' -> "dxf_file". (Message-ID: <3BFD5CBD.8AC681BB@gmx.net>). 2001-11-24 Martin Weber * output-epd.c: "ps_file"->"epd_file". (output_epd_header): "%%"->"%". (out_splines): swap "S"<->"f" in OUT_LINE. (Message-ID: <3BFEA7B6.E4CDB9F5@gmx.net>). 2001-11-24 Martin Weber * output-epd.c (out_splines): Fix a bugs in output formats. "*U"->"h", "B"->"S". Divied each color components by 255. (Message-ID: <3BFD3CA5.EA11A99C@gmx.net>). 2001-11-24 Masatake YAMATO * Makefile.am (output_src): Added output-epd.[ch]. 2001-11-21 Martin Weber * output-epd.[ch]: New files. * output.c (output_formats): output_epd_writer is added. (Message-ID: <3BFC27DC.DE9DE0E7@gmx.net>) 2001-11-21 Martin Weber * output.h (OUTPUT_SUFFIX_LIST): Removed dxf12. Added epd. * input-magick.h: Include ptypes.h * autotrace.dsp: Updated. (Message-ID: <3BFC1CA5.996CD642@gmx.net>) 2001-11-21 Martin Weber * READM, THANKS, NEWS: Updated. (Message-ID: <3BFBEB8D.E493F888@gmx.net>) 2001-11-21 Masatake YAMATO * main.c (main): Set fitting_opts->centerline. * fit.c (fitted_splines, new_fitting_opts): set value for new field `centerline'. * autotrace.[ch] (at_centerline): removed. (struct _at_spline_list_array_type, struct _at_fitting_opts_type): new field `centerline' is added. * output-*.[ch]: at_centerline is removed. Use shape.centerline instead. 2001-11-21 Masatake YAMATO * ptypes.h: New file. * Makefile.am: Added ptypes.h. * types.h: Added "at_" as prefix to all type names. * *.[ch]: Include ptypes.h. 2001-11-19 Martin Weber * pxl-outline.c (find_one_outline): Fixed that sometimes the first point of the outline is wrong 2001-11-19 Dan Mills * fit.c (split_at_corners): Here is a patch for another autotrace bug which caused some images to seemingly hang when processed with the thin option. The problem was caused by the fact that the LHS of the if statement was evaluated as an unsigned value, thus when pixel_o == 1, the statement evaluates as if (((unsigned int)(-1)) >= 4) which comes out to somewhere around (2^32 >= 4), this has the predictable result. Using signed math overcomes this problem. 2001-11-19 Martin Weber * pxl-outline.c (find_outline_pixels): improved background handling. 2001-11-19 Masatake YAMATO * fit.c (fit_one_spline): Remove wrong fprintf. 2001-11-19 Martin Weber * fit.c (filter): added initialisation of prev_new_point. * color.h (COLOR_EQUAL): fixed a bug in the COLOR_EQUAL macro * pxl-outline.c (find_outline_pixels): corrected outline generation with a given background color. 2001-11-19 Martin Weber * fit.c (filter): Temporary solution for not totally collapsing a curve with repeated filtering. 2001-11-17 Martin Weber * fit.c (fit_with_least_squares): Force closed splines to be split. 2001-11-17 Martin Weber * fit.c (find_half_tangent): fixed a problem in calculation of halftangent with cyclic curves. 2001-11-11 Masatake YAMATO * pxl-outline.c (find_outline_pixels): (find_centerline_pixels): Put cancel points. * main.c (main): Use at_splines_new_full. * fit.[hc] (fitted_splines): Put cancel points. If `test_cancel' is given and it returns TRUE, execution is stopped and the control is returned. * types.h (testcancel_func): New type. * autotrace.h (at_testcancel_func): New type. * autotrace.[hc] (at_splines_new_full): New function. at_splines_new_with_progress is removed. at_splines_new_full is almost the same as `at_splines_new_with_progress' but has cancel points. 2001-11-09 Masatake YAMATO * despeckle.h: Remove nest '/*'. * pxl-outline.h: Change the indent style. Lines were too long. 2001-10-14 Martin Weber * output-dxf.c: adopted so it could also be compiled as C++ 2001-10-14 Martin Weber * NEWS: Upated * README (version): Updated * THANKS: Updated. * autotrace.dsp (SOURCE): Update again. 2001-10-14 Martin Weber * autotrace.dsp: adopted to newer versions of ImageMagick. * input-magick.c: Likewise. 2001-10-14 Martin Weber * output-dxf.h: changed wrong define constant * curve.c, pxl-outline.c, fit.c: removed warning in notify_progress for Visual C++ * output.c: added output_dxf_writer 2001-10-28 Masatake YAMATO * Makefile.am (output_src): Added output-dxf.[ch]. 2001-10-28 Steffen Politzky Logged by Masatake YAMATO . * output-dxf.[ch]: New files. 2001-10-14 Martin Weber * main.c (read_command_line::long_options): Added despeckle-level and despeckle-tightness. 2001-10-13 Masatake YAMATO * types.h (progress_func): New type. * pxl-outline.c: Added progress notify callback. * curve.[ch]: Likewise * autotrace.[ch]: Likewise. * fit.[ch]: Likewise. * autotrace.c (at_splines_new): Invoke despeckle. * autotrace.h (struct _at_fitting_opts_type): New members, despeckle_level and despeckle_tightness. * fit.c (new_fitting_opts): Initialize despeckle_level and despeckle_tightness. * main.c (read_command_line): Use fitting_opts->despeckle_tightness and fitting_opts->despeckle_level. 2001-10-11 Martin Weber * main.c, despeckle.c, despeckle.h: Added new despeckling code. 2001-10-12 Masatake YAMATO * Makefile.am: Added despeckle.[ch]. 2001-10-12 David A. Bartold by Masatake) * despeckle.[ch]: New files. 2001-10-03 Jerritt Collord * output-sk.c (out_splines): Check `at_centerline' before doing fputs("bC()\n", file). (Logged by Masatake) o2001-09-18 Martin Weber * output-eps.c: fixed a small bug in the initialisation of last_color Suggested by "Wolfgang Glunz" . * output-p2e.c: fixed a small bug in the initialisation of last_color, adopted to pstoedit 3.30 Suggested by "Wolfgang Glunz" . 2001-09-15 Masatake YAMATO * autotrace.c (at_home_site): Update the homepage of autotrace. * README: Likewise. 2001-04-13 Masatake YAMATO * configure.in: Warn if libping is not found. 2001-04-12 Martin Weber Message-ID: <3AD446C7.9045830B@gmx.net> * input-tga.c: I fixed a bug in input-tga.c: Indexed tga images are now interpreted correctly. 2001-04-11 Masatake YAMATO * configure.in: Don't check malloc.h. * output-er.c: Don't include malloc.h. * output-p2e.c: Likewise. 2001-04-11 Masatake YAMATO * output-er.c: Include malloc.h if HAVE_MALLOC_H is defined. * output-p2e.c: Likewise. * configure.in: Check malloc.h. These changes are suggested by Peter Cucka. 2001-03-25 Masatake YAMATO * configure.in: VERSION 0.27a. 2001-03-24 Masatake YAMATO * Makefile.am (autotrace_LDADD): Added -lm. Suggested by "Stefan A. Deutscher" . (autotrace-config.in): Specify the base file at its generating rule. Reported by "Stefan A. Deutscher" . 2001-03-21 Masatake YAMATO * configure.in: Version 0.27. * output-fig.c (get_fig_colour): Added static keyword. (fig_col_init): Likewise. * output-emf.c: Added static keyword to all variable and functions except output_emf_writer. * input-bmp.[ch] (bmp_load_image): Renamed ReadBMP. * input-tga.[ch] (tga_load_image): Renamed ReadTGA. 2001-03-21 Martin Weber Message-ID: <3AB7AD7B.CA58CE8A@gmx.net>. * README: Updated. 2001-03-16 Peter Cucka Message-ID: <3AB26304.182F7AB2@anim.dreamworks.com>: * fit.c: Fixed a bug that, in centerline mode, caused a zero-length line segment to be added to the end of every open curve. * output-er.c: Modified out_splines() to correctly output open curves, taking into account the above changes to fit.c. 2001-03-20 Masatake YAMATO * configure.in: Check ImageMagick version is higher than 5.2.1. Use AC_MSG_WARN instead of AC_MSG_ERROR if ImageMagick is not found. The user can build autotrace without ImageMagick. This change is required by Martin. Message-ID: <3AB26698.DFC2341D@gmx.net>. 2001-03-15 Martin Weber Message-ID: <3AB26698.DFC2341D@gmx.net>. * input-magick.c (magick_load_image): dropped the support of versions older than 5.2.1. 2001-03-17 Martin Weber Message-ID: <3AB25B23.27EDD0C1@gmx.net>. * output-emf.c: Images with width or height > 655 were distorted. 2001-03-17 Peter Cucka * pxl-outline.c: Adding some explicit casts of boolean expressions to 'bool's, to keep the IRIX compiler from warning about an "enumerated type mixed with another type". (Logged by Masatake) 2001-03-16 Masatake YAMATO Applied a patch from Martin. Message-ID: <3AB12888.E31072DC@gmx.net>. * output-emf.c: Now I fixed a bug in output-emf.c and adopted it so that the generated emf files are compatible to CorelDraw 9. 2001-03-15 Masatake YAMATO * configure.in: Added --with-magick and --without-magick flags to configure. Check ImageMagick version. --with-magick and --without-magick are suggested by "Stewart C. Russell" . 2001-03-14 Masatake YAMATO * configure.in: Check zlib. Print the required version of libpng. Suggested by Martin. Message-ID: <3AABC7D4.1E7CDAA@gmx.net>. 2001-03-13 Masatake YAMATO Applied a patch from Martin. Message-ID: <3AAD4C14.6072AD3C@gmx.net>. * input-magick.c (magick_load_image): Improved supports for various version of libmagick. 2001-03-13 Masatake YAMATO Applied a patch from Martin. Message-ID: <3AAD4C65.AB2EAF23@gmx.net>. * autotrace.dsp: Updated. Reduced the size of the exe file without reducing speed. 2001-03-12 Masatake YAMATO * autotrace.h: Added copyright notice. * types.h: Likewise. * Makefile.am (INCLUDES): Renamed from libautotrace_a_INCLUDES. Suggested by Martin. * HACKING: Write about releasing scheme. Updated by Martin. Message-ID: <3AAB952E.7A1CE3A9@gmx.net>. * autotrace.dsp: updated. 2001-03-11 Masatake YAMATO * input-png.c: Added arguments for png_get_color_type. 2001-03-09 Masatake YAMATO Applied a patch from Martin. Message-ID: <3AA7F19A.C11E5BC2@gmx.net>. * autotrace.dsp: Updated. 2001-03-09 Masatake YAMATO * configure.in: Added -lm to LIBSWF_LDFLAGS. * autotrace-config.af(AF_DEF_LIBS): Added @LIBSWF_LDFLAGS@. * Makefile.am (autotrace_LDADD): Remove -lm. 2001-03-08 Masatake YAMATO Applied a patch from Martin. Message-ID: <18838.984036759@www23.gmx.net> * NEWS: Updated. 2001-03-08 Masatake YAMATO * NEWS: Write the place where you can libming. * output-swf.h: Use triangle brackets instead of double quotes to include ming.h. * NEWS: Write about swf output. * configure.in: Added ming(swf) supports. * Makefile.am (EXTRA_DIST): Remove swf.h. (HAVE_LIBSWF): Added ming(swf) supports. 2001-03-08 Masatake YAMATO Kevin O' Gorman updates swf output. * output.h: Added ".swf". * output.c: Addd swf handler. * output-swf.h: Updated. * output-swf.c: Updated. 2001-03-07 Masatake YAMATO * spline.h (LINEARTYPE): (QUADRATICTYPE): (CUBICTYPE): (PARALLELELLIPSETYPE): (ELLIPSETYPE): (CIRCLETYPE): Aliases for the members of _at_polynomial_degree. * autotrace.h (_at_polynomial_degree): Added AT_ prefix to enum symbols. Applied a patch from Martin. Message-ID: <3AA15F77.44F4ECAF@gmx.net>. * autotrace.h: Improved fitting speed, reduced number of fitting parameters. * fit.c: Likewise. * main.c: Likewise. Applied a patch from Martin. Message-ID: <3AA129B5.FE736C40@gmx.net>. * main.c: Replaced static bool thin; by static bool thin = false; in main.c otherwise there is no initialization. 2001-03-07 Masatake YAMATO * types.h (struct): Remove dimensions_type. (DIMENSIONS_HEIGHT): Likewise. (DIMENSIONS_WIDTH): Likewise. Applied patches from Martin. Message-ID: <3AA12454.6AF6FD69@gmx.net>. * autotrace.h (struct _at_bitmap_type): Remove dimensions_type. * bitmap.c (new_bitmap): Likewise. * bitmap.h: Likewise. * median.c: Likewise. * input-magick.c: Likewise. * pxl-outline.c: Likewise. * input-pnm.c: Likewise. * autotrace.c: Likewise. Applied patches from Martin. Message-ID: <3AA11C68.9B494013@gmx.net> * output-emf.c: Replaced TRUE and FALSE by true and false. * types.h: Remove TRUE and FALSE. Applied patches from Martin. Message-ID: <3AA11A4B.BD319064@gmx.net>. * autotrace.dsp: Removed usefull.h and median.h. * Makefile.am (libautotrace_a_SOURCES): Remove median.h. * types.h: Removed unnecessary #ifdef __cplusplus. * usefull.h: File is removed. * Makefile.am (noinst_HEADERS): usefull.h is removed. * fit.c: Likewise. * output-er.c: Likewise. 2001-03-02 Masatake YAMATO * pxl-outline.c: Put file name on the head of file. * Makefile.am: Added autotrace.m4 supports. * autotrace.m4: New file. 2001-02-28 Masatake YAMATO Applied a patch from Martin. * output-emf.c: Now supports centerline. 2001-02-27 Masatake YAMATO * NEWS: Write about dxf. Applied a patch from Martin. * NEWS: Updated. * output.c: Don't include output-dxf.h and output-dxf12.h. 2001-02-26 Masatake YAMATO Applied a patch from Martin. * output.c: Remove dxf supports. * Makefile.am (output_src): Likewise. * autotrace.dsw: Updated. * autotrace.dsp: Likewise. 2001-02-25 Masatake YAMATO Applied two patches from Martin. * output-p2e.c: Now supports centerline. * output-sk.c: Likewise. * output-svg.c: Likewise. 2001-02-25 Ian MacPhedran * output-fig.c: Updated. Added support for the "centerline" option Added code to reduce the number of FIG "levels" produced 2001-02-24 Masatake YAMATO Applied patches from Martin. * output-eps.c: Made the centerline eps output compatible to CorelDraw. Applied patches from Martin. * thin-image.c: Made it C++ compatible again (replaced delete by todelete) and removed some warnings. * output-er.c: Made it C++ compatible, replaced malloc my XMALLOC and removed some unnecessary code. * pxl-outline.c: Moved edge.h to pxl-outline.c, some cleanup and removed some warnings. * edge.h: Removed, because the code was added to pxl-outline.c. 2001-02-24 Masatake YAMATO * median.c (quantize): Applied a patch from Martin. -- I removed a bug in median.c: fixed wrong color count 2001-02-23 Masatake YAMATO * HACKING (Autofig): Updated. * autogen.sh: Check whether autofig is existed or not. Applied patches from Martin. -- I removed some compiler warnings in color.h and pxl-outline.c. Also I have a new autotrace.dsp. * pxl-outline.c: Updated. * color.h: Updated. * autotrace.dsp: Updated. 2001-02-23 Masatake YAMATO * configure.in: Set version to 0.27pre. * output-eps.c (out_splines): Use at_centerline. * main.c (main): Use at_centerline. (centerline): static scope. * autotrace.[hc] (at_centerline): New varaible. 2001-02-22 Masatake YAMATO * output.h (OUTPUT_SUFFIX_LIST): Added "er". 2001-02-20 Martin Weber -- Centerline vectorization * Makefile.am: Added output-er.c and .h. * autotrace.c: Modified at_splines_new() to support centerline vectorization. * autotrace.h: Added 'open' flag to at_spline_list_type. * color.h: Added COLOR_LUMINANCE() macro. * curve.h: Added 'open' flag to curve_list_type. * fit.c: Made several modifications to handle open curves. * input-pnm.c: In pnm_load_image(), replaced fopen()/fclose() with xfopen()/xfclose() (see below). * main.c: Added a -centerline option. Commented out a call to free() that was causing memory corruption. Fixed a bug in the conversion to decimal of the -background-color hex string. Reinstated 'remove_adj_corners' and 'thin' globals as temporary variables (because the SGI MIPSpro compiler doesn't allow initializing 'long_options' with the addresses of a non-static variables). * median.c: Added rudimentary support for single-channel images (by interpreting them as three-channel images for which R = G = B). Changed the way the background color is handled. Changed some function prototypes. * output-eps.c: Made changes to support open curves. * output-er.c, output-er.h: New; adds Elastic Reality shape file output. * output.c: Added Elastic Reality shape file output format (see output-er.c and .h). * pxl-outline.c: Added find_centerline_pixels() and supporting functions find_one_centerline(), concat_pixel_outline(), next_edge(), next_unmarked_outline_edge(), opposite_edge(), mark_pixel(), next_unmarked_outline_pixel(), is_marked_pixel(), num_neighbors(), num_marked_neighbors(), and is_open_junction() (some of these, as well as a few macros, were resurrected from an earlier version of AutoTrace). * pxl-outline.h: Added 'open' flag to pixel_outline_type. Added function find_centerline_pixels(). Added optional background color parameter to find_outline_pixels(). * quantize.h: Changed function prototype for quantize(). * spline.c: Reinstated patch to evaluate_spline() for SGI MIPSpro compiler. * thin-image.c: Added support for single-channel images. Rewrote code to eliminate most inner-loop function calls. Fixed two bugs that caused problems with border pixels. Replaced hard-coded BACKGROUND color with an optional parameter. * thin-image.h: Added optional background color parameter to thin_image(). * vector.c: Rewrote normalize() to not abort if the vector is zero-length. * xstd.c: Modified xfopen() and xfclose() to allow reads from stdin. 2001-02-21 Masatake YAMATO [Patches from from Martin.] * THANKS: Updated contributors. * types.h: Fixed a bug when compiling with C++. * Makefile.am (EXTRA_DIST): Added vc++6.0.txt autotrace.dsp autotrace.dsw. 2001-02-19 Masatake YAMATO Applied patches from Martin. * main.c(read_command_line): removed bad initialisation of opts * input.c(input_get_handler_by_suffix): Removed warning. magick_load_image is casted to input_read. * input-tga.c: removed unistd.h because it does not compile with Windows. 2001-01-20 Masatake YAMATO * input-magick.c: Applied a patch from Martin. Added special care for (MagickLibVersion >= 0x500) && (MagickLibVersion <= 0x525). 2001-01-10 Masatake YAMATO * median.c: Appled a patch from Martin. (median_cut_rgb): Rid ^M. 2000-12-02 Masatake YAMATO Following two changes are suggested by Brian V. Smith . * input-magick.c (magick_load_image): Invoke GetExceptionInfo if MagickLibVersion > 0x500. * input-tga.c: Include unistd.h. 2000-12-01 Masatake YAMATO * Merge branch TOWARD_RELEASE_0_26->RELEASE_0_26. 2000-11-16 Masatake YAMATO - configure.in: Version 0.26. 2000-11-15 Masatake YAMATO - pxl-outline.c: Applied a patch from Martin. 2000-11-21 Masatake YAMATO * main.c (read_command_line): Use at_color_new. * autotrace.[ch] (at_fitting_opts_copy): (at_color_new): (at_color_free): (at_color_copy): New functions. 2000-11-20 Masatake YAMATO * HACKING: Write about autofig. Write about Library usage. * configure.in (AC_OUTPUT): Generate autotrace-config. * autotrace-config.af: New file. * Makefile.am: Added target for autotrace-config. * autotrace.h: Put typedefs here. * autotrace.c (at_home_site): New function. * Makefile.am (autotraceinclude_HEADERS): Only types.h and autotrace.h are installed. 2000-11-18 Masatake YAMATO * Makefile.am (autotraceinclude_HEADERS): Added image-header.h. (noinst_HEADERS): Added xstd.h, epsilon-equal.h, logreport.h, usefull.h, message.h. (libautotrace_a_SOURCES): Added quantize.h and median.h. * (substring.[ch]): Merged into filename.c. * (concat3.[ch]): Likewise. * xstd.h: xmem.h, xf*.[ch] are unified. * filename.[ch]: *-suffi?x and are unified. 2000-11-17 Masatake YAMATO Make codes C++-clean. Suggested by Glunz Wolfgang and Reini Urban . * autotrace.h: Added an extern "C". * fit.c (remove_adjacent_corners): Rename new to new_list. * getopt.h: Added an extern "C". * thin-image.c (delete_map): Renamed from `delete'. (thin_image): Add a cast to return value of malloc. (thin): Likewise. (thin): Use delete_map. 2000-11-14 Masatake YAMATO * Makefile.am (autotrace_SOURCES): Move some files to libautotrace_a_SOURCES from autotrace_SOURCES. * main.c (read_command_line): Use at_version(). * autotrace.c (at_version): New function. * Makefile.am: Create libautotrace.a. * main.c: use autotrace.[ch]. * autotrace.c: New file. * autotrace.h: New file. * output.c(output_list): New function. * input.c (input_format_entry): Added descr field. (input_list): New function. (input_list_formats): Move to main. * fit.h (fitting_opts_type): Added new field `thin'. * fit.c (new_fitting_opts): Initialize thin. * README (http): Remove files in main part. * Makefile.am (autotrace_SOURCES): Added autotrace.[ch]. * fit.c: Apply a patch from martin. "I fixed a bug in fit.c that sometimes causes an endless loop in AutoTrace." * main.c: Don't include main.h. Include image-header.h. * Makefile.am (autotrace_SOURCES): Remove main.h. * main.c(input_reader): Renamed from load_image. Use type input_read. (input_extension): Removed unused variable (set_input_format): (set_input_format_by_suffix): Removed. Use input_get_handler* instead. (main): Check `input_reader' is set or not before set. Set output format and open output before oput input. Close output. Call free_bitmap instead of calling free directly. (image_header): Make the scope of `image_header' to main local from global. * THANKS: New file. * input-magick.c: Replaced with new one from Martin. * Makefile.am (INCLUDES): -Wall is removed. 2000-11-11 Masatake YAMATO * Makefile.am (autotrace_LDADD): Added LIBPNG_LDFLAGS to autotrace_LDADD. 2000-11-10 Martin Weber Removed warning in pxl-outline.c 2000-11-06 Martin Weber Fixed some warnings with gcc on AIX in xmem.h 2000-11-04 Martin Weber Removed warning for input-magick.c Improved input-p2e.c 2000-11-03 Martin Weber Fixed a bug in input-bmp.c 2000-11-02 Martin Weber pxl-outline.c completely rewritten removed edge.c 2000-10-30 Martin Weber Removed problems with nonvalid filenames. Fixed some compiler warnings. 2000-10-22 Martin Weber Made code more portable 2000-10-22 Dan Mills Added thinning 2000-10-20 Martin Weber Some cosmetic changes updates for a bug in pxl-outline.c replaced boolean by bool better quantization fixed tga import for gray images ... 2000-10-11 Enrico Persiani * output-emf.c: 1. Improved output efficiency by grouping shapes of the same color 2. Corrected an ERROR on filling shapes with holes 3. If the user tries to output EMF on stdout, an error message is sent to stderr 2000-10-11 MenTaLguY (This log entry is written by Masatake YAMATO). * Makefile.am (EXTRA_DIST): Added input-png.*. (input_png_src): Likewise. * configure.in: Added png check code. Masatake YAMATO also added STAGE1 check. * input-png.[hc]: New files. 2000-10-11 Masatake YAMATO * main.c: Include input.h only. (input_extension): Comment out unused variable. (set_*_input_format): Removed. Use input_get_handler* instead. (INPUT_SUFFIX_LIST): Move to input.h. (list-output-formats): A option renamed from list-formats. (list-input-formats): New option. * configure.in(AM_INIT_AUTOMAKE): Define package and version. * Makefile.am (autotrace_SOURCES): Added input.c and .h. * output.h (OUTPUT_SUFFIX_LIST): Move definition from main.c. * version.c(version_string): Append VERSION defined in configure.in. * input.[hc]: New file. input.[hc] is based on a patch from "MenTaLguY" . 2000-10-04 Masatake YAMATO * output-emf.c: Revised by Enrico Persiani . 1. Fixed a bug that caused crashes when the output was redirected to stdout 2. Cleaned the code from unused variable definitions 3. Removed a data-type (EMFPoint) and a function (write8) not used by the main conversion code. 2000-10-03 Masatake YAMATO * configure.in: Fix a typo. (MAGIC->MAGICK). * Makefile.am (EXTRA_DIST): Added input-magick.[ch]. * output-emf.c (OutputEmf): Set return type to void. * output.c: Added emf as a new output format. * Makefile.am (output_src): Added output-emf.[ch]. * main.c (INPUT_SUFFIX_LIST): Renamed SUFFIX_LIST. (OUTPUT_SUFFIX_LIST): New constant. (OUTPUT_SUFFIX_LIST): Added emf as a new output format. * output-emf.[hc]: New files from Enrico Persiani . 2000-10-01 Masatake YAMATO * xmem.h: Replaced with new one which is sent from Martin. 2000-09-29 Masatake YAMATO * configure.in: Check magick/api.h. * spline.c (evaluate_spline): Appleid a patch that avoid a bug in MIPSpro compiler (from Peter Cucka ). * Makefile.am (input_magick_src): Remove "". This causes an error when "make dist" is invoked. (autotrace_SOURCES): Remove type.h. 2000-09-28 Masatake YAMATO * main.c: Added tag file format support. * Makefile.am (autotrace_SOURCES): Split the file set into autotrace_SOURCES, input_magick_src and output_src. (input_src): Added input-tga.[hc]. * input-bmp.[hc]: Replace old files with new files sent from Martin. * input-tga.[hc]: New file from Martin. (ReadImage): Initialize pels with 0 instead of NULL. Initialize image.bitmap after local variable declarations. 2000-09-26 Masatake YAMATO * output-eps.c: Applied a revised patch from Bernhard Herzog . Message-ID: Subject: Re: [AutoTrace] autotrace 0.23 From: Bernhard Herzog To: autotrace@egroups.com Date: 22 Sep 2000 20:06:17 +0200 * main.c: Applied a patch from for Magick input support. See blocks surrounded by HAVE_MAGICK. (SUFFIX_LIST): New macro definition. * input-magick.[ch]: Magick input plug donated by . * configure.in(MAGICK_CONFIG): Check Magick-config. * Makefile.am(HAVE_MAGICK): New condition. * output-eps.c: Applied a patch from Bernhard Herzog . Message-ID: Subject: Re: [AutoTrace] autotrace 0.23 From: Bernhard Herzog To: autotrace@egroups.com Date: 22 Sep 2000 16:16:18 +0200 * fit.c: Include both limits.h and float.h. (fit_with_least_squares): Use %lx instead of %x. Cast left_curve to unsigned long. (fit_with_least_squares): Likewise. * curve.c (log_curve): Likewise. (log_entire_curve): Likewise. * xmem.h (XREALLOC): Likewise. * .cvsignore: Added .deps, autotrace, config.cache, config.log, config.status and Makefile. * Makefile.am (AUTOMAKE_OPTIONS): Added AUTOMAKE_OPTIONS. autotrace-0.31.1/INSTALL0000664000076400007640000002620407555433306010325 Installation guide for Autotrace -*- text -*- Index of this file: 1. Basic Installation 2. ImageMagick related issues 3. Pstoedit related issues 1. Basic Installation ===================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. 2. ImageMagick related issues ============================= If you use Red Hat Linux 7.2 to build autotrace with ImageMagick rpm, you will get a trouble something like: /bin/sh ./libtool --mode=link gcc -g -O2 -o autotrace atou.o main.o ... libtool: link: cannot find the library `/usr/lib/libxml2.la' gmake: *** [autotrace] Error 1 The reasons of thie trouble are 1. libMagick.la is broken; and 2. libxml2.so does not exist. There are two ways to avoid this trouble. 1. Build autotrace without ImageMagick. Run configure with "--withoud-magick" option(then run make clean; make). However, you lost input functions that use ImageMagick. 2. Hack the broken files. Replace "/usr/lib/libxml2.la" with -lxml2 in ImageMagick.la then Make a symbolic link, /usr/lib/libxml2.so, that referees /usr/lib/libxml2.so.2. If you don't understand what I write, you should not do. If you use Red Hat Linux 8.0 to build autotrace with ImageMagick rpm, you will get a trouble something like in configure time: checking for Magick-config... Magick-config checking magick/api.h usability... no checking magick/api.h presence... no checking for magick/api.h... no configure: WARNING: *** Magick-config is found but magick/api.h is not found in -I/usr/X11R6/include/X11/magick -D_REENTRANT -D_FILE_OFFSET_BITS=64 -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/freetype2 -I/usr/include/libxml2 *** configure: WARNING: *** Check Magick-config. *** configure: WARNING: *** ImageMagick input handler is disabled. *** in spite of following rpm -q results: [jet@chuf autotrace]$ rpm -q ImageMagick ImageMagick-5.4.7-5 [jet@chuf autotrace]$ rpm -q ImageMagick-devel ImageMagick-devel-5.4.7-5 I guess some of header files are missed in ImageMagick-devel. I recommend you to install ImageMagick from tar.gz. file. Pstoedit related issues ======================= If you are using pstoedit-3.32, pstoedit checking in configure of autotrace runs TWICE. Ignore the warning message of first checking. If you are using pstoedit-3.33 or higher, pstoedit checking runs only once. If you got a trouble to build autotrace with pstoedit, you can disable to use pstoedit with giving --without-pstoedit to configure of autotrace. Is you want to use pstoedit anyway linked with autotrace, let me(Masatake YAMATO or autotrace mailing list) know following informations: your operating system name and version autotrace version pstoedit version value of $LD_LIBRARY_PATH value of $PATH options given to configure of autotrace options given to configure of pstoedit output of configure of autotrace output of configure of pstoedit config.log of configure of autotrace config.log of configure of pstoedit Makefile of autotrace if generated src/Makefile of pstoedit output of pstoedit-config --libs output of pstoedit-config --cflags output of autotrace-config --libs output of autotrace-config --cflags path for pstoedit-config path for autotrace-config path for libautotrace.so path for libpstoedit.so if there is a compile farm on that the same OS as you use (Of couse, I(Masatake YAMATO) cannot promise anything even if you sent me above informations.) autotrace-0.31.1/Makefile.am0000664000076400007640000000674707560007042011330 man_MANS = autotrace.1 EXTRA_DIST=$(man_MANS) \ output-swf.c output-swf.h \ input-magick.h input-magick.c input-png.c input-png.h \ output-pstoedit.c output-pstoedit.h \ autotrace-config.af autotrace-config.in \ autotrace.dsp autotrace.dsw \ autotrace.m4 shape_cubic.c.diff README.MING \ libming.dsw libming.dsp \ autotrace.sln autotrace.vcproj libming.sln libming.vcproj \ autotrace.pc.in autotrace.spec.in TODO HACKING FAQ AUTOMAKE_OPTIONS = foreign no-dependencies autotraceincludedir=$(includedir)/autotrace lib_LTLIBRARIES=libautotrace.la bin_PROGRAMS=autotrace if HAVE_MAGICK input_magick_src=input-magick.h input-magick.c else input_magick_src= endif if HAVE_LIBPNG input_png_src=input-png.c input-png.h else input_png_src= endif input_src=input-pnm.c input-pnm.h \ input-bmp.c input-bmp.h \ input-tga.c input-tga.h \ $(input_png_src) \ $(input_magick_src) if HAVE_LIBSWF output_swf_src=output-swf.c output-swf.h else output_swf_src= endif if HAVE_LIBPSTOEDIT output_pstoedit_src=output-pstoedit.h output-pstoedit.c else output_pstoedit_src= endif output_src=output-eps.c output-eps.h \ output-er.c output-er.h \ output-fig.c output-fig.h \ output-sk.c output-sk.h \ output-svg.c output-svg.h \ output-p2e.c output-p2e.h \ output-emf.c output-emf.h \ output-dxf.c output-dxf.h \ output-epd.c output-epd.h \ output-pdf.c output-pdf.h \ output-mif.c output-mif.h \ output-cgm.c output-cgm.h \ output-dr2d.c output-dr2d.h \ $(output_swf_src) \ $(output_pstoedit_src) libautotrace_la_SOURCES =\ $(input_src) $(output_src) \ fit.c \ bitmap.c \ spline.c \ curve.c \ epsilon-equal.c \ vector.c \ color.c \ autotrace.c \ output.c \ input.c \ pxl-outline.c \ median.c \ thin-image.c \ logreport.c \ filename.c \ xstd.c \ epsilon-equal.h \ thin-image.h \ quantize.h \ image-header.h \ fit.h \ bitmap.h \ spline.h \ curve.h \ vector.h \ color.h \ pxl-outline.h \ despeckle.c \ despeckle.h \ exception.c \ strgicmp.c \ image-proc.c \ image-proc.h autotraceinclude_HEADERS=\ types.h \ autotrace.h \ input.h \ output.h \ exception.h libautotrace_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) # # noinst_HEADERS: headers shared between lib and bin. # File not installed and not shared should be in # libautotrace_a_SOURCES. noinst_HEADERS = filename.h \ xstd.h \ logreport.h \ message.h autotrace_SOURCES=\ atou.c \ atou.h \ main.c \ cmdline.h \ getopt.c \ getopt.h \ getopt1.c \ strgicmp.h INCLUDES = $(MAGICK_CFLAGS) $(LIBPSTOEDIT_CFLAGS) autotrace_LDADD = \ libautotrace.la \ $(MAGICK_LDFLAGS) \ $(LIBPNG_LDFLAGS) \ $(LIBSWF_LDFLAGS) \ $(LIBPSTOEDIT_LIBS) \ -lm m4datadir = $(datadir)/aclocal m4data_DATA = autotrace.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA= autotrace.pc bin_SCRIPTS=autotrace-config BUILT_SOURCES=autotrace-config autotrace-config: autotrace-config.in autotrace-config.in: autotrace-config.af autofig $< dist-hook: autotrace.spec cp autotrace.spec $(distdir) rpm: dist autotrace.spec rpm -bb autotrace.spec autotrace-0.31.1/Makefile.in0000664000076400007640000024105607563000003011324 # Makefile.in generated automatically by automake 1.5 from Makefile.am. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AMTAR = @AMTAR@ AS = @AS@ AUTOTRACE_VERSION = @AUTOTRACE_VERSION@ AWK = @AWK@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EXEEXT = @EXEEXT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBPNG_LDFLAGS = @LIBPNG_LDFLAGS@ LIBPSTOEDIT_CFLAGS = @LIBPSTOEDIT_CFLAGS@ LIBPSTOEDIT_LIBS = @LIBPSTOEDIT_LIBS@ LIBSWF_LDFLAGS = @LIBSWF_LDFLAGS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAGICK_CFLAGS = @MAGICK_CFLAGS@ MAGICK_CONFIG = @MAGICK_CONFIG@ MAGICK_LDFLAGS = @MAGICK_LDFLAGS@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PSTOEDIT_CFLAGS = @PSTOEDIT_CFLAGS@ PSTOEDIT_CONFIG = @PSTOEDIT_CONFIG@ PSTOEDIT_LIBS = @PSTOEDIT_LIBS@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ man_MANS = autotrace.1 EXTRA_DIST = $(man_MANS) \ output-swf.c output-swf.h \ input-magick.h input-magick.c input-png.c input-png.h \ output-pstoedit.c output-pstoedit.h \ autotrace-config.af autotrace-config.in \ autotrace.dsp autotrace.dsw \ autotrace.m4 shape_cubic.c.diff README.MING \ libming.dsw libming.dsp \ autotrace.sln autotrace.vcproj libming.sln libming.vcproj \ autotrace.pc.in autotrace.spec.in TODO HACKING FAQ AUTOMAKE_OPTIONS = foreign no-dependencies autotraceincludedir = $(includedir)/autotrace lib_LTLIBRARIES = libautotrace.la bin_PROGRAMS = autotrace @HAVE_MAGICK_TRUE@input_magick_src = input-magick.h input-magick.c @HAVE_MAGICK_FALSE@input_magick_src = @HAVE_LIBPNG_TRUE@input_png_src = input-png.c input-png.h @HAVE_LIBPNG_FALSE@input_png_src = input_src = input-pnm.c input-pnm.h \ input-bmp.c input-bmp.h \ input-tga.c input-tga.h \ $(input_png_src) \ $(input_magick_src) @HAVE_LIBSWF_TRUE@output_swf_src = output-swf.c output-swf.h @HAVE_LIBSWF_FALSE@output_swf_src = @HAVE_LIBPSTOEDIT_TRUE@output_pstoedit_src = output-pstoedit.h output-pstoedit.c @HAVE_LIBPSTOEDIT_FALSE@output_pstoedit_src = output_src = output-eps.c output-eps.h \ output-er.c output-er.h \ output-fig.c output-fig.h \ output-sk.c output-sk.h \ output-svg.c output-svg.h \ output-p2e.c output-p2e.h \ output-emf.c output-emf.h \ output-dxf.c output-dxf.h \ output-epd.c output-epd.h \ output-pdf.c output-pdf.h \ output-mif.c output-mif.h \ output-cgm.c output-cgm.h \ output-dr2d.c output-dr2d.h \ $(output_swf_src) \ $(output_pstoedit_src) libautotrace_la_SOURCES = \ $(input_src) $(output_src) \ fit.c \ bitmap.c \ spline.c \ curve.c \ epsilon-equal.c \ vector.c \ color.c \ autotrace.c \ output.c \ input.c \ pxl-outline.c \ median.c \ thin-image.c \ logreport.c \ filename.c \ xstd.c \ epsilon-equal.h \ thin-image.h \ quantize.h \ image-header.h \ fit.h \ bitmap.h \ spline.h \ curve.h \ vector.h \ color.h \ pxl-outline.h \ despeckle.c \ despeckle.h \ exception.c \ strgicmp.c \ image-proc.c \ image-proc.h autotraceinclude_HEADERS = \ types.h \ autotrace.h \ input.h \ output.h \ exception.h libautotrace_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) # # noinst_HEADERS: headers shared between lib and bin. # File not installed and not shared should be in # libautotrace_a_SOURCES. noinst_HEADERS = filename.h \ xstd.h \ logreport.h \ message.h autotrace_SOURCES = \ atou.c \ atou.h \ main.c \ cmdline.h \ getopt.c \ getopt.h \ getopt1.c \ strgicmp.h INCLUDES = $(MAGICK_CFLAGS) $(LIBPSTOEDIT_CFLAGS) autotrace_LDADD = \ libautotrace.la \ $(MAGICK_LDFLAGS) \ $(LIBPNG_LDFLAGS) \ $(LIBSWF_LDFLAGS) \ $(LIBPSTOEDIT_LIBS) \ -lm m4datadir = $(datadir)/aclocal m4data_DATA = autotrace.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = autotrace.pc bin_SCRIPTS = autotrace-config BUILT_SOURCES = autotrace-config subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = autotrace-config autotrace.pc autotrace.spec LTLIBRARIES = $(lib_LTLIBRARIES) libautotrace_la_LIBADD = @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-pnm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-bmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-tga.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-magick.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-eps.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-er.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-fig.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-sk.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-svg.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-p2e.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-emf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-dxf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-epd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-pdf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-mif.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-cgm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-dr2d.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ fit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ bitmap.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ spline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ curve.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ epsilon-equal.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ vector.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ color.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ autotrace.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ pxl-outline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ median.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ thin-image.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ logreport.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ filename.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ xstd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ despeckle.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ exception.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ strgicmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ image-proc.lo @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-pnm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-bmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-tga.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-eps.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-er.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-fig.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-sk.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-svg.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-p2e.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-emf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-dxf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-epd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-pdf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-mif.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-cgm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-dr2d.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ fit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ bitmap.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ spline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ curve.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ epsilon-equal.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ vector.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ color.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ autotrace.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ pxl-outline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ median.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ thin-image.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ logreport.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ filename.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ xstd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ despeckle.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ exception.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ strgicmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ image-proc.lo @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-pnm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-bmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-tga.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-magick.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-eps.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-er.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-fig.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-sk.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-svg.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-p2e.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-emf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-dxf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-epd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-pdf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-mif.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-cgm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-dr2d.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-swf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ fit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ bitmap.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ spline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ curve.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ epsilon-equal.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ vector.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ color.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ autotrace.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ pxl-outline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ median.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ thin-image.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ logreport.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ filename.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ xstd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ despeckle.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ exception.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ strgicmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ image-proc.lo @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-pnm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-bmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-tga.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-eps.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-er.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-fig.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-sk.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-svg.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-p2e.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-emf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-dxf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-epd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-pdf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-mif.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-cgm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-dr2d.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-swf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ fit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ bitmap.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ spline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ curve.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ epsilon-equal.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ vector.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ color.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ autotrace.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ pxl-outline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ median.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ thin-image.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ logreport.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ filename.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ xstd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ despeckle.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ exception.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ strgicmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ image-proc.lo @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-pnm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-bmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-tga.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-magick.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-eps.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-er.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-fig.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-sk.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-svg.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-p2e.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-emf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-dxf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-epd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-pdf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-mif.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-cgm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-dr2d.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-pstoedit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ fit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ bitmap.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ spline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ curve.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ epsilon-equal.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ vector.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ color.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ autotrace.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ pxl-outline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ median.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ thin-image.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ logreport.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ filename.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ xstd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ despeckle.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ exception.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ strgicmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ image-proc.lo @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-pnm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-bmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-tga.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-eps.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-er.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-fig.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-sk.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-svg.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-p2e.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-emf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-dxf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-epd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-pdf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-mif.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-cgm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-dr2d.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-pstoedit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ fit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ bitmap.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ spline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ curve.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ epsilon-equal.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ vector.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ color.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ autotrace.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ pxl-outline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ median.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ thin-image.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ logreport.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ filename.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ xstd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ despeckle.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ exception.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ strgicmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ image-proc.lo @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-pnm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-bmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-tga.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-magick.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-eps.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-er.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-fig.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-sk.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-svg.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-p2e.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-emf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-dxf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-epd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-pdf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-mif.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-cgm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-dr2d.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-swf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-pstoedit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ fit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ bitmap.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ spline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ curve.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ epsilon-equal.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ vector.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ color.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ autotrace.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ pxl-outline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ median.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ thin-image.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ logreport.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ filename.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ xstd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ despeckle.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ exception.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ strgicmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ image-proc.lo @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-pnm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-bmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-tga.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-eps.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-er.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-fig.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-sk.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-svg.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-p2e.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-emf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-dxf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-epd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-pdf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-mif.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-cgm.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-dr2d.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-swf.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-pstoedit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ fit.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ bitmap.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ spline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ curve.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ epsilon-equal.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ vector.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ color.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ autotrace.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ pxl-outline.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ median.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ thin-image.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ logreport.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ filename.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ xstd.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ despeckle.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ exception.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ strgicmp.lo \ @HAVE_LIBPNG_FALSE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ image-proc.lo @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-pnm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-bmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-tga.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-png.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-magick.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-eps.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-er.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-fig.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-sk.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-svg.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-p2e.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-emf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-dxf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-epd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-pdf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-mif.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-cgm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-dr2d.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ fit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ bitmap.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ spline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ curve.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ epsilon-equal.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ vector.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ color.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ autotrace.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ pxl-outline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ median.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ thin-image.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ logreport.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ filename.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ xstd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ despeckle.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ exception.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ strgicmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ image-proc.lo @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-pnm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-bmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-tga.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-png.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-eps.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-er.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-fig.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-sk.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-svg.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-p2e.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-emf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-dxf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-epd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-pdf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-mif.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-cgm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-dr2d.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ fit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ bitmap.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ spline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ curve.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ epsilon-equal.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ vector.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ color.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ autotrace.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ pxl-outline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ median.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ thin-image.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ logreport.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ filename.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ xstd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ despeckle.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ exception.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ strgicmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ image-proc.lo @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-pnm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-bmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-tga.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-png.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-magick.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-eps.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-er.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-fig.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-sk.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-svg.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-p2e.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-emf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-dxf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-epd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-pdf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-mif.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-cgm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-dr2d.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-swf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ fit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ bitmap.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ spline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ curve.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ epsilon-equal.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ vector.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ color.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ autotrace.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ pxl-outline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ median.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ thin-image.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ logreport.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ filename.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ xstd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ despeckle.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ exception.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ strgicmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ image-proc.lo @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-pnm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-bmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-tga.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-png.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-eps.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-er.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-fig.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-sk.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-svg.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-p2e.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-emf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-dxf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-epd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-pdf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-mif.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-cgm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-dr2d.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-swf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ fit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ bitmap.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ spline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ curve.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ epsilon-equal.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ vector.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ color.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ autotrace.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ pxl-outline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ median.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ thin-image.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ logreport.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ filename.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ xstd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ despeckle.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ exception.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ strgicmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_FALSE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ image-proc.lo @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-pnm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-bmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-tga.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-png.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input-magick.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-eps.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-er.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-fig.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-sk.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-svg.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-p2e.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-emf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-dxf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-epd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-pdf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-mif.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-cgm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-dr2d.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output-pstoedit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ fit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ bitmap.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ spline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ curve.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ epsilon-equal.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ vector.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ color.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ autotrace.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ output.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ input.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ pxl-outline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ median.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ thin-image.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ logreport.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ filename.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ xstd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ despeckle.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ exception.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ strgicmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_TRUE@ image-proc.lo @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-pnm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-bmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-tga.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input-png.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-eps.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-er.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-fig.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-sk.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-svg.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-p2e.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-emf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-dxf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-epd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-pdf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-mif.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-cgm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-dr2d.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output-pstoedit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ fit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ bitmap.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ spline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ curve.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ epsilon-equal.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ vector.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ color.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ autotrace.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ output.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ input.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ pxl-outline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ median.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ thin-image.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ logreport.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ filename.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ xstd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ despeckle.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ exception.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ strgicmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_FALSE@@HAVE_MAGICK_FALSE@ image-proc.lo @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-pnm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-bmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-tga.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-png.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input-magick.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-eps.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-er.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-fig.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-sk.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-svg.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-p2e.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-emf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-dxf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-epd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-pdf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-mif.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-cgm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-dr2d.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-swf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output-pstoedit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ fit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ bitmap.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ spline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ curve.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ epsilon-equal.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ vector.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ color.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ autotrace.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ output.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ input.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ pxl-outline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ median.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ thin-image.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ logreport.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ filename.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ xstd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ despeckle.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ exception.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ strgicmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_TRUE@ image-proc.lo @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@am_libautotrace_la_OBJECTS = \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-pnm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-bmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-tga.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input-png.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-eps.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-er.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-fig.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-sk.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-svg.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-p2e.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-emf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-dxf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-epd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-pdf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-mif.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-cgm.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-dr2d.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-swf.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output-pstoedit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ fit.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ bitmap.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ spline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ curve.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ epsilon-equal.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ vector.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ color.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ autotrace.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ output.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ input.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ pxl-outline.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ median.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ thin-image.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ logreport.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ filename.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ xstd.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ despeckle.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ exception.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ strgicmp.lo \ @HAVE_LIBPNG_TRUE@@HAVE_LIBPSTOEDIT_TRUE@@HAVE_LIBSWF_TRUE@@HAVE_MAGICK_FALSE@ image-proc.lo libautotrace_la_OBJECTS = $(am_libautotrace_la_OBJECTS) bin_PROGRAMS = autotrace$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_autotrace_OBJECTS = atou.$(OBJEXT) main.$(OBJEXT) getopt.$(OBJEXT) \ getopt1.$(OBJEXT) autotrace_OBJECTS = $(am_autotrace_OBJECTS) autotrace_DEPENDENCIES = libautotrace.la autotrace_LDFLAGS = SCRIPTS = $(bin_SCRIPTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libautotrace_la_SOURCES) $(autotrace_SOURCES) NROFF = nroff MANS = $(man_MANS) DATA = $(m4data_DATA) $(pkgconfig_DATA) HEADERS = $(autotraceinclude_HEADERS) $(noinst_HEADERS) DIST_COMMON = README $(autotraceinclude_HEADERS) $(noinst_HEADERS) \ ./stamp-h.in AUTHORS COPYING COPYING.LIB ChangeLog INSTALL \ Makefile.am Makefile.in NEWS THANKS TODO acconfig.h aclocal.m4 \ autotrace-config.in autotrace.pc.in autotrace.spec.in \ config.guess config.h.in config.sub configure configure.in \ install-sh ltmain.sh missing mkinstalldirs SOURCES = $(libautotrace_la_SOURCES) $(autotrace_SOURCES) all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && \ CONFIG_HEADERS= CONFIG_LINKS= \ CONFIG_FILES=$@ $(SHELL) ./config.status $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h stamp-hT @echo timestamp > stamp-hT 2> /dev/null cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status @mv stamp-hT stamp-h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/./stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/./stamp-h.in; \ $(MAKE) $(srcdir)/./stamp-h.in; \ else :; fi $(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null cd $(top_srcdir) && $(AUTOHEADER) @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in distclean-hdr: -rm -f config.h autotrace-config: $(top_builddir)/config.status autotrace-config.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status autotrace.pc: $(top_builddir)/config.status autotrace.pc.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status autotrace.spec: $(top_builddir)/config.status autotrace.spec.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) libautotrace.la: $(libautotrace_la_OBJECTS) $(libautotrace_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libautotrace_la_LDFLAGS) $(libautotrace_la_OBJECTS) $(libautotrace_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) autotrace$(EXEEXT): $(autotrace_OBJECTS) $(autotrace_DEPENDENCIES) @rm -f autotrace$(EXEEXT) $(LINK) $(autotrace_LDFLAGS) $(autotrace_OBJECTS) $(autotrace_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f="`echo $$p|sed '$(transform)'`"; \ if test -f $$p; then \ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f; \ elif test -f $(srcdir)/$$p; then \ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f="`echo $$p|sed '$(transform)'`"; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< .c.obj: $(COMPILE) -c `cygpath -w $<` .c.lo: $(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< uninstall-info-am: man1dir = $(mandir)/man1 install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done install-m4dataDATA: $(m4data_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(m4datadir) @list='$(m4data_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(m4datadir)/$$f"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(m4datadir)/$$f; \ done uninstall-m4dataDATA: @$(NORMAL_UNINSTALL) @list='$(m4data_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(m4datadir)/$$f"; \ rm -f $(DESTDIR)$(m4datadir)/$$f; \ done install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir) @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgconfigdir)/$$f"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgconfigdir)/$$f; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(pkgconfigdir)/$$f"; \ rm -f $(DESTDIR)$(pkgconfigdir)/$$f; \ done install-autotraceincludeHEADERS: $(autotraceinclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(autotraceincludedir) @list='$(autotraceinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(INSTALL_HEADER) $$d$$p $(DESTDIR)$(autotraceincludedir)/$$f"; \ $(INSTALL_HEADER) $$d$$p $(DESTDIR)$(autotraceincludedir)/$$f; \ done uninstall-autotraceincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(autotraceinclude_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(autotraceincludedir)/$$f"; \ rm -f $(DESTDIR)$(autotraceincludedir)/$$f; \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ || etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) GTAGS: here=`CDPATH=: && cd $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . # Avoid unsightly `./'. distdir = $(PACKAGE)-$(VERSION) GZIP_ENV = --best distdir: $(DISTFILES) -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) mkdir $(distdir) $(mkinstalldirs) $(distdir)/. @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ $(mkinstalldirs) "$(distdir)/$$dir"; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="${top_distdir}" distdir="$(distdir)" \ dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/=build mkdir $(distdir)/=inst chmod a-w $(distdir) dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \ && cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ || (echo "Error: files left after uninstall" 1>&2; \ exit 1) ) \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && $(MAKE) $(AM_MAKEFLAGS) distclean \ && rm -f $(distdir).tar.gz \ && (test `find . -type f -print | wc -l` -eq 0 \ || (echo "Error: files left after distclean" 1>&2; \ exit 1) ) -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \ $(HEADERS) config.h install-binPROGRAMS: install-libLTLIBRARIES installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(m4datadir) $(DESTDIR)$(pkgconfigdir) $(DESTDIR)$(autotraceincludedir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool mostlyclean-am dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) distclean: distclean-am -rm -f config.status config.cache config.log distclean-am: clean-am distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-autotraceincludeHEADERS install-m4dataDATA \ install-man install-pkgconfigDATA install-exec-am: install-binPROGRAMS install-binSCRIPTS \ install-libLTLIBRARIES install-info: install-info-am install-man: install-man1 installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-autotraceincludeHEADERS uninstall-binPROGRAMS \ uninstall-binSCRIPTS uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-m4dataDATA uninstall-man uninstall-pkgconfigDATA uninstall-man: uninstall-man1 .PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libLTLIBRARIES clean-libtool dist dist-all \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am \ install-autotraceincludeHEADERS install-binPROGRAMS \ install-binSCRIPTS install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-m4dataDATA install-man \ install-man1 install-pkgconfigDATA install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-autotraceincludeHEADERS \ uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-m4dataDATA uninstall-man \ uninstall-man1 uninstall-pkgconfigDATA autotrace-config: autotrace-config.in autotrace-config.in: autotrace-config.af autofig $< dist-hook: autotrace.spec cp autotrace.spec $(distdir) rpm: dist autotrace.spec rpm -bb autotrace.spec # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: autotrace-0.31.1/NEWS0000664000076400007640000000606707563013235007772 What's new in AutoTrace 0.31.1? - fixed compile time error appeared when an user specifies --without-pstoedit option(Ralf Stubner). - fixed a bug related to centerline tracing(Martin). - fixed bugs in dr2d output and dxf output(Martin). - changed the name of tracing option structure field(width_weight_factor)(Masatake). This means source compatibility is broken. What's new in AutoTrace 0.31.0? (This NEWS items are the summary of changed from 0.30.1 to 0.30.8. For more detail, see ChangeLog.) - improved interface between pstoedit and autotrace - added library level pstoedit support - built autotrace library as a shared library - corrected output when background-color is used - changing the license of sources files input and output to GNU Lesser Public License(LGPL) - checking libautotrace version number in autotrace.m4 - output in dr2d format(Andrew Elia) - introduced config.h - corrected thin-image - made more portable - corrected a bug in fitting - now recognizes line width What's new in AutoTrace 0.30.8? - added variable line width in centerline tracing(--width-factor, --preserve-width) autotrace library API is changed. - fixed memory leaks - many bugs fixes What's new in AutoTrace 0.30.6? - added workaround for a compile time error that appears when autotrace is linked to pstoedit-3.32.0. - made code that creates temporary file more portable. What's new in AutoTrace 0.30.5? - fixed a compile time error that appears when autotrace is not linked to pstoedit. What's new in AutoTrace 0.30.4? - fixed a bug reported by Gerhard Gaussling - improved the interface between pstoedit and autotrace What's new in AutoTrace 0.30.2? - added library level pstoedit support - built autotrace library as a shared library What's new in AutoTrace 0.30.1? - corrected output when background-color is used - changing the license of sources files input and output to GNU Lesser Public License(LGPL) - checking libautotrace version number in autotrace.m4 - output in dr2d format(Andrew Elia) - introduced config.h What's new in AutoTrace 0.30? - fixed some bugs in the filtering routine - fixed pdf export - fixed despeckle - fixed emf export - better error handling mechanism - rpm spec file template(Han-Wen Nienhuys) - pkgconfig support - man page (R. P. C. Rodgers) What's new in AutoTrace 0.29? - Small bug fix for binary output - code rearrangements - CGM and MIF export - fixes the lowercase/uppercase problems - fix for swf export What's new in AutoTrace 0.28? - Several bug fixes - Progress bar - Cancel point - Efforts to make libautotrace.a thread-safe - Clean up library name space (all exported symbols have "at_" prefix) - DXF, EPD and PDF export - Despeckling filter What's new in AutoTrace 0.27? - Parts of the code were rearranged - Fixed a bug in color quantization - Centerline support - Elastic Reality output - Now works with new versions of ImageMagick - Swf output(via libming. You can get libming from http://www.opaque.net/ming/) - The dxf output was removed because it never worked. - Speed up and simplification of the fitting routine autotrace-0.31.1/THANKS0000664000076400007640000000123407556274432010207 If soneone missing please let me (Martin Weber ) know. --- Bernhard Herzog (Postscript, svg and sk export filter) Ian MacPhedran (xfig export filter) Martin Kroeker (bugfixes) Tobias Polzin (bugfixes) Kevin O'Gorman (Shockwave support) MenTaLguY (png import filter) Peter Cucka (bugfixes) Enrico Persiani (emf export) Johannes Schindelin (Magick import filter) Masatake YAMATO (library, help with cvs) Steffen Politzky (dxf export) David A. Bartold (part of despeckle) Han-Wen Nienhuys (rpm-spec file) R. P. C. Rodgers (man page) Allen Barnett (improved emf export) Andrew Elia (dr2d export filter) Ralf Stubner (bugfixes about pstoedit usage) autotrace-0.31.1/TODO0000664000076400007640000000242007555461202007752 Core: - Speed up - Improve tracing quality - Bugs?! - Recognition of Circle and Ellipse pieces. - Addition of code to recognize lines, splines and circles even if there is a lot of noise - Currently pictures have to fit completely into memory - New algorithm to work best with anti-aliased pictures - 3D recognition - Better list management, that means the current generation of lists is time consuming and fragmentates the heap. - Outlines are traced two times that means that it could be faster and if we trace and fit every outline only once we will not have the problems with unwanted gaps anymore. - Better thinning algorithm like CAT (Chordal Axis Transformation) Input: - Migrate to new plug-in interface using glib(0.32.0) - Support of image libraries as freeimage, gdk-pixbuf or paintlib(0.32.0) Output: - Migrate to new plug-in interface using glib(0.32.0) - Output API abstraction(0.32.0) - New export formats like wmf, cdr, cmx, compressed pdf, compressed svg and dxf with splines... Library and its clients: - Graphical user interface -- For gnome/gtk+, frontline is under developing. See http://autotrace.sourceforge.net/frontline -- For KDE/Qt? Misc: - Gettextize(0.32.0) - Better documentations - Predefined parameter system(discussed as aop file, 0.32.0) autotrace-0.31.1/acconfig.h0000664000076400007640000000175507557662405011230 /* acconfig.h This file is in the public domain. Descriptive text for the C preprocessor macros that the distributed Autoconf macros can define. No software package will use all of them; autoheader copies the ones your configure.in uses into your configuration header file templates. The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). Although this order can split up related entries, it makes it easier to check whether a given entry is in the file. Leave the following blank line there!! Autoheader needs it. */ /* Other stuff */ #undef AUTOTRACE_VERSION #undef AUTOTRACE_WEB #undef HAVE_LIBPNG #undef HAVE_LIBSWF #undef HAVE_MAGICK #undef HAVE_LIBPSTOEDIT #undef HAVE_MKSTEMP /* Leave that blank line there!! Autoheader needs it. If you're adding to this file, keep in mind: The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). */ autotrace-0.31.1/aclocal.m40000664000076400007640000042455407562777770011164 # aclocal.m4 generated automatically by aclocal 1.5 # Copyright 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 5 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # We require 2.13 because we rely on SHELL being computed by configure. AC_PREREQ([2.13]) # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED. # The purpose of this macro is to provide the user with a means to # check macros which are provided without letting her know how the # information is coded. # If this macro is not defined by Autoconf, define it here. ifdef([AC_PROVIDE_IFELSE], [], [define([AC_PROVIDE_IFELSE], [ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE]) # ---------------------------------------------- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first]) fi # Define the identity of the package. PACKAGE=$1 AC_SUBST(PACKAGE)dnl VERSION=$2 AC_SUBST(VERSION)dnl ifelse([$3],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. ifdef([m4_pattern_allow], [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl # Autoconf 2.50 always computes EXEEXT. However we need to be # compatible with 2.13, for now. So we always define EXEEXT, but we # don't compute it. AC_SUBST(EXEEXT) # Similar for OBJEXT -- only we only use OBJEXT if the user actually # requests that it be used. This is a bit dumb. : ${OBJEXT=o} AC_SUBST(OBJEXT) # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_DEP_TRACK])dnl AC_REQUIRE([AM_SET_DEPDIR])dnl AC_PROVIDE_IFELSE([AC_PROG_][CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_][CC], defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_][CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_][CXX], defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) # # Check to make sure that the build environment is sane. # # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # serial 2 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= am_backtick='`' AC_MSG_WARN([${am_backtick}missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # serial 4 -*- Autoconf -*- # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # --------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX" or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'] [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_$1_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type" AC_SUBST([$1DEPMODE]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null AC_SUBST(DEPDIR) ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) pushdef([subst], defn([AC_SUBST])) subst(AMDEPBACKSLASH) popdef([subst]) ]) # Generate code to set up dependency tracking. # This macro should only be invoked once -- use via AC_REQUIRE. # Usage: # AM_OUTPUT_DEPENDENCY_COMMANDS # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[ AC_OUTPUT_COMMANDS([ test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do case "$mf" in Makefile) dirpart=.;; */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; *) continue;; esac grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`echo "$file" | sed -e 's|/[^/]*$||'` $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])]) # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include='#' am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote='"' _am_result=BSD fi fi AC_SUBST(am__include) AC_SUBST(am__quote) AC_MSG_RESULT($_am_result) rm -f confinc confmf ]) # serial 3 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. # # FIXME: Once using 2.50, use this: # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [errprint(__file__:__line__: [$0: invalid condition: $1 ])dnl m4exit(1)])dnl ifelse([$1], [FALSE], [errprint(__file__:__line__: [$0: invalid condition: $1 ])dnl m4exit(1)])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi]) # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- # serial 46 AC_PROG_LIBTOOL AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ]) AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.13)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl _LT_AC_PROG_ECHO_BACKSLASH # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE(libtool-lock, [ --disable-libtool-lock avoid locking (might break parallel builds)]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_SAVE AC_LANG_C AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_RESTORE]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, [AC_TRY_LINK([], [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); DllMain (0, 0, 0);], [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) case $host/$CC in *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) # old mingw systems require "-dll" to link a DLL, while more recent ones # require "-mdll" SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mdll" AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) CFLAGS="$SAVE_CFLAGS" ;; *-*-cygwin* | *-*-pw32*) # cygwin systems need to pass --dll to the linker, and not link # crt.o which will require a WinMain@16 definition. lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; esac ;; ]) esac _LT_AC_LTCONFIG_HACK ]) # AC_LIBTOOL_HEADER_ASSERT # ------------------------ AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], [AC_CACHE_CHECK([whether $CC supports assert without backlinking], [lt_cv_func_assert_works], [case $host in *-*-solaris*) if test "$GCC" = yes && test "$with_gnu_ld" != yes; then case `$CC --version 2>/dev/null` in [[12]].*) lt_cv_func_assert_works=no ;; *) lt_cv_func_assert_works=yes ;; esac fi ;; esac]) if test "x$lt_cv_func_assert_works" = xyes; then AC_CHECK_HEADERS(assert.h) fi ])# AC_LIBTOOL_HEADER_ASSERT # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h) ])# _LT_AC_CHECK_DLFCN # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix*) symcode='[[BCDEGRST]]' ;; solaris* | sysv5*) symcode='[[BDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $host_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[[ABCDGISTW]]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[[]] = { EOF sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if AC_TRY_EVAL(ac_link) && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AC_FD_CC fi else echo "cannot find nm_test_var in $nlist" >&AC_FD_CC fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC fi else echo "$progname: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= global_symbol_to_c_name_address= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" fi if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # --------------------------------- AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], [# Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) AC_DIVERT_POP ])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [if test "$cross_compiling" = yes; then : [$4] else AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF AC_DEFUN([_LT_AC_LTCONFIG_HACK], [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case $host_os in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="[$]2" AC_MSG_CHECKING([for objdir]) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null AC_MSG_RESULT($objdir) AC_ARG_WITH(pic, [ --with-pic try to use only PIC/non-PIC objects [default=use both]], pic_mode="$withval", pic_mode=default) test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. AC_MSG_CHECKING([for $compiler option to produce PIC]) AC_CACHE_VAL(lt_cv_prog_cc_pic, [ lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case $host_os in aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_cv_prog_cc_pic='-fno-common' ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case $host_os in aix3* | aix4* | aix5*) lt_cv_prog_cc_wl='-Wl,' # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_cv_prog_cc_static='-Bstatic' else lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' if test "x$host_vendor" = xsni; then lt_cv_prog_cc_wl='-LD' else lt_cv_prog_cc_wl='-Wl,' fi ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi ]) if test -z "$lt_cv_prog_cc_pic"; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([$lt_cv_prog_cc_pic]) # Check to make sure the pic_flag actually works. AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" AC_TRY_COMPILE([], [], [dnl case $host_os in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then # they create non-PIC objects. So, if there were any warnings, we # assume that PIC is not supported. if test -s conftest.err; then lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac ], [dnl lt_cv_prog_cc_pic_works=no ]) CFLAGS="$save_CFLAGS" ]) if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) fi # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : else AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) lt_cv_prog_cc_can_build_shared=no fi fi AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) LDFLAGS="$save_LDFLAGS" ]) # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) AC_CACHE_VAL([lt_cv_compiler_c_o], [ $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then lt_cv_compiler_c_o=no else lt_cv_compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&AC_FD_CC lt_cv_compiler_c_o=no fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null ]) compiler_c_o=$lt_cv_compiler_c_o AC_MSG_RESULT([$compiler_c_o]) if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) AC_CACHE_VAL([lt_cv_compiler_o_lo], [ lt_cv_compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" save_objext="$ac_objext" ac_objext=lo AC_TRY_COMPILE([], [int some_variable = 0;], [dnl # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then lt_cv_compiler_o_lo=no else lt_cv_compiler_o_lo=yes fi ]) ac_objext="$save_objext" CFLAGS="$save_CFLAGS" ]) compiler_o_lo=$lt_cv_compiler_o_lo AC_MSG_RESULT([$compiler_o_lo]) else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no AC_TRY_COMPILE([], [int some_variable = 0;], [dnl # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi ]) CFLAGS="$save_CFLAGS" AC_MSG_RESULT([$compiler_rtti_exceptions]) if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # See if the linker supports building shared libraries. AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \[$]# in 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done; fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw* | pw32*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. hardcode_direct=yes archive_cmds='' hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then shared_flag='${wl}-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall can do strange things, so it is better to # generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. allow_undefined_flag='${wl}-berok' # This is a bit strange, but is similar to how AIX traditionally builds # it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[[012]]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on allow_undefined_flag='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load $convenience' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case "$host_os" in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes export_dynamic_flag_spec='${wl}-Bexport' ;; solaris*) # gcc --version < 3.0 without binutils cannot create self contained # shared libraries reliably, requiring libgcc.a to resolve some of # the object symbols generated in some cases. Libraries that use # assert need libgcc.a to resolve __eprintf, for example. Linking # a copy of libgcc.a into every shared library to guarantee resolving # such symbols causes other problems: According to Tim Van Holder # , C++ libraries end up with a separate # (to the application) exception stack for one thing. no_undefined_flag=' -z defs' if test "$GCC" = yes; then case `$CC --version 2>/dev/null` in [[12]].*) cat <&2 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably *** create self contained shared libraries on Solaris systems, without *** introducing a dependency on libgcc.a. Therefore, libtool is disabling *** -no-undefined support, which will at least allow you to build shared *** libraries. However, you may find that when you link such libraries *** into an application without using GCC, you have to manually add *** \`gcc --print-libgcc-file-name\` to the link command. We urge you to *** upgrade to a newer version of GCC. Another option is to rebuild your *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. EOF no_undefined_flag= ;; esac fi # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsno; then archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5uw7* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi AC_MSG_RESULT([$ld_shlibs]) test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. AC_MSG_CHECKING([how to hardcode library paths into programs]) hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi AC_MSG_RESULT([$hardcode_action]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4* | aix5*) version_type=linux if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can # not hardcode correct soname into executable. Probably we can # add versioning support to collect2, so additional links can # be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin*) library_names_spec='$libname.dll.a' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog .libs/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' ;; yes,mingw*) library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` ;; yes,pw32*) library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' ;; *) library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' case $host_os in irix5*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case "$host_os" in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi AC_LIBTOOL_DLOPEN_SELF if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], [$rm conftest* echo 'static int dummy;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi]) AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS \ AR AR_FLAGS CC LD LN_S NM SHELL \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib file_magic_cmd export_symbols_cmds \ deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ global_symbol_to_c_name_address \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case $var in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # 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. # # 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. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$need_lc # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "${ofile}T" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac case $host_os in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # 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. # */ # # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (dll < 1) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi ])# _LT_AC_LTCONFIG_HACK # AC_LIBTOOL_DLOPEN - enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac], enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl ]) # AC_DISABLE_SHARED - set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no)]) # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac], enable_static=AC_ENABLE_STATIC_DEFAULT)dnl ]) # AC_DISABLE_STATIC - set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no)]) # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(fast-install, changequote(<<, >>)dnl << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac], enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl ]) # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no)]) # AC_LIBTOOL_PICMODE - implement the --with-pic flag # Usage: AC_LIBTOOL_PICMODE[(MODE)] # Where MODE is either `yes' or `no'. If omitted, it defaults to # `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default)]) # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ]) # AC_PATH_MAGIC - find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) else MAGIC_CMD=: fi fi ]) # AC_PROG_LD - find the path to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | [[A-Za-z]]:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$lt_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ]) # AC_PROG_LD_GNU - AC_DEFUN([AC_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi]) with_gnu_ld=$lt_cv_prog_gnu_ld ]) # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker # -- PORTME Some linkers may need a different reload flag. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" ]) # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], [AC_CACHE_CHECK([how to recognise dependant libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.[[012]]) lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case $host_cpu in alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv5uw[[78]]* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; esac ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method ]) # AC_PROG_NM - find the path to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" AC_MSG_RESULT([$NM]) ]) # AC_CHECK_LIBM - check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32*) # These system don't have libm ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, main, LIBM="-lm") ;; esac ]) # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for # the libltdl convenience library and INCLTDL to the include flags for # the libltdl header and adds --enable-ltdl-convenience to the # configure arguments. Note that LIBLTDL and INCLTDL are not # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed # with '${top_builddir}/' and INCLTDL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) ]) # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for # the libltdl installable library and INCLTDL to the include flags for # the libltdl header and adds --enable-ltdl-install to the configure # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed # with '${top_srcdir}/' (note the single quotes!). If your package is # not flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, main, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" INCLTDL= fi ]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering # serial 1 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) # Like AC_CONFIG_HEADER, but automatically create stamp file. # serial 3 # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. We must strip everything past the first ":", # and everything past the last "/". AC_PREREQ([2.12]) AC_DEFUN([AM_CONFIG_HEADER], [ifdef([AC_FOREACH],dnl [dnl init our file count if it isn't already m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0])) dnl prepare to store our destination file list for use in config.status AC_FOREACH([_AM_File], [$1], [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*])) m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index)) dnl and add it to the list of files AC keeps track of, along dnl with our hook AC_CONFIG_HEADERS(_AM_File, dnl COMMANDS, [, INIT-CMDS] [# update the timestamp echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index[" ][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS m4_popdef([_AM_Dest])])],dnl [AC_CONFIG_HEADER([$1]) AC_OUTPUT_COMMANDS( ifelse(patsubst([$1], [[^ ]], []), [], [test -z "$CONFIG_HEADERS" || echo timestamp >dnl patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl [am_indx=1 for am_file in $1; do case " \$CONFIG_HEADERS " in *" \$am_file "*) am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\` if test -n "\$am_dir"; then am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\` for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do am_tmpdir=\$am_tmpdir\$am_subdir/ if test ! -d \$am_tmpdir; then mkdir \$am_tmpdir fi done fi echo timestamp > "\$am_dir"stamp-h\$am_indx ;; esac am_indx=\`expr \$am_indx + 1\` done]) ])]) # AM_CONFIG_HEADER # _AM_DIRNAME(PATH) # ----------------- # Like AS_DIRNAME, only do it during macro expansion AC_DEFUN([_AM_DIRNAME], [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1, m4_if(m4_regexp([$1], [^/.*]), -1, [.], m4_patsubst([$1], [^\(/\).*], [\1])), m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl ]) # _AM_DIRNAME # a macro to get the libs/cflags for libpstoedit # Copyed from gdk-pixbuf.m4 dnl AM_PATH_PSTOEDIT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Test to see if libpstoedit is installed, and define PSTOEDIT_CFLAGS, LIBS dnl AC_DEFUN(AM_PATH_PSTOEDIT, [dnl dnl Get the cflags and libraries from the pstoedit-config script dnl AC_ARG_WITH(pstoedit-prefix,[ --with-pstoedit-prefix=PFX Prefix where Pstoedit is installed (optional)], pstoedit_prefix="$withval", pstoedit_prefix="") AC_ARG_WITH(pstoedit-exec-prefix,[ --with-pstoedit-exec-prefix=PFX Exec prefix where Pstoedit is installed (optional)], pstoedit_exec_prefix="$withval", pstoedit_exec_prefix="") AC_ARG_ENABLE(pstoedittest, [ --disable-pstoedittest Do not try to compile and run a test Pstoedit program], , enable_pstoedittest=yes) if test x$pstoedit_exec_prefix != x ; then pstoedit_args="$pstoedit_args --exec_prefix=$pstoedit_exec_prefix" if test x${PSTOEDIT_CONFIG+set} != xset ; then PSTOEDIT_CONFIG=$pstoedit_exec_prefix/bin/pstoedit-config fi fi if test x$pstoedit_prefix != x ; then pstoedit_args="$pstoedit_args --prefix=$pstoedit_prefix" if test x${PSTOEDIT_CONFIG+set} != xset ; then PSTOEDIT_CONFIG=$pstoedit_prefix/bin/pstoedit-config fi fi AC_PATH_PROG(PSTOEDIT_CONFIG, pstoedit-config, no) min_pstoedit_version=ifelse([$1], ,3.32.0,$1) AC_MSG_CHECKING(for PSTOEDIT - version >= $min_pstoedit_version) no_pstoedit="" if test "$PSTOEDIT_CONFIG" = "no" ; then no_pstoedit=yes else PSTOEDIT_CFLAGS=`$PSTOEDIT_CONFIG $pstoedit_args --cflags` PSTOEDIT_LIBS=`$PSTOEDIT_CONFIG $pstoedit_args --libs` pstoedit_major_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` pstoedit_minor_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` pstoedit_micro_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_pstoedittest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PSTOEDIT_CFLAGS" LIBS="$PSTOEDIT_LIBS $LIBS" dnl dnl Now check if the installed PSTOEDIT is sufficiently new. (Also sanity dnl checks the results of pstoedit-config to some extent dnl rm -f conf.pstoedittest AC_TRY_RUN([ #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main () { int major, minor, micro; char *tmp_version; system ("touch conf.pstoedittest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_pstoedit_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_pstoedit_version"); exit(1); } if (($pstoedit_major_version > major) || (($pstoedit_major_version == major) && ($pstoedit_minor_version > minor)) || (($pstoedit_major_version == major) && ($pstoedit_minor_version == minor) && ($pstoedit_micro_version >= micro))) { return 0; } else { printf("\n*** 'pstoedit-config --version' returned %d.%d.%d, but the minimum version\n", $pstoedit_major_version, $pstoedit_minor_version, $pstoedit_micro_version); printf("*** of PSTOEDIT required is %d.%d.%d. If pstoedit-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If pstoedit-config was wrong, set the environment variable PSTOEDIT_CONFIG\n"); printf("*** to point to the correct copy of pstoedit-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_pstoedit=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_pstoedit" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PSTOEDIT_CONFIG" = "no" ; then echo "*** The pstoedit-config script installed by PSTOEDIT could not be found" echo "*** If PSTOEDIT was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the PSTOEDIT_CONFIG environment variable to the" echo "*** full path to pstoedit-config." else if test -f conf.pstoedittest ; then : else echo "*** Could not run PSTOEDIT test program, checking why..." CFLAGS="$CFLAGS $PSTOEDIT_CFLAGS" LIBS="$LIBS $PSTOEDIT_LIBS" AC_TRY_LINK([ #include #include ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding PSTOEDIT or finding the wrong" echo "*** version of PSTOEDIT. If it is not finding PSTOEDIT, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means PSTOEDIT was incorrectly installed" echo "*** or that you have moved PSTOEDIT since it was installed. In the latter case, you" echo "*** may want to edit the pstoedit-config script: $PSTOEDIT_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi PSTOEDIT_CFLAGS="" PSTOEDIT_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(PSTOEDIT_CFLAGS) AC_SUBST(PSTOEDIT_LIBS) rm -f conf.pstoedittest ]) autotrace-0.31.1/autotrace-config.in0000664000076400007640000000752207562777767013104 #!/bin/sh af_libs= af_cflags= prefix=@prefix@ exec_prefix=@exec_prefix@ ## ## Define usage() ## usage() { cat <&2 fi # at least one option should be selected case "$1" in --*) ;; *) usage 1 1>&2 ;; esac # grab all -- arguments while test $# -gt 0; do case "$1" in -*=*) af_optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) af_optarg= ;; esac case $1 in --help) usage 0 0>&2 ;; --cflags) af_echo_cflags=yes ;; --libs) af_echo_libs_L=yes af_echo_libs_l=yes ;; --libs-dirs) af_echo_libs_L=yes ;; --libs-names) af_echo_libs_l=yes ;; --prefix=*) prefix=$af_optarg af_prefix_set=yes ;; --prefix) af_echo_prefix=yes ;; --exec_prefix=*) exec_prefix=$af_optarg af_exec_prefix_set=yes ;; --exec_prefix) af_echo_exec_prefix=yes ;; --version) af_echo_version=yes ;; --*) usage 1 1>&2 ;; *) break ;; esac shift done # if we have a default library use it if test $# -eq 0; then if test "X$af_lib_default" != "X"; then af_lib__AF_LIB_DEFAULT=yes return fi fi while test $# -gt 0; do case $1 in autotrace) af_lib_autotrace=yes ;; *) usage 1 1>&2 ;; esac shift done } print_result() { if test "X$af_echo_cflags" = "Xyes"; then af_all_flags="$af_cflags" fi if test "X$af_echo_libs_L" = "Xyes" || test "X$af_echo_libs_l" = "Xyes"; then af_all_flags="$af_all_flags $af_libs" fi if test -z "$af_all_flags" || test "X$af_all_flags" = "X "; then exit 1 fi # Straight out any possible duplicates, but be careful to # get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz' af_other_flags= af_lib_L_flags= af_rev_libs= for i in $af_all_flags; do case "$i" in # a library, save it for later, in reverse order -l*) af_rev_libs="$i $af_rev_libs" ;; -L*|-R*) if test "X$af_echo_libs_L" = "Xyes"; then case " $af_lib_L_flags " in *\ $i\ *) ;; # already there *) af_lib_L_flags="$af_lib_L_flags $i" ;; # add it to output esac fi;; *) case " $af_other_flags " in *\ $i\ *) ;; # already there *) af_other_flags="$af_other_flags $i" ;; # add it to output esac ;; esac done af_ord_libs= if test "X$af_echo_libs_l" = "Xyes"; then for i in $af_rev_libs; do case " $af_ord_libs " in *\ $i\ *) ;; # already there *) af_ord_libs="$i $af_ord_libs" ;; # add it to output in reverse order esac done fi echo $af_other_flags $af_lib_L_flags $af_ord_libs } ## ## Main Body ## parse $* ## ## Initialize names ## ## ## Available options ## if test "X$af_echo_prefix" = "Xyes"; then echo $prefix fi if test "X$af_echo_exec_prefix" = "Xyes"; then echo $exec_prefix fi if test "X$af_echo_version" = "Xyes"; then echo @VERSION@ exit 0 fi ## ## Libraries ## #dummy because this should always be selected af_cflags="$af_cflags -I@includedir@" af_libs="-L@libdir@ -lautotrace @LIBPNG_LDFLAGS@ @MAGICK_LDFLAGS@ @LIBSWF_LDFLAGS@ @LIBPSTOEDIT_LIBS@ $af_libs" print_result exit 0 autotrace-0.31.1/autotrace.pc.in0000664000076400007640000000047207551363373012215 prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: Autotrace Description: a utility that converts bitmap to vector graphics Version: @VERSION@ Requires: Libs: -L@libdir@ -lautotrace @LIBPNG_LDFLAGS@ @MAGICK_LDFLAGS@ @LIBSWF_LDFLAGS@ @LIBPSTOEDIT_LIBS@ Cflags: -I@includedir@ autotrace-0.31.1/autotrace.spec.in0000664000076400007640000000345307555434734012553 Summary: Program for converting bitmaps to vector graphics Name: @PACKAGE@ Version: @VERSION@ Release: 1 Url: http://autotrace.sourceforge.net Source: %{name}-%{version}.tar.gz Copyright: GPL and LGPL Group: Applications/Graphics BuildRoot: %{_tmppath}/%{name}-root %description AutoTrace is a program for converting bitmaps to vector graphics. The aim of the AutoTrace project is the development of a freely-available application similar to CorelTrace or Adobe Streamline. In some aspects it is already better. Originally being created as a plugin for the GIMP, AutoTrace is now a standalone program and can be compiled on any UNIX platform using GCC. %prep %setup -q %build %configure --without-magick --without-pstoedit make %install rm -rf $RPM_BUILD_ROOT make prefix=$RPM_BUILD_ROOT/usr/ install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc AUTHORS COPYING COPYING.LIB ChangeLog NEWS README %doc /usr/man/man1/autotrace.1.* /usr/include/autotrace/autotrace.h /usr/lib/pkgconfig/autotrace.pc /usr/include/autotrace/types.h /usr/lib/libautotrace.* /usr/include/autotrace/exception.h /usr/include/autotrace/input.h /usr/include/autotrace/output.h /usr/share/aclocal/autotrace.m4 /usr/bin/autotrace-config /usr/bin/autotrace %changelog * Wed Oct 23 2002 Masatake YAMATO - make disabled magick and pstoedit. * Tue Jul 9 2002 Masatake YAMATO - Supported shared library and bzip'ed manual. * Sun May 12 2002 Masatake YAMATO - Install output.h. * Tue Apr 16 2002 Masatake YAMATO - Added LGPL to Copyright * Wed Apr 3 2002 Masatake YAMATO - autotrace.1 -> autotrace.1.gz * Thu Mar 7 2002 Masatake YAMATO - Change %description. - Update files. * Thu Feb 21 2002 Han-Wen Nienhuys - Initial build. autotrace-0.31.1/config.guess0000755000076400007640000011544307555272170011616 #! /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-07-23' # 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 trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # This shell variable is my proudest work .. or something. --bje set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; (old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; dummy=$tmpdir/dummy ; files="$dummy.c $dummy.o $dummy.rel $dummy" ; trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $files ; 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 ; unset files' # 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 armeb) machine=armeb-unknown ;; 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. eval $set_cc_for_build 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 $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" ;; 3-1307) UNAME_MACHINE="alphaev7" ;; esac fi rm -f $dummy.s $dummy && rmdir $tmpdir 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 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; 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 && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS) echo powerpc-harris-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 && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir 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 && rmdir $tmpdir 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 && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir 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:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` rm -f $dummy.c && rmdir $tmpdir echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} 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 && rmdir $tmpdir 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 && rmdir $tmpdir 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|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^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 | 4400:*: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 && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir # 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: autotrace-0.31.1/config.h.in0000664000076400007640000000473107555503155011320 /* config.h.in. Generated from configure.in by autoheader. */ /* acconfig.h This file is in the public domain. Descriptive text for the C preprocessor macros that the distributed Autoconf macros can define. No software package will use all of them; autoheader copies the ones your configure.in uses into your configuration header file templates. The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). Although this order can split up related entries, it makes it easier to check whether a given entry is in the file. Leave the following blank line there!! Autoheader needs it. */ /* Other stuff */ #undef AUTOTRACE_VERSION #undef AUTOTRACE_WEB #undef HAVE_LIBPNG #undef HAVE_LIBSWF #undef HAVE_MAGICK #undef HAVE_LIBPSTOEDIT #undef HAVE_MKSTEMP /* Leave that blank line there!! Autoheader needs it. If you're adding to this file, keep in mind: The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). */ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS autotrace-0.31.1/config.sub0000755000076400007640000006710007530313701011242 #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-09-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 . # # 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-*) 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] \ | 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 \ | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mipsisa32 \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[34] | sh[34]eb | shbe | shle \ | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ | stormy16 | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 \ | we32k \ | x86 | xscale \ | 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]-* \ | alphapca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armv*-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ | clipper-* | cray2-* | 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[01234]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-* \ | s390-* | s390x-* \ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \ | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | v850-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ | 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 ;; 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 | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [cjt]90) basic_machine=${basic_machine}-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 ;; 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 ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; 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 ;; 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 ;; 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) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-*) 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 ;; sa29200) basic_machine=a29k-amd os=-udi ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-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 ;; t3e) basic_machine=t3e-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; 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 ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; 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 ;; mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; 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 ;; 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*) # 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 ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -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 ;; 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 ;; *-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: autotrace-0.31.1/configure0000775000076400007640000124152607563000006011174 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $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'` # PATH needs CR, and LINENO needs CR and PATH. # 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" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') 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=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # 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 before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, 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 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi 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$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } # 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` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="fit.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" # 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. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= 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 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -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 | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$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" ;; -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'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac 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 ;; -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 ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) 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 ;; -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'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac 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; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` 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 paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac 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 # 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 its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $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 if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS # # 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 \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names 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 Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --enable-shared=PKGS build shared libraries default=yes --enable-static=PKGS build static libraries default=yes --enable-fast-install=PKGS optimize for fast installation default=yes --disable-libtool-lock avoid locking (might break parallel builds) --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-pstoedittest Do not try to compile and run a test Pstoedit program Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-pic try to use only PIC/non-PIC objects default=use both --with-magick compile with maigck(default) --without-magick compile without maigck --with-pstoedit link with pstoedit library(default) --without-pstoedit link without pstoedit library --with-pstoedit-prefix=PFX Prefix where Pstoedit is installed (optional) --with-pstoedit-exec-prefix=PFX Exec prefix where Pstoedit is installed (optional) 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 CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style 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 elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 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 0 fi exec 5>config.log cat >&5 <<_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.53. Invocation command line was $ $0 $@ _ACEOF { 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` hostinfo = `(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 } >&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. # Also quote any args containing shell meta-characters. ac_configure_args= ac_sep= for ac_arg do case $ac_arg in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n ) continue ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; esac # Get rid of the leading space. done # 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: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. 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, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" 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 && rm -rf 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 -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >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 -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; 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 `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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 # # version setting up for Automake # AUTOTRACE_MAJOR_VERSION=0 AUTOTRACE_MINOR_VERSION=31 AUTOTRACE_MICRO_VERSION=1 AUTOTRACE_VERSION=${AUTOTRACE_MAJOR_VERSION}.${AUTOTRACE_MINOR_VERSION}.${AUTOTRACE_MICRO_VERSION} cat >>confdefs.h <<_ACEOF #define AUTOTRACE_VERSION "$AUTOTRACE_VERSION" _ACEOF ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; 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 $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # 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" # ./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/* | \ /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 $as_executable_p "$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 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. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. 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 build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= am_backtick='`' { echo "$as_me:$LINENO: WARNING: ${am_backtick}missing' script is too old or missing" >&5 echo "$as_me: WARNING: ${am_backtick}missing' script is too old or missing" >&2;} fi for ac_prog in gawk mawk nawk awk 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_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="${MAKE}"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$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 # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null # test to see if srcdir already configured if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # Define the identity of the package. PACKAGE=autotrace VERSION=$AUTOTRACE_VERSION # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. # Autoconf 2.50 always computes EXEEXT. However we need to be # compatible with 2.13, for now. So we always define EXEEXT, but we # don't compute it. # Similar for OBJEXT -- only we only use OBJEXT if the user actually # requests that it be used. This is a bit dumb. : ${OBJEXT=o} # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # # version setting up for libtool # LT_CURRENT=3 LT_REVISION=0 LT_AGE=0 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 $as_executable_p "$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 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 $as_executable_p "$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 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 CC=$ac_ct_CC 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 $as_executable_p "$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 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 "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_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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done 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 CC=$ac_ct_CC else CC="$ac_cv_prog_CC" 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 $as_executable_p "$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 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 set dummy "$as_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" 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 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 $as_executable_p "$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 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 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 $as_executable_p "$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 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 CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH" >&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` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # 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" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check 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' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&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 ac_clean_files=$ac_clean_files_save # Check 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f 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 CFLAGS="-g" 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 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext 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 # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext 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_config_commands="$ac_config_commands default-1" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include='#' am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote='"' _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type" # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac else enable_fast_install=yes fi; # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_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_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { 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=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_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 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` 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 ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi fi echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi NM="$lt_cv_path_NM" echo "$as_me:$LINENO: result: $NM" >&5 echo "${ECHO_T}$NM" >&6 echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.[012]) lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case $host_cpu in alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv5uw[78]* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; esac ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output" >&5 echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris* | sysv5*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $host_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = { EOF sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= global_symbol_to_c_name_address= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" fi if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 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 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. # 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 #line $LINENO "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat 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 non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat 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. # 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 #line $LINENO "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat 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 non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat 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" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&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 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 #line $LINENO "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err 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 #line $LINENO "configure" #include "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 #line $LINENO "configure" #include "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 #line $LINENO "configure" #include "confdefs.h" #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core 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 eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f 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 #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat 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 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 preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; 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: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; 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 $as_executable_p "$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 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 $as_executable_p "$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 test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" 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 RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in *-*-irix6*) # Find out which ABI we are using. echo '#line 4110 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 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 fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case $host_os in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$as_me:$LINENO: result: $objdir" >&5 echo "${ECHO_T}$objdir" >&6 # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "${lt_cv_prog_cc_pic+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case $host_os in aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_cv_prog_cc_pic='-fno-common' ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case $host_os in aix3* | aix4* | aix5*) lt_cv_prog_cc_wl='-Wl,' # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_cv_prog_cc_static='-Bstatic' else lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' if test "x$host_vendor" = xsni; then lt_cv_prog_cc_wl='-LD' else lt_cv_prog_cc_wl='-Wl,' fi ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi fi if test -z "$lt_cv_prog_cc_pic"; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 else echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5 echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6 # Check to make sure the pic_flag actually works. echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6 if test "${lt_cv_prog_cc_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then case $host_os in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then # they create non-PIC objects. So, if there were any warnings, we # assume that PIC is not supported. if test -s conftest.err; then lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 lt_cv_prog_cc_pic_works=no fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5 echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6 fi # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6 if test "${lt_cv_prog_cc_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_prog_cc_static_works=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5 echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6 pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no if { (eval echo configure:4646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then lt_cv_compiler_c_o=no else lt_cv_compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 lt_cv_compiler_c_o=no fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null fi compiler_c_o=$lt_cv_compiler_c_o echo "$as_me:$LINENO: result: $compiler_c_o" >&5 echo "${ECHO_T}$compiler_c_o" >&6 if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6 if test "${lt_cv_compiler_o_lo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" save_objext="$ac_objext" ac_objext=lo cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { int some_variable = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then lt_cv_compiler_o_lo=no else lt_cv_compiler_o_lo=yes fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_objext="$save_objext" CFLAGS="$save_CFLAGS" fi compiler_o_lo=$lt_cv_compiler_o_lo echo "$as_me:$LINENO: result: $compiler_o_lo" >&5 echo "${ECHO_T}$compiler_o_lo" >&6 else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { int some_variable = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5 echo "${ECHO_T}$compiler_rtti_exceptions" >&6 if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # See if the linker supports building shared libraries. echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \$# in 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done; fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw* | pw32*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. hardcode_direct=yes archive_cmds='' hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then shared_flag='${wl}-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall can do strange things, so it is better to # generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. allow_undefined_flag='${wl}-berok' # This is a bit strange, but is similar to how AIX traditionally builds # it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on allow_undefined_flag='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load $convenience' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes export_dynamic_flag_spec='${wl}-Bexport' ;; solaris*) # gcc --version < 3.0 without binutils cannot create self contained # shared libraries reliably, requiring libgcc.a to resolve some of # the object symbols generated in some cases. Libraries that use # assert need libgcc.a to resolve __eprintf, for example. Linking # a copy of libgcc.a into every shared library to guarantee resolving # such symbols causes other problems: According to Tim Van Holder # , C++ libraries end up with a separate # (to the application) exception stack for one thing. no_undefined_flag=' -z defs' if test "$GCC" = yes; then case `$CC --version 2>/dev/null` in [12].*) cat <&2 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably *** create self contained shared libraries on Solaris systems, without *** introducing a dependency on libgcc.a. Therefore, libtool is disabling *** -no-undefined support, which will at least allow you to build shared *** libraries. However, you may find that when you link such libraries *** into an application without using GCC, you have to manually add *** \`gcc --print-libgcc-file-name\` to the link command. We urge you to *** upgrade to a newer version of GCC. Another option is to rebuild your *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. EOF no_undefined_flag= ;; esac fi # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsno; then archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5uw7* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4* | aix5*) version_type=linux if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can # not hardcode correct soname into executable. Probably we can # add versioning support to collect2, so additional links can # be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin*) library_names_spec='$libname.dll.a' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog .libs/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' ;; yes,mingw*) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` ;; yes,pw32*) library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll' ;; *) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' case $host_os in irix5*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case "$host_os" in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_shl_load) || defined (__stub___shl_load) choke me #else f = shl_load; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" 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 #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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 #else f = dlopen; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.$ac_objext 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 lt_cv_dlopen="dlopen" else 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 #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext 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 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 if test "${lt_cv_archive_cmds_need_lc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $rm conftest* echo 'static int dummy;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi fi echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6 ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS \ AR AR_FLAGS CC LD LN_S NM SHELL \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib file_magic_cmd export_symbols_cmds \ deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ global_symbol_to_c_name_address \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case $var in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # 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. # # 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. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$need_lc # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "${ofile}T" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac case $host_os in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # 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. # */ # # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (dll < 1) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion AUTOTRACE_WEB=http://autotrace.sourceforge.net cat >>confdefs.h <<_ACEOF #define AUTOTRACE_WEB "$AUTOTRACE_WEB" _ACEOF echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_config_headers="$ac_config_headers config.h" 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. # 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 #line $LINENO "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat 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 non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat 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. # 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 #line $LINENO "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat 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 non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat 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" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&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 -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 $as_executable_p "$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 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 $as_executable_p "$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 test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" 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 RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 # 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" # ./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/* | \ /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 $as_executable_p "$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 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. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. 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' for ac_header in malloc.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f 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 #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat 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 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 preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; 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: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 HAVE_MAGICK=no # Check whether --with-magick or --without-magick was given. if test "${with_magick+set}" = set; then withval="$with_magick" else with_magick=yes fi; if test $with_magick = yes ; then # Extract the first word of "Magick-config", so it can be a program name with args. set dummy Magick-config; 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_MAGICK_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAGICK_CONFIG"; then ac_cv_prog_MAGICK_CONFIG="$MAGICK_CONFIG" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MAGICK_CONFIG="Magick-config" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_MAGICK_CONFIG" && ac_cv_prog_MAGICK_CONFIG="""" fi fi MAGICK_CONFIG=$ac_cv_prog_MAGICK_CONFIG if test -n "$MAGICK_CONFIG"; then echo "$as_me:$LINENO: result: $MAGICK_CONFIG" >&5 echo "${ECHO_T}$MAGICK_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "x$MAGICK_CONFIG" = "xMagick-config" ; then CPPFLAGS_BACKUP="$CPPFLAGS" CPPFLAGS=`Magick-config --cppflags` if test "${ac_cv_header_magick_api_h+set}" = set; then echo "$as_me:$LINENO: checking for magick/api.h" >&5 echo $ECHO_N "checking for magick/api.h... $ECHO_C" >&6 if test "${ac_cv_header_magick_api_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_magick_api_h" >&5 echo "${ECHO_T}$ac_cv_header_magick_api_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking magick/api.h usability" >&5 echo $ECHO_N "checking magick/api.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f 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 magick/api.h presence" >&5 echo $ECHO_N "checking magick/api.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat 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 in yes:no ) { echo "$as_me:$LINENO: WARNING: magick/api.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: magick/api.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: magick/api.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: magick/api.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: magick/api.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: magick/api.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: magick/api.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: magick/api.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: magick/api.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: magick/api.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for magick/api.h" >&5 echo $ECHO_N "checking for magick/api.h... $ECHO_C" >&6 if test "${ac_cv_header_magick_api_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_magick_api_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_magick_api_h" >&5 echo "${ECHO_T}$ac_cv_header_magick_api_h" >&6 fi if test $ac_cv_header_magick_api_h = yes; then magick_header_found=yes else magick_header_found=no fi MAGICK_CFLAGS=${CPPFLAGS} CPPFLAGS=${CPPFLAGS_BACKUP} if test "x${magick_header_found}" = xyes ; then MAGICK_LDFLAGS="`Magick-config --ldflags` `Magick-config --libs`" echo "$as_me:$LINENO: checking ImageMagick - version >= 5.2.1" >&5 echo $ECHO_N "checking ImageMagick - version >= 5.2.1... $ECHO_C" >&6 MAGICK_VERSION=`Magick-config --version` MAGICK_MAJOR_VERSION=`echo $MAGICK_VERSION \ | sed -e 's/^\([0-9]*\).[0-9]*.[0-9]*$/\1/'` MAGICK_MINOR_VERSION=`echo $MAGICK_VERSION \ | sed -e 's/^[0-9]*.\([0-9]*\).[0-9]*$/\1/'` MAGICK_MICRO_VERSION=`echo $MAGICK_VERSION \ | sed -e 's/^[0-9]*.[0-9]*.\([0-9]*\)$/\1/'` MAGICK_MAJOR_VERSION_CHECK=`expr $MAGICK_MAJOR_VERSION \>= 5` MAGICK_MINOR_VERSION_CHECK=`expr $MAGICK_MINOR_VERSION \>= 2` if test "$MAGICK_VERSION" = "5.2.0" \ || test "$MAGICK_MAJOR_VERSION_CHECK" = 0 \ || test "$MAGICK_MINOR_VERSION_CHECK" = 0 ; then echo "$as_me:$LINENO: result: no($MAGICK_VERSION)" >&5 echo "${ECHO_T}no($MAGICK_VERSION)" >&6 { echo "$as_me:$LINENO: WARNING: *** Version 5.2.1 or higher is required. ***" >&5 echo "$as_me: WARNING: *** Version 5.2.1 or higher is required. ***" >&2;} { echo "$as_me:$LINENO: WARNING: *** ImageMagick input handler is disabled. ***" >&5 echo "$as_me: WARNING: *** ImageMagick input handler is disabled. ***" >&2;} else echo "$as_me:$LINENO: result: yes($MAGICK_VERSION)" >&5 echo "${ECHO_T}yes($MAGICK_VERSION)" >&6 HAVE_MAGICK=yes cat >>confdefs.h <<\_ACEOF #define HAVE_MAGICK 1 _ACEOF fi else { echo "$as_me:$LINENO: WARNING: *** Magick-config is found but magick/api.h is not found in $MAGICK_CFLAGS ***" >&5 echo "$as_me: WARNING: *** Magick-config is found but magick/api.h is not found in $MAGICK_CFLAGS ***" >&2;} { echo "$as_me:$LINENO: WARNING: *** Check Magick-config. ***" >&5 echo "$as_me: WARNING: *** Check Magick-config. ***" >&2;} { echo "$as_me:$LINENO: WARNING: *** ImageMagick input handler is disabled. ***" >&5 echo "$as_me: WARNING: *** ImageMagick input handler is disabled. ***" >&2;} fi else { echo "$as_me:$LINENO: WARNING: *** Magick-config is not found. ***" >&5 echo "$as_me: WARNING: *** Magick-config is not found. ***" >&2;} { echo "$as_me:$LINENO: WARNING: *** ImageMagick input handler is disabled. ***" >&5 echo "$as_me: WARNING: *** ImageMagick input handler is disabled. ***" >&2;} fi fi if test $HAVE_MAGICK = yes; then HAVE_MAGICK_TRUE= HAVE_MAGICK_FALSE='#' else HAVE_MAGICK_TRUE='#' HAVE_MAGICK_FALSE= fi libMagick_la_path= libMagick_la_sanity=yes if test $HAVE_MAGICK = yes && test $enable_shared = yes; then for f in $MAGICK_LDFLAGS; do case ${f} in -L*) f=`echo $f | sed -e 's/-L//'` if test -f ${f}/libMagick.la; then libMagick_la_path="${f}/libMagick.la" fi;; esac done fi if test -n "${libMagick_la_path}"; then echo "$as_me:$LINENO: checking Sanity of libMagick.la" >&5 echo $ECHO_N "checking Sanity of libMagick.la... $ECHO_C" >&6 libdir_backup=${libdir} . ${libMagick_la_path} libdir=${libdir_backup} for elt in ${dependency_libs}; do case ${elt} in *.la ) if test ! -f ${elt}; then if test ${libMagick_la_sanity} = yes; then echo "$as_me:$LINENO: result: broken" >&5 echo "${ECHO_T}broken" >&6 libMagick_la_sanity=no fi { echo "$as_me:$LINENO: WARNING: Cannot find $elt refereed in ${libMagick_la_path}" >&5 echo "$as_me: WARNING: Cannot find $elt refereed in ${libMagick_la_path}" >&2;} fi;; esac done if test ${libMagick_la_sanity} = yes; then echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 else { echo "$as_me:$LINENO: WARNING: *** Building will be failed at link time." >&5 echo "$as_me: WARNING: *** Building will be failed at link time." >&2;} { echo "$as_me:$LINENO: WARNING: *** To avoid this failure, don't link libMagick.so: Run ./configure --without-magick" >&5 echo "$as_me: WARNING: *** To avoid this failure, don't link libMagick.so: Run ./configure --without-magick" >&2;} fi fi HAVE_ZLIB=no echo "$as_me:$LINENO: checking for gzsetparams in -lz" >&5 echo $ECHO_N "checking for gzsetparams in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_gzsetparams+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gzsetparams (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { gzsetparams (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_gzsetparams=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_z_gzsetparams=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzsetparams" >&5 echo "${ECHO_T}$ac_cv_lib_z_gzsetparams" >&6 if test $ac_cv_lib_z_gzsetparams = yes; then if test "${ac_cv_header_zlib_h+set}" = set; then echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking zlib.h usability" >&5 echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f 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 zlib.h presence" >&5 echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat 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 in yes:no ) { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_zlib_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 fi if test $ac_cv_header_zlib_h = yes; then HAVE_ZLIB=yes else { echo "$as_me:$LINENO: WARNING: *** ZLIB header files not found: PNG Input will be disabled. ***" >&5 echo "$as_me: WARNING: *** ZLIB header files not found: PNG Input will be disabled. ***" >&2;} fi else { echo "$as_me:$LINENO: WARNING: *** ZLIB library files not found: PNG Input will be disabled. ***" >&5 echo "$as_me: WARNING: *** ZLIB library files not found: PNG Input will be disabled. ***" >&2;} fi HAVE_LIBPNG_STAGE1=no echo "$as_me:$LINENO: checking for png_get_image_width in -lpng" >&5 echo $ECHO_N "checking for png_get_image_width in -lpng... $ECHO_C" >&6 if test "${ac_cv_lib_png_png_get_image_width+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng -lz -lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char png_get_image_width (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { png_get_image_width (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_png_png_get_image_width=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_png_png_get_image_width=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_get_image_width" >&5 echo "${ECHO_T}$ac_cv_lib_png_png_get_image_width" >&6 if test $ac_cv_lib_png_png_get_image_width = yes; then HAVE_LIBPNG_STAGE1=yes fi HAVE_LIBPNG=no if test "x$HAVE_LIBPNG_STAGE1" = "xyes" ; then echo "$as_me:$LINENO: checking for png_read_png in -lpng" >&5 echo $ECHO_N "checking for png_read_png in -lpng... $ECHO_C" >&6 if test "${ac_cv_lib_png_png_read_png+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng -lz -lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char png_read_png (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { png_read_png (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_png_png_read_png=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_png_png_read_png=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_read_png" >&5 echo "${ECHO_T}$ac_cv_lib_png_png_read_png" >&6 if test $ac_cv_lib_png_png_read_png = yes; then HAVE_LIBPNG=yes fi if test "x$HAVE_LIBPNG" = "xyes" ; then LIBPNG_LDFLAGS="-lpng -lz -lm" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBPNG 1 _ACEOF else { echo "$as_me:$LINENO: WARNING: *** libpng exists but cannot find png_read_png in the libpng. ***" >&5 echo "$as_me: WARNING: *** libpng exists but cannot find png_read_png in the libpng. ***" >&2;} { echo "$as_me:$LINENO: WARNING: *** libpng might be old. ***" >&5 echo "$as_me: WARNING: *** libpng might be old. ***" >&2;} { echo "$as_me:$LINENO: WARNING: *** You need libpng 1.0.6 or higher. ***" >&5 echo "$as_me: WARNING: *** You need libpng 1.0.6 or higher. ***" >&2;} { echo "$as_me:$LINENO: WARNING: *** Png input handler is disabled. ***" >&5 echo "$as_me: WARNING: *** Png input handler is disabled. ***" >&2;} fi else { echo "$as_me:$LINENO: WARNING: *** Cannot find libpng. ***" >&5 echo "$as_me: WARNING: *** Cannot find libpng. ***" >&2;} { echo "$as_me:$LINENO: WARNING: *** Png input handler is disabled. ***" >&5 echo "$as_me: WARNING: *** Png input handler is disabled. ***" >&2;} fi if test $HAVE_LIBPNG = yes; then HAVE_LIBPNG_TRUE= HAVE_LIBPNG_FALSE='#' else HAVE_LIBPNG_TRUE='#' HAVE_LIBPNG_FALSE= fi HAVE_LIBSWF=no if test "${ac_cv_header_ming_h+set}" = set; then echo "$as_me:$LINENO: checking for ming.h" >&5 echo $ECHO_N "checking for ming.h... $ECHO_C" >&6 if test "${ac_cv_header_ming_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_ming_h" >&5 echo "${ECHO_T}$ac_cv_header_ming_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking ming.h usability" >&5 echo $ECHO_N "checking ming.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f 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 ming.h presence" >&5 echo $ECHO_N "checking ming.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat 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 in yes:no ) { echo "$as_me:$LINENO: WARNING: ming.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: ming.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: ming.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ming.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: ming.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: ming.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: ming.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: ming.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: ming.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ming.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for ming.h" >&5 echo $ECHO_N "checking for ming.h... $ECHO_C" >&6 if test "${ac_cv_header_ming_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_ming_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_ming_h" >&5 echo "${ECHO_T}$ac_cv_header_ming_h" >&6 fi if test $ac_cv_header_ming_h = yes; then swf_header_found=yes else swf_header_found=no fi if test "${swf_header_found}" = yes ; then echo "$as_me:$LINENO: checking for Ming_init in -lming" >&5 echo $ECHO_N "checking for Ming_init in -lming... $ECHO_C" >&6 if test "${ac_cv_lib_ming_Ming_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lming -lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char Ming_init (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { Ming_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ming_Ming_init=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_ming_Ming_init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ming_Ming_init" >&5 echo "${ECHO_T}$ac_cv_lib_ming_Ming_init" >&6 if test $ac_cv_lib_ming_Ming_init = yes; then HAVE_LIBSWF=yes fi if test "$HAVE_LIBSWF" = "yes" ; then LIBSWF_LDFLAGS="-lming -lm" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBSWF 1 _ACEOF else { echo "$as_me:$LINENO: WARNING: *** Cannot find libming. ***" >&5 echo "$as_me: WARNING: *** Cannot find libming. ***" >&2;} { echo "$as_me:$LINENO: WARNING: *** SWF output is disabled. ***" >&5 echo "$as_me: WARNING: *** SWF output is disabled. ***" >&2;} fi else { echo "$as_me:$LINENO: WARNING: *** Cannot find ming.h. ***" >&5 echo "$as_me: WARNING: *** Cannot find ming.h. ***" >&2;} { echo "$as_me:$LINENO: WARNING: *** SWF output is disabled. ***" >&5 echo "$as_me: WARNING: *** SWF output is disabled. ***" >&2;} fi if test x$HAVE_LIBSWF = xyes; then HAVE_LIBSWF_TRUE= HAVE_LIBSWF_FALSE='#' else HAVE_LIBSWF_TRUE='#' HAVE_LIBSWF_FALSE= fi echo "$as_me:$LINENO: checking whether the host is Darwin" >&5 echo $ECHO_N "checking whether the host is Darwin... $ECHO_C" >&6 case $host_os in darwin*) LDFLAGS="-Xlinker -multiply_defined -Xlinker suppress ${LDFLAGS}" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 { echo "$as_me:$LINENO: WARNING: linker messages that warns symbols are multiply defined are suppressed" >&5 echo "$as_me: WARNING: linker messages that warns symbols are multiply defined are suppressed" >&2;} ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac HAVE_LIBPSTOEDIT=no HAVE_LIBPSTOEDIT_320=no HAVE_LIBPSTOEDIT_321=no LIBPSTOEDIT_CFLAGS= LIBPSTOEDIT_LIBS= LIBPSTOEDIT_EXTRA_LIBS= # Check whether --with-pstoedit or --without-pstoedit was given. if test "${with_pstoedit+set}" = set; then withval="$with_pstoedit" else with_pstoedit=yes fi; if test "x${with_pstoedit}" = xyes; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC 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_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC 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_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&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_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h 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 depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CXX_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE="depmode=$am_cv_CXX_dependencies_compiler_type" CXX_RUNTIME_LIB= CXX_STD_LIB= if test x"$GXX" = xyes; then echo "$as_me:$LINENO: checking for main in -lg++" >&5 echo $ECHO_N "checking for main in -lg++... $ECHO_C" >&6 if test "${ac_cv_lib_gpp_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lg++ $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpp_main=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_gpp_main=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_gpp_main" >&5 echo "${ECHO_T}$ac_cv_lib_gpp_main" >&6 if test $ac_cv_lib_gpp_main = yes; then CXX_RUNTIME_LIB=-lg++ fi echo "$as_me:$LINENO: checking for main in -lstdc++" >&5 echo $ECHO_N "checking for main in -lstdc++... $ECHO_C" >&6 if test "${ac_cv_lib_stdcpp_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lstdc++ ${CXX_RUNTIME_LIB} $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_stdcpp_main=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_stdcpp_main=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_stdcpp_main" >&5 echo "${ECHO_T}$ac_cv_lib_stdcpp_main" >&6 if test $ac_cv_lib_stdcpp_main = yes; then CXX_STD_LIB=-lstdc++ fi fi echo "$as_me:$LINENO: checking for C++ runtime" >&5 echo $ECHO_N "checking for C++ runtime... $ECHO_C" >&6 LIBPSTOEDIT_EXTRA_LIBS="${CXX_STD_LIB} ${CXX_RUNTIME_LIB}" echo "$as_me:$LINENO: result: ${CXX_STD_LIB} ${CXX_RUNTIME_LIB}" >&5 echo "${ECHO_T}${CXX_STD_LIB} ${CXX_RUNTIME_LIB}" >&6 LIBLD_LDFLAGS= echo "$as_me:$LINENO: checking for main in -ldl" >&5 echo $ECHO_N "checking for main in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_main+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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_main=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dl_main=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_main" >&5 echo "${ECHO_T}$ac_cv_lib_dl_main" >&6 if test $ac_cv_lib_dl_main = yes; then LIBLD_LDFLAGS=-ldl fi if test "x${LIBLD_LDFLAGS}" != x; then LIBPSTOEDIT_EXTRA_LIBS="${LIBPSTOEDIT_EXTRA_LIBS} ${LIBLD_LDFLAGS}" fi echo '*** Checking pstoedit existence TWICE(if needed) ***' echo '*** This is the 1st check ***' # Check whether --with-pstoedit-prefix or --without-pstoedit-prefix was given. if test "${with_pstoedit_prefix+set}" = set; then withval="$with_pstoedit_prefix" pstoedit_prefix="$withval" else pstoedit_prefix="" fi; # Check whether --with-pstoedit-exec-prefix or --without-pstoedit-exec-prefix was given. if test "${with_pstoedit_exec_prefix+set}" = set; then withval="$with_pstoedit_exec_prefix" pstoedit_exec_prefix="$withval" else pstoedit_exec_prefix="" fi; # Check whether --enable-pstoedittest or --disable-pstoedittest was given. if test "${enable_pstoedittest+set}" = set; then enableval="$enable_pstoedittest" else enable_pstoedittest=yes fi; if test x$pstoedit_exec_prefix != x ; then pstoedit_args="$pstoedit_args --exec_prefix=$pstoedit_exec_prefix" if test x${PSTOEDIT_CONFIG+set} != xset ; then PSTOEDIT_CONFIG=$pstoedit_exec_prefix/bin/pstoedit-config fi fi if test x$pstoedit_prefix != x ; then pstoedit_args="$pstoedit_args --prefix=$pstoedit_prefix" if test x${PSTOEDIT_CONFIG+set} != xset ; then PSTOEDIT_CONFIG=$pstoedit_prefix/bin/pstoedit-config fi fi # Extract the first word of "pstoedit-config", so it can be a program name with args. set dummy pstoedit-config; 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_path_PSTOEDIT_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PSTOEDIT_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PSTOEDIT_CONFIG="$PSTOEDIT_CONFIG" # Let the user override the test with a path. ;; *) 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PSTOEDIT_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_PSTOEDIT_CONFIG" && ac_cv_path_PSTOEDIT_CONFIG="no" ;; esac fi PSTOEDIT_CONFIG=$ac_cv_path_PSTOEDIT_CONFIG if test -n "$PSTOEDIT_CONFIG"; then echo "$as_me:$LINENO: result: $PSTOEDIT_CONFIG" >&5 echo "${ECHO_T}$PSTOEDIT_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi min_pstoedit_version=3.32.1 echo "$as_me:$LINENO: checking for PSTOEDIT - version >= $min_pstoedit_version" >&5 echo $ECHO_N "checking for PSTOEDIT - version >= $min_pstoedit_version... $ECHO_C" >&6 no_pstoedit="" if test "$PSTOEDIT_CONFIG" = "no" ; then no_pstoedit=yes else PSTOEDIT_CFLAGS=`$PSTOEDIT_CONFIG $pstoedit_args --cflags` PSTOEDIT_LIBS=`$PSTOEDIT_CONFIG $pstoedit_args --libs` pstoedit_major_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` pstoedit_minor_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` pstoedit_micro_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_pstoedittest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PSTOEDIT_CFLAGS" LIBS="$PSTOEDIT_LIBS $LIBS" rm -f conf.pstoedittest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main () { int major, minor, micro; char *tmp_version; system ("touch conf.pstoedittest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_pstoedit_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_pstoedit_version"); exit(1); } if (($pstoedit_major_version > major) || (($pstoedit_major_version == major) && ($pstoedit_minor_version > minor)) || (($pstoedit_major_version == major) && ($pstoedit_minor_version == minor) && ($pstoedit_micro_version >= micro))) { return 0; } else { printf("\n*** 'pstoedit-config --version' returned %d.%d.%d, but the minimum version\n", $pstoedit_major_version, $pstoedit_minor_version, $pstoedit_micro_version); printf("*** of PSTOEDIT required is %d.%d.%d. If pstoedit-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If pstoedit-config was wrong, set the environment variable PSTOEDIT_CONFIG\n"); printf("*** to point to the correct copy of pstoedit-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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 cat conftest.$ac_ext >&5 ( exit $ac_status ) no_pstoedit=yes fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_pstoedit" = x ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 HAVE_LIBPSTOEDIT_321=yes else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 if test "$PSTOEDIT_CONFIG" = "no" ; then echo "*** The pstoedit-config script installed by PSTOEDIT could not be found" echo "*** If PSTOEDIT was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the PSTOEDIT_CONFIG environment variable to the" echo "*** full path to pstoedit-config." else if test -f conf.pstoedittest ; then : else echo "*** Could not run PSTOEDIT test program, checking why..." CFLAGS="$CFLAGS $PSTOEDIT_CFLAGS" LIBS="$LIBS $PSTOEDIT_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding PSTOEDIT or finding the wrong" echo "*** version of PSTOEDIT. If it is not finding PSTOEDIT, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means PSTOEDIT was incorrectly installed" echo "*** or that you have moved PSTOEDIT since it was installed. In the latter case, you" echo "*** may want to edit the pstoedit-config script: $PSTOEDIT_CONFIG" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi PSTOEDIT_CFLAGS="" PSTOEDIT_LIBS="" : fi rm -f conf.pstoedittest if test ${HAVE_LIBPSTOEDIT_321} != yes; then echo '*** The 1st check is failed. ***' LIBS_BAKCUP=$LIBS LIBS="$LIBS ${LIBPSTOEDIT_EXTRA_LIBS}" echo '*** This is the 2nd check ***' # Check whether --with-pstoedit-prefix or --without-pstoedit-prefix was given. if test "${with_pstoedit_prefix+set}" = set; then withval="$with_pstoedit_prefix" pstoedit_prefix="$withval" else pstoedit_prefix="" fi; # Check whether --with-pstoedit-exec-prefix or --without-pstoedit-exec-prefix was given. if test "${with_pstoedit_exec_prefix+set}" = set; then withval="$with_pstoedit_exec_prefix" pstoedit_exec_prefix="$withval" else pstoedit_exec_prefix="" fi; # Check whether --enable-pstoedittest or --disable-pstoedittest was given. if test "${enable_pstoedittest+set}" = set; then enableval="$enable_pstoedittest" else enable_pstoedittest=yes fi; if test x$pstoedit_exec_prefix != x ; then pstoedit_args="$pstoedit_args --exec_prefix=$pstoedit_exec_prefix" if test x${PSTOEDIT_CONFIG+set} != xset ; then PSTOEDIT_CONFIG=$pstoedit_exec_prefix/bin/pstoedit-config fi fi if test x$pstoedit_prefix != x ; then pstoedit_args="$pstoedit_args --prefix=$pstoedit_prefix" if test x${PSTOEDIT_CONFIG+set} != xset ; then PSTOEDIT_CONFIG=$pstoedit_prefix/bin/pstoedit-config fi fi # Extract the first word of "pstoedit-config", so it can be a program name with args. set dummy pstoedit-config; 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_path_PSTOEDIT_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PSTOEDIT_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PSTOEDIT_CONFIG="$PSTOEDIT_CONFIG" # Let the user override the test with a path. ;; *) 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PSTOEDIT_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_PSTOEDIT_CONFIG" && ac_cv_path_PSTOEDIT_CONFIG="no" ;; esac fi PSTOEDIT_CONFIG=$ac_cv_path_PSTOEDIT_CONFIG if test -n "$PSTOEDIT_CONFIG"; then echo "$as_me:$LINENO: result: $PSTOEDIT_CONFIG" >&5 echo "${ECHO_T}$PSTOEDIT_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi min_pstoedit_version=3.32.0 echo "$as_me:$LINENO: checking for PSTOEDIT - version >= $min_pstoedit_version" >&5 echo $ECHO_N "checking for PSTOEDIT - version >= $min_pstoedit_version... $ECHO_C" >&6 no_pstoedit="" if test "$PSTOEDIT_CONFIG" = "no" ; then no_pstoedit=yes else PSTOEDIT_CFLAGS=`$PSTOEDIT_CONFIG $pstoedit_args --cflags` PSTOEDIT_LIBS=`$PSTOEDIT_CONFIG $pstoedit_args --libs` pstoedit_major_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` pstoedit_minor_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` pstoedit_micro_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_pstoedittest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PSTOEDIT_CFLAGS" LIBS="$PSTOEDIT_LIBS $LIBS" rm -f conf.pstoedittest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main () { int major, minor, micro; char *tmp_version; system ("touch conf.pstoedittest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_pstoedit_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_pstoedit_version"); exit(1); } if (($pstoedit_major_version > major) || (($pstoedit_major_version == major) && ($pstoedit_minor_version > minor)) || (($pstoedit_major_version == major) && ($pstoedit_minor_version == minor) && ($pstoedit_micro_version >= micro))) { return 0; } else { printf("\n*** 'pstoedit-config --version' returned %d.%d.%d, but the minimum version\n", $pstoedit_major_version, $pstoedit_minor_version, $pstoedit_micro_version); printf("*** of PSTOEDIT required is %d.%d.%d. If pstoedit-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If pstoedit-config was wrong, set the environment variable PSTOEDIT_CONFIG\n"); printf("*** to point to the correct copy of pstoedit-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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 cat conftest.$ac_ext >&5 ( exit $ac_status ) no_pstoedit=yes fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_pstoedit" = x ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 HAVE_LIBPSTOEDIT_320=yes else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 if test "$PSTOEDIT_CONFIG" = "no" ; then echo "*** The pstoedit-config script installed by PSTOEDIT could not be found" echo "*** If PSTOEDIT was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the PSTOEDIT_CONFIG environment variable to the" echo "*** full path to pstoedit-config." else if test -f conf.pstoedittest ; then : else echo "*** Could not run PSTOEDIT test program, checking why..." CFLAGS="$CFLAGS $PSTOEDIT_CFLAGS" LIBS="$LIBS $PSTOEDIT_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding PSTOEDIT or finding the wrong" echo "*** version of PSTOEDIT. If it is not finding PSTOEDIT, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means PSTOEDIT was incorrectly installed" echo "*** or that you have moved PSTOEDIT since it was installed. In the latter case, you" echo "*** may want to edit the pstoedit-config script: $PSTOEDIT_CONFIG" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi PSTOEDIT_CFLAGS="" PSTOEDIT_LIBS="" : fi rm -f conf.pstoedittest LIBS=${LIBS_BAKCUP} if test ${HAVE_LIBPSTOEDIT_320} = yes; then echo '*** The 2nd check is passed. ***' HAVE_LIBPSTOEDIT=yes cat >>confdefs.h <<\_ACEOF #define HAVE_LIBPSTOEDIT 1 _ACEOF LIBPSTOEDIT_LIBS="${PSTOEDIT_LIBS} ${LIBPSTOEDIT_EXTRA_LIBS}" LIBPSTOEDIT_CFLAGS="${PSTOEDIT_CFLAGS}" else echo '*** The 2nd check is failed. ***' fi else echo '*** The 1st check is passed. ***' HAVE_LIBPSTOEDIT=yes cat >>confdefs.h <<\_ACEOF #define HAVE_LIBPSTOEDIT 1 _ACEOF LIBPSTOEDIT_LIBS="${PSTOEDIT_LIBS} ${LIBPSTOEDIT_EXTRA_LIBS}" LIBPSTOEDIT_CFLAGS="${PSTOEDIT_CFLAGS}" fi if test ${HAVE_LIBPSTOEDIT} = yes; then for ac_func in mkstemp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo '*** pstoedit output functions are enabled. ***' echo '*** However, these are experimental functions in autotrace. ***' echo '*** If you get an error in building time about pstoedit, ***' echo '*** you can run configure with --without-pstoedit option again. ***' else { echo "$as_me:$LINENO: WARNING: *** Cannot find libpstoedit. *** *** Output functions using libpstoedit are disabled ***" >&5 echo "$as_me: WARNING: *** Cannot find libpstoedit. *** *** Output functions using libpstoedit are disabled ***" >&2;} fi else { echo "$as_me:$LINENO: WARNING: pstoedit output functions are disabled from command line." >&5 echo "$as_me: WARNING: pstoedit output functions are disabled from command line." >&2;} fi if test x$HAVE_LIBPSTOEDIT = xyes; then HAVE_LIBPSTOEDIT_TRUE= HAVE_LIBPSTOEDIT_FALSE='#' else HAVE_LIBPSTOEDIT_TRUE='#' HAVE_LIBPSTOEDIT_FALSE= fi ac_config_files="$ac_config_files Makefile autotrace-config autotrace.pc autotrace.spec" ac_config_commands="$ac_config_commands default" 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 overriden 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, don't put newlines in cache variables' values. # 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. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *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 \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" 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}' # 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 DEFS=-DHAVE_CONFIG_H : ${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 SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $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'` # PATH needs CR, and LINENO needs CR and PATH. # 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" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') 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=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # 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 before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, 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 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi 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$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.53. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi 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, then exit -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 Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." 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[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 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 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 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" ;; esac shift done _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "autotrace-config" ) CONFIG_FILES="$CONFIG_FILES autotrace-config" ;; "autotrace.pc" ) CONFIG_FILES="$CONFIG_FILES autotrace.pc" ;; "autotrace.spec" ) CONFIG_FILES="$CONFIG_FILES autotrace.spec" ;; "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { 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 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # 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 # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@AUTOTRACE_VERSION@,$AUTOTRACE_VERSION,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@DEPDIR@,$DEPDIR,;t t s,@LT_CURRENT@,$LT_CURRENT,;t t s,@LT_REVISION@,$LT_REVISION,;t t s,@LT_AGE@,$LT_AGE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@CPP@,$CPP,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@MAGICK_CONFIG@,$MAGICK_CONFIG,;t t s,@MAGICK_CFLAGS@,$MAGICK_CFLAGS,;t t s,@MAGICK_LDFLAGS@,$MAGICK_LDFLAGS,;t t s,@HAVE_MAGICK_TRUE@,$HAVE_MAGICK_TRUE,;t t s,@HAVE_MAGICK_FALSE@,$HAVE_MAGICK_FALSE,;t t s,@LIBPNG_LDFLAGS@,$LIBPNG_LDFLAGS,;t t s,@HAVE_LIBPNG_TRUE@,$HAVE_LIBPNG_TRUE,;t t s,@HAVE_LIBPNG_FALSE@,$HAVE_LIBPNG_FALSE,;t t s,@LIBSWF_LDFLAGS@,$LIBSWF_LDFLAGS,;t t s,@HAVE_LIBSWF_TRUE@,$HAVE_LIBSWF_TRUE,;t t s,@HAVE_LIBSWF_FALSE@,$HAVE_LIBSWF_FALSE,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@PSTOEDIT_CONFIG@,$PSTOEDIT_CONFIG,;t t s,@PSTOEDIT_CFLAGS@,$PSTOEDIT_CFLAGS,;t t s,@PSTOEDIT_LIBS@,$PSTOEDIT_LIBS,;t t s,@LIBPSTOEDIT_CFLAGS@,$LIBPSTOEDIT_CFLAGS,;t t s,@LIBPSTOEDIT_LIBS@,$LIBPSTOEDIT_LIBS,;t t s,@HAVE_LIBPSTOEDIT_TRUE@,$HAVE_LIBPSTOEDIT_TRUE,;t t s,@HAVE_LIBPSTOEDIT_FALSE@,$HAVE_LIBPSTOEDIT_FALSE,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $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'` { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; } ;; esac done; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF 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,@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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #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. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # egrep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # 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. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $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'` { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; } ;; esac done; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Run the commands associated with the file. case $ac_file in config.h ) # update the timestamp echo timestamp >"./stamp-h1" ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in default-1 ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do case "$mf" in Makefile) dirpart=.;; */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; *) continue;; esac grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`echo "$file" | sed -e 's|/[^/]*$||'` $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; default ) chmod a+x autotrace-config ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (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=: exec 5>/dev/null $SHELL $CONFIG_STATUS || 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 " Configuration: imagemagick output support: $HAVE_MAGICK libpng output support: $HAVE_LIBPNG swf output support by ming: $HAVE_LIBSWF pstoedit output support: $HAVE_LIBPSTOEDIT " autotrace-0.31.1/configure.in0000664000076400007640000002571607562774443011624 # configure.in for frontline # # Author: Masatake YAMATO (jet@gyve.org) # AC_INIT(fit.c) # # version setting up for Automake # AUTOTRACE_MAJOR_VERSION=0 AUTOTRACE_MINOR_VERSION=31 AUTOTRACE_MICRO_VERSION=1 AUTOTRACE_VERSION=${AUTOTRACE_MAJOR_VERSION}.${AUTOTRACE_MINOR_VERSION}.${AUTOTRACE_MICRO_VERSION} AC_DEFINE_UNQUOTED(AUTOTRACE_VERSION,"$AUTOTRACE_VERSION") AC_SUBST(AUTOTRACE_VERSION) AM_INIT_AUTOMAKE(autotrace, $AUTOTRACE_VERSION, no-define) # # version setting up for libtool # LT_CURRENT=3 LT_REVISION=0 LT_AGE=0 dnl AC_SUBST(LT_RELEASE) AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) dnl AC_SUBST(LT_CURRENT_MINUS_AGE) AC_PROG_CC AC_PROG_LIBTOOL AUTOTRACE_WEB=http://autotrace.sourceforge.net AC_DEFINE_UNQUOTED(AUTOTRACE_WEB, "$AUTOTRACE_WEB") AM_MAINTAINER_MODE AM_CONFIG_HEADER(config.h) AC_PROG_CPP AC_PROG_RANLIB dnl AC_CANONICAL_HOST dnl AC_ARG_PROGRAM AM_SANITY_CHECK AC_PROG_INSTALL AC_CHECK_HEADERS(malloc.h) dnl dnl ImageMagick dnl HAVE_MAGICK=no AC_ARG_WITH(magick, [ --with-magick compile with maigck(default) --without-magick compile without maigck],,with_magick=yes) if test $with_magick = yes ; then AC_CHECK_PROG(MAGICK_CONFIG, Magick-config, Magick-config, "") if test "x$MAGICK_CONFIG" = "xMagick-config" ; then CPPFLAGS_BACKUP="$CPPFLAGS" CPPFLAGS=`Magick-config --cppflags` AC_CHECK_HEADER(magick/api.h, magick_header_found=yes, magick_header_found=no) MAGICK_CFLAGS=${CPPFLAGS} CPPFLAGS=${CPPFLAGS_BACKUP} if test "x${magick_header_found}" = xyes ; then MAGICK_LDFLAGS="`Magick-config --ldflags` `Magick-config --libs`" dnl dnl Checking version dnl AC_MSG_CHECKING([ImageMagick - version >= 5.2.1]) dnl Get version and split it into MAJOR, MINOR and MICRO MAGICK_VERSION=`Magick-config --version` changequote(,)dnl MAGICK_MAJOR_VERSION=`echo $MAGICK_VERSION \ | sed -e 's/^\([0-9]*\).[0-9]*.[0-9]*$/\1/'` MAGICK_MINOR_VERSION=`echo $MAGICK_VERSION \ | sed -e 's/^[0-9]*.\([0-9]*\).[0-9]*$/\1/'` MAGICK_MICRO_VERSION=`echo $MAGICK_VERSION \ | sed -e 's/^[0-9]*.[0-9]*.\([0-9]*\)$/\1/'` changequote([,])dnl MAGICK_MAJOR_VERSION_CHECK=`expr $MAGICK_MAJOR_VERSION \>= 5` MAGICK_MINOR_VERSION_CHECK=`expr $MAGICK_MINOR_VERSION \>= 2` dnl I don't consider ImageMagick 6.x. if test "$MAGICK_VERSION" = "5.2.0" \ || test "$MAGICK_MAJOR_VERSION_CHECK" = 0 \ || test "$MAGICK_MINOR_VERSION_CHECK" = 0 ; then AC_MSG_RESULT(no($MAGICK_VERSION)) AC_MSG_WARN([*** Version 5.2.1 or higher is required. ***]) AC_MSG_WARN([*** ImageMagick input handler is disabled. ***]) else AC_MSG_RESULT(yes($MAGICK_VERSION)) AC_SUBST(MAGICK_CFLAGS) AC_SUBST(MAGICK_LDFLAGS) HAVE_MAGICK=yes AC_DEFINE(HAVE_MAGICK) fi else AC_MSG_WARN([*** Magick-config is found but magick/api.h is not found in $MAGICK_CFLAGS ***]) AC_MSG_WARN([*** Check Magick-config. ***]) AC_MSG_WARN([*** ImageMagick input handler is disabled. ***]) fi else AC_MSG_WARN([*** Magick-config is not found. ***]) AC_MSG_WARN([*** ImageMagick input handler is disabled. ***]) fi fi AM_CONDITIONAL(HAVE_MAGICK, test $HAVE_MAGICK = yes) dnl dnl libMagick.la sanity check dnl dnl It seems that libMagick.la in RedHat 7.2 is broken. dnl libMagick.la refers /usr/lib/libxml2.la. However, dnl /usr/lib/libxml2.la is not existed. Therefore linking dnl against libMagick.la is failed. dnl libMagick_la_path= libMagick_la_sanity=yes dnl Stage one: finding libMagick.la if test $HAVE_MAGICK = yes && test $enable_shared = yes; then for f in $MAGICK_LDFLAGS; do case ${f} in -L*) f=`echo $f | sed -e 's/-L//'` if test -f ${f}/libMagick.la; then libMagick_la_path="${f}/libMagick.la" fi;; esac done fi dnl Stage two: Check internal of libMagick.la if test -n "${libMagick_la_path}"; then AC_MSG_CHECKING([Sanity of libMagick.la]) dnl libdir is defined in libMagick.al. dnl Don't use the value. libdir_backup=${libdir} . ${libMagick_la_path} libdir=${libdir_backup} for elt in ${dependency_libs}; do case ${elt} in *.la ) if test ! -f ${elt}; then if test ${libMagick_la_sanity} = yes; then AC_MSG_RESULT([broken]) libMagick_la_sanity=no fi AC_MSG_WARN([Cannot find $elt refereed in ${libMagick_la_path}]) fi;; esac done if test ${libMagick_la_sanity} = yes; then AC_MSG_RESULT([ok]) else AC_MSG_WARN([*** Building will be failed at link time.]) AC_MSG_WARN([*** To avoid this failure, don't link libMagick.so: Run ./configure --without-magick]) fi fi dnl dnl LIBPNG dnl dnl Test for zlib (from gimp-1.1.29) HAVE_ZLIB=no AC_CHECK_LIB(z, gzsetparams, [AC_CHECK_HEADER(zlib.h, HAVE_ZLIB=yes, AC_MSG_WARN(*** ZLIB header files not found: PNG Input will be disabled. ***))], AC_MSG_WARN(*** ZLIB library files not found: PNG Input will be disabled. ***)) dnl Test for libpng HAVE_LIBPNG_STAGE1=no AC_CHECK_LIB(png, png_get_image_width, HAVE_LIBPNG_STAGE1=yes ,,-lz -lm) HAVE_LIBPNG=no if test "x$HAVE_LIBPNG_STAGE1" = "xyes" ; then AC_CHECK_LIB(png, png_read_png, HAVE_LIBPNG=yes ,,-lz -lm) if test "x$HAVE_LIBPNG" = "xyes" ; then LIBPNG_LDFLAGS="-lpng -lz -lm" AC_SUBST(LIBPNG_LDFLAGS) AC_DEFINE(HAVE_LIBPNG) else AC_MSG_WARN([*** libpng exists but cannot find png_read_png in the libpng. ***]) AC_MSG_WARN([*** libpng might be old. ***]) AC_MSG_WARN([*** You need libpng 1.0.6 or higher. ***]) AC_MSG_WARN([*** Png input handler is disabled. ***]) fi else AC_MSG_WARN([*** Cannot find libpng. ***]) AC_MSG_WARN([*** Png input handler is disabled. ***]) fi AM_CONDITIONAL(HAVE_LIBPNG, test $HAVE_LIBPNG = yes) dnl dnl LIBMING(LIBSWF) dnl HAVE_LIBSWF=no AC_CHECK_HEADER(ming.h, swf_header_found=yes, swf_header_found=no) if test "${swf_header_found}" = yes ; then AC_CHECK_LIB(ming, Ming_init, HAVE_LIBSWF=yes,,-lm) if test "$HAVE_LIBSWF" = "yes" ; then LIBSWF_LDFLAGS="-lming -lm" AC_SUBST(LIBSWF_LDFLAGS) AC_DEFINE(HAVE_LIBSWF) else AC_MSG_WARN([*** Cannot find libming. ***]) AC_MSG_WARN([*** SWF output is disabled. ***]) fi else AC_MSG_WARN([*** Cannot find ming.h. ***]) AC_MSG_WARN([*** SWF output is disabled. ***]) fi AM_CONDITIONAL(HAVE_LIBSWF, test x$HAVE_LIBSWF = xyes) dnl dnl Suppressing linker warning dnl dnl On MacOS X(Darwin), getopt related symbols are defined dnl in /usr/lib/libm.dylib. They are conflicted with symbols dnl defined in getopt* of autotrace. To avoid warning-messages dnl about this confliction, "-multiply_defined suppress" is dnl passed to ld if autotrace is built on Darwin. dnl dnl BTW, Is getopt mathematical function? dnl dnl libm.dylib on Darwin problem is reported by dnl Martin Kerscher dnl AC_MSG_CHECKING([whether the host is Darwin]) case $host_os in darwin*) LDFLAGS="-Xlinker -multiply_defined -Xlinker suppress ${LDFLAGS}" AC_MSG_RESULT([yes]) AC_MSG_WARN([linker messages that warns symbols are multiply defined are suppressed]) ;; *) AC_MSG_RESULT([no]) ;; esac dnl dnl pstoedit library dnl HAVE_LIBPSTOEDIT=no HAVE_LIBPSTOEDIT_320=no HAVE_LIBPSTOEDIT_321=no LIBPSTOEDIT_CFLAGS= LIBPSTOEDIT_LIBS= LIBPSTOEDIT_EXTRA_LIBS= AC_ARG_WITH(pstoedit, [ --with-pstoedit link with pstoedit library(default) --without-pstoedit link without pstoedit library],,with_pstoedit=yes) if test "x${with_pstoedit}" = xyes; then dnl dnl dnl AC_PROG_CXX dnl Standard C++ library and C++ Runtime dnl --- WORKAROUND for pstoedit 3.32.0 CXX_RUNTIME_LIB= CXX_STD_LIB= if test x"$GXX" = xyes; then AC_CHECK_LIB(g++,main,CXX_RUNTIME_LIB=-lg++) AC_CHECK_LIB(stdc++,main,CXX_STD_LIB=-lstdc++,,${CXX_RUNTIME_LIB}) fi AC_MSG_CHECKING([for C++ runtime]) LIBPSTOEDIT_EXTRA_LIBS="${CXX_STD_LIB} ${CXX_RUNTIME_LIB}" AC_MSG_RESULT([${CXX_STD_LIB} ${CXX_RUNTIME_LIB}]) dnl dl library dnl --- WORKAROUND for pstoedit 3.32.0 LIBLD_LDFLAGS= AC_CHECK_LIB(dl,main,[LIBLD_LDFLAGS=-ldl]) if test "x${LIBLD_LDFLAGS}" != x; then LIBPSTOEDIT_EXTRA_LIBS="${LIBPSTOEDIT_EXTRA_LIBS} ${LIBLD_LDFLAGS}" fi echo '*** Checking pstoedit existence TWICE(if needed) ***' echo '*** This is the 1st check ***' AM_PATH_PSTOEDIT(3.32.1,HAVE_LIBPSTOEDIT_321=yes) if test ${HAVE_LIBPSTOEDIT_321} != yes; then echo '*** The 1st check is failed. ***' LIBS_BAKCUP=$LIBS LIBS="$LIBS ${LIBPSTOEDIT_EXTRA_LIBS}" echo '*** This is the 2nd check ***' AM_PATH_PSTOEDIT(3.32.0,HAVE_LIBPSTOEDIT_320=yes) LIBS=${LIBS_BAKCUP} if test ${HAVE_LIBPSTOEDIT_320} = yes; then echo '*** The 2nd check is passed. ***' HAVE_LIBPSTOEDIT=yes AC_DEFINE(HAVE_LIBPSTOEDIT) LIBPSTOEDIT_LIBS="${PSTOEDIT_LIBS} ${LIBPSTOEDIT_EXTRA_LIBS}" LIBPSTOEDIT_CFLAGS="${PSTOEDIT_CFLAGS}" else echo '*** The 2nd check is failed. ***' fi else echo '*** The 1st check is passed. ***' HAVE_LIBPSTOEDIT=yes AC_DEFINE(HAVE_LIBPSTOEDIT) LIBPSTOEDIT_LIBS="${PSTOEDIT_LIBS} ${LIBPSTOEDIT_EXTRA_LIBS}" LIBPSTOEDIT_CFLAGS="${PSTOEDIT_CFLAGS}" fi if test ${HAVE_LIBPSTOEDIT} = yes; then AC_CHECK_FUNCS([mkstemp]) echo '*** pstoedit output functions are enabled. ***' echo '*** However, these are experimental functions in autotrace. ***' echo '*** If you get an error in building time about pstoedit, ***' echo '*** you can run configure with --without-pstoedit option again. ***' else AC_MSG_WARN([ *** Cannot find libpstoedit. *** *** Output functions using libpstoedit are disabled ***]) fi dnl dnl dnl else AC_MSG_WARN([pstoedit output functions are disabled from command line.]) fi AC_SUBST(LIBPSTOEDIT_CFLAGS) AC_SUBST(LIBPSTOEDIT_LIBS) AM_CONDITIONAL(HAVE_LIBPSTOEDIT, test x$HAVE_LIBPSTOEDIT = xyes) dnl dnl Vender's cc(not gcc) dnl dnl if test "x$CC" = xcc ; then dnl case host in dnl mips-sgi-irix*) dnl # Peter Cucka wrote: dnl # > Should I use -Ofast instead of -O2? dnl # -Ofast selects optimizations that maximize speed, at the expense of dnl # size, compile time, and, in some cases, floating point accuracy. dnl # Compiled with -Ofast, AutoTrace runs about twice as fast as with -O2, dnl # or even -O3, on the two machines (admittedly not a very extensive dnl # sample) on which I've tested it. I'd recommend using -Ofast, but dnl # it's not necessary. dnl CFLAGS=-Ofast dnl ;; dnl *) dnl ;; dnl esac dnl fi AC_OUTPUT([Makefile autotrace-config autotrace.pc autotrace.spec], [chmod a+x autotrace-config]) echo " Configuration: imagemagick output support: $HAVE_MAGICK libpng output support: $HAVE_LIBPNG swf output support by ming: $HAVE_LIBSWF pstoedit output support: $HAVE_LIBPSTOEDIT " autotrace-0.31.1/install-sh0000755000076400007640000001270107521233631011263 #!/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 : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog 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" ] || [ -d "$src" ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else : 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 : 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 : fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; 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 : 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 :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 autotrace-0.31.1/ltmain.sh0000644000076400007640000042412007530313701011076 # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # 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. # # 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. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. while test $# -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 ;; --config) sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; --debug) echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then case $nonopt in *cc | *++ | gcc* | *-gcc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= prev= lastarg= srcfile="$nonopt" suppress_output= user_target=no for arg do case $prev in "") ;; xcompiler) # Aesthetically quote the previous argument. prev= lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac # Accept any command-line options. case $arg in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi user_target=next ;; -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; -Xcompiler) prev=xcompiler continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac case $user_target in next) # The next one is the -o target name user_target=yes continue ;; yes) # We got the output file user_target=set libobj="$arg" continue ;; esac # Accept the current argument as the source file. lastarg="$srcfile" srcfile="$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $lastarg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi done case $user_target in set) ;; no) # Get the name of the library object. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $libobj" else removelist="$libobj" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" else # Don't build PIC code command="$base_compile $srcfile" fi if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$libobj"; then dir="$objdir" else dir="$dir/$objdir" fi libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` if test -d "$dir"; then $show "$rm $libobj" $run $rm $libobj else $show "$mkdir $dir" $run $mkdir $dir status=$? if test $status -ne 0 && test ! -d $dir; then exit $status fi fi fi if test "$compiler_o_lo" = yes; then output_obj="$libobj" command="$command -o $output_obj" elif test "$compiler_c_o" = yes; then output_obj="$obj" command="$command -o $output_obj" fi $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist exit $error fi fi # If we have no pic_flag, then copy the object into place and finish. if (test -z "$pic_flag" || test "$pic_mode" != default) && test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj $run $rm $obj fi $show "$mv $libobj $obj" if $run $mv $libobj $obj; then : else error=$? $run $rm $removelist exit $error fi xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` # Now arrange that obj and lo_libobj become the same file $show "(cd $xdir && $LN_S $baseobj $libobj)" if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 else error=$? $run $rm $removelist exit $error fi fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $srcfile" else # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? else # Move the .lo from within objdir $show "$mv $libobj $lo_libobj" if $run $mv $libobj $lo_libobj; then : else error=$? $run $rm $removelist exit $error fi fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 ;; # libtool link mode link | relink) modename="$modename: link" case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args="$nonopt" compile_command="$nonopt" finalize_command="$nonopt" compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= # We need to know -static, to get the right output filenames. for arg do case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n $prev prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.lo | *.$objext) # A library or standard object. if test "$prev" = dlfiles; then # This file was specified with -dlopen. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $arg" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= else case $arg in *.lo) libobjs="$libobjs $arg" ;; *) objs="$objs $arg" ;; esac fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode" = prog; then # Determine which files to process case $pass in dlopen) libs="$dlfiles" save_deplibs="$deplibs" # Collect dlpreopened libraries deplibs= ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi for deplib in $libs; do lib= found=no case $deplib in -l*) if test "$linkmode" = oldlib && test "$linkmode" = obj; then $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue fi if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do # Search the libtool library lib="$searchdir/lib${name}.la" if test -f "$lib"; then found=yes break fi done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then echo echo "*** Warning: This library needs some functionality provided by $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." else echo echo "*** Warning: Linking the shared library $output against the" echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. dlprefiles="$dlprefiles $lib" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # Link against this shared library if test "$linkmode,$pass" = "prog,link" || { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac if test "$linkmode" = prog; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi fi fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`echo $soroot | sed -e 's/^.*\///'` newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$extract_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$old_archive_from_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then # Try looking first in the location we're being installed to. add_dir= if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="-L$inst_prefix_dir$libdir" ;; esac fi add_dir="$add_dir -L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. # Try looking first in the location we're being installed to. add_dir= if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="-L$inst_prefix_dir$libdir" ;; esac fi add_dir="$add_dir -L$libdir" add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi # Try to link the static library # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo echo "*** Warning: This library needs some functionality provided by $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** Therefore, libtool will create a static module, that should work " echo "*** as long as the dlopening application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="-L$absdir" fi ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then test "$pass" != scan && dependency_libs="$newdependency_libs" if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do case $deplib in -L*) new_libs="$deplib $new_libs" ;; *) case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi if test "$pass" = "conv" && { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then libs="$deplibs" # reset libs deplibs= fi done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else echo echo "*** Warning: Linking the shared library $output against the non-libtool" echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi current="$2" revision="$3" age="$4" # Check that each of the things are valid numbers. case $current in [0-9]*) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $revision in [0-9]*) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $age in [0-9]*) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix) major=`expr $current - $age + 1` verstring="sgi$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="sgi$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring="" ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd*) # Do not include libc due to us having libc/libc_r. ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | sed 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do if eval echo \"$potent_lib\" 2>/dev/null \ | sed 10q \ | egrep "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" echo "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi test -z "$dlname" && dlname=$soname lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` if test ! -f $xdir/$oldobj; then $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else eval cmds=\"$archive_cmds\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" else # Just create a symlink. $show $rm $libobj $run $rm $libobj xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$libobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` $show "(cd $xdir && $LN_S $oldobj $baseobj)" $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; prog) case $host in *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`echo "$arg" | sed -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit 0 fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case $0 in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`echo $output|sed 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe ;; *) exeext= ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # win32 systems need to use the prog path for dll # lookup to work *-*-cygwin* | *-*-pw32*) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$oldobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` $show "(cd $xdir && ${LN_S} $obj $baseobj)" $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done eval cmds=\"$old_archive_cmds\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit 1 fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit 1 fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then notinst_deplibs= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null` if test $? = 0 ; then : else tmpdir="$tmpdir/libtool-$$" fi if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in /usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`echo $destfile | sed -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $0 --finish$current_libdirs' else exit 0 fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do echo " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit 0 fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi rmdirs= for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$objdir" else objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi ;; *) # Do a test to see if this is a libtool program. if test "$mode" = clean && (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit 1 fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: autotrace-0.31.1/missing0000755000076400007640000002403607521233631010662 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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, 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. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1Help2man' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 autotrace-0.31.1/mkinstalldirs0000755000076400007640000000341107521233631012063 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case "${1}" in -h | --help | --h* ) # -h for help echo "${usage}" 1>&2; exit 0 ;; -m ) # -m PERM arg shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } dirmode="${1}" shift ;; -- ) shift; break ;; # stop option processing -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option * ) break ;; # first non-opt arg esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 3 # End: # mkinstalldirs ends here autotrace-0.31.1/input-pnm.c0000664000076400007640000003310607551363265011370 /* input-pnm.c: import pnm and pbm files. Copyright (C) 1999, 2000, 2001 Erik Nygren This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ /* * The pnm reading and writing code was written from scratch by Erik Nygren * (nygren@mit.edu) based on the specifications in the man pages and * does not contain any code from the netpbm or pbmplus distributions. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "types.h" #include "bitmap.h" #include "input-pnm.h" #include "message.h" #include "xstd.h" #include #include /* Declare local data types */ typedef struct _PNMScanner { FILE *fd; /* The file descriptor of the file being read */ char cur; /* The current character in the input stream */ int eof; /* Have we reached end of file? */ char *inbuf; /* Input buffer - initially 0 */ int inbufsize; /* Size of input buffer */ int inbufvalidsize; /* Size of input buffer with valid data */ int inbufpos; /* Position in input buffer */ } PNMScanner; typedef struct _PNMInfo { unsigned int xres, yres; /* The size of the image */ int maxval; /* For ascii image files, the max value * which we need to normalize to */ int np; /* Number of image planes (0 for pbm) */ int asciibody; /* 1 if ascii body, 0 if raw body */ /* Routine to use to load the pnm body */ void (* loader) (PNMScanner *, struct _PNMInfo *, unsigned char *, at_exception_type * excep); } PNMInfo; #define BUFLEN 512 /* The input buffer size for data returned * from the scanner. Note that lines * aren't allowed to be over 256 characters * by the spec anyways so this shouldn't * be an issue. */ #define SAVE_COMMENT_STRING "# CREATOR: The GIMP's PNM Filter Version 1.0\n" /* Declare some local functions. */ static void pnm_load_ascii (PNMScanner *scan, PNMInfo *info, unsigned char *pixel_rgn, at_exception_type * excep); static void pnm_load_raw (PNMScanner *scan, PNMInfo *info, unsigned char *pixel_rgn, at_exception_type * excep); static void pnm_load_rawpbm (PNMScanner *scan, PNMInfo *info, unsigned char *pixel_rgn, at_exception_type * excep); static void pnmscanner_destroy (PNMScanner *s); static void pnmscanner_createbuffer (PNMScanner *s, unsigned int bufsize); static void pnmscanner_getchar (PNMScanner *s); static void pnmscanner_eatwhitespace (PNMScanner *s); static void pnmscanner_gettoken (PNMScanner *s, unsigned char *buf, unsigned int bufsize); static void pnmscanner_getsmalltoken (PNMScanner *s, unsigned char *buf); static PNMScanner * pnmscanner_create (FILE *fd); #define pnmscanner_eof(s) ((s)->eof) #define pnmscanner_fd(s) ((s)->fd) static struct struct_pnm_types { char name; int np; int asciibody; int maxval; void (* loader) (PNMScanner *, struct _PNMInfo *, unsigned char *pixel_rgn, at_exception_type * excep); } pnm_types[] = { { '1', 0, 1, 1, pnm_load_ascii }, /* ASCII PBM */ { '2', 1, 1, 255, pnm_load_ascii }, /* ASCII PGM */ { '3', 3, 1, 255, pnm_load_ascii }, /* ASCII PPM */ { '4', 0, 0, 1, pnm_load_rawpbm }, /* RAW PBM */ { '5', 1, 0, 255, pnm_load_raw }, /* RAW PGM */ { '6', 3, 0, 255, pnm_load_raw }, /* RAW PPM */ { 0 , 0, 0, 0, NULL} }; at_bitmap_type input_pnm_reader (at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data) { char buf[BUFLEN]; /* buffer for random things like scanning */ PNMInfo *pnminfo; PNMScanner * volatile scan; int ctr; FILE* fd; at_bitmap_type bitmap = at_bitmap_init(NULL, 0, 0, 0); at_exception_type excep = at_exception_new(msg_func, msg_data); /* open the file */ fd = fopen (filename, "rb"); if (fd == NULL) { LOG("pnm filter: can't open file\n"); at_exception_fatal(&excep, "pnm filter: can't open file"); return (bitmap); } /* allocate the necessary structures */ pnminfo = (PNMInfo *) malloc (sizeof (PNMInfo)); scan = NULL; /* set error handling */ scan = pnmscanner_create(fd); /* Get magic number */ pnmscanner_gettoken (scan, (unsigned char *)buf, BUFLEN); if (pnmscanner_eof(scan)) { LOG("pnm filter: premature end of file\n"); at_exception_fatal (&excep, "pnm filter: premature end of file"); goto cleanup; } if (buf[0] != 'P' || buf[2]) { LOG1("pnm filter: %s is not a valid file\n", filename); at_exception_fatal (&excep, "pnm filter: invalid file"); goto cleanup; } /* Look up magic number to see what type of PNM this is */ for (ctr=0; pnm_types[ctr].name; ctr++) if (buf[1] == pnm_types[ctr].name) { pnminfo->np = pnm_types[ctr].np; pnminfo->asciibody = pnm_types[ctr].asciibody; pnminfo->maxval = pnm_types[ctr].maxval; pnminfo->loader = pnm_types[ctr].loader; } if (!pnminfo->loader) { LOG ("pnm filter: file not in a supported format\n"); at_exception_fatal (&excep, "pnm filter: file not in a supported format"); goto cleanup; } pnmscanner_gettoken(scan, (unsigned char *)buf, BUFLEN); if (pnmscanner_eof(scan)) { LOG ("pnm filter: premature end of file\n"); at_exception_fatal (&excep, "pnm filter: premature end of file"); goto cleanup; } pnminfo->xres = isdigit(*buf)?atoi(buf):0; if (pnminfo->xres<=0) { LOG ("pnm filter: invalid xres while loading\n"); at_exception_fatal (&excep, "pnm filter: premature end of file"); goto cleanup; } pnmscanner_gettoken(scan, (unsigned char *)buf, BUFLEN); if (pnmscanner_eof(scan)) { LOG ("pnm filter: premature end of file\n"); at_exception_fatal (&excep, "pnm filter: premature end of file"); goto cleanup; } pnminfo->yres = isdigit(*buf)?atoi(buf):0; if (pnminfo->yres<=0) { LOG ("pnm filter: invalid yres while loading\n"); at_exception_fatal (&excep, "pnm filter: invalid yres while loading"); goto cleanup; } if (pnminfo->np != 0) /* pbm's don't have a maxval field */ { pnmscanner_gettoken(scan, (unsigned char *)buf, BUFLEN); if (pnmscanner_eof(scan)) { LOG ("pnm filter: premature end of file\n"); at_exception_fatal (&excep, "pnm filter: invalid yres while loading"); goto cleanup; } pnminfo->maxval = isdigit(*buf)?atoi(buf):0; if ((pnminfo->maxval<=0) || (pnminfo->maxval>255 && !pnminfo->asciibody)) { LOG ("pnm filter: invalid maxval while loading\n"); at_exception_fatal (&excep, "pnm filter: invalid maxval while loading"); goto cleanup; } } bitmap = at_bitmap_init(NULL, (unsigned short) pnminfo->xres, (unsigned short) pnminfo->yres, (pnminfo->np)?(pnminfo->np):1); pnminfo->loader (scan, pnminfo, AT_BITMAP_BITS (bitmap), &excep); cleanup: /* Destroy the scanner */ pnmscanner_destroy (scan); /* free the structures */ free (pnminfo); /* close the file */ fclose (fd); return (bitmap); } static void pnm_load_ascii (PNMScanner *scan, PNMInfo *info, unsigned char *data, at_exception_type * excep) { unsigned char *d; unsigned int x; int i, b; int start, end, scanlines; int np; char buf[BUFLEN]; np = (info->np)?(info->np):1; /* Buffer reads to increase performance */ pnmscanner_createbuffer(scan, 4096); start = 0; end = info->yres; scanlines = end - start; d = data; for (i = 0; i < scanlines; i++) for (x = 0; x < info->xres; x++) { for (b = 0; b < np; b++) { /* Truncated files will just have all 0's at the end of the images */ if (pnmscanner_eof(scan)) { LOG ("pnm filter: premature end of file\n"); at_exception_fatal(excep, "pnm filter: premature end of file"); return; } if (info->np) pnmscanner_gettoken(scan, (unsigned char *)buf, BUFLEN); else pnmscanner_getsmalltoken(scan, (unsigned char *)buf); switch (info->maxval) { case 255: d[b] = (unsigned char) (isdigit(*buf)?atoi(buf):0); break; case 1: d[b] = (*buf=='0')?0xff:0x00; break; default: d[b] = (unsigned char)(255.0*(((double)(isdigit(*buf)?atoi(buf):0)) / (double)(info->maxval))); } } d += np; } } static void pnm_load_raw (PNMScanner *scan, PNMInfo *info, unsigned char *data, at_exception_type * excep) { unsigned char *d; unsigned int x, i; unsigned int start, end, scanlines; FILE *fd; fd = pnmscanner_fd(scan); start = 0; end = info->yres; scanlines = end - start; d = data; for (i = 0; i < scanlines; i++) { if (info->xres*info->np != fread(d, 1, info->xres*info->np, fd)) { LOG ("pnm filter: premature end of file\n"); at_exception_fatal (excep, "pnm filter: premature end of file\n"); return ; } if (info->maxval != 255) /* Normalize if needed */ { for (x = 0; x < info->xres * info->np; x++) d[x] = (unsigned char)(255.0*(double)(d[x]) / (double)(info->maxval)); } d += info->xres * info->np; } } static void pnm_load_rawpbm (PNMScanner *scan, PNMInfo *info, unsigned char *data, at_exception_type * excep) { unsigned char *buf; unsigned char curbyte; unsigned char *d; unsigned int x, i; unsigned int start, end, scanlines; FILE *fd; unsigned int rowlen, bufpos; fd = pnmscanner_fd(scan); rowlen = (unsigned int)ceil((double)(info->xres)/8.0); buf = (unsigned char *)malloc(rowlen*sizeof(unsigned char)); start = 0; end = info->yres; scanlines = end - start; d = data; for (i = 0; i < scanlines; i++) { if (rowlen != fread(buf, 1, rowlen, fd)) { LOG ("pnm filter: error reading file\n"); at_exception_fatal (excep, "pnm filter: error reading file"); goto cleanup; } bufpos = 0; curbyte = buf[0]; for (x = 0; x < info->xres; x++) { if ((x % 8) == 0) curbyte = buf[bufpos++]; d[x] = (curbyte&0x80) ? 0x00 : 0xff; curbyte <<= 1; } d += info->xres; } cleanup: free(buf); } /**************** FILE SCANNER UTILITIES **************/ /* pnmscanner_create --- * Creates a new scanner based on a file descriptor. The * look ahead buffer is one character initially. */ static PNMScanner * pnmscanner_create (FILE *fd) { PNMScanner *s; XMALLOC (s, sizeof(PNMScanner)); s->fd = fd; s->inbuf = 0; s->eof = !fread(&(s->cur), 1, 1, s->fd); return(s); } /* pnmscanner_destroy --- * Destroys a scanner and its resources. Doesn't close the fd. */ static void pnmscanner_destroy (PNMScanner *s) { if (s->inbuf) free(s->inbuf); free(s); } /* pnmscanner_createbuffer --- * Creates a buffer so we can do buffered reads. */ static void pnmscanner_createbuffer (PNMScanner *s, unsigned int bufsize) { s->inbuf = (char *)malloc(sizeof(char)*bufsize); s->inbufsize = bufsize; s->inbufpos = 0; s->inbufvalidsize = fread(s->inbuf, 1, bufsize, s->fd); } /* pnmscanner_gettoken --- * Gets the next token, eating any leading whitespace. */ static void pnmscanner_gettoken (PNMScanner *s, unsigned char *buf, unsigned int bufsize) { unsigned int ctr=0; pnmscanner_eatwhitespace(s); while (!(s->eof) && !isspace(s->cur) && (s->cur != '#') && (ctrcur; pnmscanner_getchar(s); } buf[ctr] = '\0'; } /* pnmscanner_getsmalltoken --- * Gets the next char, eating any leading whitespace. */ static void pnmscanner_getsmalltoken (PNMScanner *s, unsigned char *buf) { pnmscanner_eatwhitespace(s); if (!(s->eof) && !isspace(s->cur) && (s->cur != '#')) { *buf = s->cur; pnmscanner_getchar(s); } } /* pnmscanner_getchar --- * Reads a character from the input stream */ static void pnmscanner_getchar (PNMScanner *s) { if (s->inbuf) { s->cur = s->inbuf[s->inbufpos++]; if (s->inbufpos >= s->inbufvalidsize) { if (s->inbufsize > s->inbufvalidsize) s->eof = 1; else s->inbufvalidsize = fread(s->inbuf, 1, s->inbufsize, s->fd); s->inbufpos = 0; } } else s->eof = !fread(&(s->cur), 1, 1, s->fd); } /* pnmscanner_eatwhitespace --- * Eats up whitespace from the input and returns when done or eof. * Also deals with comments. */ static void pnmscanner_eatwhitespace (PNMScanner *s) { int state = 0; while (!(s->eof) && (state != -1)) { switch (state) { case 0: /* in whitespace */ if (s->cur == '#') { state = 1; /* goto comment */ pnmscanner_getchar(s); } else if (!isspace(s->cur)) state = -1; else pnmscanner_getchar(s); break; case 1: /* in comment */ if (s->cur == '\n') state = 0; /* goto whitespace */ pnmscanner_getchar(s); break; } } } autotrace-0.31.1/input-pnm.h0000664000076400007640000000206607551363230011366 /* input-pnm.h: import pnm and pbm files. Copyright (C) 1999, 2000, 2001 Erik Nygren This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef INPUT_PNM_H #define INPUT_PNM_H #include "input.h" at_bitmap_type input_pnm_reader (at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data); #endif /* not INPUT_PNM_H */ autotrace-0.31.1/input-bmp.c0000664000076400007640000003435207551363230011350 /* input-bmp.c: reads any bitmap I could get for testing Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include #include #include #include "types.h" #include "bitmap.h" #include "message.h" #include "xstd.h" #include "input-bmp.h" #define MAXCOLORS 256 #define Image long #define BitSet(byte, bit) (((byte) & (bit)) == (bit)) #define ReadOK(file,buffer,len) (fread(buffer, len, 1, file) != 0) struct Bitmap_File_Head_Struct { char zzMagic[2]; /* 00 "BM" */ unsigned long bfSize; /* 02 */ unsigned short zzHotX; /* 06 */ unsigned short zzHotY; /* 08 */ unsigned long bfOffs; /* 0A */ unsigned long biSize; /* 0E */ } Bitmap_File_Head; struct Bitmap_Head_Struct { unsigned long biWidth; /* 12 */ unsigned long biHeight; /* 16 */ unsigned short biPlanes; /* 1A */ unsigned short biBitCnt; /* 1C */ unsigned long biCompr; /* 1E */ unsigned long biSizeIm; /* 22 */ unsigned long biXPels; /* 26 */ unsigned long biYPels; /* 2A */ unsigned long biClrUsed; /* 2E */ unsigned long biClrImp; /* 32 */ /* 36 */ } Bitmap_Head; static long ToL (unsigned char *); static short ToS (unsigned char *); static int ReadColorMap (FILE *, unsigned char[256][3], int, int, int *, at_exception_type *); static unsigned char *ReadImage (FILE *, int, int, unsigned char[256][3], int, int, int, int); at_bitmap_type input_bmp_reader (at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data) { FILE *fd; unsigned char buffer[64]; int ColormapSize, rowbytes, Maps, Grey; unsigned char ColorMap[256][3]; at_bitmap_type image = at_bitmap_init(0, 0, 0, 1); unsigned char * image_storage; at_exception_type exp = at_exception_new(msg_func, msg_data); fd = fopen (filename, "rb"); if (!fd) { LOG1 ("Can't open \"%s\"\n", filename); at_exception_fatal(&exp, "bmp: cannot open input file"); return image; } /* It is a File. Now is it a Bitmap? Read the shortest possible header.*/ if (!ReadOK(fd, buffer, 18) || (strncmp((const char *)buffer,"BM",2))) { LOG1 ("Not a valid BMP file %s\n", filename); at_exception_fatal(&exp, "bmp: invalid input file"); goto cleanup; } /* bring them to the right byteorder. Not too nice, but it should work */ Bitmap_File_Head.bfSize = ToL (&buffer[0x02]); Bitmap_File_Head.zzHotX = ToS (&buffer[0x06]); Bitmap_File_Head.zzHotY = ToS (&buffer[0x08]); Bitmap_File_Head.bfOffs = ToL (&buffer[0x0a]); Bitmap_File_Head.biSize = ToL (&buffer[0x0e]); /* What kind of bitmap is it? */ if (Bitmap_File_Head.biSize == 12) /* OS/2 1.x ? */ { if (!ReadOK (fd, buffer, 8)) { LOG ("Error reading BMP file header\n"); at_exception_fatal(&exp, "Error reading BMP file header"); goto cleanup; } Bitmap_Head.biWidth = ToS (&buffer[0x00]); /* 12 */ Bitmap_Head.biHeight = ToS (&buffer[0x02]); /* 14 */ Bitmap_Head.biPlanes = ToS (&buffer[0x04]); /* 16 */ Bitmap_Head.biBitCnt = ToS (&buffer[0x06]); /* 18 */ Bitmap_Head.biCompr = 0; Bitmap_Head.biSizeIm = 0; Bitmap_Head.biXPels = Bitmap_Head.biYPels = 0; Bitmap_Head.biClrUsed = 0; Maps = 3; } else if (Bitmap_File_Head.biSize == 40) /* Windows 3.x */ { if (!ReadOK (fd, buffer, Bitmap_File_Head.biSize - 4)) { LOG ("Error reading BMP file header\n"); at_exception_fatal(&exp, "Error reading BMP file header"); goto cleanup; } Bitmap_Head.biWidth =ToL (&buffer[0x00]); /* 12 */ Bitmap_Head.biHeight =ToL (&buffer[0x04]); /* 16 */ Bitmap_Head.biPlanes =ToS (&buffer[0x08]); /* 1A */ Bitmap_Head.biBitCnt =ToS (&buffer[0x0A]); /* 1C */ Bitmap_Head.biCompr =ToL (&buffer[0x0C]); /* 1E */ Bitmap_Head.biSizeIm =ToL (&buffer[0x10]); /* 22 */ Bitmap_Head.biXPels =ToL (&buffer[0x14]); /* 26 */ Bitmap_Head.biYPels =ToL (&buffer[0x18]); /* 2A */ Bitmap_Head.biClrUsed =ToL (&buffer[0x1C]); /* 2E */ Bitmap_Head.biClrImp =ToL (&buffer[0x20]); /* 32 */ /* 36 */ Maps = 4; } else if (Bitmap_File_Head.biSize <= 64) /* Probably OS/2 2.x */ { if (!ReadOK (fd, buffer, Bitmap_File_Head.biSize - 4)) { LOG ("Error reading BMP file header\n"); at_exception_fatal(&exp, "Error reading BMP file header"); goto cleanup; } Bitmap_Head.biWidth =ToL (&buffer[0x00]); /* 12 */ Bitmap_Head.biHeight =ToL (&buffer[0x04]); /* 16 */ Bitmap_Head.biPlanes =ToS (&buffer[0x08]); /* 1A */ Bitmap_Head.biBitCnt =ToS (&buffer[0x0A]); /* 1C */ Bitmap_Head.biCompr =ToL (&buffer[0x0C]); /* 1E */ Bitmap_Head.biSizeIm =ToL (&buffer[0x10]); /* 22 */ Bitmap_Head.biXPels =ToL (&buffer[0x14]); /* 26 */ Bitmap_Head.biYPels =ToL (&buffer[0x18]); /* 2A */ Bitmap_Head.biClrUsed =ToL (&buffer[0x1C]); /* 2E */ Bitmap_Head.biClrImp =ToL (&buffer[0x20]); /* 32 */ /* 36 */ Maps = 3; } else { LOG ("Error reading BMP file header\n"); at_exception_fatal(&exp, "Error reading BMP file header"); goto cleanup; } /* Valid options 1, 4, 8, 16, 24, 32 */ /* 16 is awful, we should probably shoot whoever invented it */ /* There should be some colors used! */ ColormapSize = (Bitmap_File_Head.bfOffs - Bitmap_File_Head.biSize - 14) / Maps; if ((Bitmap_Head.biClrUsed == 0) && (Bitmap_Head.biBitCnt <= 8)) Bitmap_Head.biClrUsed = ColormapSize; /* Sanity checks */ if ((Bitmap_Head.biHeight == 0 || Bitmap_Head.biWidth == 0) || (Bitmap_Head.biPlanes != 1) || (ColormapSize > 256 || Bitmap_Head.biClrUsed > 256)) { LOG ("Error reading BMP file header\n"); at_exception_fatal(&exp, "Error reading BMP file header"); goto cleanup; } /* Windows and OS/2 declare filler so that rows are a multiple of * word length (32 bits == 4 bytes) */ rowbytes= ( (Bitmap_Head.biWidth * Bitmap_Head.biBitCnt - 1) / 32) * 4 + 4; #ifdef DEBUG printf("\nSize: %u, Colors: %u, Bits: %u, Width: %u, Height: %u, Comp: %u, Zeile: %u\n", Bitmap_File_Head.bfSize,Bitmap_Head.biClrUsed,Bitmap_Head.biBitCnt,Bitmap_Head.biWidth, Bitmap_Head.biHeight, Bitmap_Head.biCompr, rowbytes); #endif /* Get the Colormap */ ReadColorMap (fd, ColorMap, ColormapSize, Maps, &Grey, &exp); if (at_exception_got_fatal(&exp)) goto cleanup; #ifdef DEBUG printf("Colormap read\n"); #endif /* Get the Image and return the ID or -1 on error*/ image_storage = ReadImage (fd, Bitmap_Head.biWidth, Bitmap_Head.biHeight, ColorMap, Bitmap_Head.biBitCnt, Bitmap_Head.biCompr, rowbytes, Grey); image = at_bitmap_init(image_storage, (unsigned short) Bitmap_Head.biWidth, (unsigned short) Bitmap_Head.biHeight, Grey ? 1 : 3); cleanup: fclose (fd); return (image); } static int ReadColorMap (FILE *fd, unsigned char buffer[256][3], int number, int size, int *grey, at_exception_type * exp) { int i; unsigned char rgb[4]; *grey=(number>2); for (i = 0; i < number ; i++) { if (!ReadOK (fd, rgb, size)) { LOG ("Bad colormap\n"); at_exception_fatal (exp, "Bad colormap"); goto cleanup; } /* Bitmap save the colors in another order! But change only once! */ buffer[i][0] = rgb[2]; buffer[i][1] = rgb[1]; buffer[i][2] = rgb[0]; *grey = ((*grey) && (rgb[0]==rgb[1]) && (rgb[1]==rgb[2])); } cleanup: return 0; } static unsigned char* ReadImage (FILE *fd, int width, int height, unsigned char cmap[256][3], int bpp, int compression, int rowbytes, int grey) { unsigned char v,howmuch; int xpos = 0, ypos = 0; unsigned char *image; unsigned char *temp, *buffer; long rowstride, channels; unsigned short rgb; int i, j, notused; if (bpp >= 16) /* color image */ { XMALLOC (image, width * height * 3 * sizeof (unsigned char)); channels = 3; } else if (grey) /* grey image */ { XMALLOC (image, width * height * 1 * sizeof (unsigned char)); channels = 1; } else /* indexed image */ { XMALLOC (image, width * height * 1 * sizeof (unsigned char)); channels = 1; } XMALLOC (buffer, rowbytes); rowstride = width * channels; ypos = height - 1; /* Bitmaps begin in the lower left corner */ switch (bpp) { case 32: { while (ReadOK (fd, buffer, rowbytes)) { temp = image + (ypos * rowstride); for (xpos= 0; xpos < width; ++xpos) { *(temp++)= buffer[xpos * 4 + 2]; *(temp++)= buffer[xpos * 4 + 1]; *(temp++)= buffer[xpos * 4]; } --ypos; /* next line */ } } break; case 24: { while (ReadOK (fd, buffer, rowbytes)) { temp = image + (ypos * rowstride); for (xpos= 0; xpos < width; ++xpos) { *(temp++)= buffer[xpos * 3 + 2]; *(temp++)= buffer[xpos * 3 + 1]; *(temp++)= buffer[xpos * 3]; } --ypos; /* next line */ } } break; case 16: { while (ReadOK (fd, buffer, rowbytes)) { temp = image + (ypos * rowstride); for (xpos= 0; xpos < width; ++xpos) { rgb= ToS(&buffer[xpos * 2]); *(temp++)= (unsigned char)(((rgb >> 10) & 0x1f) * 8); *(temp++)= (unsigned char)(((rgb >> 5) & 0x1f) * 8); *(temp++)= (unsigned char)(((rgb) & 0x1f) * 8); } --ypos; /* next line */ } } break; case 8: case 4: case 1: { if (compression == 0) { while (ReadOK (fd, &v, 1)) { for (i = 1; (i <= (8 / bpp)) && (xpos < width); i++, xpos++) { temp = (unsigned char*) (image + (ypos * rowstride) + (xpos * channels)); *temp= (unsigned char)(( v & ( ((1<> (8-(i*bpp))); } if (xpos == width) { notused = ReadOK (fd, buffer, rowbytes - 1 - (width * bpp - 1) / 8); ypos--; xpos = 0; } if (ypos < 0) break; } break; } else { while (ypos >= 0 && xpos <= width) { notused = ReadOK (fd, buffer, 2); if ((unsigned char) buffer[0] != 0) /* Count + Color - record */ { for (j = 0; ((unsigned char) j < (unsigned char) buffer[0]) && (xpos < width);) { #ifdef DEBUG2 printf("%u %u | ",xpos,width); #endif for (i = 1; ((i <= (8 / bpp)) && (xpos < width) && ((unsigned char) j < (unsigned char) buffer[0])); i++, xpos++, j++) { temp = image + (ypos * rowstride) + (xpos * channels); *temp = (unsigned char) ((buffer[1] & (((1<> (8 - (i * bpp))); } } } if (((unsigned char) buffer[0] == 0) && ((unsigned char) buffer[1] > 2)) /* uncompressed record */ { howmuch = buffer[1]; for (j = 0; j < howmuch; j += (8 / bpp)) { notused = ReadOK (fd, &v, 1); i = 1; while ((i <= (8 / bpp)) && (xpos < width)) { temp = image + (ypos * rowstride) + (xpos * channels); *temp = (unsigned char) ((v & (((1<> (8-(i*bpp))); i++; xpos++; } } if ((howmuch % 2) && (bpp==4)) howmuch++; if ((howmuch / (8 / bpp)) % 2) notused = ReadOK (fd, &v, 1); /*if odd(x div (8 div bpp )) then blockread(f,z^,1);*/ } if (((unsigned char) buffer[0] == 0) && ((unsigned char) buffer[1]==0)) /* Line end */ { ypos--; xpos = 0; } if (((unsigned char) buffer[0]==0) && ((unsigned char) buffer[1]==1)) /* Bitmap end */ { break; } if (((unsigned char) buffer[0]==0) && ((unsigned char) buffer[1]==2)) /* Deltarecord */ { notused = ReadOK (fd, buffer, 2); xpos += (unsigned char) buffer[0]; ypos -= (unsigned char) buffer[1]; } } break; } } break; default: /* This is very bad, we should not be here */ ; } if (bpp <= 8) { unsigned char *temp2, *temp3; unsigned char index; temp2 = temp = image; XMALLOC (image, width * height * 3 * sizeof (unsigned char)); temp3 = image; for (ypos = 0; ypos < height; ypos++) { for (xpos = 0; xpos < width; xpos++) { index = *temp2++; *temp3++ = cmap[index][0]; if (!grey) { *temp3++ = cmap[index][1]; *temp3++ = cmap[index][2]; } } } free (temp); } free (buffer); return image; } FILE *errorfile; char *prog_name = "bmp"; char *filename; int interactive_bmp; static long ToL (unsigned char *puffer) { return (puffer[0] | puffer[1]<<8 | puffer[2]<<16 | puffer[3]<<24); } static short ToS (unsigned char *puffer) { return ((short)(puffer[0] | puffer[1]<<8)); } autotrace-0.31.1/input-bmp.h0000664000076400007640000000203707551363230011350 /* input-bmp.h: import bmp files Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef INPUT_BMP_H #define INPUT_BMP_H #include "input.h" at_bitmap_type input_bmp_reader (at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data); #endif /* not INPUT_BMP_H */ autotrace-0.31.1/input-tga.c0000664000076400007640000004041207551363231011340 /* input-tga.c: reads tga files Copyright (C) 1999, 2000, 2001 Martin Weber This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include #include #include /* #include */ #include "bitmap.h" #include "message.h" #include "xstd.h" #include "input-bmp.h" /* TODO: - Handle loading images that aren't 8 bits per channel. */ /* Round up a division to the nearest integer. */ #define ROUNDUP_DIVIDE(n,d) (((n) + (d - 1)) / (d)) #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define INDEXED 1 #define INDEXEDA 2 #define GRAY 3 #define RGB 5 #define INDEXED_IMAGE 1 #define INDEXEDA_IMAGE 2 #define GRAY_IMAGE 3 #define GRAYA_IMAGE 4 #define RGB_IMAGE 5 #define RGBA_IMAGE 6 struct tga_header { unsigned char idLength; unsigned char colorMapType; /* The image type. */ #define TGA_TYPE_MAPPED 1 #define TGA_TYPE_COLOR 2 #define TGA_TYPE_GRAY 3 #define TGA_TYPE_MAPPED_RLE 9 #define TGA_TYPE_COLOR_RLE 10 #define TGA_TYPE_GRAY_RLE 11 unsigned char imageType; /* Color Map Specification. */ /* We need to separately specify high and low bytes to avoid endianness and alignment problems. */ unsigned char colorMapIndexLo, colorMapIndexHi; unsigned char colorMapLengthLo, colorMapLengthHi; unsigned char colorMapSize; /* Image Specification. */ unsigned char xOriginLo, xOriginHi; unsigned char yOriginLo, yOriginHi; unsigned char widthLo, widthHi; unsigned char heightLo, heightHi; unsigned char bpp; /* Image descriptor. 3-0: attribute bpp 4: left-to-right ordering 5: top-to-bottom ordering 7-6: zero */ #define TGA_DESC_ABITS 0x0f #define TGA_DESC_HORIZONTAL 0x10 #define TGA_DESC_VERTICAL 0x20 unsigned char descriptor; }; static struct { unsigned int extensionAreaOffset; unsigned int developerDirectoryOffset; #define TGA_SIGNATURE "TRUEVISION-XFILE" char signature[16]; char dot; char null; } tga_footer; static at_bitmap_type ReadImage (FILE *fp, struct tga_header *hdr, at_exception_type * exp); at_bitmap_type input_tga_reader (at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data) { FILE *fp; struct tga_header hdr; at_bitmap_type image = at_bitmap_init(0, 0, 0, 1); at_exception_type exp = at_exception_new(msg_func, msg_data); fp = fopen (filename, "rb"); if (!fp) { LOG1 ("TGA: can't open \"%s\"\n", filename); at_exception_fatal(&exp, "Cannot open input tga file"); } /* Check the footer. */ if (fseek (fp, 0L - (sizeof (tga_footer)), SEEK_END) || fread (&tga_footer, sizeof (tga_footer), 1, fp) != 1) { LOG1 ("TGA: Cannot read footer from \"%s\"\n", filename); at_exception_fatal(&exp, "TGA: Cannot read footer"); goto cleanup; } /* Check the signature. */ if (fseek (fp, 0, SEEK_SET) || fread (&hdr, sizeof (hdr), 1, fp) != 1) { LOG1 ("TGA: Cannot read header from \"%s\"\n", filename); at_exception_fatal(&exp, "TGA: Cannot read header"); goto cleanup; } /* Skip the image ID field. */ if (hdr.idLength && fseek (fp, hdr.idLength, SEEK_CUR)) { LOG1 ("TGA: Cannot skip ID field in \"%s\"\n", filename); at_exception_fatal(&exp, "TGA: Cannot skip ID field"); goto cleanup; } image = ReadImage (fp, &hdr, &exp); cleanup: fclose (fp); return image; } static int std_fread (unsigned char *buf, int datasize, int nelems, FILE *fp) { return fread (buf, datasize, nelems, fp); } #define RLE_PACKETSIZE 0x80 /* Decode a bufferful of file. */ static int rle_fread (unsigned char *buf, int datasize, int nelems, FILE *fp) { static unsigned char *statebuf = 0; static int statelen = 0; static int laststate = 0; int j, k; int buflen, count, bytes; unsigned char *p; /* Scale the buffer length. */ buflen = nelems * datasize; j = 0; while (j < buflen) { if (laststate < statelen) { /* Copy bytes from our previously decoded buffer. */ bytes = MIN (buflen - j, statelen - laststate); memcpy (buf + j, statebuf + laststate, bytes); j += bytes; laststate += bytes; /* If we used up all of our state bytes, then reset them. */ if (laststate >= statelen) { laststate = 0; statelen = 0; } /* If we filled the buffer, then exit the loop. */ if (j >= buflen) break; } /* Decode the next packet. */ count = fgetc (fp); if (count == EOF) { return j / datasize; } /* Scale the byte length to the size of the data. */ bytes = ((count & ~RLE_PACKETSIZE) + 1) * datasize; if (j + bytes <= buflen) { /* We can copy directly into the image buffer. */ p = buf + j; } else { /* Allocate the state buffer if we haven't already. */ if (!statebuf) statebuf = (unsigned char *) malloc (RLE_PACKETSIZE * datasize); p = statebuf; } if (count & RLE_PACKETSIZE) { /* Fill the buffer with the next value. */ if (fread (p, datasize, 1, fp) != 1) { return j / datasize; } /* Optimized case for single-byte encoded data. */ if (datasize == 1) memset (p + 1, *p, bytes - 1); else for (k = datasize; k < bytes; k += datasize) memcpy (p + k, p, datasize); } else { /* Read in the buffer. */ if (fread (p, bytes, 1, fp) != 1) { return j / datasize; } } /* We may need to copy bytes from the state buffer. */ if (p == statebuf) statelen = bytes; else j += bytes; } return nelems; } static at_bitmap_type ReadImage (FILE *fp, struct tga_header *hdr, at_exception_type * exp) { at_bitmap_type image = at_bitmap_init(0, 0, 0, 1); unsigned char *buffer; unsigned char *alphas; int width, height, bpp, abpp, pbpp, nalphas; int j, k; int pelbytes, wbytes, bsize, npels, pels; int rle, badread; int itype, dtype; unsigned char *cmap = NULL; int (*myfread)(unsigned char *, int, int, FILE *); /* Find out whether the image is horizontally or vertically reversed. */ char horzrev = (char) (hdr->descriptor & TGA_DESC_HORIZONTAL); char vertrev = (char) (!(hdr->descriptor & TGA_DESC_VERTICAL)); image.bitmap = NULL; /* Reassemble the multi-byte values correctly, regardless of host endianness. */ width = (hdr->widthHi << 8) | hdr->widthLo; height = (hdr->heightHi << 8) | hdr->heightLo; bpp = hdr->bpp; abpp = hdr->descriptor & TGA_DESC_ABITS; if (hdr->imageType == TGA_TYPE_COLOR || hdr->imageType == TGA_TYPE_COLOR_RLE) pbpp = MIN (bpp / 3, 8) * 3; else if (abpp < bpp) pbpp = bpp - abpp; else pbpp = bpp; if (abpp + pbpp > bpp) { LOG3 ("TGA: %d bit image, %d bit alpha is greater than %d total bits per pixel\n", pbpp, abpp, bpp); at_exception_warning (exp, "TGA: alpha bit is too great"); /* Assume that alpha bits were set incorrectly. */ abpp = bpp - pbpp; LOG1("TGA: reducing to %d bit alpha\n", abpp); at_exception_warning (exp, "TGA: alpha bit is reduced"); } else if (abpp + pbpp < bpp) { LOG3 ("TGA: %d bit image, %d bit alpha is less than %d total bits per pixel\n", pbpp, abpp, bpp); at_exception_warning(exp, "TGA: alpha bit is too little"); /* Again, assume that alpha bits were set incorrectly. */ abpp = bpp - pbpp; LOG1 ("TGA: increasing to %d bit alpha\n", abpp); at_exception_warning (exp, "TGA: alpha bit is increased"); } rle = 0; switch (hdr->imageType) { case TGA_TYPE_MAPPED_RLE: rle = 1; case TGA_TYPE_MAPPED: itype = INDEXED; /* Find the size of palette elements. */ pbpp = MIN (hdr->colorMapSize / 3, 8) * 3; if (pbpp < hdr->colorMapSize) abpp = hdr->colorMapSize - pbpp; else abpp = 0; if (bpp != 8) { /* We can only cope with 8-bit indices. */ LOG ("TGA: index sizes other than 8 bits are unimplemented\n"); at_exception_fatal(exp, "TGA: index sizes other than 8 bits are unimplemented"); return image; } if (abpp) dtype = INDEXEDA_IMAGE; else dtype = INDEXED_IMAGE; break; case TGA_TYPE_GRAY_RLE: rle = 1; case TGA_TYPE_GRAY: itype = GRAY; if (abpp) dtype = GRAYA_IMAGE; else dtype = GRAY_IMAGE; break; case TGA_TYPE_COLOR_RLE: rle = 1; case TGA_TYPE_COLOR: itype = RGB; if (abpp) dtype = RGBA_IMAGE; else dtype = RGB_IMAGE; break; default: { LOG1 ("TGA: unrecognized image type %d\n", hdr->imageType); at_exception_fatal (exp, "TGA: unrecognized image type"); return image; } } if ((abpp && abpp != 8) || ((itype == RGB || itype == INDEXED) && pbpp != 24) || (itype == GRAY && pbpp != 8)) { /* FIXME: We haven't implemented bit-packed fields yet. */ LOG ("TGA: channel sizes other than 8 bits are unimplemented\n"); at_exception_fatal (exp, "TGA: channel sizes other than 8 bits are unimplemented"); return image; } /* Check that we have a color map only when we need it. */ if (itype == INDEXED) { if (hdr->colorMapType != 1) { LOG1 ("TGA: indexed image has invalid color map type %d\n", hdr->colorMapType); at_exception_fatal (exp, "TGA: indexed image has invalid color map type"); return image; } } else if (hdr->colorMapType != 0) { LOG1("TGA: non-indexed image has invalid color map type %d\n", hdr->colorMapType); at_exception_fatal (exp, "TGA: non-indexed image has invalid color map type"); return image; } alphas = 0; nalphas = 0; if (hdr->colorMapType == 1) { /* We need to read in the colormap. */ int index, colors; unsigned int length; index = (hdr->colorMapIndexHi << 8) | hdr->colorMapIndexLo; length = (hdr->colorMapLengthHi << 8) | hdr->colorMapLengthLo; if (length == 0) { LOG1 ("TGA: invalid color map length %d\n", length); at_exception_fatal(exp, "TGA: invalid color map length"); return image; } pelbytes = ROUNDUP_DIVIDE (hdr->colorMapSize, 8); colors = length + index; cmap = (unsigned char *) malloc (colors * pelbytes); /* Zero the entries up to the beginning of the map. */ memset (cmap, 0, index * pelbytes); /* Read in the rest of the colormap. */ if (fread (cmap + (index * pelbytes), pelbytes, length, fp) != length) { LOG1 ("TGA: error reading colormap (ftell == %ld)\n", ftell (fp)); at_exception_fatal(exp, "TGA: error reading colormap"); return image; } /* If we have an alpha channel, then create a mapping to the alpha values. */ if (pelbytes > 3) alphas = (unsigned char *) malloc (colors); k = 0; for (j = 0; j < colors * pelbytes; j += pelbytes) { /* Swap from BGR to RGB. */ unsigned char tmp = cmap[j]; cmap[k ++] = cmap[j + 2]; cmap[k ++] = cmap[j + 1]; cmap[k ++] = tmp; /* Take the alpha values out of the colormap. */ if (alphas) alphas[nalphas ++] = cmap[j + 3]; } /* If the last color was transparent, then omit it from the mapping. */ if (nalphas && alphas[nalphas - 1] == 0) colors --; /* Now pretend as if we only have 8 bpp. */ abpp = 0; pbpp = 8; pelbytes = 1; } else pelbytes = 3; image = at_bitmap_init(NULL, width, height, 3); /* Calculate TGA bytes per pixel. */ bpp = ROUNDUP_DIVIDE (pbpp + abpp, 8); /* Maybe we need to reverse the data. */ buffer = NULL; if (horzrev || vertrev) buffer = (unsigned char *) malloc (width * height * pelbytes * sizeof (unsigned char)); if (rle) myfread = rle_fread; else myfread = std_fread; wbytes = width * pelbytes; badread = 0; npels = width * height; bsize = wbytes * height; /* Suck in the data one height at a time. */ if (badread) pels = 0; else pels = (*myfread) (image.bitmap, bpp, npels, fp); if (pels != npels) { if (!badread) { /* Probably premature end of file. */ LOG1 ("TGA: error reading (ftell == %ld)\n", ftell (fp)); at_exception_warning(exp, "TGA: eroor reading file"); badread = 1; } /* Fill the rest of this tile with zeros. */ memset (image.bitmap + (pels * bpp), 0, ((npels - pels) * bpp)); } /* If we have indexed alphas, then set them. */ if (nalphas) { /* Start at the end of the buffer, and work backwards. */ k = (npels - 1) * bpp; for (j = bsize - pelbytes; j >= 0; j -= pelbytes) { /* Find the alpha for this index. */ image.bitmap[j + 1] = alphas[image.bitmap[k]]; image.bitmap[j] = image.bitmap[k --]; } } if (itype == GRAY) for (j = bsize/3 - 1; j >= 0; j -= 1) { /* Find the alpha for this index. */ image.bitmap[3*j] = image.bitmap[j]; image.bitmap[3*j+1] = image.bitmap[j]; image.bitmap[3*j+2] = image.bitmap[j]; } if (pelbytes >= 3) { /* Rearrange the colors from BGR to RGB. */ for (j = 0; j < bsize; j += pelbytes) { unsigned char tmp = image.bitmap[j]; image.bitmap[j] = image.bitmap[j + 2]; image.bitmap[j + 2] = tmp; } } if (horzrev || vertrev) { unsigned char *tmp; if (vertrev) { /* We need to mirror only vertically. */ for (j = 0; j < bsize; j += wbytes) memcpy (buffer + j, image.bitmap + bsize - (j + wbytes), wbytes); } else if (horzrev) { /* We need to mirror only horizontally. */ for (j = 0; j < bsize; j += wbytes) for (k = 0; k < wbytes; k += pelbytes) memcpy (buffer + k + j, image.bitmap + (j + wbytes) - (k + pelbytes), pelbytes); } else { /* Completely reverse the pixels in the buffer. */ for (j = 0; j < bsize; j += pelbytes) memcpy (buffer + j, image.bitmap + bsize - (j + pelbytes), pelbytes); } /* Swap the buffers because we modified them. */ tmp = buffer; buffer = image.bitmap; image.bitmap = tmp; } if (fgetc (fp) != EOF) { LOG ("TGA: too much input data, ignoring extra...\n"); at_exception_warning(exp, "TGA: too much input data, ignoring extra datum"); } free (buffer); if (hdr->colorMapType == 1) { unsigned char *temp, *temp2, *temp3; unsigned char index; int xpos, ypos; temp2 = temp = image.bitmap; image.bitmap = temp3 = (unsigned char *) malloc (width * height * 3 * sizeof (unsigned char)); for (ypos = 0; ypos < height; ypos++) { for (xpos = 0; xpos < width; xpos++) { index = *temp2++; *temp3++ = cmap[3*index+0]; *temp3++ = cmap[3*index+1]; *temp3++ = cmap[3*index+2]; } } free (temp); free (cmap); } if (alphas) free (alphas); return image; } /* read_image */ autotrace-0.31.1/input-tga.h0000664000076400007640000000203607551363231011345 /* input-tga.h: import tga files. Copyright (C) 1999, 2000, 2001 Martin Weber This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef INPUT_TGA_H #define INPUT_TGA_H #include "input.h" at_bitmap_type input_tga_reader (at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data); #endif /* not INPUT_TGA_H */ autotrace-0.31.1/input-png.c0000644000076400007640000001345107551363236011357 /* input-png.c: PNG loader for autotrace Copyright (C) 2000 MenTaLguY This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include #include #include #include "types.h" #include "bitmap.h" #include "message.h" #include "xstd.h" #include #include "input-png.h" static volatile char rcsid[]="$Id: input-png.c,v 1.16 2002/10/05 19:38:25 masata-y Exp $"; static png_bytep * read_png(png_structp png_ptr, png_infop info_ptr, at_input_opts_type * opts); /* for pre-1.0.6 versions of libpng */ #ifndef png_jmpbuf # define png_jmpbuf(png_ptr) (png_ptr)->jmpbuf #endif static void handle_warning(png_structp png, const at_string message) { LOG1("PNG warning: %s", message); at_exception_warning((at_exception_type *)png->error_ptr, message); /* at_exception_fatal((at_exception_type *)at_png->error_ptr, "PNG warning"); */ } static void handle_error(png_structp png, const at_string message) { LOG1("PNG error: %s", message); at_exception_fatal((at_exception_type *)png->error_ptr, message); /* at_exception_fatal((at_exception_type *)at_png->error_ptr, "PNG error"); */ } static void finalize_structs(png_structp png, png_infop info, png_infop end_info) { png_destroy_read_struct(png ? &png : NULL, info ? &info : NULL, end_info ? &end_info : NULL); } static int init_structs(png_structp *png, png_infop *info, png_infop *end_info, at_exception_type * exp) { *png = NULL; *info = *end_info = NULL; *png = png_create_read_struct(PNG_LIBPNG_VER_STRING, exp, (png_error_ptr)handle_error, (png_error_ptr)handle_warning); if (*png) { *info = png_create_info_struct(*png); if (*info) { *end_info = png_create_info_struct(*png); if (*end_info) return 1; } finalize_structs(*png, *info, *end_info); } return 0; } #define CHECK_ERROR() do { if (at_exception_got_fatal(exp)) \ { \ result = 0; \ goto cleanup; \ } } while (0) static int load_image(at_bitmap_type *image, FILE *stream, at_input_opts_type * opts, at_exception_type * exp) { png_structp png; png_infop info, end_info; png_bytep *rows; unsigned short width, height, row; int pixel_size; int result = 1; if (!init_structs(&png, &info, &end_info, exp)) return 0; png_init_io(png, stream); CHECK_ERROR(); rows = read_png(png, info, opts); width = (unsigned short)png_get_image_width(png, info); height = (unsigned short)png_get_image_height(png, info); if ( png_get_color_type(png, info) == PNG_COLOR_TYPE_GRAY ) { pixel_size = 1; } else { pixel_size = 3; } *image = at_bitmap_init(NULL, width, height, pixel_size); for ( row = 0 ; row < height ; row++, rows++ ) { memcpy(AT_BITMAP_PIXEL(*image, row, 0), *rows, width * pixel_size * sizeof(unsigned char)); } cleanup: finalize_structs(png, info, end_info); return result; } at_bitmap_type input_png_reader(at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data) { FILE *stream; at_bitmap_type image = at_bitmap_init(0, 0, 0, 1); at_exception_type exp = at_exception_new(msg_func, msg_data); stream = fopen(filename, "rb"); if (!stream) { LOG1("Can't open \"%s\"\n", filename); at_exception_fatal(&exp, "Cannot open input png file"); return image; } load_image(&image, stream, opts, &exp); fclose(stream); return image; } static png_bytep * read_png(png_structp png_ptr, png_infop info_ptr, at_input_opts_type * opts) { int row; png_color_16p original_bg; png_color_16 my_bg; png_read_info(png_ptr, info_ptr); png_set_strip_16(png_ptr); png_set_packing(png_ptr); if ((png_ptr->bit_depth < 8) || (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) || (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) png_set_expand(png_ptr); if (png_get_bKGD(png_ptr, info_ptr, &original_bg)) { /* Fill transparent region with ... */ my_bg.index = 0; if (opts && opts->background_color) { my_bg.red = 256 * opts->background_color->r; my_bg.green = 256 * opts->background_color->g; my_bg.blue = 256 * opts->background_color->b; my_bg.gray = 256* ((opts->background_color->r + opts->background_color->g + opts->background_color->b) / 3); } else /* else, use white */ my_bg.red = my_bg.green = my_bg.blue = my_bg.gray = 0xFFFF; png_set_background(png_ptr, &my_bg, PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); } else png_set_strip_alpha(png_ptr); png_read_update_info(png_ptr, info_ptr); info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr, info_ptr->height * sizeof(png_bytep)); #ifdef PNG_FREE_ME_SUPPORTED info_ptr->free_me |= PNG_FREE_ROWS; #endif for (row = 0; row < (int)info_ptr->height; row++) info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr)); png_read_image(png_ptr, info_ptr->row_pointers); info_ptr->valid |= PNG_INFO_IDAT; png_read_end(png_ptr, info_ptr); return png_get_rows(png_ptr, info_ptr); } autotrace-0.31.1/input-png.h0000644000076400007640000000214507551363230011354 /* input-png.h: import png files. Copyright (C) 2000 MenTaLguY This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ /* $Id: input-png.h,v 1.7 2002/10/05 19:38:25 masata-y Exp $ */ #ifndef INPUT_PNG_H #define INPUT_PNG_H #include "input.h" at_bitmap_type input_png_reader (at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data); #endif /* not INPUT_PNG_H */ autotrace-0.31.1/output-eps.c0000664000076400007640000001600207551363235011557 /* output-eps.c: utility routines for PostScript output. Copyright (C) 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "types.h" #include "spline.h" #include "color.h" #include "output-eps.h" #include "xstd.h" #include "autotrace.h" #include #include static at_string now (void); #define SIGN(x) ((x) > 0 ? 1 : (x) < 0 ? -1 : 0) #define ROUND(x) ((int) ((int) (x) + .5 * SIGN (x))) /* Output macros. */ /* This should be used for outputting a string S on a line by itself. */ #define OUT_LINE(s) \ fprintf (ps_file, "%s\n", s) /* These output their arguments, preceded by the indentation. */ #define OUT1(s, e) \ fprintf (ps_file, s, e) #define OUT2(s, e1, e2) \ fprintf (ps_file, s, e1, e2) #define OUT3(s, e1, e2, e3) \ fprintf (ps_file, s, e1, e2, e3) #define OUT4(s, e1, e2, e3, e4) \ fprintf (ps_file, s, e1, e2, e3, e4) #define OUT5(s, e1, e2, e3, e4, e5) \ fprintf (ps_file, s, e1, e2, e3, e4, e5) /* These macros just output their arguments. */ #define OUT_STRING(s) fprintf (ps_file, "%s", s) #define OUT_REAL(r) fprintf (ps_file, r == (ROUND (r = ROUND((at_real)6.0*r)/(at_real)6.0)) \ ? "%.0f " : "%.3f ", r) /* For a PostScript command with two real arguments, e.g., lineto. OP should be a constant string. */ #define OUT_COMMAND2(first, second, op) \ do \ { \ OUT_REAL (first); \ OUT_REAL (second); \ OUT_STRING (op "\n"); \ } \ while (0) /* For a PostScript command with six real arguments, e.g., curveto. Again, OP should be a constant string. */ #define OUT_COMMAND6(first, second, third, fourth, fifth, sixth, op) \ do \ { \ OUT_REAL (first); \ OUT_REAL (second); \ OUT_STRING (" "); \ OUT_REAL (third); \ OUT_REAL (fourth); \ OUT_STRING (" "); \ OUT_REAL (fifth); \ OUT_REAL (sixth); \ OUT_STRING (" " op " \n"); \ } \ while (0) /* This should be called before the others in this file. It opens the output file `OUTPUT_NAME.ps', and writes some preliminary boilerplate. */ static int output_eps_header(FILE* ps_file, at_string name, int llx, int lly, int urx, int ury) { at_string time; OUT_LINE ("%!PS-Adobe-3.0 EPSF-3.0"); OUT1 ("%%%%Creator: Adobe Illustrator by %s\n", at_version(true)); OUT1 ("%%%%Title: %s\n", name); OUT1 ("%%%%CreationDate: %s\n", time = now ()); OUT4 ("%%%%BoundingBox: %d %d %d %d\n", llx, lly, urx, ury); OUT_LINE ("%%DocumentData: Clean7Bit"); OUT_LINE ("%%EndComments"); free (time); /* Prolog to define Illustrator commands. * * The s and S commands are not used at the moment and could be * removed or commented out. * * Calling f in *U is not really the right thing to do, but since all * paths are simply filled currently, this is the easiest solution. */ OUT_LINE ("%%BeginProlog"); OUT_LINE ("/bd { bind def } bind def"); OUT_LINE ("/incompound false def"); OUT_LINE ("/m { moveto } bd"); OUT_LINE ("/l { lineto } bd"); OUT_LINE ("/c { curveto } bd"); OUT_LINE ("/F { incompound not {fill} if } bd"); OUT_LINE ("/f { closepath F } bd"); OUT_LINE ("/S { stroke } bd"); OUT_LINE ("/*u { /incompound true def } bd"); OUT_LINE ("/*U { /incompound false def f} bd"); OUT_LINE ("/k { setcmykcolor } bd"); /* must symbol k for CorelDraw 3/4 */ OUT_LINE ("/K { k } bd"); OUT_LINE ("%%EndProlog"); OUT_LINE ("%%BeginSetup"); /* needed for CorelDraw 3/4 */ OUT_LINE ("%%EndSetup"); /* needed for CorelDraw 3/4 */ return 0; } /* This outputs the PostScript code which produces the shape in SHAPE. */ static void out_splines (FILE * ps_file, spline_list_array_type shape) { unsigned this_list; spline_list_type list; color_type last_color = {0,0,0}; for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { unsigned this_spline; int c, m, y, k; spline_type first; list = SPLINE_LIST_ARRAY_ELT (shape, this_list); first = SPLINE_LIST_ELT (list, 0); if (this_list == 0 || !COLOR_EQUAL(list.color, last_color)) { if (this_list > 0) OUT_LINE("*U"); c = k = 255 - list.color.r; m = 255 - list.color.g; if (m < k) k = m; y = 255 - list.color.b; if (y < k) k = y; c -= k; m -= k; y -= k; /* symbol k is used for CorelDraw 3/4 compatibility */ OUT5 ("%.3f %.3f %.3f %.3f %s\n", (double) c/255.0, (double) m/255.0,(double) y/255.0, (double) k/255.0, (shape.centerline || list.open) ? "K" : "k"); OUT_LINE("*u"); last_color = list.color; } OUT_COMMAND2 (START_POINT (first).x, START_POINT (first).y, "m"); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list); this_spline++) { spline_type s = SPLINE_LIST_ELT (list, this_spline); if (SPLINE_DEGREE (s) == LINEARTYPE) OUT_COMMAND2 (END_POINT (s).x, END_POINT (s).y, "l"); else OUT_COMMAND6 (CONTROL1 (s).x, CONTROL1 (s).y, CONTROL2 (s).x, CONTROL2 (s).y, END_POINT (s).x, END_POINT (s).y, "c"); } if (SPLINE_LIST_ARRAY_LENGTH(shape) > 0) OUT_LINE ((shape.centerline || list.open) ? "S" : "f"); } if (SPLINE_LIST_ARRAY_LENGTH(shape) > 0) OUT_LINE("*U"); } int output_eps_writer(FILE* ps_file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { int result; result = output_eps_header(ps_file, name, llx, lly, urx, ury); if (result != 0) return result; out_splines(ps_file, shape); OUT_LINE ("%%Trailer"); OUT_LINE ("%%EOF"); return 0; } static at_string now (void) { at_string time_string; time_t t = time (0); XMALLOC (time_string, 26); /* not 25 ! */ strcpy (time_string, ctime (&t)); time_string[24] = 0; /* No newline. */ return time_string; } autotrace-0.31.1/output-eps.h0000664000076400007640000000223107551363235011563 /* output-eps.c: utility routines for PostScript output. Copyright (C) 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_EPS_H #define OUTPUT_EPS_H #include "output.h" int output_eps_writer (FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* not OUTPUT_EPS_H */ autotrace-0.31.1/output-er.c0000664000076400007640000001655007560006733011403 /* output-er.c: utility routines for Elastic Reality shape file output Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "types.h" #include "spline.h" #include "output-er.h" #include "xstd.h" #include #include static at_string now(void); #define NUM_CORRESP_POINTS 4 /* This should be called before the others in this file. It opens the output file and writes some preliminary boilerplate. */ static int output_er_header(FILE* er_file, at_string name, int llx, int lly, int urx, int ury) { at_string time; fprintf(er_file, "#Elastic Reality Shape File\n\n#Date: %s\n\n", time = now()); free(time); fprintf(er_file, "ImageSize = {\n\tWidth = %d\n\tHeight = %d\n}\n\n", urx - llx, ury - lly); return 0; } /* This outputs shape data and the point list for the shape in SHAPE. */ static void out_splines(FILE* er_file, spline_list_array_type shape, unsigned width, unsigned height, at_output_opts_type * opts) { unsigned this_list, corresp_pt; double x0, y0, x1, y1, x2, y2, corresp_length; for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH(shape); this_list++) { unsigned this_spline; spline_type prev; spline_list_type list = SPLINE_LIST_ARRAY_ELT(shape, this_list); unsigned length = SPLINE_LIST_LENGTH(list); unsigned out_length = (list.open || length == 1 ? length + 1 : length); fprintf(er_file, "Shape = {\n"); fprintf(er_file, "\t#Shape Number %d\n", this_list + 1); fprintf(er_file, "\tGroup = Default\n"); fprintf(er_file, "\tType = Source\n"); fprintf(er_file, "\tRoll = A\n"); fprintf(er_file, "\tOpaque = True\n"); fprintf(er_file, "\tLocked = False\n"); fprintf(er_file, "\tWarp = True\n"); fprintf(er_file, "\tCookieCut = True\n"); fprintf(er_file, "\tColorCorrect = True\n"); fprintf(er_file, "\tPrecision = 10\n"); fprintf(er_file, "\tClosed = %s\n", (list.open ? "False" : "True")); fprintf(er_file, "\tTween = Linear\n"); fprintf(er_file, "\tBPoints = %d\n", out_length); fprintf(er_file, "\tCPoints = %d\n", NUM_CORRESP_POINTS); fprintf(er_file, "\tFormKey = {\n"); fprintf(er_file, "\t\tFrame = 1\n"); fprintf(er_file, "\t\tPointList = {\n"); prev = PREV_SPLINE_LIST_ELT(list, 0); if (list.open || length == 1) SPLINE_DEGREE(prev) = (polynomial_degree) -1; for (this_spline = 0; this_spline < length; this_spline++) { spline_type s = SPLINE_LIST_ELT(list, this_spline); if (SPLINE_DEGREE(prev) == -1) { x0 = START_POINT(s).x; y0 = START_POINT(s).y; } else if (SPLINE_DEGREE(prev) == CUBICTYPE) { x0 = CONTROL2(prev).x; y0 = CONTROL2(prev).y; } else /* if (SPLINE_DEGREE(prev) == LINEARTYPE) */ { x0 = START_POINT(s).x; y0 = START_POINT(s).y; } x1 = START_POINT(s).x; y1 = START_POINT(s).y; if (SPLINE_DEGREE(s) == CUBICTYPE) { x2 = CONTROL1(s).x; y2 = CONTROL1(s).y; } else { x2 = START_POINT(s).x; y2 = START_POINT(s).y; } fprintf(er_file, "\t\t\t(%f, %f), (%f, %f), (%f, %f),\n", x0 / width, y0 / height, x1 / width, y1 / height, x2 / width, y2 / height); prev = s; } if (list.open || length == 1) { x0 = CONTROL2(prev).x; y0 = CONTROL2(prev).y; x2 = x1 = END_POINT(prev).x; y2 = y1 = END_POINT(prev).y; fprintf(er_file, "\t\t\t(%f, %f), (%f, %f), (%f, %f),\n", x0 / width, y0 / height, x1 / width, y1 / height, x2 / width, y2 / height); } /* Close PointList and enclosing FormKey. */ fprintf(er_file, "\t\t}\n\n\t}\n\n"); if (shape.centerline && shape.preserve_width) { at_real w = (at_real) 1.0 / (shape.width_weight_factor); fprintf(er_file, "\tWeightKey = {\n"); fprintf(er_file, "\t\tFrame = 1\n"); fprintf(er_file, "\t\tPointList = {\n"); prev = PREV_SPLINE_LIST_ELT(list, 0); if (list.open || length == 1) SPLINE_DEGREE(prev) = (polynomial_degree) -1; for (this_spline = 0; this_spline < length; this_spline++) { spline_type s = SPLINE_LIST_ELT(list, this_spline); if (SPLINE_DEGREE(prev) == -1) x0 = START_POINT(s).z; else if (SPLINE_DEGREE(prev) == CUBICTYPE) x0 = CONTROL2(prev).z; else /* if (SPLINE_DEGREE(prev) == LINEARTYPE) */ x0 = START_POINT(s).z; x1 = START_POINT(s).z; if (SPLINE_DEGREE(s) == CUBICTYPE) x2 = CONTROL1(s).z; else x2 = START_POINT(s).z; fprintf(er_file, "\t\t\t%g, %g, %g,\n", x0*w, x1*w, x2*w); prev = s; } if (list.open || length == 1) { x0 = CONTROL2(prev).z; x2 = x1 = END_POINT(prev).z; fprintf(er_file, "\t\t\t%g, %g, %g,\n", x0*w, x1*w, x2*w); } /* Close PointList and enclosing WeightKey. */ fprintf(er_file, "\t\t}\n\n\t}\n\n"); } fprintf(er_file, "\tCorrKey = {\n"); fprintf(er_file, "\t\tFrame = 1\n"); fprintf(er_file, "\t\tPointList = {\n"); fprintf(er_file, "\t\t\t0"); corresp_length = out_length - (list.open ? 1.0 : 2.0); for (corresp_pt = 1; corresp_pt < NUM_CORRESP_POINTS; corresp_pt++) { fprintf(er_file, ", %g", corresp_length * corresp_pt / (NUM_CORRESP_POINTS - (list.open ? 1.0 : 0.0))); } /* Close PointList and enclosing CorrKey. */ fprintf(er_file, "\n\t\t}\n\n\t}\n\n"); /* Close Shape. */ fprintf(er_file, "}\n\n"); } } int output_er_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { int result; unsigned width, height; result = output_er_header(file, name, llx, lly, urx, ury); if (result != 0) return result; width = urx - llx; height = ury - lly; out_splines(file, shape, width, height, opts); return 0; } static at_string now(void) { at_string time_string; time_t t = time (0); XMALLOC (time_string, 26); /* not 25 ! */ strcpy (time_string, ctime (&t)); time_string[24] = 0; /* No newline. */ return time_string; } autotrace-0.31.1/output-er.h0000644000076400007640000000217407551363261011405 /* output-er.h: utility routines for Elastic Reality shape file output Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef EROUT_H #define EROUT_H #include "output.h" int output_er_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif autotrace-0.31.1/output-fig.c0000664000076400007640000003441007551363235011540 /* output-fig.c - output autotrace splines in FIG 3.2 format Copyright (C) 1999, 2000, 2001 Ian MacPhedran This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "output-fig.h" #include "xstd.h" #include "color.h" #include "spline.h" /* use FIG_X and FIG_Y to convert from local units (pixels) to FIG ones */ /* assume 1 pixel is equal to 1/80 inches (old FIG unit) */ /* Offset by 300 units (1/4 inch) */ #define FIG_X(x) (int)((x * 15.0) + 300.0) #define FIG_Y(y) (int)(((ury - y) * 15.0) + 300.0) /* the basic colours */ #define FIG_BLACK 0 #define FIG_BLUE 1 #define FIG_GREEN 2 #define FIG_CYAN 3 #define FIG_RED 4 #define FIG_MAGENTA 5 #define FIG_YELLOW 6 #define FIG_WHITE 7 static at_real bezpnt(at_real, at_real, at_real, at_real, at_real); static void out_fig_splines(FILE *, spline_list_array_type, int, int, int, int, at_exception_type *); static int get_fig_colour(color_type, at_exception_type *); static void fig_col_init(void); /* colour information */ #define fig_col_hash(col_typ) ( ( (col_typ).r & 255 ) + ( (col_typ).g & 161 ) + ( (col_typ).b & 127 ) ) static struct { unsigned int colour; unsigned int alternate; } fig_hash[544]; static struct { unsigned char r,g,b; int alternate; } fig_colour_map[544]; static int LAST_FIG_COLOUR=32; #define MAX_FIG_COLOUR 543 /* Bounding Box data and routines */ static float glob_min_x, glob_max_x, glob_min_y, glob_max_y; static float loc_min_x, loc_max_x, loc_min_y, loc_max_y; static int glo_bbox_flag=0,loc_bbox_flag=0,fig_depth; static void fig_new_depth() { if (glo_bbox_flag == 0) { glob_max_y = loc_max_y ; glob_min_y = loc_min_y ; glob_max_y = loc_max_y ; glob_min_y = loc_min_y ; glob_max_x = loc_max_x ; glob_min_x = loc_min_x ; glo_bbox_flag = 1; } else { if ((loc_max_y <= glob_min_y) || (loc_min_y >= glob_max_y) || (loc_max_x <= glob_min_x) || (loc_min_x >= glob_max_x)) { /* outside global bounds, increase global box */ if (loc_max_y > glob_max_y) glob_max_y = loc_max_y ; if (loc_min_y < glob_min_y) glob_min_y = loc_min_y ; if (loc_max_x > glob_max_x) glob_max_x = loc_max_x ; if (loc_min_x < glob_min_x) glob_min_x = loc_min_x ; } else { /* inside global bounds, decrease depth and create new bounds */ glob_max_y = loc_max_y ; glob_min_y = loc_min_y ; glob_max_x = loc_max_x ; glob_min_x = loc_min_x ; if (fig_depth) fig_depth--; // don't let it get < 0 } } loc_bbox_flag = 0; } static void fig_addtobbox(float x, float y) { if (loc_bbox_flag == 0) { loc_max_y = y ; loc_min_y = y ; loc_max_x = x ; loc_min_x = x ; loc_bbox_flag = 1; } else { if (loc_max_y < y) loc_max_y = y ; if (loc_min_y > y) loc_min_y = y ; if (loc_max_x < x) loc_max_x = x ; if (loc_min_x > x) loc_min_x = x ; } } /* Convert Bezier Spline */ static at_real bezpnt(at_real t, at_real z1, at_real z2, at_real z3, at_real z4) { at_real temp, t1; /* Determine ordinate on Bezier curve at length "t" on curve */ if (t < (at_real) 0.0) { t = (at_real) 0.0; } if (t > (at_real) 1.0) { t = (at_real) 1.0; } t1 = ((at_real) 1.0 - t); temp = t1*t1*t1*z1 + (at_real)3.0*t*t1*t1*z2 + (at_real)3.0*t*t*t1*z3 + t*t*t*z4; return(temp); } static void out_fig_splines(FILE * file, spline_list_array_type shape, int llx, int lly, int urx, int ury, at_exception_type * exp) { unsigned this_list; /* int fig_colour, fig_depth, i; */ int fig_colour, fig_fill, fig_width, fig_subt, fig_spline_close, i; int *spline_colours; /* add an array of colours for splines (one for each group) create palette hash */ /* Need to create hash table for colours */ XMALLOC(spline_colours, (sizeof(int)*SPLINE_LIST_ARRAY_LENGTH(shape))); /* Preload the big 8 */ fig_col_init(); /* Load the colours from the splines */ for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { spline_list_type list = SPLINE_LIST_ARRAY_ELT (shape, this_list); color_type curr_color = (list.clockwise && shape.background_color != NULL) ? *(shape.background_color) : list.color; spline_colours[this_list] = get_fig_colour(curr_color, exp); } /* Output colours */ if (LAST_FIG_COLOUR > 32) { for (i=32; i 999) { fig_depth = 999; } for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { unsigned this_spline; spline_list_type list = SPLINE_LIST_ARRAY_ELT (shape, this_list); /* store the spline points in two arrays, control weights in another */ int *pointx, *pointy; at_real *contrl; int pointcount=0,is_spline=0,j; int maxlength=SPLINE_LIST_LENGTH (list) * 5 + 1; XMALLOC (pointx, maxlength * sizeof (int)); XMALLOC (pointy, maxlength * sizeof (int)); XMALLOC (contrl, maxlength * sizeof (at_real)); if (list.clockwise) { fig_colour = FIG_WHITE; } else { fig_colour = spline_colours[this_list]; } fig_spline_close = 5; for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list); this_spline++) { spline_type s = SPLINE_LIST_ELT (list, this_spline); if (pointcount == 0) { pointx[pointcount] = FIG_X(START_POINT(s).x); pointy[pointcount] = FIG_Y(START_POINT(s).y); contrl[pointcount] = (at_real) 0.0; fig_addtobbox(START_POINT(s).x,START_POINT(s).y); pointcount++; } /* Apparently START_POINT for one spline section is same as END_POINT for previous section - should at_really test for this */ if (SPLINE_DEGREE(s) == LINEARTYPE) { pointx[pointcount] = FIG_X(END_POINT(s).x); pointy[pointcount] = FIG_Y(END_POINT(s).y); contrl[pointcount] = (at_real) 0.0; fig_addtobbox(START_POINT(s).x,START_POINT(s).y); pointcount++; } else /* Assume Bezier like spline */ { /* Convert approximated bezier to interpolated X Spline */ at_real temp; for (temp = (at_real) 0.2; temp < (at_real) 0.9; temp += (at_real) 0.2) { pointx[pointcount] = FIG_X(bezpnt(temp,START_POINT(s).x,CONTROL1(s).x, CONTROL2(s).x,END_POINT(s).x)); pointy[pointcount] = FIG_Y(bezpnt(temp,START_POINT(s).y,CONTROL1(s).y, CONTROL2(s).y,END_POINT(s).y)); contrl[pointcount] = (at_real) -1.0; pointcount++; } pointx[pointcount] = FIG_X(END_POINT(s).x); pointy[pointcount] = FIG_Y(END_POINT(s).y); contrl[pointcount] = (at_real) 0.0; fig_addtobbox(START_POINT(s).x,START_POINT(s).y); fig_addtobbox(CONTROL1(s).x,CONTROL1(s).y); fig_addtobbox(CONTROL2(s).x,CONTROL2(s).y); fig_addtobbox(END_POINT(s).x,END_POINT(s).y); pointcount++; is_spline=1; } } if (shape.centerline) { fig_fill = -1; fig_width = 1; fig_spline_close = 4; } else { /* Use zero width lines - unit width is too thick */ fig_fill = 20; fig_width = 0; fig_spline_close = 5; } if (is_spline != 0) { fig_new_depth(); fprintf(file,"3 %d 0 %d %d %d %d 0 %d 0.00 0 0 0 %d\n", fig_spline_close, fig_width, fig_colour, fig_colour, fig_depth, fig_fill, pointcount); /* Print out points */ j = 0; for (i=0; i set fig number If fig number already used, go to next fig number (alternate) if alternate is 0, set next unused fig number */ static void fig_col_init(void) { int i; for (i=0;i<544;i++) { fig_hash[i].colour = 0; fig_colour_map[i].alternate = 0; } /* populate the first 8 primary colours */ /* Black */ fig_hash[0].colour = FIG_BLACK; fig_colour_map[FIG_BLACK].r = 0; fig_colour_map[FIG_BLACK].g = 0; fig_colour_map[FIG_BLACK].b = 0; /* White */ fig_hash[543].colour = FIG_WHITE; fig_colour_map[FIG_WHITE].r = 255; fig_colour_map[FIG_WHITE].g = 255; fig_colour_map[FIG_WHITE].b = 255; /* Red */ fig_hash[255].colour = FIG_RED; fig_colour_map[FIG_RED].r = 255; fig_colour_map[FIG_RED].g = 0; fig_colour_map[FIG_RED].b = 0; /* Green */ fig_hash[161].colour = FIG_GREEN; fig_colour_map[FIG_GREEN].r = 0; fig_colour_map[FIG_GREEN].g = 255; fig_colour_map[FIG_GREEN].b = 0; /* Blue */ fig_hash[127].colour = FIG_BLUE; fig_colour_map[FIG_BLUE].r = 0; fig_colour_map[FIG_BLUE].g = 0; fig_colour_map[FIG_BLUE].b = 255; /* Cyan */ fig_hash[198].colour = FIG_CYAN; fig_colour_map[FIG_CYAN].r = 0; fig_colour_map[FIG_CYAN].g = 255; fig_colour_map[FIG_CYAN].b = 255; /* Magenta */ fig_hash[382].colour = FIG_MAGENTA; fig_colour_map[FIG_MAGENTA].r = 255; fig_colour_map[FIG_MAGENTA].g = 0; fig_colour_map[FIG_MAGENTA].b = 255; /* Yellow */ fig_hash[416].colour = FIG_YELLOW; fig_colour_map[FIG_YELLOW].r = 255; fig_colour_map[FIG_YELLOW].g = 255; fig_colour_map[FIG_YELLOW].b = 0; } /* * Return the FIG colour index based on the RGB triplet. * If unknown, create a new colour index and return that. */ static int get_fig_colour(color_type this_colour, at_exception_type * exp) { int hash,i,this_ind; hash = fig_col_hash(this_colour); /* Special case: black _IS_ zero: */ if ((hash == 0) && (COLOR_EQUAL(fig_colour_map[0],this_colour))) {return(0);} if (fig_hash[hash].colour == 0) { fig_hash[hash].colour = LAST_FIG_COLOUR; fig_colour_map[LAST_FIG_COLOUR].r = this_colour.r; fig_colour_map[LAST_FIG_COLOUR].g = this_colour.g; fig_colour_map[LAST_FIG_COLOUR].b = this_colour.b; LAST_FIG_COLOUR++; if (LAST_FIG_COLOUR >= MAX_FIG_COLOUR) { LOG1("Output-Fig: too many colours: %d", LAST_FIG_COLOUR); at_exception_fatal(exp, "Output-Fig: too many colours"); return 0; } return(fig_hash[hash].colour); } else { i=0; this_ind = fig_hash[hash].colour; figcolloop: /* If colour match return current colour */ if (COLOR_EQUAL(fig_colour_map[this_ind],this_colour)) { return(this_ind); } /* If next colour zero - set it, return */ if (fig_colour_map[this_ind].alternate == 0) { fig_colour_map[this_ind].alternate = LAST_FIG_COLOUR; fig_colour_map[LAST_FIG_COLOUR].r = this_colour.r; fig_colour_map[LAST_FIG_COLOUR].g = this_colour.g; fig_colour_map[LAST_FIG_COLOUR].b = this_colour.b; LAST_FIG_COLOUR++; if (LAST_FIG_COLOUR >= MAX_FIG_COLOUR) { LOG1("Output-Fig: too many colours: %d", LAST_FIG_COLOUR); at_exception_fatal(exp, "Output-Fig: too many colours"); return 0; } return(fig_colour_map[this_ind].alternate); } /* Else get next colour */ this_ind = fig_colour_map[this_ind].alternate; /* Sanity check ... if colour too big - abort */ if (i++ > MAX_FIG_COLOUR) { LOG1("Output-Fig: too many colours (loop): %d", i); at_exception_fatal(exp, "Output-Fig: too many colours (loop)"); return 0; } /* Else loop top */ goto figcolloop; } } autotrace-0.31.1/output-fig.h0000664000076400007640000000223307551363235011543 /* output-fig.c - output autotrace splines in FIG 3.2 format Copyright (C) 1999, 2000, 2001 Ian MacPhedran This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_FIG_H #define OUTPUT_FIG_H #include "output.h" int output_fig_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* not OUTPUT_FIG_H */ autotrace-0.31.1/output-sk.c0000664000076400007640000000572307551363236011416 /* output-sk.c - output in sketch format Copyright (C) 1999, 2000, 2001 Bernhard Herzog This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "spline.h" #include "color.h" #include "output-sk.h" static void out_splines (FILE * file, spline_list_array_type shape) { unsigned this_list; spline_list_type list; color_type last_color = {0,0,0}; for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { unsigned this_spline; spline_type first; list = SPLINE_LIST_ARRAY_ELT (shape, this_list); first = SPLINE_LIST_ELT (list, 0); if (this_list == 0 || !COLOR_EQUAL(list.color, last_color)) { if (this_list > 0 && !shape.centerline) fputs("bC()\n", file); fprintf(file, (shape.centerline || list.open) ? "lp((%g,%g,%g))\n" : "fp((%g,%g,%g))\n", list.color.r / 255.0, list.color.g / 255.0, list.color.b / 255.0); fputs((shape.centerline || list.open) ? "fe()\n" : "le()\n", file); /* no outline */ last_color = list.color; fputs("b()\n", file); /* the beginning of a bezier object */ } fprintf(file, "bs(%g,%g,0)\n", START_POINT(first).x, START_POINT(first).y); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list); this_spline++) { spline_type s = SPLINE_LIST_ELT (list, this_spline); if (SPLINE_DEGREE(s) == LINEARTYPE) fprintf(file, "bs(%g,%g,0)\n", END_POINT(s).x, END_POINT(s).y); else fprintf(file, "bc(%g,%g,%g,%g,%g,%g,0)\n", CONTROL1(s).x, CONTROL1(s).y, CONTROL2(s).x, CONTROL2(s).y, END_POINT(s).x, END_POINT(s).y); } } if (SPLINE_LIST_ARRAY_LENGTH(shape) > 0 && !shape.centerline) fputs("bC()\n", file); } int output_sk_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { fputs("##Sketch 1 0\n", file); fputs("document()\n", file); fputs("layer('Layer 1',1,1,0,0)\n", file); fputs("guess_cont()\n", file); out_splines(file, shape); return 0; } autotrace-0.31.1/output-sk.h0000664000076400007640000000220007551363236011406 /* output-sk.c - output in sketch format Copyright (C) 1999, 2000, 2001 Bernhard Herzog This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_SK_H #define OUTPUT_SK_H #include "output.h" int output_sk_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* not OUTPUT_SK_H */ autotrace-0.31.1/output-svg.c0000664000076400007640000000624607551363236011601 /* output-svg.h - output in SVG format Copyright (C) 1999, 2000, 2001 Bernhard Herzog This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "spline.h" #include "color.h" #include "output-svg.h" static void out_splines (FILE * file, spline_list_array_type shape, int height) { unsigned this_list; spline_list_type list; color_type last_color = {0,0,0}; for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { unsigned this_spline; spline_type first; list = SPLINE_LIST_ARRAY_ELT (shape, this_list); first = SPLINE_LIST_ELT (list, 0); if (this_list == 0 || !COLOR_EQUAL(list.color, last_color)) { if (this_list > 0) { if (!(shape.centerline || list.open)) fputs("z", file); fputs("\"/>\n", file); } fprintf(file, " 0) fputs("\"/>\n", file); } int output_svg_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { int width = urx - llx; int height = ury - lly; fputs("\n", file); fprintf(file, "\n", width, height); out_splines(file, shape, height); fputs("\n", file); return 0; } autotrace-0.31.1/output-svg.h0000664000076400007640000000220707551363236011577 /* output-svg.h - output in SVG format Copyright (C) 1999, 2000, 2001 Bernhard Herzog This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_SVG_H #define OUTPUT_SVG_H #include "output.h" int output_svg_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* not OUTPUT_SVG_H */ autotrace-0.31.1/output-p2e.c0000664000076400007640000001762007551363235011465 /* output-p2e.c: utility routines for pstoedit intermediate output Copyright (C) 2000-2001 Wolfgang Glunz, Martin Weber This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ /* Initial author: Wolfgang Glunz - wglunz@pstoedit.net use the generated file to run "pstoedit -bo -f format input output" Adapted to pstoedit 3.30 by Wolfgang Glunz. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "types.h" #include "spline.h" #include "color.h" #include "output-p2e.h" #define SIGN(x) ((x) > 0 ? 1 : (x) < 0 ? -1 : 0) #define ROUND(x) ((int) ((int) (x) + .5 * SIGN (x))) /* Output macros. */ /* This should be used for outputting a string S on a line by itself. */ #define OUT_LINE(l) \ fprintf (ps_file, "%s\n", l) /* These output their arguments, preceded by the indentation. */ #define OUT1(s, e) \ fprintf (ps_file, s, e) #ifdef withrgbcolor #define OUT3(s, e1, e2, e3) fprintf (ps_file, s, e1, e2, e3) #else #define OUT5(s, e1, e2, e3, e4, e5) fprintf (ps_file, s, e1, e2, e3, e4, e5) #endif #define OUT4(s, e1, e2, e3, e4) \ fprintf (ps_file, s, e1, e2, e3, e4) /* These macros just output their arguments. */ #define OUT_STRING(st) fprintf (ps_file, "%s", st) #define OUT_REAL(r) fprintf (ps_file, \ r == ROUND (r) ? "%.0f " : "%.3f ", r) /* For a PostScript command with two real arguments, e.g., lineto. OP should be a constant string. */ #define OUT_COMMAND2(first, second, op) \ do \ { \ OUT_STRING (" "); \ OUT_REAL (first); \ OUT_REAL (second); \ OUT_STRING (op "\n"); \ } \ while (0) /* For a PostScript command with six real arguments, e.g., curveto. Again, OP should be a constant string. */ #define OUT_COMMAND6(first, second, third, fourth, fifth, sixth, op) \ do \ { \ OUT_STRING (" "); \ OUT_REAL (first); \ OUT_REAL (second); \ OUT_STRING (" "); \ OUT_REAL (third); \ OUT_REAL (fourth); \ OUT_STRING (" "); \ OUT_REAL (fifth); \ OUT_REAL (sixth); \ OUT_STRING (" " op "\n"); \ } \ while (0) /* This should be called before the others in this file. It opens the output file `OUTPUT_NAME.ps', and writes some preliminary boilerplate. */ static int output_p2e_header(FILE* ps_file, at_string name, int llx, int lly, int urx, int ury, spline_list_array_type shape) { unsigned this_list, with_curves = 1; for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { unsigned this_spline; spline_list_type list = SPLINE_LIST_ARRAY_ELT (shape, this_list); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list); this_spline++) { spline_type s = SPLINE_LIST_ELT (list, this_spline); if (SPLINE_DEGREE (s) != LINEARTYPE) { with_curves = 0; this_list = SPLINE_LIST_ARRAY_LENGTH (shape); break; } } } OUT_LINE ("%!PS-Adobe-3.0"); OUT1 ("%%%%Title: flattened PostScript generated by autotrace: %s\n",name); OUT_LINE ("%%Creator: pstoedit"); OUT_LINE ("%%BoundingBox: (atend)"); OUT_LINE ("%%Pages: (atend)"); OUT_LINE ("%%EndComments"); OUT_LINE ("%%BeginProlog"); OUT_LINE ("/setPageSize { pop pop } def"); OUT_LINE ("/ntranslate { neg exch neg exch translate } def"); OUT_LINE ("/setshowparams { pop pop pop} def"); OUT_LINE ("/awidthshowhex { dup /ASCIIHexDecode filter exch length 2 div cvi string readstring pop awidthshow } def"); OUT_LINE ("/backendconstraints { pop pop } def"); OUT_LINE ("/pstoedit.newfont { 80 string cvs findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding ISOLatin1Encoding def dup 80 string cvs /FontName exch def currentdict end definefont pop } def"); OUT_LINE ("/imagestring 1 string def"); OUT_LINE ("%%EndProlog"); OUT_LINE ("%%BeginSetup"); OUT_LINE ("% textastext doflatten backendconstraints "); OUT1 ("%d 0 backendconstraints\n", with_curves); OUT_LINE ("%%EndSetup"); return 0; } /* This outputs the PostScript code which produces the shape in SHAPE. */ static void out_splines (FILE * ps_file, spline_list_array_type shape) { unsigned this_list; unsigned int pathnr = 1; spline_list_type list; color_type last_color = {0,0,0}; OUT_LINE (" 612 792 setPageSize"); OUT_LINE (" 0 setlinecap"); OUT_LINE (" 10.0 setmiterlimit"); OUT_LINE (" 0 setlinejoin"); OUT_LINE (" [ ] 0.0 setdash"); OUT_LINE (" 1.0 setlinewidth"); for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { unsigned this_spline; spline_type first; list = SPLINE_LIST_ARRAY_ELT (shape, this_list); first = SPLINE_LIST_ELT (list, 0); if (this_list == 0 || !COLOR_EQUAL(list.color, last_color)) { int c, m, y, k; OUT_LINE ((shape.centerline || list.open) ? "stroke" : "fill"); OUT1("\n\n%% %d pathnumber\n",pathnr); OUT_LINE ((shape.centerline || list.open) ? "% strokedpath" : "% filledpath"); pathnr++; #ifdef withrgbcolor // in the long term this can be removed. OUT3 ("%.3f %.3f %.3f setrgbcolor\n", (real)list.color.r/255.0, (real)list.color.g/255.0, (real)list.color.b/255.0); #else c = k = 255 - list.color.r; m = 255 - list.color.g; if (m < k) k = m; y = 255 - list.color.b; if (y < k) k = y; c -= k; m -= k; y -= k; OUT5("%.3f %.3f %.3f %.3f %s\n", (double) c/255.0, (double) m/255.0,(double) y/255.0, (double) k/255.0, "setcmykcolor"); #endif last_color = list.color; } OUT_LINE ("newpath"); OUT_COMMAND2 (START_POINT (first).x, START_POINT (first).y, "moveto"); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list); this_spline++) { spline_type s = SPLINE_LIST_ELT (list, this_spline); if (SPLINE_DEGREE (s) == LINEARTYPE) OUT_COMMAND2 (END_POINT (s).x, END_POINT (s).y, "lineto"); else OUT_COMMAND6 (CONTROL1 (s).x, CONTROL1 (s).y, CONTROL2 (s).x, CONTROL2 (s).y, END_POINT (s).x, END_POINT (s).y, "curveto"); } if (!list.open) OUT_LINE ("closepath"); } if (SPLINE_LIST_ARRAY_LENGTH(shape) > 0) OUT_LINE ((shape.centerline || list.open) ? "stroke" : "fill"); } int output_p2e_writer(FILE* ps_file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { int result; result = output_p2e_header(ps_file, name, llx, lly, urx, ury, shape); if (result != 0) return result; out_splines(ps_file, shape); OUT_LINE ("showpage"); OUT4 ("%%%%BoundingBox: %d %d %d %d\n", llx, lly, urx, ury); OUT_LINE ("%%Page: 1 1"); OUT_LINE ("% normal end reached by pstoedit.pro"); OUT_LINE ("%%Trailer"); OUT_LINE ("%%Pages: 1"); OUT_LINE ("%%EOF"); return 0; } autotrace-0.31.1/output-p2e.h0000664000076400007640000000226007551363236011465 /* output-p2e.c: utility routines for pstoedit intermediate output Copyright (C) 2000-2001 Wolfgang Glunz, Martin Weber This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_P2E_H #define OUTPUT_P2E_H #include "output.h" int output_p2e_writer (FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* not OUTPUT_P2E_H */ autotrace-0.31.1/output-emf.c0000664000076400007640000004750507562261172011552 /* output-emf.c --- output in Enhanced Metafile format Copyright (C) 2000, 2001 Enrico Persiani This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ /* ** Notes: ** ** Since EMF files are binary files, their persistent ** format have to deal with endianess problems */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include #include #include "spline.h" #include "xstd.h" /* EMF record-number definitions */ #define ENMT_HEADER 1 #define ENMT_EOF 14 #define ENMT_POLYLINETO 6 #define ENMT_MOVETO 27 #define ENMT_POLYBEZIERTO 5 #define ENMT_BEGINPATH 59 #define ENMT_ENDPATH 60 #define ENMT_FILLPATH 62 #define ENMT_CREATEPEN 38 #define ENMT_CREATEBRUSHINDIRECT 39 #define ENMT_SELECTOBJECT 37 #define ENMT_SETWORLDTRANSFORM 35 #define ENMT_SETPOLYFILLMODE 19 #define ENMT_STROKEPATH 64 #define ENMT_LINETO 54 #define ENMT_POLYBEZIERTO16 88 #define STOCK_NULL_PEN 0x80000008 #define FM_ALTERNATE 1 #define WDEVPIXEL 1280 #define HDEVPIXEL 1024 #define WDEVMLMTR 320 #define HDEVMLMTR 240 #define SCALE (at_real) 1.0 #define MAKE_COLREF(r,g,b) (((r) & 0x0FF) | (((g) & 0x0FF) << 8) | (((b) & 0x0FF) << 16)) #define MK_PEN(n) ((n) * 2 + 1) #define MK_BRUSH(n) ((n) * 2 + 2) #define X_FLOAT_TO_UI32(num) ((UI32)(num * SCALE)) #define X_FLOAT_TO_UI16(num) ((UI16)(num * SCALE)) #define Y_FLOAT_TO_UI32(num) ((UI32)(y_offset - num * SCALE)) #define Y_FLOAT_TO_UI16(num) ((UI16)(y_offset - num * SCALE)) /* maybe these definitions be put into types.h with some ifdefs ... */ typedef unsigned long int UI32; typedef unsigned short int UI16; typedef unsigned char UI8; /* color list type */ typedef struct EMFColorListType { UI32 colref; struct EMFColorListType *next; } EMFColorList; /* Emf stats needed for outputting EHNMETAHEADER*/ typedef struct { int ncolors; int nrecords; int filesize; } EMFStats; /* globals */ static EMFColorList *color_list = NULL; /* Color list */ static UI32 *color_table = NULL; /* Color table */ static float y_offset; /* color list & table functions */ static int SearchColor(EMFColorList *head, UI32 colref) { while(head != NULL) { if(head->colref == colref) return 1; head = head->next; } return 0; } static void AddColor(EMFColorList **head, UI32 colref) { EMFColorList *temp; XMALLOC(temp, sizeof(EMFColorList)); temp->colref = colref; temp->next = *head; *head = temp; } static void ColorListToColorTable(EMFColorList **head, UI32 **table, int len) { EMFColorList *temp; int i = 0; XMALLOC(*table, sizeof(UI32) * len); while(*head != NULL) { temp = *head; *head = (*head)->next; (*table)[i] = temp->colref; i++; free(temp); } } static int ColorLookUp(UI32 colref, UI32 *table, int len) { int i; for(i=0; i> 8) & 0x0FF); count += fwrite(&outch, 1, 1, fdes); outch = (UI8) ((data >> 16) & 0x0FF); count += fwrite(&outch, 1, 1, fdes); outch = (UI8) ((data >> 24) & 0x0FF); count += fwrite(&outch, 1, 1, fdes); return (count == sizeof(UI32)) ? true : false; } static at_bool write16(FILE *fdes, UI16 data) { size_t count = 0; UI8 outch; outch = (UI8) (data & 0x0FF); count += fwrite(&outch, 1, 1, fdes); outch = (UI8) ((data >> 8) & 0x0FF); count += fwrite(&outch, 1, 1, fdes); return (count == sizeof(UI16)) ? true : false; } /* EMF record-type function definitions */ static int WriteMoveTo(FILE* fdes, at_real_coord *pt) { int recsize = sizeof(UI32) * 4; if(fdes != NULL) { write32(fdes, ENMT_MOVETO); write32(fdes, (UI32) recsize); write32(fdes, (UI32) X_FLOAT_TO_UI32(pt->x)); write32(fdes, (UI32) Y_FLOAT_TO_UI32(pt->y)); } return recsize; } static int WriteLineTo(FILE* fdes, spline_type *spl) { int recsize = sizeof(UI32) * 4; if(fdes != NULL) { write32(fdes, ENMT_LINETO); write32(fdes, (UI32) recsize); write32(fdes, (UI32) X_FLOAT_TO_UI32(END_POINT(*spl).x)); write32(fdes, (UI32) Y_FLOAT_TO_UI32(END_POINT(*spl).y)); } return recsize; } /* CorelDraw 9 can't handle PolyLineTo nor PolyLineTo16, so we do not use this function but divide it to single lines instead int WritePolyLineTo(FILE* fdes, spline_type *spl, int nlines) { int i; int recsize = sizeof(UI32) * (7 + nlines * 1); if(fdes != NULL) { write32(fdes, ENMT_POLYLINETO); write32(fdes, (UI32) recsize); write32(fdes, (UI32) 0x0); write32(fdes, (UI32) 0x0); write32(fdes, (UI32) 0xFFFFFFFF); write32(fdes, (UI32) 0xFFFFFFFF); write32(fdes, (UI32) nlines); for(i=0; i=SPLINE_LIST_LENGTH(curr_list)) break; curr_spline = SPLINE_LIST_ELT(curr_list, j); } switch((polynomial_degree)last_degree) { case LINEARTYPE: /* emf stats :: PolyLineTo */ nrecords += nlines; filesize += MyWritePolyLineTo(NULL, NULL, nlines); break; default: /* emf stats :: PolyBezierTo */ nrecords++; filesize += WritePolyBezierTo16(NULL, NULL, nlines); break; } } } /* emf stats :: CreateSolidPen & CreateSolidBrush*/ nrecords += ncolors * 2; filesize += (WriteCreateSolidPen(NULL, 0, 0) + WriteCreateSolidBrush(NULL, 0, 0)) * ncolors; /* emf stats :: SelectObject */ nrecords += ncolorchng * 2; filesize += WriteSelectObject(NULL, 0) * ncolorchng * 2; /* emf stats :: header + footer */ nrecords += 2; filesize += WriteEndOfMetafile(NULL) + WriteHeader(NULL, name, 0, 0, 0, 0, 0); /* emf stats :: SetPolyFillMode */ nrecords++; filesize += WriteSetPolyFillMode(NULL); stats->ncolors = ncolors; stats->nrecords = nrecords; stats->filesize = filesize; /* convert the color list into a color table */ ColorListToColorTable(&color_list, &color_table, ncolors); } /* EMF output */ static void OutputEmf(FILE* fdes, EMFStats *stats, at_string name, int width, int height, spline_list_array_type shape) { unsigned int i, j; int color_index; UI32 last_color = 0xFFFFFFFF, curr_color; spline_list_type curr_list; spline_type curr_spline; int last_degree; int nlines; /* output EMF header */ WriteHeader(fdes, name, width, height, stats->filesize, stats->nrecords, (stats->ncolors * 2) +1); y_offset = SCALE * height; /* output pens & brushes */ for(i=0; i<(unsigned int) stats->ncolors; i++) { WriteCreateSolidPen(fdes, MK_PEN(i), color_table[i]); WriteCreateSolidBrush(fdes, MK_BRUSH(i), color_table[i]); } /* output fill mode */ WriteSetPolyFillMode(fdes); /* visit each spline-list */ for(i=0; i 0) { /* output EndPath */ WriteEndPath(fdes); if (shape.centerline) /* output StrokePath */ WriteStrokePath(fdes); else /* output StrokePath */ WriteFillPath(fdes); } /* output a BeginPath for current shape */ WriteBeginPath(fdes); color_index = ColorLookUp(curr_color, color_table, stats->ncolors); if (shape.centerline) WriteSelectObject(fdes, MK_PEN(color_index)); else WriteSelectObject(fdes, STOCK_NULL_PEN); WriteSelectObject(fdes, MK_BRUSH(color_index)); last_color = curr_color; } /* output MoveTo first point */ curr_spline = SPLINE_LIST_ELT(curr_list, 0); WriteMoveTo(fdes, &(START_POINT(curr_spline))); /* visit each spline */ j = 0; /* the outer loop iterates through spline groups of the same degree */ while (j=SPLINE_LIST_LENGTH(curr_list)) break; curr_spline = SPLINE_LIST_ELT(curr_list, j); } switch((polynomial_degree)last_degree) { case LINEARTYPE: /* output PolyLineTo */ MyWritePolyLineTo(fdes, &(SPLINE_LIST_ELT(curr_list, j - nlines)), nlines); break; default: /* output PolyBezierTo */ WritePolyBezierTo16(fdes, &(SPLINE_LIST_ELT(curr_list, j - nlines)), nlines); break; } } } if (SPLINE_LIST_ARRAY_LENGTH(shape) > 0) { /* output EndPath */ WriteEndPath(fdes); if (shape.centerline) /* output StrokePath */ WriteStrokePath(fdes); else /* output StrokePath */ WriteFillPath(fdes); } /* output EndOfMetafile */ WriteEndOfMetafile(fdes); /* delete color table */ free((void *)color_table); } int output_emf_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape) { EMFStats stats; #ifdef _WINDOWS if(file == stdout) { fprintf(stderr, "This driver couldn't write to stdout!\n"); return -1; } #endif /* Get EMF stats */ GetEmfStats(&stats, name, shape); /* Output EMF */ OutputEmf(file, &stats, name, urx, ury, shape); return 0; } autotrace-0.31.1/output-emf.h0000664000076400007640000000222207551363235011543 /* output-emf.h --- output in Enhanced Metafile format Copyright (C) 2000, 2001 Enrico Persiani This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef __OUTPUT_EMF_H #define __OUTPUT_EMF_H #include "output.h" int output_emf_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* __OUTPUT_EMF_H */ autotrace-0.31.1/output-dxf.c0000664000076400007640000006544607562770647011604 /* output-dxf.c: utility routines for DXF output. Copyright (C) 1999, 2000, 2001 Dietmar Kovar This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ /* mail comments and suggestions to kovar@t-online.de */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "types.h" #include "spline.h" #include "color.h" #include "output-dxf.h" #include "xstd.h" #include "autotrace.h" #include #include #include #define SIGN(x) ((x) > 0 ? 1 : (x) < 0 ? -1 : 0) #define ROUND(x) ((int) ((int) (x) + .5 * SIGN (x))) /* Output macros. */ /* This should be used for outputting a string S on a line by itself. */ #define OUT_LINE(s) \ fprintf (dxf_file, "%s\n", s) /* These output their arguments, preceded by the indentation. */ #define OUT1(s, e) \ fprintf (dxf_file, s, e) #define color_check false /************************************************************************************** Definitions for spline to line transformation **************************************************************************************/ typedef enum { NATURAL, TANGENT, PERIODIC, CYCLIC, ANTICYCLIC } SPLINE_END_TYPE; #define MAX_VERTICES 10000 #define RESOLUTION 10000 /* asume no pixels bigger than 1000000.0 */ #define RADIAN 57.295779513082 typedef struct xypnt_t { int xp, yp; } xypnt; typedef struct xypnt_point_t { xypnt point; struct xypnt_point_t *next_point; } xypnt_point_rec; typedef struct xypnt_head_t { xypnt_point_rec *first_point, *last_point, *current_point; struct xypnt_head_t *next_head; } xypnt_head_rec; typedef struct Colors_t { int red, green, blue; } Colors; /* RGB to layer transformation table follows */ #define MAX_COLORS 255 struct Colors_t dxftable[MAX_COLORS] = { /* 1 */ {255, 0, 0}, /* 2 */ {255, 255, 0}, /* 3 */ { 0, 255, 0}, /* 4 */ { 0, 255, 255}, /* 5 */ { 0, 0, 255}, /* 6 */ {255, 0, 255}, /* 7 */ {255, 255, 255}, /* 8 */ {255, 255, 255}, /* 9 */ {255, 255, 255}, /* 10 */ {255, 9, 0}, /* 11 */ {255, 128, 128}, /* 12 */ {166, 0, 0}, /* 13 */ {166, 83, 83}, /* 14 */ {128, 0, 0}, /* 15 */ {128, 64, 64}, /* 16 */ { 77, 0, 0}, /* 17 */ { 77, 38, 38}, /* 18 */ { 38, 0, 0}, /* 19 */ { 38, 19, 19}, /* 20 */ {255, 64, 0}, /* 21 */ {255, 160, 128}, /* 22 */ {166, 42, 0}, /* 23 */ {166, 104, 83}, /* 24 */ {128, 32, 0}, /* 25 */ {128, 80, 64}, /* 26 */ { 77, 19, 0}, /* 27 */ { 77, 48, 38}, /* 28 */ { 38, 10, 0}, /* 29 */ { 38, 24, 19}, /* 30 */ {256, 128, 0}, /* 31 */ {256, 192, 0}, /* 32 */ {166, 83, 0}, /* 33 */ {166, 125, 83}, /* 34 */ {128, 64, 0}, /* 35 */ {128, 96, 64}, /* 36 */ { 77, 38, 0}, /* 37 */ { 77, 58, 38}, /* 38 */ { 38, 19, 0}, /* 39 */ { 38, 29, 19}, /* 40 */ {255, 192, 0}, /* 41 */ {255, 224, 128}, /* 42 */ {166, 125, 0}, /* 43 */ {166, 146, 83}, /* 44 */ {128, 96, 0}, /* 45 */ {128, 112, 64}, /* 46 */ { 77, 58, 0}, /* 47 */ { 77, 67, 38}, /* 48 */ { 38, 29, 0}, /* 49 */ { 38, 34, 19}, /* 50 */ {255, 255, 0}, /* 51 */ {255, 255, 128}, /* 52 */ {166, 166, 0}, /* 53 */ {166, 166, 83}, /* 54 */ {128, 128, 0}, /* 55 */ {128, 128, 64}, /* 56 */ { 77, 77, 0}, /* 57 */ { 77, 77, 38}, /* 58 */ { 38, 38, 0}, /* 59 */ { 38, 38, 19}, /* 60 */ {192, 255, 0}, /* 61 */ {224, 255, 128}, /* 62 */ {125, 166, 0}, /* 63 */ {146, 166, 83}, /* 64 */ { 96, 128, 0}, /* 65 */ {112, 128, 64}, /* 66 */ { 58, 77, 0}, /* 67 */ { 67, 77, 38}, /* 68 */ { 29, 38, 0}, /* 69 */ { 34, 38, 19}, /* 70 */ {128, 255, 0}, /* 71 */ {192, 255, 128}, /* 72 */ { 83, 166, 0}, /* 73 */ {125, 166, 83}, /* 74 */ { 64, 128, 0}, /* 75 */ { 96, 128, 64}, /* 76 */ { 38, 77, 0}, /* 77 */ { 58, 77, 38}, /* 78 */ { 19, 38, 0}, /* 79 */ { 29, 38, 19}, /* 80 */ { 64, 255, 0}, /* 81 */ {160, 255, 128}, /* 82 */ { 42, 160, 0}, /* 83 */ {104, 160, 80}, /* 84 */ { 32, 128, 0}, /* 85 */ { 80, 128, 64}, /* 86 */ { 19, 77, 0}, /* 87 */ { 48, 77, 38}, /* 88 */ { 10, 38, 0}, /* 89 */ { 24, 38, 19}, /* 90 */ { 0, 255, 0}, /* 91 */ {128, 255, 128}, /* 92 */ { 0, 166, 0}, /* 93 */ { 83, 166, 83}, /* 94 */ { 0, 128, 0}, /* 95 */ { 64, 128, 64}, /* 96 */ { 0, 77, 0}, /* 97 */ { 38, 77, 38}, /* 98 */ { 0, 38, 0}, /* 99 */ { 19, 38, 19}, /* 100 */ { 0, 255, 64}, /* 101 */ {128, 255, 160}, /* 102 */ { 0, 166, 42}, /* 103 */ { 83, 166, 118}, /* 104 */ { 0, 128, 32}, /* 105 */ { 64, 128, 80}, /* 106 */ { 0, 77, 19}, /* 107 */ { 38, 77, 48}, /* 108 */ { 0, 38, 10}, /* 109 */ { 19, 38, 24}, /* 110 */ { 0, 255, 128}, /* 111 */ {128, 255, 192}, /* 112 */ { 0, 166, 83}, /* 113 */ { 83, 166, 125}, /* 114 */ { 0, 128, 64}, /* 115 */ { 64, 128, 96}, /* 116 */ { 0, 77, 38}, /* 117 */ { 38, 77, 58}, /* 118 */ { 0, 38, 19}, /* 119 */ { 19, 38, 29}, /* 120 */ { 0, 255, 192}, /* 121 */ {128, 255, 224}, /* 122 */ { 0, 166, 125}, /* 123 */ { 83, 166, 146}, /* 124 */ { 0, 128, 96}, /* 125 */ { 64, 128, 112}, /* 125 */ { 0, 77, 58}, /* 127 */ { 38, 77, 67}, /* 128 */ { 0, 38, 29}, /* 129 */ { 19, 38, 34}, /* 130 */ { 0, 255, 255}, /* 131 */ {128, 255, 255}, /* 132 */ { 0, 166, 166}, /* 133 */ { 83, 166, 166}, /* 134 */ { 0, 128, 128}, /* 135 */ { 64, 128, 128}, /* 136 */ { 0, 77, 77}, /* 137 */ { 38, 77, 77}, /* 138 */ { 0, 38, 38}, /* 139 */ { 19, 38, 38}, /* 140 */ { 0, 192, 255}, /* 141 */ {128, 224, 255}, /* 142 */ { 0, 125, 166}, /* 143 */ { 83, 146, 166}, /* 144 */ { 0, 96, 128}, /* 145 */ { 64, 112, 128}, /* 146 */ { 0, 58, 77}, /* 147 */ { 38, 67, 77}, /* 148 */ { 0, 29, 38}, /* 149 */ { 19, 34, 38}, /* 150 */ { 0, 128, 255}, /* 151 */ {128, 192, 255}, /* 152 */ { 0, 83, 166}, /* 153 */ { 83, 125, 166}, /* 154 */ { 0, 64, 128}, /* 155 */ { 64, 96, 128}, /* 156 */ { 0, 38, 77}, /* 157 */ { 38, 58, 77}, /* 158 */ { 0, 19, 38}, /* 159 */ { 19, 29, 38}, /* 160 */ { 0, 64, 255}, /* 161 */ {128, 160, 255}, /* 162 */ { 0, 42, 166}, /* 163 */ { 83, 104, 166}, /* 164 */ { 0, 32, 128}, /* 165 */ { 64, 80, 128}, /* 166 */ { 0, 19, 77}, /* 167 */ { 38, 48, 77}, /* 168 */ { 0, 10, 38}, /* 169 */ { 19, 24, 38}, /* 170 */ { 0, 0, 255}, /* 171 */ {128, 128, 255}, /* 172 */ { 0, 0, 166}, /* 173 */ { 83, 83, 166}, /* 174 */ { 0, 0, 128}, /* 175 */ { 64, 64, 128}, /* 176 */ { 0, 0, 77}, /* 177 */ { 38, 38, 77}, /* 178 */ { 0, 0, 38}, /* 179 */ { 19, 19, 38}, /* 180 */ { 64, 0, 255}, /* 181 */ {160, 128, 255}, /* 182 */ { 42, 0, 166}, /* 183 */ {104, 83, 166}, /* 184 */ { 32, 0, 128}, /* 185 */ { 80, 64, 128}, /* 186 */ { 19, 0, 77}, /* 187 */ { 48, 38, 77}, /* 188 */ { 10, 0, 38}, /* 189 */ { 24, 19, 38}, /* 190 */ {128, 0, 255}, /* 191 */ {192, 128, 255}, /* 192 */ { 83, 0, 166}, /* 193 */ {125, 83, 166}, /* 194 */ { 64, 0, 128}, /* 195 */ { 96, 64, 128}, /* 196 */ { 38, 0, 77}, /* 197 */ { 58, 38, 77}, /* 198 */ { 19, 0, 38}, /* 199 */ { 29, 19, 38}, /* 200 */ {192, 0, 255}, /* 201 */ {224, 128, 255}, /* 202 */ {125, 0, 166}, /* 203 */ {146, 83, 166}, /* 204 */ { 96, 0, 128}, /* 205 */ {112, 64, 128}, /* 206 */ { 58, 0, 77}, /* 207 */ { 67, 38, 77}, /* 208 */ { 29, 0, 38}, /* 209 */ { 34, 19, 38}, /* 210 */ {255, 0, 255}, /* 211 */ {255, 128, 255}, /* 212 */ {166, 0, 166}, /* 213 */ {166, 83, 166}, /* 214 */ {128, 0, 128}, /* 215 */ {128, 64, 128}, /* 216 */ { 77, 0, 77}, /* 217 */ { 77, 38, 77}, /* 218 */ { 38, 0, 38}, /* 219 */ { 38, 19, 38}, /* 220 */ {255, 0, 192}, /* 221 */ {255, 128, 224}, /* 222 */ {166, 0, 125}, /* 223 */ {166, 83, 146}, /* 224 */ {128, 0, 96}, /* 225 */ {128, 64, 112}, /* 226 */ { 77, 0, 58}, /* 227 */ { 77, 38, 67}, /* 228 */ { 38, 0, 29}, /* 229 */ { 38, 19, 34}, /* 230 */ {255, 0, 128}, /* 231 */ {255, 128, 192}, /* 232 */ {166, 0, 83}, /* 233 */ {166, 83, 125}, /* 234 */ {128, 0, 64}, /* 235 */ {128, 64, 96}, /* 236 */ { 77, 0, 38}, /* 237 */ { 77, 38, 58}, /* 238 */ { 38, 0, 19}, /* 239 */ { 38, 19, 29}, /* 240 */ {255, 0, 64}, /* 241 */ {255, 128, 160}, /* 242 */ {166, 0, 42}, /* 243 */ {166, 83, 104}, /* 244 */ {128, 0, 32}, /* 245 */ {128, 64, 80}, /* 246 */ { 77, 0, 19}, /* 247 */ { 77, 38, 48}, /* 248 */ { 38, 0, 10}, /* 249 */ { 38, 19, 24}, /* 250 */ { 84, 84, 84}, /* 251 */ {119, 119, 119}, /* 252 */ {153, 153, 153}, /* 253 */ {187, 187, 187}, /* 254 */ {222, 222, 222}, /* 255 */ {255, 255, 255} }; /****************************************************************************** * Moves the current_point pointer to the next point in the list. * If current_point is at last point then it becomes NULL. * finished is 1 if coord_point has not been set, that is current_point is NULL. */ void xypnt_next_pnt (xypnt_head_rec *head_xypnt /* */, xypnt *coord_point /* */, char *finished /* */) { if (head_xypnt && head_xypnt->current_point) { head_xypnt->current_point = head_xypnt->current_point->next_point; if (head_xypnt->current_point == NULL) *finished = 1; else { *coord_point = head_xypnt->current_point->point; *finished = 0; } } else *finished = 1; } /****************************************************************************** * Moves the current_point pointer to the begining of the list */ void xypnt_first_pnt (xypnt_head_rec *head_xypnt /* */, xypnt *coord_point /* */, char *finished /* */) { if (head_xypnt) { head_xypnt->current_point = head_xypnt->first_point; if (head_xypnt->current_point == NULL) *finished = 1; else { *coord_point = head_xypnt->current_point->point; *finished = 0; } } else *finished = 1; } /****************************************************************************** * This routine will add the "coord_point" to the end of the xypnt list * which is specified by the "head_xypnt". Does not change current_point. */ void xypnt_add_pnt (xypnt_head_rec *head_xypnt /* */, xypnt coord_point /* */) { xypnt_point_rec *temp_point; if (!head_xypnt) return; temp_point=(struct xypnt_point_t *)calloc(1,sizeof(struct xypnt_point_t)); temp_point->point = coord_point; temp_point->next_point = NULL; if (head_xypnt->first_point == NULL) head_xypnt->first_point = temp_point; else head_xypnt->last_point->next_point = temp_point; head_xypnt->last_point = temp_point; } /****************************************************************************** * This routine will dispose a list of points and the head pointer to * which they are connected to. The pointer is returned as a NIL. */ void xypnt_dispose_list (xypnt_head_rec **head_xypnt /* */) { xypnt_point_rec *p, *old; if (head_xypnt && *head_xypnt) { if ((*head_xypnt)->last_point && (*head_xypnt)->first_point) { p = (*head_xypnt)->first_point; while (p) { old = p; p = p->next_point; free(old); } } } } /****************************************************************************** * Searches color by closest rgb values (distance of 2 3D points) * not os specific. * returns: index of color */ int GetIndexByRGBValue(int red /* */, int green /* */, int blue /* */) { int savdis=1, i; double psav = 10000000, pnew, px, py, pz; int nred, ngreen, nblue; for (i = 0; i < MAX_COLORS; i++) { nred = dxftable[i].red; ngreen = dxftable[i].green; nblue = dxftable[i].blue; /* compute shortest distance between rgb colors */ px = red*red - 2*nred*red + nred*nred; py = green*green - 2*ngreen*green + ngreen*ngreen; pz = blue*blue - 2*nblue*blue + nblue*nblue; pnew = sqrt(px+py+pz); if (pnew < psav) { psav = pnew; savdis = i; } } return(savdis+1); } /****************************************************************************** * Moves the current_point pointer to the end of the list */ void xypnt_last_pnt (xypnt_head_rec *head_xypnt /* */, xypnt *coord_point /* */, char *finished /* */) { if (head_xypnt) { head_xypnt->current_point = head_xypnt->last_point; if (head_xypnt->current_point == NULL) *finished = 1; else { *coord_point = head_xypnt->current_point->point; *finished = 0; } } else *finished = 1; } /****************************************************************************** * computes the distance between p1 and p2 * * returns: */ double distpt2pt(xypnt p1 /* */, xypnt p2 /* */) { double dx, dy; dx = p2.xp - p1.xp; dy = p2.yp - p1.yp; if (p1.xp==p2.xp) return (fabs (dy)); else if (p1.yp==p2.yp) return (fabs (dx)); else return (sqrt(dx*dx + dy*dy)); } /****************************************************************************** * returns: length of all vectors in vertex list */ static double get_total_length(xypnt_head_rec *vtx_list /* */) { double total_length; xypnt curr_pnt, next_pnt; char end_of_list; total_length = 0.0; xypnt_first_pnt(vtx_list, &curr_pnt, &end_of_list); while (!end_of_list) { xypnt_next_pnt(vtx_list, &next_pnt, &end_of_list); total_length += distpt2pt(curr_pnt, next_pnt); curr_pnt = next_pnt; } return (total_length); } /****************************************************************************** * Convert B-Spline to list of lines. */ int bspline_to_lines(xypnt_head_rec *vtx_list /* */, xypnt_head_rec **new_vtx_list /* */, int vtx_count /* */, int spline_order /* */, int spline_resolution /* */) { int i, j, knot_index, number_of_segments, knot[MAX_VERTICES + 1],n,m; double spline_step, total_length, t, spline_pnt_x, spline_pnt_y, r, *weight; xypnt curr_pnt, spline_pnt; char end_of_list; *new_vtx_list = (struct xypnt_head_t *) calloc(1, sizeof (struct xypnt_head_t)); if (vtx_list) { n = vtx_count + spline_order+1; m = spline_order + 1; weight = (double *) malloc( n*m* sizeof(double)); for (i = 0; i < vtx_count + spline_order; i++) knot[i] = (i < spline_order) ? 0 : (i > vtx_count) ? knot[i-1] : knot[i-1] + 1; total_length = get_total_length(vtx_list); r = (spline_resolution==0) ? sqrt(total_length) : total_length/spline_resolution; number_of_segments = ROUND(r); spline_step = ((double)knot[vtx_count+spline_order-1]) / number_of_segments; for (knot_index=spline_order-1; knot_index #include static at_string now (void); #define SIGN(x) ((x) > 0 ? 1 : (x) < 0 ? -1 : 0) #define ROUND(x) ((int) ((int) (x) + .5 * SIGN (x))) /* Output macros. */ /* This should be used for outputting a string S on a line by itself. */ #define OUT_LINE(s) \ fprintf (epd_file, "%s\n", s) /* These output their arguments, preceded by the indentation. */ #define OUT1(s, e) \ fprintf (epd_file, s, e) #define OUT2(s, e1, e2) \ fprintf (epd_file, s, e1, e2) #define OUT3(s, e1, e2, e3) \ fprintf (epd_file, s, e1, e2, e3) #define OUT4(s, e1, e2, e3, e4) \ fprintf (epd_file, s, e1, e2, e3, e4) /* These macros just output their arguments. */ #define OUT_STRING(s) fprintf (epd_file, "%s", s) #define OUT_REAL(r) fprintf (epd_file, r == (ROUND (r = ROUND((at_real)6.0*r)/(at_real)6.0)) \ ? "%.0f " : "%.3f ", r) /* For a PostScript command with two real arguments, e.g., lineto. OP should be a constant string. */ #define OUT_COMMAND2(first, second, op) \ do \ { \ OUT_REAL (first); \ OUT_REAL (second); \ OUT_STRING (op "\n"); \ } \ while (0) /* For a PostScript command with six real arguments, e.g., curveto. Again, OP should be a constant string. */ #define OUT_COMMAND6(first, second, third, fourth, fifth, sixth, op) \ do \ { \ OUT_REAL (first); \ OUT_REAL (second); \ OUT_STRING (" "); \ OUT_REAL (third); \ OUT_REAL (fourth); \ OUT_STRING (" "); \ OUT_REAL (fifth); \ OUT_REAL (sixth); \ OUT_STRING (" " op " \n"); \ } \ while (0) /* This should be called before the others in this file. It opens the output file `OUTPUT_NAME.ps', and writes some preliminary boilerplate. */ static int output_epd_header(FILE* epd_file, at_string name, int llx, int lly, int urx, int ury) { at_string time; OUT_LINE ("%EPD-1.0"); OUT1 ("%% Created by %s\n", at_version(true)); OUT1 ("%% Title: %s\n", name); OUT1 ("%% CreationDate: %s\n", time = now ()); OUT4 ("%%BBox(%d,%d,%d,%d)\n", llx, lly, urx, ury); free (time); return 0; } /* This outputs the PostScript code which produces the shape in SHAPE. */ static void out_splines (FILE * epd_file, spline_list_array_type shape) { unsigned this_list; spline_list_type list; color_type last_color = {0,0,0}; for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { unsigned this_spline; spline_type first; list = SPLINE_LIST_ARRAY_ELT (shape, this_list); first = SPLINE_LIST_ELT (list, 0); if (this_list == 0 || !COLOR_EQUAL(list.color, last_color)) { if (this_list > 0) { OUT_LINE ((shape.centerline || list.open) ? "S" : "f"); OUT_LINE("h"); } OUT4 ("%.3f %.3f %.3f %s\n", (double) list.color.r / 255.0, (double) list.color.g / 255.0, (double) list.color.b / 255.0, (shape.centerline || list.open) ? "RG" : "rg"); last_color = list.color; } OUT_COMMAND2 (START_POINT (first).x, START_POINT (first).y, "m"); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list); this_spline++) { spline_type s = SPLINE_LIST_ELT (list, this_spline); if (SPLINE_DEGREE (s) == LINEARTYPE) OUT_COMMAND2 (END_POINT (s).x, END_POINT (s).y, "l"); else OUT_COMMAND6 (CONTROL1 (s).x, CONTROL1 (s).y, CONTROL2 (s).x, CONTROL2 (s).y, END_POINT (s).x, END_POINT (s).y, "c"); } } if (SPLINE_LIST_ARRAY_LENGTH(shape) > 0) OUT_LINE ((shape.centerline || list.open) ? "S" : "f"); } int output_epd_writer(FILE* epd_file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { int result; result = output_epd_header(epd_file, name, llx, lly, urx, ury); if (result != 0) return result; out_splines(epd_file, shape); return 0; } static at_string now (void) { at_string time_string; time_t t = time (0); XMALLOC (time_string, 26); /* not 25 ! */ strcpy (time_string, ctime (&t)); time_string[24] = 0; /* No newline. */ return time_string; } autotrace-0.31.1/output-epd.h0000664000076400007640000000226407551363244011552 /* output-epd.h: utility routines for EPD output (http://epd.sourceforge.net) Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_EPD_H #define OUTPUT_EPD_H #include "output.h" int output_epd_writer (FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* not OUTPUT_EPD_H */ autotrace-0.31.1/output-pdf.c0000664000076400007640000002716207562261172011551 /* output-pdf.c: utility routines for PDF output Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "types.h" #include "spline.h" #include "color.h" #include "output-pdf.h" #include "xstd.h" #include "autotrace.h" #include #include #define SIGN(x) ((x) > 0 ? 1 : (x) < 0 ? -1 : 0) #define ROUND(x) ((int) ((int) (x) + .5 * SIGN (x))) /* Output macros. */ /* This should be used for outputting a string S on a line by itself. */ #define OUT_LINE(s) \ fprintf (pdf_file, "%s\n", s) /* These output their arguments, preceded by the indentation. */ #define OUT1(s, e) \ fprintf (pdf_file, s, e) #define OUT2(s, e1, e2) \ fprintf (pdf_file, s, e1, e2) #define OUT3(s, e1, e2, e3) \ fprintf (pdf_file, s, e1, e2, e3) #define OUT4(s, e1, e2, e3, e4) \ fprintf (pdf_file, s, e1, e2, e3, e4) /* These macros just output their arguments. */ #define OUT_STRING(s) fprintf (pdf_file, "%s", s) #define OUT_REAL(r) fprintf (pdf_file, r == (ROUND (r = ROUND((at_real)6.0*r)/(at_real)6.0)) \ ? "%.0f " : "%.3f ", r) /* For a PostScript command with two real arguments, e.g., lineto. OP should be a constant string. */ #define OUT_COMMAND2(first, second, op) \ do \ { \ OUT_REAL (first); \ OUT_REAL (second); \ OUT_STRING (op "\n"); \ } \ while (0) /* For a PostScript command with six real arguments, e.g., curveto. Again, OP should be a constant string. */ #define OUT_COMMAND6(first, second, third, fourth, fifth, sixth, op) \ do \ { \ OUT_REAL (first); \ OUT_REAL (second); \ OUT_STRING (" "); \ OUT_REAL (third); \ OUT_REAL (fourth); \ OUT_STRING (" "); \ OUT_REAL (fifth); \ OUT_REAL (sixth); \ OUT_STRING (" " op " \n"); \ } \ while (0) /* This should be used for outputting a string S on a line by itself. */ #define SOUT_LINE(s) \ sprintf (temp, "%s\n", s), *length += strlen(temp) /* These output their arguments, preceded by the indentation. */ #define SOUT1(s, e) \ sprintf (temp, s, e), *length += strlen(temp) #define SOUT2(s, e1, e2) \ sprintf (temp, s, e1, e2), *length += strlen(temp) #define SOUT3(s, e1, e2, e3) \ sprintf (temp, s, e1, e2, e3), *length += strlen(temp) #define SOUT4(s, e1, e2, e3, e4) \ sprintf (temp, s, e1, e2, e3, e4), *length += strlen(temp) /* These macros just output their arguments. */ #define SOUT_STRING(s) sprintf (temp, "%s", s), *length += strlen(temp) #define SOUT_REAL(r) sprintf (temp, r == (ROUND (r = ROUND((at_real)6.0*r)/(at_real)6.0)) \ ? "%.0f " : "%.3f ", r), *length += strlen(temp) /* For a PostScript command with two real arguments, e.g., lineto. OP should be a constant string. */ #define SOUT_COMMAND2(first, second, op) \ do \ { \ SOUT_REAL (first); \ SOUT_REAL (second); \ SOUT_STRING (op "\n"); \ } \ while (0) /* For a PostScript command with six real arguments, e.g., curveto. Again, OP should be a constant string. */ #define SOUT_COMMAND6(first, second, third, fourth, fifth, sixth, op) \ do \ { \ SOUT_REAL (first); \ SOUT_REAL (second); \ SOUT_STRING (" "); \ SOUT_REAL (third); \ SOUT_REAL (fourth); \ SOUT_STRING (" "); \ SOUT_REAL (fifth); \ SOUT_REAL (sixth); \ SOUT_STRING (" " op " \n"); \ } \ while (0) /* This should be called before the others in this file. It opens the output file `OUTPUT_NAME.pdf', and writes some preliminary boilerplate. */ static int output_pdf_header(FILE* pdf_file, at_string name, int llx, int lly, int urx, int ury) { OUT_LINE ("%PDF-1.2"); OUT_LINE ("1 0 obj"); OUT_LINE (" << /Type /Catalog"); OUT_LINE (" /Outlines 2 0 R"); OUT_LINE (" /Pages 3 0 R"); OUT_LINE (" >>"); OUT_LINE ("endobj"); OUT_LINE ("2 0 obj"); OUT_LINE (" << /Type /Outlines"); OUT_LINE (" /Count 0"); OUT_LINE (" >>"); OUT_LINE ("endobj"); OUT_LINE ("3 0 obj"); OUT_LINE (" << /Type /Pages"); OUT_LINE (" /Kids [4 0 R]"); OUT_LINE (" /Count 1"); OUT_LINE (" >>"); OUT_LINE ("endobj"); OUT_LINE ("4 0 obj"); OUT_LINE (" << /Type /Page"); OUT_LINE (" /Parent 3 0 R"); OUT4 (" /MediaBox [%d %d %d %d]\n", llx, lly, urx, ury); OUT_LINE (" /Contents 5 0 R"); OUT_LINE (" /Resources << /ProcSet 6 0 R >>"); OUT_LINE (" >>"); OUT_LINE ("endobj"); return 0; } /* This should be called after the others in this file. It writes some last informations. */ static int output_pdf_tailor(FILE* pdf_file, size_t length, int llx, int lly, int urx, int ury) { char temp[40]; size_t tmp; OUT_LINE ("6 0 obj"); OUT_LINE (" [/PDF]"); OUT_LINE ("endobj"); OUT_LINE ("xref"); OUT_LINE ("0 7"); OUT_LINE ("0000000000 65535 f "); OUT_LINE ("0000000009 00000 n "); OUT_LINE ("0000000092 00000 n "); OUT_LINE ("0000000150 00000 n "); OUT_LINE ("0000000225 00000 n "); sprintf(temp, "%d", llx); tmp = 366; tmp += (strlen (temp)); sprintf(temp, "%d", lly); tmp += (strlen (temp)); sprintf(temp, "%d", urx); tmp += (strlen (temp)); sprintf(temp, "%d", ury); tmp += (strlen (temp)); OUT1 ("%010d 00000 n \n", tmp); sprintf(temp, "%d", length); tmp += 50 + length + strlen(temp); OUT1 ("%010d 00000 n \n", tmp); OUT_LINE ("trailer"); OUT_LINE (" << /Size 7"); OUT_LINE (" /Root 1 0 R"); OUT_LINE (" >>"); OUT_LINE ("startxref"); OUT1 ("%d\n", tmp + 25); OUT_LINE ("%%EOF"); return 0; } /* This outputs the PDF code which produces the shape in SHAPE. */ static void out_splines (FILE *pdf_file, spline_list_array_type shape, size_t *length) { char temp[40]; unsigned this_list; spline_list_type list; color_type last_color = {0,0,0}; for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { unsigned this_spline; spline_type first; list = SPLINE_LIST_ARRAY_ELT (shape, this_list); first = SPLINE_LIST_ELT (list, 0); if (this_list == 0 || !COLOR_EQUAL(list.color, last_color)) { if (this_list > 0) { SOUT_LINE ((shape.centerline || list.open) ? "S" : "f"); SOUT_LINE("h"); } SOUT4 ("%.3f %.3f %.3f %s\n", (double) list.color.r / 255.0, (double) list.color.g / 255.0, (double) list.color.b / 255.0, (shape.centerline || list.open) ? "RG" : "rg"); last_color = list.color; } SOUT_COMMAND2 (START_POINT (first).x, START_POINT (first).y, "m"); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list); this_spline++) { spline_type s = SPLINE_LIST_ELT (list, this_spline); if (SPLINE_DEGREE (s) == LINEARTYPE) SOUT_COMMAND2 (END_POINT (s).x, END_POINT (s).y, "l"); else SOUT_COMMAND6 (CONTROL1 (s).x, CONTROL1 (s).y, CONTROL2 (s).x, CONTROL2 (s).y, END_POINT (s).x, END_POINT (s).y, "c"); } } if (SPLINE_LIST_ARRAY_LENGTH(shape) > 0) SOUT_LINE ((shape.centerline || list.open) ? "S" : "f"); OUT_LINE ("5 0 obj"); OUT1 (" << /Length %d >>\n", *length); OUT_LINE ("stream"); last_color.r = 0; last_color.g = 0; last_color.b = 0; for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { unsigned this_spline; spline_type first; list = SPLINE_LIST_ARRAY_ELT (shape, this_list); first = SPLINE_LIST_ELT (list, 0); if (this_list == 0 || !COLOR_EQUAL(list.color, last_color)) { if (this_list > 0) { OUT_LINE ((shape.centerline || list.open) ? "S" : "f"); OUT_LINE("h"); } OUT4 ("%.3f %.3f %.3f %s\n", (double) list.color.r / 255.0, (double) list.color.g / 255.0, (double) list.color.b / 255.0, (shape.centerline || list.open) ? "RG" : "rg"); last_color = list.color; } OUT_COMMAND2 (START_POINT (first).x, START_POINT (first).y, "m"); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list); this_spline++) { spline_type s = SPLINE_LIST_ELT (list, this_spline); if (SPLINE_DEGREE (s) == LINEARTYPE) OUT_COMMAND2 (END_POINT (s).x, END_POINT (s).y, "l"); else OUT_COMMAND6 (CONTROL1 (s).x, CONTROL1 (s).y, CONTROL2 (s).x, CONTROL2 (s).y, END_POINT (s).x, END_POINT (s).y, "c"); } } if (SPLINE_LIST_ARRAY_LENGTH(shape) > 0) OUT_LINE ((shape.centerline || list.open) ? "S" : "f"); OUT_LINE ("endstream"); OUT_LINE ("endobj"); } int output_pdf_writer(FILE* pdf_file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { int result; size_t length = 0; #ifdef _WINDOWS if(pdf_file == stdout) { fprintf(stderr, "This driver couldn't write to stdout!\n"); return -1; } #endif result = output_pdf_header(pdf_file, name, llx, lly, urx, ury); if (result != 0) return result; out_splines(pdf_file, shape, &length); output_pdf_tailor(pdf_file, length, llx, lly, urx, ury); return 0; } autotrace-0.31.1/output-pdf.h0000664000076400007640000000231307551363372011550 /* output-pdf.c: utility routines for PDF output Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_PDF_H #define OUTPUT_PDF_H #include #include "types.h" #include "spline.h" #include "output.h" int output_pdf_writer (FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* not OUTPUT_PDF_H */ autotrace-0.31.1/output-mif.c0000664000076400007640000001413407551363367011555 /* output-mif.c: utility routines for FrameMaker MIF output Copyright (C) 2001 Per Grahn This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "types.h" #include "spline.h" #include "color.h" #include "output-mif.h" #include "xstd.h" #include "autotrace.h" #include #include #include typedef struct { char *tag; color_type c; } ColorT; typedef struct { int llx; int lly; int urx; int ury; at_real dpi; } BboxT; BboxT cbox; /*=========================================================================== Return a color name based on RGB value ===========================================================================*/ static const char * colorstring(int r, int g, int b) { static char buffer[15]; if( r==0 && g==0 && b==0 ) return "Black"; else if( r==255 && g==0 && b==0 ) return "Red"; else if( r==0 && g==255 && b==0 ) return "Green"; else if( r==0 && g==0 && b==255 ) return "Blue"; else if( r==255 && g==255 && b==0 ) return "Yellow"; else if( r==255 && g==0 && b==255 ) return "Magenta"; else if( r==0 && g==255 && b==255 ) return "Cyan"; else if( r==255 && g==255 && b==255 ) return "White"; else { sprintf(buffer,"R%.3dG%.3dB%.3d", r, g, b); } return buffer; } /*=========================================================================== Convert Bezier Spline ===========================================================================*/ static at_real bezpnt(at_real t, at_real z1, at_real z2, at_real z3, at_real z4) { at_real temp, t1; /* Determine ordinate on Bezier curve at length "t" on curve */ if (t < (at_real) 0.0) { t = (at_real) 0.0; } if (t > (at_real) 1.0) { t = (at_real) 1.0; } t1 = ((at_real) 1.0 - t); temp = t1*t1*t1*z1 + (at_real)3.0*t*t1*t1*z2 + (at_real)3.0*t*t*t1*z3 + t*t*t*z4; return(temp); } /*=========================================================================== Print a point ===========================================================================*/ static void print_coord(FILE* f, at_real x, at_real y) { fprintf(f, " \n", x*72.0/cbox.dpi, (cbox.ury-y+1)*72.0/cbox.dpi); } /*=========================================================================== Main conversion routine ===========================================================================*/ int output_mif_writer(FILE* ps_file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { unsigned this_list; int i; ColorT col_tbl[256]; int n_ctbl = 0; color_type curr_color = {0,0,0}; cbox.llx = llx; cbox.lly = lly; cbox.urx = urx; cbox.ury = ury; cbox.dpi = (at_real) opts->dpi; fprintf(ps_file, " #%s\n\n= n_ctbl ){ col_tbl[n_ctbl].tag = strdup(colorstring(curr_color.r, curr_color.g, curr_color.b)); col_tbl[n_ctbl].c = curr_color; n_ctbl++; } } for( i=0; i" ">\n", col_tbl[i].tag, c*100/255, m*100/255, y*100/255, k*100/255); } fprintf(ps_file, ">\n"); fprintf(ps_file, "\n" " \n" " \n" " \n" " \n", (urx-llx)*72.0/cbox.dpi, (ury-lly)*72.0/cbox.dpi); for( this_list=0; this_list < SPLINE_LIST_ARRAY_LENGTH(shape); this_list++ ){ unsigned this_spline; at_bool smooth; spline_list_type list = SPLINE_LIST_ARRAY_ELT (shape, this_list); spline_type first = SPLINE_LIST_ELT (list, 0); for( i=0; i" : ""); fprintf(ps_file, " \n", col_tbl[i].tag); print_coord(ps_file, START_POINT (first).x, START_POINT (first).y); smooth = false; for( this_spline=0; this_spline < SPLINE_LIST_LENGTH(list); this_spline++ ){ spline_type s = SPLINE_LIST_ELT (list, this_spline); if( SPLINE_DEGREE (s) == LINEARTYPE ){ print_coord(ps_file, END_POINT(s).x, END_POINT(s).y); } else { at_real temp; at_real dt = (at_real) (1.0/7.0); /*smooth = true;*/ for( temp=dt; fabs(temp-(at_real)1.0)\n", smooth ? "Yes": "No"); fprintf(ps_file, " >\n"); } fprintf(ps_file, ">\n"); return 0; } autotrace-0.31.1/output-mif.h0000664000076400007640000000222007551363372011547 /* output-mif.c: utility routines for FrameMaker MIF output Copyright (C) 2001 Per Grahn This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_MIF_H #define OUTPUT_MIF_H #include "output.h" int output_mif_writer (FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* not OUTPUT_MIF_H */ autotrace-0.31.1/output-cgm.c0000664000076400007640000001566507562261172011553 /* output-cgm.c: CGM output Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "types.h" #include "spline.h" #include "color.h" #include "output-cgm.h" #include "xstd.h" #include "autotrace.h" #include #define CGM_BEGINMETAFILE 0x0020 #define CGM_BEGINPICTURE 0x0060 #define CGM_METAFILEVERSION 0x1022 #define CGM_METAFILEDESCRIPTION 0x1040 typedef unsigned short int UI16; typedef unsigned char UI8; /* endianess independent IO functions */ static at_bool write16(FILE *fdes, UI16 data) { size_t count = 0; UI8 outch; outch = (UI8) ((data >> 8) & 0x0FF); count += fwrite(&outch, 1, 1, fdes); outch = (UI8) (data & 0x0FF); count += fwrite(&outch, 1, 1, fdes); return (count == sizeof(UI16)) ? true : false; } static at_bool write8(FILE *fdes, UI8 data) { size_t count = 0; count = fwrite(&data, 1, 1, fdes); return (count == sizeof(UI8)) ? true : false; } static at_bool output_beginmetafilename(FILE *fdes, const char *string) { int len = strlen (string); if (len + 1 < 0x001F) write16(fdes, CGM_BEGINMETAFILE + len + 1); else { write16(fdes, CGM_BEGINMETAFILE + 0x001F); write16(fdes, len + 1); } write8(fdes, len); while (*string != '\0') { write8(fdes, *string); string++; } if (len % 2 == 0) write8(fdes, 0); return true; } static at_bool output_beginpicture(FILE *fdes, const char *string) { int len = strlen (string); if (len + 1 < 0x001F) write16(fdes, CGM_BEGINPICTURE + len + 1); else { write16(fdes, CGM_BEGINPICTURE + 0x001F); write16(fdes, len + 1); } write8(fdes, len); while (*string != '\0') { write8(fdes, *string); string++; } if (len % 2 == 0) write8(fdes, 0); return true; } static at_bool output_metafiledescription(FILE *fdes, const char *string) { int len = strlen (string); if (len + 1 < 0x001F) write16(fdes, CGM_METAFILEDESCRIPTION + len + 1); else { write16(fdes, CGM_METAFILEDESCRIPTION + 0x001F); write16(fdes, len + 1); } write8(fdes, len); while (*string != '\0') { write8(fdes, *string); string++; } if (len % 2 == 0) write8(fdes, 0); return true; } int output_cgm_writer(FILE* cgm_file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { unsigned this_list; char *des; const char * version_string = at_version(true); output_beginmetafilename (cgm_file, name); write16 (cgm_file, CGM_METAFILEVERSION); write16 (cgm_file, 0x0002); des = (char *) malloc (strlen ("created by ") + strlen (version_string) + 1); strcpy (des, "created by "); strcat (des, version_string); output_metafiledescription (cgm_file, des); free (des); write16 (cgm_file, 0x1166); /* metafile element list */ write16 (cgm_file, 0x0001); write16 (cgm_file, 0xFFFF); write16 (cgm_file, 0x0001); output_beginpicture(cgm_file, "pic1"); write16 (cgm_file, 0x2042);/* color selection modes (1 = direct) */ write16 (cgm_file, 0x0001); write16 (cgm_file, 0x20C8);/* vdc extend */ write16 (cgm_file, llx/*0x0000*/); write16 (cgm_file, urx/*0x7FFF*/); write16 (cgm_file, ury/*0x7FFF*/); write16 (cgm_file, lly/*0x0000*/); write16 (cgm_file, 0x0080);/* begin picture body */ for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { unsigned this_spline; spline_list_type list = SPLINE_LIST_ARRAY_ELT (shape, this_list); if (this_list > 0) { if (shape.centerline) write16 (cgm_file, 0x0200); /* end a compound line */ else write16 (cgm_file, 0x0120); /* end a figure */ } if (shape.centerline) write16 (cgm_file, 0x5083);/* line */ else write16 (cgm_file, 0x52E3);/* fill */; /* color output */ if (list.clockwise && shape.background_color != NULL) { write8 (cgm_file, shape.background_color->r); write8 (cgm_file, shape.background_color->g); write8 (cgm_file, shape.background_color->b); } else { write8 (cgm_file, list.color.r); write8 (cgm_file, list.color.g); write8 (cgm_file, list.color.b); } write8 (cgm_file, 0); if (shape.centerline) { write16 (cgm_file, 0x53C2);/* edge visibility on */ write16 (cgm_file, 0x0001); } else { write16 (cgm_file, 0x52C2);/* interior style solid */ write16 (cgm_file, 0x0001); } if (shape.centerline) write16 (cgm_file, 0x01E0); /* begin a compound line */ else write16 (cgm_file, 0x0100); /* begin a figure */ for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list); this_spline++) { spline_type s = SPLINE_LIST_ELT (list, this_spline); if (SPLINE_DEGREE (s) == LINEARTYPE) { write16 (cgm_file, 0x4028); /* polyline */ write16 (cgm_file, (UI16) START_POINT (s).x); write16 (cgm_file, ury - (UI16) START_POINT (s).y); write16 (cgm_file, (UI16) END_POINT (s).x); write16 (cgm_file, ury - (UI16) END_POINT (s).y); } else { write16 (cgm_file, 0x4352); /* polybezier */ write16 (cgm_file, 0x0002); /* continuous */ write16 (cgm_file, (UI16) START_POINT (s).x); write16 (cgm_file, ury - (UI16) START_POINT (s).y); write16 (cgm_file, (UI16) CONTROL1 (s).x); write16 (cgm_file, ury - (UI16) CONTROL1 (s).y); write16 (cgm_file, (UI16) CONTROL2 (s).x); write16 (cgm_file, ury - (UI16) CONTROL2 (s).y); write16 (cgm_file, (UI16) END_POINT (s).x); write16 (cgm_file, ury - (UI16) END_POINT (s).y); } } } if (SPLINE_LIST_ARRAY_LENGTH(shape) > 0) { if (shape.centerline) write16 (cgm_file, 0x0200); /* end a compound line */ else write16 (cgm_file, 0x0120); /* end a figure */ } write16 (cgm_file, 0x00A0); /* end picture */ write16 (cgm_file, 0x0040); /* end metafile */ return(0); } autotrace-0.31.1/output-cgm.h0000664000076400007640000000217007551363371011545 /* output-cgm.h: CGM output Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_CGM_H #define OUTPUT_CGM_H #include "output.h" int output_cgm_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* not OUTPUT_CGM_H */ autotrace-0.31.1/output-dr2d.c0000664000076400007640000004401707562771212011632 /* output-dr2d.c: output in DR2D format Copyright (C) 2002 Andrew Elia This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include #include #include "spline.h" #include "color.h" #include "output-dr2d.h" /* Globals: Values are set by output_dr2d_writer() */ float XFactor; float YFactor; float LineThickness; #define FIXOFFS 10 #define LF_ACTIVE 0x01 #define LF_DISPLAYED 0x02 #define FT_NONE 0 #define FT_COLOR 1 #define JT_NONE 0 #define JT_MITER 1 #define JT_BEVEL 2 #define JT_ROUND 3 #define INDICATOR 0xFFFFFFFF #define IND_SPLINE 0x00000001 #define IND_MOVETO 0x00000002 struct Chunk { unsigned char ID[4]; unsigned int Size; unsigned char * Data; }; static struct Chunk * BuildDRHD(int, int, int, int); static struct Chunk * BuildPPRF(char *, int, char *, float); static struct Chunk * BuildCMAP(spline_list_array_type); static struct Chunk * BuildLAYR(void); static struct Chunk * BuildDASH(void); static struct Chunk * BuildBBOX(spline_list_type, int); static struct Chunk * BuildATTR(at_color_type, int, struct Chunk *); static int GetCMAPEntry(at_color_type, struct Chunk *); static int CountSplines(spline_list_type); static int SizeFloat(float, char *); static void ShortAsBytes(int, unsigned char *); static void IntAsBytes(int, unsigned char *); static void FloatAsIEEEBytes(float, unsigned char *); /* static void ieee2flt(long *, float *); */ static void flt2ieee(float *, unsigned char *); static void FreeChunk(struct Chunk *); static void FreeChunks(struct Chunk **, int); static int TotalSizeChunks(struct Chunk **, int); static int SizeChunk(struct Chunk *); static void PushPolyPoint(unsigned char *, int *, float, float); static void PushPolyIndicator(unsigned char *, int *, unsigned int); static struct Chunk ** GeneratexPLY(struct Chunk *, spline_list_array_type, int); static struct Chunk * BuildCMAP(spline_list_array_type shape) { unsigned this_list; unsigned this_list_length; int ListSize, MaxListSize; int WalkCol, FoundCol; unsigned char Red, Green, Blue; unsigned char * CMAP; unsigned char * IndexCol; struct Chunk * CMAPChunk; MaxListSize = SPLINE_LIST_ARRAY_LENGTH(shape); if ((CMAPChunk = (struct Chunk *) malloc(sizeof(struct Chunk))) == NULL) { fprintf(stderr, "Insufficient memory to allocate CMAP chunk\n"); return NULL; } if ((CMAP = (unsigned char *) malloc(MaxListSize * 3)) == NULL) { fprintf(stderr, "Insufficient memory to allocate colour map (size %d)\n", MaxListSize); free(CMAPChunk); return NULL; } ListSize = 0; this_list_length = SPLINE_LIST_ARRAY_LENGTH(shape); for (this_list = 0; this_list < this_list_length; this_list++) { spline_list_type list = SPLINE_LIST_ARRAY_ELT(shape, this_list); color_type curr_color = curr_color = (list.clockwise && shape.background_color != NULL)? *(shape.background_color) : list.color; Red = curr_color.r; Green = curr_color.g; Blue = curr_color.b; FoundCol = 0; for (WalkCol = 0; WalkCol < ListSize; WalkCol++) { IndexCol = CMAP + (WalkCol * 3); if ((*IndexCol == Red) && (*(IndexCol + 1) == Green) && (*(IndexCol + 2) == Blue)) { FoundCol = 1; break; } } if (FoundCol == 0) { IndexCol = CMAP + (ListSize * 3); *IndexCol = Red; *(IndexCol + 1) = Green; *(IndexCol + 2) = Blue; ++ListSize; } } strncpy(CMAPChunk->ID, "CMAP", 4); CMAPChunk->Size = ListSize * 3; CMAPChunk->Data = CMAP; return CMAPChunk; } static int GetCMAPEntry(at_color_type colour, struct Chunk * CMAPChunk) { int WalkCol, ListSize; unsigned char Red, Green, Blue; unsigned char * IndexCol; unsigned char * CMAPTable; ListSize = (CMAPChunk->Size) / 3; CMAPTable = CMAPChunk->Data; Red = colour.r; Green = colour.g; Blue = colour.b; for (WalkCol = 0; WalkCol < ListSize; WalkCol++) { IndexCol = CMAPTable + (WalkCol * 3); if ((*IndexCol == Red) && (*(IndexCol + 1) == Green) && (*(IndexCol + 2) == Blue)) { return WalkCol; } } return -1; } static struct Chunk * BuildBBOX(spline_list_type list, int height) { unsigned this_spline; unsigned this_spline_length; float x1, y1, x2, y2; float ex, ey; struct Chunk * BBOXChunk; unsigned char * BBOXData; spline_type s; if ((BBOXChunk = (struct Chunk *) malloc(sizeof(struct Chunk))) == NULL) { fprintf(stderr, "Insufficient memory to allocate BBOX chunk\n"); return NULL; } if ((BBOXData = (unsigned char *) malloc(16)) == NULL) { fprintf(stderr, "Insufficient memory to allocate BBOX data\n"); free(BBOXChunk); return NULL; } s = SPLINE_LIST_ELT(list, 0); x1 = START_POINT(s).x; y1 = START_POINT(s).y; x2 = START_POINT(s).x; y2 = START_POINT(s).y; this_spline_length = SPLINE_LIST_LENGTH(list); for (this_spline = 0; this_spline < this_spline_length; this_spline++) { s = SPLINE_LIST_ELT(list, this_spline); ex = END_POINT(s).x; ey = height - END_POINT(s).y; if (x1 > ex) { x1 = ex; } if (y1 > ey) { y1 = ey; } if (x2 < ex) { x2 = ex; } if (y2 < ey) { y2 = ey; } } FloatAsIEEEBytes(x1 * XFactor, BBOXData); FloatAsIEEEBytes(y1 * YFactor, BBOXData + 4); FloatAsIEEEBytes(x2 * XFactor, BBOXData + 8); FloatAsIEEEBytes(y2 * YFactor, BBOXData + 12); strncpy(BBOXChunk->ID, "BBOX", 4); BBOXChunk->Size = 16; BBOXChunk->Data = BBOXData; return BBOXChunk; } static struct Chunk * BuildATTR(at_color_type colour, int StrokeOrFill, struct Chunk * CMAPChunk) { struct Chunk * ATTRChunk; unsigned char * ATTRData; int ColourIndex; if ((ATTRChunk = (struct Chunk *) malloc(sizeof(struct Chunk))) == NULL) { fprintf(stderr, "Insufficient memory to allocate ATTR chunk\n"); return NULL; } if ((ATTRData = (unsigned char *) malloc(14)) == NULL) { fprintf(stderr, "Insufficient memory to allocate ATTR data\n"); free(ATTRChunk); return NULL; } ColourIndex = GetCMAPEntry(colour, CMAPChunk); ATTRData[0] = (StrokeOrFill) ? FT_NONE : FT_COLOR; ATTRData[1] = JT_ROUND; ATTRData[2] = 1; ATTRData[3] = 0; ShortAsBytes(ColourIndex, ATTRData + 4); ShortAsBytes(ColourIndex, ATTRData + 6); ShortAsBytes(0, ATTRData + 8); FloatAsIEEEBytes(LineThickness, ATTRData + 10); strncpy(ATTRChunk->ID, "ATTR", 4); ATTRChunk->Size = 14; ATTRChunk->Data = ATTRData; return ATTRChunk; } static struct Chunk * BuildDRHD(int x1, int y1, int x2, int y2) { struct Chunk * DRHDChunk; unsigned char * DRHDData; if ((DRHDChunk = (struct Chunk *) malloc(sizeof(struct Chunk))) == NULL) { fprintf(stderr, "Insufficient memory to allocate DRHD chunk\n"); return NULL; } if ((DRHDData = (unsigned char *) malloc(16)) == NULL) { fprintf(stderr, "Insufficient memory to allocate DRHD data\n"); free(DRHDChunk); return NULL; } FloatAsIEEEBytes(x1 * XFactor, DRHDData); FloatAsIEEEBytes(y1 * YFactor, DRHDData + 4); FloatAsIEEEBytes(x2 * XFactor, DRHDData + 8); FloatAsIEEEBytes(y2 * YFactor, DRHDData + 12); strncpy(DRHDChunk->ID, "DRHD", 4); DRHDChunk->Size = 16; DRHDChunk->Data = DRHDData; return DRHDChunk; } static struct Chunk * BuildPPRF(char * Units, int Portrait, char * PageType, float GridSize) { struct Chunk * PPRFChunk; char * PPRFData; char * PPRFPos; int ChunkSize; if ((PPRFChunk = (struct Chunk *) malloc(sizeof(struct Chunk))) == NULL) { fprintf(stderr, "Insufficient memory to allocate PPRF chunk\n"); return NULL; } ChunkSize = strlen("Units=") + strlen(Units) + 1; ChunkSize += strlen("Portrait=") + (Portrait ? 4 : 5) + 1; ChunkSize += strlen("PageType=") + strlen(PageType) + 1; ChunkSize += strlen("GridSize=") + SizeFloat(GridSize, "%f") + 1; if ((PPRFData = (char *) malloc(ChunkSize)) == NULL) { fprintf(stderr, "Insufficient memory to allocate PPRF data\n"); free(PPRFChunk); return NULL; } PPRFPos = PPRFData; sprintf(PPRFPos, "Units=%s", Units); PPRFPos += strlen(PPRFPos) + 1; sprintf(PPRFPos, "Portrait=%s", (Portrait ? "True" : "False")); PPRFPos += strlen(PPRFPos) + 1; sprintf(PPRFPos, "PageType=%s", PageType); PPRFPos += strlen(PPRFPos) + 1; sprintf(PPRFPos, "GridSize=%f", GridSize); strncpy(PPRFChunk->ID, "PPRF", 4); PPRFChunk->Size = ChunkSize; PPRFChunk->Data = (unsigned char *) PPRFData; return PPRFChunk; } static struct Chunk * BuildLAYR() { struct Chunk * LAYRChunk; unsigned char * LAYRData; if ((LAYRChunk = (struct Chunk *) malloc(sizeof(struct Chunk))) == NULL) { fprintf(stderr, "Insufficient memory to allocate LAYR chunk\n"); return NULL; } if ((LAYRData = (unsigned char *) malloc(20)) == NULL) { fprintf(stderr, "Insufficient memory to allocate LAYR data\n"); free(LAYRChunk); return NULL; } ShortAsBytes(0, LAYRData); memset(LAYRData + 2, (char) NULL, 16); strcpy(LAYRData + 2, "Default layer"); *(LAYRData + 18) = LF_ACTIVE | LF_DISPLAYED; *(LAYRData + 19) = 0; strncpy(LAYRChunk->ID, "LAYR", 4); LAYRChunk->Size = 20; LAYRChunk->Data = LAYRData; return LAYRChunk; } static struct Chunk * BuildDASH(void) { struct Chunk * DASHChunk; unsigned char * DASHData; if ((DASHChunk = (struct Chunk *) malloc(sizeof(struct Chunk))) == NULL) { fprintf(stderr, "Insufficient memory to allocate DASH chunk\n"); return NULL; } if ((DASHData = (unsigned char *) malloc(4)) == NULL) { fprintf(stderr, "Insufficient memory to allocate DASH data\n"); free(DASHChunk); return NULL; } ShortAsBytes(1, DASHData); ShortAsBytes(0, DASHData + 2); strncpy(DASHChunk->ID, "DASH", 4); DASHChunk->Size = 4; DASHChunk->Data = DASHData; return DASHChunk; } static struct Chunk ** GeneratexPLY(struct Chunk * CMAP, spline_list_array_type shape, int height) { unsigned this_list; unsigned this_list_length; unsigned this_spline; unsigned this_spline_length; spline_type s; struct Chunk ** ChunkList; struct Chunk * PolyChunk; int ListPoint, PolySize, PolyPoint, NumPoints; int StrokeOrFill; unsigned char * PolyData; this_list_length = SPLINE_LIST_ARRAY_LENGTH(shape); /* We store three chunks for every spline (one for BBOX, one for ATTR, and one for xPLY) */ if ((ChunkList = (struct Chunk **) malloc(sizeof(struct Chunk) * (this_list_length * 3))) == NULL) { fprintf(stderr, "Insufficient memory to allocate chunk list\n"); return NULL; } ListPoint = 0; for (this_list = 0; this_list < this_list_length; this_list++) { spline_list_type list = SPLINE_LIST_ARRAY_ELT(shape, this_list); spline_type first = SPLINE_LIST_ELT(list, 0); color_type curr_color = curr_color = (list.clockwise && shape.background_color != NULL)? *(shape.background_color) : list.color; StrokeOrFill = (shape.centerline || list.open); this_spline_length = SPLINE_LIST_LENGTH(list); ChunkList[ListPoint++] = BuildBBOX(list, height); ChunkList[ListPoint++] = BuildATTR(curr_color, StrokeOrFill, CMAP); if ((PolyChunk = (struct Chunk *) malloc(sizeof(struct Chunk))) == NULL) { fprintf(stderr, "Insufficient memory to allocate xPLY chunk\n"); FreeChunks(ChunkList, ListPoint); return NULL; } NumPoints = CountSplines(list); /* Store an extra 2 bytes for length header */ PolySize = (NumPoints << 3) + 2; if ((PolyData = (unsigned char *) malloc(PolySize)) == NULL) { fprintf(stderr, "Insufficient memory to allocate xPLY data\n"); free(PolyChunk); free(PolyData); FreeChunks(ChunkList, ListPoint); return NULL; } ChunkList[ListPoint++] = PolyChunk; strncpy(PolyChunk->ID, (StrokeOrFill) ? "OPLY" : "CPLY", 4); PolyChunk->Size = PolySize; PolyChunk->Data = PolyData; ShortAsBytes(NumPoints, PolyData); PolyPoint = 2; if (SPLINE_DEGREE(first) == LINEARTYPE) { PushPolyPoint(PolyData, &PolyPoint, START_POINT(first).x, height - START_POINT(first).y); } for (this_spline = 0; this_spline < this_spline_length; this_spline++) { s = SPLINE_LIST_ELT(list, this_spline); if (SPLINE_DEGREE(s) == LINEARTYPE) { PushPolyPoint(PolyData, &PolyPoint, END_POINT(s).x, height - END_POINT(s).y); } else { PushPolyIndicator(PolyData, &PolyPoint, IND_SPLINE); PushPolyPoint(PolyData, &PolyPoint, START_POINT(s).x, height - START_POINT(s).y); PushPolyPoint(PolyData, &PolyPoint, CONTROL1(s).x, height - CONTROL1(s).y); PushPolyPoint(PolyData, &PolyPoint, CONTROL2(s).x, height - CONTROL2(s).y); PushPolyPoint(PolyData, &PolyPoint, END_POINT(s).x, height - END_POINT(s).y); } } } return ChunkList; } static int CountSplines(spline_list_type list) { unsigned this_spline; unsigned this_spline_length; int Total; Total = 0; if (SPLINE_DEGREE(SPLINE_LIST_ELT(list, 0)) == LINEARTYPE) { ++Total; } this_spline_length = SPLINE_LIST_LENGTH(list); for (this_spline = 0; this_spline < this_spline_length; this_spline++) { if (SPLINE_DEGREE(SPLINE_LIST_ELT(list, this_spline)) == LINEARTYPE) { ++Total; } else { Total += 5; } } return Total; } static void PushPolyPoint(unsigned char * PolyData, int * PolyPoint, float x, float y) { int PolyLocal; PolyLocal = *PolyPoint; FloatAsIEEEBytes(x * XFactor, PolyData + PolyLocal); PolyLocal += 4; FloatAsIEEEBytes(y * YFactor, PolyData + PolyLocal); *PolyPoint = PolyLocal + 4; } static void PushPolyIndicator(unsigned char * PolyData, int * PolyPoint, unsigned int flags) { int PolyLocal; PolyLocal = *PolyPoint; IntAsBytes(INDICATOR, PolyData + PolyLocal); PolyLocal += 4; IntAsBytes(flags, PolyData + PolyLocal); *PolyPoint = PolyLocal + 4; } static void WriteChunk(FILE * file, struct Chunk * Chunk) { unsigned char SizeBytes[4]; int Size; Size = Chunk->Size; IntAsBytes(Size, SizeBytes); fwrite(Chunk->ID, 4, 1, file); fwrite(SizeBytes, 4, 1, file); fwrite(Chunk->Data, Size, 1, file); if (Size & 0x01) { fprintf(file, "%c", (char) NULL); } } static void WriteChunks(FILE * file, struct Chunk ** ChunkList, int NumChunks) { int WalkChunks; for (WalkChunks = 0; WalkChunks < NumChunks; WalkChunks++) { WriteChunk(file, ChunkList[WalkChunks]); } } static int TotalSizeChunks(struct Chunk ** ChunkList, int NumChunks) { int WalkChunks; int Size; int Total; Total = 0; for (WalkChunks = 0; WalkChunks < NumChunks; WalkChunks++) { /* 4 bytes for ID and 4 bytes for length */ Size = ChunkList[WalkChunks]->Size; Size += Size & 0x01; Total += (Size) + 8; } return Total; } static int SizeChunk(struct Chunk * ThisChunk) { int Size; Size = ThisChunk->Size; Size += Size & 0x01; return Size; } static void FreeChunk(struct Chunk * ThisChunk) { free(ThisChunk->Data); free(ThisChunk); } static void FreeChunks(struct Chunk ** ChunkList, int NumChunks) { int WalkChunks; for (WalkChunks = 0; WalkChunks < NumChunks; WalkChunks++) { FreeChunk(ChunkList[WalkChunks]); } } int output_dr2d_writer(FILE * file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { int width = urx - llx; int height = ury - lly; int NumSplines, FORMSize; int Portrait; struct Chunk * DRHDChunk; struct Chunk * PPRFChunk; struct Chunk * LAYRChunk; struct Chunk * DASHChunk; struct Chunk * CMAPChunk; struct Chunk ** ChunkList; unsigned char SizeBytes[4]; Portrait = width < height; if (Portrait) { XFactor = ((float)11.6930 / (float) width) * (1 << FIXOFFS); YFactor = XFactor; } else { YFactor = ((float)8.2681 / (float) height) * (1 << FIXOFFS); XFactor = YFactor; } LineThickness = (float)1.0 / opts->dpi; DRHDChunk = BuildDRHD(llx, lly, urx, ury); PPRFChunk = BuildPPRF("Inch", Portrait, "A4", 1.0); LAYRChunk = BuildLAYR(); DASHChunk = BuildDASH(); CMAPChunk = BuildCMAP(shape); ChunkList = GeneratexPLY(CMAPChunk, shape, height); NumSplines = SPLINE_LIST_ARRAY_LENGTH(shape) * 3; FORMSize = 4 + (SizeChunk(DRHDChunk) + 8) + (SizeChunk(PPRFChunk) + 8) + (SizeChunk(LAYRChunk) + 8) + (SizeChunk(DASHChunk) + 8) + (SizeChunk(CMAPChunk) + 8) + TotalSizeChunks(ChunkList, NumSplines); IntAsBytes(FORMSize, SizeBytes); fprintf(file, "FORM"); fwrite(SizeBytes, 4, 1, file); fprintf(file, "DR2D"); WriteChunk(file, DRHDChunk); FreeChunk(DRHDChunk); WriteChunk(file, PPRFChunk); FreeChunk(PPRFChunk); WriteChunk(file, LAYRChunk); FreeChunk(LAYRChunk); WriteChunk(file, DASHChunk); FreeChunk(DASHChunk); WriteChunk(file, CMAPChunk); FreeChunk(CMAPChunk); WriteChunks(file, ChunkList, NumSplines); FreeChunks(ChunkList, NumSplines); return 0; } static int SizeFloat(float f, char * Format) { char FloatString[100]; return (sprintf(FloatString, Format, f)); } static void IntAsBytes(int value, unsigned char * bytes) { *bytes = (value >> 24) & 0xFF; *(bytes + 1) = (value >> 16) & 0xFF; *(bytes + 2) = (value >> 8) & 0xFF; *(bytes + 3) = value & 0xFF; } static void ShortAsBytes(int value, unsigned char * bytes) { *(bytes + 0) = (value >> 8) & 0xFF; *(bytes + 1) = value & 0xFF; } static void FloatAsIEEEBytes(float value, unsigned char * bytes) { flt2ieee(&value, bytes); } static void flt2ieee(float * flt, unsigned char * bytes) { long RealMant, RealMask, RealExp; long MoveExp; RealMant = (long) *flt; *bytes = 0; *(bytes + 1) = 0; *(bytes + 2) = 0; *(bytes + 3) = 0; if (RealMant) { if (RealMant < 0) { *bytes |= 0x80; RealMant = -RealMant; } for (RealMask = 0x40000000, RealExp = 31; RealMask; RealMask >>= 1, RealExp--) { if (RealMant & RealMask) { break; } } if (RealExp > 24) { RealMant >>= RealExp - 24; } else { RealMant <<= 24 - RealExp; } RealExp -= FIXOFFS; RealExp += 126; MoveExp = RealExp << 23; *bytes |= (MoveExp >> 24) & 0x7F; *(bytes + 1) |= ((MoveExp >> 16) & 0x80) | ((RealMant >> 16) & 0x7F); *(bytes + 2) |= (RealMant >> 8) & 0xFF; *(bytes + 3) |= RealMant & 0xFF; } } autotrace-0.31.1/output-dr2d.h0000664000076400007640000000214407551363410011625 /* output-dr2d.h: output in DR2D format Copyright (C) 2002 Andrew Elia This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_DR2D_H #define OUTPUT_DR2D_H #include "output.h" int output_dr2d_writer(FILE * file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* not OUTPUT_DR2D_H */ autotrace-0.31.1/output-pstoedit.h0000664000076400007640000000271607555264537012650 /* output-pstoedit.h: utility routines for libpstoedit.so functions Copyright (C) 2002 Masatake YAMATO This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef OUTPUT_PSTOEDIT_H #define OUTPUT_PSTOEDIT_H #include #include "output.h" at_output_write_func output_pstoedit_get_writer(const at_string); at_bool output_pstoedit_is_writer (at_output_write_func writer); int output_pstoedit_invoke_writer (at_output_write_func writer, FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); at_bool output_pstoedit_is_unusable_writer(const at_string name); #endif /* Not def: OUTPUTPSTOEDIT_H */ autotrace-0.31.1/output-pstoedit.c0000664000076400007640000002360107555655124012633 /* output-pstoedit.c: utility routines for libpstoedit.so functions Copyright (C) 2002 Masatake YAMATO This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ /* This module uses a temporary file to pass a file to libpstoedit Which functions should I use to create tmpfile? ------------------------------------------------------------------- Function || Security | Availability ---------++------------+------------------------------------------- mktemp || risky | BSD 4.3 mkstemp || no problem | BSD 4.3 tempnam || risky | SVID 2, BSD 4.3 tmpfile || no problem | SVID 3, POSIX, BSD 4.3, ISO 9899, SUSv2 tmpnam || risky | SVID 2, POSIX, BSD 4.3, ISO 9899 ------------------------------------------------------------------- tmpfile returns file pointer, not file name mkstemp is the best in the security aspect, however it is not portable. (Read http://groups.yahoo.com/group/autotrace/message/369) */ #include "output-pstoedit.h" #include "output-p2e.h" #include "filename.h" #include "xstd.h" #include #include #include #include #define BO_DEBUG 0 #define TMPDIR "/tmp/" /* #define OUTPUT_PSTOEDIT_DEBUG */ static char ** pstoedit_suffix_table = NULL; static void pstoedit_suffix_table_init (void); static at_string pstoedit_suffix_table_lookup_deep (const at_string suffix); static at_bool pstoedit_suffix_table_lookup_shallow (const void * suffix); static const at_string get_symbolicname(const at_string suffix); static int output_pstoedit_writer (const at_string suffix, FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); static void remove_temporary_file (const at_string tmpfile_name); static FILE * make_temporary_file(char *template, char * mode); static void pstoedit_suffix_table_init (void) { struct DriverDescription_S* dd_start, *dd_tmp; if (pstoedit_suffix_table != NULL) return; pstoedit_checkversion(pstoeditdllversion); dd_start = getPstoeditDriverInfo_plainC(); if (dd_start) { dd_tmp = dd_start; while (dd_tmp->symbolicname) dd_tmp++; XMALLOC(pstoedit_suffix_table, sizeof(char *) * 2 * (dd_tmp - dd_start) + 1); #if defined (OUTPUT_PSTOEDIT_DEBUG) && defined(__GNUC__) fprintf(stderr, "OUTPUT PSTOEDIT BACKEND DEBUG(%s)\n", __FUNCTION__); #endif /* Def: OUTPUT_PSTOEDIT_DEBUG */ dd_tmp = dd_start; while (dd_tmp->symbolicname) { #ifdef OUTPUT_PSTOEDIT_DEBUG fprintf(stderr, "[symbolicname: %d]%s\n", (dd_tmp - dd_start), dd_tmp->symbolicname); fprintf(stderr, "[ suffix: %d]%s\n", (dd_tmp - dd_start), dd_tmp->suffix); #endif /* Def: OUTPUT_PSTOEDIT_DEBUG */ pstoedit_suffix_table[2 * (dd_tmp - dd_start)] = strdup(dd_tmp->symbolicname); pstoedit_suffix_table[2 * (dd_tmp - dd_start) + 1] = strdup(dd_tmp->suffix); dd_tmp++; } pstoedit_suffix_table[2 * (dd_tmp - dd_start)] = NULL; free(dd_start); } else { XMALLOC(pstoedit_suffix_table, sizeof(char *)); pstoedit_suffix_table[0] = NULL; } } static at_string pstoedit_suffix_table_lookup_deep (const at_string suffix) { char ** tmp; if (pstoedit_suffix_table == NULL) pstoedit_suffix_table_init(); #if defined (OUTPUT_PSTOEDIT_DEBUG) && defined(__GNUC__) fprintf(stderr, "OUTPUT PSTOEDIT BACKEND DEBUG(%s)\n", __FUNCTION__); #endif /* Def: OUTPUT_PSTOEDIT_DEBUG */ for (tmp = pstoedit_suffix_table; *tmp != NULL; tmp++) { #ifdef OUTPUT_PSTOEDIT_DEBUG fprintf(stderr, "%s\n", *tmp); #endif /* Def: OUTPUT_PSTOEDIT_DEBUG */ if (0 == strcmp(suffix, *tmp)) return * tmp; } return NULL; } static at_bool pstoedit_suffix_table_lookup_shallow (const void * suffix) { char ** tmp; if (pstoedit_suffix_table == NULL) pstoedit_suffix_table_init(); for (tmp = pstoedit_suffix_table; *tmp != NULL; tmp++) if (*tmp == suffix) return true; return false; } at_output_write_func output_pstoedit_get_writer(const at_string suffix) { return (at_output_write_func)pstoedit_suffix_table_lookup_deep (suffix); } at_bool output_pstoedit_is_writer (at_output_write_func writer) { return pstoedit_suffix_table_lookup_shallow(writer); } int output_pstoedit_invoke_writer (at_output_write_func writer, FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { return output_pstoedit_writer((const at_string) writer, file, name, llx, lly, urx, ury, opts, shape, msg_func, msg_data); } /* This output routine uses two temporary files to keep the both the command line syntax of autotrace and the pstoedit API. shape -> bo file(tmpfile_name_p2e) -> specified formatted file(tmpfile_name_pstoedit) -> file */ static int output_pstoedit_writer (const at_string suffix, FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { char tmpfile_name_p2e[] = TMPDIR "at-bo-" "XXXXXX"; char tmpfile_name_pstoedit[] = TMPDIR "at-fo-" "XXXXXX"; char * symbolicname; FILE * tmpfile; int result = 0; int c; int argc; #define CMD_INDEX 0 #define SYMBOLICNAME_FLAG_INDEX 1 #define SYMBOLICNAME_VAL_INDEX 2 #define BO_FLAG_INDEX 3 #define INPUT_INDEX 4 #define OUTPUT_INDEX 5 char * argv[] = {"pstoedit", "-f", 0, "-bo", 0, 0}; argc = sizeof(argv) / sizeof(char *); if (false == pstoedit_suffix_table_lookup_shallow(suffix)) { if (msg_func) msg_func ("Suffix for pstoedit backend driver is wrong", AT_MSG_WARNING, msg_data); return -1; } symbolicname = get_symbolicname(suffix); if (!symbolicname) { if (msg_func) msg_func ("Symbolicname for pstoedit backend driver is wrong", AT_MSG_WARNING, msg_data); return -1; } tmpfile = make_temporary_file(tmpfile_name_p2e, "w"); if (NULL == tmpfile) { result = -1; goto remove_tmp_p2e; } /* * shape -> bo file */ output_p2e_writer(tmpfile, tmpfile_name_p2e, llx, lly, urx, ury, opts, shape, msg_func, msg_data); fclose(tmpfile); tmpfile = make_temporary_file(tmpfile_name_pstoedit, "r"); if (NULL == tmpfile) { result = -1; goto remove_tmp_pstoedit; } /* * bo file -> specified formatted file */ argv[SYMBOLICNAME_VAL_INDEX] = symbolicname; argv[INPUT_INDEX] = tmpfile_name_p2e; argv[OUTPUT_INDEX] = tmpfile_name_pstoedit; pstoedit_plainC(argc, argv, NULL); /* * specified formatted file(tmpfile_name_pstoedit) -> file */ /* fseek(tmpfile, 0, SEEK_SET); */ while (EOF != (c = fgetc(tmpfile))) fputc(c, file); fclose(tmpfile); remove_tmp_pstoedit: remove_temporary_file(tmpfile_name_pstoedit); remove_tmp_p2e: remove_temporary_file(tmpfile_name_p2e); free(symbolicname); return result; } at_bool output_pstoedit_is_unusable_writer(const at_string name) { if (0 == strcmp(name, "sam") || 0 == strcmp(name, "dbg") || 0 == strcmp(name, "gs") || 0 == strcmp(name, "psf") || 0 == strcmp(name, "fps") || 0 == strcmp(name, "ps") || 0 == strcmp(name, "spsc") || 0 == strcmp(name, "debug") || 0 == strcmp(name, "dump") || 0 == strcmp(name, "ps2as")) return true; else return false; } /* get_symbolicname --- Return symbolicname associated with SUFFIX If SUFFIX itself a symbolicname, just return SUFFIX. If SUFFIX doesn't have any associated symbolicname and it is not a suffix registered in pstoedit, reutrn NULL. */ static const at_string get_symbolicname(const at_string suffix) { at_string symbolicname = NULL; struct DriverDescription_S* dd_start, * dd_tmp; if (!suffix) return NULL; dd_start = getPstoeditDriverInfo_plainC(); if (dd_start) { dd_tmp = dd_start; while (dd_tmp->symbolicname) { if (0 == strcmp(dd_tmp->suffix, suffix)) { symbolicname = strdup(dd_tmp->symbolicname); break; } else if (0 == strcmp(dd_tmp->symbolicname, suffix)) { symbolicname = strdup(suffix); break; } else dd_tmp++; } free (dd_start); } return symbolicname; } /* make_temporary_file --- Make a temporary file */ static FILE * make_temporary_file(char *template, char * mode) { #ifdef HAVE_MKSTEMP /* #warning "To make temporary file, mkstemp will be used." */ int tmpfd; tmpfd = mkstemp(template); if (tmpfd < 0) return NULL; return fdopen(tmpfd, mode); #else /* #warning "To make temporary file, tmpnam will be used." */ char * tmpname; tmpname = tmpnam(template); if (template == NULL) return NULL; return fopen(tmpname, mode); #endif /* HAVE_MKSTEMP */ } static void remove_temporary_file (const at_string tmpfile_name) { #if BO_DEBUG == 0 remove (tmpfile_name); #else fprintf(stderr, "tmp file name: %s\n", tmpfile_name); #endif /* Not BO_DEBUG == 0 */ } autotrace-0.31.1/fit.c0000664000076400007640000016466407561267002010232 /* fit.c: turn a bitmap representation of a curve into a list of splines. Some of the ideas, but not the code, comes from the Phoenix thesis. See README for the reference. The code was partially derived from limn. Copyright (C) 1992 Free Software Foundation, Inc. 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "autotrace.h" #include "fit.h" #include "message.h" #include "logreport.h" #include "spline.h" #include "vector.h" #include "curve.h" #include "pxl-outline.h" #include "epsilon-equal.h" #include "xstd.h" #include #ifndef FLT_MAX #include #include #endif #ifndef FLT_MIN #include #include #endif #include #include #define SQUARE(x) ((x) * (x)) #define CUBE(x) ((x) * (x) * (x)) #define ROUND(x) ((unsigned short) ((unsigned short) (x) + .5 * SIGN (x))) #define SIGN(x) ((x) > 0 ? 1 : (x) < 0 ? -1 : 0) /* We need to manipulate lists of array indices. */ typedef struct index_list { unsigned *data; unsigned length; } index_list_type; /* The usual accessor macros. */ #define GET_INDEX(i_l, n) ((i_l).data[n]) #define INDEX_LIST_LENGTH(i_l) ((i_l).length) #define GET_LAST_INDEX(i_l) ((i_l).data[INDEX_LIST_LENGTH (i_l) - 1]) static void append_index (index_list_type *, unsigned); static void free_index_list (index_list_type *); static index_list_type new_index_list (void); static void remove_adjacent_corners (index_list_type *, unsigned, at_bool, at_exception_type * exception); static void change_bad_lines (spline_list_type *, fitting_opts_type *); static void filter (curve_type, fitting_opts_type *); static void find_vectors (unsigned, pixel_outline_type, vector_type *, vector_type *, unsigned); static index_list_type find_corners (pixel_outline_type, fitting_opts_type *, at_exception_type * exception); static at_real find_error (curve_type, spline_type, unsigned *, at_exception_type * exception); static vector_type find_half_tangent (curve_type, at_bool start, unsigned *, unsigned); static void find_tangent (curve_type, at_bool, at_bool, unsigned); static spline_type fit_one_spline (curve_type, at_exception_type * exception); static spline_list_type *fit_curve (curve_type, fitting_opts_type *, at_exception_type * exception); static spline_list_type fit_curve_list (curve_list_type, fitting_opts_type *, distance_map_type *, at_exception_type * exception); static spline_list_type *fit_with_least_squares (curve_type, fitting_opts_type *, at_exception_type * exception); static spline_list_type *fit_with_line (curve_type); static void remove_knee_points (curve_type, at_bool); static void set_initial_parameter_values (curve_type); static at_bool spline_linear_enough (spline_type *, curve_type, fitting_opts_type *); static curve_list_array_type split_at_corners (pixel_outline_list_type, fitting_opts_type *, at_exception_type * exception); static at_coord real_to_int_coord (at_real_coord); static at_real distance (at_real_coord, at_real_coord); /* Get a new set of fitting options */ fitting_opts_type new_fitting_opts (void) { fitting_opts_type fitting_opts; fitting_opts.background_color = NULL; fitting_opts.color_count = 0; fitting_opts.corner_always_threshold = (at_real) 60.0; fitting_opts.corner_surround = 4; fitting_opts.corner_threshold = (at_real) 100.0; fitting_opts.error_threshold = (at_real) 2.0; fitting_opts.filter_iterations = 4; fitting_opts.line_reversion_threshold = (at_real) .01; fitting_opts.line_threshold = (at_real) 1.0; fitting_opts.remove_adjacent_corners = false; fitting_opts.tangent_surround = 3; fitting_opts.despeckle_level = 0; fitting_opts.despeckle_tightness = 2.0; fitting_opts.centerline = false; fitting_opts.preserve_width = false; fitting_opts.width_weight_factor = 6.0; return (fitting_opts); } /* The top-level call that transforms the list of pixels in the outlines of the original character to a list of spline lists fitted to those pixels. */ spline_list_array_type fitted_splines (pixel_outline_list_type pixel_outline_list, fitting_opts_type *fitting_opts, distance_map_type *dist, unsigned short width, unsigned short height, at_exception_type * exception, at_progress_func notify_progress, at_address progress_data, at_testcancel_func test_cancel, at_address testcancel_data) { unsigned this_list; spline_list_array_type char_splines = new_spline_list_array (); curve_list_array_type curve_array = split_at_corners (pixel_outline_list, fitting_opts, exception); char_splines.centerline = fitting_opts->centerline; char_splines.preserve_width = fitting_opts->preserve_width; char_splines.width_weight_factor = fitting_opts->width_weight_factor; if (fitting_opts->background_color) char_splines.background_color = at_color_copy(fitting_opts->background_color); else char_splines.background_color = NULL; /* Set dummy values. Real value is set in upper context. */ char_splines.width = width; char_splines.height = height; for (this_list = 0; this_list < CURVE_LIST_ARRAY_LENGTH (curve_array); this_list++) { spline_list_type curve_list_splines; curve_list_type curves = CURVE_LIST_ARRAY_ELT (curve_array, this_list); if (notify_progress) notify_progress((((at_real)this_list)/((at_real)CURVE_LIST_ARRAY_LENGTH (curve_array)*(at_real)3.0) + (at_real)0.333), progress_data); if (test_cancel && test_cancel(testcancel_data)) goto cleanup; LOG1 ("\nFitting curve list #%u:\n", this_list); curve_list_splines = fit_curve_list (curves, fitting_opts, dist, exception); if (at_exception_got_fatal(exception)) { if (char_splines.background_color) at_color_free(char_splines.background_color); goto cleanup; } curve_list_splines.clockwise = curves.clockwise; memcpy (&(curve_list_splines.color), &(O_LIST_OUTLINE(pixel_outline_list, this_list).color), sizeof (color_type)); append_spline_list (&char_splines, curve_list_splines); } cleanup: free_curve_list_array (&curve_array, notify_progress, progress_data); flush_log_output (); return char_splines; } /* Fit the list of curves CURVE_LIST to a list of splines, and return it. CURVE_LIST represents a single closed paths, e.g., either the inside or outside outline of an `o'. */ static spline_list_type fit_curve_list (curve_list_type curve_list, fitting_opts_type *fitting_opts, distance_map_type *dist, at_exception_type * exception) { curve_type curve; unsigned this_curve, this_spline; unsigned curve_list_length = CURVE_LIST_LENGTH (curve_list); spline_list_type curve_list_splines = empty_spline_list(); curve_list_splines.open = curve_list.open; /* Remove the extraneous ``knee'' points before filtering. Since the corners have already been found, we don't need to worry about removing a point that should be a corner. */ LOG ("\nRemoving knees:\n"); for (this_curve = 0; this_curve < curve_list_length; this_curve++) { LOG1 ("#%u:", this_curve); remove_knee_points (CURVE_LIST_ELT (curve_list, this_curve), CURVE_LIST_CLOCKWISE (curve_list)); } if (dist != NULL) { unsigned this_point; unsigned height = dist->height; for (this_curve = 0; this_curve < curve_list_length; this_curve++) { curve = CURVE_LIST_ELT (curve_list, this_curve); for (this_point = 0; this_point < CURVE_LENGTH (curve); this_point++) { unsigned x, y; float width, w; at_real_coord *coord = &CURVE_POINT(curve, this_point); x = (unsigned)(coord->x); y = height - (unsigned)(coord->y) - 1; /* Each (x, y) is a point on the skeleton of the curve, which might be offset from the true centerline, where the width is maximal. Therefore, use as the local line width the maximum distance over the neighborhood of (x, y). */ width = dist->d[y][x]; if (y - 1 >= 0) { if ((w = dist->d[y-1][x]) > width) width = w; if (x - 1 >= 0) { if ((w = dist->d[y][x-1]) > width) width = w; if ((w = dist->d[y-1][x-1]) > width) width = w; } if (x + 1 < dist->width) { if ((w = dist->d[y][x+1]) > width) width = w; if ((w = dist->d[y-1][x+1]) > width) width = w; } } if (y + 1 < height) { if ((w = dist->d[y+1][x]) > width) width = w; if (x - 1 >= 0 && (w = dist->d[y+1][x-1]) > width) width = w; if (x + 1 < dist->width && (w = dist->d[y+1][x+1]) > width) width = w; } coord->z = width * (fitting_opts->width_weight_factor); } } } /* We filter all the curves in CURVE_LIST at once; otherwise, we would look at an unfiltered curve when computing tangents. */ LOG ("\nFiltering curves:\n"); for (this_curve = 0; this_curve < curve_list.length; this_curve++) { LOG1 ("#%u: ", this_curve); filter (CURVE_LIST_ELT (curve_list, this_curve), fitting_opts); } /* Make the first point in the first curve also be the last point in the last curve, so the fit to the whole curve list will begin and end at the same point. This may cause slight errors in computing the tangents and t values, but it's worth it for the continuity. Of course we don't want to do this if the two points are already the same, as they are if the curve is cyclic. (We don't append it earlier, in `split_at_corners', because that confuses the filtering.) Finally, we can't append the point if the curve is exactly three points long, because we aren't adding any more data, and three points isn't enough to determine a spline. Therefore, the fitting will fail. */ curve = CURVE_LIST_ELT (curve_list, 0); if (CURVE_CYCLIC (curve) == true) append_point (curve, CURVE_POINT (curve, 0)); /* Finally, fit each curve in the list to a list of splines. */ for (this_curve = 0; this_curve < curve_list_length; this_curve++) { spline_list_type *curve_splines; curve_type current_curve = CURVE_LIST_ELT (curve_list, this_curve); LOG1 ("\nFitting curve #%u:\n", this_curve); curve_splines = fit_curve (current_curve, fitting_opts, exception); if (at_exception_got_fatal(exception)) goto cleanup; else if (curve_splines == NULL) { LOG1 ("Could not fit curve #%u", this_curve); at_exception_warning(exception, "Could not fit curve"); } else { LOG1 ("Fitted splines for curve #%u:\n", this_curve); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (*curve_splines); this_spline++) { LOG1 (" %u: ", this_spline); if (log_file) print_spline (log_file, SPLINE_LIST_ELT (*curve_splines, this_spline)); } /* After fitting, we may need to change some would-be lines back to curves, because they are in a list with other curves. */ change_bad_lines (curve_splines, fitting_opts); concat_spline_lists (&curve_list_splines, *curve_splines); free_spline_list (*curve_splines); free (curve_splines); } } if (log_file) { LOG ("\nFitted splines are:\n"); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (curve_list_splines); this_spline++) { LOG1 (" %u: ", this_spline); print_spline (log_file, SPLINE_LIST_ELT (curve_list_splines, this_spline)); } } cleanup: return curve_list_splines; } /* Transform a set of locations to a list of splines (the fewer the better). We are guaranteed that CURVE does not contain any corners. We return NULL if we cannot fit the points at all. */ static spline_list_type * fit_curve (curve_type curve, fitting_opts_type *fitting_opts, at_exception_type *exception) { spline_list_type *fittedsplines; if (CURVE_LENGTH (curve) < 2) { LOG ("Tried to fit curve with less than two points"); at_exception_warning(exception, "Tried to fit curve with less than two points"); return NULL; } /* Do we have enough points to fit with a spline? */ fittedsplines = CURVE_LENGTH (curve) < 4 ? fit_with_line (curve) : fit_with_least_squares (curve, fitting_opts, exception); return fittedsplines; } /* As mentioned above, the first step is to find the corners in PIXEL_LIST, the list of points. (Presumably we can't fit a single spline around a corner.) The general strategy is to look through all the points, remembering which we want to consider corners. Then go through that list, producing the curve_list. This is dictated by the fact that PIXEL_LIST does not necessarily start on a corner---it just starts at the character's first outline pixel, going left-to-right, top-to-bottom. But we want all our splines to start and end on real corners. For example, consider the top of a capital `C' (this is in cmss20): x *********** ****************** PIXEL_LIST will start at the pixel below the `x'. If we considered this pixel a corner, we would wind up matching a very small segment from there to the end of the line, probably as a straight line, which is certainly not what we want. PIXEL_LIST has one element for each closed outline on the character. To preserve this information, we return an array of curve_lists, one element (which in turn consists of several curves, one between each pair of corners) for each element in PIXEL_LIST. */ static curve_list_array_type split_at_corners (pixel_outline_list_type pixel_list, fitting_opts_type *fitting_opts, at_exception_type * exception) { unsigned this_pixel_o; curve_list_array_type curve_array = new_curve_list_array (); LOG ("\nFinding corners:\n"); for (this_pixel_o = 0; this_pixel_o < O_LIST_LENGTH (pixel_list); this_pixel_o++) { curve_type curve, first_curve; index_list_type corner_list; unsigned p, this_corner; curve_list_type curve_list = new_curve_list (); pixel_outline_type pixel_o = O_LIST_OUTLINE (pixel_list, this_pixel_o); CURVE_LIST_CLOCKWISE (curve_list) = O_CLOCKWISE (pixel_o); curve_list.open = pixel_o.open; LOG1 ("#%u:", this_pixel_o); /* If the outline does not have enough points, we can't do anything. The endpoints of the outlines are automatically corners. We need at least `corner_surround' more pixels on either side of a point before it is conceivable that we might want another corner. */ if (O_LENGTH (pixel_o) > fitting_opts->corner_surround * 2 + 2) corner_list = find_corners (pixel_o, fitting_opts, exception); else { int surround; if ((surround = (int)(O_LENGTH (pixel_o) - 3) / 2) >= 2) { unsigned save_corner_surround = fitting_opts->corner_surround; fitting_opts->corner_surround = surround; corner_list = find_corners (pixel_o, fitting_opts, exception); fitting_opts->corner_surround = save_corner_surround; } else { corner_list.length = 0; corner_list.data = NULL; } } /* Remember the first curve so we can make it be the `next' of the last one. (And vice versa.) */ first_curve = new_curve (); curve = first_curve; if (corner_list.length == 0) { /* No corners. Use all of the pixel outline as the curve. */ for (p = 0; p < O_LENGTH (pixel_o); p++) append_pixel (curve, O_COORDINATE (pixel_o, p)); if (curve_list.open == true) CURVE_CYCLIC (curve) = false; else CURVE_CYCLIC (curve) = true; } else { /* Each curve consists of the points between (inclusive) each pair of corners. */ for (this_corner = 0; this_corner < corner_list.length - 1; this_corner++) { curve_type previous_curve = curve; unsigned corner = GET_INDEX (corner_list, this_corner); unsigned next_corner = GET_INDEX (corner_list, this_corner + 1); for (p = corner; p <= next_corner; p++) append_pixel (curve, O_COORDINATE (pixel_o, p)); append_curve (&curve_list, curve); curve = new_curve (); NEXT_CURVE (previous_curve) = curve; PREVIOUS_CURVE (curve) = previous_curve; } /* The last curve is different. It consists of the points (inclusive) between the last corner and the end of the list, and the beginning of the list and the first corner. */ for (p = GET_LAST_INDEX (corner_list); p < O_LENGTH (pixel_o); p++) append_pixel (curve, O_COORDINATE (pixel_o, p)); if (!pixel_o.open) { for (p = 0; p <= GET_INDEX (corner_list, 0); p++) append_pixel (curve, O_COORDINATE (pixel_o, p)); } else { curve_type last_curve = PREVIOUS_CURVE(curve); PREVIOUS_CURVE(first_curve) = NULL; if (last_curve) NEXT_CURVE(last_curve) = NULL; } } LOG1 (" [%u].\n", corner_list.length); free_index_list (&corner_list); /* Add `curve' to the end of the list, updating the pointers in the chain. */ append_curve (&curve_list, curve); NEXT_CURVE (curve) = first_curve; PREVIOUS_CURVE (first_curve) = curve; /* And now add the just-completed curve list to the array. */ append_curve_list (&curve_array, curve_list); } /* End of considering each pixel outline. */ return curve_array; } /* We consider a point to be a corner if (1) the angle defined by the `corner_surround' points coming into it and going out from it is less than `corner_threshold' degrees, and no point within `corner_surround' points has a smaller angle; or (2) the angle is less than `corner_always_threshold' degrees. Because of the different cases, it is convenient to have the following macro to append a corner on to the list we return. The character argument C is simply so that the different cases can be distinguished in the log file. */ #define APPEND_CORNER(index, angle, c) \ do \ { \ append_index (&corner_list, index); \ LOG4 (" (%d,%d)%c%.3f", \ O_COORDINATE (pixel_outline, index).x, \ O_COORDINATE (pixel_outline, index).y, \ c, angle); \ } \ while (0) static index_list_type find_corners (pixel_outline_type pixel_outline, fitting_opts_type *fitting_opts, at_exception_type * exception) { unsigned p, start_p, end_p; index_list_type corner_list = new_index_list (); start_p = 0; end_p = O_LENGTH(pixel_outline) - 1; if (pixel_outline.open) { if (end_p <= fitting_opts->corner_surround * 2) return corner_list; APPEND_CORNER(0, 0.0, '@'); start_p += fitting_opts->corner_surround; end_p -= fitting_opts->corner_surround; } /* Consider each pixel on the outline in turn. */ for (p = start_p; p <= end_p; p++) { at_real corner_angle; vector_type in_vector, out_vector; /* Check if the angle is small enough. */ find_vectors (p, pixel_outline, &in_vector, &out_vector, fitting_opts->corner_surround); corner_angle = Vangle (in_vector, out_vector, exception); if (at_exception_got_fatal(exception)) goto cleanup; if (fabs (corner_angle) <= fitting_opts->corner_threshold) { /* We want to keep looking, instead of just appending the first pixel we find with a small enough angle, since there might be another corner within `corner_surround' pixels, with a smaller angle. If that is the case, we want that one. */ at_real best_corner_angle = corner_angle; unsigned best_corner_index = p; index_list_type equally_good_list = new_index_list (); /* As we come into the loop, `p' is the index of the point that has an angle less than `corner_angle'. We use `i' to move through the pixels next to that, and `q' for moving through the adjacent pixels to each `p'. */ unsigned q = p; unsigned i = p + 1; while (true) { /* Perhaps the angle is sufficiently small that we want to consider this a corner, even if it's not the best (unless we've already wrapped around in the search, i.e., `qcorner_always_threshold && q >= p) APPEND_CORNER (q, corner_angle, '\\'); /* Exit the loop if we've looked at `corner_surround' pixels past the best one we found, or if we've looked at all the pixels. */ if (i >= best_corner_index + fitting_opts->corner_surround || i >= O_LENGTH (pixel_outline)) break; /* Check the angle. */ q = i % O_LENGTH (pixel_outline); find_vectors (q, pixel_outline, &in_vector, &out_vector, fitting_opts->corner_surround); corner_angle = Vangle (in_vector, out_vector, exception); if (at_exception_got_fatal(exception)) goto cleanup; /* If we come across a corner that is just as good as the best one, we should make it a corner, too. This happens, for example, at the points on the `W' in some typefaces, where the ``points'' are flat. */ if (epsilon_equal (corner_angle, best_corner_angle)) append_index (&equally_good_list, q); else if (corner_angle < best_corner_angle) { best_corner_angle = corner_angle; /* We want to check `corner_surround' pixels beyond the new best corner. */ i = best_corner_index = q; free_index_list (&equally_good_list); equally_good_list = new_index_list (); } i++; } /* After we exit the loop, `q' is the index of the last point we checked. We have already added the corner if `best_corner_angle' is less than `corner_always_threshold'. Again, if we've already wrapped around, we don't want to add the corner again. */ if (best_corner_angle > fitting_opts->corner_always_threshold && best_corner_index >= p) { unsigned j; APPEND_CORNER (best_corner_index, best_corner_angle, '/'); for (j = 0; j < INDEX_LIST_LENGTH (equally_good_list); j++) APPEND_CORNER (GET_INDEX (equally_good_list, j), best_corner_angle, '@'); } free_index_list (&equally_good_list); /* If we wrapped around in our search, we're done; otherwise, we don't want the outer loop to look at the pixels that we already looked at in searching for the best corner. */ p = (q < p) ? O_LENGTH (pixel_outline) : q; } /* End of searching for the best corner. */ } /* End of considering each pixel. */ if (INDEX_LIST_LENGTH (corner_list) > 0) /* We never want two corners next to each other, since the only way to fit such a ``curve'' would be with a straight line, which usually interrupts the continuity dreadfully. */ remove_adjacent_corners (&corner_list, O_LENGTH (pixel_outline) - (pixel_outline.open ? 2 : 1), fitting_opts->remove_adjacent_corners, exception); cleanup: return corner_list; } /* Return the difference vectors coming in and going out of the outline OUTLINE at the point whose index is TEST_INDEX. In Phoenix, Schneider looks at a single point on either side of the point we're considering. That works for him because his points are not touching. But our points *are* touching, and so we have to look at `corner_surround' points on either side, to get a better picture of the outline's shape. */ static void find_vectors (unsigned test_index, pixel_outline_type outline, vector_type *in, vector_type *out, unsigned corner_surround) { int i; unsigned n_done; at_coord candidate = O_COORDINATE (outline, test_index); in->dx = in->dy = in->dz = 0.0; out->dx = out->dy = out->dz = 0.0; /* Add up the differences from p of the `corner_surround' points before p. */ for (i = O_PREV (outline, test_index), n_done = 0; n_done < corner_surround; i = O_PREV (outline, i), n_done++) *in = Vadd (*in, IPsubtract (O_COORDINATE (outline, i), candidate)); /* And the points after p. */ for (i = O_NEXT (outline, test_index), n_done = 0; n_done < corner_surround; i = O_NEXT (outline, i), n_done++) *out = Vadd (*out, IPsubtract (O_COORDINATE (outline, i), candidate)); } /* Remove adjacent points from the index list LIST. We do this by first sorting the list and then running through it. Since these lists are quite short, a straight selection sort (e.g., p.139 of the Art of Computer Programming, vol.3) is good enough. LAST_INDEX is the index of the last pixel on the outline, i.e., the next one is the first pixel. We need this for checking the adjacency of the last corner. We need to do this because the adjacent corners turn into two-pixel-long curves, which can only be fit by straight lines. */ static void remove_adjacent_corners (index_list_type *list, unsigned last_index, at_bool remove_adj_corners, at_exception_type * exception) { unsigned j; unsigned last; index_list_type new_list = new_index_list (); for (j = INDEX_LIST_LENGTH (*list) - 1; j > 0; j--) { unsigned search; unsigned temp; /* Find maximal element below `j'. */ unsigned max_index = j; for (search = 0; search < j; search++) if (GET_INDEX (*list, search) > GET_INDEX (*list, max_index)) max_index = search; if (max_index != j) { temp = GET_INDEX (*list, j); GET_INDEX (*list, j) = GET_INDEX (*list, max_index); GET_INDEX (*list, max_index) = temp; /* xx -- really have to sort? */ LOG ("needed exchange"); at_exception_warning(exception, "needed exchange"); } } /* The list is sorted. Now look for adjacent entries. Each time through the loop we insert the current entry and, if appropriate, the next entry. */ for (j = 0; j < INDEX_LIST_LENGTH (*list) - 1; j++) { unsigned current = GET_INDEX (*list, j); unsigned next = GET_INDEX (*list, j + 1); /* We should never have inserted the same element twice. */ /* assert (current != next); */ if ((remove_adj_corners) && ((next == current + 1) || (next == current))) j++; append_index (&new_list, current); } /* Don't append the last element if it is 1) adjacent to the previous one; or 2) adjacent to the very first one. */ last = GET_LAST_INDEX (*list); if (INDEX_LIST_LENGTH (new_list) == 0 || !(last == GET_LAST_INDEX (new_list) + 1 || (last == last_index && GET_INDEX (*list, 0) == 0))) append_index (&new_list, last); free_index_list (list); *list = new_list; } /* A ``knee'' is a point which forms a ``right angle'' with its predecessor and successor. See the documentation (the `Removing knees' section) for an example and more details. The argument CLOCKWISE tells us which direction we're moving. (We can't figure that information out from just the single segment with which we are given to work.) We should never find two consecutive knees. Since the first and last points are corners (unless the curve is cyclic), it doesn't make sense to remove those. */ /* This evaluates to true if the vector V is zero in one direction and nonzero in the other. */ #define ONLY_ONE_ZERO(v) \ (((v).dx == 0.0 && (v).dy != 0.0) || ((v).dy == 0.0 && (v).dx != 0.0)) /* There are four possible cases for knees, one for each of the four corners of a rectangle; and then the cases differ depending on which direction we are going around the curve. The tests are listed here in the order of upper left, upper right, lower right, lower left. Perhaps there is some simple pattern to the clockwise/counterclockwise differences, but I don't see one. */ #define CLOCKWISE_KNEE(prev_delta, next_delta) \ ((prev_delta.dx == -1.0 && next_delta.dy == 1.0) \ || (prev_delta.dy == 1.0 && next_delta.dx == 1.0) \ || (prev_delta.dx == 1.0 && next_delta.dy == -1.0) \ || (prev_delta.dy == -1.0 && next_delta.dx == -1.0)) #define COUNTERCLOCKWISE_KNEE(prev_delta, next_delta) \ ((prev_delta.dy == 1.0 && next_delta.dx == -1.0) \ || (prev_delta.dx == 1.0 && next_delta.dy == 1.0) \ || (prev_delta.dy == -1.0 && next_delta.dx == 1.0) \ || (prev_delta.dx == -1.0 && next_delta.dy == -1.0)) static void remove_knee_points (curve_type curve, at_bool clockwise) { unsigned i; unsigned offset = (CURVE_CYCLIC (curve) == true) ? 0 : 1; at_coord previous = real_to_int_coord (CURVE_POINT (curve, CURVE_PREV (curve, offset))); curve_type trimmed_curve = copy_most_of_curve (curve); if (CURVE_CYCLIC (curve) == false) append_pixel (trimmed_curve, real_to_int_coord (CURVE_POINT (curve, 0))); for (i = offset; i < CURVE_LENGTH (curve) - offset; i++) { at_coord current = real_to_int_coord (CURVE_POINT (curve, i)); at_coord next = real_to_int_coord (CURVE_POINT (curve, CURVE_NEXT (curve, i))); vector_type prev_delta = IPsubtract (previous, current); vector_type next_delta = IPsubtract (next, current); if (ONLY_ONE_ZERO (prev_delta) && ONLY_ONE_ZERO (next_delta) && ((clockwise && CLOCKWISE_KNEE (prev_delta, next_delta)) || (!clockwise && COUNTERCLOCKWISE_KNEE (prev_delta, next_delta)))) LOG2 (" (%d,%d)", current.x, current.y); else { previous = current; append_pixel (trimmed_curve, current); } } if (CURVE_CYCLIC (curve) == false) append_pixel (trimmed_curve, real_to_int_coord (LAST_CURVE_POINT (curve))); if (CURVE_LENGTH (trimmed_curve) == CURVE_LENGTH (curve)) LOG (" (none)"); LOG (".\n"); free_curve (curve); *curve = *trimmed_curve; free (trimmed_curve); /* free_curve? --- Masatake */ } /* Smooth the curve by adding in neighboring points. Do this `filter_iterations' times. But don't change the corners. */ static void filter (curve_type curve, fitting_opts_type *fitting_opts) { unsigned iteration, this_point; unsigned offset = (CURVE_CYCLIC (curve) == true) ? 0 : 1; at_real_coord prev_new_point; /* We must have at least three points---the previous one, the current one, and the next one. But if we don't have at least five, we will probably collapse the curve down onto a single point, which means we won't be able to fit it with a spline. */ if (CURVE_LENGTH (curve) < 5) { LOG1 ("Length is %u, not enough to filter.\n", CURVE_LENGTH (curve)); return; } prev_new_point.x = FLT_MAX; prev_new_point.y = FLT_MAX; prev_new_point.z = FLT_MAX; for (iteration = 0; iteration < fitting_opts->filter_iterations; iteration++) { curve_type newcurve = copy_most_of_curve (curve); at_bool collapsed = false; /* Keep the first point on the curve. */ if (offset) append_point (newcurve, CURVE_POINT (curve, 0)); for (this_point = offset; this_point < CURVE_LENGTH (curve) - offset; this_point++) { vector_type in, out, sum; at_real_coord new_point; /* Calculate the vectors in and out, computed by looking at n points on either side of this_point. Experimental it was found that 2 is optimal. */ signed int prev, prevprev; /* have to be signed */ unsigned int next, nextnext; at_real_coord candidate = CURVE_POINT (curve, this_point); prev = CURVE_PREV (curve, this_point); prevprev = CURVE_PREV (curve, prev); next = CURVE_NEXT (curve, this_point); nextnext = CURVE_NEXT (curve, next); /* Add up the differences from p of the `surround' points before p. */ in.dx = in.dy = in.dz = 0.0; in = Vadd (in, Psubtract (CURVE_POINT (curve, prev), candidate)); if (prevprev >= 0) in = Vadd (in, Psubtract (CURVE_POINT (curve, prevprev), candidate)); /* And the points after p. Don't use more points after p than we ended up with before it. */ out.dx = out.dy = out.dz = 0.0; out = Vadd (out, Psubtract (CURVE_POINT (curve, next), candidate)); if (nextnext < CURVE_LENGTH (curve)) out = Vadd (out, Psubtract (CURVE_POINT (curve, nextnext), candidate)); /* Start with the old point. */ new_point = candidate; sum = Vadd (in, out); /* We added 2*n+2 points, so we have to divide the sum by 2*n+2 */ new_point.x += sum.dx / 6; new_point.y += sum.dy / 6; new_point.z += sum.dz / 6; if (fabs (prev_new_point.x - new_point.x) < 0.3 && fabs (prev_new_point.y - new_point.y) < 0.3 && fabs (prev_new_point.z - new_point.z) < 0.3) { collapsed = true; break; } /* Put the newly computed point into a separate curve, so it doesn't affect future computation (on this iteration). */ append_point (newcurve, prev_new_point = new_point); } if (collapsed) free_curve (newcurve); else { /* Just as with the first point, we have to keep the last point. */ if (offset) append_point (newcurve, LAST_CURVE_POINT (curve)); /* Set the original curve to the newly filtered one, and go again. */ free_curve (curve); *curve = *newcurve; } free (newcurve); } log_curve (curve, false); } /* This routine returns the curve fitted to a straight line in a very simple way: make the first and last points on the curve be the endpoints of the line. This simplicity is justified because we are called only on very short curves. */ static spline_list_type * fit_with_line (curve_type curve) { spline_type line; LOG ("Fitting with straight line:\n"); SPLINE_DEGREE (line) = LINEARTYPE; START_POINT (line) = CONTROL1 (line) = CURVE_POINT (curve, 0); END_POINT (line) = CONTROL2 (line) = LAST_CURVE_POINT (curve); /* Make sure that this line is never changed to a cubic. */ SPLINE_LINEARITY (line) = 0; if (log_file) { LOG (" "); print_spline (log_file, line); } return new_spline_list_with_spline (line); } /* The least squares method is well described in Schneider's thesis. Briefly, we try to fit the entire curve with one spline. If that fails, we subdivide the curve. */ static spline_list_type * fit_with_least_squares (curve_type curve, fitting_opts_type *fitting_opts, at_exception_type * exception) { at_real error = 0, best_error = FLT_MAX; spline_type spline, best_spline; spline_list_type *spline_list = NULL; unsigned worst_point = 0; at_real previous_error = FLT_MAX; LOG ("\nFitting with least squares:\n"); /* Phoenix reduces the number of points with a ``linear spline technique''. But for fitting letterforms, that is inappropriate. We want all the points we can get. */ /* It makes no difference whether we first set the `t' values or find the tangents. This order makes the documentation a little more coherent. */ LOG ("Finding tangents:\n"); find_tangent (curve, /* to_start */ true, /* cross_curve */ false, fitting_opts->tangent_surround); find_tangent (curve, /* to_start */ false, /* cross_curve */ false, fitting_opts->tangent_surround); set_initial_parameter_values (curve); /* Now we loop, subdividing, until CURVE has been fit. */ while (true) { spline = best_spline = fit_one_spline (curve, exception); if (at_exception_got_fatal(exception)) goto cleanup; if (SPLINE_DEGREE(spline) == LINEARTYPE) LOG (" fitted to line:\n"); else LOG (" fitted to spline:\n"); if (log_file) { LOG (" "); print_spline (log_file, spline); } if (SPLINE_DEGREE(spline) == LINEARTYPE) break; error = find_error (curve, spline, &worst_point, exception); if (error <= previous_error) { best_error = error; best_spline = spline; } break; } if (SPLINE_DEGREE(spline) == LINEARTYPE) { spline_list = new_spline_list_with_spline (spline); LOG1 ("Accepted error of %.3f.\n", error); return (spline_list); } /* Go back to the best fit. */ spline = best_spline; error = best_error; if (error < fitting_opts->error_threshold && CURVE_CYCLIC(curve) == false) { /* The points were fitted with a spline. We end up here whenever a fit is accepted. We have one more job: see if the ``curve'' that was fit should really be a straight line. */ if (spline_linear_enough (&spline, curve, fitting_opts)) { SPLINE_DEGREE (spline) = LINEARTYPE; LOG ("Changed to line.\n"); } spline_list = new_spline_list_with_spline (spline); LOG1 ("Accepted error of %.3f.\n", error); } else { /* We couldn't fit the curve acceptably, so subdivide. */ unsigned subdivision_index; spline_list_type *left_spline_list; spline_list_type *right_spline_list; curve_type left_curve = new_curve (); curve_type right_curve = new_curve (); /* Keep the linked list of curves intact. */ NEXT_CURVE (right_curve) = NEXT_CURVE (curve); PREVIOUS_CURVE (right_curve) = left_curve; NEXT_CURVE (left_curve) = right_curve; PREVIOUS_CURVE (left_curve) = curve; NEXT_CURVE (curve) = left_curve; LOG1 ("\nSubdividing (error %.3f):\n", error); LOG3 (" Original point: (%.3f,%.3f), #%u.\n", CURVE_POINT (curve, worst_point).x, CURVE_POINT (curve, worst_point).y, worst_point); subdivision_index = worst_point; LOG3 (" Final point: (%.3f,%.3f), #%u.\n", CURVE_POINT (curve, subdivision_index).x, CURVE_POINT (curve, subdivision_index).y, subdivision_index); /* The last point of the left-hand curve will also be the first point of the right-hand curve. */ CURVE_LENGTH (left_curve) = subdivision_index + 1; CURVE_LENGTH (right_curve) = CURVE_LENGTH (curve) - subdivision_index; left_curve->point_list = curve->point_list; right_curve->point_list = curve->point_list + subdivision_index; /* We want to use the tangents of the curve which we are subdividing for the start tangent for left_curve and the end tangent for right_curve. */ CURVE_START_TANGENT (left_curve) = CURVE_START_TANGENT (curve); CURVE_END_TANGENT (right_curve) = CURVE_END_TANGENT (curve); /* We have to set up the two curves before finding the tangent at the subdivision point. The tangent at that point must be the same for both curves, or noticeable bumps will occur in the character. But we want to use information on both sides of the point to compute the tangent, hence cross_curve = true. */ find_tangent (left_curve, /* to_start_point: */ false, /* cross_curve: */ true, fitting_opts->tangent_surround); CURVE_START_TANGENT (right_curve) = CURVE_END_TANGENT (left_curve); /* Now that we've set up the curves, we can fit them. */ left_spline_list = fit_curve (left_curve, fitting_opts, exception); if (at_exception_got_fatal(exception)) /* TODO: Memory allocated for left_curve and right_curve will leak.*/ goto cleanup; right_spline_list = fit_curve (right_curve, fitting_opts, exception); /* TODO: Memory allocated for left_curve and right_curve will leak.*/ if (at_exception_got_fatal(exception)) goto cleanup; /* Neither of the subdivided curves could be fit, so fail. */ if (left_spline_list == NULL && right_spline_list == NULL) return NULL; /* Put the two together (or whichever of them exist). */ spline_list = new_spline_list (); if (left_spline_list == NULL) { LOG1 ("Could not fit spline to left curve (%lx).\n", (unsigned long) left_curve); at_exception_warning(exception, "Could not fit left spline list"); } else { concat_spline_lists (spline_list, *left_spline_list); free_spline_list (*left_spline_list); free (left_spline_list); } if (right_spline_list == NULL) { LOG1 ("Could not fit spline to right curve (%lx).\n", (unsigned long) right_curve); at_exception_warning(exception, "Could not fit right spline list"); } else { concat_spline_lists (spline_list, *right_spline_list); free_spline_list (*right_spline_list); free (right_spline_list); } if (CURVE_END_TANGENT (left_curve)) free (CURVE_END_TANGENT (left_curve)); free (left_curve); free (right_curve); } cleanup: return spline_list; } /* Our job here is to find alpha1 (and alpha2), where t1_hat (t2_hat) is the tangent to CURVE at the starting (ending) point, such that: control1 = alpha1*t1_hat + starting point control2 = alpha2*t2_hat + ending_point and the resulting spline (starting_point .. control1 and control2 .. ending_point) minimizes the least-square error from CURVE. See pp.57--59 of the Phoenix thesis. The B?(t) here corresponds to B_i^3(U_i) there. The Bernshte\u in polynomials of degree n are defined by B_i^n(t) = { n \choose i } t^i (1-t)^{n-i}, i = 0..n */ #define B0(t) CUBE ((at_real) 1.0 - (t)) #define B1(t) ((at_real) 3.0 * (t) * SQUARE ((at_real) 1.0 - (t))) #define B2(t) ((at_real) 3.0 * SQUARE (t) * ((at_real) 1.0 - (t))) #define B3(t) CUBE (t) static spline_type fit_one_spline (curve_type curve, at_exception_type * exception) { /* Since our arrays are zero-based, the `C0' and `C1' here correspond to `C1' and `C2' in the paper. */ at_real X_C1_det, C0_X_det, C0_C1_det; at_real alpha1, alpha2; spline_type spline; vector_type start_vector, end_vector; unsigned i; vector_type *A; vector_type t1_hat = *CURVE_START_TANGENT (curve); vector_type t2_hat = *CURVE_END_TANGENT (curve); at_real C[2][2] = { { 0.0, 0.0 }, { 0.0, 0.0 } }; at_real X[2] = { 0.0, 0.0 }; XMALLOC (A, CURVE_LENGTH (curve) * 2 * sizeof (vector_type )); /* A dynamically allocated array. */ START_POINT (spline) = CURVE_POINT (curve, 0); END_POINT (spline) = LAST_CURVE_POINT (curve); start_vector = make_vector (START_POINT (spline)); end_vector = make_vector (END_POINT (spline)); for (i = 0; i < CURVE_LENGTH (curve); i++) { A[(i << 1) + 0] = Vmult_scalar (t1_hat, B1 (CURVE_T (curve, i))); A[(i << 1) + 1] = Vmult_scalar (t2_hat, B2 (CURVE_T (curve, i))); } for (i = 0; i < CURVE_LENGTH (curve); i++) { vector_type temp, temp0, temp1, temp2, temp3; vector_type *Ai = A + (i << 1); C[0][0] += Vdot (Ai[0], Ai[0]); C[0][1] += Vdot (Ai[0], Ai[1]); /* C[1][0] = C[0][1] (this is assigned outside the loop) */ C[1][1] += Vdot (Ai[1], Ai[1]); /* Now the right-hand side of the equation in the paper. */ temp0 = Vmult_scalar (start_vector, B0 (CURVE_T (curve, i))); temp1 = Vmult_scalar (start_vector, B1 (CURVE_T (curve, i))); temp2 = Vmult_scalar (end_vector, B2 (CURVE_T (curve, i))); temp3 = Vmult_scalar (end_vector, B3 (CURVE_T (curve, i))); temp = make_vector (Vsubtract_point (CURVE_POINT (curve, i), Vadd (temp0, Vadd (temp1, Vadd (temp2, temp3))))); X[0] += Vdot (temp, Ai[0]); X[1] += Vdot (temp, Ai[1]); } free (A); C[1][0] = C[0][1]; X_C1_det = X[0] * C[1][1] - X[1] * C[0][1]; C0_X_det = C[0][0] * X[1] - C[0][1] * X[0]; C0_C1_det = C[0][0] * C[1][1] - C[1][0] * C[0][1]; if (C0_C1_det == 0.0) { LOG ("zero determinant of C0*C1"); at_exception_fatal(exception, "zero determinant of C0*C1"); goto cleanup; } alpha1 = X_C1_det / C0_C1_det; alpha2 = C0_X_det / C0_C1_det; CONTROL1 (spline) = Vadd_point (START_POINT (spline), Vmult_scalar (t1_hat, alpha1)); CONTROL2 (spline) = Vadd_point (END_POINT (spline), Vmult_scalar (t2_hat, alpha2)); SPLINE_DEGREE (spline) = CUBICTYPE; cleanup: return spline; } /* Find reasonable values for t for each point on CURVE. The method is called chord-length parameterization, which is described in Plass & Stone. The basic idea is just to use the distance from one point to the next as the t value, normalized to produce values that increase from zero for the first point to one for the last point. */ static void set_initial_parameter_values (curve_type curve) { unsigned p; LOG ("\nAssigning initial t values:\n "); CURVE_T (curve, 0) = 0.0; for (p = 1; p < CURVE_LENGTH (curve); p++) { at_real_coord point = CURVE_POINT (curve, p), previous_p = CURVE_POINT (curve, p - 1); at_real d = distance (point, previous_p); CURVE_T (curve, p) = CURVE_T (curve, p - 1) + d; } assert (LAST_CURVE_T (curve) != 0.0); for (p = 1; p < CURVE_LENGTH (curve); p++) CURVE_T (curve, p) = CURVE_T (curve, p) / LAST_CURVE_T (curve); log_entire_curve (curve); } /* Find an approximation to the tangent to an endpoint of CURVE (to the first point if TO_START_POINT is true, else the last). If CROSS_CURVE is true, consider points on the adjacent curve to CURVE. It is important to compute an accurate approximation, because the control points that we eventually decide upon to fit the curve will be placed on the half-lines defined by the tangents and endpoints...and we never recompute the tangent after this. */ static void find_tangent (curve_type curve, at_bool to_start_point, at_bool cross_curve, unsigned tangent_surround) { vector_type tangent; vector_type **curve_tangent = (to_start_point == true) ? &(CURVE_START_TANGENT (curve)) : &(CURVE_END_TANGENT (curve)); unsigned n_points = 0; LOG1 (" tangent to %s: ", (to_start_point == true) ? "start" : "end"); if (*curve_tangent == NULL) { XMALLOC (*curve_tangent, sizeof (vector_type)); do { tangent = find_half_tangent (curve, to_start_point, &n_points, tangent_surround); if ((cross_curve == true) || (CURVE_CYCLIC (curve) == true)) { curve_type adjacent_curve = (to_start_point == true) ? PREVIOUS_CURVE (curve) : NEXT_CURVE (curve); vector_type tangent2 = (to_start_point == false) ? find_half_tangent (adjacent_curve, true, &n_points, tangent_surround) : find_half_tangent (adjacent_curve, true, &n_points, tangent_surround); LOG3 ("(adjacent curve half tangent (%.3f,%.3f,%.3f)) ", tangent2.dx, tangent2.dy, tangent2.dz); tangent = Vadd (tangent, tangent2); } tangent_surround--; } while (tangent.dx == 0.0 && tangent.dy == 0.0); assert (n_points > 0); **curve_tangent = Vmult_scalar (tangent, (at_real)(1.0 / n_points)); if ((CURVE_CYCLIC (curve) == true) && CURVE_START_TANGENT (curve)) *CURVE_START_TANGENT (curve) = **curve_tangent; if ((CURVE_CYCLIC (curve) == true) && CURVE_END_TANGENT (curve)) *CURVE_END_TANGENT (curve) = **curve_tangent; } else LOG ("(already computed) "); LOG3 ("(%.3f,%.3f,%.3f).\n", (*curve_tangent)->dx, (*curve_tangent)->dy, (*curve_tangent)->dz); } /* Find the change in y and change in x for `tangent_surround' (a global) points along CURVE. Increment N_POINTS by the number of points we actually look at. */ static vector_type find_half_tangent (curve_type c, at_bool to_start_point, unsigned *n_points, unsigned tangent_surround) { unsigned p; int factor = to_start_point ? 1 : -1; unsigned tangent_index = to_start_point ? 0 : c->length - 1; at_real_coord tangent_point = CURVE_POINT (c, tangent_index); vector_type tangent = { 0.0, 0.0 }; unsigned int surround; if ((surround = CURVE_LENGTH (c) / 2) > tangent_surround) surround = tangent_surround; for (p = 1; p <= surround; p++) { int this_index = p * factor + tangent_index; at_real_coord this_point; if (this_index < 0 || this_index >= (int) c->length) break; this_point = CURVE_POINT (c, p * factor + tangent_index); /* Perhaps we should weight the tangent from `this_point' by some factor dependent on the distance from the tangent point. */ tangent = Vadd (tangent, Vmult_scalar (Psubtract (this_point, tangent_point), (at_real) factor)); (*n_points)++; } return tangent; } /* When this routine is called, we have computed a spline representation for the digitized curve. The question is, how good is it? If the fit is very good indeed, we might have an error of zero on each point, and then WORST_POINT becomes irrelevant. But normally, we return the error at the worst point, and the index of that point in WORST_POINT. The error computation itself is the Euclidean distance from the original curve CURVE to the fitted spline SPLINE. */ static at_real find_error (curve_type curve, spline_type spline, unsigned *worst_point, at_exception_type * exception) { unsigned this_point; at_real total_error = 0.0; at_real worst_error = FLT_MIN; *worst_point = CURVE_LENGTH (curve) + 1; /* A sentinel value. */ for (this_point = 0; this_point < CURVE_LENGTH (curve); this_point++) { at_real_coord curve_point = CURVE_POINT (curve, this_point); at_real t = CURVE_T (curve, this_point); at_real_coord spline_point = evaluate_spline (spline, t); at_real this_error = distance (curve_point, spline_point); if (this_error >= worst_error) { *worst_point = this_point; worst_error = this_error; } total_error += this_error; } if (*worst_point == CURVE_LENGTH (curve) + 1) { /* Didn't have any ``worst point''; the error should be zero. */ if (epsilon_equal (total_error, 0.0)) LOG (" Every point fit perfectly.\n"); else { LOG("No worst point found; something is wrong"); at_exception_warning(exception, "No worst point found; something is wrong"); } } else { if (epsilon_equal (total_error, 0.0)) LOG (" Every point fit perfectly.\n"); else { LOG5 (" Worst error (at (%.3f,%.3f,%.3f), point #%u) was %.3f.\n", CURVE_POINT (curve, *worst_point).x, CURVE_POINT (curve, *worst_point).y, CURVE_POINT (curve, *worst_point).z, *worst_point, worst_error); LOG1 (" Total error was %.3f.\n", total_error); LOG2 (" Average error (over %u points) was %.3f.\n", CURVE_LENGTH (curve), total_error / CURVE_LENGTH (curve)); } } return worst_error; } /* Supposing that we have accepted the error, another question arises: would we be better off just using a straight line? */ static at_bool spline_linear_enough (spline_type *spline, curve_type curve, fitting_opts_type *fitting_opts) { at_real A, B, C; unsigned this_point; at_real dist = 0.0, start_end_dist, threshold; LOG ("Checking linearity:\n"); A = END_POINT(*spline).x - START_POINT(*spline).x; B = END_POINT(*spline).y - START_POINT(*spline).y; C = END_POINT(*spline).z - START_POINT(*spline).z; start_end_dist = (at_real) (SQUARE(A) + SQUARE(B) + SQUARE(C)); LOG1 ("start_end_distance is %.3f.\n", sqrt(start_end_dist)); LOG3 (" Line endpoints are (%.3f, %.3f, %.3f) and ", START_POINT(*spline).x, START_POINT(*spline).y, START_POINT(*spline).z); LOG3 ("(%.3f, %.3f, %.3f)\n", END_POINT(*spline).x, END_POINT(*spline).y, END_POINT(*spline).z); /* LOG3 (" Line is %.3fx + %.3fy + %.3f = 0.\n", A, B, C); */ for (this_point = 0; this_point < CURVE_LENGTH (curve); this_point++) { at_real a, b, c, w; at_real t = CURVE_T (curve, this_point); at_real_coord spline_point = evaluate_spline (*spline, t); a = spline_point.x - START_POINT(*spline).x; b = spline_point.y - START_POINT(*spline).y; c = spline_point.z - START_POINT(*spline).z; w = (A*a + B*b + C*c) / start_end_dist; dist += (at_real)sqrt(SQUARE(a-A*w) + SQUARE(b-B*w) + SQUARE(c-C*w)); } LOG1 (" Total distance is %.3f, ", dist); dist /= (CURVE_LENGTH (curve) - 1); LOG1 ("which is %.3f normalized.\n", dist); /* We want reversion of short curves to splines to be more likely than reversion of long curves, hence the second division by the curve length, for use in `change_bad_lines'. */ SPLINE_LINEARITY (*spline) = dist; LOG1 (" Final linearity: %.3f.\n", SPLINE_LINEARITY (*spline)); if (start_end_dist * (at_real) 0.5 > fitting_opts->line_threshold) threshold = fitting_opts->line_threshold; else threshold = start_end_dist * (at_real) 0.5; LOG1 ("threshold is %.3f .\n", threshold); if (dist < threshold) return true; else return false; } /* Unfortunately, we cannot tell in isolation whether a given spline should be changed to a line or not. That can only be known after the entire curve has been fit to a list of splines. (The curve is the pixel outline between two corners.) After subdividing the curve, a line may very well fit a portion of the curve just as well as the spline---but unless a spline is truly close to being a line, it should not be combined with other lines. */ static void change_bad_lines (spline_list_type *spline_list, fitting_opts_type *fitting_opts) { unsigned this_spline; at_bool found_cubic = false; unsigned length = SPLINE_LIST_LENGTH (*spline_list); LOG1 ("\nChecking for bad lines (length %u):\n", length); /* First see if there are any splines in the fitted shape. */ for (this_spline = 0; this_spline < length; this_spline++) { if (SPLINE_DEGREE (SPLINE_LIST_ELT (*spline_list, this_spline)) == CUBICTYPE) { found_cubic = true; break; } } /* If so, change lines back to splines (we haven't done anything to their control points, so we only have to change the degree) unless the spline is close enough to being a line. */ if (found_cubic) for (this_spline = 0; this_spline < length; this_spline++) { spline_type s = SPLINE_LIST_ELT (*spline_list, this_spline); if (SPLINE_DEGREE (s) == LINEARTYPE) { LOG1 (" #%u: ", this_spline); if (SPLINE_LINEARITY (s) > fitting_opts->line_reversion_threshold) { LOG ("reverted, "); SPLINE_DEGREE (SPLINE_LIST_ELT (*spline_list, this_spline)) = CUBICTYPE; } LOG1 ("linearity %.3f.\n", SPLINE_LINEARITY (s)); } } else LOG (" No lines.\n"); } /* Lists of array indices (well, that is what we use it for). */ static index_list_type new_index_list (void) { index_list_type index_list; index_list.data = NULL; INDEX_LIST_LENGTH (index_list) = 0; return index_list; } static void free_index_list (index_list_type *index_list) { if (INDEX_LIST_LENGTH (*index_list) > 0) { free (index_list->data); index_list->data = NULL; INDEX_LIST_LENGTH (*index_list) = 0; } } static void append_index (index_list_type *list, unsigned new_index) { INDEX_LIST_LENGTH (*list)++; XREALLOC (list->data, INDEX_LIST_LENGTH (*list) * sizeof (unsigned)); list->data[INDEX_LIST_LENGTH (*list) - 1] = new_index; } /* Turn an real point into a integer one. */ static at_coord real_to_int_coord (at_real_coord real_coord) { at_coord int_coord; int_coord.x = ROUND (real_coord.x); int_coord.y = ROUND (real_coord.y); return int_coord; } /* Return the Euclidean distance between P1 and P2. */ static at_real distance (at_real_coord p1, at_real_coord p2) { at_real x = p1.x - p2.x, y = p1.y - p2.y, z = p1.z - p2.z; return (at_real) sqrt (SQUARE(x) + SQUARE(y) + SQUARE(z)); } autotrace-0.31.1/bitmap.c0000664000076400007640000000107607551363216010712 /* bitmap.c: operations on bitmaps. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "bitmap.h" #include "xstd.h" bitmap_type new_bitmap (unsigned short width, unsigned short height) { return at_bitmap_init(NULL,width,height,1); } /* Free the storage that is allocated for a bitmap. On the other hand, the bitmap might not have any storage allocated for it if it is zero in either dimension; in that case, don't free it. */ void free_bitmap (bitmap_type *b) { if (BITMAP_BITS (*b) != NULL) free (BITMAP_BITS (*b)); } autotrace-0.31.1/spline.c0000664000076400007640000001142107561477727010741 /* spline.c: spline and spline list (represented as arrays) manipulation. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "message.h" #include "types.h" #include "spline.h" #include "vector.h" #include "xstd.h" #include /* Print a spline in human-readable form. */ void print_spline (FILE *f, spline_type s) { assert(SPLINE_DEGREE (s) == LINEARTYPE || SPLINE_DEGREE (s) == CUBICTYPE); if (SPLINE_DEGREE (s) == LINEARTYPE) fprintf (f, "(%.3f,%.3f)--(%.3f,%.3f).\n", START_POINT (s).x, START_POINT (s).y, END_POINT (s).x, END_POINT (s).y); else if (SPLINE_DEGREE (s) == CUBICTYPE) fprintf (f, "(%.3f,%.3f)..ctrls(%.3f,%.3f)&(%.3f,%.3f)..(%.3f,%.3f).\n", START_POINT (s).x, START_POINT (s).y, CONTROL1 (s).x, CONTROL1 (s).y, CONTROL2 (s).x, CONTROL2 (s).y, END_POINT (s).x, END_POINT (s).y); } /* Evaluate the spline S at a given T value. This is an implementation of de Casteljau's algorithm. See Schneider's thesis, p.37. The variable names are taken from there. */ at_real_coord evaluate_spline (spline_type s, at_real t) { spline_type V[4]; /* We need degree+1 splines, but assert degree <= 3. */ signed i, j; at_real one_minus_t = (at_real) 1.0 - t; polynomial_degree degree = SPLINE_DEGREE (s); for (i = 0; i <= degree; i++) { V[0].v[i].x = s.v[i].x; V[0].v[i].y = s.v[i].y; V[0].v[i].z = s.v[i].z; } for (j = 1; j <= degree; j++) for (i = 0; i <= degree - j; i++) { at_real_coord t1 = Pmult_scalar (V[j - 1].v[i], one_minus_t); at_real_coord t2 = Pmult_scalar (V[j - 1].v[i + 1], t); at_real_coord temp = Padd (t1, t2); V[j].v[i].x = temp.x; V[j].v[i].y = temp.y; V[j].v[i].z = temp.z; } return V[degree].v[0]; } /* Return a new, empty, spline list. */ spline_list_type * new_spline_list (void) { spline_list_type *answer; XMALLOC (answer, sizeof (spline_list_type)); *answer = empty_spline_list(); return answer; } spline_list_type empty_spline_list (void) { spline_list_type answer; SPLINE_LIST_DATA (answer) = NULL; SPLINE_LIST_LENGTH (answer) = 0; return answer; } /* Return a new spline list with SPLINE as the first element. */ spline_list_type * new_spline_list_with_spline (spline_type spline) { spline_list_type *answer; answer = new_spline_list(); XMALLOC (SPLINE_LIST_DATA (*answer), sizeof (spline_type)); SPLINE_LIST_ELT (*answer, 0) = spline; SPLINE_LIST_LENGTH (*answer) = 1; return answer; } /* Free the storage in a spline list. We don't have to free the elements, since they are arrays in automatic storage. And we don't want to free the list if it was empty. */ void free_spline_list (spline_list_type spline_list) { if (SPLINE_LIST_DATA (spline_list) != NULL) free (SPLINE_LIST_DATA (spline_list)); } /* Append the spline S to the list SPLINE_LIST. */ void append_spline (spline_list_type *l, spline_type s) { assert (l != NULL); SPLINE_LIST_LENGTH (*l)++; XREALLOC (SPLINE_LIST_DATA (*l), SPLINE_LIST_LENGTH (*l) * sizeof (spline_type)); LAST_SPLINE_LIST_ELT (*l) = s; } /* Tack the elements in the list S2 onto the end of S1. S2 is not changed. */ void concat_spline_lists (spline_list_type *s1, spline_list_type s2) { unsigned this_spline; unsigned new_length; assert (s1 != NULL); new_length = SPLINE_LIST_LENGTH (*s1) + SPLINE_LIST_LENGTH (s2); XREALLOC (SPLINE_LIST_DATA (*s1), new_length * sizeof (spline_type)); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (s2); this_spline++) SPLINE_LIST_ELT (*s1, SPLINE_LIST_LENGTH (*s1)++) = SPLINE_LIST_ELT (s2, this_spline); } /* Return a new, empty, spline list array. */ spline_list_array_type new_spline_list_array (void) { spline_list_array_type answer; SPLINE_LIST_ARRAY_DATA (answer) = NULL; SPLINE_LIST_ARRAY_LENGTH (answer) = 0; return answer; } /* Free the storage in a spline list array. We don't want to free the list if it is empty. */ void free_spline_list_array (spline_list_array_type *spline_list_array) { unsigned this_list; for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (*spline_list_array); this_list++) free_spline_list (SPLINE_LIST_ARRAY_ELT (*spline_list_array, this_list)); if (SPLINE_LIST_ARRAY_DATA (*spline_list_array) != NULL) free (SPLINE_LIST_ARRAY_DATA (*spline_list_array)); flush_log_output (); } /* Append the spline S to the list SPLINE_LIST_ARRAY. */ void append_spline_list (spline_list_array_type *l, spline_list_type s) { SPLINE_LIST_ARRAY_LENGTH (*l)++; XREALLOC (SPLINE_LIST_ARRAY_DATA (*l), SPLINE_LIST_ARRAY_LENGTH (*l) * sizeof (spline_list_type)); LAST_SPLINE_LIST_ARRAY_ELT (*l) = s; } autotrace-0.31.1/curve.c0000664000076400007640000001771407551363240010565 /* curve.c: operations on the lists of pixels and lists of curves. The code was partially derived from limn. Copyright (C) 1992 Free Software Foundation, Inc. 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "logreport.h" #include "curve.h" #include "xstd.h" static at_real_coord int_to_real_coord (at_coord); /* Return an entirely empty curve. */ curve_type new_curve (void) { curve_type curve; XMALLOC (curve, sizeof (struct curve)); curve->point_list = NULL; CURVE_LENGTH (curve) = 0; CURVE_CYCLIC (curve) = false; CURVE_START_TANGENT (curve) = CURVE_END_TANGENT (curve) = NULL; PREVIOUS_CURVE (curve) = NEXT_CURVE (curve) = NULL; return curve; } /* Don't copy the points or tangents, but copy everything else. */ curve_type copy_most_of_curve (curve_type old_curve) { curve_type curve = new_curve (); CURVE_CYCLIC (curve) = CURVE_CYCLIC (old_curve); PREVIOUS_CURVE (curve) = PREVIOUS_CURVE (old_curve); NEXT_CURVE (curve) = NEXT_CURVE (old_curve); return curve; } /* The length of CURVE will be zero if we ended up not being able to fit it (which in turn implies a problem elsewhere in the program, but at any rate, we shouldn't try here to free the nonexistent curve). */ void free_curve (curve_type curve) { if (CURVE_LENGTH (curve) > 0) free (curve->point_list); if (CURVE_START_TANGENT (curve)) free (CURVE_START_TANGENT (curve)); if (CURVE_END_TANGENT (curve)) free (CURVE_END_TANGENT (curve)); } void append_pixel (curve_type curve, at_coord coord) { append_point (curve, int_to_real_coord (coord)); } void append_point (curve_type curve, at_real_coord coord) { CURVE_LENGTH (curve)++; XREALLOC (curve->point_list, CURVE_LENGTH (curve) * sizeof(point_type)); LAST_CURVE_POINT (curve) = coord; /* The t value does not need to be set. */ } /* Print a curve in human-readable form. It turns out we never care about most of the points on the curve, and so it is pointless to print them all out umpteen times. What matters is that we have some from the end and some from the beginning. */ #define NUM_TO_PRINT 3 #define LOG_CURVE_POINT(c, p, print_t) \ do \ { \ LOG2 ("(%.3f,%.3f)", CURVE_POINT (c, p).x, CURVE_POINT (c, p).y); \ if (print_t) \ LOG1 ("/%.2f", CURVE_T (c, p)); \ } \ while (0) void log_curve (curve_type curve, at_bool print_t) { unsigned this_point; if (!log_file) return; LOG1 ("curve id = %x:\n", (unsigned long) curve); LOG1 (" length = %u.\n", CURVE_LENGTH (curve)); if (CURVE_CYCLIC (curve)) LOG (" cyclic.\n"); /* It should suffice to check just one of the tangents for being null -- either they both should be, or neither should be. */ if (CURVE_START_TANGENT (curve) != NULL) LOG4 (" tangents = (%.3f,%.3f) & (%.3f,%.3f).\n", CURVE_START_TANGENT (curve)->dx, CURVE_START_TANGENT (curve)->dy, CURVE_END_TANGENT (curve)->dx, CURVE_END_TANGENT (curve)->dy); LOG (" "); /* If the curve is short enough, don't use ellipses. */ if (CURVE_LENGTH (curve) <= NUM_TO_PRINT * 2) { for (this_point = 0; this_point < CURVE_LENGTH (curve); this_point++) { LOG_CURVE_POINT (curve, this_point, print_t); LOG (" "); if (this_point != CURVE_LENGTH (curve) - 1 && (this_point + 1) % NUM_TO_PRINT == 0) LOG ("\n "); } } else { for (this_point = 0; this_point < NUM_TO_PRINT && this_point < CURVE_LENGTH (curve); this_point++) { LOG_CURVE_POINT (curve, this_point, print_t); LOG (" "); } LOG ("...\n ..."); for (this_point = CURVE_LENGTH (curve) - NUM_TO_PRINT; this_point < CURVE_LENGTH (curve); this_point++) { LOG (" "); LOG_CURVE_POINT (curve, this_point, print_t); } } LOG (".\n"); } /* Like `log_curve', but write the whole thing. */ void log_entire_curve (curve_type curve) { unsigned this_point; if (!log_file) return; LOG1 ("curve id = %x:\n", (unsigned long) curve); LOG1 (" length = %u.\n", CURVE_LENGTH (curve)); if (CURVE_CYCLIC (curve)) LOG (" cyclic.\n"); /* It should suffice to check just one of the tangents for being null -- either they both should be, or neither should be. */ if (CURVE_START_TANGENT (curve) != NULL) LOG4 (" tangents = (%.3f,%.3f) & (%.3f,%.3f).\n", CURVE_START_TANGENT (curve)->dx, CURVE_START_TANGENT (curve)->dy, CURVE_END_TANGENT (curve)->dx, CURVE_END_TANGENT (curve)->dy); LOG (" "); for (this_point = 0; this_point < CURVE_LENGTH (curve); this_point++) { LOG (" "); LOG_CURVE_POINT (curve, this_point, true); /* Compiler warning `Condition is always true' can be ignored */ } LOG (".\n"); } /* Return an initialized but empty curve list. */ curve_list_type new_curve_list (void) { curve_list_type curve_list; curve_list.length = 0; curve_list.data = NULL; return curve_list; } /* Free a curve list and all the curves it contains. */ void free_curve_list (curve_list_type *curve_list) { unsigned this_curve; for (this_curve = 0; this_curve < curve_list->length; this_curve++) { free_curve (curve_list->data[this_curve]); free (curve_list->data[this_curve]); } /* If the character was empty, it won't have any curves. */ if (curve_list->data != NULL) free (curve_list->data); } /* Add an element to a curve list. */ void append_curve (curve_list_type *curve_list, curve_type curve) { curve_list->length++; XREALLOC (curve_list->data, curve_list->length * sizeof (curve_type)); curve_list->data[curve_list->length - 1] = curve; } /* Return an initialized but empty curve list array. */ curve_list_array_type new_curve_list_array (void) { curve_list_array_type curve_list_array; CURVE_LIST_ARRAY_LENGTH (curve_list_array) = 0; curve_list_array.data = NULL; return curve_list_array; } /* Free a curve list array and all the curve lists it contains. */ void free_curve_list_array (curve_list_array_type *curve_list_array, at_progress_func notify_progress, at_address client_data) { unsigned this_list; for (this_list = 0; this_list < CURVE_LIST_ARRAY_LENGTH (*curve_list_array); this_list++) { if (notify_progress) notify_progress(((at_real)this_list)/(CURVE_LIST_ARRAY_LENGTH (*curve_list_array)*(at_real)3.0)+(at_real)0.666 , client_data); free_curve_list (&CURVE_LIST_ARRAY_ELT (*curve_list_array, this_list)); } /* If the character was empty, it won't have any curves. */ if (curve_list_array->data != NULL) free (curve_list_array->data); } /* Add an element to a curve list array. */ void append_curve_list (curve_list_array_type *curve_list_array, curve_list_type curve_list) { CURVE_LIST_ARRAY_LENGTH (*curve_list_array)++; XREALLOC (curve_list_array->data, CURVE_LIST_ARRAY_LENGTH (*curve_list_array) * sizeof (curve_list_type)); LAST_CURVE_LIST_ARRAY_ELT (*curve_list_array) = curve_list; } /* Turn an integer point into a real one. */ static at_real_coord int_to_real_coord (at_coord int_coord) { at_real_coord real_coord; real_coord.x = int_coord.x; real_coord.y = int_coord.y; real_coord.z = 0.0; return real_coord; } autotrace-0.31.1/epsilon-equal.c0000664000076400007640000000114607551363226012213 /* epsilon-equal.c: define a error resist compare. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "types.h" #include "epsilon-equal.h" #include /* Numerical errors sometimes make a floating point number just slightly larger or smaller than its true value. When it matters, we need to compare with some tolerance, REAL_EPSILON, defined in kbase.h. */ at_bool epsilon_equal (at_real v1, at_real v2) { if (v1 == v2 /* Usually they'll be exactly equal, anyway. */ || fabs (v1 - v2) <= REAL_EPSILON) return true; else return false; } autotrace-0.31.1/vector.c0000664000076400007640000001140207551363240010727 /* vector.c: vector/point operations. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "vector.h" #include "message.h" #include "epsilon-equal.h" #include #include #include #include static at_real acos_d (at_real, at_exception_type * excep); #ifndef M_PI #define M_PI 3.14159265 #endif #define SIGN(x) ((x) > 0 ? 1 : (x) < 0 ? -1 : 0) #define ROUND(x) ((int) ((int) (x) + .5 * SIGN (x))) /* Given the point COORD, return the corresponding vector. */ vector_type make_vector (const at_real_coord c) { vector_type v; v.dx = c.x; v.dy = c.y; v.dz = c.z; return v; } /* And the converse: given a vector, return the corresponding point. */ at_real_coord vector_to_point (const vector_type v) { at_real_coord coord; coord.x = v.dx; coord.y = v.dy; return coord; } at_real magnitude (const vector_type v) { return (at_real) sqrt (v.dx * v.dx + v.dy * v.dy + v.dz * v.dz); } vector_type normalize (const vector_type v) { vector_type new_v; at_real m = magnitude (v); /* assert (m > 0.0); */ if (m > 0.0) { new_v.dx = v.dx / m; new_v.dy = v.dy / m; new_v.dz = v.dz / m; } else { new_v.dx = v.dx; new_v.dy = v.dy; new_v.dz = v.dz; } return new_v; } vector_type Vadd (const vector_type v1, const vector_type v2) { vector_type new_v; new_v.dx = v1.dx + v2.dx; new_v.dy = v1.dy + v2.dy; new_v.dz = v1.dz + v2.dz; return new_v; } at_real Vdot (const vector_type v1, const vector_type v2) { return v1.dx * v2.dx + v1.dy * v2.dy + v1.dz * v2.dz; } vector_type Vmult_scalar (const vector_type v, const at_real r) { vector_type new_v; new_v.dx = v.dx * r; new_v.dy = v.dy * r; new_v.dz = v.dz * r; return new_v; } /* Given the IN_VECTOR and OUT_VECTOR, return the angle between them in degrees, in the range zero to 180. */ at_real Vangle (const vector_type in_vector, const vector_type out_vector, at_exception_type * exp) { vector_type v1 = normalize (in_vector); vector_type v2 = normalize (out_vector); return acos_d (Vdot (v2, v1), exp); } at_real_coord Vadd_point (const at_real_coord c, const vector_type v) { at_real_coord new_c; new_c.x = c.x + v.dx; new_c.y = c.y + v.dy; new_c.z = c.z + v.dz; return new_c; } at_real_coord Vsubtract_point (const at_real_coord c, const vector_type v) { at_real_coord new_c; new_c.x = c.x - v.dx; new_c.y = c.y - v.dy; new_c.z = c.z - v.dz; return new_c; } at_coord Vadd_int_point (const at_coord c, const vector_type v) { at_coord a; a.x = (unsigned short) ROUND ((at_real) c.x + v.dx); a.y = (unsigned short) ROUND ((at_real) c.y + v.dy); return a; } vector_type Vabs (const vector_type v) { vector_type new_v; new_v.dx = (at_real) fabs (v.dx); new_v.dy = (at_real) fabs (v.dy); new_v.dz = (at_real) fabs (v.dz); return new_v; } /* Operations on points. */ at_real_coord Padd (const at_real_coord coord1, const at_real_coord coord2) { at_real_coord sum; sum.x = coord1.x + coord2.x; sum.y = coord1.y + coord2.y; sum.z = coord1.z + coord2.z; return sum; } at_real_coord Pmult_scalar (const at_real_coord coord, const at_real r) { at_real_coord answer; answer.x = coord.x * r; answer.y = coord.y * r; answer.z = coord.z * r; return answer; } vector_type Psubtract (const at_real_coord c1, const at_real_coord c2) { vector_type v; v.dx = c1.x - c2.x; v.dy = c1.y - c2.y; v.dz = c1.z - c2.z; return v; } /* Operations on integer points. */ vector_type IPsubtract (const at_coord coord1, const at_coord coord2) { vector_type v; v.dx = (at_real) (coord1.x - coord2.x); v.dy = (at_real) (coord1.y - coord2.y); v.dz = 0.0; return v; } at_coord IPsubtractP (const at_coord c1, const at_coord c2) { at_coord c; c.x = c1.x - c2.x; c.y = c1.y - c2.y; return c; } at_coord IPadd (const at_coord c1, const at_coord c2) { at_coord c; c.x = c1.x + c2.x; c.y = c1.y + c2.y; return c; } at_coord IPmult_scalar (const at_coord c, const int i) { at_coord a; a.x = (unsigned short) (c.x * i); a.y = (unsigned short) (c.y * i); return a; } at_real_coord IPmult_real (const at_coord c, const at_real r) { at_real_coord a; a.x = c.x * r; a.y = c.y * r; return a; } at_bool IPequal (const at_coord c1, const at_coord c2) { if ((c1.x == c2.x) && (c1.y == c2.y)) return true; else return false; } static at_real acos_d (at_real v, at_exception_type * excep) { at_real a; if (epsilon_equal (v, 1.0)) v = 1.0; else if (epsilon_equal (v, -1.0)) v = -1.0; errno = 0; a = (at_real) acos (v); if (errno == ERANGE || errno == EDOM) { at_exception_fatal(excep, strerror(errno)); return 0.0; } return a * (at_real) 180.0 / (at_real) M_PI; } autotrace-0.31.1/color.c0000664000076400007640000000064407551363217010555 /* color.c: color handling. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "color.h" color_type GET_COLOR (bitmap_type bitmap, unsigned int row, unsigned int col) { color_type c; unsigned char *p = BITMAP_PIXEL (bitmap, row, col); if (BITMAP_PLANES (bitmap) >= 3) { c.r = p[0]; c.g = p[1]; c.b = p[2]; } else c.g = c.b = c.r = p[0]; return (c); } autotrace-0.31.1/autotrace.c0000664000076400007640000002517507561265014011431 /* autotrace.c --- Autotrace API Copyright (C) 2000, 2001, 2002 Martin Weber The author can be contacted at 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "autotrace.h" #include "exception.h" #include "fit.h" #include "bitmap.h" #include "spline.h" #include "input.h" #include "xstd.h" #include "image-header.h" #include "image-proc.h" #include "quantize.h" #include "thin-image.h" #include "despeckle.h" #if HAVE_LIBPSTOEDIT #include "output-pstoedit.h" #endif /* HAVE_LIBPSTOEDIT */ #define AT_DEFAULT_DPI 72 at_fitting_opts_type * at_fitting_opts_new(void) { at_fitting_opts_type * opts; XMALLOC(opts, sizeof(at_fitting_opts_type)); *opts = new_fitting_opts(); return opts; } at_fitting_opts_type * at_fitting_opts_copy (at_fitting_opts_type * original) { at_fitting_opts_type * new_opts; if (original == NULL) return NULL; new_opts = at_fitting_opts_new (); *new_opts = *original; if (original->background_color) new_opts->background_color = at_color_copy(original->background_color); return new_opts; } void at_fitting_opts_free(at_fitting_opts_type * opts) { if (opts->background_color != NULL) free (opts->background_color); free(opts); } at_input_opts_type * at_input_opts_new(void) { at_input_opts_type * opts; XMALLOC(opts, sizeof(at_input_opts_type)); opts->background_color = NULL; return opts; } at_input_opts_type * at_input_opts_copy(at_input_opts_type * original) { at_input_opts_type * opts; opts = at_input_opts_new(); if (original->background_color) opts->background_color = at_color_copy(original->background_color); return opts; } void at_input_opts_free(at_input_opts_type * opts) { if (opts->background_color != NULL) free (opts->background_color); free(opts); } at_output_opts_type * at_output_opts_new(void) { at_output_opts_type * opts; XMALLOC(opts, sizeof(at_output_opts_type)); opts->dpi = AT_DEFAULT_DPI; return opts; } at_output_opts_type * at_output_opts_copy(at_output_opts_type * original) { at_output_opts_type * opts = at_output_opts_new(); *opts = *original; return opts; } void at_output_opts_free(at_output_opts_type * opts) { free(opts); } at_bitmap_type * at_bitmap_read (at_input_read_func input_reader, at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data) { at_bool new_opts = false; at_bitmap_type * bitmap; XMALLOC(bitmap, sizeof(at_bitmap_type)); if (opts == NULL) { opts = at_input_opts_new(); new_opts = true; } *bitmap = (*input_reader) (filename, opts, msg_func, msg_data); if (new_opts) at_input_opts_free(opts); return bitmap; } at_bitmap_type * at_bitmap_new(unsigned short width, unsigned short height, unsigned int planes) { at_bitmap_type * bitmap; XMALLOC(bitmap, sizeof(at_bitmap_type)); *bitmap = at_bitmap_init(NULL, width, height, planes); return bitmap; } at_bitmap_type * at_bitmap_copy(at_bitmap_type * src) { at_bitmap_type * dist; unsigned short width, height, planes; width = at_bitmap_get_width(src); height = at_bitmap_get_height(src); planes = at_bitmap_get_planes(src); dist = at_bitmap_new(width, height, planes); memcpy(dist->bitmap, src->bitmap, width * height * planes * sizeof(unsigned char)); return dist; } at_bitmap_type at_bitmap_init(unsigned char * area, unsigned short width, unsigned short height, unsigned int planes) { at_bitmap_type bitmap; if (area) bitmap.bitmap = area; else { if (0 == (width * height)) bitmap.bitmap = NULL; else XCALLOC(bitmap.bitmap, width * height * planes * sizeof(unsigned char)); } bitmap.width = width; bitmap.height = height; bitmap.np = planes; return bitmap; } void at_bitmap_free (at_bitmap_type * bitmap) { free_bitmap (bitmap); free(bitmap); } unsigned short at_bitmap_get_width (at_bitmap_type * bitmap) { return bitmap->width; } unsigned short at_bitmap_get_height (at_bitmap_type * bitmap) { return bitmap->height; } unsigned short at_bitmap_get_planes (at_bitmap_type * bitmap) { return bitmap->np; } at_splines_type * at_splines_new (at_bitmap_type * bitmap, at_fitting_opts_type * opts, at_msg_func msg_func, at_address msg_data) { return at_splines_new_full(bitmap, opts, msg_func, msg_data, NULL, NULL, NULL, NULL); } /* at_splines_new_full modify its argument: BITMAP when despeckle, quantize and/or thin_image are invoked. */ at_splines_type * at_splines_new_full (at_bitmap_type * bitmap, at_fitting_opts_type * opts, at_msg_func msg_func, at_address msg_data, at_progress_func notify_progress, at_address progress_data, at_testcancel_func test_cancel, at_address testcancel_data) { image_header_type image_header; at_splines_type * splines = NULL; pixel_outline_list_type pixels; QuantizeObj *myQuant = NULL; /* curently not used */ at_exception_type exp = at_exception_new(msg_func, msg_data); distance_map_type dist_map, *dist = NULL; #define CANCELP (test_cancel && test_cancel(testcancel_data)) #define FATALP (at_exception_got_fatal(&exp)) #define FREE_SPLINE() do {if (splines) {at_splines_free(splines); splines = NULL;}} while(0) #define CANCEL_THEN_CLEANUP_DIST() if (CANCELP) goto cleanup_dist; #define CANCEL_THEN_CLEANUP_PIXELS() if (CANCELP) {FREE_SPLINE(); goto cleanup_pixels;} #define FATAL_THEN_RETURN() if (FATALP) return splines; #define FATAL_THEN_CLEANUP_DIST() if (FATALP) goto cleanup_dist; #define FATAL_THEN_CLEANUP_PIXELS() if (FATALP) {FREE_SPLINE(); goto cleanup_pixels;} if (opts->despeckle_level > 0) { despeckle (bitmap, opts->despeckle_level, opts->despeckle_tightness, &exp); FATAL_THEN_RETURN(); } image_header.width = at_bitmap_get_width(bitmap); image_header.height = at_bitmap_get_height(bitmap); if (opts->color_count > 0) { quantize (bitmap, opts->color_count, opts->background_color, &myQuant, &exp); if (myQuant) quantize_object_free(myQuant); /* curently not used */ FATAL_THEN_RETURN(); } if (opts->centerline) { if (opts->preserve_width) { /* Preserve line width prior to thinning. */ dist_map = new_distance_map(*bitmap, 255, /*padded=*/true, &exp); dist = &dist_map; FATAL_THEN_RETURN(); } /* Hereafter, dist is allocated. dist must be freed if the execution is canceled or exception is raised; use FATAL_THEN_CLEANUP_DIST. */ thin_image (bitmap, opts->background_color, &exp); FATAL_THEN_CLEANUP_DIST() } /* Hereafter, pixels is allocated. pixels must be freed if the execution is canceled; use CANCEL_THEN_CLEANUP_PIXELS. */ if (opts->centerline) { color_type background_color = { 0xff, 0xff, 0xff }; if (opts->background_color) background_color = *opts->background_color; pixels = find_centerline_pixels(*bitmap, background_color, notify_progress, progress_data, test_cancel, testcancel_data, &exp); } else pixels = find_outline_pixels(*bitmap, opts->background_color, notify_progress, progress_data, test_cancel, testcancel_data, &exp); FATAL_THEN_CLEANUP_DIST(); CANCEL_THEN_CLEANUP_DIST(); XMALLOC(splines, sizeof(at_splines_type)); *splines = fitted_splines (pixels, opts, dist, image_header.width, image_header.height, &exp, notify_progress, progress_data, test_cancel, testcancel_data); FATAL_THEN_CLEANUP_PIXELS(); CANCEL_THEN_CLEANUP_PIXELS(); if (notify_progress) notify_progress(1.0, progress_data); cleanup_pixels: free_pixel_outline_list (&pixels); cleanup_dist: if (dist) free_distance_map (dist); return splines; #undef CANCELP #undef FATALP #undef FREE_SPLINE #undef CANCEL_THEN_CLEANUP_DIST #undef CANCEL_THEN_CLEANUP_PIXELS #undef FATAL_THEN_RETURN #undef FATAL_THEN_CLEANUP_DIST #undef FATAL_THEN_CLEANUP_PIXELS } void at_splines_write (at_output_write_func output_writer, FILE * writeto, at_string file_name, at_output_opts_type * opts, at_splines_type * splines, at_msg_func msg_func, at_address msg_data) { at_bool new_opts = false; int llx, lly, urx, ury; llx = 0; lly = 0; urx = splines->width; ury = splines->height; if (!file_name) file_name = ""; if (opts == NULL) { new_opts = true; opts = at_output_opts_new(); } #if HAVE_LIBPSTOEDIT if (output_pstoedit_is_writer(output_writer)) output_pstoedit_invoke_writer (output_writer, writeto, file_name, llx, lly, urx, ury, opts, *splines, msg_func, msg_data); else (*output_writer) (writeto, file_name, llx, lly, urx, ury, opts, *splines, msg_func, msg_data); #else (*output_writer) (writeto, file_name, llx, lly, urx, ury, opts, *splines, msg_func, msg_data); #endif /* HAVE_LIBPSTOEDIT */ if (new_opts) at_output_opts_free(opts); } void at_splines_free (at_splines_type * splines) { free_spline_list_array (splines); if (splines->background_color) at_color_free(splines->background_color); free(splines); } at_color_type * at_color_new (unsigned char r, unsigned char g, unsigned char b) { at_color_type * color; XMALLOC (color, sizeof (at_color_type)); color->r = r; color->g = g; color->b = b; return color; } at_color_type * at_color_copy (at_color_type * original) { if (original == NULL) return NULL; return at_color_new(original->r, original->g, original->b); } at_bool at_color_equal (at_color_type * c1, at_color_type * c2) { if (c1 == c2) return true; else return (COLOR_EQUAL(*c1, *c2)); } void at_color_free(at_color_type * color) { free(color); } const char * at_version (at_bool long_format) { if (long_format) return "AutoTrace version " AUTOTRACE_VERSION; else return AUTOTRACE_VERSION; } const char * at_home_site (void) { return AUTOTRACE_WEB; } autotrace-0.31.1/output.c0000664000076400007640000002024407562261172010774 /* output.c: interface for output handlers Copyright (C) 1999, 2000, 2001 Bernhard Herzog. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "output.h" #include "xstd.h" #include "filename.h" #include "strgicmp.h" #include #include "output-eps.h" #include "output-er.h" #include "output-p2e.h" #include "output-sk.h" #include "output-svg.h" #include "output-fig.h" #ifdef HAVE_LIBSWF #include "output-swf.h" #endif /* HAVE_LIBSWF */ #include "output-emf.h" #include "output-mif.h" #include "output-dxf.h" #include "output-epd.h" #include "output-pdf.h" #include "output-cgm.h" #include "output-dr2d.h" #if HAVE_LIBPSTOEDIT #include "output-pstoedit.h" #endif /* HAVE_LIBPSTOEDIT */ struct output_format_entry { const char * name; const char * descr; at_output_write_func writer; }; #define END {NULL, NULL, NULL} static struct output_format_entry output_formats[] = { {"eps", "Encapsulated PostScript", output_eps_writer}, {"ai", "Adobe Illustrator", output_eps_writer}, {"p2e", "pstoedit frontend format", output_p2e_writer}, {"sk", "Sketch", output_sk_writer}, {"svg", "Scalable Vector Graphics", output_svg_writer}, {"fig", "XFIG 3.2", output_fig_writer}, #ifdef HAVE_LIBSWF {"swf", "Shockwave Flash 3", output_swf_writer}, #endif /* HAVE_LIBSWF */ {"emf", "Enhanced Metafile format", output_emf_writer}, {"mif", "FrameMaker MIF format", output_mif_writer}, {"er", "Elastic Reality Shape file", output_er_writer}, {"dxf", "DXF format (without splines)", output_dxf12_writer}, {"epd", "EPD format", output_epd_writer}, {"pdf", "PDF format", output_pdf_writer}, {"cgm", "Computer Graphics Metafile", output_cgm_writer}, {"dr2d", "IFF DR2D format", output_dr2d_writer}, END }; #if HAVE_LIBPSTOEDIT static at_bool output_is_static_member (struct output_format_entry * entries, struct DriverDescription_S* dd); #endif /* HAVE_LIBPSTOEDIT */ static at_bool streq (const char * a, const char * b); at_output_write_func at_output_get_handler(at_string filename) { char * ext = find_suffix (filename); if (ext == NULL) ext = ""; return at_output_get_handler_by_suffix (ext); } at_output_write_func at_output_get_handler_by_suffix(at_string suffix) { struct output_format_entry * format; if (!suffix || suffix[0] == '\0') return NULL; for (format = output_formats ; format->name; format++) { if (strgicmp (suffix, format->name)) { return format->writer; } } #if HAVE_LIBPSTOEDIT return output_pstoedit_get_writer(suffix); #else return NULL; #endif /* HAVE_LIBPSTOEDIT */ } char ** at_output_list_new (void) { char ** list; int count_out = 0, count; int i; struct output_format_entry * entry; #if HAVE_LIBPSTOEDIT struct DriverDescription_S* driver_description; #endif /* HAVE_LIBPSTOEDIT */ for (entry = output_formats; entry->name; entry++) count_out++; count = count_out; #if HAVE_LIBPSTOEDIT { struct DriverDescription_S* dd_tmp; pstoedit_checkversion(pstoeditdllversion); driver_description = getPstoeditDriverInfo_plainC(); if (driver_description) { dd_tmp = driver_description; while (dd_tmp->symbolicname) { if (!output_is_static_member(output_formats, dd_tmp) && !output_pstoedit_is_unusable_writer(dd_tmp->suffix)) { if (streq(dd_tmp->symbolicname, dd_tmp->suffix)) count += 1; else count += 2; } dd_tmp++; } } } #endif /* HAVE_LIBPSTOEDIT */ XMALLOC(list, sizeof(char*)*((2*count)+1)); entry = output_formats; for (i = 0; i < count_out; i++) { list[2*i] = (char *)entry[i].name; list[2*i+1] = (char *)entry[i].descr; } #if HAVE_LIBPSTOEDIT while (driver_description->symbolicname) { if (!output_is_static_member(output_formats, driver_description) && !output_pstoedit_is_unusable_writer(driver_description->suffix)) { list[2*i] = driver_description->suffix; list[2*i+1] = driver_description->explanation; i++; if (!streq(driver_description->suffix, driver_description->symbolicname)) { list[2*i] = driver_description->symbolicname; list[2*i+1] = driver_description->explanation; i++; } } driver_description++; } #endif /* HAVE_LIBPSTOEDIT */ list[2*i] = NULL; return list; } void at_output_list_free(char ** list) { free(list); } char * at_output_shortlist (void) { char * list; int count = 0; size_t length = 0; int i; struct output_format_entry * entry; #if HAVE_LIBPSTOEDIT struct DriverDescription_S* driver_description; struct DriverDescription_S* dd_tmp; #endif /* HAVE_LIBPSTOEDIT */ for (entry = output_formats; entry->name; entry++) { count++; length += strlen (entry->name) + 2; } #if HAVE_LIBPSTOEDIT { pstoedit_checkversion(pstoeditdllversion); driver_description = getPstoeditDriverInfo_plainC(); if (driver_description) { dd_tmp = driver_description; while (dd_tmp->symbolicname) { if (!output_is_static_member(output_formats, dd_tmp) && !output_pstoedit_is_unusable_writer(dd_tmp->suffix)) { length += strlen (dd_tmp->suffix) + 2; if (!streq(dd_tmp->suffix, dd_tmp->symbolicname)) length += strlen (dd_tmp->symbolicname) + 2; } dd_tmp++; } } } #endif /* HAVE_LIBPSTOEDIT */ XMALLOC(list, sizeof (char) * (length + 1 + 2)); entry = output_formats; strcpy (list, (char *) entry[0].name); for (i = 1; i < count - 1; i++) { strcat (list, ", "); strcat (list, (char *) entry[i].name); } #if HAVE_LIBPSTOEDIT dd_tmp = driver_description; while (dd_tmp->symbolicname) { if (!output_is_static_member(output_formats, dd_tmp) && !output_pstoedit_is_unusable_writer(dd_tmp->suffix)) { strcat (list, ", "); strcat (list, dd_tmp->suffix); if (!streq(dd_tmp->suffix, dd_tmp->symbolicname)) { strcat (list, ", "); strcat (list, dd_tmp->symbolicname); } } dd_tmp++; } free(driver_description); #endif /* HAVE_LIBPSTOEDIT */ strcat (list, " or "); strcat (list, (char *) entry[i].name); return list; } int at_output_add_handler (at_string suffix, at_string description, at_output_write_func func) { return 0; } void at_spline_list_foreach (at_spline_list_type * list, AtSplineListForeachFunc func, at_address user_data) { unsigned i; for (i = 0; i < AT_SPLINE_LIST_LENGTH(list); i++) { func (list, AT_SPLINE_LIST_ELT(list, i), i, user_data); } } void at_spline_list_array_foreach (at_spline_list_array_type *list_array, AtSplineListArrayForeachFunc func, at_address user_data) { unsigned i; for (i = 0; i < AT_SPLINE_LIST_ARRAY_LENGTH(list_array); i++) { func (list_array, AT_SPLINE_LIST_ARRAY_ELT(list_array, i), i, user_data); } } #if HAVE_LIBPSTOEDIT static at_bool output_is_static_member (struct output_format_entry * entries, struct DriverDescription_S* dd) { while (entries->name) { if (streq(dd->suffix, entries->name) || streq(dd->symbolicname, entries->name)) return true; entries++; } return false; } #endif /* HAVE_LIBPSTOEDIT */ static at_bool streq (const char * a, const char * b) { if (!strcmp(a, b)) return true; else return false; } autotrace-0.31.1/input.c0000664000076400007640000001423507562261172010576 /* input.c: interface for input handlers Copyright (C) 1999, 2000, 2001 Bernhard Herzog. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "autotrace.h" #include "input.h" #include "input-pnm.h" #include "input-bmp.h" #include "input-tga.h" #ifdef HAVE_LIBPNG #include "input-png.h" #endif /* HAVE_LIBPNG */ #if HAVE_MAGICK #include /* Needed for correct interpretation of magick/api.h */ #include #include "input-magick.h" #endif /* HAVE_MAGICK */ #include "xstd.h" #include "filename.h" #include "strgicmp.h" #include struct input_format_entry { const char * name; const char * descr; at_input_read_func reader; }; #define END {NULL, NULL, NULL} static struct input_format_entry input_formats[] = { #ifdef HAVE_LIBPNG { "PNG", "Portable network graphics", input_png_reader}, #endif /* HAVE_LIBPNG */ { "TGA", "Truevision Targa image", input_tga_reader }, { "PBM", "Portable bitmap format", input_pnm_reader }, { "PNM", "Portable anymap format", input_pnm_reader }, { "PGM", "Portable graymap format", input_pnm_reader }, { "PPM", "Portable pixmap format", input_pnm_reader }, { "BMP", "Microsoft Windows bitmap image", input_bmp_reader }, END }; at_input_read_func at_input_get_handler (at_string filename) { char * ext = find_suffix (filename); if (ext == NULL) ext = ""; return at_input_get_handler_by_suffix (ext); } at_input_read_func at_input_get_handler_by_suffix (at_string suffix) { struct input_format_entry * format; if (!suffix || suffix[0] == '\0') return NULL; for (format = input_formats ; format->name; format++) { if (strgicmp (suffix, format->name)) { return format->reader; } } #if HAVE_MAGICK return (at_input_read_func)input_magick_reader; #else return NULL; #endif /* HAVE_MAGICK */ } char ** at_input_list_new (void) { char ** list; int count, count_int = 0; int i; #if HAVE_MAGICK ExceptionInfo exception; #if (MagickLibVersion < 0x0540) MagickInfo *info, *magickinfo; #else const MagickInfo *info, *magickinfo; #endif #endif struct input_format_entry * entry; for (entry = input_formats; entry->name; entry++) count_int++; #if HAVE_MAGICK #if (MagickLibVersion < 0x0538) MagickIncarnate(""); #else InitializeMagick(""); #endif GetExceptionInfo(&exception); #if (MagickLibVersion < 0x0534) magickinfo = info = GetMagickInfo(NULL); #else info = GetMagickInfo(NULL, &exception); if (info && !info->next) info = GetMagickInfo("*", &exception); magickinfo = info; #endif #endif count = count_int; #if HAVE_MAGICK while (info) { #if (MagickLibVersion < 0x0537) if (info->tag && info->description) #else if (info->name && info->description) #endif count ++; info = info->next ; } #endif XMALLOC(list, sizeof(char*)*((2*count)+1)); entry = input_formats; for (i = 0; i < count_int; i++) { list[2*i] = (char *)entry[i].name; list[2*i+1] = (char *)entry[i].descr; } #if HAVE_MAGICK info = magickinfo; while (info) { #if (MagickLibVersion < 0x0537) if (info->tag && info->description) #else if (info->name && info->description) #endif { #if (MagickLibVersion < 0x0537) list[2*i] = info->tag; #else list[2*i] = info->name; #endif list[2*i+1] = info->description; i++; } info = info->next ; } #endif list[2*i] = NULL; return list; } void at_input_list_free(char ** list) { free(list); } char * at_input_shortlist (void) { char * list; int count_int = 0; size_t length = 0; int i; #if HAVE_MAGICK ExceptionInfo exception; #if (MagickLibVersion < 0x0540) MagickInfo *info, *magickinfo; #else const MagickInfo *info, *magickinfo; #endif #endif struct input_format_entry * entry; for (entry = input_formats; entry->name; entry++) { count_int++; length += strlen (entry->name) + 2; } #if HAVE_MAGICK #if (MagickLibVersion < 0x0538) MagickIncarnate(""); #else InitializeMagick(""); #endif GetExceptionInfo(&exception); #if (MagickLibVersion < 0x0534) magickinfo = info = GetMagickInfo(NULL); #else magickinfo = info = GetMagickInfo(NULL, &exception); #endif #endif #if HAVE_MAGICK while (info) { #if (MagickLibVersion < 0x0537) if (info->tag && info->description) #else if (info->name && info->description) #endif { #if (MagickLibVersion < 0x0537) length += strlen (info->tag) + 2; #else length += strlen (info->name) + 2; #endif } info = info->next ; } #endif XMALLOC(list, sizeof (char) * (length + 1 + 2)); entry = input_formats; strcpy (list, (char *) entry[0].name); for (i = 1; i < count_int - 1; i++) { strcat (list, ", "); strcat (list, (char *) entry[i].name); } #if HAVE_MAGICK info = magickinfo; while (info) { #if (MagickLibVersion < 0x0537) if (info->tag && info->description) #else if (info->name && info->description) #endif { strcat (list, ", "); #if (MagickLibVersion < 0x0537) strcat (list, info->tag); #else strcat (list, info->name); #endif } info = info->next ; } #endif strcat (list, " or "); strcat (list, (char *) entry[i].name); return list; } int at_input_add_handler (at_string suffix, at_string description, at_input_read_func func) { return 0; } autotrace-0.31.1/pxl-outline.c0000664000076400007640000011054007562764172011723 /* pxl-outline.c: find the outlines of a bitmap image; each outline is made up of one or more pixels; and each pixel participates via one or more edges. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "message.h" #include "types.h" #include "bitmap.h" #include "color.h" #include "bitmap.h" #include "logreport.h" #include "xstd.h" #include "pxl-outline.h" #include /* We consider each pixel to consist of four edges, and we travel along edges, instead of through pixel centers. This is necessary for those unfortunate times when a single pixel is on both an inside and an outside outline. The numbers chosen here are not arbitrary; the code that figures out which edge to move to depends on particular values. See the `TRY_PIXEL' macro in `edge.c'. To emphasize this, I've written in the numbers we need for each edge value. */ typedef enum { TOP = 1, LEFT = 2, BOTTOM = 3, RIGHT = 0, NO_EDGE = 4 } edge_type; /* This choice is also not arbitrary: starting at the top edge makes the code find outside outlines before inside ones, which is certainly what we want. */ #define START_EDGE top typedef enum { NORTH = 0, NORTHWEST = 1, WEST = 2, SOUTHWEST = 3, SOUTH = 4, SOUTHEAST = 5, EAST = 6, NORTHEAST = 7 } direction_type; #define NUM_EDGES NO_EDGE #define COMPUTE_DELTA(axis, dir) \ ((dir) % 2 != 0 \ ? COMPUTE_##axis##_DELTA ((dir) - 1) \ + COMPUTE_##axis##_DELTA (((dir) + 1) % 8) \ : COMPUTE_##axis##_DELTA (dir) \ ) #define COMPUTE_ROW_DELTA(dir) \ ((dir) == NORTH ? -1 : (dir) == SOUTH ? +1 : 0) #define COMPUTE_COL_DELTA(dir) \ ((dir) == WEST ? -1 : (dir) == EAST ? +1 : 0) static pixel_outline_type find_one_outline (bitmap_type, edge_type, unsigned short, unsigned short, bitmap_type *, at_bool, at_bool, at_exception_type *); static pixel_outline_type find_one_centerline (bitmap_type, direction_type, unsigned short, unsigned short, bitmap_type *); static void append_pixel_outline (pixel_outline_list_type *, pixel_outline_type); static pixel_outline_type new_pixel_outline (void); static void free_pixel_outline (pixel_outline_type *); static void concat_pixel_outline (pixel_outline_type *, const pixel_outline_type*); static void append_outline_pixel (pixel_outline_type *, at_coord); static at_bool is_marked_edge (edge_type, unsigned short, unsigned short, bitmap_type); static at_bool is_outline_edge (edge_type, bitmap_type, unsigned short, unsigned short, color_type, at_exception_type *); static at_bool is_unmarked_outline_edge (unsigned short, unsigned short, edge_type, bitmap_type, bitmap_type, color_type, at_exception_type *); static void mark_edge (edge_type e, unsigned short, unsigned short, bitmap_type *); static edge_type opposite_edge(edge_type); static at_bool is_marked_dir(unsigned short, unsigned short, direction_type, bitmap_type); static at_bool is_other_dir_marked(unsigned short, unsigned short, direction_type, bitmap_type); static void mark_dir(unsigned short, unsigned short, direction_type, bitmap_type *); static at_bool next_unmarked_pixel(unsigned short *, unsigned short *, direction_type *, bitmap_type, bitmap_type *); at_bool is_valid_dir (unsigned short, unsigned short, direction_type, bitmap_type, bitmap_type); static at_coord next_point(bitmap_type, edge_type *, unsigned short *, unsigned short *, color_type, at_bool, bitmap_type, at_exception_type * ); static unsigned num_neighbors(unsigned short, unsigned short, bitmap_type); #define CHECK_FATAL() if (at_exception_got_fatal(exp)) goto cleanup; /* We go through a bitmap TOP to BOTTOM, LEFT to RIGHT, looking for each pixel with an unmarked edge that we consider a starting point of an outline. */ pixel_outline_list_type find_outline_pixels (bitmap_type bitmap, color_type *bg_color, at_progress_func notify_progress, at_address progress_data, at_testcancel_func test_cancel, at_address testcancel_data, at_exception_type * exp) { pixel_outline_list_type outline_list; unsigned short row, col; bitmap_type marked = new_bitmap (BITMAP_WIDTH (bitmap), BITMAP_HEIGHT (bitmap)); unsigned int max_progress = BITMAP_HEIGHT (bitmap) * BITMAP_WIDTH (bitmap); O_LIST_LENGTH (outline_list) = 0; outline_list.data = NULL; for (row = 0; row < BITMAP_HEIGHT (bitmap); row++) { for (col = 0; col < BITMAP_WIDTH (bitmap); col++) { edge_type edge; color_type color; at_bool is_background; if (notify_progress) notify_progress((at_real)(row * BITMAP_WIDTH(bitmap) + col) / ((at_real) max_progress * (at_real)3.0), progress_data); /* A valid edge can be TOP for an outside outline. Outside outlines are traced counterclockwise */ color = GET_COLOR (bitmap, row, col); if (!(is_background = (bg_color && COLOR_EQUAL(color, *bg_color))) && is_unmarked_outline_edge (row, col, edge = TOP, bitmap, marked, color, exp)) { pixel_outline_type outline; CHECK_FATAL (); /* FREE(DONE) outline_list */ LOG1 ("#%u: (counterclockwise)", O_LIST_LENGTH (outline_list)); outline = find_one_outline (bitmap, edge, row, col, &marked, false, false, exp); CHECK_FATAL(); /* FREE(DONE) outline_list */ O_CLOCKWISE (outline) = false; append_pixel_outline (&outline_list, outline); LOG1 (" [%u].\n", O_LENGTH (outline)); } else CHECK_FATAL (); /* FREE(DONE) outline_list */ /* A valid edge can be BOTTOM for an inside outline. Inside outlines are traced clockwise */ if (row!=0) { color = GET_COLOR (bitmap, row-1, col); if (!(bg_color && COLOR_EQUAL(color, *bg_color)) && is_unmarked_outline_edge (row-1, col, edge = BOTTOM, bitmap, marked, color, exp)) { pixel_outline_type outline; CHECK_FATAL(); /* FREE(DONE) outline_list */ /* This lines are for debugging only:*/ if (is_background) { LOG1 ("#%u: (clockwise)", O_LIST_LENGTH (outline_list)); outline = find_one_outline (bitmap, edge, row-1, col, &marked, true, false, exp); CHECK_FATAL(); /* FREE(DONE) outline_list */ O_CLOCKWISE (outline) = true; append_pixel_outline (&outline_list, outline); LOG1 (" [%u].\n", O_LENGTH (outline)); } else { outline = find_one_outline (bitmap, edge, row-1, col, &marked, true, true, exp); CHECK_FATAL(); /* FREE(DONE) outline_list */ } } else CHECK_FATAL(); /* FREE(DONE) outline_list */ } if (test_cancel && test_cancel(testcancel_data)) { free_pixel_outline_list(&outline_list); goto cleanup; } } } cleanup: free_bitmap (&marked); flush_log_output (); if (at_exception_got_fatal(exp)) free_pixel_outline_list(&outline_list); return outline_list; } /* We calculate one single outline here. We pass the position of the starting pixel and the starting edge. All edges we track along will be marked and the outline pixels are appended to the coordinate list. */ static pixel_outline_type find_one_outline (bitmap_type bitmap, edge_type original_edge, unsigned short original_row, unsigned short original_col, bitmap_type *marked, at_bool clockwise, at_bool ignore, at_exception_type * exp) { pixel_outline_type outline; unsigned short row = original_row, col = original_col; edge_type edge = original_edge; at_coord pos; pos.x = col + ((edge == RIGHT) || (edge == BOTTOM) ? 1 : 0); pos.y = BITMAP_HEIGHT (bitmap) - row - 1 + ((edge == TOP) || (edge == RIGHT) ? 1 : 0); if (!ignore) outline = new_pixel_outline (); outline.color = GET_COLOR (bitmap, row, col); do { /* Put this edge into the output list */ if (!ignore) { LOG2 (" (%d,%d)", pos.x, pos.y); append_outline_pixel (&outline, pos); } mark_edge (edge, row, col, marked); pos = next_point (bitmap, &edge, &row, &col, outline.color, clockwise, *marked, exp); CHECK_FATAL(); } while (edge != NO_EDGE); cleanup: if (at_exception_got_fatal(exp)) free_pixel_outline(&outline); return outline; } at_bool is_valid_dir (unsigned short row, unsigned short col, direction_type dir, bitmap_type bitmap, bitmap_type marked) { return (!is_marked_dir(row, col, dir, marked) && COMPUTE_DELTA(ROW, dir)+row > 0 && COMPUTE_DELTA(COL, dir)+col > 0 && BITMAP_VALID_PIXEL(bitmap, COMPUTE_DELTA(ROW, dir)+row, COMPUTE_DELTA(COL, dir)+col) && COLOR_EQUAL(GET_COLOR(bitmap, COMPUTE_DELTA(ROW, dir)+row, COMPUTE_DELTA(COL, dir)+col), GET_COLOR(bitmap, row, col))); } pixel_outline_list_type find_centerline_pixels (bitmap_type bitmap, color_type bg_color, at_progress_func notify_progress, at_address progress_data, at_testcancel_func test_cancel, at_address testcancel_data, at_exception_type * exp) { pixel_outline_list_type outline_list; signed short row, col; bitmap_type marked = new_bitmap(BITMAP_WIDTH(bitmap), BITMAP_HEIGHT (bitmap)); unsigned int max_progress = BITMAP_HEIGHT (bitmap) * BITMAP_WIDTH (bitmap); O_LIST_LENGTH(outline_list) = 0; outline_list.data = NULL; for (row = 0; row < BITMAP_HEIGHT(bitmap); row++) { for (col = 0; col < BITMAP_WIDTH(bitmap); ) { direction_type dir=EAST; pixel_outline_type outline; at_bool clockwise = false; if (notify_progress) notify_progress((at_real)(row * BITMAP_WIDTH(bitmap) + col) / ((at_real) max_progress * (at_real)3.0), progress_data); if (COLOR_EQUAL(GET_COLOR(bitmap, row, col), bg_color)) { col++; continue; } if (!is_valid_dir(row, col, dir, bitmap, marked) || (!is_valid_dir(COMPUTE_DELTA(ROW, dir)+row, COMPUTE_DELTA(COL, dir)+col, dir, bitmap, marked) && num_neighbors(row, col, bitmap) > 2) || num_neighbors(row, col, bitmap) > 4 || num_neighbors(COMPUTE_DELTA(ROW, dir)+row, COMPUTE_DELTA(COL, dir)+col, bitmap) > 4 || (is_other_dir_marked(row, col, dir, marked) && is_other_dir_marked(row+COMPUTE_DELTA(ROW, dir), col+COMPUTE_DELTA(COL, dir), dir, marked))) { dir = SOUTHEAST; if (!is_valid_dir(row, col, dir, bitmap, marked) || (!is_valid_dir(COMPUTE_DELTA(ROW, dir)+row, COMPUTE_DELTA(COL, dir)+col, dir, bitmap, marked) && num_neighbors(row, col, bitmap) > 2) || num_neighbors(row, col, bitmap) > 4 || num_neighbors(COMPUTE_DELTA(ROW, dir)+row, COMPUTE_DELTA(COL, dir)+col, bitmap) > 4 || (is_other_dir_marked(row, col, dir, marked) && is_other_dir_marked(row+COMPUTE_DELTA(ROW, dir), col+COMPUTE_DELTA(COL, dir), dir, marked))) { dir = SOUTH; if (!is_valid_dir(row, col, dir, bitmap, marked) || (!is_valid_dir(COMPUTE_DELTA(ROW, dir)+row, COMPUTE_DELTA(COL, dir)+col, dir, bitmap, marked) && num_neighbors(row, col, bitmap) > 2) || num_neighbors(row, col, bitmap) > 4 || num_neighbors(COMPUTE_DELTA(ROW, dir)+row, COMPUTE_DELTA(COL, dir)+col, bitmap) > 4 || (is_other_dir_marked(row, col, dir, marked) && is_other_dir_marked(row+COMPUTE_DELTA(ROW, dir), col+COMPUTE_DELTA(COL, dir), dir, marked))) { dir = SOUTHWEST; if (!is_valid_dir(row, col, dir, bitmap, marked) || (!is_valid_dir(COMPUTE_DELTA(ROW, dir)+row, COMPUTE_DELTA(COL, dir)+col, dir, bitmap, marked) && num_neighbors(row, col, bitmap) > 2) || num_neighbors(row, col, bitmap) > 4 || num_neighbors(COMPUTE_DELTA(ROW, dir)+row, COMPUTE_DELTA(COL, dir)+col, bitmap) > 4 || (is_other_dir_marked(row, col, dir, marked) && is_other_dir_marked(row+COMPUTE_DELTA(ROW, dir), col+COMPUTE_DELTA(COL, dir), dir, marked))) { col++; continue; } } } } LOG2("#%u: (%sclockwise) ", O_LIST_LENGTH(outline_list), clockwise ? "" : "counter"); outline = find_one_centerline(bitmap, dir, row, col, &marked); /* If the outline is open (i.e., we didn't return to the starting pixel), search from the starting pixel in the opposite direction and concatenate the two outlines. */ if (outline.open) { pixel_outline_type partial_outline; at_bool okay = false; if (dir == EAST) { dir = SOUTH; if (!(okay=is_valid_dir(row, col, dir, bitmap, marked))) { dir = SOUTHWEST; if (!(okay=is_valid_dir(row, col, dir, bitmap, marked))) { dir = SOUTHEAST; okay=is_valid_dir(row, col, dir, bitmap, marked); } } } else if (dir == SOUTHEAST) { dir = SOUTHWEST; if(!(okay=is_valid_dir(row, col, dir, bitmap, marked))) { dir = EAST; if(!(okay=is_valid_dir(row, col, dir, bitmap, marked))) { dir = SOUTH; okay=is_valid_dir(row, col, dir, bitmap, marked); } } } else if (dir == SOUTH) { dir = EAST; if(!(okay=is_valid_dir(row, col, dir, bitmap, marked))) { dir = SOUTHEAST; if(!(okay=is_valid_dir(row, col, dir, bitmap, marked))) { dir = SOUTHWEST; okay=is_valid_dir(row, col, dir, bitmap, marked); } } } else if (dir == SOUTHWEST) { dir = SOUTHEAST; if(!(okay=is_valid_dir(row, col, dir, bitmap, marked))) { dir = EAST; if(!(okay=is_valid_dir(row, col, dir, bitmap, marked))) { dir = SOUTH; okay=is_valid_dir(row, col, dir, bitmap, marked); } } } if (okay) { partial_outline = find_one_centerline(bitmap, dir, row, col, &marked); concat_pixel_outline(&outline, &partial_outline); if (partial_outline.data) free(partial_outline.data); } else col++; } /* Outside outlines will start at a top edge, and move counterclockwise, and inside outlines will start at a bottom edge, and move clockwise. This happens because of the order in which we look at the edges. */ O_CLOCKWISE(outline) = clockwise; if (O_LENGTH(outline) > 1) append_pixel_outline(&outline_list, outline); LOG1("(%s)", (outline.open ? " open" : " closed")); LOG1(" [%u].\n", O_LENGTH(outline)); if (O_LENGTH(outline) == 1) free_pixel_outline(&outline); } } if (test_cancel && test_cancel(testcancel_data)) { if (O_LIST_LENGTH (outline_list) != 0) free_pixel_outline_list (&outline_list); goto cleanup; } cleanup: free_bitmap(&marked); flush_log_output(); return outline_list; } static pixel_outline_type find_one_centerline(bitmap_type bitmap, direction_type search_dir, unsigned short original_row, unsigned short original_col, bitmap_type *marked) { pixel_outline_type outline = new_pixel_outline(); direction_type original_dir = search_dir; unsigned short row = original_row, col = original_col; unsigned short prev_row, prev_col; at_coord pos; outline.open = false; outline.color = GET_COLOR(bitmap, row, col); /* Add the starting pixel to the output list, changing from bitmap to Cartesian coordinates and specifying the left edge so that the coordinates won't be adjusted. */ pos.x = col; pos.y = BITMAP_HEIGHT(bitmap) - row - 1; LOG2 (" (%d,%d)", pos.x, pos.y); append_outline_pixel(&outline, pos); for ( ; ; ) { prev_row = row; prev_col = col; /* If there is no adjacent, unmarked pixel, we can't proceed any further, so return an open outline. */ if (!next_unmarked_pixel(&row, &col, &search_dir, bitmap, marked)) { outline.open = true; break; } /* If we've moved to a new pixel, mark all edges of the previous pixel so that it won't be revisited. */ if (!(prev_row == original_row && prev_col == original_col)) mark_dir(prev_row, prev_col, search_dir, marked); mark_dir(row, col, (search_dir+4)%8, marked); /* If we've returned to the starting pixel, we're done. */ if (row == original_row && col == original_col) break; /* Add the new pixel to the output list. */ pos.x = col; pos.y = BITMAP_HEIGHT(bitmap) - row - 1; LOG2 (" (%d,%d)", pos.x, pos.y); append_outline_pixel(&outline, pos); } mark_dir(original_row, original_col, original_dir, marked); return outline; } /* Add an outline to an outline list. */ static void append_pixel_outline (pixel_outline_list_type *outline_list, pixel_outline_type outline) { O_LIST_LENGTH (*outline_list)++; XREALLOC (outline_list->data, outline_list->length * sizeof (pixel_outline_type)); O_LIST_OUTLINE (*outline_list, O_LIST_LENGTH (*outline_list) - 1) = outline; } /* Free the list of outline lists. */ void free_pixel_outline_list (pixel_outline_list_type *outline_list) { unsigned this_outline; for (this_outline = 0; this_outline < outline_list->length; this_outline++) { pixel_outline_type o = outline_list->data[this_outline]; free_pixel_outline (&o); } outline_list->length = 0; if (outline_list->data != NULL) { free (outline_list->data); outline_list->data = NULL; } flush_log_output (); } /* Return an empty list of pixels. */ static pixel_outline_type new_pixel_outline (void) { pixel_outline_type pixel_outline; O_LENGTH (pixel_outline) = 0; pixel_outline.data = NULL; pixel_outline.open = false; return pixel_outline; } static void free_pixel_outline (pixel_outline_type * outline) { if (outline->data) { free (outline->data) ; outline->data = NULL; outline->length = 0; } } /* Concatenate two pixel lists. The two lists are assumed to have the same starting pixel and to proceed in opposite directions therefrom. */ static void concat_pixel_outline(pixel_outline_type *o1, const pixel_outline_type *o2) { int src, dst; unsigned o1_length, o2_length; if (!o1 || !o2 || O_LENGTH(*o2) <= 1) return; o1_length = O_LENGTH(*o1); o2_length = O_LENGTH(*o2); O_LENGTH(*o1) += o2_length - 1; /* Resize o1 to the sum of the lengths of o1 and o2 minus one (because the two lists are assumed to share the same starting pixel). */ XREALLOC(o1->data, O_LENGTH(*o1) * sizeof(at_coord)); /* Shift the contents of o1 to the end of the new array to make room to prepend o2. */ for (src = o1_length - 1, dst = O_LENGTH(*o1) - 1; src >= 0; src--, dst--) O_COORDINATE(*o1, dst) = O_COORDINATE(*o1, src); /* Prepend the contents of o2 (in reverse order) to o1. */ for (src = o2_length - 1, dst = 0; src > 0; src--, dst++) O_COORDINATE(*o1, dst) = O_COORDINATE(*o2, src); } /* Add a point to the pixel list. */ static void append_outline_pixel (pixel_outline_type *o, at_coord c) { O_LENGTH (*o)++; XREALLOC (o->data, O_LENGTH (*o) * sizeof (at_coord)); O_COORDINATE (*o, O_LENGTH (*o) - 1) = c; } /* Is this really an edge and is it still unmarked? */ static at_bool is_unmarked_outline_edge (unsigned short row, unsigned short col, edge_type edge, bitmap_type bitmap, bitmap_type marked, color_type color, at_exception_type * exp) { return (at_bool)(!is_marked_edge (edge, row, col, marked) && is_outline_edge (edge, bitmap, row, col, color, exp)); } /* We check to see if the edge of the pixel at position ROW and COL is an outline edge */ static at_bool is_outline_edge (edge_type edge, bitmap_type bitmap, unsigned short row, unsigned short col, color_type color, at_exception_type * exp) { /* If this pixel isn't of the same color, it's not part of the outline. */ if (!COLOR_EQUAL (GET_COLOR (bitmap, row, col), color)) return false; switch (edge) { case LEFT: return (at_bool)(col == 0 || !COLOR_EQUAL (GET_COLOR (bitmap, row, col - 1), color)); case TOP: return (at_bool)(row == 0 || !COLOR_EQUAL (GET_COLOR (bitmap, row - 1, col), color)); case RIGHT: return (at_bool)(col == BITMAP_WIDTH (bitmap) - 1 || !COLOR_EQUAL(GET_COLOR (bitmap, row, col + 1), color)); case BOTTOM: return (at_bool)(row == BITMAP_HEIGHT (bitmap) - 1 || !COLOR_EQUAL(GET_COLOR (bitmap, row + 1, col), color)); case NO_EDGE: default: LOG1 ("is_outline_edge: Bad edge value(%d)", edge); at_exception_fatal(exp, "is_outline_edge: Bad edge value"); } return false; /* NOT REACHED */ } /* If EDGE is not already marked, we mark it; otherwise, it's a fatal error. The position ROW and COL should be inside the bitmap MARKED. EDGE can be NO_EDGE. */ static void mark_edge (edge_type edge, unsigned short row, unsigned short col, bitmap_type *marked) { *BITMAP_PIXEL (*marked, row, col) |= 1 << edge; } /* Mark the direction of the pixel ROW/COL in MARKED. */ static void mark_dir(unsigned short row, unsigned short col, direction_type dir, bitmap_type *marked) { *BITMAP_PIXEL(*marked, row, col) |= 1 << dir; } /* Test if the direction of pixel at ROW/COL in MARKED is marked. */ static at_bool is_marked_dir(unsigned short row, unsigned short col, direction_type dir, bitmap_type marked) { return (at_bool)((*BITMAP_PIXEL(marked, row, col) & 1 << dir) != 0); } static at_bool is_other_dir_marked(unsigned short row, unsigned short col, direction_type dir, bitmap_type marked) { return (at_bool)((*BITMAP_PIXEL(marked, row, col) & (255 - (1 << dir) - (1 << ((dir + 4) % 8))) ) != 0); } static at_bool next_unmarked_pixel(unsigned short *row, unsigned short *col, direction_type *dir, bitmap_type bitmap, bitmap_type *marked) { color_type color; unsigned orig_row = *row, orig_col = *col; direction_type orig_dir = *dir, test_dir = *dir; color = GET_COLOR(bitmap, *row, *col); do { if (is_valid_dir(orig_row, orig_col, test_dir, bitmap, *marked)) { *row = orig_row + COMPUTE_DELTA(ROW, test_dir); *col = orig_col + COMPUTE_DELTA(COL, test_dir); *dir = test_dir; break; } if (orig_dir == test_dir) test_dir = (orig_dir + 2) % 8; else if ((orig_dir + 2) % 8 == test_dir) test_dir = (orig_dir + 6) % 8; else if ((orig_dir + 6) % 8 == test_dir) test_dir = (orig_dir + 1) % 8; else if ((orig_dir + 1) % 8 == test_dir) test_dir = (orig_dir + 7) % 8; else if ((orig_dir + 7) % 8 == test_dir) test_dir = (orig_dir + 3) % 8; else if ((orig_dir + 3) % 8 == test_dir) test_dir = (orig_dir + 5) % 8; else if ((orig_dir + 5) % 8 == test_dir) break; } while (1); if ((*row != orig_row || *col != orig_col) && (!(is_other_dir_marked(orig_row,orig_col,test_dir,*marked) &&is_other_dir_marked(orig_row + COMPUTE_DELTA(ROW, test_dir), orig_col + COMPUTE_DELTA(COL, test_dir),test_dir,*marked)))) return true; else return false; } /* Return the number of pixels adjacent to pixel ROW/COL that are black. */ static unsigned num_neighbors(unsigned short row, unsigned short col, bitmap_type bitmap) { unsigned dir, count = 0; color_type color = GET_COLOR(bitmap, row, col); for (dir = NORTH; dir <= NORTHEAST; dir++) { int delta_r = COMPUTE_DELTA(ROW, dir); int delta_c = COMPUTE_DELTA(COL, dir); unsigned int test_row = row + delta_r; unsigned int test_col = col + delta_c; if (BITMAP_VALID_PIXEL(bitmap, test_row, test_col) && COLOR_EQUAL(GET_COLOR(bitmap, test_row, test_col), color)) ++count; } return count; } /* Test if the edge EDGE at ROW/COL in MARKED is marked. */ static at_bool is_marked_edge (edge_type edge, unsigned short row, unsigned short col, bitmap_type marked) { return (at_bool)(edge == NO_EDGE ? false : (*BITMAP_PIXEL (marked, row, col) & (1 << edge)) != 0); } static at_coord next_point(bitmap_type bitmap, edge_type *edge, unsigned short *row, unsigned short *col, color_type color, at_bool clockwise, bitmap_type marked, at_exception_type * exp) { at_coord pos = {0, 0}; if (!clockwise) switch(*edge) { case TOP: /* WEST */ if((*col >=1 &&!is_marked_edge(TOP,*row,*col-1, marked) && is_outline_edge(TOP,bitmap,*row,*col-1, color, exp))) { /**edge = TOP;*/ (*col)--; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); /* NORTHWEST */ if((*col >=1 && *row >= 1 && !is_marked_edge(RIGHT,*row-1,*col-1, marked) && is_outline_edge(RIGHT,bitmap,*row-1,*col-1, color, exp)) && !(is_marked_edge(LEFT,*row-1,*col, marked) && is_marked_edge(TOP, *row,*col-1, marked)) && !(is_marked_edge(BOTTOM,*row-1,*col, marked) && is_marked_edge(RIGHT, *row,*col-1, marked))) { *edge = RIGHT; (*col)--; (*row)--; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); if ((!is_marked_edge(LEFT,*row,*col, marked) && is_outline_edge(LEFT,bitmap,*row,*col, color, exp))) { *edge = LEFT; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); *edge = NO_EDGE; break; case RIGHT: /* NORTH */ if((*row >=1 &&!is_marked_edge(RIGHT,*row-1,*col, marked) && is_outline_edge(RIGHT,bitmap,*row-1,*col, color, exp))) { /**edge = RIGHT;*/ (*row)--; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); /* NORTHEAST */ if((*col+1 < BITMAP_WIDTH (marked) && *row >= 1 && !is_marked_edge(BOTTOM,*row-1,*col+1, marked) && is_outline_edge(BOTTOM,bitmap,*row-1,*col+1, color, exp)) && !(is_marked_edge(LEFT,*row,*col+1, marked) && is_marked_edge(BOTTOM, *row-1,*col, marked)) && !(is_marked_edge(TOP,*row,*col+1, marked) && is_marked_edge(RIGHT, *row-1,*col, marked))) { *edge = BOTTOM; (*col)++; (*row)--; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); if ((!is_marked_edge(TOP,*row,*col, marked) && is_outline_edge(TOP,bitmap,*row,*col, color, exp))) { *edge = TOP; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); *edge = NO_EDGE; break; case BOTTOM: /* EAST */ if((*col+1 < BITMAP_WIDTH (marked) && !is_marked_edge(BOTTOM,*row,*col+1, marked) && is_outline_edge(BOTTOM,bitmap,*row,*col+1, color, exp))) { /**edge = BOTTOM;*/ (*col)++; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); /* SOUTHEAST */ if((*col+1 < BITMAP_WIDTH (marked) && *row+1 < BITMAP_HEIGHT (marked) && !is_marked_edge(LEFT,*row+1,*col+1, marked) && is_outline_edge(LEFT,bitmap,*row+1,*col+1, color, exp)) && !(is_marked_edge(TOP,*row+1,*col, marked) && is_marked_edge(LEFT, *row,*col+1, marked)) && !(is_marked_edge(RIGHT,*row+1,*col, marked) && is_marked_edge(BOTTOM,*row,*col+1, marked))) { *edge = LEFT; (*col)++; (*row)++; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); if ((!is_marked_edge(RIGHT,*row,*col, marked) && is_outline_edge(RIGHT,bitmap,*row,*col, color, exp))) { *edge = RIGHT; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); *edge = NO_EDGE; break; case LEFT: /* SOUTH */ if((*row+1 < BITMAP_HEIGHT (marked) && !is_marked_edge(LEFT,*row+1,*col, marked) && is_outline_edge(LEFT,bitmap,*row+1,*col, color, exp))) { /**edge = LEFT;*/ (*row)++; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); /* SOUTHWEST */ if((*col >= 1 && *row+1 < BITMAP_HEIGHT (marked) && !is_marked_edge(TOP,*row+1,*col-1, marked) && is_outline_edge(TOP,bitmap,*row+1,*col-1, color, exp)) && !(is_marked_edge(RIGHT,*row,*col-1, marked) && is_marked_edge(TOP, *row+1,*col, marked)) && !(is_marked_edge(BOTTOM, *row,*col-1, marked) && is_marked_edge(LEFT, *row+1,*col, marked))) { *edge = TOP; (*col)--; (*row)++; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); if ((!is_marked_edge(BOTTOM,*row,*col, marked) && is_outline_edge(BOTTOM,bitmap,*row,*col, color, exp))) { *edge = BOTTOM; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); case NO_EDGE: default: *edge = NO_EDGE; break; } else switch(*edge) { case TOP: if ((!is_marked_edge(LEFT,*row,*col, marked) && is_outline_edge(LEFT,bitmap,*row,*col, color, exp))) { *edge = LEFT; pos.x=*col; pos.y=BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); /* WEST */ if((*col >=1 &&!is_marked_edge(TOP,*row,*col-1, marked) && is_outline_edge(TOP,bitmap,*row,*col-1, color, exp))) { /**edge = TOP;*/ (*col)--; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); /* NORTHWEST */ if((*col >=1 && *row >= 1 && !is_marked_edge(RIGHT,*row-1,*col-1, marked) && is_outline_edge(RIGHT,bitmap,*row-1,*col-1, color, exp))) { *edge = RIGHT; (*col)--; (*row)--; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); *edge = NO_EDGE; break; case RIGHT: if ((!is_marked_edge(TOP,*row,*col, marked) && is_outline_edge(TOP,bitmap,*row,*col, color, exp))) { *edge = TOP; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); /* NORTH */ if((*row >=1 &&!is_marked_edge(RIGHT,*row-1,*col, marked) && is_outline_edge(RIGHT,bitmap,*row-1,*col, color, exp))) { /**edge = RIGHT;*/ (*row)--; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); /* NORTHEAST */ if((*col+1 < BITMAP_WIDTH (marked) && *row >= 1 && !is_marked_edge(BOTTOM,*row-1,*col+1, marked) && is_outline_edge(BOTTOM,bitmap,*row-1,*col+1, color, exp))) { *edge = BOTTOM; (*col)++; (*row)--; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); *edge = NO_EDGE; break; case BOTTOM: if ((!is_marked_edge(RIGHT,*row,*col, marked) && is_outline_edge(RIGHT,bitmap,*row,*col, color, exp))) { *edge = RIGHT; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); /* EAST */ if((*col+1 < BITMAP_WIDTH (marked) && !is_marked_edge(BOTTOM,*row,*col+1, marked) && is_outline_edge(BOTTOM,bitmap,*row,*col+1, color, exp))) { /**edge = BOTTOM;*/ (*col)++; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); /* SOUTHEAST */ if((*col+1 < BITMAP_WIDTH (marked) && *row+1 < BITMAP_HEIGHT (marked) && !is_marked_edge(LEFT,*row+1,*col+1, marked) && is_outline_edge(LEFT,bitmap,*row+1,*col+1, color, exp))) { *edge = LEFT; (*col)++; (*row)++; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); *edge = NO_EDGE; break; case LEFT: if ((!is_marked_edge(BOTTOM,*row,*col, marked) && is_outline_edge(BOTTOM,bitmap,*row,*col, color, exp))) { *edge = BOTTOM; pos.x = *col+1; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); /* SOUTH */ if((*row+1 < BITMAP_HEIGHT (marked) && !is_marked_edge(LEFT,*row+1,*col, marked) && is_outline_edge(LEFT,bitmap,*row+1,*col, color, exp))) { /**edge = LEFT;*/ (*row)++; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row - 1; break; } CHECK_FATAL(); /* SOUTHWEST */ if((*col >= 1 && *row+1 < BITMAP_HEIGHT (marked) && !is_marked_edge(TOP,*row+1,*col-1, marked) && is_outline_edge(TOP,bitmap,*row+1,*col-1, color, exp))) { *edge = TOP; (*col)--; (*row)++; pos.x = *col; pos.y = BITMAP_HEIGHT (bitmap) - *row; break; } CHECK_FATAL(); case NO_EDGE: default: *edge = NO_EDGE; break; } cleanup: return(pos); } autotrace-0.31.1/median.c0000664000076400007640000007124307551363232010674 /* median.c: median cut - reducing a high color bitmap to certain number of colors Copyright (C) 2001, 2002 Martin Weber This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include #include #include #include "message.h" #include "xstd.h" #include "quantize.h" #define MAXNUMCOLORS 256 #if 0 #define R_SCALE #define G_SCALE #define B_SCALE #else /* scale RGB distances by *2,*3,*1 */ #define R_SCALE <<1 #define G_SCALE *3 #define B_SCALE #endif #define BITS_IN_SAMPLE 8 #define R_SHIFT (BITS_IN_SAMPLE - PRECISION_R) #define G_SHIFT (BITS_IN_SAMPLE - PRECISION_G) #define B_SHIFT (BITS_IN_SAMPLE - PRECISION_B) typedef struct { /* The bounds of the box (inclusive); expressed as histogram indexes */ int Rmin, Rmax; int Gmin, Gmax; int Bmin, Bmax; /* The volume (actually 2-norm) of the box */ int volume; /* The number of nonzero histogram cells within this box */ long colorcount; } box, *boxptr; static void zero_histogram_rgb(Histogram histogram) { int r, g, b; for (r = 0; r < HIST_R_ELEMS; r++) for (g = 0; g < HIST_G_ELEMS; g++) for (b = 0; b < HIST_B_ELEMS; b++) histogram[r * MR + g * MG + b] = 0; } static void generate_histogram_rgb(Histogram histogram, bitmap_type *image, const color_type *ignoreColor) { unsigned char *src = image->bitmap; int num_elems; ColorFreq *col; num_elems = BITMAP_WIDTH(*image) * BITMAP_HEIGHT(*image); zero_histogram_rgb(histogram); switch (BITMAP_PLANES(*image)) { case 3: while (num_elems--) { /* If we have an ignorecolor, skip it. */ if (ignoreColor) { if ((src[0] == ignoreColor->r) && (src[1] == ignoreColor->g) && (src[2] == ignoreColor->b)) { src += 3; continue; } } col = &histogram[(src[0] >> R_SHIFT) * MR + (src[1] >> G_SHIFT) * MG + (src[2] >> B_SHIFT)]; (*col)++; src += 3; } break; case 1: while (--num_elems >= 0) { if (ignoreColor && src[num_elems] == ignoreColor->r) continue; col = &histogram[(src[num_elems] >> R_SHIFT) * MR + (src[num_elems] >> G_SHIFT) * MG + (src[num_elems] >> B_SHIFT)]; (*col)++; } break; default: /* To avoid compiler warning */ ; } } static boxptr find_biggest_volume (boxptr boxlist, int numboxes) /* Find the splittable box with the largest (scaled) volume */ /* Returns 0 if no splittable boxes remain */ { boxptr boxp; int i; int maxv = 0; boxptr which = 0; for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { if (boxp->volume > maxv) { which = boxp; maxv = boxp->volume; } } return which; } static void update_box_rgb(Histogram histogram, boxptr boxp) /* Shrink the min/max bounds of a box to enclose only nonzero elements, */ /* and recompute its volume and population */ { ColorFreq *histp; int R, G, B; int Rmin, Rmax, Gmin, Gmax, Bmin, Bmax; int dist0, dist1, dist2; long ccount; Rmin = boxp->Rmin; Rmax = boxp->Rmax; Gmin = boxp->Gmin; Gmax = boxp->Gmax; Bmin = boxp->Bmin; Bmax = boxp->Bmax; if (Rmax > Rmin) for (R = Rmin; R <= Rmax; R++) for (G = Gmin; G <= Gmax; G++) { histp = histogram + R * MR + G * MG + Bmin; for (B = Bmin; B <= Bmax; B++) if (*histp++ != 0) { boxp->Rmin = Rmin = R; goto have_Rmin; } } have_Rmin: if (Rmax > Rmin) for (R = Rmax; R >= Rmin; R--) for (G = Gmin; G <= Gmax; G++) { histp = histogram + R * MR + G * MG + Bmin; for (B = Bmin; B <= Bmax; B++) if (*histp++ != 0) { boxp->Rmax = Rmax = R; goto have_Rmax; } } have_Rmax: if (Gmax > Gmin) for (G = Gmin; G <= Gmax; G++) for (R = Rmin; R <= Rmax; R++) { histp = histogram + R * MR + G * MG + Bmin; for (B = Bmin; B <= Bmax; B++) if (*histp++ != 0) { boxp->Gmin = Gmin = G; goto have_Gmin; } } have_Gmin: if (Gmax > Gmin) for (G = Gmax; G >= Gmin; G--) for (R = Rmin; R <= Rmax; R++) { histp = histogram + R * MR + G * MG + Bmin; for (B = Bmin; B <= Bmax; B++) if (*histp++ != 0) { boxp->Gmax = Gmax = G; goto have_Gmax; } } have_Gmax: if (Bmax > Bmin) for (B = Bmin; B <= Bmax; B++) for (R = Rmin; R <= Rmax; R++) { histp = histogram + R * MR + Gmin * MG + B; for (G = Gmin; G <= Gmax; G++, histp += MG) if (*histp != 0) { boxp->Bmin = Bmin = B; goto have_Bmin; } } have_Bmin: if (Bmax > Bmin) for (B = Bmax; B >= Bmin; B--) for (R = Rmin; R <= Rmax; R++) { histp = histogram + R * MR + Gmin * MG + B; for (G = Gmin; G <= Gmax; G++, histp += MG) if (*histp != 0) { boxp->Bmax = Bmax = B; goto have_Bmax; } } have_Bmax: /* Update box volume. * We use 2-norm rather than real volume here; this biases the method * against making long narrow boxes, and it has the side benefit that * a box is splittable iff norm > 0. * Since the differences are expressed in histogram-cell units, * we have to shift back to JSAMPLE units to get consistent distances; * after which, we scale according to the selected distance scale factors. */ dist0 = Rmax - Rmin; dist1 = Gmax - Gmin; dist2 = Bmax - Bmin; boxp->volume = dist0 * dist0 + dist1 * dist1 + dist2 * dist2; /* Now scan remaining volume of box and compute population */ ccount = 0; for (R = Rmin; R <= Rmax; R++) for (G = Gmin; G <= Gmax; G++) { histp = histogram + R * MR + G * MG + Bmin; for (B = Bmin; B <= Bmax; B++, histp++) if (*histp != 0) { ccount++; } } boxp->colorcount = ccount; } static int median_cut_rgb (Histogram histogram, boxptr boxlist, int numboxes, int desired_colors) /* Repeatedly select and split the largest box until we have enough boxes */ { int n, lb; int R, G, B, cmax; boxptr b1, b2; while (numboxes < desired_colors) { /* Select box to split. * Current algorithm: by population for first half, then by volume. */ b1 = find_biggest_volume (boxlist, numboxes); if (b1 == 0) /* no splittable boxes left! */ break; b2 = boxlist + numboxes; /* where new box will go */ /* Copy the color bounds to the new box. */ b2->Rmax = b1->Rmax; b2->Gmax = b1->Gmax; b2->Bmax = b1->Bmax; b2->Rmin = b1->Rmin; b2->Gmin = b1->Gmin; b2->Bmin = b1->Bmin; /* Choose which axis to split the box on. * Current algorithm: longest scaled axis. * See notes in update_box about scaling distances. */ R = b1->Rmax - b1->Rmin; G = b1->Gmax - b1->Gmin; B = b1->Bmax - b1->Bmin; /* We want to break any ties in favor of green, then red, blue last. */ cmax = G; n = 1; if (R > cmax) { cmax = R; n = 0; } if (B > cmax) { n = 2; } /* Choose split point along selected axis, and update box bounds. * Current algorithm: split at halfway point. * (Since the box has been shrunk to minimum volume, * any split will produce two nonempty subboxes.) * Note that lb value is max for lower box, so must be < old max. */ switch (n) { case 0: lb = (b1->Rmax + b1->Rmin) / 2; b1->Rmax = lb; b2->Rmin = lb + 1; break; case 1: lb = (b1->Gmax + b1->Gmin) / 2; b1->Gmax = lb; b2->Gmin = lb + 1; break; case 2: lb = (b1->Bmax + b1->Bmin) / 2; b1->Bmax = lb; b2->Bmin = lb + 1; break; } /* Update stats for boxes */ update_box_rgb(histogram, b1); update_box_rgb(histogram, b2); numboxes++; } return numboxes; } static void compute_color_rgb(QuantizeObj *quantobj, Histogram histogram, boxptr boxp, int icolor) /* Compute representative color for a box, put it in colormap[icolor] */ { /* Current algorithm: mean weighted by pixels (not colors) */ /* Note it is important to get the rounding correct! */ ColorFreq *histp; int R, G, B; int Rmin, Rmax; int Gmin, Gmax; int Bmin, Bmax; unsigned long count; unsigned long total = 0; unsigned long Rtotal = 0; unsigned long Gtotal = 0; unsigned long Btotal = 0; Rmin = boxp->Rmin; Rmax = boxp->Rmax; Gmin = boxp->Gmin; Gmax = boxp->Gmax; Bmin = boxp->Bmin; Bmax = boxp->Bmax; for (R = Rmin; R <= Rmax; R++) for (G = Gmin; G <= Gmax; G++) { histp = histogram + R * MR + G * MG + Bmin; for (B = Bmin; B <= Bmax; B++) { if ((count = *histp++) != 0) { total += count; Rtotal += ((R << R_SHIFT) + ((1 << R_SHIFT) >> 1)) * count; Gtotal += ((G << G_SHIFT) + ((1 << G_SHIFT) >> 1)) * count; Btotal += ((B << B_SHIFT) + ((1 << B_SHIFT) >> 1)) * count; } } } quantobj->cmap[icolor].r = (unsigned char) ((Rtotal + (total >> 1)) / total); quantobj->cmap[icolor].g = (unsigned char) ((Gtotal + (total >> 1)) / total); quantobj->cmap[icolor].b = (unsigned char) ((Btotal + (total >> 1)) / total); quantobj->freq[icolor] = total; } static void select_colors_rgb(QuantizeObj *quantobj, Histogram histogram) /* Master routine for color selection */ { boxptr boxlist; int numboxes; int desired = quantobj->desired_number_of_colors; int i; /* Allocate workspace for box list */ XMALLOC (boxlist, desired * sizeof(box)); /* Initialize one box containing whole space */ numboxes = 1; boxlist[0].Rmin = 0; boxlist[0].Rmax = (1 << PRECISION_R) - 1; boxlist[0].Gmin = 0; boxlist[0].Gmax = (1 << PRECISION_G) - 1; boxlist[0].Bmin = 0; boxlist[0].Bmax = (1 << PRECISION_B) - 1; /* Shrink it to actually-used volume and set its statistics */ update_box_rgb(histogram, boxlist); /* Perform median-cut to produce final box list */ numboxes = median_cut_rgb(histogram, boxlist, numboxes, desired); quantobj->actual_number_of_colors = numboxes; /* Compute the representative color for each box, fill colormap */ for (i = 0; i < numboxes; i++) compute_color_rgb(quantobj, histogram, boxlist + i, i); free (boxlist); } /* * These routines are concerned with the time-critical task of mapping input * colors to the nearest color in the selected colormap. * * We re-use the histogram space as an "inverse color map", essentially a * cache for the results of nearest-color searches. All colors within a * histogram cell will be mapped to the same colormap entry, namely the one * closest to the cell's center. This may not be quite the closest entry to * the actual input color, but it's almost as good. A zero in the cache * indicates we haven't found the nearest color for that cell yet; the array * is cleared to zeroes before starting the mapping pass. When we find the * nearest color for a cell, its colormap index plus one is recorded in the * cache for future use. The pass2 scanning routines call fill_inverse_cmap * when they need to use an unfilled entry in the cache. * * Our method of efficiently finding nearest colors is based on the "locally * sorted search" idea described by Heckbert and on the incremental distance * calculation described by Spencer W. Thomas in chapter III.1 of Graphics * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that * the distances from a given colormap entry to each cell of the histogram can * be computed quickly using an incremental method: the differences between * distances to adjacent cells themselves differ by a constant. This allows a * fairly fast implementation of the "brute force" approach of computing the * distance from every colormap entry to every histogram cell. Unfortunately, * it needs a work array to hold the best-distance-so-far for each histogram * cell (because the inner loop has to be over cells, not colormap entries). * The work array elements have to be ints, so the work array would need * 256Kb at our recommended precision. This is not feasible in DOS machines. [ 256*1024/4 = 65,536 ] * To get around these problems, we apply Thomas' method to compute the * nearest colors for only the cells within a small subbox of the histogram. * The work array need be only as big as the subbox, so the memory usage * problem is solved. Furthermore, we need not fill subboxes that are never * referenced in pass2; many images use only part of the color gamut, so a * fair amount of work is saved. An additional advantage of this * approach is that we can apply Heckbert's locality criterion to quickly * eliminate colormap entries that are far away from the subbox; typically * three-fourths of the colormap entries are rejected by Heckbert's criterion, * and we need not compute their distances to individual cells in the subbox. * The speed of this approach is heavily influenced by the subbox size: too * small means too much overhead, too big loses because Heckbert's criterion * can't eliminate as many colormap entries. Empirically the best subbox * size seems to be about 1/512th of the histogram (1/8th in each direction). * * Thomas' article also describes a refined method which is asymptotically * faster than the brute-force method, but it is also far more complex and * cannot efficiently be applied to small subboxes. It is therefore not * useful for programs intended to be portable to DOS machines. On machines * with plenty of memory, filling the whole histogram in one shot with Thomas' * refined method might be faster than the present code --- but then again, * it might not be any faster, and it's certainly more complicated. */ /* log2(histogram cells in update box) for each axis; this can be adjusted */ #define BOX_R_LOG (PRECISION_R-3) #define BOX_G_LOG (PRECISION_G-3) #define BOX_B_LOG (PRECISION_B-3) #define BOX_R_ELEMS (1<actual_number_of_colors; int maxR, maxG, maxB; int centerR, centerG, centerB; int i, x, ncolors; int minmaxdist, min_dist = 0, max_dist, tdist; int mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ /* Compute true coordinates of update box's upper corner and center. * Actually we compute the coordinates of the center of the upper-corner * histogram cell, which are the upper bounds of the volume we care about. * Note that since ">>" rounds down, the "center" values may be closer to * min than to max; hence comparisons to them must be "<=", not "<". */ maxR = minR + ((1 << BOX_R_SHIFT) - (1 << R_SHIFT)); centerR = (minR + maxR) >> 1; maxG = minG + ((1 << BOX_G_SHIFT) - (1 << G_SHIFT)); centerG = (minG + maxG) >> 1; maxB = minB + ((1 << BOX_B_SHIFT) - (1 << B_SHIFT)); centerB = (minB + maxB) >> 1; /* For each color in colormap, find: * 1. its minimum squared-distance to any point in the update box * (zero if color is within update box); * 2. its maximum squared-distance to any point in the update box. * Both of these can be found by considering only the corners of the box. * We save the minimum distance for each color in mindist[]; * only the smallest maximum distance is of interest. */ minmaxdist = 0x7FFFFFFFL; for (i = 0; i < numcolors; i++) { /* We compute the squared-R-distance term, then add in the other two. */ x = quantobj->cmap[i].r; if (x < minR) { tdist = (x - minR) R_SCALE; min_dist = tdist * tdist; tdist = (x - maxR) R_SCALE; max_dist = tdist * tdist; } else if (x > maxR) { tdist = (x - maxR) R_SCALE; min_dist = tdist * tdist; tdist = (x - minR) R_SCALE; max_dist = tdist * tdist; } else { /* within cell range so no contribution to min_dist */ min_dist = 0; if (x <= centerR) { tdist = (x - maxR) R_SCALE; max_dist = tdist * tdist; } else { tdist = (x - minR) R_SCALE; max_dist = tdist * tdist; } } x = quantobj->cmap[i].g; if (x < minG) { tdist = (x - minG) G_SCALE; min_dist += tdist * tdist; tdist = (x - maxG) G_SCALE; max_dist += tdist * tdist; } else if (x > maxG) { tdist = (x - maxG) G_SCALE; min_dist += tdist * tdist; tdist = (x - minG) G_SCALE; max_dist += tdist * tdist; } else { /* within cell range so no contribution to min_dist */ if (x <= centerG) { tdist = (x - maxG) G_SCALE; max_dist += tdist * tdist; } else { tdist = (x - minG) G_SCALE; max_dist += tdist * tdist; } } x = quantobj->cmap[i].b; if (x < minB) { tdist = (x - minB) B_SCALE; min_dist += tdist * tdist; tdist = (x - maxB) B_SCALE; max_dist += tdist * tdist; } else if (x > maxB) { tdist = (x - maxB) B_SCALE; min_dist += tdist * tdist; tdist = (x - minB) B_SCALE; max_dist += tdist * tdist; } else { /* within cell range so no contribution to min_dist */ if (x <= centerB) { tdist = (x - maxB) B_SCALE; max_dist += tdist * tdist; } else { tdist = (x - minB) B_SCALE; max_dist += tdist * tdist; } } mindist[i] = min_dist; /* save away the results */ if (max_dist < minmaxdist) minmaxdist = max_dist; } /* Now we know that no cell in the update box is more than minmaxdist * away from some colormap entry. Therefore, only colors that are * within minmaxdist of some part of the box need be considered. */ ncolors = 0; for (i = 0; i < numcolors; i++) { if (mindist[i] <= minmaxdist) colorlist[ncolors++] = i; } return ncolors; } static void find_best_colors(QuantizeObj *quantobj, int minR, int minG, int minB, int numcolors, int *colorlist,int *bestcolor) /* Find the closest colormap entry for each cell in the update box, given the list of candidate colors prepared by find_nearby_colors. Return the indexes of the closest entries in the bestcolor[] array. This routine uses Thomas' incremental distance calculation method to find the distance from a colormap entry to successive cells in the box. */ { int iR, iG, iB; int i, icolor; int *bptr; /* pointer into bestdist[] array */ int *cptr; /* pointer into bestcolor[] array */ int dist0, dist1; /* initial distance values */ int dist2; /* current distance in inner loop */ int xx0, xx1; /* distance increments */ int xx2; int inR, inG, inB; /* initial values for increments */ /* This array holds the distance to the nearest-so-far color for each cell */ int bestdist[BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS]; /* Initialize best-distance for each cell of the update box */ bptr = bestdist; for (i = BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS - 1; i >= 0; i--) *bptr++ = 0x7FFFFFFFL; /* For each color selected by find_nearby_colors, * compute its distance to the center of each cell in the box. * If that's less than best-so-far, update best distance and color number. */ /* Nominal steps between cell centers ("x" in Thomas article) */ #define STEP_R ((1 << R_SHIFT) R_SCALE) #define STEP_G ((1 << G_SHIFT) G_SCALE) #define STEP_B ((1 << B_SHIFT) B_SCALE) for (i = 0; i < numcolors; i++) { icolor = colorlist[i]; /* Compute (square of) distance from minR/G/B to this color */ inR = (minR - quantobj->cmap[icolor].r) R_SCALE; dist0 = inR * inR; inG = (minG - quantobj->cmap[icolor].g) G_SCALE; dist0 += inG * inG; inB = (minB - quantobj->cmap[icolor].b) B_SCALE; dist0 += inB * inB; /* Form the initial difference increments */ inR = inR * (2 * STEP_R) + STEP_R * STEP_R; inG = inG * (2 * STEP_G) + STEP_G * STEP_G; inB = inB * (2 * STEP_B) + STEP_B * STEP_B; /* Now loop over all cells in box, updating distance per Thomas method */ bptr = bestdist; cptr = bestcolor; xx0 = inR; for (iR = BOX_R_ELEMS - 1; iR >= 0; iR--) { dist1 = dist0; xx1 = inG; for (iG = BOX_G_ELEMS - 1; iG >= 0; iG--) { dist2 = dist1; xx2 = inB; for (iB = BOX_B_ELEMS - 1; iB >= 0; iB--) { if (dist2 < *bptr) { *bptr = dist2; *cptr = icolor; } dist2 += xx2; xx2 += 2 * STEP_B * STEP_B; bptr++; cptr++; } dist1 += xx1; xx1 += 2 * STEP_G * STEP_G; } dist0 += xx0; xx0 += 2 * STEP_R * STEP_R; } } } static void fill_inverse_cmap_rgb(QuantizeObj *quantobj, Histogram histogram, int R, int G, int B) /* Fill the inverse-colormap entries in the update box that contains histogram cell R/G/B. (Only that one cell MUST be filled, but we can fill as many others as we wish.) */ { int minR, minG, minB; /* lower left corner of update box */ int iR, iG, iB; int *cptr; /* pointer into bestcolor[] array */ ColorFreq *cachep; /* pointer into main cache array */ /* This array lists the candidate colormap indexes. */ int colorlist[MAXNUMCOLORS]; int numcolors; /* number of candidate colors */ /* This array holds the actually closest colormap index for each cell. */ int bestcolor[BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS]; /* Convert cell coordinates to update box ID */ R >>= BOX_R_LOG; G >>= BOX_G_LOG; B >>= BOX_B_LOG; /* Compute true coordinates of update box's origin corner. * Actually we compute the coordinates of the center of the corner * histogram cell, which are the lower bounds of the volume we care about. */ minR = (R << BOX_R_SHIFT) + ((1 << R_SHIFT) >> 1); minG = (G << BOX_G_SHIFT) + ((1 << G_SHIFT) >> 1); minB = (B << BOX_B_SHIFT) + ((1 << B_SHIFT) >> 1); /* Determine which colormap entries are close enough to be candidates * for the nearest entry to some cell in the update box. */ numcolors = find_nearby_colors(quantobj, minR, minG, minB, colorlist); /* Determine the actually nearest colors. */ find_best_colors(quantobj, minR, minG, minB, numcolors, colorlist, bestcolor); /* Save the best color numbers (plus 1) in the main cache array */ R <<= BOX_R_LOG; /* convert ID back to base cell indexes */ G <<= BOX_G_LOG; B <<= BOX_B_LOG; cptr = bestcolor; for (iR = 0; iR < BOX_R_ELEMS; iR++) { for (iG = 0; iG < BOX_G_ELEMS; iG++) { cachep = &histogram[(R + iR) * MR + (G + iG) * MG + B]; for (iB = 0; iB < BOX_B_ELEMS; iB++) { *cachep++ = (*cptr++) + 1; } } } } /* This is pass 1 */ static void median_cut_pass1_rgb(QuantizeObj *quantobj, bitmap_type *image, const color_type *ignoreColor) { generate_histogram_rgb(quantobj->histogram, image, ignoreColor); select_colors_rgb(quantobj, quantobj->histogram); } /* Map some rows of pixels to the output colormapped representation. */ static void median_cut_pass2_rgb(QuantizeObj *quantobj, bitmap_type *image, const color_type *bgColor) /* This version performs no dithering */ { Histogram histogram = quantobj->histogram; ColorFreq *cachep; int R, G, B; int origR, origG, origB; int row, col; int spp = BITMAP_PLANES(*image); int width = BITMAP_WIDTH(*image); int height = BITMAP_HEIGHT(*image); unsigned char *src, *dest; color_type bg_color = { 0xff, 0xff, 0xff }; zero_histogram_rgb(histogram); if (bgColor) { /* Find the nearest colormap entry for the background color. */ R = bgColor->r >> R_SHIFT; G = bgColor->g >> G_SHIFT; B = bgColor->b >> B_SHIFT; cachep = &histogram[R * MR + G * MG + B]; if (*cachep == 0) fill_inverse_cmap_rgb(quantobj, histogram, R, G, B); bg_color = quantobj->cmap[*cachep - 1]; } src = dest = image->bitmap; if (spp == 3) { for (row = 0; row < height; row++) { for (col = 0; col < width; col++) { /* get pixel value and index into the cache */ origR = (*src++); origG = (*src++); origB = (*src++); /* if (origR > 253 && origG > 253 && origB > 253) { (*dest++) = 255; (*dest++) = 255; (*dest++) = 255; continue; } */ /* get pixel value and index into the cache */ R = origR >> R_SHIFT; G = origG >> G_SHIFT; B = origB >> B_SHIFT; cachep = &histogram[R * MR + G * MG + B]; /* If we have not seen this color before, find nearest colormap entry and update the cache */ if (*cachep == 0) { fill_inverse_cmap_rgb(quantobj, histogram, R, G, B); } /* Now emit the colormap index for this cell */ dest[0] = quantobj->cmap[*cachep - 1].r; dest[1] = quantobj->cmap[*cachep - 1].g; dest[2] = quantobj->cmap[*cachep - 1].b; /* If the colormap entry for this pixel is the same as the background's colormap entry, set the pixel to the background color. */ if (bgColor && (dest[0] == bg_color.r && dest[1] == bg_color.g && dest[2] == bg_color.b)) { dest[0] = bgColor->r; dest[1] = bgColor->g; dest[2] = bgColor->b; } dest += 3; } } } else if (spp == 1) { long idx = width * height; while (--idx >= 0) { origR = src[idx]; R = origR >> R_SHIFT; G = origR >> G_SHIFT; B = origR >> B_SHIFT; cachep = &histogram[R * MR + G * MG + B]; if (*cachep == 0) fill_inverse_cmap_rgb(quantobj, histogram, R, G, B); dest[idx] = quantobj->cmap[*cachep - 1].r; /* If the colormap entry for this pixel is the same as the background's colormap entry, set the pixel to the background color. */ if (bgColor && dest[idx] == bg_color.r) dest[idx] = bgColor->r; } } } static QuantizeObj *initialize_median_cut(int num_colors) { QuantizeObj *quantobj; /* Initialize the data structures */ XMALLOC (quantobj, sizeof(QuantizeObj)); XMALLOC (quantobj->histogram, sizeof(ColorFreq) * HIST_R_ELEMS * HIST_G_ELEMS * HIST_B_ELEMS); quantobj->desired_number_of_colors = num_colors; return quantobj; } void quantize(bitmap_type *image, long ncolors, const color_type *bgColor, QuantizeObj **iQuant, at_exception_type * exp) { QuantizeObj *quantobj; unsigned int spp = BITMAP_PLANES(*image); if (spp != 3 && spp != 1) { LOG1 ("quantize: %u-plane images are not supported", spp); at_exception_fatal(exp, "quantize: wrong plane images are passed"); return; } /* If a pointer was sent in, let's use it. */ if (iQuant) { if (*iQuant == NULL) { quantobj = initialize_median_cut(ncolors); median_cut_pass1_rgb (quantobj, image, bgColor); *iQuant = quantobj; } else quantobj = *iQuant; } else { quantobj = initialize_median_cut(ncolors); median_cut_pass1_rgb (quantobj, image, NULL); } median_cut_pass2_rgb (quantobj, image, bgColor); if (iQuant == NULL) quantize_object_free(quantobj); } void quantize_object_free(QuantizeObj * quantobj) { free (quantobj->histogram); free (quantobj); } autotrace-0.31.1/thin-image.c0000664000076400007640000003333307551363237011464 /* thin-image.c: thin binary image Copyright (C) 2001, 2002 Martin Weber This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include #include #include "thin-image.h" #include "logreport.h" #include "message.h" #include "types.h" #include "bitmap.h" #include "xstd.h" #include #define PIXEL_SET(p, new) ((void)memcpy((p), (new), sizeof(Pixel))) #define PIXEL_EQUAL(p1, p2) \ ((p1)[0] == (p2)[0] && (p1)[1] == (p2)[1] && (p1)[2] == (p2)[2]) typedef unsigned char Pixel[3]; /* RGB pixel data type */ void thin3(bitmap_type *image, Pixel colour); void thin1(bitmap_type *image, unsigned char colour); /* -------------------------------- ThinImage - Thin binary image. --------------------------- * * * Description: * Thins the supplied binary image using Rosenfeld's parallel * thinning algorithm. * * On Entry: * image = Image to thin. * * -------------------------------------------------------------------------------------------- */ /* Direction masks: */ /* N S W E */ static unsigned int masks[] = { 0200, 0002, 0040, 0010 }; /* True if pixel neighbor map indicates the pixel is 8-simple and */ /* not an end point and thus can be deleted. The neighborhood */ /* map is defined as an integer of bits abcdefghi with a non-zero */ /* bit representing a non-zero pixel. The bit assignment for the */ /* neighborhood is: */ /* */ /* a b c */ /* d e f */ /* g h i */ static unsigned char todelete[512] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; static color_type background = { 0xff, 0xff, 0xff }; void thin_image(bitmap_type *image, const color_type *bg, at_exception_type * exp) { /* This is nasty as we need to call thin once for each * colour in the image the way I do this is to keep a second * copy of the bitmap and to use this to keep * track of which colours have not yet been processed, * trades time for pathological case memory.....*/ long m, n, num_pixels; bitmap_type bm; unsigned int spp = BITMAP_PLANES(*image), width = BITMAP_WIDTH(*image), height = BITMAP_HEIGHT(*image); if (bg) background = *bg; bm.height = image->height; bm.width = image->width; bm.np = image->np; XMALLOC(bm.bitmap, height * width * spp); memcpy(bm.bitmap, image->bitmap, height * width * spp); /* that clones the image */ num_pixels = height * width; switch (spp) { case 3: { Pixel *ptr = (Pixel*)BITMAP_BITS(bm); Pixel bg_color; bg_color[0] = background.r; bg_color[1] = background.g; bg_color[2] = background.b; for (n = num_pixels - 1; n >= 0L; --n) { Pixel p; PIXEL_SET(p, ptr[n]); if (!PIXEL_EQUAL(p, bg_color)) { /* we have a new colour in the image */ LOG3("Thinning colour (%x, %x, %x)\n", p[0], p[1], p[2]); for (m = n - 1; m >= 0L; --m) { if (PIXEL_EQUAL(ptr[m], p)) PIXEL_SET(ptr[m], bg_color); } thin3(image, p); } } break; } case 1: { unsigned char *ptr = BITMAP_BITS(bm); unsigned char bg_color; if (background.r == background.g && background.g == background.b) bg_color = background.r; else bg_color = COLOR_LUMINANCE(background); for (n = num_pixels - 1; n >= 0L; --n) { unsigned char c = ptr[n]; if (c != bg_color) { LOG1 ("Thinning colour %x\n", c); for (m = n - 1; m >= 0L; --m) if (ptr[m] == c) ptr[m] = bg_color; thin1(image, c); } } break; } default: { LOG1 ("thin_image: %u-plane images are not supported", spp); at_exception_fatal(exp, "thin_image: wrong plane images are passed"); goto cleanup; } } cleanup: free (bm.bitmap); } void thin3(bitmap_type *image, Pixel colour) { Pixel *ptr, *y_ptr, *y1_ptr; Pixel bg_color; unsigned int xsize, ysize; /* Image resolution */ unsigned int x, y; /* Pixel location */ unsigned int i; /* Pass index */ unsigned int pc = 0; /* Pass count */ unsigned int count = 1; /* Deleted pixel count */ unsigned int p, q; /* Neighborhood maps of adjacent*/ /* cells */ unsigned char *qb; /* Neighborhood maps of previous*/ /* scanline */ unsigned int m; /* Deletion direction mask */ bg_color[0] = background.r; bg_color[1] = background.g; bg_color[2] = background.b; LOG (" Thinning image.....\n "); xsize = BITMAP_WIDTH(*image); ysize = BITMAP_HEIGHT(*image); XMALLOC (qb, xsize*sizeof(unsigned char)); qb[xsize-1] = 0; /* Used for lower-right pixel */ ptr = (Pixel*)BITMAP_BITS(*image); while ( count ) { /* Scan image while deletions */ pc++; count = 0; for ( i = 0 ; i < 4 ; i++ ) { m = masks[i]; /* Build initial previous scan buffer. */ p = PIXEL_EQUAL(ptr[0], colour); for ( x = 0 ; x < xsize-1 ; x++ ) qb[x] = (unsigned char) (p = ((p<<1)&0006) | (unsigned int) PIXEL_EQUAL(ptr[x+1], colour)); /* Scan image for pixel deletion candidates. */ y_ptr = ptr; y1_ptr = ptr + xsize; for (y = 0; y < ysize - 1; y++, y_ptr += xsize, y1_ptr += xsize) { q = qb[0]; p = ((q<<2)&0330) | (unsigned int) PIXEL_EQUAL(y1_ptr[0], colour); for ( x = 0 ; x < xsize-1 ; x++ ) { q = qb[x]; p = ((p<<1)&0666) | ((q<<3)&0110) | (unsigned int) PIXEL_EQUAL(y1_ptr[x+1], colour); qb[x] = (unsigned char) p; if ((i != 2 || x != 0) && ((p&m) == 0) && todelete[p] ) { count++; /* delete the pixel */ PIXEL_SET(y_ptr[x], bg_color); } } /* Process right edge pixel. */ p = (p<<1)&0666; if (i != 3 && (p&m) == 0 && todelete[p] ) { count++; PIXEL_SET(y_ptr[xsize-1], bg_color); } } if (i != 1) { /* Process bottom scan line. */ q = qb[0]; p = ((q<<2)&0330); y_ptr = ptr + xsize * (ysize - 1); for ( x = 0 ; x < xsize ; x++ ) { q = qb[x]; p = ((p<<1)&0666) | ((q<<3)&0110); if ((i != 2 || x != 0) && (p&m) == 0 && todelete[p]) { count++; PIXEL_SET(y_ptr[x], bg_color); } } } } LOG2 ("ThinImage: pass %d, %d pixels deleted\n", pc, count); } free (qb); } void thin1(bitmap_type *image, unsigned char colour) { unsigned char *ptr, *y_ptr, *y1_ptr; unsigned char bg_color; unsigned int xsize, ysize; /* Image resolution */ unsigned int x, y; /* Pixel location */ unsigned int i; /* Pass index */ unsigned int pc = 0; /* Pass count */ unsigned int count = 1; /* Deleted pixel count */ unsigned int p, q; /* Neighborhood maps of adjacent*/ /* cells */ unsigned char *qb; /* Neighborhood maps of previous*/ /* scanline */ unsigned int m; /* Deletion direction mask */ if (background.r == background.g && background.g == background.b) bg_color = background.r; else bg_color = COLOR_LUMINANCE(background); LOG (" Thinning image.....\n "); xsize = BITMAP_WIDTH(*image); ysize = BITMAP_HEIGHT(*image); XMALLOC (qb, xsize*sizeof(unsigned char)); qb[xsize-1] = 0; /* Used for lower-right pixel */ ptr = BITMAP_BITS(*image); while ( count ) { /* Scan image while deletions */ pc++; count = 0; for ( i = 0 ; i < 4 ; i++ ) { m = masks[i]; /* Build initial previous scan buffer. */ p = (ptr[0] == colour); for ( x = 0 ; x < xsize-1 ; x++ ) qb[x] = (unsigned char) (p = ((p<<1)&0006) | (unsigned int)(ptr[x+1] == colour)); /* Scan image for pixel deletion candidates. */ y_ptr = ptr; y1_ptr = ptr + xsize; for (y = 0; y < ysize - 1; y++, y_ptr += xsize, y1_ptr += xsize) { q = qb[0]; p = ((q<<2)&0330) | (y1_ptr[0] == colour); for ( x = 0 ; x < xsize-1 ; x++ ) { q = qb[x]; p = ((p<<1)&0666) | ((q<<3)&0110) | (unsigned int) (y1_ptr[x+1]==colour); qb[x] = (unsigned char) p; if ( ((p&m) == 0) && todelete[p] ) { count++; y_ptr[x] = bg_color; /* delete the pixel */ } } /* Process right edge pixel. */ p = (p<<1)&0666; if ( (p&m) == 0 && todelete[p] ) { count++; y_ptr[xsize-1] = bg_color; } } /* Process bottom scan line. */ q = qb[0]; p = ((q<<2)&0330); y_ptr = ptr + xsize * (ysize - 1); for ( x = 0 ; x < xsize ; x++ ) { q = qb[x]; p = ((p<<1)&0666) | ((q<<3)&0110); if ( (p&m) == 0 && todelete[p] ) { count++; y_ptr[x] = bg_color; } } } LOG2("thin1: pass %d, %d pixels deleted\n", pc, count); } free (qb); } autotrace-0.31.1/logreport.c0000664000076400007640000000107707551363231011451 /* logreport.c: showing information to the user. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "logreport.h" #include "message.h" #ifdef _EXPORTING /* Says whether to output detailed progress reports, i.e., all the data on the fitting, as we run. (-log) */ FILE __declspec(dllexport) *log_file = NULL; #else /* Says whether to output detailed progress reports, i.e., all the data on the fitting, as we run. (-log) */ FILE *log_file = NULL; #endif void flush_log_output (void) { if (log_file) fflush (log_file); } autotrace-0.31.1/filename.c0000664000076400007640000000656007562261172011221 /* filename.c: Function manipulate file names Was: find-suffix, extend-fname, make-suffix, remove-suffx substring, concat3 */ /* remove-suffx.c: remove any suffix. Copyright (C) 1999 Free Software Foundation, Inc. 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "filename.h" #include "xstd.h" #include /* Return a fresh copy of SOURCE[START..LIMIT], or NULL if LIMITstrlen(START), it is reassigned. */ static at_string substring (at_string source, const unsigned start, const unsigned limit); /* Return a fresh copy of S1 followed by S2, et al. */ static at_string concat3 (at_string, at_string, at_string); at_string find_suffix (at_string name) { at_string dot_pos = strrchr (name, '.'); #ifdef WIN32 at_string slash_pos = strrchr (name, '\\'); #else at_string slash_pos = strrchr (name, '/'); #endif /* If the name is `foo' or `/foo.bar/baz', we have no extension. */ return dot_pos == NULL || dot_pos < slash_pos ? NULL : dot_pos + 1; } at_string extend_filename (at_string name, at_string default_suffix) { at_string new_s; at_string suffix = find_suffix (name); new_s = suffix == NULL ? concat3 (name, ".", default_suffix) : name; return new_s; } at_string make_suffix (at_string s, at_string new_suffix) { at_string new_s; at_string old_suffix = find_suffix (s); if (old_suffix == NULL) new_s = concat3 (s, ".", new_suffix); else { size_t length_through_dot = old_suffix - s; XMALLOC (new_s, length_through_dot + strlen (new_suffix) + 1); strncpy (new_s, s, length_through_dot); strcpy (new_s + length_through_dot, new_suffix); } return new_s; } at_string remove_suffix (at_string s) { at_string suffix = find_suffix (s); return suffix == NULL ? s : suffix - 2 - s < 0 ? NULL : substring (s, 0, (unsigned)(suffix - 2 - s)); } /* From substring.c */ static at_string substring (at_string source, const unsigned start, const unsigned limit) { at_string result; unsigned this_char; size_t length = strlen (source); size_t lim = limit; /* Upper bound out of range? */ if (lim >= length) lim = length - 1; /* Null substring? */ if (start > lim) return ""; /* The `2' here is one for the null and one for limit - start inclusive. */ XMALLOC (result, lim - start + 2); for (this_char = start; this_char <= lim; this_char++) result[this_char - start] = source[this_char]; result[this_char - start] = 0; return result; } static at_string concat3 (at_string s1, at_string s2, at_string s3) { at_string answer; XMALLOC (answer, strlen (s1) + strlen (s2) + strlen (s3) + 1); strcpy (answer, s1); strcat (answer, s2); strcat (answer, s3); return answer; } autotrace-0.31.1/xstd.c0000664000076400007640000000124307551363241010412 /* xfopen.c: fopen and fclose with error checking. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "xstd.h" #include FILE * xfopen (at_string filename, at_string mode) { FILE *f; if (strcmp(filename, "-") == 0) f = stdin; else { f = fopen (filename, mode); if (f == NULL) FATAL_PERROR (filename); } return f; } void xfclose (FILE *f, at_string filename) { if (f != stdin) { if (fclose (f) == EOF) FATAL_PERROR (filename); } } void xfseek (FILE *f, long offset, int wherefrom, at_string filename) { if (fseek (f, offset, wherefrom) < 0) FATAL_PERROR (filename); } autotrace-0.31.1/epsilon-equal.h0000664000076400007640000000113507551363226012216 /* epsilon-equal.h: define an error resist compare. */ #ifndef EPSILON_EQUAL_H #define EPSILON_EQUAL_H #include "types.h" /* Says whether V1 and V2 are within REAL_EPSILON of each other. Fixed-point arithmetic would be better, to guarantee machine independence, but it's so much more painful to work with. The value here is smaller than can be represented in either a `fix_word' or a `scaled_num', so more precision than this will be lost when we output, anyway. */ extern at_bool epsilon_equal (at_real v1, at_real v2); #define REAL_EPSILON 0.00001 #endif /* not EPSILON_EQUAL_H */ autotrace-0.31.1/thin-image.h0000664000076400007640000000233107551363240011455 /* thin-image.h: thin binary image Copyright (C) 2001, 2002 Martin Weber This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef THIN_IMAGE_H #define THIN_IMAGE_H /* * C code from the article * "Efficient Binary Image Thinning using Neighborhood Maps" * by Joseph M. Cychosz, 3ksnn64@ecn.purdue.edu * in "Graphics Gems IV", Academic Press, 1994 */ #include "bitmap.h" #include "color.h" #include "exception.h" void thin_image (bitmap_type *image, const color_type *bg_color, at_exception_type * exp); #endif /* not THIN_IMAGE_H */ autotrace-0.31.1/quantize.h0000664000076400007640000000341407551363237011304 /* quantize.h: Quantize a high color bitmap Copyright (C) 2001, 2002 Martin Weber This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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 "bitmap.h" #include "color.h" #include "exception.h" #ifndef QUANTIZE_H #define QUANTIZE_H #define PRECISION_R 7 #define PRECISION_G 7 #define PRECISION_B 7 #define HIST_R_ELEMS (1< /* at_ prefix removed version */ typedef at_bitmap_type bitmap_type; #define BITMAP_PLANES(b) AT_BITMAP_PLANES(b) #define BITMAP_BITS(b) AT_BITMAP_BITS(b) #define BITMAP_WIDTH(b) AT_BITMAP_WIDTH(b) #define BITMAP_HEIGHT(b) AT_BITMAP_HEIGHT(b) #define BITMAP_PIXEL(b, row, col) AT_BITMAP_PIXEL(b, row, col) #define BITMAP_VALID_PIXEL(b, row, col) \ ((row) < BITMAP_HEIGHT (b) && (col) < BITMAP_WIDTH (b)) /* Allocate storage for the bits, set them all to white, and return an initialized structure. */ extern bitmap_type new_bitmap (unsigned short width, unsigned short height); /* Free that storage. */ extern void free_bitmap (bitmap_type *); #endif /* not BITMAP_H */ autotrace-0.31.1/spline.h0000664000076400007640000000640407562011637010734 /* spline.h: manipulate the spline representation. Some of macrs are only renamed macros in output.h. */ #ifndef SPLINE_H #define SPLINE_H #include #include "autotrace.h" #include "output.h" typedef at_polynomial_degree polynomial_degree; typedef at_spline_type spline_type; #define LINEARTYPE AT_LINEARTYPE #define QUADRATICTYPE AT_QUADRATICTYPE #define CUBICTYPE AT_CUBICTYPE #define PARALLELELLIPSETYPE AT_PARALLELELLIPSETYPE #define ELLIPSETYPE AT_ELLIPSETYPE #define CIRCLETYPE AT_CIRCLETYPE #define START_POINT AT_SPLINE_START_POINT_VALUE #define CONTROL1 AT_SPLINE_CONTROL1_VALUE #define CONTROL2 AT_SPLINE_CONTROL2_VALUE #define END_POINT AT_SPLINE_END_POINT_VALUE #define SPLINE_DEGREE AT_SPLINE_DEGREE_VALUE #define SPLINE_LINEARITY(spl) ((spl).linearity) #ifndef _IMPORTING /* Print a spline on the given file. */ extern void print_spline (FILE *, spline_type); /* Evaluate SPLINE at the given T value. */ extern at_real_coord evaluate_spline (spline_type spline, at_real t); #endif /* Each outline in a character is typically represented by many splines. So, here is a list structure for that: */ typedef at_spline_list_type spline_list_type; /* An empty list will have length zero (and null data). */ #define SPLINE_LIST_LENGTH AT_SPLINE_LIST_LENGTH_VALUE /* The address of the beginning of the array of data. */ #define SPLINE_LIST_DATA AT_SPLINE_LIST_DATA_VALUE /* The element INDEX in S_L. */ #define SPLINE_LIST_ELT AT_SPLINE_LIST_ELT_VALUE /* The last element in S_L. */ #define LAST_SPLINE_LIST_ELT(s_l) \ (SPLINE_LIST_DATA (s_l)[SPLINE_LIST_LENGTH (s_l) - 1]) /* The previous and next elements to INDEX in S_L. */ #define NEXT_SPLINE_LIST_ELT(s_l, index) \ SPLINE_LIST_ELT (s_l, ((index) + 1) % SPLINE_LIST_LENGTH (s_l)) #define PREV_SPLINE_LIST_ELT(s_l, index) \ SPLINE_LIST_ELT (s_l, index == 0 \ ? SPLINE_LIST_LENGTH (s_l) - 1 \ : index - 1) #ifndef _IMPORTING /* Construct and destroy new `spline_list_type' objects. */ extern spline_list_type *new_spline_list (void); /* Allocate new memory */ extern spline_list_type empty_spline_list (void); /* No allocation */ extern spline_list_type *new_spline_list_with_spline (spline_type); extern void free_spline_list (spline_list_type); /* Append the spline S to the list S_LIST. */ extern void append_spline (spline_list_type *s_list, spline_type s); /* Append the elements in list S2 to S1, changing S1. */ extern void concat_spline_lists (spline_list_type *s1, spline_list_type s2); #endif typedef at_spline_list_array_type spline_list_array_type; /* Turns out we can use the same definitions for lists of lists as for just lists. But we define the usual names, just in case. */ #define SPLINE_LIST_ARRAY_LENGTH AT_SPLINE_LIST_ARRAY_LENGTH_VALUE #define SPLINE_LIST_ARRAY_DATA SPLINE_LIST_DATA #define SPLINE_LIST_ARRAY_ELT AT_SPLINE_LIST_ARRAY_ELT_VALUE #define LAST_SPLINE_LIST_ARRAY_ELT LAST_SPLINE_LIST_ELT extern spline_list_array_type new_spline_list_array (void); extern void append_spline_list (spline_list_array_type *, spline_list_type); extern void free_spline_list_array (spline_list_array_type *); #endif /* not SPLINE_H */ autotrace-0.31.1/curve.h0000664000076400007640000001075207551363227010572 /* curve.h: data structures for the conversion from pixels to splines. */ #ifndef CURVE_H #define CURVE_H #include "autotrace.h" #include "vector.h" /* We are simultaneously manipulating two different representations of the same outline: one based on (x,y) positions in the plane, and one based on parametric splines. (We are trying to match the latter to the former.) Although the original (x,y)'s are pixel positions, i.e., integers, after filtering they are reals. */ typedef struct { at_real_coord coord; at_real t; } point_type; /* It turns out to be convenient to break the list of all the pixels in the outline into sublists, divided at ``corners''. Then each of the sublists is treated independently. Each of these sublists is a `curve'. */ struct curve { point_type *point_list; unsigned length; at_bool cyclic; vector_type *start_tangent; vector_type *end_tangent; struct curve *previous; struct curve *next; }; typedef struct curve *curve_type; /* Get at the coordinates and the t values. */ #define CURVE_POINT(c, n) ((c)->point_list[n].coord) #define LAST_CURVE_POINT(c) ((c)->point_list[(c)->length-1].coord) #define CURVE_T(c, n) ((c)->point_list[n].t) #define LAST_CURVE_T(c) ((c)->point_list[(c)->length-1].t) /* This is the length of `point_list'. */ #define CURVE_LENGTH(c) ((c)->length) /* A curve is ``cyclic'' if it didn't have any corners, after all, so the last point is adjacent to the first. */ #define CURVE_CYCLIC(c) ((c)->cyclic) /* If the curve is cyclic, the next and previous points should wrap around; otherwise, if we get to the end, we return CURVE_LENGTH and -1, respectively. */ #define CURVE_NEXT(c, n) \ ((n) + 1 >= CURVE_LENGTH (c) \ ? CURVE_CYCLIC (c) ? ((n) + 1) % CURVE_LENGTH (c) : CURVE_LENGTH (c) \ : (n) + 1) #define CURVE_PREV(c, n) \ ((signed int) (n) - 1 < 0 \ ? CURVE_CYCLIC (c) ? (signed int) CURVE_LENGTH (c) + (signed int) (n) - 1 : -1\ : (signed int) (n) - 1) /* The tangents at the endpoints are computed using the neighboring curves. */ #define CURVE_START_TANGENT(c) ((c)->start_tangent) #define CURVE_END_TANGENT(c) ((c)->end_tangent) #define PREVIOUS_CURVE(c) ((c)->previous) #define NEXT_CURVE(c) ((c)->next) /* Return an entirely empty curve. */ extern curve_type new_curve (void); /* Return a curve the same as C, except without any points. */ extern curve_type copy_most_of_curve (curve_type c); /* Free the memory C uses. */ extern void free_curve (curve_type c); /* Append the point P to the end of C's list. */ extern void append_pixel (curve_type c, at_coord p); /* Like `append_pixel', for a point in real coordinates. */ extern void append_point (curve_type c, at_real_coord p); /* Write some or all, respectively, of the curve C in human-readable form to the log file, if logging is enabled. */ extern void log_curve (curve_type c, at_bool print_t); extern void log_entire_curve (curve_type c); /* Display the curve C online, if displaying is enabled. */ extern void display_curve (curve_type); /* So, an outline is a list of curves. */ typedef struct { curve_type *data; unsigned length; at_bool clockwise; at_bool open; } curve_list_type; /* Number of curves in the list. */ #define CURVE_LIST_LENGTH(c_l) ((c_l).length) /* Access the individual curves. */ #define CURVE_LIST_ELT(c_l, n) ((c_l).data[n]) #define LAST_CURVE_LIST_ELT(c_l) ((c_l).data[CURVE_LIST_LENGTH (c_l) - 1]) /* Says whether the outline that this curve list represents moves clockwise or counterclockwise. */ #define CURVE_LIST_CLOCKWISE(c_l) ((c_l).clockwise) extern curve_list_type new_curve_list (void); extern void free_curve_list (curve_list_type *); extern void append_curve (curve_list_type *, curve_type); /* And a character is a list of outlines. I named this `curve_list_array_type' because `curve_list_list_type' seemed pretty monstrous. */ typedef struct { curve_list_type *data; unsigned length; } curve_list_array_type; /* Turns out we can use the same definitions for lists of lists as for just lists. But we define the usual names, just in case. */ #define CURVE_LIST_ARRAY_LENGTH CURVE_LIST_LENGTH #define CURVE_LIST_ARRAY_ELT CURVE_LIST_ELT #define LAST_CURVE_LIST_ARRAY_ELT LAST_CURVE_LIST_ELT extern curve_list_array_type new_curve_list_array (void); extern void free_curve_list_array (curve_list_array_type *, at_progress_func, at_address); extern void append_curve_list (curve_list_array_type *, curve_list_type); #endif /* not CURVE_H */ autotrace-0.31.1/vector.h0000664000076400007640000000510707551363234010744 /* vector.h: operations on vectors and points. */ #ifndef VECTOR_H #define VECTOR_H #include "types.h" #include "exception.h" /* Our vectors are represented as displacements along the x and y axes. */ typedef struct { at_real dx, dy, dz; } vector_type; /* Consider a point as a vector from the origin. */ extern vector_type make_vector (const at_real_coord); /* And a vector as a point, i.e., a displacement from the origin. */ extern at_real_coord vector_to_point (const vector_type); /* Definitions for these common operations can be found in any decent linear algebra book, and most calculus books. */ extern at_real magnitude (const vector_type); extern vector_type normalize (const vector_type); extern vector_type Vadd (const vector_type, const vector_type); extern at_real Vdot (const vector_type, const vector_type); extern vector_type Vmult_scalar (const vector_type, const at_real); extern at_real Vangle (const vector_type in, const vector_type out, at_exception_type * exp); /* These operations could have been named `P..._vector' just as well as V..._point, so we may as well allow both names. */ #define Padd_vector Vadd_point extern at_real_coord Vadd_point (const at_real_coord, const vector_type); #define Psubtract_vector Vsubtract_point extern at_real_coord Vsubtract_point (const at_real_coord, const vector_type); /* This returns the rounded sum. */ #define IPadd_vector Vadd_int_point extern at_coord Vadd_int_point (const at_coord, const vector_type); /* Take the absolute value of both components. */ extern vector_type Vabs (const vector_type); /* Operations on points with real coordinates. It is not orthogonal, but more convenient, to have the subtraction operator return a vector, and the addition operator return a point. */ extern vector_type Psubtract (const at_real_coord, const at_real_coord); /* These are heavily used in spline fitting. */ extern at_real_coord Padd (const at_real_coord, const at_real_coord); extern at_real_coord Pmult_scalar (const at_real_coord, const at_real); /* Similarly, for points with integer coordinates; here, a subtraction operator that does return another point is useful. */ extern vector_type IPsubtract (const at_coord, const at_coord); extern at_coord IPsubtractP (const at_coord, const at_coord); extern at_coord IPadd (const at_coord, const at_coord); extern at_coord IPmult_scalar (const at_coord, const int); extern at_real_coord IPmult_real (const at_coord, const at_real); extern at_bool IPequal (const at_coord, const at_coord); #endif /* not VECTOR_H */ autotrace-0.31.1/color.h0000664000076400007640000000073007551363217010556 /* color.h: declarations for color handling. */ #ifndef COLOR_H #define COLOR_H #include "autotrace.h" #include "bitmap.h" typedef at_color_type color_type; /* RGB to grayscale */ #define COLOR_LUMINANCE(c) ((unsigned char)(((c).r) * 0.30 + ((c).g) * 0.59 + ((c).b) * 0.11 + 0.5)) #define COLOR_EQUAL(c1,c2) (((c1).r == (c2).r) && ((c1).g == (c2).g) && ((c1).b == (c2).b)) color_type GET_COLOR (at_bitmap_type, unsigned int, unsigned int); #endif /* not COLOR_H */ autotrace-0.31.1/pxl-outline.h0000664000076400007640000000405107555247320011720 /* pxl-outline.h: find a list of outlines which make up one character. */ #ifndef PXL_OUTLINE_H #define PXL_OUTLINE_H #include "autotrace.h" #include "exception.h" #include "bitmap.h" #include "color.h" /* This is a list of contiguous points on the bitmap. */ typedef struct { at_coord *data; unsigned length; at_bool clockwise; color_type color; at_bool open; } pixel_outline_type; /* The Nth coordinate in the list. */ #define O_COORDINATE(p_o, n) ((p_o).data[n]) /* The length of the list. */ #define O_LENGTH(p_o) ((p_o).length) /* Whether the outline moves clockwise or counterclockwise. */ #define O_CLOCKWISE(p_o) ((p_o).clockwise) /* Since a pixel outline is cyclic, the index of the next coordinate after the last is the first, and the previous coordinate before the first is the last. */ #define O_NEXT(p_o, n) (((n) + 1) % O_LENGTH (p_o)) #define O_PREV(p_o, n) ((n) == 0 \ ? O_LENGTH (p_o) - 1 \ : (n) - 1) /* And the character turns into a list of such lists. */ typedef struct { pixel_outline_type *data; unsigned length; } pixel_outline_list_type; /* The Nth list in the list of lists. */ #define O_LIST_OUTLINE(p_o_l, n) ((p_o_l).data[n]) /* The length of the list of lists. */ #define O_LIST_LENGTH(p_o_l) ((p_o_l).length) /* Find all pixels on the outline in the character C. */ extern pixel_outline_list_type find_outline_pixels (bitmap_type, color_type *bg_color, at_progress_func notify_progress, at_address progress_data, at_testcancel_func test_cancel, at_address testcancel_data, at_exception_type * exp); /* Find all pixels on the center line of the character C. */ extern pixel_outline_list_type find_centerline_pixels (bitmap_type, color_type bg_color, at_progress_func notify_progress, at_address progress_data, at_testcancel_func test_cancel, at_address testcancel_data, at_exception_type * exp); /* Free the memory in the list. */ extern void free_pixel_outline_list (pixel_outline_list_type *); #endif /* not PXL_OUTLINE_H */ autotrace-0.31.1/despeckle.c0000664000076400007640000005140507551363262011377 /* despeckle.c: Bitmap despeckler Copyright (C) 2001 David A. Bartold This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include #include #include #include #include "xstd.h" #include "types.h" #include "bitmap.h" #include "despeckle.h" /* Calculate Error - compute the error between two colors * * Input parameters: * Two 24 bit RGB colors * * Returns: * The squared error between the two colors */ static int calc_error (unsigned char *color1, unsigned char *color2) { int the_error; int temp; temp = color1[0] - color2[0]; the_error = temp * temp; temp = color1[1] - color2[1]; the_error += temp * temp; temp = color1[2] - color2[2]; the_error += temp * temp; return the_error; } /* Calculate Error - compute the error between two colors * * Input parameters: * Two 8 bit gray scale colors * * Returns: * The squared error between the two colors */ static int calc_error_8 (unsigned char *color1, unsigned char *color2) { int the_error; int temp; temp = color1[0] - color2[0]; the_error = temp * temp; return the_error; } /* Find Size - Find the number of adjacent pixels of the same color * * Input Parameters: * An 24 bit image, the current location inside the image, and the palette * index of the color we are looking for * * Modified Parameters: * A mask array used to prevent backtracking over already counted pixels * * Returns: * Number of adjacent pixels found having the same color */ static int find_size (/* in */ unsigned char *index, /* in */ int x, /* in */ int y, /* in */ int width, /* in */ int height, /* in */ unsigned char *bitmap, /* in/out */ unsigned char *mask) { int count; int x1, x2; if (y < 0 || y >= height || mask[y * width + x] == 1 || bitmap[3 * (y * width + x) ] != index[0] || bitmap[3 * (y * width + x) + 1] != index[1] || bitmap[3 * (y * width + x) + 2] != index[2]) return 0; for (x1 = x; x1 >= 0 && bitmap[3 * (y * width + x1) ] == index[0] && bitmap[3 * (y * width + x1) + 1] == index[1] && bitmap[3 * (y * width + x1) + 2] == index[2] && mask[y * width + x] != 1; x1--) ; x1++; for (x2 = x; x2 < width && bitmap[3 * (y * width + x2) ] == index[0] && bitmap[3 * (y * width + x2) + 1] == index[1] && bitmap[3 * (y * width + x2) + 2] == index[2] && mask[y * width + x] != 1; x2++) ; x2--; count = x2 - x1 + 1; for (x = x1; x <= x2; x++) mask[y * width + x] = 1; for (x = x1; x <= x2; x++) { count += find_size (index, x, y - 1, width, height, bitmap, mask); count += find_size (index, x, y + 1, width, height, bitmap, mask); } return count; } /* Find Size - Find the number of adjacent pixels of the same color * * Input Parameters: * An 8 bit image, the current location inside the image, and the palette * index of the color we are looking for * * Modified Parameters: * A mask array used to prevent backtracking over already counted pixels * * Returns: * Number of adjacent pixels found having the same color */ static int find_size_8 (/* in */ unsigned char *index, /* in */ int x, /* in */ int y, /* in */ int width, /* in */ int height, /* in */ unsigned char *bitmap, /* in/out */ unsigned char *mask) { int count; int x1, x2; if (y < 0 || y >= height || mask[y * width + x] == 1 || bitmap[(y * width + x) ] != index[0]) return 0; for (x1 = x; x1 >= 0 && bitmap[(y * width + x1) ] == index[0] && mask[y * width + x] != 1; x1--) ; x1++; for (x2 = x; x2 < width && bitmap[(y * width + x2) ] == index[0] && mask[y * width + x] != 1; x2++) ; x2--; count = x2 - x1 + 1; for (x = x1; x <= x2; x++) mask[y * width + x] = 1; for (x = x1; x <= x2; x++) { count += find_size_8 (index, x, y - 1, width, height, bitmap, mask); count += find_size_8 (index, x, y + 1, width, height, bitmap, mask); } return count; } /* Find Most Similar Neighbor - Given a position in an 8bit bitmap and a color * index, traverse over a blob of adjacent pixels having the same value. * Return the color index of the neighbor pixel that has the most similar * color. * * Input parameters: * 24 bit bitmap, the current location inside the image, * and the color index of the blob * * Modified parameters: * Mask used to prevent backtracking * * Output parameters: * Closest index != index and the error between the two colors squared */ static void find_most_similar_neighbor (/* in */ unsigned char *index, /* in/out */ unsigned char **closest_index, /* in/out */ int *error_amt, /* in */ int x, /* in */ int y, /* in */ int width, /* in */ int height, /* in */ unsigned char *bitmap, /* in/out */ unsigned char *mask) { int x1, x2; int temp_error; unsigned char *value, *temp; if (y < 0 || y >= height || mask[y * width + x] == 2) return; temp = &bitmap[3 * (y * width + x)]; assert (closest_index != NULL); if (temp[0] != index[0] || temp[1] != index[1] || temp[2] != index[2]) { value = temp; temp_error = calc_error (index, value); if (*closest_index == NULL || temp_error < *error_amt) *closest_index = value, *error_amt = temp_error; return; } for (x1 = x; x1 >= 0 && bitmap[ 3 * (y * width + x1) ] == index[0] && bitmap[ 3 * (y * width + x1) + 1] == index[1] && bitmap[ 3 * (y * width + x1) + 2] == index[2]; x1--) ; x1++; for (x2 = x; x2 < width && bitmap[ 3 * (y * width + x2) ] == index[0] && bitmap[ 3 * (y * width + x2) + 1] == index[1] && bitmap[ 3 * (y * width + x2) + 2] == index[2]; x2++) ; x2--; if (x1 > 0) { value = &bitmap[ 3 * (y * width + x1 - 1) ]; temp_error = calc_error (index, value); if (*closest_index == NULL || temp_error < *error_amt) *closest_index = value, *error_amt = temp_error; } if (x2 < width - 1) { value = &bitmap[ 3 * (y * width + x2 + 1) ]; temp_error = calc_error (index, value); if (*closest_index == NULL || temp_error < *error_amt) *closest_index = value, *error_amt = temp_error; } for (x = x1; x <= x2; x++) mask[y * width + x] = 2; for (x = x1; x <= x2; x++) { find_most_similar_neighbor (index, closest_index, error_amt, x, y - 1, width, height, bitmap, mask); find_most_similar_neighbor (index, closest_index, error_amt, x, y + 1, width, height, bitmap, mask); } } /* Find Most Similar Neighbor - Given a position in an 8bit bitmap and a color * index, traverse over a blob of adjacent pixels having the same value. * Return the color index of the neighbor pixel that has the most similar * color. * * Input parameters: * 8 bit bitmap, the current location inside the image, * and the color index of the blob * * Modified parameters: * Mask used to prevent backtracking * * Output parameters: * Closest index != index and the error between the two colors squared */ static void find_most_similar_neighbor_8 (/* in */ unsigned char *index, /* in/out */ unsigned char **closest_index, /* in/out */ int *error_amt, /* in */ int x, /* in */ int y, /* in */ int width, /* in */ int height, /* in */ unsigned char *bitmap, /* in/out */ unsigned char *mask) { int x1, x2; int temp_error; unsigned char *value, *temp; if (y < 0 || y >= height || mask[y * width + x] == 2) return; temp = &bitmap[(y * width + x)]; assert (closest_index != NULL); if (temp[0] != index[0]) { value = temp; temp_error = calc_error_8 (index, value); if (*closest_index == NULL || temp_error < *error_amt) *closest_index = value, *error_amt = temp_error; return; } for (x1 = x; x1 >= 0 && bitmap[(y * width + x1) ] == index[0]; x1--) ; x1++; for (x2 = x; x2 < width && bitmap[(y * width + x2) ] == index[0]; x2++) ; x2--; if (x1 > 0) { value = &bitmap[(y * width + x1 - 1) ]; temp_error = calc_error_8 (index, value); if (*closest_index == NULL || temp_error < *error_amt) *closest_index = value, *error_amt = temp_error; } if (x2 < width - 1) { value = &bitmap[(y * width + x2 + 1) ]; temp_error = calc_error_8 (index, value); if (*closest_index == NULL || temp_error < *error_amt) *closest_index = value, *error_amt = temp_error; } for (x = x1; x <= x2; x++) mask[y * width + x] = 2; for (x = x1; x <= x2; x++) { find_most_similar_neighbor_8 (index, closest_index, error_amt, x, y - 1, width, height, bitmap, mask); find_most_similar_neighbor_8 (index, closest_index, error_amt, x, y + 1, width, height, bitmap, mask); } } /* Fill - change the color of a blob * * Input parameters: * The new color * * Modified parameters: * 24 bit pixbuf and its mask (used to prevent backtracking) */ static void fill (/* in */ unsigned char *to_index, /* in */ int x, /* in */ int y, /* in */ int width, /* in */ int height, /* in/out */ unsigned char *bitmap, /* in/out */ unsigned char *mask) { int x1, x2; if (y < 0 || y >= height || mask[y * width + x] != 2) return; for (x1 = x; x1 >= 0 && mask[y * width + x1] == 2; x1--) ; x1++; for (x2 = x; x2 < width && mask[y * width + x2] == 2; x2++) ; x2--; assert (x1 >= 0 && x2 < width); for (x = x1; x <= x2; x++) { bitmap[3 * (y * width + x) ] = to_index[0]; bitmap[3 * (y * width + x) + 1] = to_index[1]; bitmap[3 * (y * width + x) + 2] = to_index[2]; mask[y * width + x] = 3; } for (x = x1; x <= x2; x++) { fill (to_index, x, y - 1, width, height, bitmap, mask); fill (to_index, x, y + 1, width, height, bitmap, mask); } } /* Fill - change the color of a blob * * Input parameters: * The new color * * Modified parameters: * 8 bit pixbuf and its mask (used to prevent backtracking) */ static void fill_8 (/* in */ unsigned char *to_index, /* in */ int x, /* in */ int y, /* in */ int width, /* in */ int height, /* in/out */ unsigned char *bitmap, /* in/out */ unsigned char *mask) { int x1, x2; if (y < 0 || y >= height || mask[y * width + x] != 2) return; for (x1 = x; x1 >= 0 && mask[y * width + x1] == 2; x1--) ; x1++; for (x2 = x; x2 < width && mask[y * width + x2] == 2; x2++) ; x2--; assert (x1 >= 0 && x2 < width); for (x = x1; x <= x2; x++) { bitmap[(y * width + x) ] = to_index[0]; mask[y * width + x] = 3; } for (x = x1; x <= x2; x++) { fill_8 (to_index, x, y - 1, width, height, bitmap, mask); fill_8 (to_index, x, y + 1, width, height, bitmap, mask); } } /* Ignore - blob is big enough, mask it off * * Modified parameters: * its mask (used to prevent backtracking) */ static void ignore (/* in */ int x, /* in */ int y, /* in */ int width, /* in */ int height, /* in/out */ unsigned char *mask) { int x1, x2; if (y < 0 || y >= height || mask[y * width + x] != 1) return; for (x1 = x; x1 >= 0 && mask[y * width + x1] == 1; x1--) ; x1++; for (x2 = x; x2 < width && mask[y * width + x2] == 1; x2++) ; x2--; assert (x1 >= 0 && x2 < width); for (x = x1; x <= x2; x++) mask[y * width + x] = 3; for (x = x1; x <= x2; x++) { ignore (x, y - 1, width, height, mask); ignore (x, y + 1, width, height, mask); } } /* Recolor - conditionally change a feature's color to the closest color of all * neighboring pixels * * Input parameters: * The color palette, current blob size, and adaptive tightness * * Adaptive Tightness: (integer 1 to 256) * 1 = really tight * 256 = turn off the feature * * Modified parameters: * 24 bit pixbuf and its mask (used to prevent backtracking) * * Returns: * TRUE - feature was recolored, thus coalesced * FALSE - feature wasn't recolored */ static at_bool recolor (/* in */ double adaptive_tightness, /* in */ int x, /* in */ int y, /* in */ int width, /* in */ int height, /* in/out */ unsigned char *bitmap, /* in/out */ unsigned char *mask) { unsigned char *index, *to_index; int error_amt; index = &bitmap[3 * (y * width + x) ]; to_index = NULL; error_amt = 0; find_most_similar_neighbor (index, &to_index, &error_amt, x, y, width, height, bitmap, mask); /* This condition only fails if the bitmap is all the same color */ if (to_index != NULL) { double temp_error; /* Adaptive */ temp_error = calc_error (index, to_index); temp_error = sqrt (temp_error / 3.0); /* * If the difference between the two colors is too great, * don't coalesce the feature with its neighbor(s). This prevents a * color from turning into its complement. */ if (temp_error > adaptive_tightness) fill (index, x, y, width, height, bitmap, mask); else { fill (to_index, x, y, width, height, bitmap, mask); return true; } } return false; } /* Recolor - conditionally change a feature's color to the closest color of all * neighboring pixels * * Input parameters: * The color palette, current blob size, and adaptive tightness * * Adaptive Tightness: (integer 1 to 256) * 1 = really tight * 256 = turn off the feature * * Modified parameters: * 8 bit pixbuf and its mask (used to prevent backtracking) * * Returns: * TRUE - feature was recolored, thus coalesced * FALSE - feature wasn't recolored */ static at_bool recolor_8 (/* in */ double adaptive_tightness, /* in */ int x, /* in */ int y, /* in */ int width, /* in */ int height, /* in/out */ unsigned char *bitmap, /* in/out */ unsigned char *mask) { unsigned char *index, *to_index; int error_amt; index = &bitmap[(y * width + x) ]; to_index = NULL; error_amt = 0; find_most_similar_neighbor_8 (index, &to_index, &error_amt, x, y, width, height, bitmap, mask); /* This condition only fails if the bitmap is all the same color */ if (to_index != NULL) { double temp_error; /* Adaptive */ temp_error = calc_error_8 (index, to_index); temp_error = sqrt (temp_error / 3.0); /* * If the difference between the two colors is too great, * don't coalesce the feature with its neighbor(s). This prevents a * color from turning into its complement. */ if (temp_error > adaptive_tightness) fill_8 (index, x, y, width, height, bitmap, mask); else { fill_8 (to_index, x, y, width, height, bitmap, mask); return true; } } return false; } /* Despeckle Iteration - Despeckle all regions smaller than cur_size pixels * * Input Parameters: * Current blob size, maximum blob size * for all iterations (used to selectively recolor blobs), and adaptive * tightness * * Modified Parameters: * The 24 bit pixbuf is despeckled */ static void despeckle_iteration (/* in */ int level, /* in */ double adaptive_tightness, /* in */ int width, /* in */ int height, /* in/out */ unsigned char *bitmap) { unsigned char *mask; int x, y; int i; int current_size; int tightness; for (i = 0, current_size = 1; i < level; i++, current_size *= 2) tightness = (int) (256 / (1.0 + adaptive_tightness * level)); mask = (unsigned char *) calloc (width * height, sizeof(unsigned char)); for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { if (mask[y * width + x] == 0) { int size; size = find_size (&bitmap[3 * (y * width + x)], x, y, width, height, bitmap, mask); assert (size > 0); if (size < current_size) { if (recolor (tightness, x, y, width, height, bitmap, mask)) x--; } else ignore (x, y, width, height, mask); } } } free (mask); } /* Despeckle Iteration - Despeckle all regions smaller than cur_size pixels * * Input Parameters: * Current blob size, maximum blob size * for all iterations (used to selectively recolor blobs), and adaptive * tightness * * Modified Parameters: * The 8 bit pixbuf is despeckled */ static void despeckle_iteration_8 (/* in */ int level, /* in */ double adaptive_tightness, /* in */ int width, /* in */ int height, /* in/out */ unsigned char *bitmap) { unsigned char *mask; int x, y; int i; int current_size; int tightness; for (i = 0, current_size = 1; i < level; i++, current_size *= 2) tightness = (int) (256 / (1.0 + adaptive_tightness * level)); mask = (unsigned char *) calloc (width * height, sizeof(unsigned char)); for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { if (mask[y * width + x] == 0) { int size; size = find_size_8 (&bitmap[(y * width + x)], x, y, width, height, bitmap, mask); assert (size > 0); if (size < current_size) { if (recolor_8 (tightness, x, y, width, height, bitmap, mask)) x--; } else ignore (x, y, width, height, mask); } } } free (mask); } /* Despeckle - Despeckle an 8/24 bit image * * Input Parameters: * Color palette, current blob size, and the despeckling level * * Despeckling level: Integer from 0 to ~20 * 0 = perform no despeckling * An increase of the despeckling level by one doubles the size of features * * Adaptive tightness: * 0 = Turn it off (whites may turn black and vice versa, etc) * 3 = Good middle value * 8 = Really tight * * Modified Parameters: * The 24 bit pixbuf is despeckled */ void despeckle (/* in/out */ bitmap_type *bitmap, /* in */ int level, /* in */ at_real tightness, at_exception_type * excep) { int i; int planes; planes = BITMAP_PLANES (*bitmap); assert (tightness >= 0.0 && tightness <= 8.0); assert (level >= 0 && level <= 20); if (planes == 3) { for (i = 0; i < level; i++) despeckle_iteration (i, tightness, BITMAP_WIDTH (*bitmap), BITMAP_HEIGHT (*bitmap), BITMAP_BITS(*bitmap)); } else if (planes == 1) { for (i = 0; i < level; i++) despeckle_iteration_8 (i, tightness, BITMAP_WIDTH (*bitmap), BITMAP_HEIGHT (*bitmap), BITMAP_BITS(*bitmap)); } else { LOG1 ("despeckle: %u-plane images are not supported", planes); at_exception_fatal(excep, "despeckle: wrong plane images are passed"); return; } } autotrace-0.31.1/despeckle.h0000664000076400007640000000304007551363267011401 /* despeckle.h: Bitmap despeckler for AutoTrace Copyright (C) 2001 David A. Bartold This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef DESPECKLE_H #define DESPECKLE_H #include "types.h" #include "bitmap.h" #include "exception.h" /* Despeckle - Despeckle a 8 or 24 bit image * * Input Parameters: * Adaptive feature coalescing value and the despeckling level * * Despeckling level: Integer from 0 to ~20 * 0 = perform no despeckling * An increase of the despeckling level by one doubles the size of features * * Feature coalescing: * 0 = Turn it off (whites may turn black and vice versa, etc) * 3 = Good middle value * 8 = Really tight * * Modified Parameters: * The bitmap is despeckled */ extern void despeckle (bitmap_type *bitmap, int level, at_real tightness, at_exception_type * exp); #endif /* not DESPECKLE_H */ autotrace-0.31.1/exception.c0000664000076400007640000000171007551363362011431 #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "exception.h" at_exception_type at_exception_new(at_msg_func client_func, at_address client_data) { at_exception_type e = {0, client_func, client_data}; return e; } at_bool at_exception_got_fatal(at_exception_type * exception) { return (exception->msg_type == AT_MSG_FATAL); } void at_exception_fatal(at_exception_type * exception, const at_string message) { if (!exception) return; exception->msg_type = AT_MSG_FATAL; if (exception->client_func) { exception->client_func(message, AT_MSG_FATAL, exception->client_data); } } void at_exception_warning(at_exception_type * exception, const at_string message) { if (!exception) return; exception->msg_type = AT_MSG_WARNING; if (exception->client_func) { exception->client_func(message, AT_MSG_WARNING, exception->client_data); } } autotrace-0.31.1/strgicmp.c0000664000076400007640000000261707562261172011270 #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "strgicmp.h" #include at_bool strgicmp (const char *s1, const char *s2) { if (s1 == NULL || s2 == NULL) return (false); while (*s1 != '\0' && *s2 != '\0') { if (tolower (*s1) != tolower (*s2)) break; s1++; s2++; } if (*s1 == '\0' && *s2 == '\0') return (true); else return (false); } at_bool strgnicmp (const char *s1, const char *s2, size_t len) { long i = 0; if (s1 == NULL || s2 == NULL) return (false); while (*s1 != '\0' && *s2 != '\0') { if (tolower (*s1) != tolower (*s2) || i == len) break; s1++; s2++; i++; } if ((*s1 == '\0' && *s2 == '\0') || len == i) return (true); else return (false); } #if 0 #include void result (at_bool val) { if (val) printf("successful\n"); else printf("failed\n"); } int main() { result(strgicmp("abc", "abc")); result(!strgicmp("abc", "abcd")); result(strgicmp("abc", "ABC")); result(strgicmp("abc", "abC")); result(!strgicmp("abc", "abCd")); result(strgnicmp("abc", "abc", 3)); result(strgnicmp("abc", "abcd", 3)); result(!strgnicmp("abc", "abcd", 4)); result(strgnicmp("abc", "ABC", 3)); result(strgnicmp("abc", "ABZ", 2)); result(strgnicmp("abc", "abC", 3)); result(strgnicmp("abc", "abCdddd", 3)); return 0; } #endif /* 0 */ autotrace-0.31.1/image-proc.c0000664000076400007640000003410507551363416011462 /* image-proc.c: image processing routines */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include #include #include "xstd.h" #include "image-proc.h" #define BLACK 0 #define WHITE 0xff #ifndef M_SQRT2 #define M_SQRT2 1.41421356237 #endif #if 0 struct etyp { int t00, t11, t01, t01s; }; static at_bool get_edge(bitmap_type, int y, int x, struct etyp *t); static void check(int v1, int v2, int v3, struct etyp *t); #endif /* Allocate storage for a new distance map with the same dimensions as BITMAP and initialize it so that pixels in BITMAP with value TARGET_VALUE are at distance zero and all other pixels are at distance infinity. Then compute the gray-weighted distance from every non-target point to the nearest target point. */ distance_map_type new_distance_map(bitmap_type bitmap, unsigned char target_value, at_bool padded, at_exception_type * exp) { signed x, y; float d, min; distance_map_type dist; unsigned char *b = BITMAP_BITS(bitmap); unsigned w = BITMAP_WIDTH(bitmap); unsigned h = BITMAP_HEIGHT(bitmap); unsigned spp = BITMAP_PLANES(bitmap); dist.height = h; dist.width = w; XMALLOC(dist.d, h * sizeof(float*)); XMALLOC(dist.weight, h * sizeof(float*)); for (y = 0; y < (signed) h; y++) { XCALLOC(dist.d[y], w * sizeof(float)); XMALLOC(dist.weight[y], w * sizeof(float)); } if (spp == 3) { for (y = 0; y < (signed) h; y++) { for (x = 0; x < (signed) w; x++, b += spp) { int gray; float fgray; gray = (int)LUMINANCE(b[0], b[1], b[2]); dist.d[y][x] = (gray == target_value ? 0.0F : 1.0e10F); fgray = gray * 0.0039215686F; /* = gray / 255.0F */ dist.weight[y][x] = 1.0F - fgray; /* dist.weight[y][x] = 1.0F - (fgray * fgray);*/ /* dist.weight[y][x] = (fgray < 0.5F ? 1.0F - fgray : -2.0F * fgray * (fgray - 1.0F));*/ } } } else { for (y = 0; y < (signed) h; y++) { for (x = 0; x < (signed) w; x++, b += spp) { int gray; float fgray; gray = b[0]; dist.d[y][x] = (gray == target_value ? 0.0F : 1.0e10F); fgray = gray * 0.0039215686F; /* = gray / 255.0F */ dist.weight[y][x] = 1.0F - fgray; /* dist.weight[y][x] = 1.0F - (fgray * fgray);*/ /* dist.weight[y][x] = (fgray < 0.5F ? 1.0F - fgray : -2.0F * fgray * (fgray - 1.0F)); */ } } } /* If the image is padded then border points are all at most one unit away from the nearest target point. */ if (padded) { for (y = 0; y < (signed) h; y++) { if (dist.d[y][0] > dist.weight[y][0]) dist.d[y][0] = dist.weight[y][0]; if (dist.d[y][w - 1] > dist.weight[y][w - 1]) dist.d[y][w - 1] = dist.weight[y][w - 1]; } for (x = 0; x < (signed) w; x++) { if (dist.d[0][x] > dist.weight[0][x]) dist.d[0][x] = dist.weight[0][x]; if (dist.d[h - 1][x] > dist.weight[h - 1][x]) dist.d[h - 1][x] = dist.weight[h - 1][x]; } } /* Scan the image from left to right, top to bottom. Examine the already-visited neighbors of each point (those situated above or to the left of it). Each neighbor knows the distance to its nearest target point; add to this distance the distance from the central point to the neighbor (either sqrt(2) or one) multiplied by the central point's weight (derived from its gray level). Replace the distance already stored at the central point if the new distance is smaller. */ for (y = 1; y < (signed) h; y++) { for (x = 1; x < (signed) w; x++) { if (dist.d[y][x] == 0.0F) continue; min = dist.d[y][x]; /* upper-left neighbor */ d = dist.d[y - 1][x - 1] + (float) M_SQRT2 * dist.weight[y][x]; if (d < min) min = dist.d[y][x] = d; /* upper neighbor */ d = dist.d[y - 1][x] + dist.weight[y][x]; if (d < min) min = dist.d[y][x] = d; /* left neighbor */ d = dist.d[y][x - 1] + dist.weight[y][x]; if (d < min) min = dist.d[y][x] = d; /* upper-right neighbor (except at the last column) */ if (x + 1 < (signed) w) { d = dist.d[y - 1][x + 1] + (float) M_SQRT2 * dist.weight[y][x]; if (d < min) min = dist.d[y][x] = d; } } } /* Same as above, but now scanning right to left, bottom to top. */ for (y = h - 2; y >= 0; y--) { for (x = w - 2; x >= 0; x--) { min = dist.d[y][x]; /* lower-right neighbor */ d = dist.d[y + 1][x + 1] + (float) M_SQRT2 * dist.weight[y][x]; if (d < min) min = dist.d[y][x] = d; /* lower neighbor */ d = dist.d[y + 1][x] + dist.weight[y][x]; if (d < min) min = dist.d[y][x] = d; /* right neighbor */ d = dist.d[y][x + 1] + dist.weight[y][x]; if (d < min) min = dist.d[y][x] = d; /* lower-left neighbor (except at the first column) */ if (x - 1 >= 0) { d = dist.d[y + 1][x - 1] + (float) M_SQRT2 * dist.weight[y][x]; if (d < min) min = dist.d[y][x] = d; } } } return dist; } /* Free the dynamically-allocated storage associated with a distance map. */ void free_distance_map(distance_map_type *dist) { unsigned y, h; if (!dist) return; h = BITMAP_HEIGHT(*dist); if (dist->d != NULL) { for (y = 0; y < h; y++) free((at_address*)dist->d[y]); free((at_address*)dist->d); } if (dist->weight != NULL) { for (y = 0; y < h; y++) free((at_address*)dist->weight[y]); free((at_address*)dist->weight); } } #if 0 void medial_axis(bitmap_type *bitmap, distance_map_type *dist, const color_type *bg_color) { unsigned x, y, test; unsigned w, h; unsigned char *b; float **d, f; color_type bg; assert(bitmap != NULL); assert(BITMAP_PLANES(*bitmap) == 1); b = BITMAP_BITS(*bitmap); assert(b != NULL); assert(dist != NULL); d = dist->d; assert(d != NULL); h = BITMAP_HEIGHT(*dist); w = BITMAP_WIDTH(*dist); assert(BITMAP_WIDTH(*bitmap) == w && BITMAP_HEIGHT(*bitmap) == h); if (bg_color) bg = *bg_color; else bg.r = bg.g = bg.b = 255; f = d[0][0] + 0.5; test = (f < d[1][0]) + (f < d[1][1]) + (f < d[0][1]); if (test > 1) b[0] = bg.r; f = d[0][w-1] + 0.5; test = (f < d[1][w-1]) + (f < d[1][w-2]) + (f < d[0][w-2]); if (test > 1) b[w-1] = bg.r; for (x = 1; x < w - 1; x++) { f = d[0][x] + 0.5; test = (f < d[0][x-1]) + (f < d[0][x+1]) + (f < d[1][x-1]) + (f < d[1][x]) + (f < d[1][x+1]); if (test > 1) b[x] = bg.r; } b += w; for (y = 1; y < h - 1; y++) { f = d[y][0] + 0.5; test = (f < d[y-1][0]) + (f < d[y-1][1]) + (f < d[y][1]) + (f < d[y+1][0]) + (f < d[y+1][1]); if (test > 1) b[0] = bg.r; for (x = 1; x < w - 1; x++) { f = d[y][x] + 0.5; test = (f < d[y-1][x-1]) + (f < d[y-1][x]) + (f < d[y-1][x+1]) + (f < d[y][x-1]) + (f < d[y][x+1]) + (f < d[y+1][x-1]) + (f < d[y+1][x]) + (f < d[y+1][x+1]); if (test > 1) b[x] = bg.r; } f = d[y][w-1] + 0.5; test = (f < d[y-1][w-1]) + (f < d[y-1][w-2]) + (f < d[y][w-2]) + (f < d[y+1][w-1]) + (f < d[y+1][w-2]); if (test > 1) b[w-1] = bg.r; b += w; } for (x = 1; x < w - 1; x++) { f = d[h-1][x] + 0.5; test = (f < d[h-1][x-1]) + (f < d[h-1][x+1]) + (f < d[h-2][x-1]) + (f < d[h-2][x]) + (f < d[h-2][x+1]); if (test > 1) b[x] = bg.r; } f = d[h-1][0] + 0.5; test = (f < d[h-2][0]) + (f < d[h-2][1]) + (f < d[h-1][1]); if (test > 1) b[0] = bg.r; f = d[h-1][w-1] + 0.5; test = (f < d[h-2][w-1]) + (f < d[h-2][w-2]) + (f < d[h-1][w-2]); if (test > 1) b[w-1] = bg.r; } #endif /* Binarize a grayscale or color image. */ void binarize(bitmap_type *bitmap) { unsigned i, npixels, spp; unsigned char *b; assert(bitmap != NULL); assert(BITMAP_BITS(*bitmap) != NULL); b = BITMAP_BITS(*bitmap); spp = BITMAP_PLANES(*bitmap); npixels = BITMAP_WIDTH(*bitmap) * BITMAP_HEIGHT(*bitmap); if (spp == 1) { for (i = 0; i < npixels; i++) b[i] = (b[i] > GRAY_THRESHOLD ? WHITE : BLACK); } else if (spp == 3) { unsigned char *rgb = b; for (i = 0; i < npixels; i++, rgb += 3) { b[i] = (LUMINANCE(rgb[0], rgb[1], rgb[2]) > GRAY_THRESHOLD ? WHITE : BLACK); } XREALLOC(BITMAP_BITS(*bitmap), npixels); BITMAP_PLANES(*bitmap) = 1; } else { WARNING1("binarize: %u-plane images are not supported", spp); } } #if 0 /* Thin a binary image, replacing the original image with the thinned one. */ bitmap_type ip_thin(bitmap_type input_b) { unsigned y, x, i; at_bool k, again; struct etyp t; unsigned w = BITMAP_WIDTH(input_b); unsigned h = BITMAP_HEIGHT(input_b); size_t num_bytes = w * h; bitmap_type b = input_b; if (BITMAP_PLANES(input_b) != 1) { FATAL1("thin: single-plane image required; " "%u-plane images cannot be thinned", BITMAP_PLANES(input_b)); return b; } /* Process and return a copy of the input image. */ XMALLOC(b.bitmap, num_bytes); memcpy(b.bitmap, input_b.bitmap, num_bytes); /* Set background pixels to zero, foreground pixels to one. */ for (i = 0; i < num_bytes; i++) b.bitmap[i] = (b.bitmap[i] == BLACK ? 1 : 0); again = true; while (again) { again = false; for (y = 1; y < h - 1; y++) { for (x = 1; x < w - 1; x++) { /* During processing, pixels are used to store edge type codes, so we can't just test for WHITE or BLACK. */ if (*BITMAP_PIXEL(b, y, x) == 0) continue; k = (!get_edge(b, y, x, &t) || (get_edge(b, y, x+1, &t) && *BITMAP_PIXEL(b, y-1, x) && *BITMAP_PIXEL(b, y+1, x)) || (get_edge(b, y+1, x, &t) && *BITMAP_PIXEL(b, y, x-1) && *BITMAP_PIXEL(b, y, x+1)) || (get_edge(b, y, x+1, &t) && get_edge(b, y+1, x+1, &t) && get_edge(b, y+1, x, &t))); if (k) continue; get_edge(b, y, x, &t); if (t.t01) *BITMAP_PIXEL(b, y, x) |= 4; *BITMAP_PIXEL(b, y, x) |= 2; again = true; } } for (y = 0; y < h; y++) for (x = 0; x < w; x++) if (*BITMAP_PIXEL(b, y, x) & 02) *BITMAP_PIXEL(b, y, x) = 0; for (y = 1; y < h - 1; y++) { for (x = 1; x < w - 1; x++) { if (*BITMAP_PIXEL(b, y, x) == 0) continue; k = (!get_edge(b, y, x, &t) || ((*BITMAP_PIXEL(b, y, x) & 04) == 0) || (get_edge(b, y+1, x, &t) && (*BITMAP_PIXEL(b, y, x-1)) && *BITMAP_PIXEL(b, y, x+1)) || (get_edge(b, y, x+1, &t) && *BITMAP_PIXEL(b, y-1, x) && *BITMAP_PIXEL(b, y+1, x)) || (get_edge(b, y+1, x, &t) && get_edge(b, y, x+1, &t) && get_edge(b, y+1, x+1, &t))); if (k) continue; *BITMAP_PIXEL(b, y, x) |= 02; again = true; } } for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { if (*BITMAP_PIXEL(b, y, x) & 02) *BITMAP_PIXEL(b, y, x) = 0; else if (*BITMAP_PIXEL(b, y, x) > 0) *BITMAP_PIXEL(b, y, x) = 1; } } } /* Staircase removal; northward bias. */ for (y = 1; y < h - 1; y++) { for (x = 1; x < w - 1; x++) { if (*BITMAP_PIXEL(b, y, x) == 0) continue; k = !(*BITMAP_PIXEL(b, y-1, x) && ((*BITMAP_PIXEL(b, y, x+1) && !*BITMAP_PIXEL(b, y-1, x+1) && !*BITMAP_PIXEL(b, y+1, x-1) && (!*BITMAP_PIXEL(b, y, x-1) || !*BITMAP_PIXEL(b, y+1, x))) || (*BITMAP_PIXEL(b, y, x-1) && !*BITMAP_PIXEL(b, y-1, x-1) && !*BITMAP_PIXEL(b, y+1, x+1) && (!*BITMAP_PIXEL(b, y, x+1) || !*BITMAP_PIXEL(b, y+1, x))))); if (k) continue; *BITMAP_PIXEL(b, y, x) |= 02; } } for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { if (*BITMAP_PIXEL(b, y, x) & 02) *BITMAP_PIXEL(b, y, x) = 0; else if (*BITMAP_PIXEL(b, y, x) > 0) *BITMAP_PIXEL(b, y, x) = 1; } } /* Southward bias */ for (y = 1; y < h - 1; y++) { for (x = 1; x < w - 1; x++) { if (*BITMAP_PIXEL(b, y, x) == 0) continue; k = !(*BITMAP_PIXEL(b, y+1, x) && ((*BITMAP_PIXEL(b, y, x+1) && !*BITMAP_PIXEL(b, y+1, x+1) && !*BITMAP_PIXEL(b, y-1, x-1) && (!*BITMAP_PIXEL(b, y, x-1) || !*BITMAP_PIXEL(b, y-1, x))) || (*BITMAP_PIXEL(b, y, x-1) && !*BITMAP_PIXEL(b, y+1, x-1) && !*BITMAP_PIXEL(b, y-1, x+1) && (!*BITMAP_PIXEL(b, y, x+1) || !*BITMAP_PIXEL(b, y-1, x)) ))); if (k) continue; *BITMAP_PIXEL(b, y, x) |= 02; } } for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { if (*BITMAP_PIXEL(b, y, x) & 02) *BITMAP_PIXEL(b, y, x) = 0; else if (*BITMAP_PIXEL(b, y, x) > 0) *BITMAP_PIXEL(b, y, x) = 1; } } /* Set background pixels to WHITE, foreground pixels to BLACK. */ for (i = 0; i < num_bytes; i++) b.bitmap[i] = (b.bitmap[i] == 0 ? WHITE : BLACK); return b; } at_bool get_edge(bitmap_type b, int y, int x, struct etyp *t) { t->t00 = 0; t->t01 = 0; t->t01s = 0; t->t11 = 0; check(*BITMAP_PIXEL(b, y - 1, x - 1), *BITMAP_PIXEL(b, y - 1, x), *BITMAP_PIXEL(b, y - 1, x + 1), t); check(*BITMAP_PIXEL(b, y - 1, x + 1), *BITMAP_PIXEL(b, y, x + 1), *BITMAP_PIXEL(b, y + 1, x + 1), t); check(*BITMAP_PIXEL(b, y + 1, x + 1), *BITMAP_PIXEL(b, y + 1, x), *BITMAP_PIXEL(b, y + 1, x - 1), t); check(*BITMAP_PIXEL(b, y + 1, x - 1), *BITMAP_PIXEL(b, y, x - 1), *BITMAP_PIXEL(b, y - 1, x - 1), t); return *BITMAP_PIXEL(b, y, x) && t->t00 && t->t11 && !t->t01s; } void check(int v1, int v2, int v3, struct etyp *t) { if (!v2 && (!v1 || !v3)) t->t00 = 1; if (v2 && (v1 || v3)) t->t11 = 1; if ((!v1 && v2) || (!v2 && v3)) { t->t01s = t->t01; t->t01 = 1; } } #endif autotrace-0.31.1/image-proc.h0000664000076400007640000000203607551363415011464 /* image-proc.h: image processing routines */ #ifndef IMAGE_PROC_H #define IMAGE_PROC_H #include "bitmap.h" #include "color.h" /* Threshold for binarizing a monochrome image */ #define GRAY_THRESHOLD 225 /* RGB to grayscale */ #define LUMINANCE(r, g, b) ((r) * 0.30 + (g) * 0.59 + (b) * 0.11 + 0.5) typedef struct { unsigned height, width; float **weight; float **d; } distance_map_type; /* Allocate and compute a new distance map. */ extern distance_map_type new_distance_map(bitmap_type, unsigned char target_value, at_bool padded, at_exception_type * exp); /* Free the dynamically-allocated storage associated with a distance map. */ extern void free_distance_map(distance_map_type*); extern void medial_axis(bitmap_type *bitmap, distance_map_type *dist, const color_type *bg_color); /* Binarize a grayscale or color image. */ extern void binarize(bitmap_type*); /* Thin a binary image, replacing the original image with the thinned one. */ extern bitmap_type ip_thin(bitmap_type); #endif /* not IMAGE_PROC_H */ autotrace-0.31.1/atou.c0000664000076400007640000000050507551363216010402 /* atou.c: like atoi, but if the number is negative, abort. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "message.h" #include "atou.h" unsigned atou (at_string s) { int i = atoi (s); if (i < 0) FATAL1 ("I expected a positive number, not %d", i); return (unsigned) i; } autotrace-0.31.1/atou.h0000664000076400007640000000025007551363216010404 /* atou.h: like atoi, but if the number is negative, abort. */ #ifndef ATOU_H #define ATOU_H #include "types.h" unsigned atou (at_string s); #endif /* not ATOU_H */ autotrace-0.31.1/main.c0000664000076400007640000004044307560130544010357 /* main.c: main driver for autotrace -- convert bitmaps to splines. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "autotrace.h" #include "message.h" #include "cmdline.h" #include "logreport.h" #include "getopt.h" #include "filename.h" #include "xstd.h" #include "atou.h" #include "strgicmp.h" #include "input.h" #include #include #include /* Pointers to functions based on input format. (-input-format) */ static at_input_read_func input_reader = NULL; /* Return NAME with any leading path stripped off. This returns a pointer into NAME. For example, `basename ("/foo/bar.baz")' returns "bar.baz". */ static char * get_basename (char * name); /* The name of the file we're going to write. (-output-file) */ static char * output_name = (char *)""; /* The output function. (-output-format) */ static at_output_write_func output_writer = NULL; /* Whether to print version information */ static at_bool printed_version; /* Whether to write a log file */ static at_bool logging = false; /* Whether to dump a bitmap file */ static at_bool dumping_bitmap = false; /* Report tracing status in real time (--report-progress) */ static at_bool report_progress = false; #define dot_printer_max_column 50 #define dot_printer_char '|' static void dot_printer(at_real percentage, at_address client_data); static char * read_command_line (int, char * [], at_fitting_opts_type *, at_output_opts_type *); static unsigned int hctoi (char c); static void dump (at_bitmap_type * bitmap, FILE * fp); static void input_list_formats(FILE * file); static void output_list_formats(FILE* file); static void exception_handler(at_string msg, at_msg_type type, at_address data); #define DEFAULT_FORMAT "eps" int main (int argc, char * argv[]) { at_fitting_opts_type * fitting_opts; at_input_opts_type * input_opts; at_output_opts_type * output_opts; char * input_name, * input_rootname; char * logfile_name = NULL, * dumpfile_name = NULL; at_splines_type * splines; at_bitmap_type * bitmap; FILE *output_file; FILE *dump_file; at_progress_func progress_reporter = NULL; int progress_stat = 0; fitting_opts = at_fitting_opts_new (); output_opts = at_output_opts_new (); input_name = read_command_line (argc, argv, fitting_opts, output_opts); if (strgicmp (output_name, input_name)) FATAL("Input and output file may not be the same\n"); if ((input_rootname = remove_suffix (get_basename (input_name))) == NULL) FATAL1 ("Not a valid inputname %s", input_name); if (logging) log_file = xfopen (logfile_name = extend_filename (input_rootname, "log"), "w"); /* BUG: Sometimes input_rootname points to the heap, sometimes to the stack, so it can't safely be freed. */ /* if (input_rootname != input_name) free (input_rootname); */ if (logging) free (logfile_name); /* Set input_reader if it is not set in command line args */ if (!input_reader) input_reader = at_input_get_handler (input_name); /* Set output_writer if it is not set in command line args Step1. Guess from a file name. Step2. Use default. */ if (!output_writer) output_writer = at_output_get_handler (output_name); if (!output_writer) { output_writer = at_output_get_handler_by_suffix(DEFAULT_FORMAT); if (output_writer == NULL) FATAL1("Default format %s not supported", DEFAULT_FORMAT); } /* Open output file */ if (!strcmp (output_name, "")) output_file = stdout; else output_file = xfopen(output_name, "wb"); /* Open the main input file. */ if (input_reader != NULL) { input_opts = at_input_opts_new (); if (fitting_opts->background_color) input_opts->background_color = at_color_copy(fitting_opts->background_color); bitmap = at_bitmap_read(input_reader, input_name, input_opts, exception_handler, NULL); at_input_opts_free(input_opts); } else FATAL ("Unsupported input format"); if (report_progress) { progress_reporter = dot_printer; fprintf(stderr, "%-15s", input_name); }; splines = at_splines_new_full(bitmap, fitting_opts, exception_handler, NULL, progress_reporter, &progress_stat, NULL, NULL); /* Dump loaded bitmap if needed */ if (dumping_bitmap) { dumpfile_name = extend_filename (input_rootname, "bitmap"); dump_file = xfopen (dumpfile_name, "wb"); dump(bitmap, dump_file); fclose(dump_file); } at_splines_write (output_writer, output_file, output_name, output_opts, splines, exception_handler, NULL); at_output_opts_free(output_opts); if (output_file != stdout) fclose (output_file); at_splines_free (splines); at_bitmap_free (bitmap); at_fitting_opts_free(fitting_opts); if (report_progress) fputs("\n", stderr); return 0; } /* Reading the options. */ #define USAGE1 "Options:\ should be a supported image.\n"\ GETOPT_USAGE \ "background-color : the color of the background that\n\ should be ignored, for example FFFFFF;\n\ default is no background color.\n\ centerline: trace a character's centerline, rather than its outline.\n\ color-count : number of colors a color bitmap is reduced to,\n\ it does not work on grayscale, allowed are 1..256;\n\ default is 0, that means not color reduction is done.\n\ corner-always-threshold : if the angle at a pixel is\n\ less than this, it is considered a corner, even if it is within\n\ `corner-surround' pixels of another corner; default is 60.\n\ corner-surround : number of pixels on either side of a\n\ point to consider when determining if that point is a corner;\n\ default is 4.\n\ corner-threshold : if a pixel, its predecessor(s),\n\ and its successor(s) meet at an angle smaller than this, it's a\n\ corner; default is 100.\n\ despeckle-level : 0..20; default is no despeckling.\n\ despeckle-tightness : 0.0..8.0; default is 2.0.\n\ dpi : The dots per inch value in the input image, affects scaling\n\ of mif output image\n" #define USAGE2 "error-threshold : subdivide fitted curves that are off by\n\ more pixels than this; default is 2.0.\n\ filter-iterations : smooth the curve this many times\n\ before fitting; default is 4.\n\ input-format: %s. \n\ help: print this message.\n\ line-reversion-threshold : if a spline is closer to a straight\n\ line than this, weighted by the square of the curve length, keep it a\n\ straight line even if it is a list with curves; default is .01.\n\ line-threshold : if the spline is not more than this far away\n\ from the straight line defined by its endpoints,\n\ then output a straight line; default is 1.\n\ list-output-formats: print a list of support output formats to stderr.\n\ list-input-formats: print a list of support input formats to stderr.\n\ log: write detailed progress reports to .log.\n\ output-file : write to \n\ output-format : use format for the output file\n\ %s can be used.\n\ preserve-width: whether to preserve line width prior to thinning.\n\ remove-adjacent-corners: remove corners that are adjacent.\n\ tangent-surround : number of points on either side of a\n\ point to consider when computing the tangent at that point; default is 3.\n\ report-progress: report tracing status in real time.\n\ debug-arch: print the type of cpu.\n\ debug-bitmap: dump loaded bitmap to .bitmap.\n\ version: print the version number of this program.\n\ width-weight-factor : weight factor for fitting the linewidth.\n\ " /* We return the name of the image to process. */ static char * read_command_line (int argc, char * argv[], at_fitting_opts_type * fitting_opts, at_output_opts_type * output_opts) { int g; /* `getopt' return code. */ int option_index; struct option long_options[] = { { "align-threshold", 1, 0, 0 }, { "background-color", 1, 0, 0 }, { "debug-arch", 0, 0, 0 }, { "debug-bitmap", 0, (int *)&dumping_bitmap, 1 }, { "centerline", 0, 0, 0 }, { "color-count", 1, 0, 0 }, { "corner-always-threshold", 1, 0, 0 }, { "corner-surround", 1, 0, 0 }, { "corner-threshold", 1, 0, 0 }, { "despeckle-level", 1, 0, 0 }, { "despeckle-tightness", 1, 0, 0 }, { "dpi", 1, 0, 0 }, { "error-threshold", 1, 0, 0 }, { "filter-iterations", 1, 0, 0 }, { "help", 0, 0, 0 }, { "input-format", 1, 0, 0 }, { "line-reversion-threshold", 1, 0, 0 }, { "line-threshold", 1, 0, 0 }, { "list-output-formats", 0, 0, 0 }, { "list-input-formats", 0, 0, 0 }, { "log", 0, (int *) &logging, 1 }, { "output-file", 1, 0, 0 }, { "output-format", 1, 0, 0 }, { "preserve-width", 0, 0, 0 }, { "range", 1, 0, 0 }, { "remove-adjacent-corners", 0, 0, 0 }, { "tangent-surround", 1, 0, 0 }, { "report-progress", 0, (int *) &report_progress, 1}, { "version", 0, (int *) &printed_version, 1 }, { "width-weight-factor", 1, 0, 0 }, { 0, 0, 0, 0 } }; while (true) { g = getopt_long_only (argc, argv, "", long_options, &option_index); if (g == EOF) break; if (g == '?') exit (1); /* Unknown option. */ assert (g == 0); /* We have no short option names. */ if (ARGUMENT_IS ("background-color")) { if (strlen (optarg) != 6) FATAL ("background-color be six chars long"); fitting_opts->background_color = at_color_new((unsigned char)(hctoi (optarg[0]) * 16 + hctoi (optarg[1])), (unsigned char)(hctoi (optarg[2]) * 16 + hctoi (optarg[3])), (unsigned char)(hctoi (optarg[4]) * 16 + hctoi (optarg[5]))); } else if (ARGUMENT_IS ("centerline")) fitting_opts->centerline = true; else if (ARGUMENT_IS ("color-count")) fitting_opts->color_count = atou (optarg); else if (ARGUMENT_IS ("corner-always-threshold")) fitting_opts->corner_always_threshold = (at_real) atof (optarg); else if (ARGUMENT_IS ("corner-surround")) fitting_opts->corner_surround = atou (optarg); else if (ARGUMENT_IS ("corner-threshold")) fitting_opts->corner_threshold = (at_real) atof (optarg); else if (ARGUMENT_IS ("debug-arch")) { int endian = 1; char * str; if (*(char *)&endian) str = "little"; else str = "big"; printf("%d bit, %s endian\n", sizeof(void *) * 8, str); exit(0); } else if (ARGUMENT_IS ("despeckle-level")) fitting_opts->despeckle_level = atou (optarg); else if (ARGUMENT_IS ("despeckle-tightness")) fitting_opts->despeckle_tightness = (at_real) atof (optarg); else if (ARGUMENT_IS ("dpi")) output_opts->dpi = atou (optarg); else if (ARGUMENT_IS ("error-threshold")) fitting_opts->error_threshold = (at_real) atof (optarg); else if (ARGUMENT_IS ("filter-iterations")) fitting_opts->filter_iterations = atou (optarg); else if (ARGUMENT_IS ("help")) { char *ishortlist, *oshortlist; fprintf (stderr, "Usage: %s [options] .\n", argv[0]); fprintf (stderr, USAGE1); fprintf (stderr, USAGE2, ishortlist = at_input_shortlist(), oshortlist = at_output_shortlist()); free (ishortlist); free (oshortlist); fprintf (stderr, "\nYou can get the source code of autotrace from \n%s\n", at_home_site()); exit (0); } else if (ARGUMENT_IS ("input-format")) { input_reader = at_input_get_handler_by_suffix (optarg); if (!input_reader) FATAL1 ("Input format %s not supported\n", optarg); } else if (ARGUMENT_IS ("line-threshold")) fitting_opts->line_threshold = (at_real) atof (optarg); else if (ARGUMENT_IS ("line-reversion-threshold")) fitting_opts->line_reversion_threshold = (at_real) atof (optarg); else if (ARGUMENT_IS ("list-output-formats")) { fprintf (stderr, "Supported output formats:\n"); output_list_formats (stderr); exit (0); } else if (ARGUMENT_IS ("list-input-formats")) { fprintf (stderr, "Supported input formats:\n"); input_list_formats (stderr); exit (0); } else if (ARGUMENT_IS ("output-file")) output_name = optarg; else if (ARGUMENT_IS ("output-format")) { output_writer = at_output_get_handler_by_suffix (optarg); if (output_writer == NULL) FATAL1 ("Output format %s not supported", optarg); } else if (ARGUMENT_IS ("preserve_width")) fitting_opts->preserve_width = true; else if (ARGUMENT_IS ("remove-adjacent-corners")) fitting_opts->remove_adjacent_corners = true; else if (ARGUMENT_IS ("tangent-surround")) fitting_opts->tangent_surround = atou (optarg); else if (ARGUMENT_IS ("version")) printf ("AutoTrace version %s.\n", at_version(false)); else if (ARGUMENT_IS ("width-weight-factor")) fitting_opts->width_weight_factor = (at_real) atof (optarg); /* Else it was just a flag; getopt has already done the assignment. */ } FINISH_COMMAND_LINE (); } /* Return NAME with any leading path stripped off. This returns a pointer into NAME. For example, `basename ("/foo/bar.baz")' returns "bar.baz". */ static char * get_basename (char * name) { #ifdef WIN32 char * base = strrchr (name, '\\'); #else char * base = strrchr (name, '/'); #endif return base ? base + 1 : name; } /* Convert hex char to integer */ static unsigned int hctoi (char c) { if (c == '0') return (0); else if (c == '1') return (1); else if (c == '2') return (2); else if (c == '3') return (3); else if (c == '4') return (4); else if (c == '5') return (5); else if (c == '6') return (6); else if (c == '7') return (7); else if (c == '8') return (8); else if (c == '9') return (9); else if (c == 'a') return (10); else if (c == 'A') return (10); else if (c == 'b') return (11); else if (c == 'B') return (11); else if (c == 'c') return (12); else if (c == 'C') return (12); else if (c == 'd') return (13); else if (c == 'D') return (13); else if (c == 'e') return (14); else if (c == 'E') return (14); else if (c == 'f') return (15); else if (c == 'F') return (15); else FATAL ("No hex values"); } static void input_list_formats(FILE * file) { char ** list = at_input_list_new (); char ** tmp; char * suffix; char * descr; tmp = list; while (*list) { suffix = *list++; descr = *list++; fprintf(file, "%5s %s\n", suffix, descr); } at_input_list_free(tmp); } static void output_list_formats(FILE* file) { char ** list = at_output_list_new (); char ** tmp; char * suffix; char * descr; tmp = list; while (*list) { suffix = *list++; descr = *list++; fprintf(file, "%10s %s\n", suffix, descr); } at_output_list_free(tmp); } static void dot_printer(at_real percentage, at_address client_data) { int * current = (int *)client_data; float unit = (float)1.0 / (float)(dot_printer_max_column) ; int maximum = (int)(percentage / unit); while (*current < maximum) { fputc(dot_printer_char, stderr); (*current)++; } } static void dump (at_bitmap_type * bitmap, FILE * fp) { unsigned short width, height; unsigned int np; width = at_bitmap_get_width (bitmap); height = at_bitmap_get_height (bitmap); np = at_bitmap_get_planes (bitmap); fprintf(fp, "w=%u, h=%u, np=%u\n", width, height, np); fwrite(AT_BITMAP_BITS(*bitmap), sizeof(unsigned char), width * height * np, fp); } static void exception_handler(at_string msg, at_msg_type type, at_address data) { if (type == AT_MSG_FATAL) { fprintf (stderr, "%s\n", msg); exit (1); } else if (type == AT_MSG_WARNING) fprintf (stderr, "%s\n", msg); else exception_handler("Wrong type of msg", AT_MSG_FATAL, NULL); } autotrace-0.31.1/cmdline.h0000664000076400007640000000405007551363216011051 /* cmdline.h: macros to help process command-line arguments. */ #ifndef CMDLINE_H #define CMDLINE_H #include "getopt.h" #include "types.h" #include "strgicmp.h" #include /* Test whether getopt found an option ``A''. Assumes the option index is in the variable `option_index', and the option table in a variable `long_options'. */ #define ARGUMENT_IS(a) strgicmp (long_options[option_index].name, a) /* Perform common actions at the end of parsing the arguments. Assumes lots of variables: `printed_version', a boolean for whether the version number has been printed; `optind', the current option index; `argc'; `argv'. */ #define FINISH_COMMAND_LINE() \ do \ { \ /* Just wanted to know the version number? */ \ if (printed_version && optind == argc) exit (0); \ \ /* Exactly one (non-empty) argument left? */ \ if (optind + 1 == argc && *argv[optind] != 0) \ { \ return (argv[optind]); \ } \ else \ { \ fprintf (stderr, "Usage: %s [options] .\n", argv[0]);\ fprintf (stderr, "(%s.)\n", optind == argc ? "Missing "\ : "Too many s"); \ fputs ("For more information, use ``-help''.\n", stderr); \ exit (1); \ } \ return NULL; /* stop warnings */ \ } \ while (0) #define GETOPT_USAGE \ " You can use `--' or `-' to start an option.\n\ You can use any unambiguous abbreviation for an option name.\n\ You can separate option names and values with `=' or ` '.\n\ " /* What to pass to `strtok' to separate different arguments to an option, as in `-option=arg1,arg2,arg3'. It is useful to allow whitespace as well so that the option value can come from a file, via the shell construct "`cat file`" (including the quotes). */ #define ARG_SEP ", \t\n" #endif /* not CMDLINE_H */ autotrace-0.31.1/getopt.c0000664000076400007640000004033607551363227010744 /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! Copyright (C) 1987, 88, 89, 90, 91, 1992, 1999 Free Software Foundation, Inc. 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, 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "xstd.h" #include "strgicmp.h" #include #include /* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a long-named option. Because this is not POSIX.2 compliant, it is being phased out. */ #define GETOPT_COMPAT /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = 0; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns EOF, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ int optind = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return EOF with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; #include /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange (char **argv) { int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *); char **temp; XMALLOC (temp, nonopts_size); /* Interchange the two blocks of data in ARGV. */ memcpy ((char *) temp, (char *) &argv[first_nonopt], nonopts_size); memcpy ((char *) &argv[first_nonopt], (char *) &argv[last_nonopt], (optind - last_nonopt) * sizeof (char *)); memcpy ((char *) &argv[first_nonopt + optind - last_nonopt], (char *) temp, nonopts_size); /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; free (temp); } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns `EOF'. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) { int option_index; optarg = 0; /* Initialize the internal data when the first call is made. Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ if (optind == 0) { first_nonopt = last_nonopt = optind = 1; nextchar = NULL; /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (getenv ("POSIXLY_CORRECT") != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; } if (nextchar == NULL || *nextchar == '\0') { if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Now skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && (argv[optind][0] != '-' || argv[optind][1] == '\0') #ifdef GETOPT_COMPAT && (longopts == NULL || argv[optind][0] != '+' || argv[optind][1] == '\0') #endif /* GETOPT_COMPAT */ ) optind++; last_nonopt = optind; } /* Special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return EOF; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if ((argv[optind][0] != '-' || argv[optind][1] == '\0') #ifdef GETOPT_COMPAT && (longopts == NULL || argv[optind][0] != '+' || argv[optind][1] == '\0') #endif /* GETOPT_COMPAT */ ) { if (ordering == REQUIRE_ORDER) return EOF; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Start decoding its characters. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } if (longopts != NULL && ((argv[optind][0] == '-' && (argv[optind][1] == '-' || long_only)) #ifdef GETOPT_COMPAT || argv[optind][0] == '+' #endif /* GETOPT_COMPAT */ )) { const struct option *p; char *s = nextchar; int exact = 0; int ambig = 0; const struct option *pfound = NULL; int indfound=0; while (*s && *s != '=') s++; /* Test all options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (strgnicmp (p->name, nextchar, s - nextchar)) { if ((unsigned) (s - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, "%s: option `%s' is ambiguous\n", argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*s) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = s + 1; else { if (opterr) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, "%s: option `--%s' doesn't allow an argument\n", argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, "%s: option `%c%s' doesn't allow an argument\n", argv[0], argv[optind - 1][0], pfound->name); } nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, "%s: option `%s' requires an argument\n", argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' #ifdef GETOPT_COMPAT || argv[optind][0] == '+' #endif /* GETOPT_COMPAT */ || strchr (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, "%s: unrecognized option `--%s'\n", argv[0], nextchar); else /* +option or -option */ fprintf (stderr, "%s: unrecognized option `%c%s'\n", argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; return '?'; } } /* Look at and handle the next option-character. */ { char c = *nextchar++; char *temp = strchr (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (c < 040 || c >= 0177) fprintf (stderr, "%s: unrecognized option, character code 0%o\n", argv[0], c); else fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c); } return '?'; } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = 0; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) fprintf (stderr, "%s: option `-%c' requires an argument\n", argv[0], c); c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } autotrace-0.31.1/getopt.h0000664000076400007640000000737507551363227010757 /* Declarations for getopt. Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. 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, 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef GETOPT_H #define GETOPT_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns EOF, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 extern int getopt (int argc, char *const *argv, const char *shortopts); extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind, int long_only); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* GETOPT_H */ autotrace-0.31.1/getopt1.c0000664000076400007640000000275207551363227011025 /* Getopt for GNU. Copyright (C) 1987, 88, 89, 90, 91, 1992, 1999 Free Software Foundation, Inc. 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, 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "getopt.h" int getopt_long (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } autotrace-0.31.1/strgicmp.h0000664000076400007640000000033507562261172011270 #ifndef STRGICMP_H #define STRGICMP_H #include "autotrace.h" extern at_bool strgicmp (const char *s1, const char *s2); extern at_bool strgnicmp (const char *s1, const char *s2, size_t len); #endif /* not STRGICMP_H */ autotrace-0.31.1/autotrace.10000664000076400007640000001505507551363267011353 .TH AUTOTRACE 1 "10 October 2002" .SH NAME autotrace \- converts bitmap image data into vector graphics .SH SYNOPSIS .B autotrace .RB [ \-background-color .IR " hexvalue" ] .RB [ \-centerline ] .RB [ \-color-count .IR " int" ] .RB [ \-corner-always-threshold .IR " angle" ] .RB [ \-corner-surround .IR " int" ] .RB [ \-corner-threshold .IR " angle" ] .RB [ \-despeckle-level .IR " int" ] .RB [ \-despeckle-tightness .IR " real" ] .RB [ \-dpi .IR " int" ] .RB [ \-error-threshold .IR " real" ] .RB [ \-filter-iterations .IR " int" ] .RB [ \-help ] .RB [ \-input-format .IR " format" ] .RB [ \-line-reversion-threshold .IR " real" ] .RB [ \-line-threshold .IR " real" ] .RB [ \-list-input-formats ] .RB [ \-list-output-formats ] .RB [ \-log ] .RB [ \-output-file .IR " file" ] .RB [ \-output-format .IR " format" ] .RB [ \-preserve-width ] .RB [ \-remove-adjacent-corners ] .RB [ \-report-progress ] .RB [ \-debug-arch ] .RB [ \-debug-bitmap ] .RB [ \-tangent-surround .IR " int" ] .RB [ \-version ] .RB [ \-width-factor .IR " real" ] .I inputfile .SH DESCRIPTION The .I autotrace program accepts bitmap graphics from the file .I inputfile specified on the command line, and as output produces a collection of splines approximating the original image, the converting the image from bitmap to vector format. It behaves in a manner similar to the commercial software known as *tream*ine or *orel*race. The result is sent to standard output unless the .B \-output-file option is active. .SH OPTIONS Options can begin with either .B \-\- or .BR \- . Any unambiguous abbreviation can be used for the option name. Option names and values can be separated with either a space or equal sign (=). .TP .BI \-background-color " hexvalue" Employ the color specified by the hexadecimal code .I hexcode as the background that should be ignored, for example FFFFFF (default: no background color). .TP .B \-centerline Trace an object's centerline (default: employ its outline). .TP .BI \-color-count " int" Reduce the bitmap to using the number of colors specified by the unsigned integer .I int (range: 1-256). The default value of 0 indicates that no color reduction is to be done. Does not work with grayscale images. .TP .BI \-corner-always-threshold " angle" Consider any angle at a pixel which falls below the specified .I angle (in degrees) as a corner, even if it is bordered by other corner pixels (default: 60). .TP .BI \-corner-surround " int" Consider the specified number of pixels on either side of a point when determining if that point is a corner (default: 4). .TP .BI \-corner-threshold " angle" Consider any pixel which forms an angle with its predecessor(s) and successor(s) that is smaller than the specified .I angle (in degrees) as a corner (default: 100). .TP .BI \-despeckle-level " int" Employ the specified integer (range: 1-20) as the value for despeckling (default: no despeckling). .TP .BI \-despeckle-tightness " real" Employ the specified real number (range: 0.0-8.0) as the value for despeckle tightness (default: 2.0). .TP .BI \-dpi " int" The dots per inch value in the input image, affects scaling of mif output image. .TP .BI \-error-threshold " real" Subdivide fitted curves that are offset by a number of pixels exceeding the specified real number (default: 2.0). .TP .BI \-filter-iterations " int" Smooth the curve the specified number of times prior to fitting (default: 4). .TP .B \-help Print a help message and exit. .TP .BI \-input-format " format" Employ the specified input format, where .I format is one of: .RS .TP .BR BMP " (Windows bitmap format)" .TP .BR PBM " (Portable BitMap format)" .TP .BR PGM " (Portable Graymap format)" .TP .BR PNM " (Portable Anymap format)" .TP .BR PPM " (Portable Pixmap format)" .TP .BR TGA " (Targa format)" .RE .IP The supported input formats are determined when the application is built and depend upon the availability of other software (the .B \-list-input-formats command can be used to determine which are supported locally). .TP .BI \-line-reversion-threshold " real" When a spline is closer to a straight line than the specified real number weighted by the square of the curve length (default: .01), maintain it as a straight line, even if it is a list with curves. .TP .BI \-line-threshold " real" If a spline does not deviate from the straight line defined by its endpoints by more than the specified number of pixels, then treat it as a straight line (default: 1). .TP .B \-list-input-formats Send a list of the supported input formats to stderr. .TP .B \-list-output-formats Send a list of the supported output formats to stderr. .TP .B \-log Send a detailed progress report to the file .IR inputfile .log. .TP .BI \-output-file " file" Send the output to the specified file. .TP .BI \-output-format " format" Employ the specified output format, where .I format is one of: .RS .TP .BR ai "(Adobe Illustrator)" .TP .BR cgm "(Computer Graphics Metafile)" .TP .BR dr2d "(IFF DR2D format, used almost exclusively on Amiga platforms)" .TP .BR dxf "(AutoCAD Drawing Exchange format)" .TP .BR emf "(Windows Enhanced Metafile format)" .TP .BR epd "(Encapsulated Vectorial Graphics format)" .TP .BR eps "(Encapsulated \*(Ps)" .TP .BR er "(Elastic Reality Shape format)" .TP .BR fig "(\fIxfig\fP (1) 3.2)" .TP .BR mif "(FrameMaker MIF format)" .TP .BR pdf "(Portable Data Format)" .TP .BR p2e "(\fIpstoedit\fP (1) frontend)" .TP .BR sk "(Sketch)" .TP .BR svg "(Scalable Vector Graphics)" .TP .BR swf "(Shockwave Flash 3)" .RE .IP The supported output formats are determined when the application is built and depend upon the availability of other software (the .B \-list-output-formats command can be used to determine which are supported locally). .TP .B \-preserve-width Whether to preserve line width prior to thinning. .TP .B \-remove-adjacent-corners Remove adjacent corners. .TP .B \-report-progress Report tracing status in real time. .TP .B \-debug-arch Print the type of cpu. .TP .B \-debug-bitmap Dump loaded bitmap to .bitmap. .TP .BI \-tangent-surround " int" Consider the specified number of points to either side of a point when computing the tangent at that point (default: 3). .TP .B \-version Print the version number of the program and exit. .TP .BI \-width-factor " real" Weight factor for fitting the linewidth. .SH FILES .TP 2.2i /depot/bin/autotrace binary .SH "SEE ALSO" gimp(1), ImageMagick(1), pbm(1), pgm(1), pnm(1), ps2pdf(1), pstoedit(1), pstoepd(1), sketch(1), xfig(1), xv(1) .SH AUTHORS Martin Weber (martweb@gmx.net) .LP Manual page by R. P. C. Rodgers, Lister Hill National Center for Biomedical Communications, U.S. National Library of Medicine (rodgers@nlm.nih.gov). .\" end of man page autotrace-0.31.1/output-swf.c0000664000076400007640000000652407551363236011600 /* output-swf.c - output in SWF format Copyright (C) 1999, 2000, 2001 Kevin O' Gorman This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include "spline.h" #include "color.h" #include "output-swf.h" #include #define FPS 24.0 #define IMGID 1 #define IMGLAYER 1 #define SWFSCALE 20 static void out_splines (SWFMovie m, spline_list_array_type shape, int height) { unsigned this_list; color_type last_color = {0,0,0}; for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape); this_list++) { SWFShape k; unsigned this_spline; spline_list_type list = SPLINE_LIST_ARRAY_ELT (shape, this_list); spline_type first = SPLINE_LIST_ELT (list, 0); if (this_list == 0 || !COLOR_EQUAL(list.color, last_color)) { k = newSWFShape(); SWFShape_setRightFill(k, SWFShape_addSolidFill(k, list.color.r, list.color.g, list.color.b, 0xff)); last_color = list.color; } SWFShape_movePenTo(k, SWFSCALE*START_POINT(first).x, SWFSCALE*height - SWFSCALE*START_POINT(first).y); for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list); this_spline++) { spline_type s = SPLINE_LIST_ELT (list, this_spline); if (SPLINE_DEGREE(s) == LINEARTYPE) { SWFShape_drawLineTo(k, SWFSCALE*END_POINT(s).x, SWFSCALE*height - SWFSCALE*END_POINT(s).y); } else { SWFShape_drawCubicTo (k, SWFSCALE*CONTROL1(s).x, SWFSCALE*height - SWFSCALE*CONTROL1(s).y, SWFSCALE*CONTROL2(s).x, SWFSCALE*height - SWFSCALE*CONTROL2(s).y, SWFSCALE*END_POINT(s).x, SWFSCALE*height - SWFSCALE*END_POINT(s).y); } } SWFMovie_add(m,k); } } int output_swf_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data) { int width = urx - llx; int height = ury - lly; SWFMovie m; #ifdef _WINDOWS if(file == stdout) { fprintf(stderr, "This driver couldn't write to stdout!\n"); return -1; } #endif Ming_init(); Ming_setCubicThreshold(20000); m = newSWFMovie(); out_splines(m, shape, height); SWFMovie_setDimension(m, SWFSCALE*(float)width, SWFSCALE*(float)height); SWFMovie_setRate(m, FPS); SWFMovie_nextFrame(m); SWFMovie_output(m, fileOutputMethod, file); return 0; } autotrace-0.31.1/output-swf.h0000664000076400007640000000234007551363236011575 /* output-swf.h - output in SWF format Copyright (C) 1999, 2000, 2001 Kevin O' Gorman This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ /* Uses the Ming SWF library from http://www.opaque.net/ming/ */ #ifndef OUTPUTSWF_H #define OUTPUTSWF_H #include "output.h" int output_swf_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, at_spline_list_array_type shape, at_msg_func msg_func, at_address msg_data); #endif /* Not def: OUTPUTSWF_H */ autotrace-0.31.1/input-magick.h0000664000076400007640000000210107551363230012015 /* input-magick.h: import files via image magick Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ #ifndef INPUT_MAGICK_H #define INPUT_MAGICK_H #include "input.h" at_bitmap_type input_magick_reader (at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data); #endif /* not INPUT_MAGICK_H */ autotrace-0.31.1/input-magick.c0000664000076400007640000000570107557401615012027 /* input-magick.c: import files via image magick Copyright (C) 1999, 2000, 2001 Martin Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser 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. */ /* This code was tested with ImageMagick 5.2.1-5.5.2 it doesn't work with earlier versions */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Def: HAVE_CONFIG_H */ #include #include #include #include /* Needed for correct interpretation of magick/api.h */ #include #include "input-magick.h" #include "bitmap.h" at_bitmap_type input_magick_reader(at_string filename, at_input_opts_type * opts, at_msg_func msg_func, at_address msg_data) { Image *image = NULL; ImageInfo *image_info; ImageType image_type; unsigned int i,j,point,np,runcount; at_bitmap_type bitmap; PixelPacket p; PixelPacket *pixel=&p; ExceptionInfo exception; #if (MagickLibVersion < 0x0538) MagickIncarnate(""); #else InitializeMagick(""); #endif GetExceptionInfo(&exception); image_info=CloneImageInfo((ImageInfo *) NULL); (void) strcpy(image_info->filename,filename); image_info->antialias = 0; image=ReadImage(image_info,&exception); if (image == (Image *) NULL) { #if (MagickLibVersion <= 0x0525) /* MagickError(exception.severity,exception.message,exception.qualifier); */ if (msg_func) msg_func (exception.qualifier, AT_MSG_FATAL, msg_data); goto cleanup; #else /* MagickError(exception.severity,exception.reason,exception.description); */ if (msg_func) msg_func (exception.reason, AT_MSG_FATAL, msg_data); goto cleanup; #endif } #if (MagickLibVersion < 0x0540) image_type=GetImageType(image); #else image_type=GetImageType(image, &exception); #endif if(image_type == BilevelType || image_type == GrayscaleType) np=1; else np=3; bitmap = at_bitmap_init(NULL, image->columns, image->rows, np); for(j=0,runcount=0,point=0;jrows;j++) for(i=0;icolumns;i++) { p=GetOnePixel(image,i,j); AT_BITMAP_BITS(bitmap)[point++]=pixel->red; /* if gray: red=green=blue */ if(np==3) { AT_BITMAP_BITS(bitmap)[point++]=pixel->green; AT_BITMAP_BITS(bitmap)[point++]=pixel->blue; } } DestroyImage(image); cleanup: DestroyImageInfo(image_info); return(bitmap); } autotrace-0.31.1/autotrace-config.af0000664000076400007640000000061107551363216013026 ## ## Initialize names ## AF_INIT(autotrace) ## ## Available options ## AF_ARG_DIR(prefix,@prefix@) AF_ARG_DIR(exec_prefix,@exec_prefix@) AF_ARG_VERSION(@VERSION@) ## ## Libraries ## #dummy because this should always be selected AF_LIBRARY(autotrace) AF_DEF_CFLAGS([-I@includedir@]) AF_DEF_LIBS([-L@libdir@ -lautotrace @LIBPNG_LDFLAGS@ @MAGICK_LDFLAGS@ @LIBSWF_LDFLAGS@ @LIBPSTOEDIT_LIBS@]) autotrace-0.31.1/autotrace.dsp0000664000076400007640000002445107555510712011772 # Microsoft Developer Studio Project File - Name="autotrace" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=autotrace - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "autotrace.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "autotrace.mak" CFG="autotrace - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "autotrace - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "autotrace - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "autotrace - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "autotrace___Win32_Release" # PROP BASE Intermediate_Dir "autotrace___Win32_Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "autotrace___Win32_Release" # PROP Intermediate_Dir "autotrace___Win32_Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /W3 /Gm /GX /Zi /O2 /I "C:\ImageMagick-5.3.4" /I "C:\ming-0.2a" /I "C:\pstoedit-3.32" /D "WIN32" /D "_WINDOWS" /D "_VISUALC_" /D "NeedFunctionPrototypes" /D "HAVE_MAGICK" /D AUTOTRACE_VERSION=\"0.31\" /D "HAVE_LIBSWF" /D inline=__inline /D "_MAGICKDLL_" /D "HAVE_LIBPSTOEDIT" /Fp"autotrace___Win32_Release/autotraceexe.pch" /YX /FD /D AUTOTRACE_WEB=\""http://autotrace.sourceforge.net"\" /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 CORE_RL_magick_.lib libming.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib pstoedit.lib /nologo /subsystem:console /machine:I386 /libpath:"C:\ImageMagick-5.3.4\VisualMagick\lib\\" /libpath:"C:\ming-0.2a\Release" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "autotrace - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "autotrace___Win32_Debug" # PROP BASE Intermediate_Dir "autotrace___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "autotrace___Win32_Debug" # PROP Intermediate_Dir "autotrace___Win32_Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "C:\ImageMagick-5.3.4" /I "C:\ming-0.2a" /I "C:\pstoedit-3.32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_VISUALC_" /D "NeedFunctionPrototypes" /D "HAVE_MAGICK" /D AUTOTRACE_VERSION=\"0.31\" /D "HAVE_LIBSWF" /D inline=__inline /D "_MAGICKDLL_" /D "HAVE_LIBPSTOEDIT" /FD /D AUTOTRACE_WEB=\""http://autotrace.sourceforge.net"\" /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libming.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib CORE_DB_magick_.lib pstoedit.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"C:\ImageMagick-5.3.4\VisualMagick\lib\\" /libpath:"C:\ming-0.2a\Debug" !ENDIF # Begin Target # Name "autotrace - Win32 Release" # Name "autotrace - Win32 Debug" # Begin Source File SOURCE=.\atou.c # End Source File # Begin Source File SOURCE=.\atou.h # End Source File # Begin Source File SOURCE=.\autotrace.c # End Source File # Begin Source File SOURCE=.\autotrace.h # End Source File # Begin Source File SOURCE=.\bitmap.c # End Source File # Begin Source File SOURCE=.\bitmap.h # End Source File # Begin Source File SOURCE=.\cmdline.h # End Source File # Begin Source File SOURCE=.\color.c # End Source File # Begin Source File SOURCE=.\color.h # End Source File # Begin Source File SOURCE=.\curve.c # End Source File # Begin Source File SOURCE=.\curve.h # End Source File # Begin Source File SOURCE=.\despeckle.c # End Source File # Begin Source File SOURCE=.\despeckle.h # End Source File # Begin Source File SOURCE=".\epsilon-equal.c" # End Source File # Begin Source File SOURCE=".\epsilon-equal.h" # End Source File # Begin Source File SOURCE=.\exception.c # End Source File # Begin Source File SOURCE=.\exception.h # End Source File # Begin Source File SOURCE=.\filename.c # End Source File # Begin Source File SOURCE=.\filename.h # End Source File # Begin Source File SOURCE=.\fit.c # End Source File # Begin Source File SOURCE=.\fit.h # End Source File # Begin Source File SOURCE=.\getopt.c # End Source File # Begin Source File SOURCE=.\getopt.h # End Source File # Begin Source File SOURCE=.\getopt1.c # End Source File # Begin Source File SOURCE=".\image-header.h" # End Source File # Begin Source File SOURCE=".\image-proc.c" # End Source File # Begin Source File SOURCE=".\image-proc.h" # End Source File # Begin Source File SOURCE=".\input-bmp.c" # End Source File # Begin Source File SOURCE=".\input-bmp.h" # End Source File # Begin Source File SOURCE=".\input-magick.c" # End Source File # Begin Source File SOURCE=".\input-magick.h" # End Source File # Begin Source File SOURCE=".\input-pnm.c" # End Source File # Begin Source File SOURCE=".\input-pnm.h" # End Source File # Begin Source File SOURCE=".\input-tga.c" # End Source File # Begin Source File SOURCE=".\input-tga.h" # End Source File # Begin Source File SOURCE=.\input.c # End Source File # Begin Source File SOURCE=.\input.h # End Source File # Begin Source File SOURCE=.\logreport.c # End Source File # Begin Source File SOURCE=.\logreport.h # End Source File # Begin Source File SOURCE=.\main.c # End Source File # Begin Source File SOURCE=.\median.c # End Source File # Begin Source File SOURCE=.\message.h # End Source File # Begin Source File SOURCE=".\output-cgm.c" # End Source File # Begin Source File SOURCE=".\output-cgm.h" # End Source File # Begin Source File SOURCE=".\output-dr2d.c" # End Source File # Begin Source File SOURCE=".\output-dr2d.h" # End Source File # Begin Source File SOURCE=".\output-dxf.c" # End Source File # Begin Source File SOURCE=".\output-dxf.h" # End Source File # Begin Source File SOURCE=".\output-emf.c" # End Source File # Begin Source File SOURCE=".\output-emf.h" # End Source File # Begin Source File SOURCE=".\output-epd.c" # End Source File # Begin Source File SOURCE=".\output-epd.h" # End Source File # Begin Source File SOURCE=".\output-eps.c" # End Source File # Begin Source File SOURCE=".\output-eps.h" # End Source File # Begin Source File SOURCE=".\output-er.c" # End Source File # Begin Source File SOURCE=".\output-er.h" # End Source File # Begin Source File SOURCE=".\output-fig.c" # End Source File # Begin Source File SOURCE=".\output-fig.h" # End Source File # Begin Source File SOURCE=".\output-mif.c" # End Source File # Begin Source File SOURCE=".\output-mif.h" # End Source File # Begin Source File SOURCE=".\output-p2e.c" # End Source File # Begin Source File SOURCE=".\output-p2e.h" # End Source File # Begin Source File SOURCE=".\output-pdf.c" # End Source File # Begin Source File SOURCE=".\output-pdf.h" # End Source File # Begin Source File SOURCE=".\output-pstoedit.c" # End Source File # Begin Source File SOURCE=".\output-pstoedit.h" # End Source File # Begin Source File SOURCE=".\output-sk.c" # End Source File # Begin Source File SOURCE=".\output-sk.h" # End Source File # Begin Source File SOURCE=".\output-svg.c" # End Source File # Begin Source File SOURCE=".\output-svg.h" # End Source File # Begin Source File SOURCE=".\output-swf.c" # End Source File # Begin Source File SOURCE=".\output-swf.h" # End Source File # Begin Source File SOURCE=.\output.c # End Source File # Begin Source File SOURCE=.\output.h # End Source File # Begin Source File SOURCE=.\ptypes.h # End Source File # Begin Source File SOURCE=".\pxl-outline.c" # End Source File # Begin Source File SOURCE=".\pxl-outline.h" # End Source File # Begin Source File SOURCE=.\quantize.h # End Source File # Begin Source File SOURCE=.\spline.c # End Source File # Begin Source File SOURCE=.\spline.h # End Source File # Begin Source File SOURCE=.\strgicmp.c # End Source File # Begin Source File SOURCE=.\strgicmp.h # End Source File # Begin Source File SOURCE=".\thin-image.c" # End Source File # Begin Source File SOURCE=".\thin-image.h" # End Source File # Begin Source File SOURCE=.\types.h # End Source File # Begin Source File SOURCE=.\vector.c # End Source File # Begin Source File SOURCE=.\vector.h # End Source File # Begin Source File SOURCE=.\xstd.c # End Source File # Begin Source File SOURCE=.\xstd.h # End Source File # End Target # End Project autotrace-0.31.1/autotrace.dsw0000664000076400007640000000103507551363251011772 Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELSCHT WERDEN! ############################################################################### Project: "autotrace"=".\autotrace.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### autotrace-0.31.1/autotrace.m40000664000076400007640000001450407551363234011523 # a macro to get the libs/cflags for libautotrace # Copyed from gdk-pixbuf.m4 dnl AM_PATH_AUTOTRACE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Test to see if libautotrace is installed, and define AUTOTRACE_CFLAGS, LIBS dnl AC_DEFUN(AM_PATH_AUTOTRACE, [dnl dnl Get the cflags and libraries from the autotrace-config script dnl AC_ARG_WITH(autotrace-prefix,[ --with-autotrace-prefix=PFX Prefix where Autotrace is installed (optional)], autotrace_prefix="$withval", autotrace_prefix="") AC_ARG_WITH(autotrace-exec-prefix,[ --with-autotrace-exec-prefix=PFX Exec prefix where Autotrace is installed (optional)], autotrace_exec_prefix="$withval", autotrace_exec_prefix="") AC_ARG_ENABLE(autotracetest, [ --disable-autotracetest Do not try to compile and run a test Autotrace program], , enable_autotracetest=yes) if test x$autotrace_exec_prefix != x ; then autotrace_args="$autotrace_args --exec_prefix=$autotrace_exec_prefix" if test x${AUTOTRACE_CONFIG+set} != xset ; then AUTOTRACE_CONFIG=$autotrace_exec_prefix/bin/autotrace-config fi fi if test x$autotrace_prefix != x ; then autotrace_args="$autotrace_args --prefix=$autotrace_prefix" if test x${AUTOTRACE_CONFIG+set} != xset ; then AUTOTRACE_CONFIG=$autotrace_prefix/bin/autotrace-config fi fi AC_PATH_PROG(AUTOTRACE_CONFIG, autotrace-config, no) min_autotrace_version=ifelse([$1], ,0.30.1,$1) AC_MSG_CHECKING(for AUTOTRACE - version >= $min_autotrace_version) no_autotrace="" if test "$AUTOTRACE_CONFIG" = "no" ; then no_autotrace=yes else AUTOTRACE_CFLAGS=`$AUTOTRACE_CONFIG $autotrace_args --cflags` AUTOTRACE_LIBS=`$AUTOTRACE_CONFIG $autotrace_args --libs` autotrace_major_version=`$AUTOTRACE_CONFIG $autotrace_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` autotrace_minor_version=`$AUTOTRACE_CONFIG $autotrace_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` autotrace_micro_version=`$AUTOTRACE_CONFIG $autotrace_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_autotracetest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $AUTOTRACE_CFLAGS" LIBS="$AUTOTRACE_LIBS $LIBS" dnl dnl Now check if the installed AUTOTRACE is sufficiently new. (Also sanity dnl checks the results of autotrace-config to some extent dnl rm -f conf.autotracetest AC_TRY_RUN([ #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main () { int major, minor, micro; char *tmp_version; system ("touch conf.autotracetest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_autotrace_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_autotrace_version"); exit(1); } if (($autotrace_major_version > major) || (($autotrace_major_version == major) && ($autotrace_minor_version > minor)) || (($autotrace_major_version == major) && ($autotrace_minor_version == minor) && ($autotrace_micro_version >= micro))) { return 0; } else { printf("\n*** 'autotrace-config --version' returned %d.%d.%d, but the minimum version\n", $autotrace_major_version, $autotrace_minor_version, $autotrace_micro_version); printf("*** of AUTOTRACE required is %d.%d.%d. If autotrace-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If autotrace-config was wrong, set the environment variable AUTOTRACE_CONFIG\n"); printf("*** to point to the correct copy of autotrace-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_autotrace=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_autotrace" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$AUTOTRACE_CONFIG" = "no" ; then echo "*** The autotrace-config script installed by AUTOTRACE could not be found" echo "*** If AUTOTRACE was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the AUTOTRACE_CONFIG environment variable to the" echo "*** full path to autotrace-config." else if test -f conf.autotracetest ; then : else echo "*** Could not run AUTOTRACE test program, checking why..." CFLAGS="$CFLAGS $AUTOTRACE_CFLAGS" LIBS="$LIBS $AUTOTRACE_LIBS" AC_TRY_LINK([ #include #include ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding AUTOTRACE or finding the wrong" echo "*** version of AUTOTRACE. If it is not finding AUTOTRACE, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means AUTOTRACE was incorrectly installed" echo "*** or that you have moved AUTOTRACE since it was installed. In the latter case, you" echo "*** may want to edit the autotrace-config script: $AUTOTRACE_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi AUTOTRACE_CFLAGS="" AUTOTRACE_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(AUTOTRACE_CFLAGS) AC_SUBST(AUTOTRACE_LIBS) rm -f conf.autotracetest ])autotrace-0.31.1/shape_cubic.c.diff0000664000076400007640000000035307551363247012613 --- shape_cubic.c.old Fri Aug 17 18:06:16 2001 +++ shape_cubic.c Mon Nov 26 21:13:48 2001 @@ -1,6 +1,7 @@ #include #include "shape_util.h" +#include "libming.h" extern int Ming_cubicThreshold; extern float Ming_scale; autotrace-0.31.1/README.MING0000664000076400007640000000074407551363365010711 For Visual C++ user: If you want swf support you have to get Ming at http://www.opaque.net/ming/. You'll get an unresolved symbol when linking to the ming library with using Visual C++. In Ming-0.2a shape_cubic.c has to be patched(shape_cubic.c.diff). Project files for Visual C++ 6.0 you can find in this directory(libming.dps, libming.dsw). The patch is already reported to the ming author. The next version of MING will contain this patch. Martin Weber and Masatake YAMATO autotrace-0.31.1/libming.dsw0000664000076400007640000000103007551363372011423 Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "libswf"=.\libming.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### autotrace-0.31.1/libming.dsp0000664000076400007640000002414307551363372011426 # Microsoft Developer Studio Project File - Name="libming" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=libming - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "libming.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "libming.mak" CFG="libming - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "libming - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "libming - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "libming - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D inline=__inline /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" /l 0.907 # ADD RSC /l 0x407 /d "NDEBUG" /l 0.907 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ELSEIF "$(CFG)" == "libming - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D inline=__inline /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" /l 0.907 # ADD RSC /l 0x407 /d "_DEBUG" /l 0.907 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ENDIF # Begin Target # Name "libming - Win32 Release" # Name "libming - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\action.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\action.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\bitmap.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\bitmap.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\block.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\block.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocklist.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocklist.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\blocktypes.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocktypes.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\browserfont.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\browserfont.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\button.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\button.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\character.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\character.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\cxform.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\cxform.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\dbl.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\dbl.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\displaylist.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\displaylist.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\error.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\error.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\fill.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\fill.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\fillstyle.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\fillstyle.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\font.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\font.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\fontinfo.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\fontinfo.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\gradient.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\gradient.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\input.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\input.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\jpeg.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\jpeg.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\libswf.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\libming.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\linestyle.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\linestyle.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\loadfont.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\matrix.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\matrix.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\method.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\method.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\ming.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\ming.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\morph.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\morph.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\movie.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\movie.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\movieclip.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\movieclip.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\mp3.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\output.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\output.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\outputblock.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\outputblock.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\placeobject.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\position.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\position.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\rect.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\rect.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\shape.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\shape.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\shape_cubic.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\shape_util.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\shape_util.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\sound.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\sound.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\soundstream.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\soundstream.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\sprite.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\sprite.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\swf.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\text.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\text.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\text_util.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\text_util.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\textfield.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\textfield.h" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\ttffont.c" # End Source File # Begin Source File SOURCE="..\..\ming-0.2a\src\blocks\ttffont.h" # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE="..\..\ming-0.2a\mingpp.h" # End Source File # End Group # End Target # End Project autotrace-0.31.1/autotrace.sln0000664000076400007640000000160107551363251011770 Microsoft Visual Studio Solution File, Format Version 7.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "autotrace", "autotrace.vcproj", "{E13CA74B-A192-4205-AEA0-5E945C269210}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution ConfigName.0 = Debug ConfigName.1 = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {E13CA74B-A192-4205-AEA0-5E945C269210}.Debug.ActiveCfg = Debug|Win32 {E13CA74B-A192-4205-AEA0-5E945C269210}.Debug.Build.0 = Debug|Win32 {E13CA74B-A192-4205-AEA0-5E945C269210}.Release.ActiveCfg = Release|Win32 {E13CA74B-A192-4205-AEA0-5E945C269210}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal autotrace-0.31.1/autotrace.vcproj0000664000076400007640000002211307555511356012505 autotrace-0.31.1/libming.sln0000664000076400007640000000162207551363372011431 Microsoft Visual Studio Solution File, Format Version 7.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libming", "libming.vcproj", "{1D57886B-1B51-4B79-BBAC-D3830939CE67}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution ConfigName.0 = Debug ConfigName.1 = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {1D57886B-1B51-4B79-BBAC-D3830939CE67}.Debug.ActiveCfg = Debug|Win32 {1D57886B-1B51-4B79-BBAC-D3830939CE67}.Debug.Build.0 = Debug|Win32 {1D57886B-1B51-4B79-BBAC-D3830939CE67}.Release.ActiveCfg = Release|Win32 {1D57886B-1B51-4B79-BBAC-D3830939CE67}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal autotrace-0.31.1/libming.vcproj0000664000076400007640000002161007551363373012140 autotrace-0.31.1/HACKING0000664000076400007640000001425007555433464010266 -*- text -*- Notes for autotrace developers * Autotools Versions I (Masatake) am using: autoconf --version autoconf (GNU Autoconf) 2.53 automake --version automake (GNU automake) 1.5 libtool --version ltmain.sh (GNU libtool) 1.4.2 (1.922.2.53 2001/09/11 03:18:52) However config.guess of 1.5 that is part of automake is broken, therefore I'm replacing it with ./config.guess --version GNU config.guess (2002-07-23) when releasing. * AM_PATH_PSTOEDIT AM_PATH_PSTOEDIT is m4 macro defined in pstoedit.m4. pstoedit.m4 will be in pstoedit-3.33. However, it is not released yet(Wed Sep 25 04:43:36 2002). You can get pstoedit.m4 from http://autotrace.sourceforge.net/tools/. (You need pstoedit.m4 if you want to build autotrace from CVS sources.) * How to release (0) Update NEWS file (1) Check and/or set Version number in configure.in (2) CVS tagging (3) sourceforge(http://sourceforge.net/docman/display_doc.php?docid=781&group_id=1) * Shared library We use libtool to manage our shared library, libautotrace.so. First of all, read "Versioning" section of libtool info manual. Especially "Libtool versioning" and "Updating library version information" subsections are important. I quote the most important blocks here: ==================================== CURRENT The most recent interface number that this library implements. REVISION The implementation number of the CURRENT interface. AGE The difference between the newest and oldest interfaces that this library implements. In other words, the library implements all the interface numbers in the range from number `CURRENT - AGE' to `CURRENT'. If two libraries have identical CURRENT and AGE numbers, then the dynamic linker chooses the library with the greater REVISION number. --- Libtool versioning Here are a set of rules to help you update your library version information: 1. Start with version information of `0:0:0' for each libtool library. 2. Update the version information only immediately before a public release of your software. More frequent updates are unnecessary, and only guarantee that the current interface number gets larger faster. 3. If the library source code has changed at all since the last update, then increment REVISION (`C:R:A' becomes `C:r+1:A'). 4. If any interfaces have been added, removed, or changed since the last update, increment CURRENT, and set REVISION to 0. 5. If any interfaces have been added since the last public release, then increment AGE. 6. If any interfaces have been removed since the last public release, then set AGE to 0. ---Updating library version information ==================================== * CVS See http://sourceforge.net/cvs/?group_id=11789 The module name is autotrace. After checking out the codes, invoke autogen.sh in the distribution. That generates configure.in, Makefile.in and so on. autogen.sh invokes automake, autoconf, aclocal and autofig. * Autofig Autofig generate autotrace-config.in from autotrace-config.af. You can get autofig from: http://autotrace.sourceforge.net/tools/ You can get the LATEST version of autofig. http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&dir=autofig * Library See README * Tag naming scheme CVS tag for version X.Y: RELEASE_X_Y. CVS tag for version X.YpreN: PRERELEASE_X_Y_N. Branch for version X.Y: TOWARD_version X.Y. If you need to put a tag after putting a tag, RELEASE_X_Y, for minor modification, POSTRELEASE_X_Y_N. * Tools for debugging output eps: ghostscript, Illustrator, CorelDraw sk: sketch emf: CorelDraw, Illustrator, StarOffice, OpenOffice and Microsoft Office. svg: sodipodi, CorelDraw, Illustrator, Adobe SVGViewer ai: Illustrator, CorelDraw pdf: ghostscript, xpdf, acrobat, Illustrator fig: xfig er: Elastic Reality dxf: AutoCAD, VoloView epd: pstoepd, txt2pdf, epd2svg mif: FrameMaker dr2d: visit http://uk.amigasoc.org/asearch and enter a search string of "DR2D". * Web page From sourceforge.org: 5. Setup your group's web site. I'll assume that you have some sort of web page or site built already that you wish to put up on SourceForge to give your group a public face. Login to SourceForge using SSH, for example ; ssh -l loginname yourproject.sourceforge.net you will now be in your home directory. All group files are stored in a directory structure for each project. The group directory structure is split out by the first, then first and second, letters of the project name. From here all group files are stored in /home/groups/y/yo/yourproject. Change to this directory. All your web pages are stored in the htdocs directory. Going in here will contain index.php, which is a blank page that says you haven't uploaded a web page yet. Logout, and copy the files for your web page using scp, a program which comes with ssh. For example: scp localfile loginname@yourproject.sourceforge.net:/home/groups/y/yo/yourproject/htdocs/ I suggest you gzip up your site, send it in one go using scp, then login with ssh and gunzip it. So what should be on the web page ? Perhaps you'd like the following, as well as your project's information ; 1.A link to the projects group page on SourceForge. 2.Mailing list links (we'll create them in a second) 3.A SourceForge icon and web counter - see the site documentation for this. 4.A link to the CVS web interface at http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/?cvsroot=yourproject 5.Some info about using CVS specific to your project. 6.Setup mailing lists for your project. If your project isn't that active yet (or only has one lonely developer) your mailing lists will be very quiet, however I still suggest you look to the future and setup three standard lists for your project: a devel list for developers, a users list for users, and an announce list for new version announcements. Do this via your group page using the mailing list admin link. Its quite simple so you shouldn't have any problems... autotrace-0.31.1/FAQ0000664000076400007640000000510307562766302007624 These are collections of "Question and Answers", originally posted to autotrace mailing list. Some of these are not "Frequently" but are worth to be known. Q1. Using Windows you type autotrace -help you only see the last 25 lines, so how could we check that the user can read the whole help text? (Martin Weber ) A1. For NT-based Windows systems (WinNT, Win2000, XP), it's possible to activate scrolling for the console window (DOS prompt). Just do a right click on the title bar of the window, -> preferences -> layout, and increase the buffer size. This don't work for Win9x. I don't know if it works for WinME. (Manfred Schwarb ) Q2. Why configure checks pstoedit twice? First you are checking checking for PSTOEDIT - version >= 3.32.1... no and then checking for PSTOEDIT - version >= 3.32.0... yes why not checking for PSTOEDIT - version == 3.32.0... yes instead? (Martin Weber ) A2. We have to detect one of the three states: 1. We don't have pstoedit or have pstoedit older than 3.32. -- We should not build pstoedit output functions. 2. We have pstoedit 3.32. -- pstoedit-config in 3.32 has some bugs. workaround macros must be enabled. 3. We have pstoedit 3.33. or higher -- The workaround macros must be disabled. I sent patches that fixes the bugs to the author of pstoedit. So the pstoedit-config in 3.33 will not have the bugs. So, configure checks pstoedit twice. autotrace.m4 has only '>=' version checking. It doesn't have == or > version checking. (In other hand, PKG_CHECK_MODULES has such version checking.) I don't want to extend autotrace.m4 anymore. It will cause bugs. (Masatake YAMATO) Q3. Does autotrace could be built on MacOSX? (Many people) A3. Yes. I tested on sourceforge's compilefarm. libtool shows a strange warning but autotrace could be built and run. (Masatake YAMATO) Q4. Is there autotrace GUI runs on Windows? Is it possible to port frontline, gnome based GUI, to Windows? (Many people) A4. There is no GUI that runs on Windows. frontline highly depends on libgnomeui, so if libgnomeui is ported, porting frontline to windows might be easy task. If you consider to write a GUI for frontline running on Windows, it is worth to consider using Qt. rob@mediasolution.it might have some interests. Read the archive of autotrace mailing list. I, the author of frontline, am using GNU/Linux only, so I don't have much interests in porting. (Masatake YAMATO) autotrace-0.31.1/autotrace.spec0000664000076400007640000000345007563015112012123 Summary: Program for converting bitmaps to vector graphics Name: autotrace Version: 0.31.1 Release: 1 Url: http://autotrace.sourceforge.net Source: %{name}-%{version}.tar.gz Copyright: GPL and LGPL Group: Applications/Graphics BuildRoot: %{_tmppath}/%{name}-root %description AutoTrace is a program for converting bitmaps to vector graphics. The aim of the AutoTrace project is the development of a freely-available application similar to CorelTrace or Adobe Streamline. In some aspects it is already better. Originally being created as a plugin for the GIMP, AutoTrace is now a standalone program and can be compiled on any UNIX platform using GCC. %prep %setup -q %build %configure --without-magick --without-pstoedit make %install rm -rf $RPM_BUILD_ROOT make prefix=$RPM_BUILD_ROOT/usr/ install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc AUTHORS COPYING COPYING.LIB ChangeLog NEWS README %doc /usr/man/man1/autotrace.1.* /usr/include/autotrace/autotrace.h /usr/lib/pkgconfig/autotrace.pc /usr/include/autotrace/types.h /usr/lib/libautotrace.* /usr/include/autotrace/exception.h /usr/include/autotrace/input.h /usr/include/autotrace/output.h /usr/share/aclocal/autotrace.m4 /usr/bin/autotrace-config /usr/bin/autotrace %changelog * Wed Oct 23 2002 Masatake YAMATO - make disabled magick and pstoedit. * Tue Jul 9 2002 Masatake YAMATO - Supported shared library and bzip'ed manual. * Sun May 12 2002 Masatake YAMATO - Install output.h. * Tue Apr 16 2002 Masatake YAMATO - Added LGPL to Copyright * Wed Apr 3 2002 Masatake YAMATO - autotrace.1 -> autotrace.1.gz * Thu Mar 7 2002 Masatake YAMATO - Change %description. - Update files. * Thu Feb 21 2002 Han-Wen Nienhuys - Initial build.