diff --git a/reactos/lib/freetype/ChangeLog b/reactos/lib/freetype/ChangeLog index 04a32960137..86c6fac670b 100644 --- a/reactos/lib/freetype/ChangeLog +++ b/reactos/lib/freetype/ChangeLog @@ -1,1501 +1,13 @@ -2003-02-03 Werner Lemberg - - * include/freetype/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): - Initialize `node'. - * src/type1/t1load.c (parse_dict): Initialize `have_integer'. - -2003-02-02 Werner Lemberg - - * src/type1/t1load.c (parse_dict): Handle `RD' and `-|' commands - outside of /Subrs or /CharStrings. This can happen if there is - additional code manipulating those two arrays so that FreeType - doesn't recognize them properly. - (T1_Open_Face): Improve an error message. - -2004-02-01 Werner Lemberg - - * src/type1/t1load.c (parse_charstrings): Exit immediately if - there are no elements in /CharStrings. This is needed for fonts - like Optima-Oblique which not only define /CharStrings but access it - also. - -2004-02-01 David Turner - - * src/sfnt/Jamfile: Removing `ttcmap' from the list of sources. - - * include/freetype/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP) - : Provide macro version which doesn't use inline code. - * include/freetype/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP) - : Ditto. - Use FTC_MRULIST_LOOKUP_CMP. - * include/freetype/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): New - macro. - (FTC_MRULIST_LOOKUP): Use it. - - * src/cache/Jamfile (_sources), src/cache/descrip.mms: Updated. - * src/cache/ftcbasic.c: Fix compiler warnings. - * src/cache/ftcmanag.c (FTC_Manager_LookupSize, - FTC_Manager_LookupFace) : Use FTC_MRULIST_LOOKUP_CMP. - * src/cache/ftcmru.c (FTC_MruList_Find): Fix a bug (found after - heavy testing). - - * Jamfile: Updating `refdoc' target, and adding `autohint' to the - list of modules to build. Both the autohinter and autofitter will - be built by default. But which one will be used is determined by - the content of `ftmodule.h'. - - * src/autofit/*: Many updates, but the code is still buggy... - -2004-01-31 Werner Lemberg - - * src/cff/cffgload.c (cff_operator_seac): Fix magnitude of - accent offset. - Update code similarly to the seac support for Type 1 fonts. - (cff_decoder_parse_charstrings) : Fix magnitude - of accent offset. - Don't hint glyphs twice if seac is emulated. - : Assign correct point tags. - * docs/CHANGES: Updated. - -2004-01-30 Werner Lemberg - - * src/type1/t1parse.c (T1_Get_Private_Dict): Use FT_MEM_MOVE, not - FT_MEM_COPY, for copying the private dict. - - * src/type1/t1load.c (parse_subrs): Assign number of subrs only - in first run. - (parse_charstrings): Parse /CharStrings in second run without - assigning values. - (parse_dict): Skip all /CharStrings arrays but the first. We need - this for non-standard fonts like `Optima' which have different - outlines depending on the resolution. Note that there is no - guarantee that we get fitting /Subrs and /CharStrings arrays; this - can only be done by a real PS interpreter. - -2004-01-29 Antoine Leca - - * builds/win32/visualc/index.html: New file, giving detailed - explanations about forcing CR+LF line endings for the VC++ project - files. - -2004-01-22 Garrick Meeker - - * src/cff/cffload.c (cff_subfont_load): Initialize `dict'. - -2004-01-22 Werner Lemberg - - Add support for the hexadicimal representation of binary data - started with `StartData' in CID-keyed Type 1 fonts. - - * include/freetype/internal/t1types.h (CID_FaceRec): Add new - members `binary_data' and `cid_stream'. - - * src/cid/cidload.c (cid_read_subrs): Use `face->cid_stream'. - (cid_hex_to_binary): New auxiliary function. - (cid_face_open): Add new argument `face_index' to return quickly - if less than zero. Updated all callers. - Call `cid_hex_to_binary', then open and assign memory stream to - `face->cid_stream' if `parser->binary_length' is non-zero. - * src/cid/cidload.h: Updated. - - * src/cid/cidobjs.c (cid_face_done): Free `binary_data' and - `cid_stream'. - - * src/cid/cidparse.c (cid_parser_new): Check arguments to - `StartData' and set parser->binary_length accordingly. - * src/cid/cidparse.h (CID_Parser): New member `binary_length'. - - * src/cid/cidgload.c (cid_load_glyph): Use `face->cid_stream'. - - * docs/CHANGES: Updated. - -2004-01-21 Werner Lemberg - - include/freetype/config/ftstdlib.h (ft_atoi): Replaced with... - (ft_atol): This. - * src/base/ftdbgmem.c: s/atol/ft_atol/. - * src/type42/t42drivr.c: s/ft_atoi/ft_atol/. - -2004-01-20 Masatake YAMATO - - * include/freetype/ftcache.h: Delete duplicated definition of - FTC_FaceID. - - * src/cff/cffdrivr.c (cff_get_cmap_info): Call sfnt module's TT CMap - Info service function if the cmap comes from sfnt. Return 0 if the - cmap is sythesized in cff module. - -2004-01-20 David Turner - - * src/cache/ftcmanag.c (ftc_size_node_compare): Call - FT_Activate_Size. - -2004-01-20 Werner Lemberg - - * src/type1/t1parse.c (T1_Get_Private_Dict): Skip exactly one - CR, LF, or CR/LF after `eexec'. - -2004-01-18 David Turner - - * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Remove compiler - warning. - - * src/tools/docmaker/*: Updating beautifier tool. - -2004-01-15 David Turner - - * src/base/ftoutln.c (ft_orientation_extremum_compute): Fix - infinite loop bug. - - * include/freetype/ftstroke.h: Include FT_GLYPH_H. - (FT_Stroker_Rewind, FT_Glyph_Stroke, FT_Glyph_StrokeBorder): New - declarations. - - * src/base/ftstroke.c: Include FT_INTERNAL_OBJECTS_H. - (FT_Outline_GetOutsideBorder): Inverse result. - (FT_Stroker_Rewind, FT_Glyph_Stroke, FT_GlyphStrokeBorder): New - functions. - (FT_Stroker_EndSubPath): Close path if needed. - (FT_Stroker_Set, FT_Stroker_ParseOutline): Use FT_Stroker_Rewind. - - * include/freetype/cache/ftcmanag.h (FTC_ScalerRec, - FTC_Manager_LookupSize): Moved to... - * include/freetype/ftcache.h (FTC_ScalerRec, - FTC_Manager_LookupSize): Here. - - * src/tools/docmaker/docbeauty.py: New file to beautify the - documentation comments (e.g., to convert them to single block border - mode). - * src/tools/docmaker/docmaker.py (file_exists, make_file_list): - Moved to... - * src/tools/docmaker/utils.py (file_exists, make_file_list): Here. - -2004-01-14 David Turner - - * include/freetype/internal/ftmemory.h (FT_ARRAY_COPY, - FT_ARRAY_MOVE): New macros to make copying arrays easier. - Updated all relevant code to use them. - -2004-01-14 Werner Lemberg - - * src/cff/cffload.c (cff_font_load): Load charstrings_index earlier. - Use number of charstrings as argument to CFF_Load_FD_Select (as - documented in the CFF specs). - -2004-01-13 Graham Asher - - * src/pshinter/pshalgo.c (psh_glyph_init): Move assignment of - `glyph->memory' up to free arrays properly in case of failure. - -2004-01-10 Masatake YAMATO - - Make `FT_Get_CMap_Language_ID' work with CFF. Bug reported by - Steve Hartwell . - - * src/cff/cffdrivr.c: Include FT_SERVICE_TT_CMAP_H. - (cff_services): Added an entry for FT_SERVICE_ID_TT_CMAP. - (cff_get_cmap_info): New function. - (cff_service_get_cmap_info) New entry for cff_services. - - * src/sfnt/ttcmap0.c: Exit loop after a format match has been found. - Suggested by Steve Hartwell . - -2004-01-03 Masatake YAMATO - - * src/base/ftobjs.c (destroy_charmaps): New function. - (destroy_face, open_face): Use `destroy_charmaps'. - -2004-01-01 Werner Lemberg - - * docs/CHANGES: Updated. - -2004-01-01 Michael Jansson - - * src/winfonts/winfnt.c (FNT_Size_Set_Pixels): Fix sign of - size->metrics.descender. - -2003-12-31 Wolfgang Domröse - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - [FT_DEBUG_LEVEL_TRACE]: Use `%ld' in FT_TRACE4. - : Change type of dx and dy to FT_Pos and remove - cast for accessing arguments. - -2003-12-31 Werner Lemberg - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Revert previous - change. It's not necessary. - -2003-12-29 Smith Charles - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle `repeated - flags set' correctly. - -2003-12-29 Werner Lemberg - - * src/cff/cffobjs.c (cff_face_init): Fix memory leak by deallocating - `full' and `weight' properly. - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - [FT_DEBUG_LEVEL_TRACE]: Use `0x' as prefix for - tracing output. - -2003-12-26 Werner Lemberg - - * include/freetype/internal/sfnt.h (TT_Set_SBit_Strike_Func): - Use FT_UInt for ppem values. - * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Use FT_UInt for - ppem values. - * src/sfnt/ttsbit.h: Updated. - - * src/base/ftobjs.c (FT_Set_Pixel_Sizes): Don't allow ppem values - larger than -0FFFF. - -2003-12-25 Werner Lemberg - - * src/base/fttrigon.c, src/base/ftgloadr.c: Inlude - FT_INTERNAL_OBJECTS_H. - - * src/base/ftstroke.c (FT_Outline_GetInsideBorder, - FT_Outline_GetOutsideBorder): s/or/o/ to make it compile with - C++ compilers. - - * src/cache/ftcmru.c, include/freetype/cache/ftcmru.h: - s/select/selection/ to avoid compiler warning. - * src/cff/cffload.h: s/select/ftselect/ to avoid potential - compiler warning. - -2003-12-24 Werner Lemberg - - * src/cache/ftcsbits.c (FTC_SNode_Weight): - s/FTC_SBIT_ITEM_PER_NODE/FTC_SBIT_ITEMS_PER_NODE/. - -2003-12-24 David Turner - - * Fixed compilation problems in the cache sub-system. - - * Partial updates to src/autofit. - - * Jamfile (FT2_COMPONENTS): Add autofit module. - -2003-12-23 Werner Lemberg - - * src/cff/cffgload.c (cff_lookup_glyph_by_stdcharcode): Handle - CID-keyed fonts. - -2003-12-23 David Turner - - * include/freetype/internal/ftobjs.h (FT_PAD_FLOOR, FT_PAD_ROUND, - FT_PAD_CEIL, FT_PIX_FLOOR, FT_PIX_ROUND, FT_CEIL): New macros. They - are used to avoid compiler warnings with very pedantic compilers. - Note that `(x) & -64' causes a warning if (x) is not signed. Use - `(x) & ~63' instead! - Updated all related code. - - Add support for extraction of `inside' and `outside' borders. - - * src/base/ftstroke.c (FT_StrokerBorder): New enumeration. - (FT_Outline_GetInsideBorder, FT_Outline_GetOutsideBorder, - FT_Stroker_GetBorderCounts, FT_Stroker_ExportBorder): New functions. - (FT_StrokeBorderRec): New boolean member `valid'. - (ft_stroke_border_get_counts): Updated. - * include/freetype/ftstroke.h: Updated. - -2003-12-22 Werner Lemberg - - * include/freetype/ftwinfnt.h (FT_WinFNT_ID_*): New definitions - to describe the `charset' field in FT_WinFNT_HeaderRec. - * src/winfonts/winfnt.c (FNT_Face_Init): Set encoding to - FT_ENCODING_NONE except for FT_WinFNT_ID_MAC. - - * include/freetype/freetype.h (FT_Encoding): Improve comment, - based on work by Detlef Würkner . - - * docs/CHANGES: Updated. - -2003-12-22 David Turner - - * include/freetype/ftcache.h, - include/freetype/cache/ftcmanag.h, - include/freetype/cache/ftccache.h, - include/freetype/cache/ftcmanag.h, - include/freetype/cache/ftcmru.h (added), - include/freetype/cache/ftlru.h (removed), - include/freetype/cache/ftcsbits.h, - include/freetype/cache/ftcimage.h, - include/freetype/cache/ftcglyph.h, - src/cache/ftcmru.c, - src/cache/ftcmanag.c, - src/cache/ftccache.c, - src/cache/ftcglyph.c, - src/cache/ftcimage.c, - src/cache/ftcsbits.c, - src/cache/ftccmap.c, - src/cache/ftcbasic.c (added), - src/cache/ftclru.c (removed): - - *Complete* rewrite of the cache sub-system to `solve' the - following points: - - - all public APIs have been moved to FT_CACHE_H, everything - under `include/freetype/cache' is only needed by client - applications that want to implement their own caches - - - a new function named FTC_Manager_RemoveFaceID to deal - with the uninstallation of FaceIDs - - - the image and sbit cache are now abstract classes, that - can be extended much more easily by client applications - - - better performance in certain areas. Further optimizations - to come shortly anyway... - - - the FTC_CMapCache_Lookup function has changed its signature, - charmaps can now only be retrieved by index - - - FTC_Manager_Lookup_Face => FTC_Manager_LookupFace - FTC_Manager_Lookup_Size => FTC_Manager_LookupSize (still in - private header for the moment) - -2003-12-21 Werner Lemberg - - * src/type1/t1load.c (parse_dict): Stop parsing if `eexec' keyword - is encountered. - -2003-12-19 Werner Lemberg - - * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 32. For - example, the Japanese Hiragino font already contains 15 subfonts. - - * src/cff/cffload.c (cff_font_load): Deallocate `sids' array for - CID-keyed fonts. - - * devel/ftoption.h: Define FT_DEBUG_MEMORY. - -2003-12-18 Werner Lemberg - - * include/freetype/ttnameid.h (TT_ADOBE_ID_LATIN_1): New macro. - * src/type1/t1objs.c (T1_Face_Init): Use TT_ADOBE_ID* values. - -2003-12-18 Werner Lemberg - - * src/cff/cfftypes.h (CFF_FontRecDictRec): Change type of - `cid_count' to `FT_ULong'. - - * src/cff/cffgload.c (cff_slot_load): Take care of empty `cids' - array. - - * src/cff/cffload.c (cff_charset_done): Free `cids' array. - (cff_font_load): Create cids array only for CID-keyed fonts which - are subsetted. - - * src/cff/cffobjs.c (cff_face_init): Check the availability of - the PSNames modules for non-pure CFFs also. - Set FT_FACE_FLAG_GLYPH_NAMES for a non-pure CFF also if it isn't - CID-keyed. - - * src/cff/rules.mk (CFF_DRV_H): Add cfftypes.h. - -2003-12-17 Werner Lemberg - - * src/sfnt/sfobjs.c (sfnt_init_face): Don't set - FT_FACE_FLAG_GLYPH_NAMES if the font contains a version 3.0 `post' - table. - - * docs/CHANGES: Updated. - -2003-12-17 Masatake YAMATO - - Add new function FT_Get_CMap_Language_ID to extract the language ID - for TrueType/sfnt fonts. - - * include/freetype/internal/services/svttcmap.h: New file. - * include/freetype/internal/ftserv.h (FT_SERVICE_TT_CMAP_H): Add - svttcmap.h. - - * src/sfnt/sfdriver.c: Include ttcmap0.h. - (tt_service_get_cmap_info): New service. - (sfnt_services): Updated. - - * src/sfnt/ttcmap0.c (tt_cmap*_get_info): New functions. - (tt_cmap*_class_rec): Add tt_cmap*_get_info members. - (tt_get_cmap_info): New function. - * src/sfnt/ttcmap0.h: Include FT_SERVICE_TT_CMAP_H. - (TT_CMap_ClassRec): New field `get_cmap_info'. - (tt_get_cmap_info): New declaration. - - * src/base/ftobjs.c: Include FT_SERVICE_TT_CMAP_H. - (FT_Get_CMap_Language_ID): New function implementation. - * include/freetype/tttables.h (FT_Get_CMap_Language_ID): New - function declaration. - -2003-12-16 Werner Lemberg - - * src/sfnt/ttcmap.c, src/sfnt/ttcmap.h: Removed. Obsolete. - - * include/freetype/internal/sfnt.h (SFNT_Interface): Remove - obsolete fields `load_charmap' and `free_charmap'. - (TT_CharMap_Load_Func, TT_CharMap_Free_Func): Removed. - * src/sfnt/sfnt.c: Don't include ttcmap.c. - * src/sfnt/rules.mk (SFNT_DRV_SRC): Don't include ttcmap.c. - * src/sfnt/ttload.c: Don't include ttcmap.h. - * src/sfnt/sfdriver.c: Don't include ttcmap.h. - (sfnt_interface): Updated. - - * include/freetype/internal/tttypes.h (TT_TableDirRec, - TT_CMapDirRec, TT_CMapDirEntryRec, TT_CMap0, TT_CMap2SubHeaderRec, - TT_CMap2Rec, TT_CMap4Segment, TT_CMap4Rec, TT_CMap6, - TT_CMapGroupRec, TT_CMap8_12Rec, TT_CMap10Rec, TT_CharMap_Func, - TT_CharNext_Func, TT_CMapTableRec, TT_CharMapRec): Removed. - Obsolete. - * src/cff/cffobjs.h (CFF_CharMapRec): Removed. Obsolete. - -2003-12-15 Werner Lemberg - - * docs/CHANGES: Updated. - -2003-12-15 Wolfgang Domröse - - * builds/atari/*: New directory for building FreeType 2 on Atari - with the PureC compiler. - -2003-12-12 Wolfgang Domröse - - * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add - cast. - * src/cff/cffdrivr.c (cff_ps_has_glyph_names): Assure that return - value is either 0 or 1. - -2003-12-12 Werner Lemberg - - * src/cff/cffdrivr.c (cff_get_glyph_name): Improve error message. - (cff_get_name_index): Return if no PSNames service is available. - (cff_ps_has_glyph_names): Handle CID-keyed fonts correctly. - * src/cff/cfftypes.h (CFF_CharsetRec): New field `cids', used for - CID-keyed fonts. This is the inverse mapping of `sids'. - * src/cff/cffload.c (cff_charset_load): New argument `invert'. - Initialize charset->cids if `invert' is set. - (cff_font_load): In call to cff_charset_load, set `invert' to true - for CID-keyed fonts. - * src/cff/cffgload.c (cff_slot_load): Handle glyph index as CID - and map it to the real glyph index. - - * docs/CHANGES: Updated. - -2003-12-11 Werner Lemberg - - * src/cff/cffobjs.c (cff_face_init): Don't set - FT_FACE_FLAG_GLYPH_NAMES for CID-keyed fonts. - Don't construct a cmap for CID-keyed fonts. - -2003-12-10 Werner Lemberg - - Use implementation specific SID value 0xFFFF to indicate that - a dictionary element is missing. - - * src/cff/cffload.c (cff_subfont_load): Initialize all fields - which hold SIDs to 0xFFFF. - (cff_index_get_sid_string): Handle SID value 0xFFFF. - Handle case where `psnames' is zero. - (cff_font_load): Updated. - Don't load encoding for CID-keyed CFFs. - - * src/cff/cffobjs.c (cff_face_init): Updated. - Don't check for PSNames module if font is CID-keyed. - Compute style name properly (using the same algorithm as in the - CID driver). - Fix computation of style flags. - - * src/cff/cfftoken.h: Comment out handling of base_font_name. - Rename `postscript' field to `embedded_postscript' - * src/cff/cfftypes.h (CFF_FontRecDictRec): Remove `base_font_name' - and `postscript'. - -2003-12-10 Detlef Würkner - - * src/pcf/pcfdrivr.c (pcf_get_charset_id): New function (a clone - of the similar BDF function). - (pcf_service_bdf): Use it. - -2003-12-09 Werner Lemberg - - * src/sfnt/sfobjs.c (sfnt_load_face): Set FT_FACE_FLAG_GLYPH_NAMES - only if a `post' table is present. - -2003-12-09 George Williams - - * src/base/ftobjs.c (load_mac_face): Recent versions of Linux - support Mac's HFS+ file system, thus enable code to read /rsrc on - non-Macintosh platforms also. - -2003-12-08 Werner Lemberg - - * include/freetype/internal/psaux.h (PS_TableRec): Change type - of `lengths' to FT_PtrDist. - (T1_DecoderRec): Change type of `subrs_len' to FT_PtrDist. - * include/freetype/internal/t1types.h (T1_FontRec): Change type - of `subrs_len' and `charstrings_len' to FT_PtrDist. - - * src/base/ftobjs.c (Mac_Read_POST_Resource): Replace `junk' - variable with better solution. - (IsMacResource): Remove unused variable `map_len'. - Replace `junk' variable with better solution. - (FT_Open_Face) [!FT_MACINTOSH]: Add conditional - FT_CONFIG_OPTION_MAC_FONTS. - -2003-12-08 Wolfgang Domröse - - * src/autohint/ahhint.c (ah_hinter_hint_edges, - ah_hinter_align_strong_points): Add some casts. - - * src/base/ftoutln.c (FT_OrientationExtremumRec): Change type - of `pos' to FT_Long. - - * src/base/ftobjs.c (Mac_Read_POST_Resource, - Mac_Read_sfnt_Resource): Change type of `len' to FT_Long. - - * src/type42/t42parse.c (t42_parse_dict): Add cast for `n_keywords'. - -2003-12-07 Werner Lemberg - - * docs/raster.txt: New file, taken from FreeType 1 and completely - revised. - -2003-12-04 Masatake YAMATO - - * src/type1/t1driver.c (Get_Interface): Remove FT_UNUSED for - t1_interface. t1_interface is used. - -2003-11-27 David Turner - - * src/pfr/pfrdrivr.c (pfr_get_metrics): Revert incorrect change of - 2003-11-23: For PFR fonts, metrics->x_scale and metrics->y_scale are - the scaling values for outline units, not for metric units. - -2003-11-25 Werner Lemberg - - * src/base/ftcalc.c, include/freetype/internal/ftcalc.h - (FT_MulDiv_No_Round): Surround code with `#ifdef - TT_CONFIG_OPTION_BYTECODE_INTERPRETER ... #endif'. - -2003-11-23 Werner Lemberg - - * src/base/ftcalc.c (FT_MulDiv_No_Round): New function (32 and - 64 bit version). - * include/freetype/internal/ftcalc.h: Updated. - - * src/truetype/ttinterp.c (TT_MULDIV_NO_ROUND): New macro. - (TT_INT64): Removed. - (DO_DIV): Use TT_MULDIV_NO_ROUND. - - * src/pfr/pfrdrivr.c (pfr_get_metrics): Directly use - metrics->x_scale and metrics->y_scale. - -2003-11-22 Rogier van Dalen - - * src/truetype/ttinterp.c (CUR_Func_move_orig): New macro. - (Direct_Move_Orig, Direct_Move_Orig_X, Direct_Move_Orig_Y): New - functions. Similar to Direct_Move, Direct_Move_X, and - Direct_Move_Y but without touching. - (Compute_Funcs): Use new functions. - - (Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid, - Round_Up_To_Grid, Round_To_Double_Grid, Round_Super, - Round_Super_45): Fix rounding of value zero. - - (DO_DIV): Don't use TT_MULDIV. - - (Ins_SHC): This instruction actually touches the points. - (Ins_MSIRP): Fix undocumented behaviour. - - * src/truetype/ttinterp.h (TT_ExecContextRec): Updated. - -2003-11-22 Werner Lemberg - - * docs/VERSION.DLL, docs/CHANGES: Updated. - - * src/base/ftobjs.c (FT_Set_Char_Size): Make metrics->x_scale and - metrics->y_scale really precise. - - (FT_Load_Glyph): Update computation of linearHoriAdvance and - linearVertAdvance. - - * src/true/type/ttinterp.c (Update_Max): Use FT_REALLOC. - -2003-11-22 David Turner - - * src/autofit/*: More updates. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8. - * builds/unix/configure.ac (version_info): Set to 9:6:3. - * README: Updated. - -2003-11-13 John A. Boyd Jr. - - * src/bdf/bdfdrivr.c (bdf_interpret_style), src/pcf/pcfread.c - (pcf_interpret_style): Replace spaces with dashes in properties - SETWIDTH_NAME and ADD_STYLE_NAME to simplify parsing. - -2003-11-11 Werner Lemberg - - * docs/CHANGES: Updated. - -2003-11-11 John A. Boyd Jr. - - Handle SETWIDTH_NAME and ADD_STYLE_NAME properties for BDF and PCF - fonts. - - * src/bdf/bdfdrivr.c (bdf_interpret_style): New auxiliary function. - (BDF_Face_Init): Don't handle style properties but call - bdf_interpret_style. - - * src/pcf/pcfread.c (pcf_interpret_style): New auxiliary function. - (pcf_load_font): Don't handle style properties but call - pcf_interpret_style. - -2003-11-07 Werner Lemberg - - - * Version 2.1.7 released. - ========================= - - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7. - - * builds/unix/ft2unix.h: Fix comments. - - * builds/unix/ftconfig.in: Synchronized with ANSI version. - Use `#undef' in templates as recommended in the autoconf - documentation. - Since real `#undef' lines don't survive during configuration, use - `/undef' instead; the postprocessing facility of the - AC_CONFIG_HEADERS autoconf macro converts them to `#undef'. - - * builds/unix/install.mk (install): Install Unix version of - `ftconfig.h'. - - * builds/unix/unix-cc.in (CFLAGS): Set FT_CONFIG_CONFIG_H macro - to include the correct `ftconfig.h' file. - - * builds/unix/ft-munmap.m4 (FT_MUNMAP_DECL): Removed. - (FT_MUNMAP_PARAM): Updated syntax to autoconf 2.59. - - * builds/unix/freetype2.m4: Updated syntax to autoconf 2.59. - - * builds/unix/configure.ac: Use AC_CONFIG_HEADERS instead of - AC_CONFIG_HEADER to create ftconfig.h, and use second argument - to replace `/undef' with `#undef'. - Don't use FT_MUNMAP_DECL but AC_CHECK_DECLS to check for munmap. - Use AS_HELP_STRING in AC_ARG_WITH. - Update syntax to autoconf 2.59. - - * builds/unix/ltmain.sh: Regenerated with `libtoolize --force - --copy' from libtool 1.5. - * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from - automake 1.7.8. - * builds/unix/configure: Regenerated with autoconf 2.59. - * builds/unix/config.guess, builds/unix/config.sub: Updated from - `config' CVS module at subversions.gnu.org - * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from - `texinfo' CVS module at subversions.gnu.org. - - * builds/vms/ftconfig.h: Synchronized with ANSI version. - - * docs/CUSTOMIZE: Fix documentation error. - * docs/CHANGES, docs/VERSION.DLL, docs/release: Updated. - - * builds/freetype.mk (refdoc): Updated --title. - -2003-11-07 David Turner - - - * Version 2.1.6 released. - ========================= - - - * install: Removed. Obsolete. - -2003-11-04 Werner Lemberg - - * src/sfnt/sfdriver.c: Include FT_SERVICE_SFNT_H. - (sfnt_service_sfnt_table): New service. - (sfnt_services): Updated. - - * docs/license.txt: Reworded. - -2003-11-03 Werner Lemberg - - * include/freetype/*: Add a guard to all public header files which - load FT_FREETYPE_H to reject freetype.h from FreeType 1. - -2003-11-02 Patrick Welche - - * builds/unix/freetype2.m4, builds/unix/ft-munmap.m4: Protect - first argument of AC_DEFUN with brackets to avoid possible - expansion. - -2003-11-02 Werner Lemberg - - * include/freetype/cache/ftcglyph.h: Don't include stddef.h. - - * include/freetype/freetype.h: Fix check for ft2build.h. - -2003-11-01 Werner Lemberg - - * include/freetype/freetype.h: Check that ft2build.h has been - loaded first. - - * src/base/fttype1.c (FT_Get_PS_Font_Info): Fix incorrectly applied - patch. - -2003-10-31 Detlef Würkner - - * src/base/fttype1.c (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names): - Fix parameter order in calls to FT_FACE_FIND_SERVICE. - -2003-10-31 Werner Lemberg - - * include/freetype/internal/ftserv.h - (FT_SERVICE_POSTSCRIPT_NAMES_H): Removed. Unused. - - * src/type42/t42drivr.c (t42_services): Updated. - -2003-10-29 David Turner - - * include/freetype/internal/bdftypes.h: Removed. Obsolete. - * src/base/ftbdf.c: Updated. - - * include/freetype/internal/cfftypes.h: Moved to... - * src/cff/cfftypes.h: This place since no other module needs to - know about those types. - - * include/freetype/internal/t42types.h: Moved to... - * src/type42/t42types.h: This place since no other module needs to - know about those types. - - * include/freetype/internal/services/svbdf.h: Include FT_BDF_H. - - * include/freetype/internal/services/svpsname.h: Renamed to... - * include/freetype/internal/services/svpscmap.h: This. - Updated `FT_Service_PsNames' -> `FT_Service_PsCMaps' and - `POSTSCRIPT_NAMES' -> `POSTSCRIPT_CMAPS' everywhere. - - * include/freetype/internal/services/svpsinfo.h: New file, providing - PostScript info service. - - * include/freetype/internal/ftserv.h (FT_SERVICE_POSTSCRIPT_CMAPS_H, - FT_SERVICE_POSTSCRIPT_INFO_H): New macros for svpscmap.h and - svpsinfo.h. - * include/freetype/internal/internal.h (FT_INTERNAL_TYPE42_TYPES_H, - FT_INTERNAL_CFF_TYPES_H, FT_INTERNAL_BDF_TYPES_H): Removed. - - * src/base/fttype1.c: Don't include FT_INTERNAL_TYPE1_TYPES_H and - FT_INTERNAL_TYPE42_TYPES_H but FT_INTERNAL_SERVICE_H and - FT_SERVICE_POSTSCRIPT_INFO_H. - (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names): Use new - POSTSCRIPT_INFO service. - - * src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H. - (cff_ps_has_glyph_names): New function. - (cff_service_ps_info): New service. - (cff_services): Updated. - - * src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h: Don't - include FT_INTERNAL_CFF_TYPES_H but cfftypes.h directly. - - * src/cif/cidriver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H. - (cid_ps_get_font_info): New function. - (cid_service_ps_info): New service. - (cid_services): Updated. - - * src/type1/t1driver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H. - (t1_ps_get_font_info, t1_ps_has_glyph_names): New functions. - (t1_service_ps_info): New service. - (t1_services): Updated. - - * src/type42/t42drivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H. - (t42_ps_get_font_info, t42_ps_has_glyph_names): New functions. - (t42_service_ps_info): New service. - - * src/type42/t42objs.h: Don't include FT_INTERNAL_TYPE42_TYPES_H - but t42types.h directly. - - * src/psnames/psmodule.c (psnames_interface, psnames_services): - Renamed to... - (pscmaps_interface, pscmaps_services): This. - Updated all users. - - - * src/gzip/infblock.c (inflate_blocks): Remove compiler warning. - -2003-10-22 Werner Lemberg - - * src/type1/t1load.c (parse_encoding): Handle `/Encoding [ ... ]'. - - * src/type1/t1parse.c (T1_Get_Private_Dict): Test whether `eexec' - is real. - - * src/type42/t42parse.c (t42_parse_encoding): Improve boundary - checking while parsing. - - * docs/CHANGES: Updated. - -2003-10-21 Josselin Mouette - - * include/freetype/internal/t1types.h (T1_FontRec): `paint_type' - and `stroke_width' aren't pointers. - - * src/type42/t42objs.c (T42_Face_Done), src/type1/t1objs.c - (T1_Face_Done): Don't free `paint_type' and `stroke_width'. - -2003-10-20 Graham Asher - - * src/winfonts/winfnt.c (fnt_cmap_class): Fix position of `const'. - -2003-10-19 Werner Lemberg - - * src/autohint/ahhint.c (ah_hinter_load_glyph): Patch from - 2003-08-18 introduced a severe bug (FT_Render_Glyph was called - twice under some circumstances, causing strange results). This - is fixed now by clearing the FT_LOAD_RENDER bit of `load_flags'. - - * src/base/ftpfr.c (FT_Get_PFR_Metrics): Initialize `error'. - * src/psaux/psobjs.c (ps_tobytes): Initialize `n'. - * src/type42/t42parse.c (t42_parse_sfnts): Initialize `string_size'. - -2003-10-16 Werner Lemberg - - Completely revised Type 42 parser. It now handles both fonts - produced with ttftot42 (tested version 0.3.1) and - TrueTypeToType42.ps (tested version May 2001; it is necessary to - fix the broken header comment to be `%!PS-TrueTypeFont...'). - - * src/type42/t42objs.c (T42_GlyphSlot_Load): Change fourth - parameter to `FT_UInt'. - * src/type42/t42objs.h: Updated. - - * src/type42/t42parse.h (T42_ParserRec): Change type of `in_memory' - to FT_Bool. - (T42_Loader): Change type of `num_chars' and `num_glyphs' to - FT_UInt. - Add `swap_table' element. - * src/type42/t42parse.c (T42_KEYWORD_COUNT, T1_ToFixed, - T1_ToCoordArray, T1_ToTokenArray): Removed. - (T1_ToBytes): New macro. - (t42_is_alpha, t42_hexval): Removed. - (t42_is_space): Handle `\0'. - (t42_parse_encoding): Updated to use new PostScript parser routines - from psaux. - Handle `/Encoding [ ... ]' also. - (T42_Load_Status): New enumeration. - (t42_parse_sfnts): Updated to use new PostScript parser routines - from psaux. - (t42_parse_charstrings): Updated to use new PostScript parser - routines from psaux. - Handle `/CharStrings << ... >>' also. - Don't expect that /.notdef is the first element in dictionary. Copy - code from type1 module to handle this. - (t42_parse_dict): Updated to use new PostScript parser routines - from psaux. - Remove code for synthetic fonts (which can't occur in Type 42 - fonts). - (t42_loader_done): Release `swap_table'. - - * src/psaux/psobjs.c (skip_string): Increase `cur' properly. - - * src/type1/t1load.c (parse_charstrings): Make test for `.notdef' - faster. - -2003-10-15 Graham Asher - - * src/autohint/ahglobal.c (blue_chars), src/winfonts/winfnt.c - (fnt_cmap_class_rec, fnt_cmap_class), src/bdf/bdflib.c (empty, - _num_bdf_properties), src/gzip/infutil.c (inflate_mask), - src/gzip/inffixed.h (fixed_bl, fixed_bd, fixed_tl, fixed_td), - src/gzip/inftrees.h (inflate_trees_fixed), srf/gzip/inftrees.c - (inflate_trees_fixed): Decorate with more `const' to avoid - writable global variables which are disallowed on ARM. - -2003-10-08 Werner Lemberg - - * src/type1/t1load.c (parse_font_matrix, parse_charstrings): Remove - code specially for synthetic fonts; this is handled elsewhere. - (parse_encoding): Remove code specially for synthetic fonts; this is - handled elsewhere. - Improve boundary checking while parsing. - (parse_dict): Improve boundary checking while parsing. - Use ft_memcmp to simplify code. - -2003-10-07 Werner Lemberg - - * src/type1/t1load.c (parse_subrs, parse_dict): Handle synthetic - fonts properly. - (parse_charstrings): Copy correct number of characters into - `name_table'. - -2003-10-06 Werner Lemberg - - Heavy modification of the PS parser to handle comments and strings - correctly. This doesn't slow down the loading of PS fonts - significantly since charstrings aren't affected. - - * include/freetype/config/ftstdlib.h (ft_xdigit): Renamed to... - (ft_isxdigit): This. Updated all callers. - (ft_isdigit): New alias to `isdigit'. - - * include/freetype/internal/psaux.h (PS_Parser_FuncsRec): Renamed - `skip_alpha' to `skip_PS_token'. - Add parameter to `to_bytes' and change some argument types. - - * src/psaux/psauxmod.c (ps_parser_funcs): Updated. - * src/psaux/psobjs.c (ft_char_table): New array to map character - codes (ASCII and EBCDIC) of digits to numbers. - (OP): New auxiliary macro holding either `>=' or `<' depending on - the character encoding. - (skip_comment): New function. - (skip_spaces): Use it. - (skip_alpha): Removed. - (skip_literal_string, skip_string): New functions. - (ps_parser_skip_PS_token): New function. This is a better - replacement of... - (ps_parser_skip_alpha): Removed. - (ps_parser_to_token, ps_parser_to_token_array): Updated. - (T1Radix): Rewritten, using `ft_char_table'. - (t1_toint): Renamed to... - (ps_toint): This. Update all callers. - Use `ft_char_table'. - (ps_tobytes): Add parameter to handle delimiters and change some - argument types. - Use `ft_char_table'. - (t1_tofixed): Renamed to... - (ps_tofixed): This. Update all callers. - Use `ft_char_table'. - (t1_tocoordarray): Renamed and updated to... - (ps_tocoordarray): This. Update all callers. - (t1_tofixedarray): Renamed and updated to... - (ps_tofixedarray): This. Update all callers. - (t1_tobool): Renamed to... - (ps_tobool): This. Update all callers. - (ps_parser_load_field): Updated. - (ps_parser_load_field_table): Use `T1_MAX_TABLE_ELEMENTS' - everywhere. - (ps_parser_to_int, ps_parser_to_fixed, ps_parser_to_coord_array, - ps_parser_to_fixed_array): Skip spaces. Updated. - (ps_parser_to_bytes): Add parameter to handle delimiters and change - some argument types. Updated. - * src/psaux/psobjs.h: Updated. - - * src/cid/cidload.c (cid_parse_dict): Updated. - * src/cid/cidparse.c (cid_parser_new): Check whether the `StartData' - token was really found. - * src/cid/cidparse.h (cid_parser_skip_alpha): Updated and renamed - to... - (cid_parser_skip_PS_token): This. - - * src/type1/t1parse.h (T1_ParserRec): Use `FT_Bool' for boolean - fields. - (T1_Skip_Alpha): Replaced with... - (T1_Skip_PS_Token): This new macro. - * src/type1/t1parse.c (hexa_value): Removed. - (T1_Get_Private_Dict): Use `ft_isxdigit' and - `psaux->ps_parser_funcs_to_bytes' for handling ASCII hexadecimal - encoding. - After decrypting, replace the four random bytes at the beginning - with whitespace. - * src/type1/t1load.c (t1_allocate_blend): Use proper error values. - (parser_blend_design_positions, parse_blend_design_map, - parse_weight_vector): Updated. - (is_space): Handle `\f' also. - (is_name_char): Removed. - (read_binary_data): Updated. - (parse_encoding): Use `ft_isdigit'. - Updated. - (parse_subrs): Updated. - (TABLE_EXTEND): New macro. - (parse_charstrings): Updated. - Provide a workaround for buggy fonts which have more entries in the - /CharStrings dictionary then expected; the function now adds some - slots and skips entries which still exceed the new limit. - (parse_dict): Updated. - Terminate on the token `closefile'. - - * src/type42/t42parse.c (T1_Skip_Alpha): Replaced with... - (T1_Skip_PS_Token): This new macro. Updated all callers. - (t42_parse_encoding): Use `ft_isdigit'. - - - * src/base/ftmm.c (ft_face_get_mm_service): Return FT_Err_OK if - success. - -2003-10-05 Werner Lemberg - - * include/freetype/ftmodule.h: Renamed to... - * include/freetype/ftmodapi.h: This to avoid duplicate file names. - * include/freetype/config/ftheader.h (FT_MODULE_H): Updated. - -2003-10-04 Werner Lemberg - - * src/base/ftoutln.c (FT_OrientationExtremumRec, - FT_Outline_Get_Orientation): Trivial typo fixes to make it compile. - -2003-10-02 Markus F.X.J. Oberhumer - - * src/winfonts/winfnt.c (FT_WinFNT_HeaderRec): `color_table_offset' - has four bytes, not two. - Fix all users. - (fnt_font_load, FNT_Load_Glyph): Add more font validity tests. - -2003-10-01 David Turner - - * src/autofit/*: Adding first source files of the new multi-script - `auto-fitter'. - - * include/freetype/ftoutln.h (FT_Orientation): New enumeration. - (FT_Outline_Get_Orientation): New declaration. - - * src/base/ftoutln.c (FT_OrientationExtremumRec): New structure. - (ft_orientation_extremum_compute): New auxiliary function. - (FT_Outline_Get_Orientation): New function to compute the fill - orientation of a given glyph outline. - - * include/freetype/internal/ftserv.h (FT_FACE_LOOKUP_SERVICE): Fixed - trivial bug which could crash the font engine when a cached service - pointer was retrieved. - -2003-09-30 Werner Lemberg - - * src/cid/cidload.c (cid_parse_dict): Skip token if no keyword is - found. - - * src/type1/t1parse.c (IS_T1_WHITESPACE, IS_T1_LINESPACE, - IS_T1_SPACE): Removed. - (PFB_Tag): Removed. - (read_pfb_tag): Don't use PFB_Tag. - - * src/type42/t42parse.c (t42_is_space): Handle `\f' also. - (t42_parse_encoding): Handle synthetic fonts. - -2003-09-29 Werner Lemberg - - * include/freetype/internal/t1types.h: Don't include - FT_INTERNAL_OBJECTS_H but FT_INTERNAL_SERVICE_H. - * src/truetype/ttobjs.c: Don't include - FT_SERVICE_POSTSCRIPT_NAMES_H. - -2003-09-29 David Turner - - Added new service to handle glyph name dictionaries, replacing the - old internal header named `psnames.h' by `services/svpsname.h'. - Note that this is different from `services/svpostnm.h' which only - handles the retrieval of PostScript font names for a given face. - (Should we merge these two services into a single header?) - - * include/freetype/internal/psnames.h: Removed. Most of its - contents is moved to... - * include/freetype/internal/services/svpsname.h: New file. - - * include/freetype/internal/services/svpostnm.h - (FT_SERVICE_ID_POSTSCRIPT_NAME): Replaced with... - (FT_SERVICE_ID_POSTSCRIPT_FONT_NAME): New macro. - (PsName): Service named changed to... - (PsFontName): This. - Updated `FT_Service_PsName' -> `FT_Service_PsFontName' and - `POSTSCRIPT_NAME' -> `POSTSCRIPT_FONT_NAME' everywhere. - - * include/freetype/internal/internal.h - (FT_INTERNAL_POSTSCRIPT_NAMES_H): Removed. - * include/freetype/internal/psaux.h: Include - FT_SERVICE_POSTSCRIPT_NAMES_H. - (T1_DecoderRec): Updated type of `psnames'. - * include/freetype/internal/t1types.h: Don't include - FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H. - Include FT_INTERNAL_OBJECTS_H. - * include/freetype/internal/t42types.h: Don't include - FT_INTERNAL_POSTSCRIPT_NAMES_H. - * include/freetype/internal/tttypes.h (TT_FaceRec): Updated. - - * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE): Changed - order of parameters. All callers updated. - (FT_FACE_FIND_GLOBAL_SERVICE): New macro to look up a service - globally, checking all modules. - (FT_ServiceCacheRec): Updated. - (FT_SERVICE_POSTSCRIPT_NAMES_H): New macro for accessing - `svpsname.h'. - - * include/freetype/internal/ftobjs.h, src/base/ftobjs.c - (ft_module_get_service): New function. - - * src/cff/cffdrivr.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H - but FT_SERVICE_POSTSCRIPT_NAMES_H. - (cff_get_glyph_name, cff_get_name_index): Use new POSTSCRIPT_NAMES - service. - * src/cff/cffcmap.c (cff_cmap_unicode_init): Updated. - * src/cff/cffload.c, src/cff/cffload.h: Don't include - FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H. - (cff_index_get_sid_string): Updated. - * src/cff/cffobjs.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H - but FT_SERVICE_POSTSCRIPT_NAMES_H. - (cff_face_init): Use new POSTSCRIPT_NAMES service. - * src/cff/cffobjs.h: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H - but FT_SERVICE_POSTSCRIPT_NAMES_H. - - * src/cid/cidobjs.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H - but FT_SERVICE_POSTSCRIPT_NAMES_H. - (cid_face_init): Use new POSTSCRIPT_NAMES service. - * src/cid/cidriver.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H. - - * src/psaux/t1cmap.c (t1_cmap_std_init, t1_cmap_unicode_init): Use - new POSTSCRIPT_NAMES service. - * src/psaux/t1decode.h (t1_lookup_glyph_by_stdcharcode, - t1_decode_init): Use new POSTSCRIPT_NAMES service. - * src/psaux/t1cmap.h, src/psaux/t1decode.h: Dont' include - FT_INTERNAL_POSTSCRIPT_NAMES_H. - - * src/psnames/psmodule.c: Don't include - FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H. - (ps_build_unicode_table): Renamed to... - (ps_unicodes_init): This. - (ps_lookup_unicode): Renamed to... - (ps_unicodes_char_index): This. - (ps_next_unicode): Renamed to... - (ps_unicodes_char_next): This. - (psnames_interface): Updated. - (psnames_services): New services list. - (psnames_get_service): New function. - (psnames_module_class): Updated. - - * src/sfnt/sfobjs.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H - but FT_SERVICE_POSTSCRIPT_NAMES_H. - (sfnt_init_face): Use new POSTSCRIPT_NAMES service. - * src/sfnt/ttpost.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H - but FT_SERVICE_POSTSCRIPT_NAMES_H. - (tt_face_get_ps_name): Updated. - - * src/truetype/ttobjs.c: Don't include - FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H. - - * src/type1/t1driver.c: Don't include - FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H. - * src/type1/t1objs.c: Don't include - FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H. - (T1_Face_Init): Use new POSTSCRIPT_NAMES service. - - * src/type42/t42drivr.c (t42_get_ps_name): Renamed to... - (t42_get_ps_font_name): This. - (t42_service_ps_name): Renamed to... - (t42_service_ps_font_name): This. - (t42_services): Updated. - * src/type42/t42objs.c (T42_Face_Init): Use new POSTSCRIPT_NAMES - service. - * src/type42/t42objs.h: Don't include - FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H. - - - * src/base/ftglyph.c (FT_Get_Glyph): Don't access `slot' before - testing its validity. Reported by Henry Maddocks - . - -2003-09-21 Werner Lemberg - - * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE): - Fix compilation warning (s/pptr/Pptr/). - - * include/freetype/internal/internal.h (FT_INTERNAL_PFR_H, - FT_INTERNAL_FNT_TYPES_H): Removed. - -2003-09-21 David Turner - - Migrating the PFR and WINFNT drivers to the new service-based - internal API. - - * include/freetype/internal/fnttypes.h: Removed. Most of its data - are moved to winfnt.h and... - * include/freetype/internal/services/svwinfnt.h: New file. - - * include/freetype/internal/pfr.h: Removed. Most of its data are - moved to... - * include/freetype/internal/services/svpfr.h: New file. - - * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE, - FT_FACE_LOOKUP_SERVICE): Simplify fix of 2003-09-16 by removing - pointer type argument. - Updated all callers. - Update macro names of services header files. - - * src/base/ftobjs.c (FT_Get_Name_Index): Simplified code. - - * src/base/ftpfr.c: Include FT_SERVICE_PFR_H instead of - FT_INTERNAL_PFR_H. - (ft_pfr_check, FT_Get_PFR_Metrics, FT_Get_PFR_Kerning, - FT_Get_PFR_Advance): Use services provided in `PFR_METRICS'. - - * src/base/ftwinfnt.c: Include FT_SERVICE_WINFNT_H instead of - FT_INTERNAL_FNT_TYPES_H. - (FT_Get_WinFNT_Header): Use service provided in `WINFNT'. - - * src/pfr/pfrdrivr.c: Include FT_SERVICE_PFR_H and - FT_SERVICE_XFREE86_NAME_H instead of FT_INTERNAL_PFR_H. - (pfr_service_bdf): Updated. - (pfr_services): New services list. - (pfr_get_service): New function. - (pfr_driver_class): Updated. - - * src/winfonts/winfnt.c: Include FT_SERVICE_WINFNT_H and - FT_SERVICE_XFREE86_NAME_H instead of FT_INTERNAL_FNT_TYPES_H. - (winfnt_get_header, winfnt_get_service): New functions. - (winfnt_service_rec): New structure providing WINFNT services. - (winfnt_services): New services list. - (winfnt_driver_class): Updated. - * src/winfonts/winfnt.h: Add most of the removed fnttypes.h data. - - * src/sfnt/sfdriver.c (sfnt_service_ps_name): Fix typo. - - * src/type1/t1driver.c (t1_service_ps_name): Fix typo. - - * src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c, - src/psaux/psobjs.c, src/sfnt/sfobjs.c, src/truetype/ttobjs.c, - src/type1/t1objs.c, src/type42/t42objs.c: Removing various compiler - warnings. - -2003-09-19 David Bevan - - * src/type1/t1parse.c (pfb_tag_fields): Removed. - (read_pfb_tag): Fix code so that it doesn't fail on end-of-file - indicator (0x8003). - * docs/CHANGES: Updated. - -2003-09-16 Werner Lemberg - - * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE, - FT_FACE_LOOKUP_SERVICE): Add parameter to pass pointer type. - Ugly, I know, but this is needed for compilation with C++ -- - maybe someone knows a better solution? - Updated all callers. - - * src/base/ftobjs.c (FT_Get_Name_Index, FT_Get_Glyph_Name): Remove - C++ compiler warnings. - - * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): - Fix order of arguments passed to FT_FACE_FIND_SERVICE. - -2003-09-15 Werner Lemberg - - Avoid header files with identical names. - - * include/freetype/internal/services/bdf.h: Renamed to... - * include/freetype/internal/services/svbdf.h: This. - Add copyright notice. - * include/freetype/internal/services/glyfdict.h: Renamed to... - * include/freetype/internal/services/svgldict.h: This. - Add copyright notice. - * include/freetype/internal/services/multmast.h: Renamed to... - * include/freetype/internal/services/svmm.h: This. - Add copyright notice. - Add FT_BEGIN_HEADER and FT_END_HEADER. - * include/freetype/internal/services/sfnt.h: Renamed to... - * include/freetype/internal/services/svsfnt.h: This. - Add copyright notice. - * include/freetype/internal/services/postname.h: Renamed to... - * include/freetype/internal/services/svpostnm.h: This. - Add copyright notice. - * include/freetype/internal/services/xf86name.h: Renamed to... - * include/freetype/internal/services/svxf86nm.h: This. - Add copyright notice. - - * include/freetype/internal/ftserv.h: Add FT_BEGIN_HEADER and - FT_END_HEADER. - Add copyright notice. - Update macro names of services header files. - - * builds/freetype.mk (SERVICES_DIR): New variable. - (BASE_H): Add services header files. - -2003-09-11 Werner Lemberg - - * builds/toplevel.mk (distclean): Remove `builds/unix/freetype2.pc'. - - * src/cff/cffdrivr.c: Don't load headers twice. - - * include/freetype/internal/ftserv.h (FT_SERVICE_SFNT_H): New macro. - * src/base/ftobjs.c: Include FT_SERVICE_SFNT_H. - - * src/cff/cffcmap.c: Include `cfferrs.h'. - * src/pfr/pfrdrivr.c: Include `pfrerror.h'. - * src/sfnt/sfdriver.c: Include `sferrors.h'. - * src/psaux/psobjs.h: Add declaration for `ps_parser_to_bytes'. - -2003-09-11 David Turner - - Introducing the concept of `module services'. This is the first - step towards a massive simplification of the engine's internals, in - order to get rid of various numbers of hacks. - - Note that these changes will break source & binary compatibility for - authors of external font drivers. - - * include/freetype/config/ftconfig.h (FT_BEGIN_STMNT, FT_END_STMNT, - FT_DUMMY_STMNT): New macros. - - * include/freetype/internal/ftserv.h: New file, containing the new - structures and macros to provide `services'. - - * include/freetype/internal/internal.h (FT_INTERNAL_EXTENSION_H, - FT_INTERNAL_EXTEND_H, FT_INTERNAL_HASH_H, FT_INTERNAL_OBJECT_H): - Removed, obsolete. - (FT_INTERNAL_SERVICE_H): New macro for `ftserv.h'. - - * include/freetype/internal/services/bdf.h, - include/freetype/internal/services/glyfdict.h, - include/freetype/internal/services/postname.h, - include/freetype/internal/services/xf86name.h: New files. - - * include/freetype/ftmm.h (FT_Get_MM_Func, FT_Set_MM_Design_Func, - FT_Set_MM_Blend_Func): Function pointers moved (in modified form) - to... - * include/freetype/internal/services/multmast.h: New file. - - * include/freetype/internal/sfnt.h (SFNT_Interface): `get_interface' - is now of type `FT_Module_Requester'. - (SFNT_Get_Interface_Func, SFNT_Load_Table_Func): Function pointers - moved (in modified form) to... - * include/freetype/internal/servies/sfnt.h: New file. - - * include/freetype/tttables.h (FT_Get_Sfnt_Table_Func): Function - pointer moved (in modified form) to `services/sfnt.h'. - - * include/freetype/ftmodule.h (FT_Module_Interface): Make it a - a typedef to `FT_Pointer'. - - * include/freetype/internal/tttypes.h (TT_FaceRec): Add - `postscript_name'. - * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove - `postscript_name'. - Add `services' element. - (FT_LibraryRec): Remove `meta_class'. - - * src/base/ftbdf.c: Include FT_SERVICE_BDF_H. - (test_font_type): Removed. - (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Use services - provided in `FT_SERVICE_ID_BDF'. - - * src/base/ftmm.c: Include FT_SERVICE_MULTIPLE_MASTERS_H. - (ft_face_get_mm_service): New auxiliary function to get services - from `FT_SERVICE_ID_MULTI_MASTERS'. - (FT_Get_Multi_Master, FT_Set_MM_Design_Coordinates, - FT_Set_MM_Blend_Coordinates): Use `ft_face_get_mm_service'. - - * src/base/ftobjs.c: Include FT_SERVICE_POSTSCRIPT_NAME_H and - FT_SERVICE_GLYPH_DICT_H. - (ft_service_list_lookup): New function to get a specific service. - (destroy_face): Updated. - (Mac_Read_POST_Resource): Simplify some code. - (IsMacResource): Fix warnings. - (FT_Get_Name_Index, FT_Get_Glyph_Name): Use services provided in - `FT_SERVICE_ID_GLYPH_DICT'. - (FT_Get_Postscript_Name): Use service provided in - `FT_SERVICE_ID_POSTSCRIPT_NAME'. - (FT_Get_Sfnt_Table, FT_Load_Sfnt_Table): Use services provided in - `FT_SERVICE_ID_SFNT_TABLE'. - - * src/base/ftxf86.c: Include FT_SERVICE_XFREE86_NAME_H. - (FT_Get_X11_Font_Format): Use service provided in - `FT_SERVICE_ID_XF86_NAME'. - - * src/bdf/bdfdrivr.c: Include FT_SERVICE_BDF_H and - FT_SERVICE_XFREE86_NAME_H. - (bdf_get_charset_id): New function. - (bdf_service_bdf): New structure providing BDF services. - (bdf_services): New services list. - (bdf_driver_requester): Use `ft_service_list_lookup'. - - * src/cff/cffdrivr.c: Include FT_SERVICE_XFREE86_NAME_H and - FT_SERVICE_GLYPH_DICT_H. - (cff_service_glyph_dict): New structure providing CFF services. - (cff_services): New services list. - (cff_get_interface): Use `ft_service_list_lookup'. - - * src/cid/cidriver.c: Include FT_SERVICE_POSTSCRIPT_NAME_H and - FT_SERVICE_XFREE86_NAME_H. - (cid_service_ps_name): New structure providing CID services. - (cid_services): New services list. - (cid_get_interface): Use `ft_service_list_lookup'. - - * src/pcf/pcfdrivr.c: Include FT_SERVICE_BDF_H and - FT_SERVICE_XFREE86_NAME_H. - (pcf_service_bdf): New structure providing PCF services. - (pcf_services): New services list. - (pcf_driver_requester): Use `ft_service_list_lookup'. - - * src/sfnt/sfdriver.c: Include FT_SERVICE_GLYPH_DICT_H and - FT_SERVICE_POSTSCRIPT_NAME_H. - (get_sfnt_glyph_name): Renamed to... - (sfnt_get_glyph_name): This. - (get_sfnt_postscript_name): Renamed to... - (sfnt_get_ps_name): This. - Updated. - (sfnt_service_glyph_dict, sfnt_service_ps_name): New structures - providing services. - (sfnt_services): New services list. - (sfnt_get_interface): Use `ft_service_list_lookup'. - - * src/truetype/ttdriver.c: Include FT_SERVICE_XFREE86_NAME_H. - (tt_services): New services list. - (tt_get_interface): Use `ft_service_list_lookup'. - - * src/type1/t1driver.c: Include FT_SERVICE_MULTIPLE_MASTERS_H, - FT_SERVICE_GLYPH_DICT_H, FT_SERVICE_XFREE86_NAME_H, and - FT_SERVICE_POSTSCRIPT_NAME_H. - (t1_service_glyph_dict, t1_service_ps_name, - t1_service_multi_masters): New structures providing Type 1 services. - (t1_services): New services list. - (Get_Interface): Use `ft_service_list_lookup'. - - * src/type42/t42drivr.c: Include FT_SERVICE_XFREE86_NAME_H, - FT_SERVICE_GLYPH_DICT_H, and FT_SERVICE_POSTSCRIPT_NAME_H. - (t42_service_glyph_dict, t42_service_ps_name): New strucures - providing Type 42 services. - (t42_services): New services list. - (T42_Get_Interface): Use `ft_service_list_lookup'. - - - * README, docs/CHANGES: Updating version numbers for 2.1.6, and - removing obsolete warnings in the documentation. - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6. - * builds/unix/configure.ac (version_info): Set to 9:5:3. - * builds/unix/configure: Regenerated. - - * include/freetype/internal/ftcore.h, - include/freetype/internal/ftexcept.h, - include/freetype/internal/fthash.h, - include/freetype/internal/ftobject.h: Removed. Obsolete. - -2003-09-09 David Turner - - Fixing PFR kerning support. The tables within the font file contain - (charcode,charcode) kerning pairs, we need to convert them to - (gindex,gindex). - - * src/base/ftpfr.c (ft_pfr_check): Fix serious typo. - * src/pfr/prfload.c: Remove dead code. - (pfr_get_gindex, pfr_compare_kern_pairs, pfr_sort_kerning_pairs): - New functions. - (pfr_phy_font_done): Free `kern_pairs'. - (pfr_phy_font_load): Call `pfr_sort_kerning_pairs'. - * src/pfr/pfrobjs.c (pfr_face_get_kerning): Fix kerning extraction. - * src/pfr/pfrtypes.h (PFR_KERN_PAIR_INDEX): New macro. - (PFR_KernPairRec): Make `kerning' an FT_Int. - (PFR_PhyFontRec): New element `kern_pairs'. - (PFR_KernFlags): Values of PFR_KERN_2BYTE_CHAR and - PFR_KERN_2BYTE_ADJ were erroneously reversed. - - * include/freetype/ftoption.h: Commenting out the macro - TT_CONFIG_OPTION_BYTECODE_INTERPRETER. - 2003-09-02 David Turner + * include/freetype/config/ftoption.h: commenting out the + macro TT_CONFIG_OPTION_BYTECODE_INTERPRETER so that package + managers that define it with additionnal compilation command line + options (e.g. with -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER) still + work correctly. - * Version 2.1.5 released. - ========================= - + Also added a note to indicate that TT_CONFIG_OPTION_UNPATENTED_HINTING + doesn't work as advertised yet. 2003-08-31 Manish Singh @@ -2564,8 +1076,8 @@ (not defined, but in comments) for the unpatented hinting system. * include/freetype/internal/tttypes.h (TT_FaceRec) - [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: New element `FT_Bool - unpatented_hinting'. + [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: New element "FT_Bool + unpatented_hinting". * src/truetype/ttinterp.c (NO_APPLE_PATENT, APPLE_THRESHOLD): Removed. @@ -2631,8 +1143,8 @@ * src/pcf/pcfread.c (pcf_load_font): Fixed the computation of face->num_glyphs. We must increase the value by 1 to respect the - convention that glyph index 0 always corresponds to the `missing - glyph'. + convention that glyph index 0 always corresponds to the "missing + glyph". 2003-04-24 Werner Lemberg @@ -2728,7 +1240,7 @@ 2003-04-09 Torrey Lyons * src/base/ftmac.c (open_face_from_buffer): Removed a double-free - bug that had nasty consequences when trying to open an `invalid' + bug that had nasty consequences when trying to open an "invalid" font on a Mac. 2003-04-09 Mike Fabian @@ -2740,14 +1252,14 @@ 2003-04-08 David Turner - * Version 2.1.4 released. - ========================= + * Version 2.1.4 is released. + ============================ 2003-04-03 Martin Muskens * src/type1/t1load.c (T1_Open_Face): Fixed the code to make it - handle special cases where a font only contains a `.notdef' glyph + handle special cases where a font only contains a ".notdef" glyph (happens in PDF-embedded fonts). Otherwise, FT_Panic was called. 2003-03-27 David Turner @@ -2856,8 +1368,8 @@ 2003-03-13 David Turner Added new environment variables to control memory debugging with - FreeType. See the description of `FT2_DEBUG_MEMORY', - `FT2_ALLOC_TOTAL_MAX' and `FT2_ALLOC_COUNT_MAX' in DEBUG.TXT. + FreeType. See the description of "FT2_DEBUG_MEMORY", + "FT2_ALLOC_TOTAL_MAX" and "FT2_ALLOC_COUNT_MAX" in DEBUG.TXT. * src/base/ftdbgmem.c (FT_MemTableRec): Add `alloc_count', `bound_total', `alloc_total_max', `bound_count', `alloc_count_max'. @@ -2902,7 +1414,7 @@ (ftc_cmap_family_init): The cmap cache now supports UCS-4 charmaps when available in Asian fonts. - * src/sfnt/ttload.c, src/base/ftobjs.c: Changed `asian' to `Asian' + * src/sfnt/ttload.c, src/base/ftobjs.c: Changed "asian" to "Asian" in comments. 2003-02-25 David Turner @@ -2923,7 +1435,7 @@ - The table loaded now scans for *undocumented* elements of a physical font's auxiliary data record. This is necessary to - retrieve the `real' family and style names. + retrieve the "real" family and style names. NOTE THAT THESE CHANGES THE FAMILY NAME OF MANY PFR FONTS! @@ -2969,7 +1481,7 @@ `exec->metrics'. * src/autohint/ahhint.c (ah_hinter_load): Disabled the advance width - `correction' which seemed to provide more trouble than benefits. + "correction" which seemed to provide more trouble than benefits. 2003-02-13 Graham Asher @@ -3010,7 +1522,7 @@ * src/pfr/pfrsbit.c: Removed compiler warnings. * src/cache/ftccmap.c (ftc_cmap_family_init): Changed an FT_ERROR - into an FT_TRACE1 since it caused `ftview' and others to dump too + into an FT_TRACE1 since it caused "ftview" and others to dump too much junk when trying to display a waterfall with a font without a Unicode charmap (e.g. SYMBOL.TTF). @@ -3074,9 +1586,9 @@ (pcf_find_property): Decorate it with FT_LOCAL_DEF. * src/pcf/pcfread.h: New file, providing `pcf_find_property'. - * src/sfnt/ttload.c (sfnt_dir_check): Relaxed the `head' table size + * src/sfnt/ttload.c (sfnt_dir_check): Relaxed the "head" table size verification to accept a few broken fonts who pad the size - incorrectly (the table should be padded, but its `size' field + incorrectly (the table should be padded, but its "size" field shouldn't according to the specification). 2003-01-18 Werner Lemberg @@ -3142,9 +1654,9 @@ Patches to the auto-hinter in order to slightly improve the output. Note that everything is controlled through the new - FT_CONFIG_OPTION_CHESTER_HINTS defined in `ftoption.h'. There are + FT_CONFIG_OPTION_CHESTER_HINTS defined in "ftoption.h". There are also individual FT_CONFIG_CHESTER_XXX macros to control individual - `features'. + "features". Note that all improvements are enabled by default, but can be tweaked for optimization and testing purposes. The configuration @@ -3186,11 +1698,11 @@ 2003-01-08 Huw Dawies * src/winfonts/winfnt.c (winfnt_header_fields): Read 16 bytes into - `reserved2', not `reserved'. + "reserved2", not "reserved". * src/base/ftobjs.c (find_unicode_charmap): Fixed the error code returned when the font doesn't contain a Unicode charmap. This - allows FT2 to load `symbol.ttf' and a few others correctly since the + allows FT2 to load "symbol.ttf" and a few others correctly since the last release. (open_face): Fix return value. @@ -3243,7 +1755,7 @@ assertion, and changing code to avoid hash table size contraction. * src/base/Jamfile, src/base/rules.mk, src/base/descrip.mms: Adding - `ftstroker' to default build, as optional component. + "ftstroker" to default build, as optional component. 2002-12-26 David Turner @@ -3333,8 +1845,8 @@ 2002-11-18 David Turner - * Version 2.1.3 released. - ========================= + * Version 2.1.3 is released. + ============================ 2002-11-07 David Turner @@ -3374,7 +1886,7 @@ configuration (typically by adding -D flags at compile time). * src/sfnt/ttcmap0.c (tt_face_build_cmaps): Removed compiler - warnings in optimized mode relative to the `volatile' local + warnings in optimized mode relative to the "volatile" local variables. This was not a compiler bug after all, but the fact that a pointer to a volatile variable is not the same as a volatile pointer to a variable :-) @@ -3400,9 +1912,9 @@ 2002-11-01 David Turner - Added PFR-specific public API. Fixed the kerning retrievel routine - (it returned invalid values when the outline and metrics resolution - differ). + Added PFR-specific public API. Fixed the kerning retrievel routine + (it returned invalid values when the outline and metrics resolution + differ). * include/freetype/ftpfr.h, include/freetype/internal/pfr.h: New files. @@ -3506,8 +2018,8 @@ src/tools/docmaker/tohtml.py: Fixing a few nasty bugs. * src/sfnt/ttcmap0.c (tt_cmap4_validate): The validator for format 4 - sub-tables is now capable of dealing with invalid `length' fields at - the start of the sub-table. This allows fonts like `mg______.ttf' + sub-tables is now capable of dealing with invalid "length" fields at + the start of the sub-table. This allows fonts like "mg______.ttf" (i.e. Marriage) to return accurate charmaps. * docs/CHANGES: Updated. @@ -3771,7 +2283,7 @@ Removed conditional code. This fixes a bug that prevented compilation in debug mode of template instantiation. - * include/freetype/ftimage.h: Removed incorrect `zft_' definitions + * include/freetype/ftimage.h: Removed incorrect "zft_" definitions and updated constants documentation comments. * src/cff/cffparse.c (cff_parser_run): Fixed the CFF table loader. @@ -3779,7 +2291,7 @@ certain fonts. * include/freetype/freetype.h (FT_FaceRec): Updating documentation - comment. The `descender' value is always *negative*, not positive. + comment. The "descender" value is always *negative*, not positive. 2002-09-09 Owen Taylor @@ -4083,7 +2595,7 @@ The automatic and Postscript hinter now automatically detect inflection points in glyph outlines and treats them specially. This is very useful to prevent nasty effect like the disappearing - diagonals of `S' and `s' in many, many fonts. + diagonals of "S" and "s" in many, many fonts. * src/autohint/ahtypes.h (ah_flag_inflection): New macro. * src/autohint/ahangles.c (ah_angle_diff): New function. @@ -4097,8 +2609,8 @@ * src/tools/docmaker/docmaker.py, src/tools/docmaker/utils.py, src/tools/docmaker/tohtml.py: Updating the DocMaker tool. - * include/freetype/freetype.h: Changing the type of the `load_flags' - parameter from `FT_Int' to `FT_Int32', this in order to support more + * include/freetype/freetype.h: Changing the type of the "load_flags" + parameter from "FT_Int" to "FT_Int32", this in order to support more options. This should only break binary and/or source compatibility on 16-bit platforms (Atari?). (FT_LOAD_NO_AUTOHINT): New macro. @@ -4267,7 +2779,7 @@ 2002-07-30 David Turner * include/freetype/ftincrem.h: Adding new experimental header file - to demonstrate a `cleaner' API to support incremental font loading. + to demonstrate a "cleaner" API to support incremental font loading. * include/freetype/config/ftheader.h (FT_INCREMENTAL_H): New macro. @@ -4303,10 +2815,10 @@ 2002-07-24 Graham Asher * src/truetype/ttobjs.c: Fix for bug reported by Sven Neumann - [sven@gimp.org] on the FreeType development forum: `If + [sven@gimp.org] on the FreeType development forum: "If FT_CONFIG_OPTION_INCREMENTAL is undefined (this is the default), the TrueType loader crashes in line 852 of src/truetype/ttgload.c when - it tries to access face->glyph_locations.' + it tries to access face->glyph_locations." 2002-07-18 Graham Asher @@ -4409,8 +2921,8 @@ 2002-07-11 David Turner Changing the SFNT loader to check for SFNT-based font files - differently. We now ignore the range `helper' fields and check the - `head' table's magic number instead. + differently. We now ignore the range "helper" fields and check the + "head" table's magic number instead. * include/freetype/internal/tttypes.h (SFNT_HeaderRec): Add `offset' field. @@ -4712,7 +3224,7 @@ (FT_Get_PS_Font_Info): Make it work with CID and Type 42 drivers also. -2002-06-19 Sebastien BARRE +2002-06-19 Sebastien BARRE * src/type42/t42parse.c (t42_parse_sfnts): Fix compiler warning. @@ -4927,7 +3439,7 @@ 2002-06-07 David Turner Fixed the bug that prevented the correct display of fonts with - `ftview'. + "ftview". * src/type42/t42drivr.c: Split into... * src/type42/t42drivr.h, src/type42/t42parse.c, @@ -5033,8 +3545,8 @@ * include/freetype/t1tables.h: Updated. * src/base/Jamfile, src/base/rules.mk, src/base/descrip.mms: - Updating build control files for the new files `ftxf86.c' and - `fttype1.c' in src/base. + Updating build control files for the new files "ftxf86.c" and + "fttype1.c" in src/base. * src/pshinter/pshglob.c (psh_blues_scale_zones): Fixed a bug that prevented family blue zones substitution from hapenning correctly. @@ -5056,7 +3568,7 @@ Fixing the SFNT name table loader to support various buggy fonts. It now ignores empty name entries, entries with invalid pointer Offsets and certain fonts containing tables with broken - `storageOffset' fields. + "storageOffset" fields. Name strings are now loaded on demand, which reduces the memory requirements for a given FT_Face tremendously (for example, the name @@ -5110,7 +3622,7 @@ 2002-05-21 David Turner * src/bdf/bdflib.c: Removed compiler warning, and changed all tables - to the `static const' storage specifier (instead of simply + to the "static const" storage specifier (instead of simply `static'). * src/type42/t42drivr.c (hexval): Use more efficient code. @@ -5121,7 +3633,7 @@ src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk (FT_Get_BDF_Charset_ID): New API to retrieve BDF-specific strings from a face. This is much cleaner than accessing the internal types - `BDF_Public_Face' defined in FT_INTERNAL_BDF_TYPES_H. + "BDF_Public_Face" defined in FT_INTERNAL_BDF_TYPES_H. 2002-05-21 Werner Lemberg @@ -5275,11 +3787,11 @@ 2002-05-01 David Turner * src/sfnt/sfobjs.c (tt_face_get_name): Fixing a bug that caused - FreeType to crash when certain broken fonts (e.g. `hya6gb.ttf') + FreeType to crash when certain broken fonts (e.g. "hya6gb.ttf") were opened. * src/sfnt/ttload.c (TT_Load_Names): Applied a small work-around to - manage fonts containing a broken name table (e.g. `hya6gb.ttf'). + manage fonts containing a broken name table (e.g. "hya6gb.ttf"). * src/sfnt/ttcmap0.c (tt_cmap4_validate): Fixed over-restrictive validation test. The charmap validator now accepts overlapping @@ -5446,8 +3958,8 @@ * src/base/ftobjs.c, builds/win32/ftdebug.c, builds/amiga/src/base/ftdebug.c: Version 2.1.0 couldn't be linked against applications in Win32 and Amiga builds due to changes to - `src/base/ftdebug.c' that were not properly propagated to - `builds/win32' and `builds/amiga'. This has been fixed. + "src/base/ftdebug.c" that were not properly propagated to + "builds/win32" and "builds/amiga". This has been fixed. * include/freetype/internal/ftobject.h, include/freetype/internal/ftexcept.h, include/freetype/ftsysmem.h, @@ -5534,7 +4046,7 @@ builds/amiga/src/base/ftdebug.c: - Added the new configuration file `ftstdlib.h' used to define + Added the new configuration file "ftstdlib.h" used to define aliases for all ISO C library functions used by the engine (e.g. strlen, qsort, setjmp, etc.). @@ -5775,7 +4287,7 @@ * src/psaux/t1cmap.h, src/psaux/t1cmap.c, src/type1/t1cmap.h, src/type1/t1cmap.c: Updating and moving the Type 1 FT_CMap support - from `src/type1' to `src/psaux' since it is going to be shared by + from "src/type1" to "src/psaux" since it is going to be shared by the Type 1 and CID font drivers. * src/psaux/Jamfile, src/psaux/psaux.c, src/psaux/psauxmod.c, @@ -5985,11 +4497,11 @@ * src/cid/cidriver.c (cid_get_postscript_name): Fixed a bug that caused the CID driver to return Postscript font names with a leading - slash (`/') as in `/MOEKai-Regular'. + slash ("/") as in "/MOEKai-Regular". * src/sfnt/ttload.c (TT_Load_Names), src/sfnt/sfobjs.c (Get_Name), src/sfnt/sfdriver.c (get_sfnt_postscript_name): Fixed the loader so - that it accepts broken fonts like `foxjump.ttf', which made FreeType + that it accepts broken fonts like "foxjump.ttf", which made FreeType crash when trying to load them. Also improved the name table parser to be able to load @@ -6049,7 +4561,7 @@ * src/sfnt/ttload.c (TT_Load_Names): Simplifying and securing the names table loader. Invalid individual name entries are now handled correctly. This allows the loading of very buggy fonts like - `foxjump.ttf' without allocating tons of memory and causing crashes. + "foxjump.ttf" without allocating tons of memory and causing crashes. * src/otlayout/otlcommon.h, src/otlayout/otlcommon.c: Adding (still experimental) code for OpenType Layout tables validation and @@ -6096,14 +4608,14 @@ ft_io_stream => ft_ansi_stream_io (in base/ftsystem.c only) * src/base/ftutil.c: New file. Contains all memory and list - management code (previously in `ftobjs.c' and `ftlist.c', + management code (previously in "ftobjs.c" and "ftlist.c", respectively). * include/freetype/internal/ftobjs.h: Moving all code related to glyph loaders to ... - * include/freetype/internal/ftgloadr.h: This new file. - `FT_GlyphLoader' is now a pointer to the structure - `FT_GlyphLoaderRec'. + * include/freetype/"internal/ftgloadr.h: This new file. + "FT_GlyphLoader" is now a pointer to the structure + "FT_GlyphLoaderRec". (ft_glyph_own_bitmap): Renamed to ... (FT_GLYPH_OWN_BITMAP): This. * src/base/ftobjs.c: Moving all code related to glyph loaders @@ -6118,8 +4630,8 @@ 2002-02-21 David Turner Modified the debug sub-system initialization. Trace levels can now - be specified within the `FT2_DEBUG' environment variable. See the - comments within `ftdebug.c' for more details. + be specified within the "FT2_DEBUG" environment variable. See the + comments within "ftdebug.c" for more details. * src/base/ftdebug.c: (FT_SetTraceLevel): Removed. (ft_debug_init): New function. @@ -6144,8 +4656,8 @@ Removed. Both files are now completely obsolete. * src/base/Jamfile, src/base/rules.mk: Updated. - * include/freetype/fterrors.h: Adding `#undef FT_ERR_CAT' and - `#undef FT_ERR_XCAT' to avoid warnings with certain compilers (like + * include/freetype/fterrors.h: Adding "#undef FT_ERR_CAT" and + `#undef FT_ERR_XCAT" to avoid warnings with certain compilers (like LCC). * src/pshinter/pshalgo2.c (print_zone): Renamed to ... @@ -6157,7 +4669,7 @@ 2002-02-20 David Turner - * README: Adding `devel@freetype.org' address for bug reports. + * README: Adding "devel@freetype.org" address for bug reports. 2002-02-20 Werner Lemberg @@ -6285,7 +4797,7 @@ * src/pcf/pcfdriver.c (FT_Done_Face): Fixed small memory leak. - * src/pcf/pcfread.c (pcf_load_font): Now handles the `AVERAGE_WIDTH' + * src/pcf/pcfread.c (pcf_load_font): Now handles the "AVERAGE_WIDTH" property to return correct character pixel (width/height) pairs for embedded bitmaps. @@ -6351,7 +4863,7 @@ 2002-01-30 David Turner * INSTALL: Moved to ... - * docs/INSTALL: Here to avoid conflicts with the `install' script on + * docs/INSTALL: Here to avoid conflicts with the "install" script on Windows, where the filesystem doesn't preserve case. 2002-01-29 David Turner @@ -6361,7 +4873,7 @@ ./configure --disable-shared --disable-nls - the `--disable-nls' was incorrectly sent to the `make' program. + the "--disable-nls" was incorrectly sent to the "make" program. 2002-01-29 Werner Lemberg @@ -6408,7 +4920,7 @@ 2002-01-21 Antoine Leca - * docs/PATENTS: Typo fixed (thanks to Detlef `Hawkeye' Würkner) in + * docs/PATENTS: Typo fixed (thanks to Detlef "Hawkeye" Würkner) in the URL for the online resource. 2002-01-18 Ian Brown @@ -6468,7 +4980,7 @@ (html_format): Replaced with ... (html_quote): New function. (html_quote0): New function. - (DocCode::dump_html): Small improvement. + (DocCode::dump_html: Small improvement. (DocParagraph::dump, DocBlock::html): Use html_quote0 and html_quote. * include/freetype/config/ftoption.h: Setting default options for @@ -6483,7 +4995,7 @@ * src/autohint/ahhint.c (ah_align_linked_edge): Modified computation of auto-hinted stem widths; this avoids color fringes in - `ClearType-like' rendering. + "ClearType-like" rendering. * src/truetype/ttgload.c (TT_Load_Glyph_Header, TT_Load_Simple_Glyph, TT_Load_Composite_Glyph, load_truetype_glyph): @@ -6510,22 +5022,22 @@ 2002-01-03 Keith Packard * builds/unix/ftsystem.c (FT_New_Stream): Added a fix to ensure that - all FreeType input streams are closed in child processes of a `fork' + all FreeType input streams are closed in child processes of a "fork" on Unix systems. This is important to avoid (potential) access control issues. 2002-01-03 David Turner * src/type1/t1objs.c (T1_Face_Init): Fixed a bug that crashed the - library when dealing with certain weird fonts like `Stalingrad', in - `sadn.pfb' (this font has no full font name entry). + library when dealing with certain weird fonts like "Stalingrad", in + "sadn.pfb" (this font has no full font name entry). * src/base/ftoutln.c, include/freetype/ftoutln.h (FT_Outline_Check): New function to check the consistency of outline data. * src/base/ftobjs.c (FT_Load_Glyph): Use `FT_Outline_Check' to ensure that loaded glyphs are valid. This allows certain fonts like - `tt1095m_.ttf' to be loaded even though it appears they contain + "tt1095m_.ttf" to be loaded even though it appears they contain really funky glyphs. There still is a bug there, though. @@ -6576,8 +5088,8 @@ 2001-12-21 David Turner * src/pshinter/pshrec.c (ps_hints_t2mask, ps_hints_t2counter): - Ignore invalid `hintmask' and `cntrmask' operators (instead of - returning an error). Glyph 2028 of the CFF font `MSung-Light-Acro' + Ignore invalid "hintmask" and "cntrmask" operators (instead of + returning an error). Glyph 2028 of the CFF font "MSung-Light-Acro" couldn't be rendered otherwise (it seems its charstring is buggy, though this requires more analysis). (FT_COMPONENT): Define. @@ -6673,12 +5185,12 @@ routines were never released when CID faces were destroyed. * src/cff/cffload.h, src/cff/cffload.c, src/cff/cffgload.c: Updated - to move the definition of encoding tables back within `cffload.c' + to move the definition of encoding tables back within "cffload.c" instead of making them part of a shared header (causing problems in - `multi' builds). This reverts change 2001-08-08. + "multi" builds). This reverts change 2001-08-08. * docs/CHANGES: Updated for 2.0.6 release. - * docs/TODO: Added `stem3 and counter hints support' to the TODO + * docs/TODO: Added "stem3 and counter hints support" to the TODO list for the Postscript hinter. * docs/BUGS: Closed the AUTOHINT-NO-SBITS bug. @@ -6692,12 +5204,12 @@ that prevented composites from loading correctly, due to missing parentheses around macro parameters. - * src/sfnt/sfobjs.c (SFNT_Load_Face): Make the `post' and `name' + * src/sfnt/sfobjs.c (SFNT_Load_Face): Make the "post" and "name" tables optional to load PCL fonts properly. * src/truetype/ttgload.c (TT_Load_Glyph), src/base/ftobjs.c (FT_Load_Glyph), include/freetype/freetype.h (FT_LOAD_SBITS_ONLY): - `Fixed' the bug that prevented embedded bitmaps to be loaded when + "Fixed" the bug that prevented embedded bitmaps to be loaded when the auto-hinter is used. This actually is a hack but will be enough until the internal re-design scheduled for FreeType 2.1. @@ -6786,9 +5298,9 @@ 2001-12-11 David Turner * builds/unix/freetype-config.in: Modified the script to prevent - passing `-L/usr/lib' to gcc. + passing "-L/usr/lib" to gcc. - * docs/FTL.TXT: Simple fix (change `LICENSE.TXT' to `FTL.TXT'). + * docs/FTL.TXT: Simple fix (change "LICENSE.TXT" to "FTL.TXT"). * builds/unix/freetype2.m4: New file for checking configure paths. We need to install it in $(prefix)/share/aclocal/freetype2.m4 but I @@ -6809,7 +5321,7 @@ 2001-12-10 Francesco Zappa Nardelli * src/pcf/pcfdriver.c (PCF_Init_Face): Allow Xft to use PCF fonts - by setting the `face->metrics.max_advance' correctly. + by setting the "face->metrics.max_advance" correctly. 2001-12-07 David Turner @@ -6908,8 +5420,8 @@ * include/freetype/ttnameid.h: Added some new Microsoft language codes and LCIDs as found in MSDN (Passport SDK). Also added comments about the meaning of bit 57 of the `OS/2' table - (TT_UCR_SURROGATES) which (with OpenType v.1.3) now means `there is - a character beyond 0xFFFF in this font'. Thanks to Detlef Würkner + (TT_UCR_SURROGATES) which (with OpenType v.1.3) now means "there is + a character beyond 0xFFFF in this font". Thanks to Detlef Würkner for noticing this. 2001-11-20 David Turner @@ -6956,7 +5468,7 @@ Fix typos. * tests/gview.c: Updated the debugging glyph viewer to show the - hints generated by the `autohint' module. + hints generated by the "autohint" module. 2001-10-27 David Turner @@ -6967,7 +5479,7 @@ * include/freetype/ftcache.h, include/freetype/cache/*.h, src/cache/*.c: Major re-design of the cache sub-system to provide - better performance as well as an `Acquire'/`Release' API. Seems to + better performance as well as an "Acquire"/"Release" API. Seems to work well here, but probably needs a bit more testing. 2001-10-26 Leonard Rosenthol @@ -7035,7 +5547,7 @@ the source file. * src/base/ftdbgmem.c: New debugging memory manager. You must - define the FT_DEBUG_MEMORY macro in `ftoption.h' to enable it. It + define the FT_DEBUG_MEMORY macro in "ftoption.h" to enable it. It will record every memory block allocated and report simple errors like memory leaks and double deletes. @@ -7089,7 +5601,7 @@ compiler warnings. * src/pshinter/module.mk, src/pshinter/rules.mk: Adding control - files to build the PostScript hinter with the `old' build system. + files to build the PostScript hinter with the "old" build system. 2001-10-19 Jacob Jansen @@ -7099,7 +5611,7 @@ 2001-10-18 David Turner * src/psnames/pstables.h, src/tools/glnames.py: Rewrote the - `glnames.py' script used to generate the `pstables.h' header file. + "glnames.py" script used to generate the "pstables.h" header file. The old one contained a serious bug that made FreeType return incorrect glyph names for certain glyphs. @@ -7141,7 +5653,7 @@ * tests/Jamfile, tests/gview.c: Adding a new glyph hinting viewer/debugger to the source tree. Note that you will _not_ be able to compile it since it depends on an unavailable graphics - library named `Nirvana' to render vector images. + library named "Nirvana" to render vector images. 2001-10-17 David Turner @@ -7263,7 +5775,7 @@ in PDF documents that were automatically generated from TrueType ones). - * src/type1/t1load.c (is_alpha): Now supports `+' in font names; + * src/type1/t1load.c (is_alpha): Now supports "+" in font names; this is used in embedded fonts. * src/psaux/psobjs.c (PS_Table_Add): Fixed a reallocation bug that @@ -7345,7 +5857,7 @@ (cff_get_glyph_index): Minor documentation change. * src/type1/t1driver.c (t1_get_name_index): New function used in - Get_Interface as the function returned when the `name_index' + Get_Interface as the function returned when the "name_index" function is requested. (get_t1_glyph_name): Renamed to t1_get_glyph_name for consistency. @@ -7362,10 +5874,10 @@ * src/cff/cffdrivr.c (cff_get_name_index): New function, returned when `cff_get_interface' is called with a request for the - `name_index' function. + "name_index" function. (cff_get_interface): Modified so that it returns the function - `cff_get_name_index' when the `name_index' function is requested. + `cff_get_name_index' when the "name_index" function is requested. * src/base/ftobjs.c (FT_Get_Name_Index): New function, used to return a glyph index for a given glyph name only if the driver @@ -7511,7 +6023,7 @@ Removing _lots_ of compiler warnings when the most pedantic warning levels of Visual C++ and Borland C++ are used. Too many files to be listed here, but FT2 now compiles without warnings with VC++ and the - `/W4' warning level (lint-style). + "/W4" warning level (lint-style). * include/freetype/freetype.h (FT_New_Memory_Face): Updated documentation. @@ -7585,9 +6097,9 @@ 2001-06-14 David Turner Modified the TrueType interpreter to let it use the new - trigonometric functions provided in `fttrigon.h'. This gets rid of + trigonometric functions provided in "fttrigon.h". This gets rid of some old 64-bit computation routines, as well as many warnings when - compiling the library with the `long long' 64-bit integer type. + compiling the library with the "long long" 64-bit integer type. * include/freetype/config/ftoption.h: Undefine FT_CONFIG_OPTION_OLD_CALCS. @@ -7709,7 +6221,7 @@ 2001-05-25 David Turner - Moved several documents from the top-level to the `docs' directory. + Moved several documents from the top-level to the "docs" directory. * src/base/ftcalc.c (FT_DivFix): Small fix to return value. @@ -7763,9 +6275,9 @@ * builds/newline: New file. * builds/top_level.mk, builds/detect.mk: Use it. This fixes - problems with Make on Windows 2000, as well as problems when `make - distclean' is invoked on a non-Unix platform when there is no - `config.mk' in the current directory. + problems with Make on Windows 2000, as well as problems when "make + distclean" is invoked on a non-Unix platform when there is no + "config.mk" in the current directory. * builds/freetype.mk: Fixed a problem with object deletions under Dos/Windows/OS/2 systems. @@ -7817,7 +6329,7 @@ * src/base/ftcalc.c (FT_MulDiv, FT_MulFix, FT_DivFix): Various tiny fixes related to rounding in 64-bits routines and - pseudo-`optimizations'. + pseudo-"optimizations". 2001-04-27 David Turner @@ -7844,7 +6356,7 @@ fixed-point square root computation. It is now used even with 64-bits integers, as it is _much_ faster than calling FT_Sqrt64 :-) - * src/base/ftbbox.c: Removed invalid `#include FT_BEZIER_H' line. + * src/base/ftbbox.c: Removed invalid "#include FT_BEZIER_H" line. 2001-04-25 David Turner @@ -7862,7 +6374,7 @@ 2001-04-20 David Turner - * ftconfig.h, ftoption.h: Updated `ftconfig.h' to detect 64-bit int + * ftconfig.h, ftoption.h: Updated "ftconfig.h" to detect 64-bit int types on platforms where Autoconf is not available). Also removed FTCALC_USE_LONG_LONG and replaced it with FT_CONFIG_OPTION_FORCE_INT64. @@ -7979,7 +6491,7 @@ 2001-03-20 David Turner * include/freetype/config/ftheader.h, include/freetype/ftsnames.h: - Renamed `ftnames.h' to `ftsnames.h', and FT_NAMES_H to + Renamed "ftnames.h" to "ftsnames.h", and FT_NAMES_H to FT_SFNT_NAMES_H. * docs/docmaker.py: Added generation of INDEX link in table of @@ -7989,8 +6501,8 @@ compilation process has changed slightly (no more `src' required in the include path). - * builds/*/*-def.mk: Changed the objects directory from `obj' to - `objs'. + * builds/*/*-def.mk: Changed the objects directory from "obj" to + "objs". * include/freetype/config/ftheader.h: Removed obsolete macros like FT_SOURCE_FILE, etc. and added cache-specific macro definitions that @@ -7999,7 +6511,7 @@ * src/*/*: Removed the use of FT_SOURCE_FILE, etc. Now, each component needs to add its own directory to the include path at - compile time. Modified all `rules.mk' and `descrip.mms' + compile time. Modified all "rules.mk" and "descrip.mms" accordingly. 2001-03-20 Werner Lemberg @@ -8025,7 +6537,7 @@ compiler warnings in pedantic modes. * include/config/ft2build.h, include/config/ftheader.h: The file - `ft2build.h' was renamed to `ftheader.h' to avoid conflicts with the + "ft2build.h" was renamed to "ftheader.h" to avoid conflicts with the top-level . * include/config/ftheader.h: Added new section describing the #include @@ -8047,7 +6559,7 @@ via FT_Get_Glyph_Name(). (cff_get_interface): Added support for getting a glyph name via the - `glyph_name' module interface. Uses the new function + "glyph_name" module interface. Uses the new function get_cff_glyph_name(). Submitted by Sander van der Wal . @@ -8058,7 +6570,7 @@ Submitted by Sander van der Wal . * src/cff/cffgload.c (CFF_Parse_CharStrings): Added support for - deprecated operator `dotsection'. + deprecated operator "dotsection". Submitted by Sander van der Wal . 2001-03-12 Werner Lemberg @@ -8215,7 +6727,7 @@ * src/cff/cffparse.c (cff_parse_font_matrix): Added logic to get the units_per_EM from the FontMatrix. - (cff_parse_fixed_thousand): New function. Gets a real number from + (cff_parse_fixed_thousand): New function. Gets a real number from the CFF font, but multiplies by 1000 (this is to avoid rounding errors when placing this real number into a 16.16 fixed number). @@ -8244,7 +6756,7 @@ 2001-02-01 David Turner * docs/docmaker.py: Improved the index sorting routine to place - capital letters before small ones. Added the `' marker to + capital letters before small ones. Added the "" marker to section blocks in order to give the order of blocks. 2001-01-30 Antoine Leca @@ -8451,7 +6963,7 @@ * src/smooth/ftgrays.c (grays_convert_glyph): Implement it. * INSTALL: Updated installation instructions on Win32, listing the - new `make setup list' target used to list supported + new "make setup list" target used to list supported compilers/targets. * src/raster/ftraster.c (ft_black_render): Test for unsupported @@ -8469,7 +6981,7 @@ * builds/win32/detect.mk: Added support for the Intel C/C++ compiler, as well as _preliminary_ (read: doesn't work!) support for - Watcom. Also added a new setup target. Type `make setup list' for + Watcom. Also added a new setup target. Type "make setup list" for a list of supported command-line compilers on Win32. * src/base/ftdebug.c: Added dummy symbol to avoid empty file if @@ -8570,16 +7082,16 @@ pointer). * src/base/ftsystem.c (FT_Done_Memory): Fixed an obvious bug: - The ANSI `free()' function was called instead of `memory->free()'. + The ANSI "free()" function was called instead of "memory->free()". * docs/docmaker.py: Added section filtering, multi-page generation (index page generation is still missing though). 2000-12-04 David Turner - * builds/unix/install.mk, builds/unix/ft2unix.h: The file `ft2unix.h' + * builds/unix/install.mk, builds/unix/ft2unix.h: The file "ft2unix.h" is now installed as for Unix systems. Note that we - still use the `freetype2/freetype' installation path for now. + still use the "freetype2/freetype" installation path for now. * */*.[ch]: Now using as the default build and setup configuration file in all public headers. Internal source files @@ -8591,7 +7103,7 @@ * builds/win32/detect.mk, builds/win32/w32-bccd.mk, builds/win32/w32-dev.mk: Changed the developer build targets to - `devel-gcc' and `devel-bcc' in order to be able to develop with the + "devel-gcc" and "devel-bcc" in order to be able to develop with the Borland C++ compiler. 2000-12-01 David Turner @@ -8603,7 +7115,7 @@ * builds/unix/configure.in, builds/unix/configure, builds/cygwin/configure.in, builds/cygwin/configure: Setting - `version_info' to 6:1:0 for the 2.0.1 release. + "version_info" to 6:1:0 for the 2.0.1 release. * CHANGES: Added a summary of changes between 2.0.1 and 2.0. @@ -8630,13 +7142,13 @@ 2000-11-30 David Turner * INSTALL: Slightly updated the quick starter documentation to - include IDE compilation, prevent against BSD Make, and specify `make - setup' instead of a single `make' for build configuration. + include IDE compilation, prevent against BSD Make, and specify "make + setup" instead of a single "make" for build configuration. * include/config/ftbuild.h, include/internal/internal.h: Added new configuration files used to determine the location of all public, configuration, and internal header files for FreeType 2. Modified - all headers under `include/freetype' to reflect this change. Note + all headers under "include/freetype" to reflect this change. Note that we still need to change the library source files themselves though. @@ -8644,7 +7156,7 @@ builds/win32/w32-bcc.mk, builds/win32/w32-bccd.mk, builds/win32/detect.mk: Added new files to support compilation with the free Borland C++ command-line compiler. Modified the detection - rules to recognize the new `bcc32' target in `make setup bcc32'. + rules to recognize the new "bcc32" target in "make setup bcc32". * src/sfnt/ttcmap.c, src/sfnt/ttpost.c, src/sfnt/ttsbit.c, src/truetype/ttobjs.c, src/truetype/ttgload.c, diff --git a/reactos/lib/freetype/Jamfile b/reactos/lib/freetype/Jamfile index 61583c72976..6d944669fc3 100644 --- a/reactos/lib/freetype/Jamfile +++ b/reactos/lib/freetype/Jamfile @@ -1,4 +1,4 @@ -# FreeType 2 top Jamfile (c) 2001, 2002, 2003, 2004 David Turner +# FreeType 2 top Jamfile (c) 2001, 2002, 2003 David Turner # # The HDRMACRO is already defined in FTJam and is used to add @@ -61,8 +61,7 @@ FT2_BUILD_INCLUDE ?= ; # IMPORTANT: You'll need to change the content of "ftmodule.h" as well # if you modify this list or provide your own. # -FT2_COMPONENTS ?= autofit # auto-fitter - gzip # support for gzip-compressed files +FT2_COMPONENTS ?= gzip # support for gzip-compressed files autohint # auto-hinter base # base component (public APIs) bdf # BDF font driver @@ -147,7 +146,7 @@ if $(DEBUG_HINTER) actions RefDoc { - python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.8 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h $(FT2_INCLUDE)/freetype/cache/*.h + python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.5 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h $(FT2_INCLUDE)/freetype/cache/*.h } RefDoc refdoc ; diff --git a/reactos/lib/freetype/Makefile b/reactos/lib/freetype/Makefile index dbf65ebb8db..b54f1df7eab 100644 --- a/reactos/lib/freetype/Makefile +++ b/reactos/lib/freetype/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.8 2004/02/07 00:21:45 navaraf Exp $ +# $Id: Makefile,v 1.9 2004/02/15 21:45:28 gvg Exp $ PATH_TO_TOP = ../.. @@ -37,9 +37,9 @@ all: $(MK_FULLNAME) $(MK_NOSTRIPNAME) objs/*.o objs/libfreetype.a: ifeq ($(DBG), 1) - @$(MAKE) -f Makefile.freetype CC:=$(CC) + @$(MAKE) -f Makefile.freetype CFLAGS="-c -g -Wall" CC:=$(CC) else - @$(MAKE) -f Makefile.freetype CC:=$(CC) + @$(MAKE) -f Makefile.freetype CFLAGS="-c -Wall -O3" CC:=$(CC) endif # Automatic dependency tracking diff --git a/reactos/lib/freetype/README b/reactos/lib/freetype/README index 72baf3d6a2f..b50dd0c5769 100644 --- a/reactos/lib/freetype/README +++ b/reactos/lib/freetype/README @@ -9,7 +9,7 @@ is called `libttf'. They are *not* compatible! - FreeType 2.1.8 + FreeType 2.1.5 ============== Please read the docs/CHANGES file, it contains IMPORTANT INFORMATION. @@ -19,9 +19,9 @@ Note that the FreeType 2 documentation is now available as a separate package from our sites. See: - ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.1.8.tar.bz2 - ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.1.8.tar.gz - ftp://ftp.freetype.org/pub/freetype2/ftdoc218.zip + ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.1.5.tar.bz2 + ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.1.5.tar.gz + ftp://ftp.freetype.org/pub/freetype2/ftdoc215.zip Bugs diff --git a/reactos/lib/freetype/builds/atari/ATARI.H b/reactos/lib/freetype/builds/atari/ATARI.H deleted file mode 100644 index 4e99965061b..00000000000 --- a/reactos/lib/freetype/builds/atari/ATARI.H +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef ATARI_H -#define ATARI_H - -#pragma warn -stu - -/* PureC doesn't like 32bit enumerations */ - -#ifndef FT_IMAGE_TAG -#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value -#endif /* FT_IMAGE_TAG */ - -#ifndef FT_ENC_TAG -#define FT_ENC_TAG( value, a, b, c, d ) value -#endif /* FT_ENC_TAG */ - -#endif /* ATARI_H */ diff --git a/reactos/lib/freetype/builds/atari/FNames.SIC b/reactos/lib/freetype/builds/atari/FNames.SIC deleted file mode 100644 index f3657179d91..00000000000 --- a/reactos/lib/freetype/builds/atari/FNames.SIC +++ /dev/null @@ -1,37 +0,0 @@ -/* the following changes file names for PureC projects */ - -if (argc > 0) -{ - ordner = argv[0]; - if (basename(ordner) == "") /* ist Ordner */ - { - ChangeFilenames(ordner); - } -} - -proc ChangeFilenames(folder) -local i,entries,directory,file; -{ - entries = filelist(directory,folder); - for (i = 0; i < entries; ++i) - { - file = directory[i,0]; - if ((directory[i,3]&16) > 0) /* subdirectory */ - { - ChangeFilenames(folder+file+"\\"); - } - else - { - if ((stricmp(suffix(file),".h")==0)|(stricmp(suffix(file),".c")==0)) - ChangeFilename(folder,file); - } - } -} - -proc ChangeFilename(path,datei) -local newfile,err; -{ - newfile=datei; - newfile[0]=(newfile[0] | 32) ^ 32; - err=files.rename("-q",path+datei,newfile); -} diff --git a/reactos/lib/freetype/builds/atari/FREETYPE.PRJ b/reactos/lib/freetype/builds/atari/FREETYPE.PRJ deleted file mode 100644 index 4e3e6895967..00000000000 --- a/reactos/lib/freetype/builds/atari/FREETYPE.PRJ +++ /dev/null @@ -1,33 +0,0 @@ -;FreeType project file - -FREETYPE.LIB - -.C [-K -P -R -A] -.L [-J -V] -.S - -= - -..\..\src\base\ftsystem.c -..\..\src\base\ftdebug.c - -..\..\src\base\ftinit.c -..\..\src\base\ftglyph.c -..\..\src\base\ftmm -..\..\src\base\ftbbox - -..\..\src\base\ftbase.c -..\..\src\autohint\autohint.c -;..\..\src\cache\ftcache.c -..\..\src\cff\cff.c -..\..\src\cid\type1cid.c -..\..\src\psaux\psaux.c -..\..\src\pshinter\pshinter.c -..\..\src\psnames\psnames.c -..\..\src\raster\raster.c -..\..\src\sfnt\sfnt.c -..\..\src\smooth\smooth.c -..\..\src\truetype\truetype.c -..\..\src\type1\type1.c -..\..\src\type42\type42.c - diff --git a/reactos/lib/freetype/builds/atari/README.TXT b/reactos/lib/freetype/builds/atari/README.TXT deleted file mode 100644 index 04eec63519b..00000000000 --- a/reactos/lib/freetype/builds/atari/README.TXT +++ /dev/null @@ -1,51 +0,0 @@ -Compiling FreeType 2 with PureC compiler -======================================== - -[See below for a German version.] - -To compile FreeType 2 as a library the following changes must be applied: - -- All *.c files must start with an uppercase letter. - (In case GEMSCRIPT is available: - Simply drag the whole FreeType 2 directory to the file `FNames.SIC'.) - -- You have to change the INCLUDE directory in PureC's compiler options - to contain both the `INCLUDE' and `freetype2\include' directory. - Example: - - INCLUDE;E:\freetype2\include - -- The file `freetype2/include/Ft2build.h' must be patched as follows to - include ATARI.H: - - #ifndef __FT2_BUILD_GENERIC_H__ - #define __FT2_BUILD_GENERIC_H__ - - #include "ATARI.H" - - - -Compilieren von FreeType 2 mit PureC -==================================== - -Um FreeType 2 als eine Bibliothek (library) zu compilieren, muss folgendes -ge„ndert werden: - -- Alle *.c-files mssen mit einem GROSSBUCHSTABEN beginnen. - (Falls GEMSCRIPT zur Verfgung steht: - Den kompletten Ordner freetype2 auf die Datei `FNames.SIC' draggen.) - -- In den Compiler-Optionen von PureC muss das INCLUDE directory auf INCLUDE - und freetype2\include verweisen. Z.B.: - - INCLUDE;E:\freetype2\include - -- In der Datei freetype2/include/Ft2build.h muss zu Beginn - ein #include "ATARI.H" wie folgt eingefgt werden: - - #ifndef __FT2_BUILD_GENERIC_H__ - #define __FT2_BUILD_GENERIC_H__ - - #include "ATARI.H" - ---- end of README.TXT --- diff --git a/reactos/lib/freetype/builds/freetype.mk b/reactos/lib/freetype/builds/freetype.mk index 649e22e079b..b9e553ba46f 100644 --- a/reactos/lib/freetype/builds/freetype.mk +++ b/reactos/lib/freetype/builds/freetype.mk @@ -97,7 +97,6 @@ BASE_DIR := $(SRC_DIR)/base # PUBLIC_DIR := $(TOP_DIR)/include/freetype INTERNAL_DIR := $(PUBLIC_DIR)/internal -SERVICES_DIR := $(INTERNAL_DIR)/services CONFIG_DIR := $(PUBLIC_DIR)/config CACHE_DIR := $(PUBLIC_DIR)/cache @@ -156,8 +155,7 @@ OBJECTS_LIST := # changes, the whole library is recompiled. # PUBLIC_H := $(wildcard $(PUBLIC_DIR)/*.h) -BASE_H := $(wildcard $(INTERNAL_DIR)/*.h) \ - $(wildcard $(SERVICES_DIR)/*.h) +BASE_H := $(wildcard $(INTERNAL_DIR)/*.h) CONFIG_H := $(wildcard $(CONFIG_DIR)/*.h) \ $(wildcard $(BUILD_DIR)/freetype/config/*.h) CACHE_H := $(wildcard $(CACHE_DIR)/*.h) @@ -254,7 +252,7 @@ library: $(PROJECT_LIBRARY) refdoc: python $(SRC_DIR)/tools/docmaker/docmaker.py \ --prefix=ft2 \ - --title=FreeType-2.1.7 \ + --title=FreeType-2.1.5 \ --output=$(DOC_DIR) \ $(PUBLIC_DIR)/*.h \ $(PUBLIC_DIR)/config/*.h \ diff --git a/reactos/lib/freetype/builds/toplevel.mk b/reactos/lib/freetype/builds/toplevel.mk index 6ee3818dff5..08f50b42e08 100644 --- a/reactos/lib/freetype/builds/toplevel.mk +++ b/reactos/lib/freetype/builds/toplevel.mk @@ -110,7 +110,6 @@ ifdef check_platform $(RM) builds/unix/config.status $(RM) builds/unix/unix-def.mk $(RM) builds/unix/unix-cc.mk - $(RM) builds/unix/freetype2.pc $(RM) nul endif # test is_unix diff --git a/reactos/lib/freetype/builds/unix/.cvsignore b/reactos/lib/freetype/builds/unix/.cvsignore index 808b600590d..cc8ec6a8dad 100644 --- a/reactos/lib/freetype/builds/unix/.cvsignore +++ b/reactos/lib/freetype/builds/unix/.cvsignore @@ -6,4 +6,3 @@ config.log libtool ftconfig.h freetype-config -freetype2.pc diff --git a/reactos/lib/freetype/builds/unix/aclocal.m4 b/reactos/lib/freetype/builds/unix/aclocal.m4 index c277aed35e0..e63092a429f 100644 --- a/reactos/lib/freetype/builds/unix/aclocal.m4 +++ b/reactos/lib/freetype/builds/unix/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.7.8 -*- Autoconf -*- +# generated automatically by aclocal 1.7.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -12,86 +12,42 @@ # PARTICULAR PURPOSE. -# serial 2 +# serial 1 FT_MUNMAP_DECL -AC_DEFUN([FT_MUNMAP_PARAM], - [AC_MSG_CHECKING([for munmap's first parameter type]) - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([[ +AC_DEFUN(FT_MUNMAP_DECL, +[AC_MSG_CHECKING([whether munmap must be declared]) +AC_CACHE_VAL(ft_cv_munmap_decl, +[AC_TRY_COMPILE([ +#ifdef HAVE_UNISTD_H +#include +#endif +#include ], +[char *(*pfn) = (char *(*))munmap], +ft_cv_munmap_decl=no, +ft_cv_munmap_decl=yes)]) +AC_MSG_RESULT($ft_cv_munmap_decl) +if test $ft_cv_munmap_decl = yes; then + AC_DEFINE(NEED_MUNMAP_DECL,, + [Define to 1 if munmap() is not defined in ]) +fi]) +AC_DEFUN(FT_MUNMAP_PARAM, +[AC_MSG_CHECKING([for munmap's first parameter type]) +AC_TRY_COMPILE([ #include #include -int munmap(void *, size_t); +int munmap(void *, size_t);],, + AC_MSG_RESULT([void *]);AC_DEFINE(MUNMAP_USES_VOIDP,, + [Define to 1 if the first argument of munmap is of type void *]), + AC_MSG_RESULT([char *])) +]) - ]]) - ], - [], - [AC_MSG_RESULT([void *]) - AC_DEFINE([MUNMAP_USES_VOIDP], - [], - [Define to 1 if the first argument of munmap is of type void *])], - [AC_MSG_RESULT([char *])]) - ]) +# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- -# end of ft-munmap.m4 +# serial 46 AC_PROG_LIBTOOL -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 47 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" @@ -102,13 +58,10 @@ AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL +]) - -# AC_LIBTOOL_SETUP -# ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl +[AC_PREREQ(2.13)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl @@ -118,103 +71,15 @@ 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([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH - -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 - -# 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' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_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" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -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 "$LTCC" && LTCC=$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 "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# 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 - # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) @@ -224,78 +89,327 @@ file_magic*) ;; esac -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +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], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) +AC_ARG_ENABLE(libtool-lock, + [ --disable-libtool-lock avoid locking (might break parallel builds)]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -AC_ARG_WITH([pic], - [AC_HELP_STRING([--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 +# 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* + ;; -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP +*-*-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) -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl + # 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])]) -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + 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 -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER +_LT_AC_LTCONFIG_HACK +]) -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX +# 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_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT +# _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* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +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$ac_exeext; 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], -[_LT_AC_SHELL_INIT([ +[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} @@ -313,7 +427,7 @@ if test "X[$]1" = X--no-reexec; then 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 +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else @@ -325,7 +439,7 @@ if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && @@ -370,7 +483,7 @@ else break fi done - IFS="$lt_save_ifs" + IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. @@ -443,291 +556,17 @@ if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then fi AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--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 -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - 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 - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - 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_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - 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 - ;; -AC_PROVIDE_IFELSE([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) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; 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 - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; 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 - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - testring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ - = "XX$testring") >/dev/null 2>&1 && - new_result=`expr "X$testring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - testring=$testring$testring - done - testring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - +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], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : +[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 </dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +# Same as above, but do not quote variable references. +double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' - # 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 . +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && 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_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . - $rm conftest* out/* - rmdir out - cd .. - rmdir conftest - $rm conftest* +# 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* | nonstopux* | 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* | nonstopux*) + 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' + lt_cv_prog_cc_wl='-Wl,' + ;; + + 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 ]) -])# AC_LIBTOOL_PROG_CC_C_O +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" -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- +# 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 -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then +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 @@ -993,77 +1148,764 @@ if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" 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]) + AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS +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]) -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs + if test "$compiler_rtti_exceptions" = "yes"; then + no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' + else + no_builtin_flag=' -fno-builtin' + fi fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR +# 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`sed 1q $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;; + 4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;; + *) 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 + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + 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='-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. Also zsh mangles + # `"' quotes if we put them in here... so don't! + archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -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* | nonstopux*) + 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' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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' + hardcode_libdir_flag_spec='-rpath $libdir' + fi + 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 $compiler_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 $compiler_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) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + 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 + ;; + esac + 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 -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- # Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then +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 "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + ## test "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink + hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate + hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported + hardcode_action=unsupported fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) +AC_MSG_RESULT([$hardcode_action]) -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = 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 -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= +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 @@ -1071,33 +1913,17 @@ if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else AC_MSG_RESULT([no]) fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP +reload_cmds='$LD$reload_flag -o $output$reload_objs' +test -z "$deplibs_check_method" && deplibs_check_method=unknown -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- # PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) +AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= -shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -1107,35 +1933,16 @@ shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case $host_os in aix3*) version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + # AIX has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' ;; aix4* | aix5*) @@ -1145,7 +1952,7 @@ aix4* | aix5*) hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + 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 @@ -1155,31 +1962,33 @@ aix4* | aix5*) # 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 - ;; + 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. + # 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + 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}${shared_ext}$major' + soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH fi + hardcode_into_libs=yes ;; amigaos*) @@ -1189,7 +1998,7 @@ amigaos*) ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -1197,12 +2006,13 @@ beos*) bsdi4*) version_type=linux need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 @@ -1210,55 +2020,29 @@ bsdi4*) cygwin* | mingw* | pw32*) version_type=windows - shrext=".dll" need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) + yes,cygwin*) library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + 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 $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + $install_prog .libs/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac ;; - + 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" -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}${shared_ext} $libname.lib' + library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' @@ -1274,25 +2058,10 @@ darwin* | rhapsody*) # 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}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + 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 - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) @@ -1304,12 +2073,12 @@ freebsd*) version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + 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}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac @@ -1318,11 +2087,7 @@ freebsd*) freebsd2*) shlibpath_overrides_runpath=yes ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on + *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; @@ -1333,8 +2098,8 @@ gnu*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 ;; @@ -1342,45 +2107,14 @@ gnu*) 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 - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac + 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' ;; @@ -1388,29 +2122,21 @@ hpux9* | hpux10* | hpux11*) irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; + *) version_type=irix ;; esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + 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* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; + *-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 ;; @@ -1419,21 +2145,20 @@ irix5* | irix6* | nonstopux*) 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}" - hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. -linux*) +linux-gnu*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 @@ -1456,12 +2181,12 @@ netbsd*) need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 @@ -1471,17 +2196,7 @@ netbsd*) newsos6) version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -1490,47 +2205,46 @@ openbsd*) version_type=sunos need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH 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 + 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' - shrext=".dll" need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf - need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $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" + hardcode_into_libs=yes ;; sco3.2v5*) version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; @@ -1538,8 +2252,8 @@ solaris*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 @@ -1549,7 +2263,7 @@ solaris*) sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + 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 @@ -1561,8 +2275,8 @@ sunos4*) sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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) @@ -1583,950 +2297,39 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) 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${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && test "X$CXX" != "Xno"; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# 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_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# 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], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [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. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# 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_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# 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], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [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. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# 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_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# 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], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [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. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# 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_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# 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_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -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_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -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 - IFS="$lt_save_ifs" - 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="$lt_save_ifs" - MAGIC_CMD="$lt_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_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$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_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the path to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--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([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])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 $CC]) - 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. - [[\\/]]* | ?:[[\\/]]*) - 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 - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - 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. - case `"$lt_cv_path_LD" -v 2>&1 &1 /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_file_magic_cmd=/usr/bin/file - case "$host_cpu" in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - 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_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - irix5* | nonstopux*) - # 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*) - case $host_cpu in - alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) - 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]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - 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 - ;; - -nto-qnx) - lt_cv_deplibs_check_method=unknown - ;; - -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 - ;; - -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 - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the path to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - 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 - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - 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 - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_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* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and LTDLINCL 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 - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided and an installed libltdl is not found, it is -# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' -# and LTDLINCL 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, lt_dlinit, - [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 - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`]) -])# _LT_AC_LANG_CXX - - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# -------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# -# Check for any special shared library compilation flags. -# -_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' - ;; - esac -fi -if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then - AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) - _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) - - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_DLOPEN_SELF($1) - -# Report which librarie types wil actually be built +# Report the final consequences. AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) @@ -2549,34 +2352,6 @@ aix4*) test "$enable_shared" = yes && enable_static=no fi ;; - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - *) # Darwin 1.3 on - test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-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. Also zsh mangles - # `"' quotes if we put them in here... so don't! - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - fi - ;; esac AC_MSG_RESULT([$enable_shared]) @@ -2585,1292 +2360,111 @@ AC_MSG_CHECKING([whether to build static libraries]) test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cc - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +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 -if test "$GXX" = yes; then - # Set up default GNU C++ configuration +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_PROG_LD +AC_LIBTOOL_DLOPEN_SELF - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + 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 - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= + 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} -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - 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 - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - 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. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-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 does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=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. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - *) # Darwin 1.3 on - test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - fi - ;; - - dgux*) - case $cc_basename in - ec++) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*|hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc) - # Intel C++ - with_gnu_ld=yes - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - cxx) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - osf3*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sco*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_DLOPEN_SELF($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < "${ofile}T" +#! $SHELL -ifelse([$1], [], - [cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - AC_MSG_NOTICE([creating $ofile])], - [cfgfile="$ofile"]) - - cat <<__EOF__ >> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# `$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, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: +# 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 @@ -3926,21 +2503,17 @@ ifelse([$1], [], # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# A sed program that does not truncate output. +# A sed that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e s/^X//" +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 -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) +# ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: @@ -3954,10 +2527,7 @@ build_libtool_libs=$enable_shared build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) +build_libtool_need_lc=$need_lc # Whether or not to optimize for fast installation. fast_install=$enable_fast_install @@ -3973,20 +2543,14 @@ echo=$lt_echo AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) +# The default C compiler. +CC=$lt_CC # Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP +with_gcc=$GCC # The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) +LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S @@ -4017,7 +2581,7 @@ reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) +wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" @@ -4025,21 +2589,18 @@ objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" -# Shared library suffix (normally ".so"). -shrext='$shrext' - # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_flag=$lt_pic_flag pic_mode=$pic_mode -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - # Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) +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 @@ -4060,19 +2621,19 @@ dlopen_self=$enable_dlopen_self dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) +link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) +no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) +whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) +thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type @@ -4089,50 +2650,26 @@ soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +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_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) +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_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -4140,10 +2677,10 @@ deplibs_check_method=$lt_deplibs_check_method file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) +allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) +no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds @@ -4152,13 +2689,13 @@ finish_cmds=$lt_finish_cmds finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe +global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +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_lt_cv_sys_global_symbol_to_c_name_address +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 @@ -4170,45 +2707,36 @@ shlibpath_var=$shlibpath_var shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) +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_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) +hardcode_libdir_separator=$lt_hardcode_libdir_separator -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) +hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) +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=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) +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=$_LT_AC_TAGVAR(link_all_deplibs, $1) +link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec @@ -4217,33 +2745,30 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" +fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) +always_export_symbols=$always_export_symbols # The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) +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_[]_LT_AC_TAGVAR(exclude_expsyms, $1) +exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) +include_expsyms=$lt_include_expsyms -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) +# ### END LIBTOOL CONFIG __EOF__ -ifelse([$1],[], [ case $host_os in aix3*) - cat <<\EOF >> "$cfgfile" + 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 @@ -4256,1493 +2781,11 @@ EOF ;; esac - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -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 -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# 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 from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# 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_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_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 - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_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. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGISTW]]' ;; -esac - -# 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 grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' 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_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - 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 -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - cxx) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $CC in - icc|ecc) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - ccc) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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 - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp 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'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_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 - - _LT_AC_TAGVAR(ld_shlibs, $1)=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/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=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 - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$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)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=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't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=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 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - 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. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-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 does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=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. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$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)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi4*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - 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. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$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. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - *) # Darwin 1.3 on - test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-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. Also zsh mangles - # `"' quotes if we put them in here... so don't! - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=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*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$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' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$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 - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$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' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$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 - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$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' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$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' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4.2uw2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv5*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -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 - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -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 - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) 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]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ + 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 @@ -5776,13 +2819,748 @@ AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # return TRUE; # } # /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C + # 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)]) -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) +# 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 dependent 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* | nonstopux*) + case $host_os in + irix5* | nonstopux*) + # 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 | mips | mipsel | powerpc* | sparc* | ia64*) + 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 + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + 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 LTDLINCL to the include flags for +# the libltdl header and adds --enable-ltdl-convenience to the +# configure arguments. Note that LIBLTDL and LTDLINCL 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 LTDLINCL 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 + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +]) + +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl installable library and LTDLINCL to the include flags for +# the libltdl header and adds --enable-ltdl-install to the configure +# arguments. Note that LIBLTDL and LTDLINCL 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 LTDLINCL 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 + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) @@ -5796,16 +3574,6 @@ 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]) -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # @@ -5819,51 +3587,79 @@ AC_DEFUN([LT_AC_PROG_SED], AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. +as_executable_p="test -f" as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do + for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext" fi done done done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && break - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed + + # 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/sedXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/sed$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + _max=0 + _count=0 + # Add /usr/xpg4/bin/sed as it is typically found on Solaris + # along with /bin/sed that truncates output. + for _sed in $_sed_list /usr/xpg4/bin/sed; do + test ! -f ${_sed} && break + cat /dev/null > "$tmp/sed.in" + _count=0 + echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in" + # Check for GNU sed and select it if it is found. + if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then + lt_cv_path_SED=${_sed} + break fi + while true; do + cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" + mv "$tmp/sed.tmp" "$tmp/sed.in" + cp "$tmp/sed.in" "$tmp/sed.nl" + echo >>"$tmp/sed.nl" + ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break + cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break + # 40000 chars as input seems more than enough + test $_count -gt 10 && break + _count=`expr $_count + 1` + if test $_count -gt $_max; then + _max=$_count + lt_cv_path_SED=$_sed + fi + done done -done -SED=$lt_cv_path_SED + rm -rf "$tmp" ]) +if test "X$SED" != "X"; then + lt_cv_path_SED=$SED +else + SED=$lt_cv_path_SED +fi AC_MSG_RESULT([$SED]) ]) diff --git a/reactos/lib/freetype/builds/unix/config.guess b/reactos/lib/freetype/builds/unix/config.guess index 193e328202a..78f6b92cd30 100644 --- a/reactos/lib/freetype/builds/unix/config.guess +++ b/reactos/lib/freetype/builds/unix/config.guess @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-10-16' +timestamp='2003-01-10' # 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 @@ -106,7 +106,6 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; @@ -221,9 +220,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - pegasos:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -239,56 +235,74 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + *:MicroBSD:*:*) + echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac # 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 -o $dummy $dummy.s 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 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - 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 @@ -310,9 +324,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; @@ -330,9 +341,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; @@ -740,7 +748,7 @@ EOF echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` @@ -748,11 +756,6 @@ EOF FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-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 ;; @@ -774,10 +777,7 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/KFreeBSD systems have a "k" prefix to indicate we are using - # FreeBSD's kernel, but not the complete OS. - case ${LIBC} in gnu) kernel_only='k' ;; esac - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -788,8 +788,8 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + x86:Interix*:3*) + echo i586-pc-interix3 exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks @@ -810,22 +810,14 @@ EOF echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) - # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -904,9 +896,6 @@ EOF s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -964,9 +953,6 @@ EOF LIBC=gnuaout #endif #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 @@ -1068,7 +1054,7 @@ EOF exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[345]??:*: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 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.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 | SDS2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1183,7 +1169,7 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*) + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1224,9 +1210,6 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/reactos/lib/freetype/builds/unix/config.sub b/reactos/lib/freetype/builds/unix/config.sub index e1e455b776e..04baf3d80d1 100644 --- a/reactos/lib/freetype/builds/unix/config.sub +++ b/reactos/lib/freetype/builds/unix/config.sub @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-11-03' +timestamp='2003-01-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -118,8 +118,7 @@ esac # 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* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -229,14 +228,13 @@ case $basic_machine in | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ + | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ + | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ @@ -249,7 +247,6 @@ case $basic_machine in | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ @@ -260,11 +257,11 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ + | tahoe | thumb | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ @@ -299,7 +296,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -307,7 +304,7 @@ case $basic_machine in | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ + | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ @@ -322,7 +319,6 @@ case $basic_machine in | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ @@ -333,13 +329,11 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ + | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ @@ -377,9 +371,6 @@ case $basic_machine in basic_machine=a29k-none os=-bsd ;; - amd64) - basic_machine=x86_64-pc - ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -744,10 +735,6 @@ case $basic_machine in basic_machine=or32-unknown os=-coff ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose @@ -779,24 +766,18 @@ case $basic_machine in pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; - pentiumii | pentium2 | pentiumiii | pentium3) + pentiumii | pentium2) basic_machine=i686-pc ;; - pentium4) - basic_machine=i786-pc - ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; pn) basic_machine=pn-gould ;; @@ -855,10 +836,6 @@ case $basic_machine in sb1el) basic_machine=mipsisa64sb1el-unknown ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; sequent) basic_machine=i386-sequent ;; @@ -866,9 +843,6 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; - sh64) - basic_machine=sh64-unknown - ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks @@ -943,18 +917,14 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; + tic4x | c4x*) + basic_machine=tic4x-unknown + os=-coff + ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; tx39) basic_machine=mipstx39-unknown ;; @@ -968,10 +938,6 @@ case $basic_machine in tower | tower-32) basic_machine=m68k-ncr ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; udi29k) basic_machine=a29k-amd os=-udi @@ -1061,7 +1027,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) basic_machine=sh-unknown ;; sh64) @@ -1140,19 +1106,19 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ + | -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* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) + | -powermax* | -dnix* | -microbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1176,9 +1142,6 @@ case $os in -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1191,9 +1154,6 @@ case $os in -opened*) os=-openedition ;; - -os400*) - os=-os400 - ;; -wince*) os=-wince ;; @@ -1237,9 +1197,6 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) - os=-tpf - ;; -triton*) os=-sysv3 ;; @@ -1270,12 +1227,6 @@ case $os in -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; -none) ;; *) @@ -1307,9 +1258,6 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1488,15 +1436,9 @@ case $basic_machine in -mvs* | -opened*) vendor=ibm ;; - -os400*) - vendor=ibm - ;; -ptx*) vendor=sequent ;; - -tpf*) - vendor=ibm - ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; diff --git a/reactos/lib/freetype/builds/unix/configure b/reactos/lib/freetype/builds/unix/configure index 251f9e5cc33..cfcf8bdcf1d 100644 --- a/reactos/lib/freetype/builds/unix/configure +++ b/reactos/lib/freetype/builds/unix/configure @@ -1,8 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. +# Generated by GNU Autoconf 2.54. # -# Copyright (C) 2003 Free Software Foundation, Inc. +# 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. ## --------------------- ## @@ -19,10 +20,9 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -36,12 +36,9 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME +for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -85,15 +82,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conf$$.sh + rm -f conftest.sh fi @@ -218,17 +215,16 @@ rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else - test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS @@ -241,6 +237,17 @@ IFS=" $as_nl" $as_unset CDPATH +# 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} @@ -259,7 +266,7 @@ if test "X$1" = X--no-reexec; then 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 +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else @@ -271,7 +278,7 @@ if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && @@ -316,7 +322,7 @@ else break fi done - IFS="$lt_save_ifs" + IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. @@ -390,11 +396,6 @@ fi - -tagnames=`echo "$tagnames,CXX" | sed 's/^,//'` - -tagnames=`echo "$tagnames,F77" | sed 's/^,//'` - # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. @@ -463,7 +464,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS version_info ft_version build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP XX_CFLAGS XX_ANSIFLAGS RMF RMDIR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA EGREP FTSYS_SRC LIBZ SYSTEM_ZLIB LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS version_info ft_version build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP XX_CFLAGS XX_ANSIFLAGS RMF RMDIR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA EGREP FTSYS_SRC LIBZ SYSTEM_ZLIB LN_S ECHO RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LIBTOOL LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -822,7 +823,7 @@ done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -862,10 +863,10 @@ if test -z "$srcdir"; then # 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 || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -924,26 +925,6 @@ 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 -ac_env_CXXCPP_set=${CXXCPP+set} -ac_env_CXXCPP_value=$CXXCPP -ac_cv_env_CXXCPP_set=${CXXCPP+set} -ac_cv_env_CXXCPP_value=$CXXCPP -ac_env_F77_set=${F77+set} -ac_env_F77_value=$F77 -ac_cv_env_F77_set=${F77+set} -ac_cv_env_F77_value=$F77 -ac_env_FFLAGS_set=${FFLAGS+set} -ac_env_FFLAGS_value=$FFLAGS -ac_cv_env_FFLAGS_set=${FFLAGS+set} -ac_cv_env_FFLAGS_value=$FFLAGS # # Report the --help message. @@ -977,9 +958,9 @@ _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1019,24 +1000,18 @@ if test -n "$ac_init_help"; then Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --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] + --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) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --without-zlib use internal zlib instead of system-wide - --with-old-mac-fonts allow Mac resource-based fonts to be used - --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-tags[=TAGS] - include additional configurations [automatic] + --without-zlib use internal zlib instead of system-wide + --with-old-mac-fonts allow Mac resource-based fonts to be used + --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 Some influential environment variables: CC C compiler command @@ -1046,11 +1021,6 @@ Some influential environment variables: 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 - CXXCPP C++ preprocessor - F77 Fortran 77 compiler command - FFLAGS Fortran 77 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. @@ -1088,45 +1058,12 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -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. @@ -1137,7 +1074,7 @@ esac echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then + test -f $ac_srcdir/configure.in; then echo $ac_configure --help else @@ -1151,7 +1088,8 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -Copyright (C) 2003 Free Software Foundation, Inc. +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 @@ -1163,7 +1101,7 @@ 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.59. Invocation command line was +generated by GNU Autoconf 2.54. Invocation command line was $ $0 $@ @@ -1215,54 +1153,24 @@ _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= -ac_configure_args0= -ac_configure_args1= ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 +for ac_arg do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done + 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 + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1286,12 +1194,12 @@ _ASBOX 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" + "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" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } @@ -1320,7 +1228,7 @@ _ASBOX for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi @@ -1339,7 +1247,7 @@ _ASBOX echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && + rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -1419,7 +1327,7 @@ fi # 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 + 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" @@ -1436,13 +1344,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) 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:$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:$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:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. @@ -1492,17 +1400,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_config_headers="$ac_config_headers ftconfig.h:ftconfig.in" -# Don't forget to update docs/VERSION.DLL! -version_info='9:6:3' +version_info='9:4:3' ft_version=`echo $version_info | tr : .` - -# checks for system type - ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -1611,9 +1516,6 @@ test -n "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- - -# checks for programs - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1923,10 +1825,8 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} +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. @@ -1950,11 +1850,8 @@ ac_compiler=`set X $ac_compile; echo $2` (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" int main () @@ -1965,12 +1862,12 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +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 file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +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 @@ -1984,39 +1881,27 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 # 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= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].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, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + 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 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 +check \`config.log' for details." >&5 echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} +check \`config.log' for details." >&2;} { (exit 77); exit 77; }; } fi @@ -2043,11 +1928,9 @@ if test "$cross_compiling" != yes; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 +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'. -See \`config.log' for more details." >&2;} +If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi @@ -2055,7 +1938,7 @@ fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext b.out +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. @@ -2080,16 +1963,14 @@ for ac_file in conftest.exe conftest conftest.*; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + export ac_cv_exeext + break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} + { { 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 @@ -2106,11 +1987,8 @@ if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" int main () @@ -2135,12 +2013,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} +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 @@ -2156,11 +2031,8 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" int main () @@ -2175,21 +2047,11 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2198,11 +2060,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -2218,11 +2079,8 @@ if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" int main () @@ -2234,21 +2092,11 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2257,11 +2105,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +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 @@ -2288,11 +2135,8 @@ else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include #include #include @@ -2315,16 +2159,6 @@ static char *f (char * (*g) (char **, int), char **p, ...) va_end (v); return s; } - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2351,21 +2185,11 @@ do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2375,10 +2199,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext +rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC @@ -2406,28 +2229,19 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { 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 ();' \ @@ -2435,13 +2249,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration +#line $LINENO "configure" +#include "confdefs.h" #include +$ac_declaration int main () { @@ -2452,21 +2263,11 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2475,17 +2276,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 : else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 continue fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_declaration int main () @@ -2497,21 +2294,11 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2520,10 +2307,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then @@ -2534,10 +2320,9 @@ fi else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +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' @@ -2567,22 +2352,13 @@ for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error +#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 @@ -2594,7 +2370,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2605,8 +2380,7 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi @@ -2615,11 +2389,8 @@ 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 @@ -2632,7 +2403,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2644,8 +2414,7 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break @@ -2674,22 +2443,13 @@ for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error +#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 @@ -2701,7 +2461,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2712,8 +2471,7 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi @@ -2722,11 +2480,8 @@ 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 @@ -2739,7 +2494,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2751,8 +2505,7 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break @@ -2765,10 +2518,8 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} + { { 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 @@ -2779,31 +2530,25 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# get compiler flags right - if test "x$CC" = xgcc; then XX_CFLAGS="-Wall" XX_ANSIFLAGS="-pedantic -ansi" else case "$host" in - *-dec-osf*) - CFLAGS= - XX_CFLAGS="-std1 -g3" - XX_ANSIFLAGS= - ;; - *) - XX_CFLAGS= - XX_ANSIFLAGS= - ;; + *-dec-osf*) + CFLAGS= + XX_CFLAGS="-std1 -g3" + XX_ANSIFLAGS= + ;; + *) + XX_CFLAGS= + XX_ANSIFLAGS= + ;; esac fi - -# auxiliary programs - # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -2875,11 +2620,6 @@ echo "${ECHO_T}no" >&6 fi - -# Since this file will be finally moved to another directory we make -# the path of the install script absolute. This small code snippet has -# been taken from automake's `ylwrap' script. - # 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: @@ -2891,7 +2631,6 @@ fi # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 @@ -2908,7 +2647,6 @@ do case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -2916,20 +2654,20 @@ case $as_dir/ in # 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 + 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 ;; @@ -2960,16 +2698,13 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' case "$INSTALL" in -/*) - ;; -*/*) - INSTALL="`pwd`/$INSTALL" ;; + /*) + ;; + */*) + INSTALL="`pwd`/$INSTALL" ;; esac -# checks for header files - - echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 @@ -2992,63 +2727,44 @@ if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include #include #include #include -int -main () -{ - - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 + (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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF @@ -3065,11 +2781,8 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF @@ -3089,20 +2802,16 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#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 ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -3113,7 +2822,7 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) + || toupper (i) != TOUPPER (i)) exit(2); exit (0); } @@ -3133,12 +2842,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -3163,7 +2871,7 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.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 @@ -3172,32 +2880,19 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#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>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3206,11 +2901,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +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 @@ -3242,31 +2936,18 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#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>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3275,11 +2956,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3287,11 +2967,8 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 @@ -3304,7 +2981,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3315,8 +2991,7 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3324,43 +2999,26 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) +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 compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: 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: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: 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;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +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" + 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 @@ -3376,20 +3034,14 @@ fi done - -# checks for typedefs, structures, and compiler characteristics - echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" int main () @@ -3447,21 +3099,11 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3470,11 +3112,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_c_const=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 @@ -3492,11 +3133,8 @@ if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -3511,21 +3149,11 @@ if (sizeof (int)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3534,11 +3162,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_int=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6 @@ -3556,11 +3183,8 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -3574,21 +3198,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3597,11 +3211,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -3615,21 +3226,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3638,27 +3239,22 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -3672,21 +3268,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3695,11 +3281,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -3713,21 +3296,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3736,35 +3309,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -3778,21 +3346,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3801,34 +3359,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77" >&5 +echo "$as_me: error: cannot compute sizeof (int), 77" >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default long longval () { return (long) (sizeof (int)); } unsigned long ulongval () { return (long) (sizeof (int)); } @@ -3876,16 +3426,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77" >&5 +echo "$as_me: error: cannot compute sizeof (int), 77" >&2;} { (exit 1); exit 1; }; } fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -3906,11 +3453,8 @@ if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -3925,21 +3469,11 @@ if (sizeof (long)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3948,11 +3482,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6 @@ -3970,11 +3503,8 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -3988,21 +3518,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4011,11 +3531,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -4029,21 +3546,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4052,27 +3559,22 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -4086,21 +3588,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4109,11 +3601,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -4127,21 +3616,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4150,35 +3629,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default int main () @@ -4192,21 +3666,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4215,34 +3679,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77" >&5 +echo "$as_me: error: cannot compute sizeof (long), 77" >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default long longval () { return (long) (sizeof (long)); } unsigned long ulongval () { return (long) (sizeof (long)); } @@ -4290,16 +3746,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77" >&5 +echo "$as_me: error: cannot compute sizeof (long), 77" >&2;} { (exit 1); exit 1; }; } fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -4316,10 +3769,6 @@ _ACEOF -# checks for library functions - -# Here we check whether we can use our mmap file component. - for ac_header in stdlib.h unistd.h @@ -4338,31 +3787,18 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#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>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4371,11 +3807,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -4383,11 +3818,8 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 @@ -4400,7 +3832,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4411,8 +3842,7 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4420,43 +3850,26 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) +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 compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: 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: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: 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;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +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" + 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 @@ -4481,73 +3894,43 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - +#line $LINENO "configure" +#include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - + 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) (); + +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 -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} +f = $ac_func; #endif -int -main () -{ -return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4556,12 +3939,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +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 @@ -4582,11 +3963,8 @@ else ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc @@ -4689,9 +4067,9 @@ main () data2 = (char *) malloc (2 * pagesize); if (!data2) exit (1); - data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); + data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) + MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) @@ -4729,12 +4107,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 @@ -4753,32 +4130,69 @@ if test "$ac_cv_func_mmap_fixed_mapped" != yes; then else FTSYS_SRC='$(BUILD_DIR)/ftsystem.c' - echo "$as_me:$LINENO: checking whether munmap is declared" >&5 -echo $ECHO_N "checking whether munmap is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_munmap+set}" = set; then + echo "$as_me:$LINENO: checking whether munmap must be declared" >&5 +echo $ECHO_N "checking whether munmap must be declared... $ECHO_C" >&6 +if test "${ft_cv_munmap_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - +#line $LINENO "configure" +#include "confdefs.h" #ifdef HAVE_UNISTD_H #include #endif #include - - - int main () { -#ifndef munmap - char *p = (char *) munmap; -#endif +char *(*pfn) = (char *(*))munmap + ; + 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 + ft_cv_munmap_decl=no +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ft_cv_munmap_decl=yes +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi + +echo "$as_me:$LINENO: result: $ft_cv_munmap_decl" >&5 +echo "${ECHO_T}$ft_cv_munmap_decl" >&6 +if test $ft_cv_munmap_decl = yes; then + +cat >>confdefs.h <<\_ACEOF +#define NEED_MUNMAP_DECL +_ACEOF + +fi + echo "$as_me:$LINENO: checking for munmap's first parameter type" >&5 +echo $ECHO_N "checking for munmap's first parameter type... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#include +#include +int munmap(void *, size_t); +int +main () +{ ; return 0; @@ -4786,108 +4200,29 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { 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_have_decl_munmap=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_munmap=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_munmap" >&5 -echo "${ECHO_T}$ac_cv_have_decl_munmap" >&6 -if test $ac_cv_have_decl_munmap = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MUNMAP 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MUNMAP 0 -_ACEOF - - -fi - - - - echo "$as_me:$LINENO: checking for munmap's first parameter type" >&5 -echo $ECHO_N "checking for munmap's first parameter type... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -#include -#include -int munmap(void *, size_t); - - - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -echo "$as_me:$LINENO: result: void *" >&5 -echo "${ECHO_T}void *" >&6 - + echo "$as_me:$LINENO: result: void *" >&5 +echo "${ECHO_T}void *" >&6; cat >>confdefs.h <<\_ACEOF #define MUNMAP_USES_VOIDP _ACEOF +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:$LINENO: result: char *" >&5 +echo "${ECHO_T}char *" >&6 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi @@ -4903,73 +4238,43 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - +#line $LINENO "configure" +#include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - + 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) (); + +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 -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} +f = $ac_func; #endif -int -main () -{ -return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4978,12 +4283,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +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 @@ -4997,9 +4300,6 @@ done -# Check for system zlib - - # Check whether --with-zlib or --without-zlib was given. if test "${with_zlib+set}" = set; then withval="$with_zlib" @@ -5014,11 +4314,8 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -5037,21 +4334,11 @@ gzsetparams (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5060,12 +4347,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_lib_z_gzsetparams=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_lib_z_gzsetparams=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +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 @@ -5084,31 +4369,18 @@ else echo "$as_me:$LINENO: checking zlib.h usability" >&5 echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#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>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5117,11 +4389,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -5129,11 +4400,8 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking zlib.h presence" >&5 echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 @@ -5146,7 +4414,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -5157,8 +4424,7 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -5166,36 +4432,19 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) +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 compiler's result" >&5 -echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) + { 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: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: zlib.h: section \"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;} - { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +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 @@ -5223,9 +4472,6 @@ if test x$with_zlib != xno && test -n "$LIBZ"; then fi -# Whether to use Mac OS resource-based fonts or not - - # Check whether --with-old-mac-fonts or --without-old-mac-fonts was given. if test "${with_old_mac_fonts+set}" = set; then withval="$with_old_mac_fonts" @@ -5244,137 +4490,83 @@ fi - - # 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. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac +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. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac +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. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac +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; - -echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 -if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && break - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -SED=$lt_cv_path_SED - +# 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 -echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6 - # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then @@ -5386,8 +4578,8 @@ 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 $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + 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 @@ -5397,12 +4589,12 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 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'` + 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%/%"` + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; @@ -5426,26 +4618,22 @@ if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" 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. - case `"$lt_cv_path_LD" -v 2>&1 &1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break - ;; - *) + else test "$with_gnu_ld" != yes && break - ;; - esac + fi fi done - IFS="$lt_save_ifs" + IFS="$ac_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi @@ -5468,14 +4656,11 @@ 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. -case `"$LD" -v 2>&1 &1 &5; then lt_cv_prog_gnu_ld=yes - ;; -*) +else lt_cv_prog_gnu_ld=no - ;; -esac +fi fi echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 @@ -5492,11 +4677,7 @@ 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 -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' +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 @@ -5507,42 +4688,120 @@ else # Let the user override the test. lt_cv_path_NM="$NM" else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" 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 + 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 - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + 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 - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - 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 - ;; - esac - esac + 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="$lt_save_ifs" + IFS="$ac_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6 + NM="$lt_cv_path_NM" +echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_executable_p="test -f" +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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext" + fi + done + done +done + + # 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/sedXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/sed$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + _max=0 + _count=0 + # Add /usr/xpg4/bin/sed as it is typically found on Solaris + # along with /bin/sed that truncates output. + for _sed in $_sed_list /usr/xpg4/bin/sed; do + test ! -f ${_sed} && break + cat /dev/null > "$tmp/sed.in" + _count=0 + echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in" + # Check for GNU sed and select it if it is found. + if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then + lt_cv_path_SED=${_sed} + break + fi + while true; do + cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" + mv "$tmp/sed.tmp" "$tmp/sed.in" + cp "$tmp/sed.in" "$tmp/sed.nl" + echo >>"$tmp/sed.nl" + ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break + cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break + # 40000 chars as input seems more than enough + test $_count -gt 10 && break + _count=`expr $_count + 1` + if test $_count -gt $_max; then + _max=$_count + lt_cv_path_SED=$_sed + fi + done + done + rm -rf "$tmp" + +fi + +if test "X$SED" != "X"; then + lt_cv_path_SED=$SED +else + SED=$lt_cv_path_SED +fi +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 @@ -5570,7 +4829,7 @@ lt_cv_deplibs_check_method='unknown' # '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 extended regex. +# 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. @@ -5590,24 +4849,21 @@ bsdi4*) ;; cygwin* | mingw* | pw32*) - # win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='win32_libid' + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) - # this will be overwritten by pass_all, but leave it in just in case 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=`/System/Library/Frameworks/System.framework/System` + 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 - lt_cv_deplibs_check_method=pass_all ;; freebsd*) @@ -5630,22 +4886,10 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -hpux10.20* | hpux11*) +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 - case "$host_cpu" in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - 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_test_file=/usr/lib/libc.sl - ;; - esac + lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6* | nonstopux*) @@ -5670,9 +4914,9 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux*) +linux-gnu*) case $host_cpu in - alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) + alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM @@ -5683,9 +4927,9 @@ linux*) netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; @@ -5695,10 +4939,6 @@ newos6*) lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; -nto-qnx) - lt_cv_deplibs_check_method=unknown - ;; - openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` @@ -5725,6 +4965,10 @@ solaris*) 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) @@ -5748,10 +4992,6 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ;; esac ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; esac fi @@ -5759,1259 +4999,16 @@ 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 -test -z "$deplibs_check_method" && deplibs_check_method=unknown -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# 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 -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > 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 - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 5804 "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 - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - 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 - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > 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.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -lt_cv_cc_needs_belf=no -fi -rm -f conftest.err 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 - -need_locks="$enable_libtool_lock" - - - -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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_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 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&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 - -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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cxx_g=no -fi -rm -f conftest.err 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 \ - '' \ - '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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err 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=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 - -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 -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 -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6 -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -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 - - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran - 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_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # 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_F77="$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 -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$F77" && break - done -fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran -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_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_F77="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_F77" && break -done - - F77=$ac_ct_F77 -fi - - -# Provide some information about the compiler. -echo "$as_me:6794:" \ - "checking for Fortran 77 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); } -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_f77_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_f77_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= - fi -fi - -G77=`test $ac_compiler_gnu = yes && echo yes` -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 - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - i=0 - testring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ - = "XX$testring") >/dev/null 2>&1 && - new_result=`expr "X$testring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - testring=$testring$testring - done - testring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 -else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 -fi - # 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 from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +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 @@ -7029,10 +5026,10 @@ sympat='\([_A-Za-z][_A-Za-z0-9]*\)' symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" +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_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/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'" # Define system-specific variables. case $host_os in @@ -7043,11 +5040,8 @@ cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + 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* | nonstopux*) symcode='[BCDEGRST]' @@ -7065,27 +5059,25 @@ esac # Handle CRLF in mingw tool chain opt_cr= -case $build_os in +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. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGISTW]' ;; -esac +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'" +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 </dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then + 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" { @@ -7128,27 +5120,27 @@ extern "C" { EOF # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * +# define lt_ptr void * #else -# define lt_ptr_t char * +# define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; - lt_ptr_t address; + lt_ptr address; } lt_preloaded_symbols[] = { EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} + {0, (lt_ptr) 0} }; #ifdef __cplusplus @@ -7157,19 +5149,19 @@ EOF EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + 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${ac_exeext}; then + (exit $ac_status); } && test -s conftest$ac_exeext; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -7195,10 +5187,16 @@ done fi +global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= + 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 "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then +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 @@ -7206,150 +5204,264 @@ else echo "${ECHO_T}ok" >&6 fi -echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6 -if test "${lt_cv_objdir+set}" = set; then + +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=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; 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 - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs + 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 - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs + 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 -rmdir .libs 2>/dev/null + +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 -echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6 -objdir=$lt_cv_objdir +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 -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 -# 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' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_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" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; 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_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # 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_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; 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_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="ar" - 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_AR" && ac_cv_prog_ac_ct_AR="false" -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - AR=$ac_ct_AR -else - AR="$ac_cv_prog_AR" -fi - 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 @@ -7511,6 +5623,135 @@ else 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 5641 "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" + +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" @@ -7519,18 +5760,40 @@ test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$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 "$SED" && SED=sed 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' @@ -7548,150 +5811,24 @@ if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi -# 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 +# 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 - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - 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="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac + # 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 -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_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - 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="$lt_save_ifs" - MAGIC_CMD="$lt_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 - -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 # Check whether --with-pic or --without-pic was given. @@ -7703,447 +5840,410 @@ else fi; test -z "$pic_mode" && pic_mode=default -# Use C for the default configuration in the libtool script -tagname= -lt_save_CC="$CC" -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 - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# -# Check for any special shared library compilation flags. -# -lt_prog_cc_shlib= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - lt_prog_cc_shlib='-belf' - ;; - esac -fi -if test -n "$lt_prog_cc_shlib"; then - { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 -echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} - if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : - else - { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 -echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} - lt_cv_prog_cc_can_build_shared=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_prog_compiler_static" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; 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 - # Append any errors to the config.log. - cat conftest.err 1>&5 - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 - -if test x"$lt_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' - - 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 -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7821: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:7825: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; 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_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - -lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - +# 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_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-static' case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi + 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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - - 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_prog_compiler_pic='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' + lt_cv_prog_cc_pic='-fno-common' ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no + 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_prog_compiler_pic=-Kconform_pic + lt_cv_prog_cc_pic=-Kconform_pic fi ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic='-fPIC' + lt_cv_prog_cc_pic='-fPIC' ;; esac else - # PORTME Check for flag to pass linker flags through the system compiler. + # PORTME Check for PIC flags for the system compiler. case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' + 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_prog_compiler_static='-Bstatic' + lt_cv_prog_cc_static='-Bstatic' else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; - 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_prog_compiler_pic='-DDLL_EXPORT' - ;; - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' + # 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* | nonstopux*) - lt_prog_compiler_wl='-Wl,' + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' + ;; + + 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_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - linux*) - case $CC in - icc|ecc) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - ccc) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - esac + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) - lt_prog_compiler_pic='-Kpic' - lt_prog_compiler_static='-dn' + lt_cv_prog_cc_pic='-Kpic' + lt_cv_prog_cc_static='-dn' + lt_cv_prog_cc_shlib='-belf' ;; solaris*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' + 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_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Wl,' + ;; + + uts4*) + lt_cv_prog_cc_pic='-pic' + lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' + lt_cv_prog_cc_pic='-Kconform_pic' + lt_cv_prog_cc_static='-Bstatic' fi ;; - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - *) - lt_prog_compiler_can_build_shared=no + lt_cv_prog_cc_can_build_shared=no ;; esac fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6 +fi -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works+set}" = set; then +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 - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8053: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:8057: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; 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_prog_compiler_pic_works=yes - fi - fi - $rm conftest* + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 +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 -if test x"$lt_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + lt_cv_prog_cc_pic_works=no fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac +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" + +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_prog_compiler_c_o+set}" = set; then +if test "${lt_cv_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_c_o=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - # 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 . - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8120: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:8124: \$? = $ac_status" >&5 - if (exit $ac_status) && 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_prog_compiler_c_o=yes - fi - fi - chmod u+w . - $rm conftest* out/* - rmdir out - cd .. - rmdir conftest - $rm conftest* +$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:6155: \"$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 -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 +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" + +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 "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then +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 @@ -8164,72 +6264,130 @@ else need_locks=no fi -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +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" - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - 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_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - 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 extended regexp 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 +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 - ;; - openbsd*) + +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 - ;; - esac + 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}' +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/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <&2 + # 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. @@ -8238,73 +6396,125 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar *** so that a non-GNU linker is found, and then restart. EOF - 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 + 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't use - # them. - ld_shlibs=no - ;; + # 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 | grep ': 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*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + # 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 + ;; - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$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 - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= + # 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`sed 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname-def; else - 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' - fi - ;; + 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;; + 4) echo " \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;; + *) 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' + ;; - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 + 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 @@ -8314,754 +6524,515 @@ EOF *** used, and then restart. EOF - elif $LD --help 2>&1 | grep ': 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 | grep ': 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' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi + 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 - else - # PORTME fill in a description of your system's linker (not GNU ld) + ;; + + 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 - 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 - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - 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. - - archive_cmds='' - hardcode_direct=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - - if test "$GCC" = yes; then - case $host_os in aix4.012|aix4.012.*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - 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 - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-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 does not export symbols beginning with - # underscore (_), 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' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - 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 $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec=' ' - archive_cmds_need_lc=yes - # This 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 ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_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 - ;; - - bsdi4*) - export_dynamic_flag_spec=-rdynamic - ;; - 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 - # Tell ltmain to make .dll files, not .so files. - shrext=".dll" - # 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"`' - enable_shared_with_static_runtimes=yes + # dlltool doesn't understand --whole-archive et. al. + whole_archive_flag_spec= ;; - - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - archive_cmds_need_lc=no - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag='-undefined suppress' - ;; - *) # Darwin 1.3 on - test -z ${LD_TWOLEVEL_NAMESPACE} && 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. Also zsh mangles - # `"' quotes if we put them in here... so don't! - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='-all_load $convenience' - link_all_deplibs=yes - fi - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - 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*) - if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - 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' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_libdir_separator=: - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - ia64*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - *) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - 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' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - 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 $compiler_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 $compiler_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 "%s %s\\n" -exported_symbol "\$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 - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - 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' - fi - 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) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - 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 - ;; - esac - 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' - ;; - - 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 - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | 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 - ;; - - 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 - ;; - *) - ld_shlibs=no + # 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 + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + 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='-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. Also zsh mangles + # `"' quotes if we put them in here... so don't! + archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -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* | nonstopux*) + 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' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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' + hardcode_libdir_flag_spec='-rpath $libdir' + fi + 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 $compiler_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 $compiler_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) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + 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 + ;; + esac + 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 -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 - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - 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 - $rm conftest* - printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_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 - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6 - ;; - esac - fi - ;; -esac - +# 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 " || \ - test "X$hardcode_automatic"="Xyes" ; then + 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink @@ -9077,15 +7048,6 @@ fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&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 - striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 @@ -9096,31 +7058,19 @@ if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - 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 - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac 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= -shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -9130,35 +7080,16 @@ shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case $host_os in aix3*) version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + # AIX has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' ;; aix4* | aix5*) @@ -9168,7 +7099,7 @@ aix4* | aix5*) hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + 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 @@ -9178,31 +7109,33 @@ aix4* | aix5*) # 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 - ;; + 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. + # 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + 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}${shared_ext}$major' + soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH fi + hardcode_into_libs=yes ;; amigaos*) @@ -9212,7 +7145,7 @@ amigaos*) ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -9220,12 +7153,13 @@ beos*) bsdi4*) version_type=linux need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 @@ -9233,55 +7167,29 @@ bsdi4*) cygwin* | mingw* | pw32*) version_type=windows - shrext=".dll" need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) + yes,cygwin*) library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + 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 $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + $install_prog .libs/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' - ;; - esac ;; - + 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" -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}${shared_ext} $libname.lib' + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' @@ -9297,25 +7205,10 @@ darwin* | rhapsody*) # 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}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + 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 - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) @@ -9327,12 +7220,12 @@ freebsd*) version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + 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}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac @@ -9341,11 +7234,7 @@ freebsd*) freebsd2*) shlibpath_overrides_runpath=yes ;; - freebsd3.01* | freebsdelf3.01*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on + *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; @@ -9356,8 +7245,8 @@ gnu*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 ;; @@ -9365,45 +7254,14 @@ gnu*) 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 - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac + 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' ;; @@ -9411,29 +7269,21 @@ hpux9* | hpux10* | hpux11*) irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; + *) version_type=irix ;; esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + 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* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; + *-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 ;; @@ -9442,21 +7292,20 @@ irix5* | irix6* | nonstopux*) 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}" - hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. -linux*) +linux-gnu*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 @@ -9479,12 +7328,12 @@ netbsd*) need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 @@ -9494,17 +7343,7 @@ netbsd*) newsos6) version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -9513,47 +7352,46 @@ openbsd*) version_type=sunos need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH 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 + 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' - shrext=".dll" need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf - need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $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" + hardcode_into_libs=yes ;; sco3.2v5*) version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; @@ -9561,8 +7399,8 @@ solaris*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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 @@ -9572,7 +7410,7 @@ solaris*) sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + 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 @@ -9584,8 +7422,8 @@ sunos4*) sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + 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) @@ -9606,22 +7444,31 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) 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${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - *) dynamic_linker=no ;; @@ -9630,6 +7477,57 @@ 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 @@ -9645,94 +7543,11 @@ else lt_cv_dlopen_self=yes ;; - mingw* | pw32*) + cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err 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 - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 @@ -9740,73 +7555,43 @@ if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - +#line $LINENO "configure" +#include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shl_load - + 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) (); + +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 -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} +f = shl_load; #endif -int -main () -{ -return f != 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>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9815,12 +7600,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +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 @@ -9835,11 +7618,8 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -9858,21 +7638,11 @@ shl_load (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9881,12 +7651,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +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 @@ -9900,73 +7668,43 @@ if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen - +#line $LINENO "configure" +#include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef dlopen - + 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) (); + +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 -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} +f = dlopen; #endif -int -main () -{ -return f != 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>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9975,12 +7713,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +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 @@ -9995,11 +7731,8 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -10018,21 +7751,11 @@ dlopen (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10041,12 +7764,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +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 @@ -10062,11 +7783,8 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -10085,21 +7803,11 @@ dlopen (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10108,12 +7816,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +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 @@ -10129,11 +7835,8 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -10152,21 +7855,11 @@ dld_link (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10175,12 +7868,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +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 @@ -10216,7 +7907,7 @@ fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" @@ -10232,10 +7923,10 @@ 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_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&6 fi -# Report which librarie types wil actually be built -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 - ;; - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - archive_cmds_need_lc=no - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag='-undefined suppress' - ;; - *) # Darwin 1.3 on - test -z ${LD_TWOLEVEL_NAMESPACE} && 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. Also zsh mangles - # `"' quotes if we put them in here... so don't! - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='-all_load $convenience' - link_all_deplibs=yes - fi +if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. ;; -esac -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 + '$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 -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 { (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 -# The else clause should only fire when bootstrapping the + 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 - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi + : +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 EGREP RANLIB LN_S LTCC NM SED SHELL \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ + for var in echo old_CC old_CFLAGS SED \ + 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 \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do + compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ + reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + 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\"\`\\\"" ;; @@ -10581,29 +8240,14 @@ if test -f "$ltmain"; then esac done - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} - - cat <<__EOF__ >> "$cfgfile" + cat <<__EOF__ > "${ofile}T" #! $SHELL -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# `$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, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: +# 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 @@ -10625,19 +8269,16 @@ echo "$as_me: creating $ofile" >&6;} # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# A sed program that does not truncate output. +# A sed that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e s/^X//" +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 -# The names of the tagged configurations supported by this script. -available_tags= - # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: @@ -10652,10 +8293,7 @@ build_libtool_libs=$enable_shared build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes +build_libtool_need_lc=$need_lc # Whether or not to optimize for fast installation. fast_install=$enable_fast_install @@ -10671,18 +8309,12 @@ echo=$lt_echo AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler +# The default C compiler. +CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC -# An ERE matcher. -EGREP=$lt_EGREP - # The linker used to build libraries. LD=$lt_LD @@ -10715,7 +8347,7 @@ reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl +wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" @@ -10723,21 +8355,18 @@ objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" -# Shared library suffix (normally ".so"). -shrext='$shrext' - # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic +pic_flag=$lt_pic_flag pic_mode=$pic_mode -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - # Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o +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 @@ -10758,10 +8387,10 @@ dlopen_self=$enable_dlopen_self dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static +link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag +no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec @@ -10803,34 +8432,10 @@ archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path - # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -10850,13 +8455,13 @@ finish_cmds=$lt_finish_cmds finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe +global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +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_lt_cv_sys_global_symbol_to_c_name_address +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 @@ -10877,15 +8482,10 @@ hardcode_into_libs=$hardcode_into_libs # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - # 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${shared_ext} during linking hardcodes DIR into the +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct @@ -10897,10 +8497,6 @@ hardcode_minus_L=$hardcode_minus_L # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic - # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" @@ -10936,10 +8532,9 @@ include_expsyms=$lt_include_expsyms __EOF__ - case $host_os in aix3*) - cat <<\EOF >> "$cfgfile" + 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 @@ -10948,6 +8543,186 @@ 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> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1) - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + mv -f "${ofile}T" "$ofile" || \ + (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" - -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 - - -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 - -CC="$lt_save_CC" - - -# Check whether --with-tags or --without-tags was given. -if test "${with_tags+set}" = set; then - withval="$with_tags" - tagnames="$withval" -fi; - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && test "X$CXX" != "Xno"; 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 - - - - -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= - -# Source file extension for C++ test sources. -ac_ext=cc - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -compiler_CXX=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -else - lt_prog_compiler_no_builtin_flag_CXX= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - -# 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 $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $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. - [\\/]* | ?:[\\/]*) - 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 - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - 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. - case `"$lt_cv_path_LD" -v 2>&1 &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. -case `"$LD" -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - 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 - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - 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. - - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - - if test "$GXX" = yes; then - case $host_os in aix4.012|aix4.012.*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - 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_CXX=yes - else - # We have old collect2 - hardcode_direct_CXX=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_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-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 does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_CXX=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_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - - archive_expsym_cmds_CXX="\$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_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_CXX=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX=' ' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs_CXX=no - fi - ;; - - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - archive_cmds_need_lc_CXX=no - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='-undefined suppress' - ;; - *) # Darwin 1.3 on - test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_CXX='-flat_namespace -undefined suppress' - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_CXX='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='-all_load $convenience' - link_all_deplibs_CXX=yes - fi - ;; - - dgux*) - case $cc_basename in - ec++) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - freebsd12*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC) - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - hardcode_libdir_separator_CXX=: - ;; - ia64*) - hardcode_libdir_flag_spec_CXX='-L$libdir' - ;; - *) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case "$host_cpu" in - hppa*64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC) - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*|hppa*64*) - archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - ;; - linux*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc) - # Intel C++ - with_gnu_ld=yes - archive_cmds_need_lc_CXX=no - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - cxx) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - osf3*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ - $rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sco*) - archive_cmds_need_lc_CXX=no - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.0-5 | solaris2.0-5.*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - archive_cmds_need_lc_CXX=no - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; -esac -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 -test "$ld_shlibs_CXX" = no && can_build_shared=no - -GCC_CXX="$GXX" -LD_CXX="$LD" - - -cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" - - for p in `eval $output_verbose_link_cmd`; do - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - ;; - - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$rm -f confest.$objext - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - -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 - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; - 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # 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_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - cxx) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12488: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:12492: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; 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_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 - -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -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_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - # 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 . - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12555: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:12559: \$? = $ac_status" >&5 - if (exit $ac_status) && 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_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . - $rm conftest* out/* - rmdir out - cd .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = 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 - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 -test "$ld_shlibs_CXX" = no && can_build_shared=no - -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 - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX 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 - $rm conftest* - printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 - ;; - esac - fi - ;; -esac - -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_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || \ - test -n "$runpath_var CXX" || \ - test "X$hardcode_automatic_CXX"="Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6 - -if test "$hardcode_action_CXX" = 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 - -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 -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - 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 - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - -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= -shrext=".so" -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - 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}${shared_ext}$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}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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" - # 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 - shrext=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_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}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.01* | freebsdelf3.01*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - 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}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - 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 - ;; - -os2*) - libname_spec='$name' - shrext=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - 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}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=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 - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - 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 - -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 - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err 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 - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shl_load - -/* 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 (); -/* 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 -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != 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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_shl_load=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef dlopen - -/* Override any 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 (); -/* 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 -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != 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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_dlopen=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err 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 - - -# The else 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 - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # 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 EGREP RANLIB LN_S LTCC NM SED SHELL \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do - - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_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 - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# 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=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# 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 - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# 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_lt_prog_compiler_wl_CXX - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# 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_lt_prog_compiler_static_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX - -# 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_CXX -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_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_CXX - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX - -# 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_CXX - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# 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_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_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_CXX - -# 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_CXX - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_CXX - -# 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_CXX - -# 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_CXX" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# 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_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -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 - - -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 - -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld - - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" - -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -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*) - test "$enable_shared" = yes && enable_static=no - ;; -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 - -test "$ld_shlibs_F77" = no && can_build_shared=no - -GCC_F77="$G77" -LD_F77="$LD" - -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= - -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 "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - 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_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - 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_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_F77=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - 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_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - linux*) - case $CC in - icc|ecc) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - ccc) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - - sco3.2v5*) - lt_prog_compiler_pic_F77='-Kpic' - lt_prog_compiler_static_F77='-dn' - ;; - - solaris*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then - echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14804: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:14808: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; 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_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 - -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi - -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac - -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_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - # 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 . - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14871: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:14875: \$? = $ac_status" >&5 - if (exit $ac_status) && 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_prog_compiler_c_o_F77=yes - fi - fi - chmod u+w . - $rm conftest* out/* - rmdir out - cd .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = 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 - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$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_F77= - # exclude_expsyms can be an extended regexp 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_F77="_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_F77=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/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=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 - fi - ;; - - amigaos*) - archive_cmds_F77='$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_F77='-L$libdir' - hardcode_minus_L_F77=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't use - # them. - ld_shlibs_F77=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $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 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_F77=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 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - - if test "$ld_shlibs_F77" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$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_F77=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_F77=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 - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - 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. - - archive_cmds_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - - if test "$GCC" = yes; then - case $host_os in aix4.012|aix4.012.*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - 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_F77=yes - else - # We have old collect2 - hardcode_direct_F77=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_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-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 does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_F77=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_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$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_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_F77=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77=' ' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds_F77='$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_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; - - bsdi4*) - export_dynamic_flag_spec_F77=-rdynamic - ;; - - 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_F77=' ' - allow_undefined_flag_F77=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$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_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes - ;; - - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - archive_cmds_need_lc_F77=no - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='-undefined suppress' - ;; - *) # Darwin 1.3 on - test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_F77='-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. Also zsh mangles - # `"' quotes if we put them in here... so don't! - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_F77='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='-all_load $convenience' - link_all_deplibs_F77=yes - fi - ;; - - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - freebsd1*) - ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_F77='$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' - fi - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - ia64*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - *) - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$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_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; - - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$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_F77=' -expect_unresolved \*' - archive_cmds_F77='$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_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$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_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$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_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; - - sco3.2v5*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$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' - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs_F77=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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag_F77='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv5*) - no_undefined_flag_F77=' -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_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$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_F77= - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - *) - ld_shlibs_F77=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6 -test "$ld_shlibs_F77" = no && can_build_shared=no - -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 - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 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 - $rm conftest* - printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 - ;; - esac - fi - ;; -esac - -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_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var F77" || \ - test "X$hardcode_automatic_F77"="Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6 - -if test "$hardcode_action_F77" = 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 - -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 -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - 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 - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - -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= -shrext=".so" -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - 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}${shared_ext}$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}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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" - # 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 - shrext=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_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}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.01* | freebsdelf3.01*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - 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}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - 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 - ;; - -os2*) - libname_spec='$name' - shrext=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - 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}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=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 - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - 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 - - -# The else 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 - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # 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 EGREP RANLIB LN_S LTCC NM SED SHELL \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do - - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_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 - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# 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=$archive_cmds_need_lc_F77 - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 - -# 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 - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler_F77 - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_F77 - -# 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_lt_prog_compiler_wl_F77 - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 - -# 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_lt_prog_compiler_static_F77 - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 - -# 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_F77 -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_F77 - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_F77 - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 - -# 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_F77 - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 - -# 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_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_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_F77 - -# 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_F77 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_F77 - -# 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_F77 - -# 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_F77" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 - -# 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_F77 - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -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 - - -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 - -CC="$lt_save_CC" - - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - - - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no - - -lt_prog_compiler_no_builtin_flag_GCJ= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' - - 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 -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16833: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:16837: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; 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_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi - -fi - -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= - -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 "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; - - 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_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - 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_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_GCJ=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - else - lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - 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_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - linux*) - case $CC in - icc|ecc) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' - ;; - ccc) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - sco3.2v5*) - lt_prog_compiler_pic_GCJ='-Kpic' - lt_prog_compiler_static_GCJ='-dn' - ;; - - solaris*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; - - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_GCJ=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then - echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17065: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:17069: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; 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_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 - -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac -else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no -fi - -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= - ;; - *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" - ;; -esac - -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_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - # 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 . - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17132: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:17136: \$? = $ac_status" >&5 - if (exit $ac_status) && 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_prog_compiler_c_o_GCJ=yes - fi - fi - chmod u+w . - $rm conftest* out/* - rmdir out - cd .. - rmdir conftest - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = 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 - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$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_GCJ= - # exclude_expsyms can be an extended regexp 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_GCJ="_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_GCJ=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/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_GCJ=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 - fi - ;; - - amigaos*) - archive_cmds_GCJ='$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_GCJ='-L$libdir' - hardcode_minus_L_GCJ=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't use - # them. - ld_shlibs_GCJ=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $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 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_GCJ=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 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - - if test "$ld_shlibs_GCJ" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - fi - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$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_GCJ=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_GCJ=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 - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - 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. - - archive_cmds_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - - if test "$GCC" = yes; then - case $host_os in aix4.012|aix4.012.*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - 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_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=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_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-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 does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_GCJ=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_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$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_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_GCJ=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ=' ' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds_GCJ='$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_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; - - bsdi4*) - export_dynamic_flag_spec_GCJ=-rdynamic - ;; - - 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_GCJ=' ' - allow_undefined_flag_GCJ=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_GCJ='$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_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes - ;; - - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - archive_cmds_need_lc_GCJ=no - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='-undefined suppress' - ;; - *) # Darwin 1.3 on - test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_GCJ='-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. Also zsh mangles - # `"' quotes if we put them in here... so don't! - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_GCJ='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='-all_load $convenience' - link_all_deplibs_GCJ=yes - fi - ;; - - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - freebsd1*) - ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_GCJ='$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' - fi - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - ia64*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - *) - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$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_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; - - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$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_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$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_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$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_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$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_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; - - sco3.2v5*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$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' - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - - sysv5*) - no_undefined_flag_GCJ=' -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_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$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_GCJ= - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - *) - ld_shlibs_GCJ=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6 -test "$ld_shlibs_GCJ" = no && can_build_shared=no - -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 - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_GCJ" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ 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 - $rm conftest* - printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_GCJ - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_GCJ=no - else - archive_cmds_need_lc_GCJ=yes - fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 - ;; - esac - fi - ;; -esac - -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_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var GCJ" || \ - test "X$hardcode_automatic_GCJ"="Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6 - -if test "$hardcode_action_GCJ" = 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 - -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 -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - 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 - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - -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= -shrext=".so" -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - 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}${shared_ext}$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}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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" - # 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 - shrext=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_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}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.01* | freebsdelf3.01*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - 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}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - 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 - ;; - -os2*) - libname_spec='$name' - shrext=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - 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}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=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 - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - 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 - -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 - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err 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 - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shl_load - -/* 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 (); -/* 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 -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != 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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_shl_load=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef dlopen - -/* Override any 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 (); -/* 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 -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != 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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_dlopen=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end 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 (); -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>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (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); }; } && - { 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 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err 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 - - -# The else 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 - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # 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 EGREP RANLIB LN_S LTCC NM SED SHELL \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do - - case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_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 - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# 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=$archive_cmds_need_lc_GCJ - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ - -# 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 - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler_GCJ - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_GCJ - -# 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_lt_prog_compiler_wl_GCJ - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_GCJ -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ - -# 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_lt_prog_compiler_static_GCJ - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ - -# 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_GCJ -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_GCJ - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_GCJ - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_GCJ - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ - -# 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_GCJ - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ - -# 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_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_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_GCJ - -# 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_GCJ - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_GCJ - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_GCJ - -# 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_GCJ - -# 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_GCJ" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ - -# 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_GCJ - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -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 - - -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 - -CC="$lt_save_CC" - - else - tagname="" - fi - ;; - - RC) - - - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -objext_RC=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -lt_cv_prog_compiler_c_o_RC=yes - -# The else 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 - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # 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 EGREP RANLIB LN_S LTCC NM SED SHELL \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do - - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_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 - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# 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=$archive_cmds_need_lc_RC - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC - -# 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 - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler_RC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_RC - -# 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_lt_prog_compiler_wl_RC - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_RC -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC - -# 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_lt_prog_compiler_static_RC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC - -# 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_RC -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_RC - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_RC - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_RC - -# 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_RC - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC - -# 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_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_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_RC - -# 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_RC - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_RC - -# 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_RC - -# 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_RC" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC - -# 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_RC - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -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 - - -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 - -CC="$lt_save_CC" - - ;; - - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} - { (exit 1); exit 1; }; } - fi -fi @@ -20334,42 +8752,9 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - -# configuration file -- stay in 8.3 limit -# -# since #undef doesn't survive in configuration header files we replace -# `/undef' with `#undef' after creating the output file - - ac_config_headers="$ac_config_headers ftconfig.h:ftconfig.in" - - -# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk' -# and 'builds/unix/unix-cc.mk' that will be used by the build system -# ac_config_files="$ac_config_files unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in" -# re-generate the Jamfile to use libtool now -# -# AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in]) cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -20399,13 +8784,13 @@ _ACEOF # `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" + "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" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | @@ -20416,7 +8801,7 @@ _ACEOF t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else +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 @@ -20435,13 +8820,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # 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[ ]*=/{ + ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; +s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; -s/^[^=]*=[ ]*$//; +s/^[^=]*=[ ]*$//; }' fi @@ -20452,7 +8837,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' @@ -20476,8 +8861,6 @@ cat >$CONFIG_STATUS <<_ACEOF # configure, is in config.log if it exists. debug=false -ac_cs_recheck=false -ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF @@ -20496,10 +8879,9 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -20513,12 +8895,9 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME +for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -20562,15 +8941,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conf$$.sh + rm -f conftest.sh fi @@ -20697,17 +9076,16 @@ rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else - test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS @@ -20734,7 +9112,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.54. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -20774,13 +9152,12 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit - -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + instantiate the configuration header FILE Configuration files: $config_files @@ -20794,10 +9171,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.59, +configured by $0, generated by GNU Autoconf 2.54, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +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 @@ -20830,9 +9208,12 @@ do case $ac_option in # Handling of the options. _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; + 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) @@ -20854,9 +9235,6 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 @@ -20871,20 +9249,6 @@ Try \`$0 --help' for more information." >&2;} shift done -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - _ACEOF @@ -20916,9 +9280,6 @@ if $ac_need_defaults; then test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { @@ -20927,17 +9288,17 @@ $debug || } # Create a (secure) tmp directory for tmp files. - +: ${TMPDIR=/tmp} { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM + tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { - echo "$me: cannot create a temporary directory in ." >&2 + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } @@ -21020,19 +9381,10 @@ s,@LIBZ@,$LIBZ,;t t s,@SYSTEM_ZLIB@,$SYSTEM_ZLIB,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t -s,@AR@,$AR,;t t -s,@ac_ct_AR@,$ac_ct_AR,;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,@CXX@,$CXX,;t t -s,@CXXFLAGS@,$CXXFLAGS,;t t -s,@ac_ct_CXX@,$ac_ct_CXX,;t t -s,@CXXCPP@,$CXXCPP,;t t -s,@F77@,$F77,;t t -s,@FFLAGS@,$FFLAGS,;t t -s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t @@ -21065,9 +9417,9 @@ _ACEOF (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" + 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" + 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 @@ -21085,21 +9437,21 @@ 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,:.*,,'` ;; + 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=`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 || + 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; } @@ -21115,10 +9467,10 @@ echo X"$ac_file" | as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -21156,45 +9508,12 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -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 @@ -21216,7 +9535,7 @@ echo "$as_me: creating $ac_file" >&6;} configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." + sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. @@ -21225,24 +9544,24 @@ echo "$as_me: creating $ac_file" >&6;} 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 + # 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";; + 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 + 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;; + fi;; esac done` || { (exit 1); exit 1; } _ACEOF @@ -21284,12 +9603,12 @@ cat >>$CONFIG_STATUS <<\_ACEOF # 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_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_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' @@ -21298,11 +9617,11 @@ 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,:.*,,'` ;; + 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=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac @@ -21316,29 +9635,28 @@ echo "$as_me: creating $ac_file" >&6;} 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 + # 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; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; + 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 + 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;; + fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF @@ -21361,9 +9679,9 @@ s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +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 +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 @@ -21377,13 +9695,13 @@ rm -f confdef2sed.sed # 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]*,/* & */, +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 grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*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 @@ -21392,7 +9710,7 @@ 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 + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS @@ -21419,7 +9737,7 @@ 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 + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS @@ -21447,16 +9765,16 @@ cat >>$CONFIG_STATUS <<\_ACEOF cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; 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 || + 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; } @@ -21472,10 +9790,10 @@ echo X"$ac_file" | as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -21495,12 +9813,6 @@ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} cat $tmp/config.h rm -f $tmp/config.h fi - # Run the commands associated with the file. - case $ac_file in - ftconfig.h ) mv ftconfig.h ftconfig.tmp - sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h - rm ftconfig.tmp ;; - esac done _ACEOF @@ -21522,11 +9834,8 @@ ac_clean_files=$ac_clean_files_save # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + $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. @@ -21534,4 +9843,3 @@ if test "$no_create" != yes; then fi -# end of configure.ac diff --git a/reactos/lib/freetype/builds/unix/configure.ac b/reactos/lib/freetype/builds/unix/configure.ac index 89ba574aa5d..5f4d7ef82ab 100644 --- a/reactos/lib/freetype/builds/unix/configure.ac +++ b/reactos/lib/freetype/builds/unix/configure.ac @@ -1,121 +1,91 @@ -# This file is part of the FreeType project. -# -# Process this file with autoconf to produce a configure script. +dnl This file is part of the FreeType project. +dnl +dnl Process this file with autoconf to produce a configure script. +dnl AC_INIT AC_CONFIG_SRCDIR([ftconfig.in]) +dnl configuration file -- stay in 8.3 limit +AC_CONFIG_HEADER(ftconfig.h:ftconfig.in) -# Don't forget to update docs/VERSION.DLL! - -version_info='9:6:3' -AC_SUBST([version_info]) +dnl Don't forget to update VERSION.DLL! +version_info='9:4:3' +AC_SUBST(version_info) ft_version=`echo $version_info | tr : .` -AC_SUBST([ft_version]) +AC_SUBST(ft_version) +dnl checks for system type +AC_CANONICAL_TARGET([]) -# checks for system type - -AC_CANONICAL_TARGET - - -# checks for programs - +dnl checks for programs AC_PROG_CC AC_PROG_CPP - -# get compiler flags right - +dnl get Compiler flags right. if test "x$CC" = xgcc; then XX_CFLAGS="-Wall" XX_ANSIFLAGS="-pedantic -ansi" else case "$host" in - *-dec-osf*) - CFLAGS= - XX_CFLAGS="-std1 -g3" - XX_ANSIFLAGS= - ;; - *) - XX_CFLAGS= - XX_ANSIFLAGS= - ;; + *-dec-osf*) + CFLAGS= + XX_CFLAGS="-std1 -g3" + XX_ANSIFLAGS= + ;; + *) + XX_CFLAGS= + XX_ANSIFLAGS= + ;; esac fi -AC_SUBST([XX_CFLAGS]) -AC_SUBST([XX_ANSIFLAGS]) +AC_SUBST(XX_CFLAGS) +AC_SUBST(XX_ANSIFLAGS) +AC_CHECK_PROG(RMF, rm, rm -f) +AC_CHECK_PROG(RMDIR, rmdir, rmdir) -# auxiliary programs - -AC_CHECK_PROG([RMF], [rm], [rm -f]) -AC_CHECK_PROG([RMDIR], [rmdir], [rmdir]) - - -# Since this file will be finally moved to another directory we make -# the path of the install script absolute. This small code snippet has -# been taken from automake's `ylwrap' script. - +dnl Since this file will be finally moved to another directory we make +dnl the path of the install script absolute. This small code snippet has +dnl been taken from automake's `ylwrap' script. AC_PROG_INSTALL case "$INSTALL" in -/*) - ;; -*/*) - INSTALL="`pwd`/$INSTALL" ;; + /*) + ;; + */*) + INSTALL="`pwd`/$INSTALL" ;; esac - -# checks for header files - +dnl checks for header files AC_HEADER_STDC -AC_CHECK_HEADERS([fcntl.h unistd.h]) - - -# checks for typedefs, structures, and compiler characteristics +AC_CHECK_HEADERS(fcntl.h unistd.h) +dnl checks for typedefs, structures, and compiler characteristics AC_C_CONST -AC_CHECK_SIZEOF([int]) -AC_CHECK_SIZEOF([long]) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +dnl checks for library functions -# checks for library functions - -# Here we check whether we can use our mmap file component. - +dnl Here we check whether we can use our mmap file component. AC_FUNC_MMAP if test "$ac_cv_func_mmap_fixed_mapped" != yes; then FTSYS_SRC='$(BASE_DIR)/ftsystem.c' else FTSYS_SRC='$(BUILD_DIR)/ftsystem.c' - AC_CHECK_DECLS([munmap], - [], - [], - [ - -#ifdef HAVE_UNISTD_H -#include -#endif -#include - - ]) - + FT_MUNMAP_DECL FT_MUNMAP_PARAM fi -AC_SUBST([FTSYS_SRC]) +AC_SUBST(FTSYS_SRC) -AC_CHECK_FUNCS([memcpy memmove]) +AC_CHECK_FUNCS(memcpy memmove) - -# Check for system zlib - -AC_ARG_WITH([zlib], - dnl don't quote AS_HELP_STRING! - AS_HELP_STRING([--without-zlib], - [use internal zlib instead of system-wide])) +dnl Check for system zlib +AC_ARG_WITH(zlib, + [ --without-zlib use internal zlib instead of system-wide]) if test x$with_zlib != xno && test -z "$LIBZ"; then - AC_CHECK_LIB([z], [gzsetparams], [AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])]) + AC_CHECK_LIB(z, gzsetparams, [AC_CHECK_HEADER(zlib.h, LIBZ='-lz')]) fi if test x$with_zlib != xno && test -n "$LIBZ"; then CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB" @@ -123,13 +93,9 @@ if test x$with_zlib != xno && test -n "$LIBZ"; then SYSTEM_ZLIB=yes fi - -# Whether to use Mac OS resource-based fonts or not - -AC_ARG_WITH([old-mac-fonts], - dnl don't quote AS_HELP_STRING! - AS_HELP_STRING([--with-old-mac-fonts], - [allow Mac resource-based fonts to be used])) +dnl Whether to use Mac OS resource-based fonts or not +AC_ARG_WITH(old-mac-fonts, + [ --with-old-mac-fonts allow Mac resource-based fonts to be used]) if test x$with_old_mac_fonts = xyes; then CFLAGS="$CFLAGS -DTARGET_API_MAC_CARBON" LDFLAGS="$LDFLAGS -Xlinker -framework -Xlinker CoreServices \ @@ -138,38 +104,25 @@ else CFLAGS="$CFLAGS -DDARWIN_NO_CARBON" fi - -AC_SUBST([LIBZ]) -AC_SUBST([CFLAGS]) -AC_SUBST([LDFLAGS]) -AC_SUBST([SYSTEM_ZLIB]) - +AC_SUBST(LIBZ) +AC_SUBST(CFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(SYSTEM_ZLIB) AC_PROG_LIBTOOL - -# configuration file -- stay in 8.3 limit -# -# since #undef doesn't survive in configuration header files we replace -# `/undef' with `#undef' after creating the output file - -AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in], - [mv ftconfig.h ftconfig.tmp - sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h - rm ftconfig.tmp]) - -# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk' -# and 'builds/unix/unix-cc.mk' that will be used by the build system -# +dnl create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk' +dnl and 'builds/unix/unix-cc.mk' that will be used by the build system +dnl AC_CONFIG_FILES([unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in]) -# re-generate the Jamfile to use libtool now -# -# AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in]) +dnl re-generate the Jamfile to use libtool now +dnl +dnl AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in]) AC_OUTPUT -# end of configure.ac +dnl end of configure.ac diff --git a/reactos/lib/freetype/builds/unix/freetype2.m4 b/reactos/lib/freetype/builds/unix/freetype2.m4 index 7424a32ab5a..21c6445e2cc 100644 --- a/reactos/lib/freetype/builds/unix/freetype2.m4 +++ b/reactos/lib/freetype/builds/unix/freetype2.m4 @@ -1,104 +1,88 @@ # Configure paths for FreeType2 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor -# -# serial 2 -# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -# Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS. -# MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is -# FreeType 2.0.4). -# -AC_DEFUN([AC_CHECK_FT2], - [# Get the cflags and libraries from the freetype-config script - # - AC_ARG_WITH([ft-prefix], - dnl don't quote AS_HELP_STRING! - AS_HELP_STRING([--with-ft-prefix=PREFIX], - [Prefix where FreeType is installed (optional)]), - [ft_config_prefix="$withval"], - [ft_config_prefix=""]) +dnl AC_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS +dnl +AC_DEFUN(AC_CHECK_FT2, +[dnl +dnl Get the cflags and libraries from the freetype-config script +dnl +AC_ARG_WITH(ft-prefix, +[ --with-ft-prefix=PREFIX + Prefix where FreeType is installed (optional)], + ft_config_prefix="$withval", ft_config_prefix="") +AC_ARG_WITH(ft-exec-prefix, +[ --with-ft-exec-prefix=PREFIX + Exec prefix where FreeType is installed (optional)], + ft_config_exec_prefix="$withval", ft_config_exec_prefix="") +AC_ARG_ENABLE(freetypetest, +[ --disable-freetypetest Do not try to compile and run + a test FreeType program], + [], enable_fttest=yes) - AC_ARG_WITH([ft-exec-prefix], - dnl don't quote AS_HELP_STRING! - AS_HELP_STRING([--with-ft-exec-prefix=PREFIX], - [Exec prefix where FreeType is installed (optional)]), - [ft_config_exec_prefix="$withval"], - [ft_config_exec_prefix=""]) - - AC_ARG_ENABLE([freetypetest], - dnl don't quote AS_HELP_STRING! - AS_HELP_STRING([--disable-freetypetest], - [Do not try to compile and run a test FreeType program]), - [], - [enable_fttest=yes]) - - if test x$ft_config_exec_prefix != x ; then - ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" - if test x${FT2_CONFIG+set} != xset ; then - FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config - fi - fi - - if test x$ft_config_prefix != x ; then - ft_config_args="$ft_config_args --prefix=$ft_config_prefix" - if test x${FT2_CONFIG+set} != xset ; then - FT2_CONFIG=$ft_config_prefix/bin/freetype-config - fi - fi - - AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no]) - - min_ft_version=m4_if([$1], [], [7.0.1], [$1]) - AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version]) - no_ft="" - if test "$FT2_CONFIG" = "no" ; then - no_ft=yes - else - FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` - FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` - ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - ft_min_major_version=`echo $min_ft_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - ft_min_minor_version=`echo $min_ft_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - ft_min_micro_version=`echo $min_ft_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test x$enable_fttest = xyes ; then - ft_config_is_lt="" - if test $ft_config_major_version -lt $ft_min_major_version ; then - ft_config_is_lt=yes - else - if test $ft_config_major_version -eq $ft_min_major_version ; then - if test $ft_config_minor_version -lt $ft_min_minor_version ; then - ft_config_is_lt=yes - else - if test $ft_config_minor_version -eq $ft_min_minor_version ; then - if test $ft_config_micro_version -lt $ft_min_micro_version ; then - ft_config_is_lt=yes - fi - fi - fi - fi - fi - if test x$ft_config_is_lt = xyes ; then - no_ft=yes - else - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $FT2_CFLAGS" - LIBS="$FT2_LIBS $LIBS" - - # - # Sanity checks for the results of freetype-config to some extent. - # - AC_RUN_IFELSE([ - AC_LANG_SOURCE([[ +if test x$ft_config_exec_prefix != x ; then + ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config + fi +fi +if test x$ft_config_prefix != x ; then + ft_config_args="$ft_config_args --prefix=$ft_config_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_prefix/bin/freetype-config + fi +fi +AC_PATH_PROG(FT2_CONFIG, freetype-config, no) +min_ft_version=ifelse([$1], ,6.1.0,$1) +AC_MSG_CHECKING(for FreeType - version >= $min_ft_version) +no_ft="" +if test "$FT2_CONFIG" = "no" ; then + no_ft=yes +else + FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` + FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` + ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + ft_min_major_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ft_min_minor_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ft_min_micro_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test x$enable_fttest = xyes ; then + ft_config_is_lt="" + if test $ft_config_major_version -lt $ft_min_major_version ; then + ft_config_is_lt=yes + else + if test $ft_config_major_version -eq $ft_min_major_version ; then + if test $ft_config_minor_version -lt $ft_min_minor_version ; then + ft_config_is_lt=yes + else + if test $ft_config_minor_version -eq $ft_min_minor_version ; then + if test $ft_config_micro_version -lt $ft_min_micro_version ; then + ft_config_is_lt=yes + fi + fi + fi + fi + fi + if test x$ft_config_is_lt = xyes ; then + no_ft=yes + else + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $FT2_CFLAGS" + LIBS="$FT2_LIBS $LIBS" +dnl +dnl Sanity checks for the results of freetype-config to some extent +dnl + AC_TRY_RUN([ #include #include FT_FREETYPE_H #include @@ -108,7 +92,7 @@ int main() { FT_Library library; - FT_Error error; + FT_Error error; error = FT_Init_FreeType(&library); @@ -120,59 +104,40 @@ main() return 0; } } - - ]]) - ], - [], - [no_ft=yes], - [echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"]) - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi # test $ft_config_version -lt $ft_min_version - fi # test x$enable_fttest = xyes - fi # test "$FT2_CONFIG" = "no" - - if test x$no_ft = x ; then - AC_MSG_RESULT([yes]) - m4_if([$2], [], [:], [$2]) +],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi # test $ft_config_version -lt $ft_min_version + fi # test x$enable_fttest = xyes +fi # test "$FT2_CONFIG" = "no" +if test x$no_ft = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) + if test "$FT2_CONFIG" = "no" ; then + echo "*** The freetype-config script installed by FreeType 2 could not be found." + echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the FT2_CONFIG environment variable to the" + echo "*** full path to freetype-config." else - AC_MSG_RESULT([no]) - if test "$FT2_CONFIG" = "no" ; then - AC_MSG_WARN([ - - The freetype-config script installed by FreeType 2 could not be found. - If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in - your path, or set the FT2_CONFIG environment variable to the - full path to freetype-config. - ]) + if test x$ft_config_is_lt = xyes ; then + echo "*** Your installed version of the FreeType 2 library is too old." + echo "*** If you have different versions of FreeType 2, make sure that" + echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix" + echo "*** are used, or set the FT2_CONFIG environment variable to the" + echo "*** full path to freetype-config." else - if test x$ft_config_is_lt = xyes ; then - AC_MSG_WARN([ - - Your installed version of the FreeType 2 library is too old. - If you have different versions of FreeType 2, make sure that - correct values for --with-ft-prefix or --with-ft-exec-prefix - are used, or set the FT2_CONFIG environment variable to the - full path to freetype-config. - ]) - else - AC_MSG_WARN([ - - The FreeType test program failed to run. If your system uses - shared libraries and they are installed outside the normal - system library path, make sure the variable LD_LIBRARY_PATH - (or whatever is appropiate for your system) is correctly set. - ]) - fi + echo "*** The FreeType test program failed to run. If your system uses" + echo "*** shared libraries and they are installed outside the normal" + echo "*** system library path, make sure the variable LD_LIBRARY_PATH" + echo "*** (or whatever is appropiate for your system) is correctly set." fi - - FT2_CFLAGS="" - FT2_LIBS="" - m4_if([$3], [], [:], [$3]) fi - - AC_SUBST([FT2_CFLAGS]) - AC_SUBST([FT2_LIBS])]) - -# end of freetype2.m4 + FT2_CFLAGS="" + FT2_LIBS="" + ifelse([$3], , :, [$3]) +fi +AC_SUBST(FT2_CFLAGS) +AC_SUBST(FT2_LIBS) +]) diff --git a/reactos/lib/freetype/builds/unix/ft-munmap.m4 b/reactos/lib/freetype/builds/unix/ft-munmap.m4 index d68d49fa7cf..37ebbd92d9d 100644 --- a/reactos/lib/freetype/builds/unix/ft-munmap.m4 +++ b/reactos/lib/freetype/builds/unix/ft-munmap.m4 @@ -1,24 +1,31 @@ ## FreeType specific autoconf tests -# serial 2 +# serial 1 FT_MUNMAP_DECL -AC_DEFUN([FT_MUNMAP_PARAM], - [AC_MSG_CHECKING([for munmap's first parameter type]) - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([[ +AC_DEFUN(FT_MUNMAP_DECL, +[AC_MSG_CHECKING([whether munmap must be declared]) +AC_CACHE_VAL(ft_cv_munmap_decl, +[AC_TRY_COMPILE([ +#ifdef HAVE_UNISTD_H +#include +#endif +#include ], +[char *(*pfn) = (char *(*))munmap], +ft_cv_munmap_decl=no, +ft_cv_munmap_decl=yes)]) +AC_MSG_RESULT($ft_cv_munmap_decl) +if test $ft_cv_munmap_decl = yes; then + AC_DEFINE(NEED_MUNMAP_DECL,, + [Define to 1 if munmap() is not defined in ]) +fi]) +AC_DEFUN(FT_MUNMAP_PARAM, +[AC_MSG_CHECKING([for munmap's first parameter type]) +AC_TRY_COMPILE([ #include #include -int munmap(void *, size_t); - - ]]) - ], - [], - [AC_MSG_RESULT([void *]) - AC_DEFINE([MUNMAP_USES_VOIDP], - [], - [Define to 1 if the first argument of munmap is of type void *])], - [AC_MSG_RESULT([char *])]) - ]) - -# end of ft-munmap.m4 +int munmap(void *, size_t);],, + AC_MSG_RESULT([void *]);AC_DEFINE(MUNMAP_USES_VOIDP,, + [Define to 1 if the first argument of munmap is of type void *]), + AC_MSG_RESULT([char *])) +]) diff --git a/reactos/lib/freetype/builds/unix/ft2unix.h b/reactos/lib/freetype/builds/unix/ft2unix.h index 7390dc49401..c4299c3abf6 100644 --- a/reactos/lib/freetype/builds/unix/ft2unix.h +++ b/reactos/lib/freetype/builds/unix/ft2unix.h @@ -4,7 +4,7 @@ /* */ /* Build macros of the FreeType 2 library. */ /* */ -/* Copyright 1996-2001, 2003 by */ +/* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -21,15 +21,14 @@ /* This is a Unix-specific version of that should be used */ /* exclusively *after* installation of the library. */ /* */ - /* It assumes that "/usr/local/include/freetype2" (or whatever is */ - /* returned by the "freetype-config --cflags" or "pkg-config --cflags" */ - /* command) is in your compilation include path. */ + /* It assumes that "/usr/local/include/freetype2" (or wathever is */ + /* returned by the "freetype-config --cflags" command) is in your */ + /* compilation include path. */ /* */ /* We don't need to do anything special in this release. However, for */ - /* a future FreeType 2 release, the following installation changes will */ - /* be performed: */ + /* FreeType 2.1, the following installation changes will be performed: */ /* */ - /* - The contents of "freetype-2.x/include/freetype" will be installed */ + /* - The contents of "freetype-2.1/include/freetype" will be installed */ /* to "/usr/local/include/freetype2" instead of */ /* "/usr/local/include/freetype2/freetype". */ /* */ @@ -40,11 +39,11 @@ /* replace all "" with "". */ /* */ /* - Adding "/usr/local/include/freetype2" to your compilation include */ - /* path will not be necessary anymore. */ + /* path will not be necessary anymore. The command */ + /* "freetype-config --cflags" will return an empty string. */ /* */ - /* These changes will be transparent to client applications which use */ - /* freetype-config (or pkg-config). No modifications will be necessary */ - /* to compile with the new scheme. */ + /* - Client applications which adhere to the new inclusion scheme */ + /* WILL NOT NEED TO BE MODIFIED to compile with FT 2.1! */ /* */ /*************************************************************************/ @@ -52,7 +51,7 @@ #ifndef __FT2_BUILD_UNIX_H__ #define __FT2_BUILD_UNIX_H__ - /* "/include/freetype2" must be in your current inclusion path */ + /* "/usr/local/include/freetype2" must be in your current inclusion path */ #include #endif /* __FT2_BUILD_UNIX_H__ */ diff --git a/reactos/lib/freetype/builds/unix/ftconfig.in b/reactos/lib/freetype/builds/unix/ftconfig.in index 39205d63788..c7511039f52 100644 --- a/reactos/lib/freetype/builds/unix/ftconfig.in +++ b/reactos/lib/freetype/builds/unix/ftconfig.in @@ -4,7 +4,7 @@ /* */ /* UNIX-specific configuration file (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2000, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -57,12 +57,11 @@ FT_BEGIN_HEADER /*************************************************************************/ -#undef HAVE_UNISTD_H -#undef HAVE_FCNTL_H - -#undef SIZEOF_INT -#undef SIZEOF_LONG +#define HAVE_UNISTD_H 0 +#define HAVE_FCNTL_H 0 +#define SIZEOF_INT 2 +#define SIZEOF_LONG 2 #define FT_SIZEOF_INT SIZEOF_INT #define FT_SIZEOF_LONG SIZEOF_LONG @@ -90,19 +89,6 @@ FT_BEGIN_HEADER /*************************************************************************/ - /*************************************************************************/ - /* */ - /* Mac support */ - /* */ - /* This is the only necessary change, so it is defined here instead */ - /* providing a new configuration file. */ - /* */ -#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \ - ( defined( __MWERKS__ ) && defined( macintosh ) ) -#define FT_MACINTOSH 1 -#endif - - /*************************************************************************/ /* */ /* IntN types */ @@ -126,88 +112,31 @@ FT_BEGIN_HEADER #error "no 32bit type found -- please check your configuration files" #endif - - /* look up an integer type that is at least 32 bits */ -#if FT_SIZEOF_INT >= 4 - - typedef int FT_Fast; - typedef unsigned int FT_UFast; - -#elif FT_SIZEOF_LONG >= 4 - - typedef long FT_Fast; - typedef unsigned long FT_UFast; - -#endif - - - /* determine whether we have a 64-bit int type for platforms without */ - /* Autoconf */ #if FT_SIZEOF_LONG == 8 /* FT_LONG64 must be defined if a 64-bit type is available */ #define FT_LONG64 -#define FT_INT64 long - -#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ - - /* this compiler provides the __int64 type */ -#define FT_LONG64 -#define FT_INT64 __int64 - -#elif defined( __BORLANDC__ ) /* Borland C++ */ - - /* XXXX: We should probably check the value of __BORLANDC__ in order */ - /* to test the compiler version. */ - - /* this compiler provides the __int64 type */ -#define FT_LONG64 -#define FT_INT64 __int64 - -#elif defined( __WATCOMC__ ) /* Watcom C++ */ - - /* Watcom doesn't provide 64-bit data types */ - -#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ - -#define FT_LONG64 -#define FT_INT64 long long int - -#elif defined( __GNUC__ ) - - /* GCC provides the "long long" type */ -#define FT_LONG64 -#define FT_INT64 long long int - -#endif /* FT_SIZEOF_LONG == 8 */ - - -#define FT_BEGIN_STMNT do { -#define FT_END_STMNT } while ( 0 ) -#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT +#define FT_INT64 long +#else /*************************************************************************/ /* */ - /* A 64-bit data type will create compilation problems if you compile */ - /* in strict ANSI mode. To avoid them, we disable their use if */ - /* __STDC__ is defined. You can however ignore this rule by */ - /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ + /* Many compilers provide the non-ANSI `long long' 64-bit type. You can */ + /* activate it by defining the FTCALC_USE_LONG_LONG macro in */ + /* `ftoption.h'. */ /* */ -#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) + /* Note that this will produce many -ansi warnings during library */ + /* compilation, and that in many cases, the generated code will be */ + /* neither smaller nor faster! */ + /* */ +#ifdef FTCALC_USE_LONG_LONG -#ifdef __STDC__ +#define FT_LONG64 +#define FT_INT64 long long - /* Undefine the 64-bit macros in strict ANSI compilation mode. */ - /* Since `#undef' doesn't survive in configuration header files */ - /* we use the postprocessing facility of AC_CONFIG_HEADERS to */ - /* replace the leading `/' with `#'. */ -/undef FT_LONG64 -/undef FT_INT64 - -#endif /* __STDC__ */ - -#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ +#endif /* FTCALC_USE_LONG_LONG */ +#endif /* FT_SIZEOF_LONG == 8 */ #ifdef FT_MAKE_OPTION_SINGLE_OBJECT @@ -222,7 +151,7 @@ FT_BEGIN_HEADER #define FT_LOCAL_DEF( x ) extern "C" x #else #define FT_LOCAL( x ) extern x -#define FT_LOCAL_DEF( x ) x +#define FT_LOCAL_DEF( x ) extern x #endif #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ @@ -326,7 +255,6 @@ FT_BEGIN_HEADER FT_END_HEADER - #endif /* __FTCONFIG_H__ */ diff --git a/reactos/lib/freetype/builds/unix/install-sh b/reactos/lib/freetype/builds/unix/install-sh index f5061e7e269..57a2fbd1861 100644 --- a/reactos/lib/freetype/builds/unix/install-sh +++ b/reactos/lib/freetype/builds/unix/install-sh @@ -1,38 +1,21 @@ #!/bin/sh # install - install a program, script, or datafile +# This originally came from X11R5 (mit/util/scripts/install.sh). -scriptversion=2003-09-24.23 +scriptversion=2003-01-17.15 -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. +# Copyright 1991 by the Massachusetts Institute of Technology +# (FSF changes in the public domain.) # -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. +# 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 @@ -151,11 +134,6 @@ if test -z "$src"; then exit 1 fi -# Protect names starting with `-'. -case $src in - -*) src=./$src ;; -esac - if test -n "$dir_arg"; then dst=$src src= @@ -180,11 +158,6 @@ else exit 1 fi - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac - # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then @@ -192,10 +165,11 @@ else fi fi -# This sed command emulates the dirname command. +## 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 test ! -d "$dstdir"; then @@ -239,8 +213,8 @@ else test -z "$dstfile" && dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=$dstdir/#inst.$$# + rmtmp=$dstdir/#rm.$$# # Trap to clean up those temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 diff --git a/reactos/lib/freetype/builds/unix/install.mk b/reactos/lib/freetype/builds/unix/install.mk index 1930d371601..935005edb49 100644 --- a/reactos/lib/freetype/builds/unix/install.mk +++ b/reactos/lib/freetype/builds/unix/install.mk @@ -51,8 +51,6 @@ install: $(PROJECT_LIBRARY) done $(INSTALL_DATA) $(BUILD_DIR)/ft2unix.h \ $(DESTDIR)$(includedir)/ft2build.h - $(INSTALL_DATA) $(BUILD_DIR)/ftconfig.h \ - $(DESTDIR)$(includedir)/freetype2/freetype/config/ftconfig.h $(INSTALL_SCRIPT) -m 755 $(OBJ_BUILD)/freetype-config \ $(DESTDIR)$(bindir)/freetype-config $(INSTALL_SCRIPT) -m 644 $(BUILD_DIR)/freetype2.m4 \ diff --git a/reactos/lib/freetype/builds/unix/ltmain.sh b/reactos/lib/freetype/builds/unix/ltmain.sh index fe83ff4fb74..8b50e531910 100644 --- a/reactos/lib/freetype/builds/unix/ltmain.sh +++ b/reactos/lib/freetype/builds/unix/ltmain.sh @@ -1,7 +1,7 @@ # 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, 2003 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # @@ -55,8 +55,8 @@ modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.5 -TIMESTAMP=" (1.1220 2003/04/05 19:32:58)" +VERSION=1.4.3 +TIMESTAMP=" (1.922.2.110 2002/10/23 01:39:54)" default_mode= help="Try \`$progname --help' for more information." @@ -69,17 +69,17 @@ rm="rm -f" # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -# test EBCDIC or ASCII -case `echo A|od -x` in - *[Cc]1*) # EBCDIC based system - SP2NL="tr '\100' '\n'" - NL2SP="tr '\r\n' '\100\100'" - ;; - *) # Assume ASCII based system - SP2NL="tr '\040' '\012'" - NL2SP="tr '\015\012' '\040\040'" - ;; -esac +# test EBCDIC or ASCII +case `echo A|od -x` in + *[Cc]1*) # EBCDIC based system + SP2NL="tr '\100' '\n'" + NL2SP="tr '\r\n' '\100\100'" + ;; + *) # Assume ASCII based system + SP2NL="tr '\040' '\012'" + NL2SP="tr '\015\012' '\040\040'" + ;; +esac # NLS nuisances. # Only set LANG and LC_ALL to C if already set. @@ -97,8 +97,8 @@ fi : ${IFS=" "} if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - $echo "$modename: not configured to build any kind of library" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + echo "$modename: not configured to build any kind of library" 1>&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi @@ -114,51 +114,8 @@ execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -win32_libid () { - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` - if test "X$win32_nmres" = "Ximport" ; then - win32_libid_type="x86 archive import" - else - win32_libid_type="x86 archive static" - fi - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $echo $win32_libid_type -} - -# End of Shell function definitions -##################################### - # Parse our command line options once, thoroughly. -while test "$#" -gt 0 +while test $# -gt 0 do arg="$1" shift @@ -174,33 +131,6 @@ do execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; - tag) - tagname="$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit 1 - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; *) eval "$prev=\$arg" ;; @@ -218,25 +148,17 @@ do ;; --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2003 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" - done exit 0 ;; --debug) - $echo "$progname: enabling shell trace mode" + echo "$progname: enabling shell trace mode" set -x ;; @@ -245,16 +167,16 @@ do ;; --features) - $echo "host: $host" + echo "host: $host" if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" + echo "enable shared libraries" else - $echo "disable shared libraries" + echo "disable shared libraries" fi if test "$build_old_libs" = yes; then - $echo "enable static libraries" + echo "enable static libraries" else - $echo "disable static libraries" + echo "disable static libraries" fi exit 0 ;; @@ -270,13 +192,6 @@ do show=: ;; - --tag) prevopt="--tag" prev=tag ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - ;; - -dlopen) prevopt="-dlopen" prev=execute_dlfiles @@ -310,10 +225,8 @@ if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + *cc | *++ | gcc* | *-gcc* | xlc*) mode=link for arg do @@ -368,127 +281,158 @@ if test -z "$show_help"; then modename="$modename: compile" # Get the compilation command and the source file. base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" + prev= + lastarg= + srcfile="$nonopt" suppress_output= - arg_mode=normal - libobj= + user_target=no for arg do - case "$arg_mode" in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal + 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 ;; - target ) - libobj="$arg" - arg_mode=normal + -static) + build_old_libs=yes continue ;; - normal ) - # Accept any command-line options. - case $arg in - -o) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi - arg_mode=target - continue - ;; - - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -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. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg + -prefer-pic) + pic_mode=yes + continue ;; - esac # case $arg_mode + + -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"` - case $lastarg in # 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 - base_compile="$base_compile $lastarg" - done # for arg + # 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 $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit 1 + case $user_target in + set) ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 + no) + # Get the name of the library object. + libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) - # Get the name of the library object. - [ -z "$libobj" ] && 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='[cCFSifmso]' + xform='[cCFSfmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; @@ -496,13 +440,10 @@ if test -z "$show_help"; then *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; - *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` @@ -515,56 +456,6 @@ if test -z "$show_help"; then ;; esac - # Infer tagged configuration to use if any are available and - # if one wasn't chosen via the "--tag" command line option. - # Only attempt this if the compiler in the base compile - # command doesn't match the default compiler. - if test -n "$available_tags" && test -z "$tagname"; then - case $base_compile in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" - case "$base_compile " in - "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit 1 -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi - - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 @@ -573,9 +464,9 @@ if test -z "$show_help"; then # Delete any leftover library objects. if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" + removelist="$obj $libobj" else - removelist="$lobj $libobj ${libobj}T" + removelist="$libobj" fi $run $rm $removelist @@ -600,7 +491,6 @@ if test -z "$show_help"; then removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else - output_obj= need_locks=no lockfile= fi @@ -614,7 +504,7 @@ if test -z "$show_help"; then done elif test "$need_locks" = warn; then if test -f "$lockfile"; then - $echo "\ + echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` @@ -628,55 +518,56 @@ compiler." $run $rm $removelist exit 1 fi - $echo $srcfile > "$lockfile" + echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ + test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then + echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` @@ -705,9 +596,9 @@ compiler." fi # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : + 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 @@ -715,21 +606,48 @@ compiler." fi fi - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ + test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then + echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` @@ -775,7 +695,7 @@ compiler." fi # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else @@ -785,25 +705,23 @@ compiler." fi fi - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T < $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 - $run $mv "${libobj}T" "${libobj}" - # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" @@ -820,7 +738,7 @@ EOF # 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 invocation. + # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying @@ -835,7 +753,6 @@ EOF ;; esac libtool_args="$nonopt" - base_compile="$nonopt" compile_command="$nonopt" finalize_command="$nonopt" @@ -851,7 +768,6 @@ EOF linker_flags= dllsearchpath= lib_search_path=`pwd` - inst_prefix_dir= avoid_version=no dlfiles= @@ -866,7 +782,6 @@ EOF module=no no_install=no objs= - non_pic_objects= prefer_static_libs=no preload=no prev= @@ -878,7 +793,6 @@ EOF temp_rpath= thread_safe=no vinfo= - vinfo_number=no # We need to know -static, to get the right output filenames. for arg @@ -909,9 +823,8 @@ EOF 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 + while test $# -gt 0; do arg="$1" - base_compile="$base_compile $arg" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") @@ -985,123 +898,11 @@ EOF prev= continue ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; release) release="-$arg" prev= continue ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit 1 - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit 1 - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit 1 - fi - arg=$save_arg - prev= - continue - ;; rpath | xrpath) # We need an absolute path. case $arg in @@ -1140,21 +941,13 @@ EOF finalize_command="$finalize_command $wl$qarg" continue ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac - fi # test -n "$prev" + fi # test -n $prev prevarg="$arg" @@ -1206,16 +999,11 @@ EOF 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* | /*-*-irix*) + no/*-*-irix* | no/*-*-nonstopux*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; @@ -1270,18 +1058,14 @@ EOF # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue esac - elif test "X$arg" = "X-lc_r"; then - case $host in + elif test "X$arg" = "X-lc_r"; then + case $host in *-*-openbsd* | *-*-freebsd*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac fi deplibs="$deplibs $arg" continue @@ -1292,34 +1076,6 @@ EOF continue ;; - # gcc -m* arguments should be passed to the linker via $compiler_flags - # in order to pass architecture information to the linker - # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo - # but this is not reliable with gcc because gcc may use -mfoo to - # select a different linker, different libraries, etc, while - # -Wl,-mfoo simply passes -mfoo to the linker. - -m*) - # 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 - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - if test "$with_gcc" = "yes" ; then - compiler_flags="$compiler_flags $arg" - fi - continue - ;; - - -shrext) - prev=shrext - continue - ;; - -no-fast-install) fast_install=no continue @@ -1344,11 +1100,6 @@ EOF continue ;; - -objectlist) - prev=objectlist - continue - ;; - -o) prev=output ;; -release) @@ -1401,11 +1152,6 @@ EOF prev=vinfo continue ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` @@ -1454,11 +1200,6 @@ EOF continue ;; - -XCClinker) - prev=xcclinker - continue - ;; - # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need @@ -1471,102 +1212,30 @@ EOF esac ;; - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit 1 - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit 1 + *.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 - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" + # 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) @@ -1619,54 +1288,12 @@ EOF exit 1 fi - # Infer tagged configuration to use if any are available and - # if one wasn't chosen via the "--tag" command line option. - # Only attempt this if the compiler in the base link - # command doesn't match the default compiler. - if test -n "$available_tags" && test -z "$tagname"; then - case $base_compile in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" - case $base_compile in - "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) - # The compiler in $compile_command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit 1 -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - 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 - oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" @@ -1687,11 +1314,11 @@ EOF output_objdir="$output_objdir/$objdir" fi # Create the object directory. - if test ! -d "$output_objdir"; then + 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 + if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi @@ -1709,17 +1336,7 @@ EOF *) linkmode=prog ;; # Anything else should be a program. esac - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplcations in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - esac specialdeplibs= - libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) @@ -1731,25 +1348,6 @@ EOF 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_compiler_generated_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= @@ -1781,33 +1379,28 @@ EOF ;; esac for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then + if test $linkmode = prog; then + # Determine which files to process case $pass in - dlopen) libs="$dlfiles" ;; + dlopen) + libs="$dlfiles" + save_deplibs="$deplibs" # Collect dlpreopened libraries + deplibs= + ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi for deplib in $libs; do lib= found=no case $deplib in -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + 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 + if test $pass = conv; then deplibs="$deplib $deplibs" continue fi @@ -1827,61 +1420,25 @@ EOF finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" fi continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_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 - fi - ;; - *) ;; - esac - fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" - test "$pass" = conv && continue + 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 + if test $pass = conv; then deplibs="$deplib $deplibs" continue fi - if test "$pass" = scan; then + if test $pass = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else @@ -1890,13 +1447,13 @@ EOF fi ;; *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 ;; esac # linkmode continue ;; # -L -R*) - if test "$pass" = link; then + if test $pass = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in @@ -1909,30 +1466,30 @@ EOF ;; *.la) lib="$deplib" ;; *.$libext) - if test "$pass" = conv; then + 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: Trying to link with static lib archive $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" - $echo "*** because the file extensions .$libext of this argument makes me believe" - $echo "*** that it is just a static archive that I should not used here." + echo + echo "*** Warning: Trying to link with static lib archive $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" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not used here." else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" + 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 + if test $pass != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -1943,18 +1500,14 @@ EOF esac # linkmode ;; # *.$libext *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - 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 + 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 ;; @@ -1963,14 +1516,14 @@ EOF continue ;; esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : + 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 | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + 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 @@ -1986,9 +1539,8 @@ EOF library_names= old_library= # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink + # it will not redefine variable installed. installed=yes - shouldnotlink=no # Read the .la file case $lib in @@ -1998,12 +1550,13 @@ EOF if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then + { 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 + if test $pass = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then @@ -2024,14 +1577,13 @@ EOF fi tmp_libs="$tmp_libs $deplib" done - elif test "$linkmode" != prog && test "$linkmode" != lib; then + 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 @@ -2043,17 +1595,15 @@ EOF fi # This library was specified with -dlopen. - if test "$pass" = dlopen; then + 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. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" + # statically, we need to preload. + dlprefiles="$dlprefiles $lib" else newdlfiles="$newdlfiles $lib" fi @@ -2094,7 +1644,7 @@ EOF name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then + if test $pass = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 @@ -2113,19 +1663,18 @@ EOF if test -z "$libdir"; then # Link the convenience library - if test "$linkmode" = lib; then + 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" # used for prog,scan pass + deplibs="$lib $deplibs" fi continue fi - - if test "$linkmode" = prog && test "$pass" != link; then + if test $linkmode = prog && test $pass != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" @@ -2141,7 +1690,7 @@ EOF -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 + if test $linkalldeplibs = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths @@ -2158,19 +1707,13 @@ EOF continue fi # $linkmode = prog... - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; 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 + 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. @@ -2192,6 +1735,17 @@ EOF 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 && @@ -2201,51 +1755,11 @@ EOF # We only need to search for static libraries continue fi - fi - 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 if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi - # This is a shared library - - # Warn about portability, can't link against -module's on some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; then - $echo "*** Warning: Linking the executable $output against the loadable module" - else - $echo "*** Warning: Linking the shared library $output against the loadable module" - fi - $echo "*** $linklib is not portable!" - fi - if 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 - fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname @@ -2259,7 +1773,7 @@ EOF elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw*) + *cygwin*) major=`expr $current - $age` versuffix="-$major" ;; @@ -2271,8 +1785,8 @@ EOF # 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" + 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 : @@ -2303,9 +1817,9 @@ EOF # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" + fi # test -n $old_archive_from_expsyms_cmds - if test "$linkmode" = prog || test "$mode" != relink; then + if test $linkmode = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= @@ -2314,22 +1828,6 @@ EOF immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" - case $host in - *-*-sco3.2v5* ) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a module then we can not link against it, someone - # is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then - $echo "** Warning, lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $echo - $echo "** And there doesn't seem to be a static archive available" - $echo "** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - fi - esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; @@ -2348,14 +1846,6 @@ EOF add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case "$libdir" in - [\\/]*) - add_dir="-L$inst_prefix_dir$libdir $add_dir" - ;; - esac - fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" @@ -2378,7 +1868,7 @@ EOF *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi - if test "$linkmode" = prog; then + if test $linkmode = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else @@ -2395,7 +1885,7 @@ EOF fi fi - if test "$linkmode" = prog || test "$mode" = relink; then + if test $linkmode = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= @@ -2411,27 +1901,13 @@ EOF *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case "$libdir" in - [\\/]*) - add_dir="-L$inst_prefix_dir$libdir $add_dir" - ;; - esac - fi add="-l$name" fi - if test "$linkmode" = prog; then + if test $linkmode = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else @@ -2439,7 +1915,16 @@ EOF test -n "$add" && deplibs="$add $deplibs" fi fi - elif test "$linkmode" = prog; then + 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. @@ -2459,21 +1944,21 @@ EOF # 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 system can not link to static lib archive $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." + echo + echo "*** Warning: This system can not link to static lib archive $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 "*** But as you try to build a module library, libtool will still create " - $echo "*** a static module, that should work as long as the dlopening application" - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." 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." + 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 @@ -2490,10 +1975,10 @@ EOF fi fi # link shared/static library? - if test "$linkmode" = lib; then + 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 + { 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 @@ -2524,7 +2009,7 @@ EOF tmp_libs="$tmp_libs $deplib" done - if test "$link_all_deplibs" != no; then + if test $link_all_deplibs != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in @@ -2544,7 +2029,7 @@ EOF ;; esac if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" + path="-L$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then @@ -2554,53 +2039,12 @@ EOF if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi - path="$absdir" + path="-L$absdir" fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, but need to link against shared - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - newlib_search_path="$newlib_search_path $path" - path="" - fi - ;; - *) - path="-L$path" - ;; - esac - - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac ;; *) continue ;; esac case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$deplibs $depdepl" ;; - esac - case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac @@ -2608,15 +2052,15 @@ EOF fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then + 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 - if test "$pass" != conv; then + 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 @@ -2638,30 +2082,9 @@ EOF eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) @@ -2689,31 +2112,19 @@ EOF eval $var=\"$tmp_libs\" done # for var fi - # Last step: remove runtime libs from dependency_libs (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs + 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 + if test $linkmode = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi @@ -2727,7 +2138,7 @@ EOF fi if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then @@ -2749,7 +2160,6 @@ EOF case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext\" eval libname=\"$libname_spec\" ;; *) @@ -2761,7 +2171,6 @@ EOF if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` @@ -2774,9 +2183,9 @@ EOF $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!" + echo + echo "*** Warning: Linking the shared library $output against the non-libtool" + echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi @@ -2786,7 +2195,7 @@ EOF fi set dummy $rpath - if test "$#" -gt 2; then + if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" @@ -2795,16 +2204,14 @@ EOF if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. + 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/-version-number' is ignored for convenience libraries" 1>&2 + $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then @@ -2823,46 +2230,9 @@ EOF exit 1 fi - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$2" - number_minor="$3" - number_revision="$4" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` - age="$number_minor" - revision="$number_minor" - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - esac + current="$2" + revision="$3" + age="$4" # Check that each of the things are valid numbers. case $current in @@ -2892,7 +2262,7 @@ EOF ;; esac - if test "$age" -gt "$current"; then + 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 @@ -2905,15 +2275,28 @@ EOF 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" - ;; + darwin* | rhapsody*) + case "$host_os" in + darwin1.[012]) + # 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" + ;; + *) + # 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" + compatage=`expr $age - 1` + compatver="$major.$compatage.0" + verstring="-compatibility_version $compatver -current_version $versuffix" + ;; + esac + ;; freebsd-aout) major=".$current" @@ -2936,7 +2319,7 @@ EOF # Add in all the interfaces that we are compatible with. loop=$revision - while test "$loop" -ne 0; do + while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" @@ -2959,7 +2342,7 @@ EOF # Add in all the interfaces that we are compatible with. loop=$age - while test "$loop" -ne 0; do + while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" @@ -2983,7 +2366,7 @@ EOF *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac @@ -2991,11 +2374,12 @@ EOF # 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="" ;; *) verstring="0.0" @@ -3029,24 +2413,9 @@ EOF fi if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi + # 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. @@ -3059,9 +2428,9 @@ EOF # 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'` + 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 @@ -3074,7 +2443,7 @@ EOF *) finalize_rpath="$finalize_rpath $libdir" ;; esac done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + if test $hardcode_into_libs != yes || test $build_old_libs = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi @@ -3114,11 +2483,10 @@ EOF ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue ;; - *) + *) # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then + if test $build_libtool_need_lc = "yes"; then deplibs="$deplibs -lc" fi ;; @@ -3145,7 +2513,7 @@ EOF # 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 behavior. + # implementing what was already the behaviour. newdeplibs=$deplibs ;; test_compile) @@ -3158,22 +2526,45 @@ EOF int main() { return 0; } EOF $rm conftest - $LTCC -o conftest conftest.c $deplibs - if test "$?" -eq 0 ; then + $CC -o conftest conftest.c $deplibs + if test $? -eq 0 ; then ldd_output=`ldd conftest` for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" -ne "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then + if test -n "$name" && test "$name" != "0"; then + libname=`eval \\$echo \"$libname_spec\"` + deplib_matches=`eval \\$echo \"$library_names_spec\"` + set dummy $deplib_matches + deplib_match=$2 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" + else + droppeddeps=yes + echo + echo "*** Warning: dynamic linker does not accept needed library $i." + 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 I believe you do not have" + echo "*** because a test_compile did reveal that the linker did not use it for" + echo "*** its dynamic dependency list that programs get resolved with at runtime." + fi + else + newdeplibs="$newdeplibs $i" + fi + done + else + # Error occured in the first compile. Let's try to salvage + # the situation: Compile a separate program for each library. + for i in $deplibs; do + name="`expr $i : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + $rm conftest + $CC -o conftest conftest.c $i + # Did it work? + if test $? -eq 0 ; then + ldd_output=`ldd conftest` libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` set dummy $deplib_matches @@ -3182,64 +2573,21 @@ EOF newdeplibs="$newdeplibs $i" else droppeddeps=yes - $echo - $echo "*** Warning: dynamic linker does not accept needed library $i." - $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 I believe you do not have" - $echo "*** because a test_compile did reveal that the linker did not use it for" - $echo "*** its dynamic dependency list that programs get resolved with at runtime." - fi - fi - else - newdeplibs="$newdeplibs $i" - fi - done - else - # Error occurred in the first compile. Let's try to salvage - # the situation: Compile a separate program for each library. - for i in $deplibs; do - name="`expr $i : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - $rm conftest - $LTCC -o conftest conftest.c $i - # Did it work? - if test "$?" -eq 0 ; then - ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $echo - $echo "*** Warning: dynamic linker does not accept needed library $i." - $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" - $echo "*** because a test_compile did reveal that the linker did not use this one" - $echo "*** as a dynamic dependency that programs can get resolved with at runtime." - fi + echo + echo "*** Warning: dynamic linker does not accept needed library $i." + 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" + echo "*** because a test_compile did reveal that the linker did not use this one" + echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi else droppeddeps=yes - $echo - $echo "*** Warning! Library $i is needed by this library but I was not able to" - $echo "*** make it link in! You will probably need to install it or some" - $echo "*** library that it depends on before this library will be fully" - $echo "*** functional. Installing it before continuing would be even better." + echo + echo "*** Warning! Library $i is needed by this library but I was not able to" + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." fi else newdeplibs="$newdeplibs $i" @@ -3253,20 +2601,11 @@ EOF for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; 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 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 # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then @@ -3287,27 +2626,26 @@ EOF done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then + | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi - done - done - fi + done + done if test -n "$a_deplib" ; then droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $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" - $echo "*** because I did check the linker path looking for a file starting" + echo + echo "*** Warning: linker path does not have real file for library $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" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for file magic test)" + echo "*** with $libname but no candidates were found. (...for file magic test)" else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a file magic. Last file checked: $potlib" + echo "*** with $libname and none of the candidates passed a file format test" + echo "*** using a file magic. Last file checked: $potlib" fi fi else @@ -3323,43 +2661,33 @@ EOF name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; 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 - potlib="$potent_lib" # see symlink-check above in file_magic test - 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 + 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 + potlib="$potent_lib" # see symlink-check below in file_magic test + 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 - fi + done if test -n "$a_deplib" ; then droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $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" - $echo "*** because I did check the linker path looking for a file starting" + echo + echo "*** Warning: linker path does not have real file for library $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" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + echo "*** with $libname but no candidates were found. (...for regex pattern test)" else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a regex pattern. Last file checked: $potlib" + echo "*** with $libname and none of the candidates passed a file format test" + echo "*** using a regex pattern. Last file checked: $potlib" fi fi else @@ -3370,23 +2698,16 @@ EOF ;; none | unknown | *) newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo + 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." + echo "*** Warning: inter-library dependencies are not supported in this platform." else - $echo "*** Warning: inter-library dependencies are not known to be supported." + echo "*** Warning: inter-library dependencies are not known to be supported." fi - $echo "*** All declared inter-library dependencies are being dropped." + echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; @@ -3406,17 +2727,17 @@ EOF 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." + 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." + 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" @@ -3426,16 +2747,16 @@ EOF 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." + 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 $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 @@ -3457,7 +2778,7 @@ EOF # 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 + if test $hardcode_into_libs = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= @@ -3493,11 +2814,7 @@ EOF if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi + eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. @@ -3517,7 +2834,6 @@ EOF fi # Get the real and link names of the library. - eval shared_ext=\"$shrext\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" @@ -3528,9 +2844,7 @@ EOF else soname="$realname" fi - if test -z "$dlname"; then - dlname=$soname - fi + test -z "$dlname" && dlname=$soname lib="$output_objdir/$realname" for link @@ -3538,6 +2852,23 @@ EOF 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` @@ -3551,21 +2882,13 @@ EOF save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "using reloadable object file for export list..." - skipped_export=: - fi + $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 "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 @@ -3576,29 +2899,17 @@ EOF $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs 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" + $show "mkdir $gentop" + $run mkdir "$gentop" status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then + if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" @@ -3614,42 +2925,16 @@ EOF $show "${rm}r $xdir" $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" status=$? - if test "$status" -ne 0 && test ! -d "$xdir"; then + if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi @@ -3665,130 +2950,21 @@ EOF fi # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval cmds=\"$module_expsym_cmds\" - else - eval cmds=\"$module_cmds\" - fi - else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else - eval cmds=\"$archive_cmds\" - fi - fi - - if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$save_output-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + save_deplibs="$deplibs" + for conv in $convenience; do + tmp_deplibs= + for test_deplib in $deplibs; do + if test "$test_deplib" != "$conv"; then + tmp_deplibs="$tmp_deplibs $test_deplib" fi - last_robj=$output_objdir/$save_output-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$save_output-${k}.$objext - objlist=$obj - len=1 - fi + done + deplibs="$tmp_deplibs" done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadale object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # 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 - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~$rm $delfiles\" + eval cmds=\"$archive_cmds\" + deplibs="$save_deplibs" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do @@ -3880,10 +3056,10 @@ EOF gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then + if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" @@ -3899,42 +3075,16 @@ EOF $show "${rm}r $xdir" $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" status=$? - if test "$status" -ne 0 && test ! -d "$xdir"; then + if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi @@ -3970,8 +3120,8 @@ EOF # 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 $? + $show "echo timestamp > $libobj" + $run eval "echo timestamp > $libobj" || exit $? exit 0 fi @@ -3987,6 +3137,20 @@ EOF $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 @@ -3999,7 +3163,7 @@ EOF prog) case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + *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 @@ -4021,19 +3185,16 @@ EOF # 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 /'` + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac ;; esac - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - esac - compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" @@ -4184,12 +3345,12 @@ extern \"C\" { done if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $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 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi @@ -4207,8 +3368,8 @@ extern \"C\" { for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' + name=`echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done @@ -4217,7 +3378,7 @@ extern \"C\" { test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi @@ -4237,7 +3398,7 @@ extern \"C\" { if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" + echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ @@ -4289,18 +3450,18 @@ static const void *lt_preloaded_setup() { *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; + *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + $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" @@ -4325,7 +3486,7 @@ static const void *lt_preloaded_setup() { finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + 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" @@ -4470,228 +3631,13 @@ static const void *lt_preloaded_setup() { # 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$,,'` ;; + *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *cygwin*) exeext=.exe ;; *) exeext= ;; esac - case $host in - *cygwin* | *mingw* ) - cwrappersource=`$echo ${objdir}/lt-${output}.c` - cwrapper=`$echo ${output}.exe` - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 - - cat > $cwrappersource <> $cwrappersource<<"EOF" -#include -#include -#include -#include -#include -#include - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef DIR_SEPARATOR -#define DIR_SEPARATOR '/' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -#define HAVE_DOS_BASED_FILE_SYSTEM -#ifndef DIR_SEPARATOR_2 -#define DIR_SEPARATOR_2 '\\' -#endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -char * basename (const char *name); -char * fnqualify(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup ((char *) basename (argv[0])); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" - newargz[1] = fnqualify(argv[0]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -char * -basename (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha (name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return (char *) base; -} - -char * -fnqualify(const char *path) -{ - size_t size; - char *p; - char tmp[LT_PATHMAX + 1]; - - assert(path != NULL); - - /* Is it qualified already? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha (path[0]) && path[1] == ':') - return xstrdup (path); -#endif - if (IS_DIR_SEPARATOR (path[0])) - return xstrdup (path); - - /* prepend the current directory */ - /* doesn't handle '~' */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ - p = XMALLOC(char, size); - sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); - return p; -} - -char * -strendzap(char *str, const char *pat) -{ - size_t len, patlen; - - assert(str != NULL); - assert(pat != NULL); - - len = strlen(str); - patlen = strlen(pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC -s -o $cwrapper $cwrappersource - ;; - esac $rm $output trap "$rm $output; exit 1" 1 2 15 @@ -4709,7 +3655,7 @@ EOF # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' +Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -4769,7 +3715,7 @@ else " if test "$fast_install" = yes; then - $echo >> $output "\ + echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" @@ -4785,7 +3731,7 @@ else $rm \"\$progdir/\$file\" fi" - $echo >> $output "\ + echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then @@ -4803,13 +3749,13 @@ else $rm \"\$progdir/\$file\" fi" else - $echo >> $output "\ + echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi - $echo >> $output "\ + echo >> $output "\ if test -f \"\$progdir/\$program\"; then" @@ -4820,7 +3766,7 @@ else $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 + # 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 @@ -4840,6 +3786,14 @@ else # 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 "\ @@ -4849,7 +3803,11 @@ else *) $echo >> $output "\ - exec \$progdir/\$program \${1+\"\$@\"} + # Export the path to the program. + PATH=\"\$progdir:\$PATH\" + export PATH + + exec \$program \${1+\"\$@\"} " ;; esac @@ -4861,7 +3819,7 @@ 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 + echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ @@ -4884,7 +3842,7 @@ fi\ oldobjs="$libobjs_save" build_libtool_libs=no else - oldobjs="$old_deplibs $non_pic_objects" + oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi @@ -4893,10 +3851,10 @@ fi\ gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then + if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" @@ -4913,40 +3871,14 @@ fi\ $show "${rm}r $xdir" $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" status=$? - if test "$status" -ne 0 && test ! -d "$xdir"; then + if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done @@ -4956,65 +3888,25 @@ fi\ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - # GNU ar 2.10+ was changed to match POSIX; thus no paths are - # encoded into archives. This makes 'ar r' malfunction in - # this piecewise linking case whenever conflicting object - # names appear in distinct ar calls; check, warn and compensate. - if (for obj in $save_oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 - $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 - AR_FLAGS=cq - fi - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len"; then - : + # 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 - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= + xdir="$xdir" fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~$old_archive_cmds\" + 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 - fi + done + + eval cmds=\"$old_archive_cmds\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do @@ -5049,7 +3941,7 @@ fi\ fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. @@ -5104,7 +3996,7 @@ fi\ # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file @@ -5133,16 +4025,13 @@ revision=$revision # Is this an already installed library? installed=$installed -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - # 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 + if test "$installed" = no && test $need_relink = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi @@ -5278,7 +4167,7 @@ relink_command=\"$relink_command\"" # Not a directory, so check to see that there is only one file specified. set dummy $files - if test "$#" -gt 2; then + if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 @@ -5318,7 +4207,7 @@ relink_command=\"$relink_command\"" *.la) # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + 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 @@ -5353,33 +4242,12 @@ relink_command=\"$relink_command\"" 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. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - 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 + continue fi fi @@ -5401,7 +4269,7 @@ relink_command=\"$relink_command\"" $run eval "$striplib $destdir/$realname" || exit $? fi - if test "$#" -gt 0; then + if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do @@ -5487,43 +4355,23 @@ relink_command=\"$relink_command\"" destfile="$destdir/$destfile" fi - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + wrapper=`echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= - # To insure that "foo" is sourced, and not "foo.exe", - # finese the cygwin/MSYS system by explicitly sourcing "foo." - # which disallows the automatic-append-.exe behavior. - case $build in - *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; - *) wrapperdot=${wrapper} ;; - esac # If there is no directory component, then add one. case $file in - */* | *\\*) . ${wrapperdot} ;; - *) . ./${wrapperdot} ;; + */* | *\\*) . $wrapper ;; + *) . ./$wrapper ;; esac # Check the variables that should have been set. @@ -5551,17 +4399,10 @@ relink_command=\"$relink_command\"" done relink_command= - # To insure that "foo" is sourced, and not "foo.exe", - # finese the cygwin/MSYS system by explicitly sourcing "foo." - # which disallows the automatic-append-.exe behavior. - case $build in - *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; - *) wrapperdot=${wrapper} ;; - esac # If there is no directory component, then add one. case $file in - */* | *\\*) . ${wrapperdot} ;; - *) . ./${wrapperdot} ;; + */* | *\\*) . $wrapper ;; + *) . ./$wrapper ;; esac outputname= @@ -5575,7 +4416,7 @@ relink_command=\"$relink_command\"" $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + 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'` @@ -5593,14 +4434,14 @@ relink_command=\"$relink_command\"" fi else # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + 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*) + /usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok @@ -5609,7 +4450,7 @@ relink_command=\"$relink_command\"" destfile=$destfile.exe ;; *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + destfile=`echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; @@ -5694,42 +4535,42 @@ relink_command=\"$relink_command\"" fi # Exit here if they wanted silent mode. - test "$show" = : && exit 0 + test "$show" = ":" && exit 0 - $echo "----------------------------------------------------------------------" - $echo "Libraries have been installed in:" + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" for libdir in $libdirs; do - $echo " $libdir" + 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:" + 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" + 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" + 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" + echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then - $echo " - have your system administrator run these commands:$admincmds" + 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'" + 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 "----------------------------------------------------------------------" + 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 ;; @@ -5757,7 +4598,7 @@ relink_command=\"$relink_command\"" case $file in *.la) # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + 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 @@ -5828,7 +4669,7 @@ relink_command=\"$relink_command\"" -*) ;; *) # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + 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 ;; @@ -5851,7 +4692,7 @@ relink_command=\"$relink_command\"" eval "export $shlibpath_var" fi - # Restore saved environment variables + # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi @@ -5901,20 +4742,19 @@ relink_command=\"$relink_command\"" rmdirs= - origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. - objdir="$origobjdir" + objdir="$objdir" else - objdir="$dir/$origobjdir" + objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" + test $mode = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then + if test $mode = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; @@ -5938,7 +4778,7 @@ relink_command=\"$relink_command\"" case $name in *.la) # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. @@ -5946,9 +4786,9 @@ relink_command=\"$relink_command\"" rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - if test "$mode" = uninstall; then + if test $mode = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" @@ -5957,7 +4797,7 @@ relink_command=\"$relink_command\"" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then + if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done @@ -5972,7 +4812,7 @@ relink_command=\"$relink_command\"" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then + if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done @@ -5984,52 +4824,22 @@ relink_command=\"$relink_command\"" ;; *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi + if test "$build_old_libs" = yes; then + oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` + rmfiles="$rmfiles $dir/$oldobj" fi ;; *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename + # 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 - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi + 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 ;; @@ -6037,7 +4847,6 @@ relink_command=\"$relink_command\"" $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done - objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -6085,7 +4894,6 @@ Provide generalized library-building support services. --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: @@ -6099,9 +4907,7 @@ MODE must be one of the following: 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. - -Report bugs to ." +a more detailed description of MODE." exit 0 ;; @@ -6213,7 +5019,6 @@ The following components of LINK-COMMAND are treated specially: -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 - -objectlist FILE Use a list of object files found in FILE to specify 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 @@ -6259,31 +5064,11 @@ Otherwise, only FILE itself is deleted using RM." ;; esac -$echo +echo $echo "Try \`$modename --help' for more information about other modes." exit 0 -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - # Local Variables: # mode:shell-script # sh-indentation:2 diff --git a/reactos/lib/freetype/builds/unix/mkinstalldirs b/reactos/lib/freetype/builds/unix/mkinstalldirs index a55cff67069..d2d5f21b611 100644 --- a/reactos/lib/freetype/builds/unix/mkinstalldirs +++ b/reactos/lib/freetype/builds/unix/mkinstalldirs @@ -1,26 +1,20 @@ #! /bin/sh # mkinstalldirs --- make directory hierarchy -# Original author: Noah Friedman +# Author: Noah Friedman # Created: 1993-05-16 -# Public domain. - -scriptversion=2003-09-26.19 +# Public domain errstatus=0 dirmode="" usage="\ -Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... - -Create each directory DIR (with mode MODE, if specified), including all -leading file name components. -" +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" + echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg @@ -29,10 +23,6 @@ while test $# -gt 0 ; do dirmode=$1 shift ;; - --version) - echo "$0 $scriptversion" - exit 0 - ;; --) # stop option processing shift break @@ -65,25 +55,12 @@ case $dirmode in if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" - else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - test -d ./-p && rmdir ./-p - test -d ./-- && rmdir ./-- fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" - else - # Clean up after NextStep and OpenStep mkdir. - for d in ./-m ./-p ./-- "./$dirmode"; - do - test -d $d && rmdir $d - done fi ;; esac @@ -107,17 +84,17 @@ do mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then - errstatus=$lasterr + errstatus=$lasterr else - if test ! -z "$dirmode"; then + if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" - lasterr="" - chmod "$dirmode" "$pathcomp" || lasterr=$? + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi fi fi @@ -130,8 +107,5 @@ exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" # End: +# mkinstalldirs ends here diff --git a/reactos/lib/freetype/builds/unix/unix-cc.in b/reactos/lib/freetype/builds/unix/unix-cc.in index 2d1f17e5f5f..50df267842b 100644 --- a/reactos/lib/freetype/builds/unix/unix-cc.in +++ b/reactos/lib/freetype/builds/unix/unix-cc.in @@ -70,10 +70,7 @@ T := -o$(space) # Use the ANSIFLAGS variable to define the compiler flags used to enfore # ANSI compliance. # -# We use our own FreeType configuration file. -# -CFLAGS := -c @XX_CFLAGS@ @CPPFLAGS@ @CFLAGS@ \ - -DFT_CONFIG_CONFIG_H="" +CFLAGS := -c @XX_CFLAGS@ @CPPFLAGS@ @CFLAGS@ # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # diff --git a/reactos/lib/freetype/builds/vms/ftconfig.h b/reactos/lib/freetype/builds/vms/ftconfig.h index 795e757dadd..3174ffeab95 100644 --- a/reactos/lib/freetype/builds/vms/ftconfig.h +++ b/reactos/lib/freetype/builds/vms/ftconfig.h @@ -4,7 +4,7 @@ /* */ /* VMS-specific configuration file (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -34,8 +34,8 @@ /*************************************************************************/ -#ifndef __FTCONFIG_H__ -#define __FTCONFIG_H__ +#ifndef FTCONFIG_H +#define FTCONFIG_H /* Include the header file containing all developer build options */ @@ -43,7 +43,6 @@ #include FT_CONFIG_OPTIONS_H #include FT_CONFIG_STANDARD_LIBRARY_H - FT_BEGIN_HEADER /*************************************************************************/ @@ -90,19 +89,6 @@ FT_BEGIN_HEADER /*************************************************************************/ - /*************************************************************************/ - /* */ - /* Mac support */ - /* */ - /* This is the only necessary change, so it is defined here instead */ - /* providing a new configuration file. */ - /* */ -#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \ - ( defined( __MWERKS__ ) && defined( macintosh ) ) -#define FT_MACINTOSH 1 -#endif - - /*************************************************************************/ /* */ /* IntN types */ @@ -126,84 +112,32 @@ FT_BEGIN_HEADER #error "no 32bit type found -- please check your configuration files" #endif - /* look up an integer type that is at least 32 bits */ -#if FT_SIZEOF_INT >= 4 - - typedef int FT_Fast; - typedef unsigned int FT_UFast; - -#elif FT_SIZEOF_LONG >= 4 - - typedef long FT_Fast; - typedef unsigned long FT_UFast; - -#endif - - - /* determine whether we have a 64-bit int type for platforms without */ - /* Autoconf */ #if FT_SIZEOF_LONG == 8 /* FT_LONG64 must be defined if a 64-bit type is available */ #define FT_LONG64 -#define FT_INT64 long - -#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ - - /* this compiler provides the __int64 type */ -#define FT_LONG64 -#define FT_INT64 __int64 - -#elif defined( __BORLANDC__ ) /* Borland C++ */ - - /* XXXX: We should probably check the value of __BORLANDC__ in order */ - /* to test the compiler version. */ - - /* this compiler provides the __int64 type */ -#define FT_LONG64 -#define FT_INT64 __int64 - -#elif defined( __WATCOMC__ ) /* Watcom C++ */ - - /* Watcom doesn't provide 64-bit data types */ - -#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ - -#define FT_LONG64 -#define FT_INT64 long long int - -#elif defined( __GNUC__ ) - - /* GCC provides the "long long" type */ -#define FT_LONG64 -#define FT_INT64 long long int - -#endif /* FT_SIZEOF_LONG == 8 */ - - -#define FT_BEGIN_STMNT do { -#define FT_END_STMNT } while ( 0 ) -#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT +#define FT_INT64 long +#else /*************************************************************************/ /* */ - /* A 64-bit data type will create compilation problems if you compile */ - /* in strict ANSI mode. To avoid them, we disable their use if */ - /* __STDC__ is defined. You can however ignore this rule by */ - /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ + /* Many compilers provide the non-ANSI `long long' 64-bit type. You can */ + /* activate it by defining the FTCALC_USE_LONG_LONG macro in */ + /* `ftoption.h'. */ /* */ -#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) + /* Note that this will produce many -ansi warnings during library */ + /* compilation, and that in many cases, the generated code will be */ + /* neither smaller nor faster! */ + /* */ +#ifdef FTCALC_USE_LONG_LONG -#ifdef __STDC__ +#define FT_LONG64 +#define FT_INT64 long long - /* undefine the 64-bit macros in strict ANSI compilation mode */ -#undef FT_LONG64 -#undef FT_INT64 +#endif /* FTCALC_USE_LONG_LONG */ -#endif /* __STDC__ */ - -#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ +#endif /* FT_SIZEOF_LONG == 8 */ #ifdef FT_MAKE_OPTION_SINGLE_OBJECT @@ -223,7 +157,6 @@ FT_BEGIN_HEADER #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ - #ifndef FT_BASE #ifdef __cplusplus @@ -234,16 +167,15 @@ FT_BEGIN_HEADER #endif /* !FT_BASE */ - -#ifndef FT_BASE_DEF +#ifndef BASE_DEF #ifdef __cplusplus -#define FT_BASE_DEF( x ) extern "C" x +#define BASE_DEF( x ) extern "C" x #else -#define FT_BASE_DEF( x ) extern x +#define BASE_DEF( x ) extern x #endif -#endif /* !FT_BASE_DEF */ +#endif /* !BASE_DEF */ #ifndef FT_EXPORT @@ -256,7 +188,6 @@ FT_BEGIN_HEADER #endif /* !FT_EXPORT */ - #ifndef FT_EXPORT_DEF #ifdef __cplusplus @@ -278,9 +209,6 @@ FT_BEGIN_HEADER #endif /* !FT_EXPORT_VAR */ - /* The following macros are needed to compile the library with a */ - /* C++ compiler and with 16bit compilers. */ - /* */ /* This is special. Within C++, you must specify `extern "C"' for */ /* functions which are used via function pointers, and you also */ @@ -288,42 +216,23 @@ FT_BEGIN_HEADER /* assure C linkage -- it's not possible to have (local) anonymous */ /* functions which are accessed by (global) function pointers. */ /* */ - /* */ - /* FT_CALLBACK_DEF is used to _define_ a callback function. */ - /* */ - /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */ - /* contains pointers to callback functions. */ - /* */ - /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */ - /* that contains pointers to callback functions. */ - /* */ - /* */ - /* Some 16bit compilers have to redefine these macros to insert */ - /* the infamous `_cdecl' or `__fastcall' declarations. */ - /* */ -#ifndef FT_CALLBACK_DEF #ifdef __cplusplus -#define FT_CALLBACK_DEF( x ) extern "C" x -#else -#define FT_CALLBACK_DEF( x ) static x -#endif -#endif /* FT_CALLBACK_DEF */ -#ifndef FT_CALLBACK_TABLE -#ifdef __cplusplus -#define FT_CALLBACK_TABLE extern "C" -#define FT_CALLBACK_TABLE_DEF extern "C" -#else -#define FT_CALLBACK_TABLE extern -#define FT_CALLBACK_TABLE_DEF /* nothing */ -#endif -#endif /* FT_CALLBACK_TABLE */ +#define FT_CALLBACK_DEF( x ) extern "C" x +#define FT_CALLBACK_TABLE extern "C" +#define FT_CALLBACK_TABLE_DEF extern "C" +#else + +#define FT_CALLBACK_DEF( x ) static x +#define FT_CALLBACK_TABLE extern +#define FT_CALLBACK_TABLE_DEF + +#endif /* __cplusplus */ FT_END_HEADER - -#endif /* __FTCONFIG_H__ */ +#endif /* FTCONFIG_H */ /* END */ diff --git a/reactos/lib/freetype/builds/win32/visualc/index.html b/reactos/lib/freetype/builds/win32/visualc/index.html index f17246a1103..d491c5a5d50 100644 --- a/reactos/lib/freetype/builds/win32/visualc/index.html +++ b/reactos/lib/freetype/builds/win32/visualc/index.html @@ -19,15 +19,6 @@ -

Be sure to extract the files with the Windows (CR+LF) line endings. -ZIP archives are already stored this way, so no further step is required. -If you use some .tar.*z archives, be sure to configure your extracting -tool to convert the line endings. For example, with -WinZip, you should set the "TAR file -smart CR/LF Conversion" option on. Alternatively, you may consider using -the "unix2dos" or "u2d" utilities that are floating around, which -specifically deal with this particular problem. -

Build directories are placed in the top-level "objs" directory

Enjoy :-)

diff --git a/reactos/lib/freetype/devel/ft2build.h b/reactos/lib/freetype/devel/ft2build.h index 242ac1e85e5..ff0e0031aae 100644 --- a/reactos/lib/freetype/devel/ft2build.h +++ b/reactos/lib/freetype/devel/ft2build.h @@ -28,14 +28,14 @@ * "ftoption.h"), then invoke Jam as usual. */ -#ifndef __FT2_BUILD_DEVEL_H__ -#define __FT2_BUILD_DEVEL_H__ +#ifndef __FT2_BUILD_GENERIC_H__ +#define __FT2_BUILD_GENERIC_H__ #define FT_CONFIG_OPTIONS_H #include -#endif /* __FT2_BUILD_DEVEL_H__ */ +#endif /* __FT2_BUILD_GENERIC_H__ */ /* END */ diff --git a/reactos/lib/freetype/devel/ftoption.h b/reactos/lib/freetype/devel/ftoption.h index 3ba11bfae0d..3d806c9926b 100644 --- a/reactos/lib/freetype/devel/ftoption.h +++ b/reactos/lib/freetype/devel/ftoption.h @@ -296,7 +296,7 @@ FT_BEGIN_HEADER /* Do not #undef this macro here since the build system might define */ /* it for certain configurations only. */ /* */ -#define FT_DEBUG_MEMORY +/* #define FT_DEBUG_MEMORY */ /*************************************************************************/ diff --git a/reactos/lib/freetype/docs/CHANGES b/reactos/lib/freetype/docs/CHANGES index ddcc31e6bbe..42afa8b0071 100644 --- a/reactos/lib/freetype/docs/CHANGES +++ b/reactos/lib/freetype/docs/CHANGES @@ -1,528 +1,316 @@ -LATEST CHANGES BETWEEN 2.1.8 and 2.1.7 - - I. IMPORTANT BUG FIXES - - - The native TrueType hinter contained some bugs which prevented - some fonts to be rendered correctly, most notably Legendum.otf. - - - The linear advance width and height values were incorrectly - rounded, making them virtually unusable if not loaded with - FT_LOAD_LINEAR_DESIGN. - - - Indexing CID-keyed CFF fonts is now working: The glyph index is - correctly treated as a CID, similar to FreeType's CID driver - module. Note that CID CMaps support is still missing. - - - The FT_FACE_FLAGS_GLYPH_NAMES is now set correctly for all font - formats. - - - Some subsetted Type 1 fonts weren't parsed correctly. This bug - has been introduced in 2.1.7. - - - The WinFNT driver now correctly reports FT_ENCODING_NONE for all - but one encoding. Use the new FT_WinFNT_ID_XXX values together - with FT_Get_WinFNT_Header() to get the WinFNT charset ID. - - - The descender metrics (face->size->metrics.descender) for WinFNT - bitmap fonts had the wrong sign. - - - The (emulated) seac support for CFF fonts was broken. - - - The flex operator didn't work for CFF fonts. - - - II. IMPORTANT CHANGES - - - Both PCF and BDF drivers now handle the SETWIDTH_NAME and - ADD_STYLE_NAME properties. Values are appended to - face->style_name; example: `Bold SemiCondensed'. - - - A new API function `FT_Get_CMap_Language_ID' (declared in - `tttables.h') is available to get the language ID of a - TrueType/SFNT cmap. - - - The hexadecimal format of data after the `StartData' command in - CID-keyed Type 1 fonts is now supported. While this can't occur - in file-based fonts, it can happen in document-embedded - resources of PostScript documents. - - - The cache sub-system has been rewritten. - - - There is now support for deinstallation of faces. - - - A new API function `FTC_Manager_RemoveFaceID' has been added - to delete all `idle' nodes that correspond to a given - FTC_FaceID. All `locked' nodes (i.e., those with a reference - count > 0), will be modified to prevent them from appearing in - further lookups (they will be cleaned normally when their - reference count reaches 0). - - - There is now support for point scaling (i.e., providing - character sizes in points + dpis, instead of pixels). - - - Three abstract cache classes are now available: - - FTC_GCache: Used to store one glyph item per cache node, - with the ability to group common attributes into - `families'. This replaces the old - FTC_GlyphCache class. - - FTC_ICache: Used to store one FT_Glyph per cache node. This - extends FTC_GCache. Family definition, family - comparison, and glyph loading are however left - to sub-classes. - - FTC_SCache: Used to store up to 16 small bitmaps per cache - node. This extends FTC_GCache. Family - definition, family comparison and glyph loading - are however left to sub-classes. - - - The file `src/cache/ftcbasic.c' implements: - - FTC_ImageCache: Extends FTC_ICache; implements family - definitions and glyph loading similar to the - old API. - - FTC_SBitCache: Extends FTC_SCache, implements family - definitions and glyph loading similar to the - old API - - Client applications should be able to extend FTC_GCache, - FTC_ICache, or FTC_SCache much more easily (i.e., less code to - write, and less callbacks). For example, one could envision - caches that are capable of storing transformed (obliqued), - stroked, emboldened, or colored glyph images. Use - `ftcbasic.c' as an example. - - - All public APIs are now in `include/freetype/ftcache.h', (to - be accessed as `FT_CACHE_H'). The contents of - `include/freetype/cache/' is only needed by applications that - wish to implement their own caches. - - - There were some major performance improvements through the use - of various programming tricks. Cache hits are up to 70% - faster than in the old code. - - - The FTC_CMapCache has been simplied. Charmaps can only be - accessed by index right now. There is also a new API named - `FT_Charmap_GetIndex' for this purpose. - - - The demo programs have been updated to the new code. The - previous versions will not work with the current one. - - - III. MISCELLANEOUS - - - Wolfgang Domröse contributed support files for building FreeType - on the Atari using the PureC compiler. Note that the Atari is a - 16bit platform. - - -====================================================================== - -LATEST CHANGES BETWEEN 2.1.7 and 2.1.6 - - I. IMPORTANT BUG FIXES - - - Updated to newest libtool version, fixing build problems on - various platforms. - - - On Unix platforms, `make install' didn't copy the correct - `ftconfig.h' file. - - Note that version 2.1.7 contains the same library C source code as - version 2.1.6. - - -====================================================================== - -LATEST CHANGES BETWEEN 2.1.6 and 2.1.5 - - I. IMPORTANT BUG FIXES - - - The PFR font driver didn't load kerning tables correctly, and - the functions in FT_PFR_H didn't work at all. - - - Type 1 font files in binary format (PFB) with an end-of-file - indicator weren't accepted by the FreeType engine. - - - Fonts which contain /PaintType and /StrokeWidth no longer cause - a segfault. This bug has been introduced in version 2.1.5. - - - Fonts loaded with FT_LOAD_RENDER no longer cause strange - results. This bug has been introduced in version 2.1.5. - - - Some Windows (bitmap) FNT/FON files couldn't be handled - correctly. - - - II. IMPORTANT CHANGES - - - The internal module API has been heavily changed in favor of - massive simplifications within the font engine. This also means - that authors of third-party modules must adapt their code to the - new scheme. - - NOTE: THE NEW SCHEME IS NOT COMPLETED YET. PLEASE WAIT UNTIL A - FINAL ANNOUNCEMENT! - - - The PostScript parser has been enhanced to handle comments and - strings correctly. Additionally, more syntax forms are - recognized. - - - Added the optional unpatented hinting system for TrueType. It - allows typefaces which need hinting to produce correct glyph - forms (e.g., Chinese typefaces from Dynalab) to work acceptably - without infringing Apple patents. This system is compiled only - if TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING is defined in - ftoption.h (activated by default). - - - III. MISCELLANEOUS - - - There is now a guard in the public header files to protect - against inclusion of freetype.h from FreeType 1. - - - Direct inclusion of freetype.h and other public header files no - longer works. You have to use the documented scheme - - #include - #include FT_FREETYPE_H - - to load freetype.h with a symbolic name. This protects against - renaming of public header files (which shouldn't happen but - actually has, avoiding two public header files with the same - name). - - -====================================================================== - LATEST CHANGES BETWEEN 2.1.5 and 2.1.4 + I. IMPORTANT BUG FIXES - - Parsing the /CIDFontName field now removes the leading slash to + - Parsing the /CIDFontName field now removes the leading slash to be in sync with other font drivers. - - gzip support was buggy. Some fonts could not be read. + - gzip support was buggy. Some fonts could not be read. - - Fonts which have nested subglyphs more than one level deep no + - Fonts which have nested subglyphs more than one level deep no longer cause a segfault. - - Creation of synthetic cmaps for fonts in CFF format was broken + - Creation of synthetic cmaps for fonts in CFF format was broken partially. - - Numeric font dictionary entries for synthetic fonts are no - longer overwritten. + - Numeric font dictionary entries for synthetic fonts are no longer + overwritten. - - The font matrix wasn't applied to the advance width for Type1, - CID, and CFF fonts. This caused problems when loading certain - synthetic Type 1 fonts like `Helvetica Narrow'. + - The font matrix wasn't applied to the advance width for Type1, CID, + and CFF fonts. This caused problem when loading certain synthetic + Type 1 fonts like "Helvetica Narrow" - - The test for the charset registry in BDF and PCF fonts is now + - The test for the charset registry in BDF and PCF fonts is now case-insensitive. - - FT_Vector_Rotate sometimes returned strange values due to + - FT_Vector_Rotate rotating sometimes returned strange values due to rounding errors. - - The PCF driver now returns the correct number of glyphs - (including an artificial `notdef' glyph at index 0). + - The PCF driver now returns the correct number of glyphs (including + an artificial `notdef' glyph at index 0). - - FreeType now supports buggy CMaps which are contained in many - CJK fonts from Dynalab. + - FreeType now supports buggy CMaps which are contained in many CJK + fonts from Dynalab. - - Opening an invalid font on a Mac caused a segfault due to + - Opening an invalid font on a Mac caused a segfault due to double-freeing memory. - - BDF fonts with more than 32768 glyphs weren't supported - properly. + - BDF fonts with more than 32768 glyphs weren't supported properly. II. IMPORTANT CHANGES - Accessing bitmap font formats has been synchronized. To do that - the FT_Bitmap_Size structure has been extended to contain new + the FT_Bitmap_Size structure has been extended to contain new fields `size', `x_ppem', and `y_ppem'. - The FNT driver now returns multiple faces, not multiple strikes. - - The `psnames' module has been updated to the Adobe Glyph List + - The `psnames' module has been updated to the Adobe Glyph List version 2.0. - The `psnames' module now understands `uXXXX[X[X]]' glyph names. - The algorithm for guessing the font style has been improved. - - For fonts in SFNT format, root->height is no longer increased if - the line gap is zero. There exist fonts (containing e.g. form - drawing characters) which intentionally have a zero line gap - value. + - For fonts in sfnt format, root->height is no longer increased if + the line gap is zero. There exist fonts (containing e.g. form + drawing characters) which intentionally have a zero line gap value. - - ft_glyph_bbox_xxx flags are now deprecated in favour of + - ft_glyph_bbox_xxx flags are now deprecated in favour of FT_GLYPH_BBOX_XXX. - - ft_module_xxx flags are now deprecated in favour of - FT_MODULE_XXX. + - ft_module_xxx flags are now deprecated in favour of FT_MODULE_XXX. - - FT_ENCODING_MS_{SJIS,GB2312,BIG5,WANSUNG,JOHAB} are now - deprecated in favour of - FT_ENCODING_{SJIS,GB2312,GIB5,WANSONG,JOHAB} -- those encodings - are not specific to Microsoft. + - FT_ENCODING_MS_{SJIS,GB2312,BIG5,WANSUNG,JOHAB} are now deprecated + in favour of FT_ENCODING_{SJIS,GB2312,GIB5,WANSONG,JOHAB} -- those + encodings are not specific to Microsoft. III. MISCELLANEOUS - - The autohinter has been further improved; for example, `m' - glyphs now retain its vertical symmetry. + - The autohinter has been further improved; for example, `m' glyphs + now retain its vertical symmetry. - Partial support of Mac fonts on non-Mac platforms. - - `make refdoc' (after first `make') builds the HTML - documentation. You need Python for this. + - `make refdoc' (after first `make') builds the HTML documentation. + You need Python for this. - - The make build system should now work more reliably on DOS-like + - The make build system should now work more reliably on DOS-like platforms. - - Support for EMX gcc and Watson C/C++ compilers on MS-DOS has - been added. + - Support for EMX gcc and Watson C/C++ compilers on MS-DOS has been + added. - Better VMS build support. - - Support for the pkg-config package by providing a `freetype.pc' + - Support for the pkg-config package by providing a `freetype.pc' file. - New configure option --with-old-mac-fonts for Darwin. - - Some source files have been renamed (mainly to fit into the 8.3 + - Some source files have been renamed (mainly to fit into the 8.3 naming scheme). -====================================================================== +============================================================================== LATEST CHANGES BETWEEN 2.1.4 and 2.1.3 I. IMPORTANT BUG FIXES - - Updated to newest libtool version, fixing build problems on - various platforms. + - Updated to newest libtool version, fixing build problems on various + platforms. - - A fix in the Gzip stream reader: It couldn't read certain .gz - files properly due to a small typo. In certain cases, FreeType - could also loop endlessly when trying to load tiny gzipped - files. + - A fix in the Gzip stream reader: It couldn't read certain .gz files + properly due to a small typo. In certain cases, FreeType could also + loop endlessly when trying to load tiny gzipped files. - - The configure script now tries to use the system-wide zlib when - it finds one (instead of the copy found in src/gzip). And - "freetype-config" has been updated to return relevant flags in - this case when invoked with "--libs" (e.g. "-lzlib"). + - The configure script now tries to use the system-wide zlib when + it finds one (instead of the copy found in src/gzip). And + "freetype-config" has been updated to return relevant flags in this + case when invoked with "--libs" (e.g. "-lzlib"). - - Certain fonts couldn't be loaded by 2.1.3 because they lacked a - Unicode charmap (e.g. SYMBOL.TTF). FreeType erroneously - rejected them. + - Certain fonts couldn't be loaded by 2.1.3 because they lacked a + Unicode charmap (e.g. SYMBOL.TTF). FreeType erroneously rejected + them. - The CFF loader was modified to accept fonts which only contain a - subset of their reference charset. This prevented the correct - use of PDF-embedded fonts. + subset of their reference charset. This prevented the correct use + of PDF-embedded fonts. - The logic to detect Unicode charmaps has been modified. This is - required to support fonts which include both 16-bit and 32-bit - charmaps (like very recent asian ones) using the new 10 and 12 - SFNT formats. + required to support fonts which include both 16-bit and 32-bit + charmaps (like very recent asian ones) using the new 10 and 12 SFNT + formats. - - The TrueType loader now limits the depth of composite glyphs. - This is necessary to prevent broken fonts to break the engine by - blowing the stack with recursive glyph definitions. + - The TrueType loader now limits the depth of composite glyphs. This is + necessary to prevent broken fonts to break the engine by blowing the + stack with recursive glyph definitions. - - The CMap cache is now capable of managing UCS-4 character codes - that are mapped through extended charmaps in recent - TrueType/OpenType fonts. + - The CMap cache is now capable of managing UCS-4 character codes that + are mapped through extended charmaps in recent TrueType/OpenType + fonts. - - The cache sub-system now properly manages out-of-memory - conditions instead of blindly reporting them to the caller. - This means that it will try to empty the cache before restarting - its allocations to see if that can help. + - The cache sub-system now properly manages out-of-memory conditions + instead of blindly reporting them to the caller. This means that it + will try to empty the cache before restarting its allocations to see + if that can help. - - The PFR driver didn't return the list of available embedded - bitmaps properly. + - The PFR driver didn't return the list of available embedded bitmaps + properly. - - There was a nasty memory leak when using embedded bitmaps in - certain font formats. + - There was a nasty memory leak when using embedded bitmaps in certain + font formats. II. IMPORTANT CHANGES - - David Chester contributed some enhancements to the auto-hinter - that significantly increase the quality of its output. The - Postscript hinter was also improved in several ways. + - David Chester contributed some enhancements to the auto-hinter that + significantly increase the quality of its output. The Postscript + hinter was also improved in several ways. - The FT_RENDER_MODE_LIGHT render mode was implemented. - - A new API function called `FT_Get_BDF_Property' has been added - to FT_BDF_H to retrieve BDF properties from BDF _and_ PCF font - files. THIS IS STILL EXPERIMENTAL, since it hasn't been - properly tested yet. + - A new API function called `FT_Get_BDF_Property' has been added to + FT_BDF_H to retrieve BDF properties from BDF _and_ PCF font files. + THIS IS STILL EXPERIMENTAL, since it hasn't been properly tested yet. - A Windows FNT specific API has been added, mostly to access font headers. This is used by Wine. - - TrueType tables without an "hmtx" table are now tolerated when - an incremental interface is used. This happens for certain - Type42 fonts passed from Ghostscript to FreeType. + - TrueType tables without an "hmtx" table are now tolerated when an + incremental interface is used. This happens for certain Type42 fonts + passed from Ghostscript to FreeType. - - The PFR font driver is now capable of returning the font family - and style names when they are available (instead of the sole - "FontID"). This is performed by parsing an *undocumented* - portion of the font file! + - The PFR font driver is now capable of returning the font family and + style names when they are available (instead of the sole "FontID"). + This is performed by parsing an *undocumented* portion of the font + file! III. MISCELLANEOUS - - The path stroker in FT_STROKER_H has entered beta stage. It now - works very well, but its interface might change a bit in the - future. More on this in later releases. + - The path stroker in FT_STROKER_H has entered beta stage. It now works + very well, but its interface might change a bit in the future. More + on this in later releases. - - The documentation for FT_Size_Metrics didn't appear properly in - the API reference. + - The documentation for FT_Size_Metrics didn't appear properly in the + API reference. - The file docs/VERSION.DLL has been updated to explain versioning - with FreeType (i.e., comparing release/libtool/so numbers, and - how to use them in autoconf scripts). + with FreeType (i.e., comparing release/libtool/so numbers, and how to + use them in autoconf scripts). - - The installation documentation has been seriously revamped. + - The installation documentation has been seriously revamped. Everything is now in the "docs" directory. -====================================================================== +============================================================================== LATEST CHANGES BETWEEN 2.1.3 and 2.1.2 I. IMPORTANT BUG FIXES - - FT_Vector_Transform had been incorrectly modified in 2.1.2, - resulting in incorrect transformations being applied (for - example, rotations were processed in opposite angles). + - FT_Vector_Transform had been incorrectly modified in 2.1.2, resulting + in incorrect transformations being applied (for example, rotations + were processed in opposite angles). - - The format 8 and 12 TrueType charmap enumeration routines have - been fixed (FT_Get_Next_Char returned invalid values). + - The format 8 and 12 TrueType charmap enumeration routines have been + fixed (FT_Get_Next_Char returned invalid values). - - The PFR font driver returned incorrect advance widths if the - outline and metrics resolution defined in the font file were - different. + - The PFR font driver returned incorrect advance widths if the outline + and metrics resolution defined in the font file were different. - - FT_Glyph_To_Bitmap now returns successfully when called with an + - FT_Glyph_To_Bitmap now returns successfully when called with an FT_BitmapGlyph argument (it previously returned an error). - - A bug in the Type 1 loader that prevented valid font bounding - boxes to be loaded from multiple master fonts. + - A bug in the Type 1 loader that prevented valid font bounding boxes to + be loaded from multiple master fonts. - - The SFNT validation code has been rewritten. FreeType can now - load "broken" fonts that were usable on Windows, but not with - previous versions of the library. + - The SFNT validation code has been rewritten. FreeType can now load + "broken" fonts that were usable on Windows, but not with previous + versions of the library. - The computation of bearings in the BDF driver has been fixed. - - The Postscript hinter crashed when trying to hint certain glyphs - (more precisely, when trying to apply hints to an empty glyph - outline). + - The Postscript hinter crashed when trying to hint certain glyphs (more + precisely, when trying to apply hints to an empty glyph outline). - - The TrueType glyph loader now supports composites in "Apple - format" (they differ slightly from Microsoft/OpenType ones in - the way transformation offsets are computed). + - The TrueType glyph loader now supports composites in "Apple format" + (they differ slightly from Microsoft/OpenType ones in the way + transformation offsets are computed). - - FreeType was very slow at opening certain asian CID/CFF fonts, - due to fixed increment in dynamic array re-allocations. This - has been changed to exponential behaviour to get acceptable - performance. + - FreeType was very slow at opening certain asian CID/CFF fonts, due + to fixed increment in dynamic array re-allocations. This has been + changed to exponential behaviour to get acceptable performance. II. IMPORTANT CHANGES - - The PCF driver now supports gzip-compressed font files natively. - This means that you will be able to use all these bitmap fonts - that come with XFree86 with FreeType (and libXft/libXft2, by - extension). + - The PCF driver now supports gzip-compressed font files natively. This + means that you will be able to use all these bitmap fonts that come + with XFree86 with FreeType (and libXft/libXft2, by extension). - - The automatic and postscript hinters have both been updated. - This results in a relatively important increase of rendering - quality since many nasty defaults have been supressed. Please - visit the web page: + - The automatic and postscript hinters have both been updated. This + results in a relatively important increase of rendering quality since + many nasty defaults have been supressed. Please visit the web page: http://www.freetype.org/hinting/smooth-hinting.html for additional details on this topic. - - The "load_flags" parameter of FT_Load_Glyph is now an FT_Int32 - (instead of just being an FT_Int). This breaks source and - binary compatibility for 16bit systems only, while retaining - both of them for 32 and 64 bit ones. + - The "load_flags" parameter of FT_Load_Glyph is now an FT_Int32 + (instead of just being an FT_Int). This breaks source and binary + compatibility for 16bit systems only, while retaining both of them for + 32 and 64 bit ones. Some new flags have been added consequently: FT_LOAD_NO_AUTOHINT :: Disable the use of the auto-hinter (but not native format hinters). - FT_LOAD_TARGET_NORMAL :: Hint and render for normal - anti-aliased displays. + FT_LOAD_TARGET_NORMAL :: Hint and render for normal anti-aliased + displays. FT_LOAD_TARGET_MONO :: Hint and render for 1-bit displays. - FT_LOAD_TARGET_LCD :: Hint and render for horizontal RGB or - BGR sub-pixel displays (like LCD - screens). THIS IS STILL - EXPERIMENTAL! + FT_LOAD_TARGET_LCD :: Hint and render for horizontal RGB or BGR + sub-pixel displays (like LCD screens). + THIS IS STILL EXPERIMENTAL! - FT_LOAD_TARGET_LCD_V :: Same as FT_LOAD_TARGET_LCD, for - vertical sub-pixel displays (like - rotated LCD screens). THIS IS STILL - EXPERIMENTAL! + FT_LOAD_TARGET_LCD_V :: Same as FT_LOAD_TARGET_LCD, for vertical + sub-pixel displays (like rotated LCD + screens). THIS IS STILL EXPERIMENTAL! - FT_LOAD_MONOCHROME is still supported, but only affects - rendering, not the hinting. + FT_LOAD_MONOCHROME is still supported, but only affects rendering, not + the hinting. - Note that the `ftview' demo program available in the `ft2demos' - package has been updated to support LCD-optimized display on - non-paletted displays (under Win32 and X11). + Note that the 'ftview' demo program available in the 'ft2demos' package + has been updated to support LCD-optimized display on non-paletted + displays (under Win32 and X11). - - The PFR driver now supports embedded bitmaps (all formats - supported), and returns correct kerning metrics for all glyphs. + - The PFR driver now supports embedded bitmaps (all formats supported), + and returns correct kerning metrics for all glyphs. - - The TrueType charmap loader now supports certain `broken' fonts - that load under Windows without problems. + - The TrueType charmap loader now supports certain "broken" fonts that + load under Windows without problems. - The cache API has been slightly modified (it's still a beta!): - - The type FTC_ImageDesc has been removed; it is now replaced - by FTC_ImageTypeRec. Note that one of its fields is a - `load_flag' parameter for FT_Load_Glyph. + - The type FTC_ImageDesc has been removed; it is now replaced by + FTC_ImageTypeRec. Note that one of its fields is a `load_flag' + parameter for FT_Load_Glyph. - - The field "num_grays" of FT_SBitRec has been changed to - "max_grays" in order to fit within a single byte. Its - maximum value is thus 255 (instead of 256 as previously). + - The field "num_grays" of FT_SBitRec has been changed to "max_grays" + in order to fit within a single byte. Its maximum value is thus 255 + (instead of 256 as previously). III. MISCELLANEOUS - - Added support for the DESTDIR variable during "make install". - This simplifies packaging of FreeType. + - Added support for the DESTDIR variable during "make install". This + simplifies packaging of FreeType. - - Included modified copies of the ZLib sources in `src/gzip' in - order to support gzip-compressed PCF fonts. We do not use the - system-provided zlib for now, though this is a probable - enhancement for future releases. + - Included modified copies of the ZLib sources in 'src/gzip' in order to + support gzip-compressed PCF fonts. We do not use the system-provided + zlib for now, though this is a probable enhancement for future + releases. - - The DocMaker tool used to generate the on-line API reference has - been completely rewritten. It is now located in + - The DocMaker tool used to generate the on-line API reference has been + completely rewritten. It is now located in "src/tools/docmaker/docmaker.py". Features: - better cross-referenced output - more polished output - - uses Python regular expressions (though it didn't speed the + - uses Python regular expressions (though it didn't speed the program) - - much more modular structure, which allows for different - "backends" in order to generate HTML, XML, or whatever - format. + - much more modular structure, which allows for different "backends" + in order to generate HTML, XML, or whatever format. One can regenerate the API reference by calling: @@ -535,92 +323,86 @@ LATEST CHANGES BETWEEN 2.1.3 and 2.1.2 include/freetype/cache/*.h - A new, experimental, support for incremental font loading (i.e., - loading of fonts where the glyphs are not in the font file - itself, but provided by an external component, like a Postscript - interpreter) has been added by Graham Asher. This is still work - in progress, however. + loading of fonts where the glyphs are not in the font file itself, but + provided by an external component, like a Postscript interpreter) has + been added by Graham Asher. This is still work in progress, however. - - A new, EXPERIMENTAL, path stroker has been added. It doesn't - suffer from severe rounding errors and treat bezier arcs - directly. Still work in progress (i.e. not part of the official - API). See the file for some of the - details. + - A new, EXPERIMENTAL, path stroker has been added. It doesn't suffer + from severe rounding errors and treat bezier arcs directly. Still + work in progress (i.e. not part of the official API). See the file + for some of the details. - - The massive re-formatting of sources and internal re-design is - still under-way. Many internal functions, constants, and types - have been renamed. + - The massive re-formatting of sources and internal re-design is still + under-way. Many internal functions, constants, and types have been + renamed. -====================================================================== +======================================================================== LATEST CHANGES BETWEEN 2.1.2 and 2.1.1 I. IMPORTANT BUG FIXES - - Many font drivers didn't select a Unicode charmap by default - when a new face was opened (with the FT_CONFIG_OPTION_USE_CMAPS - options enabled), causing many applications to not be able to - display text correctly with the 2.1.x releases. + - Many font drivers didn't select a Unicode charmap by default when + a new face was opened (with the FT_CONFIG_OPTION_USE_CMAPS options + enabled), causing many applications to not be able to display text + correctly with the 2.1.x releases. - - The PFR driver had a bug in its composite loading code that - produces incorrectly placed accents with many fonts. + - The PFR driver had a bug in its composite loading code that produces + incorrectly placed accents with many fonts. - The Type42 driver crashed sometimes due to a nasty bug. - - The Type 1 custom encoding charmap didn't handle the case where - the first glyph index wasn't 0. + - The Type 1 custom encoding charmap didn't handle the case where the + first glyph index wasn't 0. - - A serious typo in the TrueType composite loader produced - incorrectly placed glyphs in fonts like "Wingdings" and a few - others. + - A serious typo in the TrueType composite loader produced incorrectly + placed glyphs in fonts like "Wingdings" and a few others. II. MISCELLANEOUS - - The Win32 Visual C++ project file has been updated to include - the PFR driver as well. + - The Win32 Visual C++ project file has been updated to include the + PFR driver as well. - - "freetype.m4" is now installed by default by "make install" on - Unix systems. + - "freetype.m4" is now installed by default by "make install" on Unix + systems. - - The function FT_Get_PS_Font_Info now works with CID and Type42 - fonts as well. + - The function FT_Get_PS_Font_Info now works with CID and Type42 fonts + as well. -====================================================================== +======================================================================== LATEST CHANGES BETWEEN 2.1.1 and 2.1.0 I. IMPORTANT BUG FIXES - - The `version_info' returned by `freetype-config' in 2.1.0 - returned an invalid value. It now returns 9:1:3 (2.0.9 returned - 9:0:3). + - The `version_info' returned by `freetype-config' in 2.1.0 returned an + invalid value. It now returns 9:1:3 (2.0.9 returned 9:0:3). - - Version 2.1.0 couldn't be linked against applications on Win32 - and Amiga systems due to a new debug function that wasn't - properly propagated to the system-specific directory in - `builds'. + - Version 2.1.0 couldn't be linked against applications on Win32 and + Amiga systems due to a new debug function that wasn't properly + propagated to the system-specific directory in `builds'. - Various MacOS and Mac OS X specific fixes. - - Fixed a bug in the TrueType charmap validation routines that - made version 2.1.0 too restrictive -- many popular fonts have - been rejected. + - Fixed a bug in the TrueType charmap validation routines that made + version 2.1.0 too restrictive -- many popular fonts have been + rejected. - - There was still a very small difference between the monochrome - glyph bitmaps produced by FreeType 1.x and FreeType 2.x with the - bytecode interpreter enabled. This was caused by an invalid - flag setting in the TrueType glyph loader, making the rasterizer - change its drop-out control mode. Now theresults should - _really_ be completely identical. + - There was still a very small difference between the monochrome glyph + bitmaps produced by FreeType 1.x and FreeType 2.x with the bytecode + interpreter enabled. This was caused by an invalid flag setting in + the TrueType glyph loader, making the rasterizer change its drop-out + control mode. Now theresults should _really_ be completely identical. - The TrueType name table loader has been improved to support many - popular though buggy Asian fonts. It now ignores empty name - entries, invalid pointer offsets and a few other incorrect - subtleties. Moreover, name strings are now loaded on demand, - which reduces the memory load of many faces (e.g. the ARIAL.TTF - font file contains a 10kByte name table with 70 names). + popular though buggy Asian fonts. It now ignores empty name entries, + invalid pointer offsets and a few other incorrect subtleties. + Moreover, name strings are now loaded on demand, which reduces the + memory load of many faces (e.g. the ARIAL.TTF font file contains a + 10kByte name table with 70 names). - Fixed a bug in the Postscript hinter that prevented family blues substitution to happen correctly. @@ -630,119 +412,116 @@ LATEST CHANGES BETWEEN 2.1.1 and 2.1.0 - Three new font drivers in this release: - * A BDF font driver, contributed by Franco Zappa Nardelli, - heavily modified by Werner Lemberg. It also supports - anti-aliased bitmaps (using a slightly extended BDF format). + * A BDF font driver, contributed by Franco Zappa Nardelli, heavily + modified by Werner Lemberg. It also supports anti-aliased bitmaps + (using a slightly extended BDF format). - * A Type42 font driver, contributed by Roberto Alameda. It is + * A Type42 font driver, contributed by Roberto Alameda. It is still experimental but seems to work relatively well. - * A PFR font driver, contributed by David Turner himself. It - doesn't support PFR hinting -- note that BitStream has at - least two patents on this format! + * A PFR font driver, contributed by David Turner himself. It doesn't + support PFR hinting -- note that BitStream has at least two patents + on this format! III. MISCELLANEOUS - - The cache sub-system has been optimized in important ways. - Cache hits are now significantly faster. For example, using the - CMap cache is about twice faster than calling FT_Get_Char_Index - on most platforms. Similarly, using an SBit cache is about five - times faster than loading the bitmaps from a bitmap file, and - 300 to 500 times faster than generating them from a scalable - format. + - The cache sub-system has been optimized in important ways. Cache hits + are now significantly faster. For example, using the CMap cache is + about twice faster than calling FT_Get_Char_Index on most platforms. + Similarly, using an SBit cache is about five times faster than loading + the bitmaps from a bitmap file, and 300 to 500 times faster than + generating them from a scalable format. - Note that you should recompile your sources if you designed a - custom cache class for the FT2 Cache subsystem, since the - changes performed are source, but not binary, compatible. + Note that you should recompile your sources if you designed a custom + cache class for the FT2 Cache subsystem, since the changes performed + are source, but not binary, compatible. -====================================================================== +======================================================================== LATEST CHANGES BETWEEN 2.1.0 and 2.0.9 I. IMPORTANT BUG FIXES - - The TrueType bytecode interpreter has been fixed to produce + - The TrueType bytecode interpreter has been fixed to produce _exactly_ the same output as FreeType 1.x. Previous differences - were due to slightly distinct fixed-point computation routines + were due to slightly distinct fixed-point computation routines used to perform dot products and vector length measurements. - It seems that native TrueType hinting is _extremely_ sensitive - to rounding errors. The required vector computation routines - have been optimized and placed within the "ttinterp.c" file. + It seems that native TrueType hinting is _extremely_ sensitive + to rounding errors. The required vector computation routines have + been optimized and placed within the "ttinterp.c" file. - Fixed the parsing of accelerator tables in the PCF font driver. - - Fixed the Type1 glyph loader routine used to compute the font's + - Fixed the Type1 glyph loader routine used to compute the font's maximum advance width. - II. NEW FEATURES - The `configure' script used on Unix systems has been modified to - check that GNU Make is being used to build the library. - Otherwise, it will display a message proposing to use the - GNUMAKE environment variable to name it. + check that GNU Make is being used to build the library. Otherwise, + it will display a message proposing to use the GNUMAKE environment + variable to name it. The Unix-specific file README.UNX has been modified accordingly. III. MISCELLANEOUS - - The FreeType License in `docs/FTL.txt' has been updated to - include a proposed preferred disclaimer. If you are using - FreeType in your products, you are encouraged (but not mandated) - to use the following text in your documentation: + - The FreeType License in `docs/FTL.txt' has been updated to include + a proposed preferred disclaimer. If you are using FreeType in your + products, you are encouraged (but not mandated) to use the following + text in your documentation: """ - Portions of this software are copyright © 1996-2002 The - FreeType Project (www.freetype.org). All rights reserved. + Portions of this software are copyright © 1996-2002 The FreeType + Project (www.freetype.org). All rights reserved. """ - The default size of the render pool has been reduced to 16kByte. - This shouldn't result in any noticeable performance penalty, - unless you are using the engine as-is to render very large and - complex glyphs. + This shouldn't result in any noticeable performance penalty, unless + you are using the engine as-is to render very large and complex + glyphs. - - The FreeType 2 redesign has begun. More information can be - found at this URL: + - The FreeType 2 redesign has begun. More information can be found + at this URL: http://www.freetype.org/freetype2/redesign.html - The following internal changes have been performed within the - sources of this release: + The following internal changes have been performed within the sources + of this release: - - Many internal types have been renamed to increase - consistency. The following should be true, except for - public types: + - Many internal types have been renamed to increase consistency. + The following should be true, except for public types: - * All structure types have a name ending in "Rec" (short - for `record'). + * All structure types have a name ending in "Rec" (short for + `record'). - * A pointer-to-structure type has the same name as the + * A pointer-to-structure type has the same name as the structure, _without_ the "Rec" suffix. - Example: + Example: - typedef struct FooRec_ - { - ... + typedef struct FooRec_ + { + ... - } FooRec, *Foo; + } FooRec, *Foo; - - Many internal macros have been renamed to increase - consistency. The following should be true: + - Many internal macros have been renamed to increase consistency. + The following should be true: - * All macros have a name beginning with "FT_". This - required a few changes like + * All macros have a name beginning with "FT_". This required + a few changes like ALLOC => FT_ALLOC FREE => FT_FREE REALLOC => FT_REALLOC - * All macros are completely UPPERCASE. This required a - few changes like: + * All macros are completely UPPERCASE. This required a few + changes like: READ_Short => FT_READ_SHORT NEXT_Short => FT_NEXT_SHORT @@ -751,7 +530,7 @@ LATEST CHANGES BETWEEN 2.1.0 and 2.0.9 MEM_Copy => FT_MEM_COPY etc. - * Whenever possible, all macro names follow the + * Whenever possible, all macro names follow the FT__ pattern. For example ACCESS_Frame => FT_FRAME_ENTER @@ -765,7 +544,7 @@ LATEST CHANGES BETWEEN 2.1.0 and 2.0.9 FILE_ReadAt => FT_STREAM_READ_AT READ_Fields => FT_STREAM_READ_FIELDS - - Many internal functions have been renamed to follow the + - Many internal functions have been renamed to follow the FT__ pattern. For example: FT_Seek_Stream => FT_Stream_Seek @@ -777,299 +556,288 @@ LATEST CHANGES BETWEEN 2.1.0 and 2.0.9 Note that method names do not contain "_". - - The FT_ALLOC_ARRAY and FT_REALLOC_ARRAY have been replaced - with FT_NEW_ARRAY and FT_RENEW_ARRAY which do not take a - type as the fourth argument. Instead, the array element - type size is computed automatically from the type of the - target pointer used. + - The FT_ALLOC_ARRAY and FT_REALLOC_ARRAY have been replaced + with FT_NEW_ARRAY and FT_RENEW_ARRAY which do not take a type + as the fourth argument. Instead, the array element type size + is computed automatically from the type of the target pointer + used. - - A new object class, FT_CMap, has been introduced. These - internal objects are used to model character maps. This - eases the support of additional charmap types within the - engine. + - A new object class, FT_CMap, has been introduced. These + internal objects are used to model character maps. This eases + the support of additional charmap types within the engine. - - A new configuration file named "ftstdlib.h" has been added - to `include/freetype/config'. It is used to define aliases - for _every_ routine of the ISO C library that the font - engine uses. Each aliases has a "ft_" prefix - (e.g. "ft_strlen" is an alias for "strlen"). + - A new configuration file named "ftstdlib.h" has been added + to `include/freetype/config'. It is used to define aliases + for _every_ routine of the ISO C library that the font engine + uses. Each aliases has a "ft_" prefix (e.g. "ft_strlen" is an + alias for "strlen"). - This is used to ease the porting of FreeType 2 to exotic - runtime environments where the ISO C Library isn't available - (e.g. XFree86 extension modules). + This is used to ease the porting of FreeType 2 to exotic runtime + environments where the ISO C Library isn't available (e.g. + XFree86 extension modules). More details are available in the "ChangeLog" file. -====================================================================== +============================================================================ LATEST CHANGES BETWEEN 2.0.9 and 2.0.8 I. IMPORTANT BUG FIXES - Certain fonts like "foxjump.ttf" contain broken name tables with - invalid entries and wild offsets. This caused FreeType to crash - when trying to load them. + invalid entries and wild offsets. This caused FreeType to crash when + trying to load them. - The SFNT `name' table loader has been fixed to be able to - support these strange fonts. + The SFNT `name' table loader has been fixed to be able to support + these strange fonts. - Moreover, the code in charge of processing this table has been - changed to always favour Windows-formatted entries over other - ones. Hence, a font that works on Windows but not on the Mac - will load cleanly in FreeType and report accurate values for - Family & PostScript names. + Moreover, the code in charge of processing this table has been changed + to always favour Windows-formatted entries over other ones. Hence, a + font that works on Windows but not on the Mac will load cleanly in + FreeType and report accurate values for Family & PostScript names. - The CID font driver has been fixed. It unfortunately returned a - Postscript Font name with a leading slash, as in + Postscript Font name with a leading slash, as in "/MunhwaGothic-Regular". - - FreeType 2 should now compile fine on AIX 4.3.3 as a shared - library. + - FreeType 2 should now compile fine on AIX 4.3.3 as a shared library. - - A bug in the Postscript hinter has been found and fixed, - removing un-even stem widths at small pixel sizes (like 14-17). + - A bug in the Postscript hinter has been found and fixed, removing + un-even stem widths at small pixel sizes (like 14-17). - This improves the quality of a certain number of Postscript - fonts. + This improves the quality of a certain number of Postscript fonts. II. NEW FEATURES - - A new function named `FT_Library_Version' has been added to - return the current library's major, minor, and patch version - numbers. This is important since the macros FREETYPE_MAJOR, - FREETYPE_MINOR, and FREETYPE_PATCH cannot be used when the - library is dynamically linked by a program. + - A new function named `FT_Library_Version' has been added to return + the current library's major, minor, and patch version numbers. This + is important since the macros FREETYPE_MAJOR, FREETYPE_MINOR, and + FREETYPE_PATCH cannot be used when the library is dynamically linked + by a program. - - Two new APIs have been added: `FT_Get_First_Char' and + - Two new APIs have been added: `FT_Get_First_Char' and `FT_Get_Next_Char'. - Together, these can be used to iterate efficiently over the - currently selected charmap of a given face. Read the API - reference for more details. + Together, these can be used to iterate efficiently over the currently + selected charmap of a given face. Read the API reference for more + details. III. MISCELLANEOUS - - The FreeType sources are under heavy internal re-factoring. As - a consequence, we have created a branch named "STABLE" on the - CVS to hold all future releases/fixes in the 2.0.x family. + - The FreeType sources are under heavy internal re-factoring. As a + consequence, we have created a branch named "STABLE" on the CVS to + hold all future releases/fixes in the 2.0.x family. - The HEAD branch now contains the re-factored sources and - shouldn't be used for testing or packaging new releases. In - case you would like to access the 2.0.9 sources from our CVS - repository, use the tag `VER-2-0-9'. + The HEAD branch now contains the re-factored sources and shouldn't be + used for testing or packaging new releases. In case you would like + to access the 2.0.9 sources from our CVS repository, use the tag + `VER-2-0-9'. -====================================================================== +============================================================================ LATEST CHANGES BETWEEN 2.0.8 and 2.0.7 I. IMPORTANT BUG FIXES - - There was a small but nasty bug in "freetype-config.in" which + - There was a small but nasty bug in "freetype-config.in" which caused the "freetype-config" script to fail on Unix. - This didn't prevent the installation of the library or even its - execution, but caused problems when trying to compile many Unix - packages that depend on it. + This didn't prevent the installation of the library or even + its execution, but caused problems when trying to compile many + Unix packages that depend on it. - - Some TrueType or OpenType fonts embedded in PDF documents do not - have a 'cmap', 'post' and 'name' as is required by the + - Some TrueType or OpenType fonts embedded in PDF documents do + not have a 'cmap', 'post' and 'name' as is required by the specification. FreeType no longer refuses to load such fonts. - - Various fixes to the PCF font driver. + - various fixes to the PCF font driver -====================================================================== +============================================================================ LATEST CHANGES BETWEEN 2.0.7 and 2.0.6 I. IMPORTANT BUG FIXES - - Fixed two bugs in the Type 1 font driver. The first one - resulted in a memory leak in subtle cases. The other one caused - FreeType to crash when trying to load ".gsf" files (Ghostscript - so-called Postscript fonts). + - Fixed two bugs in the Type 1 font driver. The first one resulted in a + memory leak in subtle cases. The other one caused FreeType to crash + when trying to load ".gsf" files (Ghostscript so-called Postscript + fonts). - (This made _many_ KDE applications crash on certain systems. - FreeType _is_ becoming a critical system component on Linux :-) + (This made _many_ KDE applications crash on certain systems. FreeType + _is_ becoming a critical system component on Linux :-) - Fixed a memory leak in the CFF font driver. - Fixed a memory leak in the PCF font driver. - - Fixed the Visual C++ project file - "builds/win32/visualc/freetype.dsp" since it didn't include the - Postscript hinter component, causing errors at build time. + - Fixed the Visual C++ project file "builds/win32/visualc/freetype.dsp" + since it didn't include the Postscript hinter component, causing + errors at build time. - - Fixed a small rendering bug in the anti-aliased renderer that - only occurred when trying to draw thin (less than 1 pixel) - strokes. + - Fixed a small rendering bug in the anti-aliased renderer that only + occurred when trying to draw thin (less than 1 pixel) strokes. - - Fixed "builds/unix/freetype2.a4" which is used to generate a - valid "freetype2.m4" for use with autoconf. + - Fixed "builds/unix/freetype2.a4" which is used to generate a valid + "freetype2.m4" for use with autoconf. - Fixed the OpenVMS Makefiles. II. MISCELLANEOUS - - Added "configure" and "install" scripts to the top-level - directory. A GNU-style installation is thus now easily possible - with + - Added "configure" and "install" scripts to the top-level directory. + A GNU-style installation is thus now easily possible with - ./configure - make - make install + ./configure + make + make install -====================================================================== +============================================================================ LATEST CHANGES BETWEEN 2.0.6 and 2.0.5 I. IMPORTANT BUG FIXES - - It wasn't possible to load embedded bitmaps when the auto-hinter - was used. This is now fixed. + - It wasn't possible to load embedded bitmaps when the auto-hinter was + used. This is now fixed. - - The TrueType font driver didn't load some composites properly - (the sub-glyphs were slightly shifted, and this was only - noticeable when using monochrome rendering). + - The TrueType font driver didn't load some composites properly (the + sub-glyphs were slightly shifted, and this was only noticeable when + using monochrome rendering). - - Various fixes to the auto-hinter. They merely improve the - output of sans-serif fonts. Note that there are still problems - with serifed fonts and composites (accented characters). + - Various fixes to the auto-hinter. They merely improve the output of + sans-serif fonts. Note that there are still problems with serifed + fonts and composites (accented characters). - - All scalable font drivers erroneously returned un-fitted glyph - advances when hinting was requested. This created problems for - a number of layout applications. This is a very old bug that - got undetected mainly because most test/demo program perform - rounding explicitly or implicitly (through the cache). + - All scalable font drivers erroneously returned un-fitted glyph + advances when hinting was requested. This created problems for a + number of layout applications. This is a very old bug that got + undetected mainly because most test/demo program perform rounding + explicitly or implicitly (through the cache). - - FT_Glyph_To_Bitmap() did erroneously modify the source glyph in + - FT_Glyph_To_Bitmap() did erroneously modify the source glyph in certain cases. - - "glnames.py" still contained a bug that made FreeType return - invalid names for certain glyphs. + - "glnames.py" still contained a bug that made FreeType return invalid + names for certain glyphs. - - The library crashed when loading certain Type 1 fonts like - "sadn.pfb" ("Stalingrad Normal"), which appear to contain - pathetic font info dictionaries. + - The library crashed when loading certain Type 1 fonts like "sadn.pfb" + ("Stalingrad Normal"), which appear to contain pathetic font info + dictionaries. - - The TrueType glyph loader is now much more paranoid and checks - everything when loading a given glyph image. This was necessary - to avoid problems (crashes and/or memory overwrites) with broken - fonts that came from a really buggy automatic font converter. + - The TrueType glyph loader is now much more paranoid and checks everything + when loading a given glyph image. This was necessary to avoid + problems (crashes and/or memory overwrites) with broken fonts that + came from a really buggy automatic font converter. II. IMPORTANT UPDATES AND NEW FEATURES - Important updates to the Mac-specific parts of the library. - - The caching sub-system has been completely re-designed, and its - API has evolved (the old one is still supported for backwards + - The caching sub-system has been completely re-designed, and its API + has evolved (the old one is still supported for backwards compatibility). - The documentation for it is not yet completed, sorry. For now, - you are encouraged to continue using the old API. However, the - ftview demo program in the ft2demos package has already been - updated to use the new caching functions. + The documentation for it is not yet completed, sorry. For now, you + are encouraged to continue using the old API. However, the ftview + demo program in the ft2demos package has already been updated to use + the new caching functions. - - A new charmap cache is provided too. See FTC_CMapCache(). This - is useful to perform character code -> glyph index translations - quickly, without the need for an opened FT_Face. + - A new charmap cache is provided too. See FTC_CMapCache(). This is + useful to perform character code -> glyph index translations quickly, + without the need for an opened FT_Face. - - A NEW POSTSCRIPT HINTER module has been added to support native - hints in the following formats: PostScript Type 1, PostScript - CID, and CFF/CEF. + - A NEW POSTSCRIPT HINTER module has been added to support native hints + in the following formats: PostScript Type 1, PostScript CID, and + CFF/CEF. - Please test! Note that the auto-hinter produces better results - for a number of badly-hinted fonts (mostly auto-generated ones) - though. + Please test! Note that the auto-hinter produces better results for a + number of badly-hinted fonts (mostly auto-generated ones) though. - - A memory debugger is now part of the standard FreeType sources. - To enable it, define FT_DEBUG_MEMORY in - , and recompile the library. + - A memory debugger is now part of the standard FreeType sources. To + enable it, define FT_DEBUG_MEMORY in , and + recompile the library. - Additionally, define the _environment_ variable FT_DEBUG_MEMORY - and run any program using FreeType. When the library is exited, - a summary of memory footprints and possible leaks will be - displayed. + Additionally, define the _environment_ variable FT_DEBUG_MEMORY and + run any program using FreeType. When the library is exited, a summary + of memory footprints and possible leaks will be displayed. - This works transparently with _any_ program that uses FreeType. - However, you will need a lot of memory to use this (allocated - blocks are never released to the heap to detect double deletes - easily). + This works transparently with _any_ program that uses FreeType. + However, you will need a lot of memory to use this (allocated blocks + are never released to the heap to detect double deletes easily). III. MISCELLANEOUS - - We are aware of subtle differences between the output of - FreeType versions 1 and 2 when it comes to monochrome - TrueType-hinted glyphs. These are most probably due to small - differences in the monochrome rasterizers and will be worked out - in an upcoming release. + - We are aware of subtle differences between the output of FreeType + versions 1 and 2 when it comes to monochrome TrueType-hinted glyphs. + These are most probably due to small differences in the monochrome + rasterizers and will be worked out in an upcoming release. - We have decided to fork the sources in a "stable" branch, and an - "unstable" one, since FreeType is becoming a critical component - of many Unix systems. + "unstable" one, since FreeType is becoming a critical component of + many Unix systems. - The next bug-fix releases of the library will be named 2.0.7, - 2.0.8, etc., while the "2.1" branch will contain a version of - the sources where we will start major reworking of the library's - internals, in order to produce FreeType 2.2.0 (or even 3.0) in a - more distant future. + The next bug-fix releases of the library will be named 2.0.7, 2.0.8, + etc., while the "2.1" branch will contain a version of the sources + where we will start major reworking of the library's internals, in + order to produce FreeType 2.2.0 (or even 3.0) in a more distant + future. - We also hope that this scheme will allow much more frequent - releases than in the past. + We also hope that this scheme will allow much more frequent releases + than in the past. -====================================================================== +============================================================================ LATEST CHANGES BETWEEN 2.0.5 and 2.0.4 - NOTE THAT 2.0.5 DOES NOT CONTAIN THE POSTSCRIPT HINTER. THIS MODULE - WILL BE PART OF THE NEXT RELEASE (EITHER 2.0.6 or 2.1) + NOTE THAT 2.0.5 DOES NOT CONTAIN THE POSTSCRIPT HINTER. THIS MODULE WILL + BE PART OF THE NEXT RELEASE (EITHER 2.0.6 or 2.1) - - Fixed a bug that made certain glyphs, like "Cacute", "cacute" and - "lslash" unavailable from Unicode charmaps of Postscript fonts. - This prevented the correct display of Polish text, for example. + - Fixed a bug that made certain glyphs, like "Cacute", "cacute" and + "lslash" unavailable from Unicode charmaps of Postscript fonts. This + prevented the correct display of Polish text, for example. - - The kerning table of Type 1 fonts was loaded by FreeType, when its - AFM file was attached to its face, but the - FT_FACE_FLAG_HAS_KERNING bit flags was not set correctly, - preventing FT_Get_Kerning to return meaningful values. + - The kerning table of Type 1 fonts was loaded by FreeType, when its AFM + file was attached to its face, but the FT_FACE_FLAG_HAS_KERNING bit + flags was not set correctly, preventing FT_Get_Kerning to return + meaningful values. - - Improved SFNT (TrueType & OpenType) charmap support. Slightly - better performance, as well as support for the new formats defined - by the OpenType 1.3 specification (8, 10, and 12) + - Improved SFNT (TrueType & OpenType) charmap support. Slightly better + performance, as well as support for the new formats defined by the + OpenType 1.3 specification (8, 10, and 12) - - Fixed a serious typo in "src/base/ftcalc.c" which caused invalid + - Fixed a serious typo in "src/base/ftcalc.c" which caused invalid computations in certain rare cases, producing ugly artefacts. - - The size of the EM square is computed with a more accurate - algorithm for Postscript fonts. The old one caused slight errors - with embedded fonts found in PDF documents. + - The size of the EM square is computed with a more accurate algorithm + for Postscript fonts. The old one caused slight errors with embedded + fonts found in PDF documents. - - Fixed a bug in the cache manager that prevented normal LRU - behaviour within the cache manager, causing unnecessary reloads - (for FT_Face and FT_Size objects only). + - Fixed a bug in the cache manager that prevented normal LRU behaviour + within the cache manager, causing unnecessary reloads (for FT_Face and + FT_Size objects only). - - Added a new function named "FT_Get_Name_Index" to retrieve the - glyph index of a given glyph name, when found in a face. + - Added a new function named "FT_Get_Name_Index" to retrieve the glyph + index of a given glyph name, when found in a face. - - Added a new function named "FT_Get_Postscript_Name" to retrieve - the "unique" Postscript font name of a given face. + - Added a new function named "FT_Get_Postscript_Name" to retrieve the + "unique" Postscript font name of a given face. - - Added a new public header size named FT_SIZES_H (or - ) providing new FT_Size-management functions: + - Added a new public header size named FT_SIZES_H (or + ) providing new FT_Size-management functions: FT_New_Size, FT_Activate_Size, FT_Done_Size. - - Fixed a reallocation bug that generated a dangling pointer (and - possibly memory leaks) with Postscript fonts (in - src/psaux/psobjs.c). + - Fixed a reallocation bug that generated a dangling pointer (and possibly + memory leaks) with Postscript fonts (in src/psaux/psobjs.c). - Many fixes for 16-bit correctness. @@ -1077,156 +845,149 @@ LATEST CHANGES BETWEEN 2.0.5 and 2.0.4 - Added an Amiga build directory in "builds/amiga". - -====================================================================== +============================================================================ LATEST CHANGES BETWEEN 2.0.4 and 2.0.3 - - Fixed a rather annoying bug that was introduced in 2.0.3. Namely, - the font transformation set through FT_Set_Transform was applied - twice to auto-hinted glyphs, resulting in incorrectly rotated text - output. + - Fixed a rather annoying bug that was introduced in 2.0.3. Namely, the + font transformation set through FT_Set_Transform was applied twice to + auto-hinted glyphs, resulting in incorrectly rotated text output. - - Fixed _many_ compiler warnings. FT2 should now compile cleanly - with Visual C++'s most pedantic warning level (/W4). It already - compiled fine with GCC and a few other compilers. + - Fixed _many_ compiler warnings. FT2 should now compile cleanly with + Visual C++'s most pedantic warning level (/W4). It already compiled + fine with GCC and a few other compilers. - - Fixed a bug that prevented the linear advance width of composite + - Fixed a bug that prevented the linear advance width of composite TrueType glyphs to be correctly returned. - - Fixed the Visual C++ project files located in - "builds/win32/visualc" (previous versions used older names of the - library). + - Fixed the Visual C++ project files located in "builds/win32/visualc" + (previous versions used older names of the library). - - Many 32-bit constants have an "L" appended to their value, in - order to improve the 16-bitness of the code. Someone is actually - trying to use FT2 on an Atari ST machine! + - Many 32-bit constants have an "L" appended to their value, in order + to improve the 16-bitness of the code. Someone is actually trying to + use FT2 on an Atari ST machine! - - Updated the "builds/detect.mk" file in order to automatically - build FT2 on AIX systems. AIX uses "/usr/sbin/init" instead of - "/sbin/init" and wasn't previously detected as a Unix platform by - the FreeType build system. + - Updated the "builds/detect.mk" file in order to automatically build + FT2 on AIX systems. AIX uses "/usr/sbin/init" instead of "/sbin/init" + and wasn't previously detected as a Unix platform by the FreeType build + system. - - Updated the Unix-specific portions of the build system (new - libtool version, etc.). + - Updated the Unix-specific portions of the build system (new libtool + version, etc.). - - The SFNT kerning lodaer now ensures that the table is sorted - (since some problem fonts do not meet this requirement). + - The SFNT kerning lodaer now ensures that the table is sorted (since some + problem fonts do not meet this requirement). - -======================================================================= +============================================================================ LATEST CHANGES BETWEEN 2.0.3 and 2.0.2 I. CHANGES TO THE MODULES / FONT DRIVERS - - THE AUTO-HINTER HAS BEEN SLIGHTLY IMPROVED, in order to fix - several annoying artefacts, mainly: + - THE AUTO-HINTER HAS BEEN SLIGHTLY IMPROVED, in order to fix several + annoying artefacts, mainly: - - Blue zone alignement of horizontal stems wasn't performed - correctly, resulting in artefacts like the "d" being placed - one pixel below the "b" in some fonts like Time New Roman. + - Blue zone alignement of horizontal stems wasn't performed + correctly, resulting in artefacts like the "d" being placed one + pixel below the "b" in some fonts like Time New Roman. - - Overshoot thresholding wasn't performed correctly, creating + - Overshoot thresholding wasn't performed correctly, creating unpleasant artefacts at large character pixel sizes. - - Composite glyph loading has been simplified. This gets rid - of various artefacts where the components of a composite - glyphs were not correctly spaced. + - Composite glyph loading has been simplified. This gets rid + of various artefacts where the components of a composite glyphs + were not correctly spaced. - These are the last changes to the current auto-hinting module. - A new hinting sub-system is currently in the work in order to - support native hints in Type 1 / CFF / OpenType fonts, as well - as globally improve rendering. + These are the last changes to the current auto-hinting module. A new + hinting sub-system is currently in the work in order to support native + hints in Type 1 / CFF / OpenType fonts, as well as globally improve + rendering. - - The PCF driver has been fixed. It reported invalid glyph - dimensions for the fonts available on Solaris. + - The PCF driver has been fixed. It reported invalid glyph dimensions + for the fonts available on Solaris. - - The Type 1, CID and CFF drivers have been modified to fix the + - The Type 1, CID and CFF drivers have been modified to fix the computation of the EM size. - - The Type 1 driver has been fixed to avoid a dangerous bug that - crashed the library with non-conforming fonts (i.e. ones that do - not place the .notdef glyph at position 0). + - The Type 1 driver has been fixed to avoid a dangerous bug that + crashed the library with non-conforming fonts (i.e. ones that do not + place the .notdef glyph at position 0). - - The TrueType driver had a rather subtle bug (dangling pointer - when loading composite glyphs) that could crash the library in - rare occasions! + - The TrueType driver had a rather subtle bug (dangling pointer when + loading composite glyphs) that could crash the library in rare + occasions! II. HIGH-LEVEL API CHANGES - - The error code enumeration values have been changed. An error - value is decomposed in a generic error code, and a module - number. see for details. + - The error code enumeration values have been changed. An error value + is decomposed in a generic error code, and a module number. see + for details. - - A new public header file has been introduced, named - FT_TRIGONOMETRY_H (include/freetype/fttrig.h), providing - trigonometric functions to compute sines, cosines, arctangents, - etc. with 16.16 fixed precision. The implementation is based on - the CORDIC algorithm and is very fast while being sufficiently - accurate. + - A new public header file has been introduced, named FT_TRIGONOMETRY_H + (include/freetype/fttrig.h), providing trigonometric functions to + compute sines, cosines, arctangents, etc. with 16.16 fixed precision. + The implementation is based on the CORDIC algorithm and is very fast + while being sufficiently accurate. III. INTERNALS - - Added BeOS-specific files in the old build sub-system. Note - that no changes were required to compile the library with Jam. + - Added BeOS-specific files in the old build sub-system. Note that + no changes were required to compile the library with Jam. - - The configuration is now capable of automatically detecting - 64-bit integers on a set of predefined compilers (GCC, Visual - C++, Borland C++) and will use them by default. This provides a - small performance boost. + - The configuration is now capable of automatically detecting 64-bit + integers on a set of predefined compilers (GCC, Visual C++, Borland + C++) and will use them by default. This provides a small performance + boost. - - A small memory leak that happened when opening 0-sized files - (duh!) have been fixed. + - A small memory leak that happened when opening 0-sized files (duh!) + have been fixed. - - Fixed bezier stack depth bug in the routines provided by the - FT_BBOX_H header file. Also fixed similar bugs in the - rasterizers. + - Fixed bezier stack depth bug in the routines provided by the + FT_BBOX_H header file. Also fixed similar bugs in the rasterizers. - - The outline bounding box code has been rewritten to use direct - computations, instead of bezier sub-division, to compute the - exact bounding box of glyphs. This is slightly slower but more - accurate. + - The outline bounding box code has been rewritten to use direct + computations, instead of bezier sub-division, to compute the exact + bounding box of glyphs. This is slightly slower but more accurate. - - The build system has been improved and fixed, mainly to support - "make" on Windows 2000 correctly, avoid problems with "make - distclean" on non Unix systems, etc. + - The build system has been improved and fixed, mainly to support "make" + on Windows 2000 correctly, avoid problems with "make distclean" on non + Unix systems, etc. - - Hexadecimal constants have been suffixed with "U" to avoid - problems with certain compilers on 64-bit platforms. + - Hexadecimal constants have been suffixed with "U" to avoid problems + with certain compilers on 64-bit platforms. - A new directory named "src/tools" has been created. It contains Python scripts and simple unit test programs used to develop the library. - - The DocMaker tool has been moved from "docs" to "src/tools" and + - The DocMaker tool has been moved from "docs" to "src/tools" and has been updated with the following: - Now accepts the "--title=XXXX" or "-t XXXX" option from the command line to set the project's name in the generated API reference. - - Now accepts the "--output=DIR" or "-o DIR" option from the - command line to set the output directory for all generated - HTML files. + - Now accepts the "--output=DIR" or "-o DIR" option from the + command line to set the output directory for all generated HTML + files. - Now accepts the "--prefix=XXXX" or "-p XXX" option from the - command line to set the file prefix to use for all - generated HTML files. + command line to set the file prefix to use for all generated HTML + files. - - Now generates the current time/data on each generated page + - Now generates the current time/data on each generated page in order to distinguish between versions. - DocMaker can be used with other projects now, not only FT2 - (e.g. MLib, FTLayout, etc.). + DocMaker can be used with other projects now, not only FT2 (e.g. MLib, + FTLayout, etc.). - -====================================================================== +=========================================================================== LATEST CHANGES BETWEEN 2.0.2 and 2.0.1 + I. CHANGES TO THE MODULES / FONT DRIVERS - THE TRUETYPE BYTECODE INTERPRETER IS NOW TURNED OFF, in order to @@ -1667,7 +1428,7 @@ BETA-8 (RELEASE CANDIDATE) CHANGES * Support for transforms and direct rendering in FT_Load_Glyph: Most of the functionality found in has been - moved to the core library. Hence, the following: + moved to the core library. Hence, the following: - A transform can be specified for a face through FT_Set_Transform. this transform is applied by FT_Load_Glyph @@ -1698,7 +1459,7 @@ BETA-8 (RELEASE CANDIDATE) CHANGES OLD CHANGES FOR BETA 7 - - bug-fixed the OpenType/CFF parser. It now loads and displays my + - bug-fixed the OpenType/CFF parser. It now loads and displays my two fonts nicely, but I'm pretty certain that more testing is needed :-) @@ -1706,20 +1467,20 @@ OLD CHANGES FOR BETA 7 correctly (well, the accent is not always well placed, but that's another problem..) - - added the CID-keyed Type 1 driver in "src/cid". Works pretty well + - added the CID-keyed Type 1 driver in "src/cid". Works pretty well for only 13 Kb of code ;-) Doesn't read AFM files though, nor the really useful CMAP files.. - - fixed two bugs in the smooth renderer (src/base/ftgrays.c). - Thanks to Boris Letocha for spotting them and providing a fix. + - fixed two bugs in the smooth renderer (src/base/ftgrays.c). Thanks + to Boris Letocha for spotting them and providing a fix.. - - fixed potential "divide by zero" bugs in ftcalc.c. + - fixed potential "divide by zero" bugs in ftcalc.c.. my god.. - added source code for the OpenType/CFF driver (still incomplete though..) - modified the SFNT driver slightly to perform more robust header - checks in TT_Load_SFNT_Header. This prevents certain font files + checks in TT_Load_SFNT_Header. This prevents certain font files (e.g. some Type 1 Multiple Masters) from being incorrectly "recognized" as TrueType font files.. @@ -1730,8 +1491,8 @@ OLD CHANGES FOR BETA 7 - added a tiny segment cache to the SFNT Charmap 4 decoder, in order to minimally speed it up.. - - added support for Multiple Master fonts in "type1z". There is - also a new file named which defines functions to + - added support for Multiple Master fonts in "type1z". There is also + a new file named which defines functions to manage them from client applications. The new file "src/base/ftmm.c" is also optional to the engine.. @@ -1743,7 +1504,7 @@ OLD CHANGES FOR BETA 7 correctly (used for many oblique fonts..) - some fixes for 64-bit systems (mainly changing some FT_TRACE calls - to use %p instead of %lx). Thanks to Karl Robillard. + to use %p instead of %lx).. Thanks to Karl Robillard - fixed some bugs in the sbit loader (src/base/sfnt/ttsbit.c) + added a new flag, FT_LOAD_CROP_BITMAP to query that bitmaps be @@ -1762,7 +1523,7 @@ OLD CHANGES FOR BETA 7 OLD CHANGES 16 May 2000 - - tagged "BETA-6" in the CVS tree. This one is a serious release + - tagged "BETA-6" in the CVS tree. This one is a serious release candidate even though it doesn't incorporate the auto-hinter yet.. - various obsolete files were removed, and copyright header updated @@ -1792,8 +1553,8 @@ OLD CHANGES 16 May 2000 | | It seems the C pre-processor that comes with LCC is broken, it | doesn't recognize the ANSI standard directives # and ## - | correctly when one of the argument is a macro. Also, - | something like: + | correctly when one of the argument is a macro. Also, something + | like: | | #define F(x) print##x | @@ -1803,12 +1564,12 @@ OLD CHANGES 16 May 2000 | | print "hello") | - | by its pre-processor. For this reason, you simply cannot build + | by its pre-processor. For this reason, you simply cannot build | FreeType 2 in debug mode with this compiler.. - - yet another massive grunt work. I've changed the definition of - the EXPORT_DEF, EXPORT_FUNC, BASE_DEF & BASE_FUNC macros. These - now take an argument, which is the function's return value type. + - yet another massive grunt work. I've changed the definition of the + EXPORT_DEF, EXPORT_FUNC, BASE_DEF & BASE_FUNC macros. These now + take an argument, which is the function's return value type. This is necessary to compile FreeType as a DLL on Windows and OS/2. Depending on the compiler used, a compiler-specific keyword @@ -1816,7 +1577,7 @@ OLD CHANGES 16 May 2000 after (BorlandC++) the type.. Of course, this needed a lot of changes throughout the source code - to make it compile again... All cleaned up now, apparently.. + to make it compile again... All cleaned up now, apparently.. Note also that there is a new EXPORT_VAR macro defined to allow the _declaration_ of an exportable public (constant) @@ -1845,17 +1606,17 @@ OLD CHANGES 16 May 2000 (the implementation was already in "ftobjs.c"). - the file has been seriously updated in order - to allow the automatic generation of error message tables. See - the comments within it for more information. + to allow the automatic generation of error message tables. See the + comments within it for more information. - - major directory hierarchy re-organisation. This was done for two + - major directory hierarchy re-organisation. This was done for two things: * first, to ease the "manual" compilation of the library by requiring at lot less include paths :-) * second, to allow external programs to effectively access - internal data fields. For example, this can be extremely + internal data fields. For example, this can be extremely useful if someone wants to write a font producer or a font manager on top of FreeType. @@ -1868,15 +1629,14 @@ OLD CHANGES 16 May 2000 Some new include sub-directories are available: a. the "freetype/config" directory, contains two files used to - configure the build of the library. Client applications - should not need to look at these normally, but they can if - they want. + configure the build of the library. Client applications should + not need to look at these normally, but they can if they want. #include #include b. the "freetype/internal" directory, contains header files that - describes library internals. These are the header files that + describes library internals. These are the header files that were previously found in the "src/base" and "src/shared" directories. @@ -1959,9 +1719,9 @@ OLD CHANGES - 14-apr-2000 to handle the new XFree86 4.0 fonts (and a few other ones..) - the smooth renderer is now complete and supports sub-banding to - render large glyphs at high speed. However, it is still located - in "demos/src/ftgrays.c" and should move to the library itself in - the next beta. NOTE: The smooth renderer doesn't compile in + render large glyphs at high speed. However, it is still located in + "demos/src/ftgrays.c" and should move to the library itself in the + next beta.. NOTE: The smooth renderer doesn't compile in stand-alone mode anymore, but this should be fixed RSN.. - introduced convenience functions to more easily deal with glyph @@ -1974,14 +1734,14 @@ OLD CHANGES - 14-apr-2000 results). - changed the raster interface, in order to allow client - applications to provide their own span-drawing callbacks. - However, only the smooth renderer supports this. See - "FT_Raster_Params" in the file "include/ftimage.h". + applications to provide their own span-drawing callbacks. However, + only the smooth renderer supports this. See "FT_Raster_Params" in + the file "include/ftimage.h" - fixed a small bug in FT_MulFix that caused incorrect transform computation! - - Note: The tutorial is out-of-date. + - Note: The tutorial is out-of-date, grumpf.. :-( ====================================================================== @@ -2023,7 +1783,7 @@ OLD CHANGES - 12-mar-2000 OLD CHANGES - 22-feb-2000 - - introduced the "psnames" module. It is used to: + - introduced the "psnames" module. It is used to: o convert a Postscript glyph name into the equivalent Unicode character code (used by the Type 1 driver(s) to synthetize on @@ -2035,16 +1795,16 @@ OLD CHANGES - 22-feb-2000 names support routines, while the other two tables are used by the Type 1 driver(s)). - - introduced the "type1z" alternate Type 1 driver. This is a (still + - introduced the "type1z" alternate Type 1 driver. This is a (still experimental) driver for the Type 1 format that will ultimately - replace the one in "src/type1". It uses pattern matching to load - data from the font, instead of a finite state analyzer. It works - much better than the "old" driver with "broken" fonts. It is also + replace the one in "src/type1". It uses pattern matching to load + data from the font, instead of a finite state analyzer. It works + much better than the "old" driver with "broken" fonts. It is also much smaller (under 15 Kb). - the Type 1 drivers (both in "src/type1" and "src/type1z") are nearly complete. They both provide automatic Unicode charmap - synthesis through the "psnames" module. No re-encoding vector is + synthesis through the "psnames" module. No re-encoding vector is needed. (note that they still leak memory due to some code missing, and I'm getting lazy). @@ -2052,7 +1812,7 @@ OLD CHANGES - 22-feb-2000 wasn't exactly tested as it should ;-) - The TrueType glyph loader has been seriously rewritten (see the - file "src/truetype/ttgload.c". It is now much, much simpler as + file "src/truetype/ttgload.c". It is now much, much simpler as well as easier to read, maintain and understand :-) Preliminary versions introduced a memory leak that has been reported by Jack Davis, and is now fixed.. @@ -2103,7 +1863,7 @@ OLDER CHANGES - 27-jan-2000 drivers to co-exist peacefully - updated the "T1_Face" type to better separate Postscript font - content from the rest of the FT_Face structure. Might be used + content from the rest of the FT_Face structure. Might be used later by the CFF/Type2 driver.. - added an experimental replacement Type 1 driver featuring advanced @@ -2155,9 +1915,9 @@ High-Level Interface: field "face->glyph.format" - the list of available charmaps is directly accessible through - "face->charmaps", counting "face->num_charmaps" elements. Each + "face->charmaps", counting "face->num_charmaps" elements. Each charmap has an 'encoding' field which specifies which known - encoding it deals with. Valid values are, for example: + encoding it deals with. Valid values are, for example : ft_encoding_unicode (for ASCII, Latin-1 and Unicode) ft_encoding_apple_roman @@ -2165,7 +1925,7 @@ High-Level Interface: ft_encoding_adobe_standard ft_encoding_adobe_expert - other values may be added in the future. Each charmap still + other values may be added in the future. Each charmap still holds its "platform_id" and "encoding_id" values in case the encoding is too exotic for the current library @@ -2215,12 +1975,12 @@ Glyph Image Formats: should encompass all known bitmap types. Each new image format must provide at least one "raster", i.e. a - module capable of transforming the glyph image into a bitmap. It's + module capable of transforming the glyph image into a bitmap. It's also possible to change the default raster used for a given glyph image format. The default outline scan-converter now uses 128 levels of grays by - default, which tends to smooth many things. Note that the demo + default, which tends to smooth many things. Note that the demo programs have been updated significantly in order to display these.. @@ -2235,7 +1995,7 @@ Build system: it is not detected, with pseudo-standard compilation flags) - the ability to compile from the Makefiles with very different and - exotic compilers. Note that linking the library can be difficult + exotic compilers. Note that linking the library can be difficult for some platforms. For example, the file `config/win32/lcclib.bat' is invoked by the @@ -2246,9 +2006,9 @@ Build system: Here's how it works: - the first time you type `make', the build system runs a series of - sub-makefiles in order to detect your host platform. It then - dumps what it found, and creates a file called `config.mk' in the - current directory. This is a sub-Makefile used to define many + sub-makefiles in order to detect your host platform. It then dumps + what it found, and creates a file called `config.mk' in the + current directory. This is a sub-Makefile used to define many important Make variables used to build the library. - the second time, the build system detects the `config.mk' then use @@ -2262,7 +2022,7 @@ Build system: re-run make. Finally, the default compiler for all platforms is gcc (for now, - this will hopefully changed in the future). You can however specify + this will hopefully changed in the future). You can however specify a different compiler by specifying it after the 'setup' target as in: @@ -2286,7 +2046,7 @@ Portability: In the previous beta, a single FT_System object was used to encompass all low-level operations like thread synchronisation, - memory management and i/o access. This has been greatly simplified: + memory management and i/o access. This has been greatly simplified: - thread synchronisation has been dropped, for the simple reason that the library is already re-entrant, and that if you really @@ -2300,12 +2060,12 @@ Portability: - resources have disappeared (they created more problems than they solved), and i/o management have been simplified greatly as a - result. Streams are defined through FT_Stream objects, which - can be either memory-based or disk-based. + result. Streams are defined through FT_Stream objects, which can + be either memory-based or disk-based. Note that each face has its own stream, which is closed only when the face object is destroyed. Hence, a function like - TT_Flush_Face in 1.x cannot be directly supported. However, if + TT_Flush_Face in 1.x cannot be directly supported. However, if you really need something like this, you can easily tailor your own streams to achieve the same feature at a lower level (and use FT_Open_Face instead of FT_New_Face to create the face). @@ -2326,19 +2086,18 @@ Font Drivers: library at compile time is managed through a new configuration file called `config//ftmodule.h'. - This file is autogenerated when invoking `make modules'. This - target will parse all sub-directories of 'src', looking for a - "module.mk" rules file, used to describe the driver to the build - system. + This file is autogenerated when invoking `make modules'. This target + will parse all sub-directories of 'src', looking for a "module.mk" + rules file, used to describe the driver to the build system. Hence, one should call `make modules' each time a font driver is added or removed from the `src' directory. - Finally, this version provides a "pseudo-driver" in `src/sfnt'. - This driver doesn't support font files directly, but provides - services used by all TrueType-like font drivers. Hence, its code is - shared between the TrueType & OpenType font formats, and possibly - more formats to come if we're lucky.. + Finally, this version provides a "pseudo-driver" in `src/sfnt'. This + driver doesn't support font files directly, but provides services + used by all TrueType-like font drivers. Hence, its code is shared + between the TrueType & OpenType font formats, and possibly more + formats to come if we're lucky.. ---------------------------------------------------------------------- @@ -2352,14 +2111,14 @@ Extensions support: driver. Extension ids are now strings, rather than 4-byte tags, as this is - usually more readable. + usually more readable.. Each extension has: - some data, associated to each face object - an interface (table of function pointers) An extension that is format-specific should simply register itself - to the correct font driver. Here is some example code: + to the correct font driver. Here is some example code: // Registering an extensions // diff --git a/reactos/lib/freetype/docs/CUSTOMIZE b/reactos/lib/freetype/docs/CUSTOMIZE index 8709b3decb6..2961d174e63 100644 --- a/reactos/lib/freetype/docs/CUSTOMIZE +++ b/reactos/lib/freetype/docs/CUSTOMIZE @@ -101,15 +101,15 @@ IV. Overriding default configuration and module headers name the configuration headers. To do so, you need a custom "ft2build.h" whose content can be as simple as: - #ifndef __FT2_BUILD_MY_PLATFORM_H__ - #define __FT2_BUILD_MY_PLATFORM_H__ + #ifndef __FT2_BUILD_GENERIC_H__ + #define __FT2_BUILD_GENERIC_H__ - #define FT_CONFIG_OPTIONS_H - #define FT_CONFIG_MODULES_H + #define FT_CONFIG_OPTIONS_H + #define FT_CONFIG_MACROS_H #include - #endif /* __FT2_BUILD_MY_PLATFORM_H__ */ + #endif /* __FT2_BUILD_GENERIC_H__ */ Place those files in a separate directory, e.g.: diff --git a/reactos/lib/freetype/docs/VERSION.DLL b/reactos/lib/freetype/docs/VERSION.DLL index 5b178bdc4ba..2e1f1af45d6 100644 --- a/reactos/lib/freetype/docs/VERSION.DLL +++ b/reactos/lib/freetype/docs/VERSION.DLL @@ -51,10 +51,7 @@ libtool number, as well as the shared object number found on _most_ systems, but not all of them: release libtool so - ------------------------------- - 2.1.8 9.6.3 6.3.6 - 2.1.7 9.5.3 6.3.5 - 2.1.6 9.5.3 6.3.5 + -------------------------------------------------------------------- 2.1.5 9.4.3 6.3.4 2.1.4 9.3.3 6.3.3 2.1.3 9.2.3 6.3.2 @@ -63,8 +60,6 @@ systems, but not all of them: 2.1.0 8.0.2 ? 2.0.9 9.0.3 ? 2.0.8 8.0.2 ? - 2.0.4 7.0.1 ? - 2.0.1 6.1.0 ? The libtool numbers are a bit inconsistent due to the library's history: @@ -91,19 +86,19 @@ other release numbers. old_CPPFLAGS="$CPPFLAGS" CPPFLAGS=`freetype-config --cflags` AC_TRY_CPP([ - -#include -#include FT_FREETYPE_H +#include #if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2000009 #error Freetype version too low. #endif - ], - [AC_MSG_RESULT(yes) - FREETYPE_LIBS=`freetype-config --libs` - AC_SUBST(FREETYPE_LIBS) - AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library]) - CPPFLAGS="$old_CPPFLAGS"], - [AC_MSG_ERROR([Need FreeType library version 2.0.9 or higher])]) + ],[ + AC_MSG_RESULT(yes) + FREETYPE_LIBS=`freetype-config --libs` + AC_SUBST(FREETYPE_LIBS) + AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library]) + CPPFLAGS="$old_CPPFLAGS" + ],[ + AC_MSG_ERROR([Need FreeType library version 2.0.9 or higher]) + ]) --- end of VERSION.DLL --- diff --git a/reactos/lib/freetype/docs/license.txt b/reactos/lib/freetype/docs/license.txt index 876cc4b93a5..dc011d1d560 100644 --- a/reactos/lib/freetype/docs/license.txt +++ b/reactos/lib/freetype/docs/license.txt @@ -2,27 +2,24 @@ The FreeType 2 font engine is copyrighted work and cannot be used legally without a software license. In order to make this project usable to a vast majority of developers, we distribute it under two -mutually exclusive open-source licenses. +mutually exclusive licenses. -This means that *you* must choose *one* of the two licenses described +This means that *you* must choose *one* license of the two described below, then obey all its terms and conditions when using FreeType 2 in any of your projects or products. - - The FreeType License, found in the file `FTL.TXT', which is similar - to the original BSD license *with* an advertising clause that forces - you to explicitly cite the FreeType project in your product's - documentation. All details are in the license file. This license - is suited to products which don't use the GNU General Public - License. + - The FreeType License, found in the file "FTL.TXT", which is an + BSD-style open-source license *with* an advertising clause that + forces you to explicitely cite the FreeType project in your + product's documentation. All details are in the license file. - - The GNU General Public License version 2, found in `GPL.TXT' (any - later version can be used also), for programs which already use the - GPL. Note that the FTL is incompatible with the GPL due to its - advertisement clause. + - The GNU General Public License, found in "GPL.TXT", which is the + traditionnal and "viral" GPL license that forces you to redistribute + the _complete_ sources of all your products that use FreeType 2. -The contributed PCF driver comes with a license similar to that of the X -Window System. It is compatible to the above two licenses (see file -src/pcf/readme). +Note that the contributed PCF driver comes with a license similar to +that of X Window System which is compatible to the above two licenses +(see file src/pcf/readme). --- end of licence.txt --- diff --git a/reactos/lib/freetype/docs/raster.txt b/reactos/lib/freetype/docs/raster.txt deleted file mode 100644 index 078c51aa19b..00000000000 --- a/reactos/lib/freetype/docs/raster.txt +++ /dev/null @@ -1,624 +0,0 @@ - - How FreeType's rasterizer work - - by David Turner - - Revised 2003-Dec-08 - - -This file is an attempt to explain the internals of the FreeType -rasterizer. The rasterizer is of quite general purpose and could -easily be integrated into other programs. - - - I. Introduction - - II. Rendering Technology - 1. Requirements - 2. Profiles and Spans - a. Sweeping the Shape - b. Decomposing Outlines into Profiles - c. The Render Pool - d. Computing Profiles Extents - e. Computing Profiles Coordinates - f. Sweeping and Sorting the Spans - - -I. Introduction -=============== - - A rasterizer is a library in charge of converting a vectorial - representation of a shape into a bitmap. The FreeType rasterizer - has been originally developed to render the glyphs found in - TrueType files, made up of segments and second-order Béziers. - Meanwhile it has been extended to render third-order Bézier curves - also. This document is an explanation of its design and - implementation. - - While these explanations start from the basics, a knowledge of - common rasterization techniques is assumed. - - -II. Rendering Technology -======================== - -1. Requirements ---------------- - - We assume that all scaling, rotating, hinting, etc., has been - already done. The glyph is thus described by a list of points in - the device space. - - - All point coordinates are in the 26.6 fixed float format. The - used orientation is: - - - ^ y - | reference orientation - | - *----> x - 0 - - - `26.6' means that 26 bits are used for the integer part of a - value and 6 bits are used for the fractional part. - Consequently, the `distance' between two neighbouring pixels is - 64 `units' (1 unit = 1/64th of a pixel). - - Note that, for the rasterizer, pixel centers are located at - integer coordinates. The TrueType bytecode interpreter, - however, assumes that the lower left edge of a pixel (which is - taken to be a square with a length of 1 unit) has integer - coordinates. - - - ^ y ^ y - | | - | (1,1) | (0.5,0.5) - +-----------+ +-----+-----+ - | | | | | - | | | | | - | | | o-----+-----> x - | | | (0,0) | - | | | | - o-----------+-----> x +-----------+ - (0,0) (-0.5,-0.5) - - TrueType bytecode interpreter FreeType rasterizer - - - A pixel line in the target bitmap is called a `scanline'. - - - A glyph is usually made of several contours, also called - `outlines'. A contour is simply a closed curve that delimits an - outer or inner region of the glyph. It is described by a series - of successive points of the points table. - - Each point of the glyph has an associated flag that indicates - whether it is `on' or `off' the curve. Two successive `on' - points indicate a line segment joining the two points. - - One `off' point amidst two `on' points indicates a second-degree - (conic) Bézier parametric arc, defined by these three points - (the `off' point being the control point, and the `on' ones the - start and end points). Similarly, a third-degree (cubic) Bézier - curve is described by four points (two `off' control points - between two `on' points). - - Finally, for second-order curves only, two successive `off' - points forces the rasterizer to create, during rendering, an - `on' point amidst them, at their exact middle. This greatly - facilitates the definition of successive Bézier arcs. - - The parametric form of a second-order Bézier curve is: - - P(t) = (1-t)^2*P1 + 2*t*(1-t)*P2 + t^2*P3 - - (P1 and P3 are the end points, P2 the control point.) - - The parametric form of a third-order Bézier curve is: - - P(t) = (1-t)^3*P1 + 3*t*(1-t)^2*P2 + 3*t^2*(1-t)*P3 + t^3*P4 - - (P1 and P4 are the end points, P2 and P3 the control points.) - - For both formulae, t is a real number in the range [0..1]. - - Note that the rasterizer does not use these formulae directly. - They exhibit, however, one very useful property of Bézier arcs: - Each point of the curve is a weighted average of the control - points. - - As all weights are positive and always sum up to 1, whatever the - value of t, each arc point lies within the triangle (polygon) - defined by the arc's three (four) control points. - - In the following, only second-order curves are discussed since - rasterization of third-order curves is completely identical. - - Here some samples for second-order curves. - - - * # on curve - * off curve - __---__ - #-__ _-- -_ - --__ _- - - --__ # \ - --__ # - -# - Two `on' points - Two `on' points and one `off' point - between them - - * - # __ Two `on' points with two `off' - \ - - points between them. The point - \ / \ marked `0' is the middle of the - - 0 \ `off' points, and is a `virtual - -_ _- # on' point where the curve passes. - -- It does not appear in the point - * list. - - -2. Profiles and Spans ---------------------- - - The following is a basic explanation of the _kind_ of computations - made by the rasterizer to build a bitmap from a vector - representation. Note that the actual implementation is slightly - different, due to performance tuning and other factors. - - However, the following ideas remain in the same category, and are - more convenient to understand. - - - a. Sweeping the Shape - - The best way to fill a shape is to decompose it into a number of - simple horizontal segments, then turn them on in the target - bitmap. These segments are called `spans'. - - __---__ - _-- -_ - _- - - - \ - / \ - / \ - | \ - - __---__ Example: filling a shape - _----------_ with spans. - _-------------- - ----------------\ - /-----------------\ This is typically done from the top - / \ to the bottom of the shape, in a - | | \ movement called a `sweep'. - V - - __---__ - _----------_ - _-------------- - ----------------\ - /-----------------\ - /-------------------\ - |---------------------\ - - - In order to draw a span, the rasterizer must compute its - coordinates, which are simply the x coordinates of the shape's - contours, taken on the y scanlines. - - - /---/ |---| Note that there are usually - /---/ |---| several spans per scanline. - | /---/ |---| - | /---/_______|---| When rendering this shape to the - V /----------------| current scanline y, we must - /-----------------| compute the x values of the - a /----| |---| points a, b, c, and d. - - - - * * - - - - * * - - y - - / / b c| |d - - - /---/ |---| - /---/ |---| And then turn on the spans a-b - /---/ |---| and c-d. - /---/_______|---| - /----------------| - /-----------------| - a /----| |---| - - - - ####### - - - - ##### - - y - - / / b c| |d - - - b. Decomposing Outlines into Profiles - - For each scanline during the sweep, we need the following - information: - - o The number of spans on the current scanline, given by the - number of shape points intersecting the scanline (these are - the points a, b, c, and d in the above example). - - o The x coordinates of these points. - - x coordinates are computed before the sweep, in a phase called - `decomposition' which converts the glyph into *profiles*. - - Put it simply, a `profile' is a contour's portion that can only - be either ascending or descending, i.e., it is monotonic in the - vertical direction (we also say y-monotonic). There is no such - thing as a horizontal profile, as we shall see. - - Here are a few examples: - - - this square - 1 2 - ---->---- is made of two - | | | | - | | profiles | | - ^ v ^ + v - | | | | - | | | | - ----<---- - - up down - - - this triangle - - P2 1 2 - - |\ is made of two | \ - ^ | \ \ | \ - | | \ \ profiles | \ | - | | \ v ^ | \ | - | \ | | + \ v - | \ | | \ - P1 ---___ \ ---___ \ - ---_\ ---_ \ - <--__ P3 up down - - - - A more general contour can be made of more than two profiles: - - __ ^ - / | / ___ / | - / | / | / | / | - | | / / => | v / / - | | | | | | ^ | - ^ | |___| | | ^ + | + | + v - | | | v | | - | | | up | - |___________| | down | - - <-- up down - - - Successive profiles are always joined by horizontal segments - that are not part of the profiles themselves. - - For the rasterizer, a profile is simply an *array* that - associates one horizontal *pixel* coordinate to each bitmap - *scanline* crossed by the contour's section containing the - profile. Note that profiles are *oriented* up or down along the - glyph's original flow orientation. - - In other graphics libraries, profiles are also called `edges' or - `edgelists'. - - - c. The Render Pool - - FreeType has been designed to be able to run well on _very_ - light systems, including embedded systems with very few memory. - - A render pool will be allocated once; the rasterizer uses this - pool for all its needs by managing this memory directly in it. - The algorithms that are used for profile computation make it - possible to use the pool as a simple growing heap. This means - that this memory management is actually quite easy and faster - than any kind of malloc()/free() combination. - - Moreover, we'll see later that the rasterizer is able, when - dealing with profiles too large and numerous to lie all at once - in the render pool, to immediately decompose recursively the - rendering process into independent sub-tasks, each taking less - memory to be performed (see `sub-banding' below). - - The render pool doesn't need to be large. A 4KByte pool is - enough for nearly all renditions, though nearly 100% slower than - a more confortable 16KByte or 32KByte pool (that was tested with - complex glyphs at sizes over 500 pixels). - - - d. Computing Profiles Extents - - Remember that a profile is an array, associating a _scanline_ to - the x pixel coordinate of its intersection with a contour. - - Though it's not exactly how the FreeType rasterizer works, it is - convenient to think that we need a profile's height before - allocating it in the pool and computing its coordinates. - - The profile's height is the number of scanlines crossed by the - y-monotonic section of a contour. We thus need to compute these - sections from the vectorial description. In order to do that, - we are obliged to compute all (local and global) y extrema of - the glyph (minima and maxima). - - - P2 For instance, this triangle has only - two y-extrema, which are simply - |\ - | \ P2.y as a vertical maximum - | \ P3.y as a vertical minimum - | \ - | \ P1.y is not a vertical extremum (though - | \ it is a horizontal minimum, which we - P1 ---___ \ don't need). - ---_\ - P3 - - - Note that the extrema are expressed in pixel units, not in - scanlines. The triangle's height is certainly (P3.y-P2.y+1) - pixel units, but its profiles' heights are computed in - scanlines. The exact conversion is simple: - - - min scanline = FLOOR ( min y ) - - max scanline = CEILING( max y ) - - A problem arises with Bézier Arcs. While a segment is always - necessarily y-monotonic (i.e., flat, ascending, or descending), - which makes extrema computations easy, the ascent of an arc can - vary between its control points. - - - P2 - * - # on curve - * off curve - __-x--_ - _-- -_ - P1 _- - A non y-monotonic Bézier arc. - # \ - - The arc goes from P1 to P3. - \ - \ P3 - # - - - We first need to be able to easily detect non-monotonic arcs, - according to their control points. I will state here, without - proof, that the monotony condition can be expressed as: - - P1.y <= P2.y <= P3.y for an ever-ascending arc - - P1.y >= P2.y >= P3.y for an ever-descending arc - - with the special case of - - P1.y = P2.y = P3.y where the arc is said to be `flat'. - - As you can see, these conditions can be very easily tested. - They are, however, extremely important, as any arc that does not - satisfy them necessarily contains an extremum. - - Note also that a monotonic arc can contain an extremum too, - which is then one of its `on' points: - - - P1 P2 - #---__ * P1P2P3 is ever-descending, but P1 - -_ is an y-extremum. - - - ---_ \ - -> \ - \ P3 - # - - - Let's go back to our previous example: - - - P2 - * - # on curve - * off curve - __-x--_ - _-- -_ - P1 _- - A non-y-monotonic Bézier arc. - # \ - - Here we have - \ P2.y >= P1.y && - \ P3 P2.y >= P3.y (!) - # - - - We need to compute the vertical maximum of this arc to be able - to compute a profile's height (the point marked by an `x'). The - arc's equation indicates that a direct computation is possible, - but we rely on a different technique, which use will become - apparent soon. - - Bézier arcs have the special property of being very easily - decomposed into two sub-arcs, which are themselves Bézier arcs. - Moreover, it is easy to prove that there is at most one vertical - extremum on each Bézier arc (for second-degree curves; similar - conditions can be found for third-order arcs). - - For instance, the following arc P1P2P3 can be decomposed into - two sub-arcs Q1Q2Q3 and R1R2R3: - - - P2 - * - # on curve - * off curve - - - original Bézier arc P1P2P3. - __---__ - _-- --_ - _- -_ - - - - / \ - / \ - # # - P1 P3 - - - - P2 - * - - - - Q3 Decomposed into two subarcs - Q2 R2 Q1Q2Q3 and R1R2R3 - * __-#-__ * - _-- --_ - _- R1 -_ Q1 = P1 R3 = P3 - - - Q2 = (P1+P2)/2 R2 = (P2+P3)/2 - / \ - / \ Q3 = R1 = (Q2+R2)/2 - # # - Q1 R3 Note that Q2, R2, and Q3=R1 - are on a single line which is - tangent to the curve. - - - We have then decomposed a non-y-monotonic Bézier curve into two - smaller sub-arcs. Note that in the above drawing, both sub-arcs - are monotonic, and that the extremum is then Q3=R1. However, in - a more general case, only one sub-arc is guaranteed to be - monotonic. Getting back to our former example: - - - Q2 - * - - __-x--_ R1 - _-- #_ - Q1 _- Q3 - R2 - # \ * - - - \ - \ R3 - # - - - Here, we see that, though Q1Q2Q3 is still non-monotonic, R1R2R3 - is ever descending: We thus know that it doesn't contain the - extremum. We can then re-subdivide Q1Q2Q3 into two sub-arcs and - go on recursively, stopping when we encounter two monotonic - subarcs, or when the subarcs become simply too small. - - We will finally find the vertical extremum. Note that the - iterative process of finding an extremum is called `flattening'. - - - e. Computing Profiles Coordinates - - Once we have the height of each profile, we are able to allocate - it in the render pool. The next task is to compute coordinates - for each scanline. - - In the case of segments, the computation is straightforward, - using the Euclidian algorithm (also known as Bresenham). - However, for Bézier arcs, the job is a little more complicated. - - We assume that all Béziers that are part of a profile are the - result of flattening the curve, which means that they are all - y-monotonic (ascending or descending, and never flat). We now - have to compute the intersections of arcs with the profile's - scanlines. One way is to use a similar scheme to flattening - called `stepping'. - - - Consider this arc, going from P1 to - --------------------- P3. Suppose that we need to - compute its intersections with the - drawn scanlines. As already - --------------------- mentioned this can be done - directly, but the involed algorithm - * P2 _---# P3 is far too slow. - ------------- _-- -- - _- - _/ Instead, it is still possible to - ---------/----------- use the decomposition property in - / the same recursive way, i.e., - | subdivide the arc into subarcs - ------|-------------- until these get too small to cross - | more than one scanline! - | - -----|--------------- This is very easily done using a - | rasterizer-managed stack of - | subarcs. - # P1 - - - f. Sweeping and Sorting the Spans - - Once all our profiles have been computed, we begin the sweep to - build (and fill) the spans. - - As both the TrueType and Type 1 specifications use the winding - fill rule (but with opposite directions), we place, on each - scanline, the present profiles in two separate lists. - - One list, called the `left' one, only contains ascending - profiles, while the other `right' list contains the descending - profiles. - - As each glyph is made of closed curves, a simple geometric - property ensures that the two lists contain the same number of - elements. - - Creating spans is thus straightforward: - - 1. We sort each list in increasing horizontal order. - - 2. We pair each value of the left list with its corresponding - value in the right list. - - - / / | | For example, we have here - / / | | four profiles. Two of - >/ / | | | them are ascending (1 & - 1// / ^ | | | 2 3), while the two others - // // 3| | | v are descending (2 & 4). - / //4 | | | On the given scanline, - a / /< | | the left list is (1,3), - - - - *-----* - - - - *---* - - y - and the right one is - / / b c| |d (4,2) (sorted). - - There are then two spans, joining - 1 to 4 (i.e. a-b) and 3 to 2 - (i.e. c-d)! - - - Sorting doesn't necessarily take much time, as in 99 cases out - of 100, the lists' order is kept from one scanline to the next. - We can thus implement it with two simple singly-linked lists, - sorted by a classic bubble-sort, which takes a minimum amount of - time when the lists are already sorted. - - A previous version of the rasterizer used more elaborate - structures, like arrays to perform `faster' sorting. It turned - out that this old scheme is not faster than the one described - above. - - Once the spans have been `created', we can simply draw them in - the target bitmap. - - ---- end of raster.txt --- - -Local Variables: -coding: latin-1 -End: diff --git a/reactos/lib/freetype/docs/reference/.cvsignore b/reactos/lib/freetype/docs/reference/.cvsignore deleted file mode 100644 index 2d19fc766d9..00000000000 --- a/reactos/lib/freetype/docs/reference/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.html diff --git a/reactos/lib/freetype/docs/release b/reactos/lib/freetype/docs/release index 7cf37b84968..df3ef5485c6 100644 --- a/reactos/lib/freetype/docs/release +++ b/reactos/lib/freetype/docs/release @@ -7,26 +7,12 @@ How to prepare a new release . builds/unix/configure.ac (version_info): Update according to the libtool rules, then regenerate the configure script. -. builds/freetype.mk (refdoc): Update the `--title' option. +. builds/freetype.mk (refdoc): Update the --title option. . docs/CHANGES: Document differences to last release. . README: Update. -. docs/VERSION.DLL: Document changed `version_info'. +. docs/VERSION.DLL: Document changed version_info. . ChangeLog: Announce new release. - -. Call `make refdoc' to update HTML reference. Copy it to - freetype2/docs/reference in the `www' CVS module and update the CVS. - Then call `update-www' in ~/cvs/scripts on www.freetype.org to - update and distribute everything to sourceforge. - -. Tag the CVS (freetype, ft2demos, www/freetype2/docs). - -. Update `make-release' and `make-current' in ~/cvs/scripts/ on - www.freetype.org, then call them. - -. Create an md5 checksum file (with md5sum). - -. Announce new release on announce@freetype.org and to relevant newsgroups. diff --git a/reactos/lib/freetype/freetype.def b/reactos/lib/freetype/freetype.def index c1f59970a18..6f1689ce818 100644 --- a/reactos/lib/freetype/freetype.def +++ b/reactos/lib/freetype/freetype.def @@ -29,7 +29,6 @@ FT_Done_Size FT_FloorFix FT_Free FT_Get_Char_Index -FT_Get_CMap_Language_ID FT_Get_First_Char FT_Get_Glyph_Name FT_Get_Kerning @@ -67,7 +66,6 @@ FT_Load_Char FT_Load_Glyph FT_Load_Sfnt_Table FT_Lookup_Renderer -ft_module_get_service FT_MulDiv FT_MulFix FT_MulTo64 @@ -84,7 +82,6 @@ FT_Outline_Done FT_Outline_Done_Internal FT_Outline_Get_Bitmap FT_Outline_Get_CBox -FT_Outline_Get_Orientation FT_Outline_New FT_Outline_New_Internal FT_Outline_Render @@ -97,7 +94,6 @@ FT_Render_Glyph FT_Render_Glyph_Internal FT_RoundFix FT_Select_Charmap -ft_service_list_lookup FT_Set_Char_Size FT_Set_Charmap FT_Set_Debug_Hook @@ -162,23 +158,16 @@ FT_Get_X11_Font_Format FT_Get_PFR_Advance FT_Get_PFR_Kerning FT_Get_PFR_Metrics -FT_Glyph_Stroke -FT_Glyph_StrokeBorder -FT_Outline_GetInsideBorder -FT_Outline_GetOutsideBorder FT_Stroker_BeginSubPath FT_Stroker_ConicTo FT_Stroker_CubicTo FT_Stroker_Done FT_Stroker_EndSubPath FT_Stroker_Export -FT_Stroker_ExportBorder -FT_Stroker_GetBorderCounts FT_Stroker_GetCounts FT_Stroker_LineTo FT_Stroker_New FT_Stroker_ParseOutline -FT_Stroker_Rewind FT_Stroker_Set FT_Get_WinFNT_Header FT_Outline_Get_BBox @@ -187,57 +176,50 @@ autohint_module_class ft_autohinter_service bdf_cmap_class bdf_driver_class -FTC_Cache_Clear -FTC_Cache_Done -FTC_Cache_Init -FTC_Cache_Lookup -FTC_Cache_NewNode -FTC_Cache_RemoveFaceID +FT_LruList_Destroy +FT_LruList_Lookup +FT_LruList_New +FT_LruList_Remove +FT_LruList_Remove_Selection +FT_LruList_Reset +ftc_cache_clear +ftc_cache_done +ftc_cache_init +ftc_cache_lookup ftc_cmap_cache_class FTC_CMapCache_Lookup FTC_CMapCache_New -FTC_Family_Init -FTC_GCache_Done -FTC_GCache_Init -FTC_GCache_Lookup -FTC_GCache_New -FTC_GNode_Compare -FTC_GNode_Done -FTC_GNode_Init -FTC_GNode_UnselectFamily +ftc_face_list_class +ftc_family_done +ftc_family_init +ftc_family_table_alloc +ftc_family_table_free +ftc_glyph_family_done +ftc_glyph_family_init +ftc_glyph_node_compare +ftc_glyph_node_done +ftc_glyph_node_init +ftc_image_cache_class +FTC_Image_Cache_Lookup +FTC_Image_Cache_New FTC_ImageCache_Lookup FTC_ImageCache_New -FTC_INode_Free -FTC_INode_New -FTC_INode_Weight FTC_Manager_Compress FTC_Manager_Done -FTC_Manager_FlushN -FTC_Manager_LookupFace -FTC_Manager_LookupSize +FTC_Manager_Lookup_Face +FTC_Manager_Lookup_Size FTC_Manager_New -FTC_Manager_RegisterCache -FTC_Manager_RemoveFaceID +FTC_Manager_Register_Cache FTC_Manager_Reset -FTC_MruList_Done -FTC_MruList_Find -FTC_MruList_Init -FTC_MruList_Lookup -FTC_MruList_New -FTC_MruList_Remove -FTC_MruList_RemoveSelection -FTC_MruList_Reset -FTC_MruNode_Prepend -FTC_MruNode_Remove -FTC_MruNode_Up ftc_node_destroy +ftc_node_done FTC_Node_Unref +ftc_sbit_cache_class +FTC_SBit_Cache_Lookup +FTC_SBit_Cache_New FTC_SBitCache_Lookup FTC_SBitCache_New -FTC_SNode_Compare -FTC_SNode_Free -FTC_SNode_New -FTC_SNode_Weight +ftc_size_list_class cff_cmap_encoding_class_rec cff_cmap_unicode_class_rec cff_driver_class @@ -251,7 +233,7 @@ RepadBitmap TwoByteSwap pfr_cmap_class_rec pfr_driver_class -pfr_metrics_service_rec +pfr_service_rec ps_parser_funcs ps_table_funcs psaux_module_class diff --git a/reactos/lib/freetype/include/freetype/cache/ftccache.h b/reactos/lib/freetype/include/freetype/cache/ftccache.h index 7c7688dba26..701b13eb0ee 100644 --- a/reactos/lib/freetype/include/freetype/cache/ftccache.h +++ b/reactos/lib/freetype/include/freetype/cache/ftccache.h @@ -4,7 +4,7 @@ /* */ /* FreeType internal cache interface (specification). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004 by */ +/* Copyright 2000-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -20,7 +20,9 @@ #define __FTCCACHE_H__ -#include FT_CACHE_INTERNAL_MRU_H +/* define to allow cache lookup inlining */ +#define FTC_CACHE_USE_INLINE + FT_BEGIN_HEADER @@ -28,7 +30,13 @@ FT_BEGIN_HEADER typedef struct FTC_CacheRec_* FTC_Cache; /* handle to cache class */ - typedef const struct FTC_CacheClassRec_* FTC_CacheClass; + typedef const struct FTC_Cache_ClassRec_* FTC_Cache_Class; + + /* handle to cache node family */ + typedef struct FTC_FamilyRec_* FTC_Family; + + /* handle to cache root query */ + typedef struct FTC_QueryRec_* FTC_Query; /*************************************************************************/ @@ -54,11 +62,12 @@ FT_BEGIN_HEADER /* structure size should be 20 bytes on 32-bits machines */ typedef struct FTC_NodeRec_ { - FTC_MruNodeRec mru; /* circular mru list pointer */ - FTC_Node link; /* used for hashing */ - FT_UInt32 hash; /* used for hashing too */ - FT_UShort cache_index; /* index of cache the node belongs to */ - FT_Short ref_count; /* reference count for this node */ + FTC_Node mru_next; /* circular mru list pointer */ + FTC_Node mru_prev; /* circular mru list pointer */ + FTC_Node link; /* used for hashing */ + FT_UInt32 hash; /* used for hashing too */ + FT_UShort fam_index; /* index of family the node belongs to */ + FT_Short ref_count; /* reference count for this node */ } FTC_NodeRec; @@ -66,9 +75,6 @@ FT_BEGIN_HEADER #define FTC_NODE( x ) ( (FTC_Node)(x) ) #define FTC_NODE_P( x ) ( (FTC_Node*)(x) ) -#define FTC_NODE__NEXT(x) FTC_NODE( (x)->mru.next ) -#define FTC_NODE__PREV(x) FTC_NODE( (x)->mru.prev ) - /*************************************************************************/ /* */ @@ -77,12 +83,83 @@ FT_BEGIN_HEADER /* cache sub-system internals. */ /* */ + /* can be used as a FTC_Node_DoneFunc */ + FT_EXPORT( void ) + ftc_node_done( FTC_Node node, + FTC_Cache cache ); + /* reserved for manager's use */ FT_EXPORT( void ) ftc_node_destroy( FTC_Node node, FTC_Manager manager ); + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** CACHE QUERY DEFINITIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* A structure modelling a cache node query. The following fields must */ + /* all be set by the @FTC_Family_CompareFunc method of a cache's family */ + /* list. */ + /* */ + typedef struct FTC_QueryRec_ + { + FTC_Family family; + FT_UFast hash; + + } FTC_QueryRec; + + +#define FTC_QUERY( x ) ( (FTC_Query)(x) ) +#define FTC_QUERY_P( x ) ( (FTC_Query*)(x) ) + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** CACHE FAMILY DEFINITIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + typedef struct FTC_FamilyRec_ + { + FT_LruNodeRec lru; + FTC_Cache cache; + FT_UInt num_nodes; + FT_UInt fam_index; + + } FTC_FamilyRec; + + +#define FTC_FAMILY( x ) ( (FTC_Family)(x) ) +#define FTC_FAMILY_P( x ) ( (FTC_Family*)(x) ) + + + /*************************************************************************/ + /* */ + /* These functions are exported so that they can be called from */ + /* user-provided cache classes; otherwise, they are really part of the */ + /* cache sub-system internals. */ + /* */ + + /* must be called by any FTC_Node_InitFunc routine */ + FT_EXPORT( FT_Error ) + ftc_family_init( FTC_Family family, + FTC_Query query, + FTC_Cache cache ); + + + /* can be used as a FTC_Family_DoneFunc; otherwise, must be called */ + /* by any family finalizer function */ + FT_EXPORT( void ) + ftc_family_done( FTC_Family family ); + + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -91,12 +168,64 @@ FT_BEGIN_HEADER /*************************************************************************/ /*************************************************************************/ + /* each cache really implements a dynamic hash table to manage its nodes */ + typedef struct FTC_CacheRec_ + { + FTC_Manager manager; + FT_Memory memory; + FTC_Cache_Class clazz; + + FT_UInt cache_index; /* in manager's table */ + FT_Pointer cache_data; /* used by cache node methods */ + + FT_UFast p; + FT_UFast mask; + FT_Long slack; + FTC_Node* buckets; + + FT_LruList_ClassRec family_class; + FT_LruList families; + + } FTC_CacheRec; + + +#define FTC_CACHE( x ) ( (FTC_Cache)(x) ) +#define FTC_CACHE_P( x ) ( (FTC_Cache*)(x) ) + + + /* initialize a given cache */ + typedef FT_Error + (*FTC_Cache_InitFunc)( FTC_Cache cache ); + + /* clear a cache */ + typedef void + (*FTC_Cache_ClearFunc)( FTC_Cache cache ); + + /* finalize a given cache */ + typedef void + (*FTC_Cache_DoneFunc)( FTC_Cache cache ); + + + typedef FT_Error + (*FTC_Family_InitFunc)( FTC_Family family, + FTC_Query query, + FTC_Cache cache ); + + typedef FT_Int + (*FTC_Family_CompareFunc)( FTC_Family family, + FTC_Query query ); + + typedef void + (*FTC_Family_DoneFunc)( FTC_Family family, + FTC_Cache cache ); + /* initialize a new cache node */ typedef FT_Error - (*FTC_Node_NewFunc)( FTC_Node *pnode, - FT_Pointer query, - FTC_Cache cache ); + (*FTC_Node_InitFunc)( FTC_Node node, + FT_Pointer type, + FTC_Cache cache ); + /* compute the weight of a given cache node */ typedef FT_ULong (*FTC_Node_WeightFunc)( FTC_Node node, FTC_Cache cache ); @@ -107,159 +236,62 @@ FT_BEGIN_HEADER FT_Pointer key, FTC_Cache cache ); - + /* finalize a given cache node */ typedef void - (*FTC_Node_FreeFunc)( FTC_Node node, + (*FTC_Node_DoneFunc)( FTC_Node node, FTC_Cache cache ); - typedef FT_Error - (*FTC_Cache_InitFunc)( FTC_Cache cache ); - typedef void - (*FTC_Cache_DoneFunc)( FTC_Cache cache ); - - - typedef struct FTC_CacheClassRec_ + typedef struct FTC_Cache_ClassRec_ { - FTC_Node_NewFunc node_new; - FTC_Node_WeightFunc node_weight; - FTC_Node_CompareFunc node_compare; - FTC_Node_CompareFunc node_remove_faceid; - FTC_Node_FreeFunc node_free; + FT_UInt cache_size; + FTC_Cache_InitFunc cache_init; + FTC_Cache_ClearFunc cache_clear; + FTC_Cache_DoneFunc cache_done; - FT_UInt cache_size; - FTC_Cache_InitFunc cache_init; - FTC_Cache_DoneFunc cache_done; + FT_UInt family_size; + FTC_Family_InitFunc family_init; + FTC_Family_CompareFunc family_compare; + FTC_Family_DoneFunc family_done; - } FTC_CacheClassRec; + FT_UInt node_size; + FTC_Node_InitFunc node_init; + FTC_Node_WeightFunc node_weight; + FTC_Node_CompareFunc node_compare; + FTC_Node_DoneFunc node_done; + + } FTC_Cache_ClassRec; - /* each cache really implements a dynamic hash table to manage its nodes */ - typedef struct FTC_CacheRec_ - { - FT_UFast p; - FT_UFast mask; - FT_Long slack; - FTC_Node* buckets; - - FTC_CacheClassRec clazz; /* local copy, for speed */ - - FTC_Manager manager; - FT_Memory memory; - FT_UInt index; /* in manager's table */ - - FTC_CacheClass org_class; /* original class pointer */ - - } FTC_CacheRec; + /* */ -#define FTC_CACHE( x ) ( (FTC_Cache)(x) ) -#define FTC_CACHE_P( x ) ( (FTC_Cache*)(x) ) + /*************************************************************************/ + /* */ + /* These functions are exported so that they can be called from */ + /* user-provided cache classes; otherwise, they are really part of the */ + /* cache sub-system internals. */ + /* */ - - /* default cache initialize */ - FT_EXPORT( FT_Error ) - FTC_Cache_Init( FTC_Cache cache ); - - /* default cache finalizer */ + /* can be used directly as FTC_Cache_DoneFunc(), or called by custom */ + /* cache finalizers */ FT_EXPORT( void ) - FTC_Cache_Done( FTC_Cache cache ); + ftc_cache_done( FTC_Cache cache ); - /* Call this function to lookup the cache. If no corresponding - * node is found, a new one is automatically created. This function - * is capable of flushing the cache adequately to make room for the - * new cache object. - */ - FT_EXPORT( FT_Error ) - FTC_Cache_Lookup( FTC_Cache cache, - FT_UInt32 hash, - FT_Pointer query, - FTC_Node *anode ); - - FT_EXPORT( FT_Error ) - FTC_Cache_NewNode( FTC_Cache cache, - FT_UInt32 hash, - FT_Pointer query, - FTC_Node *anode ); - - /* Remove all nodes that relate to a given face_id. This is useful - * when un-installing fonts. Note that if a cache node relates to - * the face_id, but is locked (i.e., has 'ref_count > 0'), the node - * will _not_ be destroyed, but its internal face_id reference will - * be modified. - * - * The final result will be that the node will never come back - * in further lookup requests, and will be flushed on demand from - * the cache normally when its reference count reaches 0. - */ + /* can be used directly as FTC_Cache_ClearFunc(), or called by custom */ + /* cache clear routines */ FT_EXPORT( void ) - FTC_Cache_RemoveFaceID( FTC_Cache cache, - FTC_FaceID face_id ); + ftc_cache_clear( FTC_Cache cache ); + /* initalize the hash table within the cache */ + FT_EXPORT( FT_Error ) + ftc_cache_init( FTC_Cache cache ); -#ifdef FTC_INLINE - -#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \ - FT_BEGIN_STMNT \ - FTC_Node *_bucket, *_pnode, _node; \ - FTC_Cache _cache = FTC_CACHE(cache); \ - FT_UInt32 _hash = (FT_UInt32)(hash); \ - FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \ - FT_UInt _idx; \ - \ - \ - error = 0; \ - node = NULL; \ - _idx = _hash & _cache->mask; \ - if ( _idx < _cache->p ) \ - _idx = _hash & ( _cache->mask*2 + 1 ); \ - \ - _bucket = _pnode = _cache->buckets + _idx; \ - for (;;) \ - { \ - _node = *_pnode; \ - if ( _node == NULL ) \ - goto _NewNode; \ - \ - if ( _node->hash == _hash && _nodcomp( _node, query, _cache ) ) \ - break; \ - \ - _pnode = &_node->link; \ - } \ - \ - if ( _node != *_bucket ) \ - { \ - *_pnode = _node->link; \ - _node->link = *_bucket; \ - *_bucket = _node; \ - } \ - \ - { \ - FTC_Manager _manager = _cache->manager; \ - \ - \ - if ( _node != _manager->nodes_list ) \ - FTC_MruNode_Up( (FTC_MruNode*)&_manager->nodes_list, \ - (FTC_MruNode)_node ); \ - } \ - goto _Ok; \ - \ - _NewNode: \ - error = FTC_Cache_NewNode( _cache, _hash, query, &_node ); \ - \ - _Ok: \ - *(FTC_Node*)&(node) = _node; \ - FT_END_STMNT - -#else /* !FTC_INLINE */ - -#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \ - FT_BEGIN_STMNT \ - error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, \ - (FTC_Node*)&(node) ); \ - FT_END_STMNT - -#endif /* !FTC_INLINE */ + /* can be called when the key's hash value has been computed */ + FT_EXPORT( FT_Error ) + ftc_cache_lookup( FTC_Cache cache, + FTC_Query query, + FTC_Node *anode ); /* */ diff --git a/reactos/lib/freetype/include/freetype/cache/ftcglyph.h b/reactos/lib/freetype/include/freetype/cache/ftcglyph.h index be237f934ad..8a2f0f3a7e2 100644 --- a/reactos/lib/freetype/include/freetype/cache/ftcglyph.h +++ b/reactos/lib/freetype/include/freetype/cache/ftcglyph.h @@ -4,7 +4,7 @@ /* */ /* FreeType abstract glyph cache (specification). */ /* */ -/* Copyright 2000-2001, 2003, 2004 by */ +/* Copyright 2000-2001, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,84 +16,13 @@ /***************************************************************************/ - /* - * - * FTC_GCache is an _abstract_ cache object optimized to store glyph - * data. It works as follows: - * - * - It manages FTC_GNode objects. Each one of them can hold one or more - * glyph `items'. Item types are not specified in the FTC_GCache but - * in classes that extend it. - * - * - Glyph attributes, like face ID, character size, render mode, etc., - * can be grouped into abstract `glyph families'. This avoids storing - * the attributes within the FTC_GCache, since it is likely that many - * FTC_GNodes will belong to the same family in typical uses. - * - * - Each FTC_GNode is thus an FTC_Node with two additional fields: - * - * * gindex: A glyph index, or the first index in a glyph range. - * * family: A pointer to a glyph `family'. - * - * - Family types are not fully specific in the FTC_Family type, but - * by classes that extend it. - * - * Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache. - * They share an FTC_Family sub-class called FTC_BasicFamily which is - * used to store the following data: face ID, pixel/point sizes, load - * flags. For more details see the file `src/cache/ftcbasic.c'. - * - * Client applications can extend FTC_GNode with their own FTC_GNode - * and FTC_Family sub-classes to implement more complex caches (e.g., - * handling automatic synthesis, like obliquing & emboldening, colored - * glyphs, etc.). - * - * See also the FTC_ICache & FTC_SCache classes in `ftcimage.h' and - * `ftcsbits.h', which both extend FTC_GCache with additional - * optimizations. - * - * A typical FTC_GCache implementation must provide at least the - * following: - * - * - FTC_GNode sub-class, e.g. MyNode, with relevant methods: - * my_node_new (must call FTC_GNode_Init) - * my_node_free (must call FTC_GNode_Done) - * my_node_compare (must call FTC_GNode_Compare) - * my_node_remove_faceid (must call ftc_gnode_unselect in case - * of match) - * - * - FTC_Family sub-class, e.g. MyFamily, with relevant methods: - * my_family_compare - * my_family_init - * my_family_reset (optional) - * my_family_done - * - * - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query - * data. - * - * - Constant structures for a FTC_GNodeClass. - * - * - MyCacheNew() can be implemented easily as a call to the convenience - * function FTC_GCache_New. - * - * - MyCacheLookup with a call to FTC_GCache_Lookup. This function will - * automatically: - * - * - Search for the corresponding family in the cache, or create - * a new one if necessary. Put it in FTC_GQUERY(myquery).family - * - * - Call FTC_Cache_Lookup. - * - * If it returns NULL, you should create a new node, then call - * ftc_cache_add as usual. - */ - - /*************************************************************************/ /* */ /* Important: The functions defined in this file are only used to */ /* implement an abstract glyph cache class. You need to */ /* provide additional logic to implement a complete cache. */ + /* For example, see `ftcimage.h' and `ftcimage.c' which */ + /* implement a FT_Glyph cache based on this code. */ /* */ /*************************************************************************/ @@ -118,53 +47,99 @@ #include -#include FT_CACHE_INTERNAL_MANAGER_H +#include FT_CACHE_H +#include FT_CACHE_MANAGER_H + +#include FT_BEGIN_HEADER - /* - * We can group glyphs into `families'. Each family correspond to a - * given face ID, character size, transform, etc. - * - * Families are implemented as MRU list nodes. They are - * reference-counted. - */ + /* each glyph set is characterized by a "glyph set type" which must be */ + /* defined by sub-classes */ + typedef struct FTC_GlyphFamilyRec_* FTC_GlyphFamily; - typedef struct FTC_FamilyRec_ + /* handle to a glyph cache node */ + typedef struct FTC_GlyphNodeRec_* FTC_GlyphNode; + + + /* size should be 24 + chunk size on 32-bit machines; */ + /* note that the node's hash is ((gfam->hash << 16) | glyph_index) -- */ + /* this _must_ be set properly by the glyph node initializer */ + /* */ + typedef struct FTC_GlyphNodeRec_ { - FTC_MruNodeRec mrunode; - FT_UInt num_nodes; /* current number of nodes in this family */ - FTC_Cache cache; - FTC_MruListClass clazz; + FTC_NodeRec node; + FT_UShort item_count; + FT_UShort item_start; - } FTC_FamilyRec, *FTC_Family; - -#define FTC_FAMILY(x) ( (FTC_Family)(x) ) -#define FTC_FAMILY_P(x) ( (FTC_Family*)(x) ) + } FTC_GlyphNodeRec; - typedef struct FTC_GNodeRec_ +#define FTC_GLYPH_NODE( x ) ( (FTC_GlyphNode)(x) ) +#define FTC_GLYPH_NODE_P( x ) ( (FTC_GlyphNode*)(x) ) + + + typedef struct FTC_GlyphQueryRec_ { - FTC_NodeRec node; - FTC_Family family; - FT_UInt gindex; + FTC_QueryRec query; + FT_UInt gindex; - } FTC_GNodeRec, *FTC_GNode; - -#define FTC_GNODE( x ) ( (FTC_GNode)(x) ) -#define FTC_GNODE_P( x ) ( (FTC_GNode*)(x) ) + } FTC_GlyphQueryRec, *FTC_GlyphQuery; - typedef struct FTC_GQueryRec_ +#define FTC_GLYPH_QUERY( x ) ( (FTC_GlyphQuery)(x) ) + + + /* a glyph set is used to categorize glyphs of a given type */ + typedef struct FTC_GlyphFamilyRec_ { - FT_UInt gindex; - FTC_Family family; + FTC_FamilyRec family; + FT_UInt32 hash; + FT_UInt item_total; /* total number of glyphs in family */ + FT_UInt item_count; /* number of glyph items per node */ - } FTC_GQueryRec, *FTC_GQuery; + } FTC_GlyphFamilyRec; -#define FTC_GQUERY( x ) ( (FTC_GQuery)(x) ) + +#define FTC_GLYPH_FAMILY( x ) ( (FTC_GlyphFamily)(x) ) +#define FTC_GLYPH_FAMILY_P( x ) ( (FTC_GlyphFamily*)(x) ) + +#define FTC_GLYPH_FAMILY_MEMORY( x ) FTC_FAMILY(x)->cache->memory + + + /* each glyph node contains a 'chunk' of glyph items; */ + /* translate a glyph index into a chunk index */ +#define FTC_GLYPH_FAMILY_CHUNK( gfam, gindex ) \ + ( ( gindex ) / FTC_GLYPH_FAMILY( gfam )->item_count ) + + /* find a glyph index's chunk, and return its start index */ +#define FTC_GLYPH_FAMILY_START( gfam, gindex ) \ + ( FTC_GLYPH_FAMILY_CHUNK( gfam, gindex ) * \ + FTC_GLYPH_FAMILY( gfam )->item_count ) + + /* compute a glyph request's hash value */ +#define FTC_GLYPH_FAMILY_HASH( gfam, gindex ) \ + ( (FT_UFast)( \ + ( FTC_GLYPH_FAMILY( gfam )->hash << 16 ) | \ + ( FTC_GLYPH_FAMILY_CHUNK( gfam, gindex ) & 0xFFFFU ) ) ) + + /* must be called in an FTC_Family_CompareFunc to update the query */ + /* whenever a glyph set is matched in the lookup, or when it */ + /* is created */ +#define FTC_GLYPH_FAMILY_FOUND( gfam, gquery ) \ + do \ + { \ + FTC_QUERY( gquery )->family = FTC_FAMILY( gfam ); \ + FTC_QUERY( gquery )->hash = \ + FTC_GLYPH_FAMILY_HASH( gfam, \ + FTC_GLYPH_QUERY( gquery )->gindex ); \ + } while ( 0 ) + + /* retrieve glyph index of glyph node */ +#define FTC_GLYPH_NODE_GINDEX( x ) \ + ( (FT_UInt)( FTC_GLYPH_NODE( x )->node.hash & 0xFFFFU ) ) /*************************************************************************/ @@ -176,116 +151,39 @@ FT_BEGIN_HEADER /* must be called by derived FTC_Node_InitFunc routines */ FT_EXPORT( void ) - FTC_GNode_Init( FTC_GNode node, - FT_UInt gindex, /* glyph index for node */ - FTC_Family family ); + ftc_glyph_node_init( FTC_GlyphNode node, + FT_UInt gindex, /* glyph index for node */ + FTC_GlyphFamily gfam ); /* returns TRUE iff the query's glyph index correspond to the node; */ /* this assumes that the "family" and "hash" fields of the query are */ /* already correctly set */ FT_EXPORT( FT_Bool ) - FTC_GNode_Compare( FTC_GNode gnode, - FTC_GQuery gquery ); - - /* call this function to clear a node's family -- this is necessary */ - /* to implement the `node_remove_faceid' cache method correctly */ - FT_EXPORT( void ) - FTC_GNode_UnselectFamily( FTC_GNode gnode, - FTC_Cache cache ); + ftc_glyph_node_compare( FTC_GlyphNode gnode, + FTC_GlyphQuery gquery ); /* must be called by derived FTC_Node_DoneFunc routines */ FT_EXPORT( void ) - FTC_GNode_Done( FTC_GNode node, - FTC_Cache cache ); + ftc_glyph_node_done( FTC_GlyphNode node, + FTC_Cache cache ); + /* must be called by derived FTC_Family_InitFunc; */ + /* calls "ftc_family_init" */ + FT_EXPORT( FT_Error ) + ftc_glyph_family_init( FTC_GlyphFamily gfam, + FT_UInt32 hash, + FT_UInt item_count, + FT_UInt item_total, + FTC_GlyphQuery gquery, + FTC_Cache cache ); + FT_EXPORT( void ) - FTC_Family_Init( FTC_Family family, - FTC_Cache cache ); - - typedef struct FTC_GCacheRec_ - { - FTC_CacheRec cache; - FTC_MruListRec families; - - } FTC_GCacheRec, *FTC_GCache; - -#define FTC_GCACHE( x ) ((FTC_GCache)(x)) + ftc_glyph_family_done( FTC_GlyphFamily gfam ); - /* can be used as @FTC_Cache_InitFunc */ - FT_EXPORT( FT_Error ) - FTC_GCache_Init( FTC_GCache cache ); - - - /* can be used as @FTC_Cache_DoneFunc */ - FT_EXPORT( void ) - FTC_GCache_Done( FTC_GCache cache ); - - - /* the glyph cache class adds fields for the family implementation */ - typedef struct FTC_GCacheClassRec_ - { - FTC_CacheClassRec clazz; - FTC_MruListClass family_class; - - } FTC_GCacheClassRec; - - typedef const FTC_GCacheClassRec* FTC_GCacheClass; - -#define FTC_GCACHE_CLASS( x ) ((FTC_GCacheClass)(x)) - -#define FTC_CACHE__GCACHE_CLASS( x ) \ - FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class ) -#define FTC_CACHE__FAMILY_CLASS( x ) \ - ((FTC_MruListClass) FTC_CACHE__GCACHE_CLASS(x)->family_class) - - - /* convenience function; use it instead of FTC_Manager_Register_Cache */ - FT_EXPORT( FT_Error ) - FTC_GCache_New( FTC_Manager manager, - FTC_GCacheClass clazz, - FTC_GCache *acache ); - - FT_EXPORT( FT_Error ) - FTC_GCache_Lookup( FTC_GCache cache, - FT_UInt32 hash, - FT_UInt gindex, - FTC_GQuery query, - FTC_Node *anode ); - - -#ifdef FTC_INLINE - -#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash, \ - gindex, query, node, error ) \ - FT_BEGIN_STMNT \ - FTC_GCache _gcache = FTC_GCACHE( cache ); \ - FTC_GQuery _gquery = (FTC_GQuery)( query ); \ - FTC_MruNode_CompareFunc _fcompare = (FTC_MruNode_CompareFunc)(famcmp); \ - \ - \ - _gquery->gindex = (gindex); \ - \ - FTC_MRULIST_LOOKUP_CMP( &_gcache->families, _gquery, _fcompare, \ - _gquery->family, error ); \ - if ( !error ) \ - FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ); \ - FT_END_STMNT /* */ - -#else /* !FTC_INLINE */ - -#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash, \ - gindex, query, node, error ) \ - FT_BEGIN_STMNT \ - error = FTC_GCache_Lookup( FTC_GCACHE( cache ), hash, gindex, \ - FTC_GQUERY( query ), (FTC_Node*)&(node) ); \ - FT_END_STMNT - -#endif /* !FTC_INLINE */ - - + FT_END_HEADER diff --git a/reactos/lib/freetype/include/freetype/cache/ftcimage.h b/reactos/lib/freetype/include/freetype/cache/ftcimage.h index 1bf12db13db..2d0b780e173 100644 --- a/reactos/lib/freetype/include/freetype/cache/ftcimage.h +++ b/reactos/lib/freetype/include/freetype/cache/ftcimage.h @@ -2,7 +2,7 @@ /* */ /* ftcimage.h */ /* */ -/* FreeType Generic Image cache (specification) */ +/* FreeType Image cache (specification). */ /* */ /* Copyright 2000-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ @@ -16,15 +16,6 @@ /***************************************************************************/ - /* - * FTC_ICache is an _abstract_ cache used to store a single FT_Glyph - * image per cache node. - * - * FTC_ICache extends FTC_GCache. For an implementation example, - * see FTC_ImageCache in `src/cache/ftbasic.c'. - */ - - /*************************************************************************/ /* */ /* Each image cache really manages FT_Glyph objects. */ @@ -38,66 +29,284 @@ #include #include FT_CACHE_H -#include FT_CACHE_INTERNAL_GLYPH_H + FT_BEGIN_HEADER - /* the FT_Glyph image node type - we store only 1 glyph per node */ - typedef struct FTC_INodeRec_ + /*************************************************************************/ + /* */ + /*
*/ + /* cache_subsystem */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** IMAGE CACHE OBJECT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + /************************************************************************** + * + * @struct: + * FTC_ImageTypeRec + * + * @description: + * A simple structure used to describe the type of glyph image to be + * loaded into the cache. + * + * @fields: + * font :: An @FTC_FontRec used to describe the glyph's face and size. + * + * flags :: The load flags to be applied when loading the glyph; see + * the @FT_LOAD_XXX constants for details. + * + * @note: + * This type completely replaces the @FTC_Image_Desc structure which is + * now obsolete. + */ + typedef struct FTC_ImageTypeRec_ { - FTC_GNodeRec gnode; - FT_Glyph glyph; + FTC_FontRec font; + FT_Int32 flags; - } FTC_INodeRec, *FTC_INode; + } FTC_ImageTypeRec; -#define FTC_INODE( x ) ( (FTC_INode)( x ) ) -#define FTC_INODE_GINDEX( x ) FTC_GNODE(x)->gindex -#define FTC_INODE_FAMILY( x ) FTC_GNODE(x)->family + typedef struct FTC_ImageTypeRec_* FTC_ImageType; - typedef FT_Error - (*FTC_IFamily_LoadGlyphFunc)( FTC_Family family, - FT_UInt gindex, - FTC_Cache cache, - FT_Glyph *aglyph ); + /* */ - typedef struct FTC_IFamilyClassRec_ - { - FTC_MruListClassRec clazz; - FTC_IFamily_LoadGlyphFunc family_load_glyph; +#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \ + ( FTC_FONT_COMPARE( &(d1)->font, &(d2)->font ) && \ + (d1)->flags == (d2)->flags ) - } FTC_IFamilyClassRec; - - typedef const FTC_IFamilyClassRec* FTC_IFamilyClass; - -#define FTC_IFAMILY_CLASS( x ) ((FTC_IFamilyClass)(x)) - -#define FTC_CACHE__IFAMILY_CLASS( x ) \ - FTC_IFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS(x)->family_class ) +#define FTC_IMAGE_TYPE_HASH( d ) \ + (FT_UFast)( FTC_FONT_HASH( &(d)->font ) ^ \ + ( (d)->flags << 4 ) ) - /* can be used as a @FTC_Node_FreeFunc */ - FT_EXPORT( void ) - FTC_INode_Free( FTC_INode inode, - FTC_Cache cache ); + /*************************************************************************/ + /* */ + /* */ + /* FTC_ImageCache */ + /* */ + /* */ + /* A handle to an glyph image cache object. They are designed to */ + /* hold many distinct glyph images while not exceeding a certain */ + /* memory threshold. */ + /* */ + typedef struct FTC_ImageCacheRec_* FTC_ImageCache; - /* Can be used as @FTC_Node_NewFunc. `gquery.index' and `gquery.family' - * must be set correctly. This function will call the `family_load_glyph' - * method to load the FT_Glyph into the cache node. - */ + + /*************************************************************************/ + /* */ + /* */ + /* FTC_ImageCache_New */ + /* */ + /* */ + /* Creates a new glyph image cache. */ + /* */ + /* */ + /* manager :: The parent manager for the image cache. */ + /* */ + /* */ + /* acache :: A handle to the new glyph image cache object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ FT_EXPORT( FT_Error ) - FTC_INode_New( FTC_INode *pinode, - FTC_GQuery gquery, - FTC_Cache cache ); + FTC_ImageCache_New( FTC_Manager manager, + FTC_ImageCache *acache ); - /* can be used as @FTC_Node_WeightFunc */ - FT_EXPORT( FT_ULong ) - FTC_INode_Weight( FTC_INode inode ); + + /*************************************************************************/ + /* */ + /* */ + /* FTC_ImageCache_Lookup */ + /* */ + /* */ + /* Retrieves a given glyph image from a glyph image cache. */ + /* */ + /* */ + /* cache :: A handle to the source glyph image cache. */ + /* */ + /* type :: A pointer to a glyph image type descriptor. */ + /* */ + /* gindex :: The glyph index to retrieve. */ + /* */ + /* */ + /* aglyph :: The corresponding @FT_Glyph object. 0 in case of */ + /* failure. */ + /* */ + /* anode :: Used to return the address of of the corresponding cache */ + /* node after incrementing its reference count (see note */ + /* below). */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* The returned glyph is owned and managed by the glyph image cache. */ + /* Never try to transform or discard it manually! You can however */ + /* create a copy with @FT_Glyph_Copy and modify the new one. */ + /* */ + /* If "anode" is _not_ NULL, it receives the address of the cache */ + /* node containing the glyph image, after increasing its reference */ + /* count. This ensures that the node (as well as the FT_Glyph) will */ + /* always be kept in the cache until you call @FTC_Node_Unref to */ + /* "release" it. */ + /* */ + /* If "anode" is NULL, the cache node is left unchanged, which means */ + /* that the FT_Glyph could be flushed out of the cache on the next */ + /* call to one of the caching sub-system APIs. Don't assume that it */ + /* is persistent! */ + /* */ + FT_EXPORT( FT_Error ) + FTC_ImageCache_Lookup( FTC_ImageCache cache, + FTC_ImageType type, + FT_UInt gindex, + FT_Glyph *aglyph, + FTC_Node *anode ); + + /* */ + +#define ftc_image_format( x ) ( (x) & 7 ) + + +#define ftc_image_format_bitmap 0x0000 +#define ftc_image_format_outline 0x0001 + +#define ftc_image_format_mask 0x000F + +#define ftc_image_flag_monochrome 0x0010 +#define ftc_image_flag_unhinted 0x0020 +#define ftc_image_flag_autohinted 0x0040 +#define ftc_image_flag_unscaled 0x0080 +#define ftc_image_flag_no_sbits 0x0100 + + /* monochrome bitmap */ +#define ftc_image_mono ftc_image_format_bitmap | \ + ftc_image_flag_monochrome + + /* anti-aliased bitmap */ +#define ftc_image_grays ftc_image_format_bitmap + + /* scaled outline */ +#define ftc_image_outline ftc_image_format_outline + + + /*************************************************************************/ + /* */ + /* */ + /* FTC_Image_Desc */ + /* */ + /* */ + /* THIS TYPE IS DEPRECATED. Use @FTC_ImageTypeRec instead. */ + /* */ + /* A simple structure used to describe a given glyph image category. */ + /* */ + /* */ + /* font :: An @FTC_FontRec used to describe the glyph's face */ + /* and size. */ + /* */ + /* image_type :: The glyph image's type. */ + /* */ + typedef struct FTC_Image_Desc_ + { + FTC_FontRec font; + FT_UInt image_type; + + } FTC_Image_Desc; + + + /*************************************************************************/ + /* */ + /* */ + /* FTC_Image_Cache */ + /* */ + /* */ + /* THIS TYPE IS DEPRECATED. Use @FTC_ImageCache instead. */ + /* */ + typedef FTC_ImageCache FTC_Image_Cache; + + + /*************************************************************************/ + /* */ + /* */ + /* FTC_Image_Cache_New */ + /* */ + /* */ + /* THIS FUNCTION IS DEPRECATED. Use @FTC_ImageCache_New instead. */ + /* */ + /* Creates a new glyph image cache. */ + /* */ + /* */ + /* manager :: The parent manager for the image cache. */ + /* */ + /* */ + /* acache :: A handle to the new glyph image cache object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FTC_Image_Cache_New( FTC_Manager manager, + FTC_Image_Cache *acache ); + + + /*************************************************************************/ + /* */ + /* */ + /* FTC_Image_Cache_Lookup */ + /* */ + /* */ + /* THIS FUNCTION IS DEPRECATED. Use @FTC_ImageCache_Lookup instead. */ + /* */ + /* */ + /* cache :: A handle to the source glyph image cache. */ + /* */ + /* desc :: A pointer to a glyph image descriptor. */ + /* */ + /* gindex :: The glyph index to retrieve. */ + /* */ + /* */ + /* aglyph :: The corresponding @FT_Glyph object. 0 in case of */ + /* failure. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* The returned glyph is owned and managed by the glyph image cache. */ + /* Never try to transform or discard it manually! You can however */ + /* create a copy with @FT_Glyph_Copy and modify the new one. */ + /* */ + /* Because the glyph image cache limits the total amount of memory */ + /* taken by the glyphs it holds, the returned glyph might disappear */ + /* on a later invocation of this function! It is a cache after */ + /* all... */ + /* */ + /* Use this function to "lock" the glyph as long as it is needed. */ + /* */ + FT_EXPORT( FT_Error ) + FTC_Image_Cache_Lookup( FTC_Image_Cache cache, + FTC_Image_Desc* desc, + FT_UInt gindex, + FT_Glyph *aglyph ); /* */ FT_END_HEADER + #endif /* __FTCIMAGE_H__ */ diff --git a/reactos/lib/freetype/include/freetype/cache/ftcmanag.h b/reactos/lib/freetype/include/freetype/cache/ftcmanag.h index 52658482286..97c77591b8d 100644 --- a/reactos/lib/freetype/include/freetype/cache/ftcmanag.h +++ b/reactos/lib/freetype/include/freetype/cache/ftcmanag.h @@ -4,7 +4,7 @@ /* */ /* FreeType Cache Manager (specification). */ /* */ -/* Copyright 2000-2001, 2003, 2004 by */ +/* Copyright 2000-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -65,7 +65,7 @@ #include #include FT_CACHE_H -#include FT_CACHE_INTERNAL_MRU_H +#include FT_CACHE_INTERNAL_LRU_H #include FT_CACHE_INTERNAL_CACHE_H @@ -88,25 +88,91 @@ FT_BEGIN_HEADER #define FTC_MAX_CACHES 16 + typedef struct FTC_FamilyEntryRec_ + { + FTC_Family family; + FTC_Cache cache; + FT_UInt index; + FT_UInt link; + + } FTC_FamilyEntryRec, *FTC_FamilyEntry; + + +#define FTC_FAMILY_ENTRY_NONE ( (FT_UInt)-1 ) + + + typedef struct FTC_FamilyTableRec_ + { + FT_UInt count; + FT_UInt size; + FTC_FamilyEntry entries; + FT_UInt free; + + } FTC_FamilyTableRec, *FTC_FamilyTable; + + + FT_EXPORT( FT_Error ) + ftc_family_table_alloc( FTC_FamilyTable table, + FT_Memory memory, + FTC_FamilyEntry *aentry ); + + FT_EXPORT( void ) + ftc_family_table_free( FTC_FamilyTable table, + FT_UInt idx ); + + + /*************************************************************************/ + /* */ + /* */ + /* FTC_ManagerRec */ + /* */ + /* */ + /* The cache manager structure. */ + /* */ + /* */ + /* library :: A handle to a FreeType library instance. */ + /* */ + /* faces_list :: The lru list of @FT_Face objects in the cache. */ + /* */ + /* sizes_list :: The lru list of @FT_Size objects in the cache. */ + /* */ + /* max_weight :: The maximum cache pool weight. */ + /* */ + /* cur_weight :: The current cache pool weight. */ + /* */ + /* num_nodes :: The current number of nodes in the manager. */ + /* */ + /* nodes_list :: The global lru list of all cache nodes. */ + /* */ + /* caches :: A table of installed/registered cache objects. */ + /* */ + /* request_data :: User-provided data passed to the requester. */ + /* */ + /* request_face :: User-provided function used to implement a mapping */ + /* between abstract @FTC_FaceID values and real */ + /* @FT_Face objects. */ + /* */ + /* families :: Global table of families. */ + /* */ typedef struct FTC_ManagerRec_ { FT_Library library; - FT_Memory memory; + FT_LruList faces_list; + FT_LruList sizes_list; - FTC_Node nodes_list; FT_ULong max_weight; FT_ULong cur_weight; + FT_UInt num_nodes; - + FTC_Node nodes_list; + FTC_Cache caches[FTC_MAX_CACHES]; - FT_UInt num_caches; - - FTC_MruListRec faces; - FTC_MruListRec sizes; FT_Pointer request_data; FTC_Face_Requester request_face; + FTC_FamilyTableRec families; + } FTC_ManagerRec; @@ -135,40 +201,43 @@ FT_BEGIN_HEADER FTC_Manager_Compress( FTC_Manager manager ); - /* try to flush `count' old nodes from the cache; return the number - * of really flushed nodes - */ - FT_EXPORT( FT_UInt ) - FTC_Manager_FlushN( FTC_Manager manager, - FT_UInt count ); - - /* this must be used internally for the moment */ FT_EXPORT( FT_Error ) - FTC_Manager_RegisterCache( FTC_Manager manager, - FTC_CacheClass clazz, - FTC_Cache *acache ); + FTC_Manager_Register_Cache( FTC_Manager manager, + FTC_Cache_Class clazz, + FTC_Cache *acache ); - /* */ -#define FTC_SCALER_COMPARE( a, b ) \ - ( (a)->face_id == (b)->face_id && \ - (a)->width == (b)->width && \ - (a)->height == (b)->height && \ - ((a)->pixel != 0) == ((b)->pixel != 0) && \ - ( (a)->pixel || \ - ( (a)->x_res == (b)->x_res && \ - (a)->y_res == (b)->y_res ) ) ) + /* can be called to increment a node's reference count */ + FT_EXPORT( void ) + FTC_Node_Ref( FTC_Node node, + FTC_Manager manager ); -#define FTC_SCALER_HASH( q ) \ - ( FTC_FACE_ID_HASH( (q)->face_id ) + \ - (q)->width + (q)->height*7 + \ - ( (q)->pixel ? 0 : ( (q)->x_res*33 ^ (q)->y_res*61 ) ) ) + + /*************************************************************************/ + /* */ + /* */ + /* FTC_Node_Unref */ + /* */ + /* */ + /* Decrement a cache node's internal reference count. When the count */ + /* reaches 0, it is not destroyed but becomes eligible for subsequent */ + /* cache flushes. */ + /* */ + /* */ + /* node :: The cache node handle. */ + /* */ + /* manager :: The cache manager handle. */ + /* */ + FT_EXPORT( void ) + FTC_Node_Unref( FTC_Node node, + FTC_Manager manager ); /* */ FT_END_HEADER + #endif /* __FTCMANAG_H__ */ diff --git a/reactos/lib/freetype/include/freetype/cache/ftcmru.h b/reactos/lib/freetype/include/freetype/cache/ftcmru.h deleted file mode 100644 index 9556f58e75e..00000000000 --- a/reactos/lib/freetype/include/freetype/cache/ftcmru.h +++ /dev/null @@ -1,246 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftcmru.h */ -/* */ -/* Simple MRU list-cache (specification). */ -/* */ -/* Copyright 2000-2001, 2003, 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* An MRU is a list that cannot hold more than a certain number of */ - /* elements (`max_elements'). All elements in the list are sorted in */ - /* least-recently-used order, i.e., the `oldest' element is at the tail */ - /* of the list. */ - /* */ - /* When doing a lookup (either through `Lookup()' or `Lookup_Node()'), */ - /* the list is searched for an element with the corresponding key. If */ - /* it is found, the element is moved to the head of the list and is */ - /* returned. */ - /* */ - /* If no corresponding element is found, the lookup routine will try to */ - /* obtain a new element with the relevant key. If the list is already */ - /* full, the oldest element from the list is discarded and replaced by a */ - /* new one; a new element is added to the list otherwise. */ - /* */ - /* Note that it is possible to pre-allocate the element list nodes. */ - /* This is handy if `max_elements' is sufficiently small, as it saves */ - /* allocations/releases during the lookup process. */ - /* */ - /*************************************************************************/ - - -#ifndef __FTCMRU_H__ -#define __FTCMRU_H__ - - -#include -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - -#define xxFT_DEBUG_ERROR -#define FTC_INLINE - -FT_BEGIN_HEADER - - typedef struct FTC_MruNodeRec_* FTC_MruNode; - - typedef struct FTC_MruNodeRec_ - { - FTC_MruNode next; - FTC_MruNode prev; - - } FTC_MruNodeRec; - - - FT_EXPORT( void ) - FTC_MruNode_Prepend( FTC_MruNode *plist, - FTC_MruNode node ); - - FT_EXPORT( void ) - FTC_MruNode_Up( FTC_MruNode *plist, - FTC_MruNode node ); - - FT_EXPORT( void ) - FTC_MruNode_Remove( FTC_MruNode *plist, - FTC_MruNode node ); - - - typedef struct FTC_MruListRec_* FTC_MruList; - - typedef struct FTC_MruListClassRec_ const * FTC_MruListClass; - - - typedef FT_Int - (*FTC_MruNode_CompareFunc)( FTC_MruNode node, - FT_Pointer key ); - - typedef FT_Error - (*FTC_MruNode_InitFunc)( FTC_MruNode node, - FT_Pointer key, - FT_Pointer data ); - - typedef FT_Error - (*FTC_MruNode_ResetFunc)( FTC_MruNode node, - FT_Pointer key, - FT_Pointer data ); - - typedef void - (*FTC_MruNode_DoneFunc)( FTC_MruNode node, - FT_Pointer data ); - - - typedef struct FTC_MruListClassRec_ - { - FT_UInt node_size; - FTC_MruNode_CompareFunc node_compare; - FTC_MruNode_InitFunc node_init; - FTC_MruNode_ResetFunc node_reset; - FTC_MruNode_DoneFunc node_done; - - } FTC_MruListClassRec; - - typedef struct FTC_MruListRec_ - { - FT_UInt num_nodes; - FT_UInt max_nodes; - FTC_MruNode nodes; - FT_Pointer data; - FTC_MruListClassRec clazz; - FT_Memory memory; - - } FTC_MruListRec; - - - FT_EXPORT( void ) - FTC_MruList_Init( FTC_MruList list, - FTC_MruListClass clazz, - FT_UInt max_nodes, - FT_Pointer data, - FT_Memory memory ); - - FT_EXPORT( void ) - FTC_MruList_Reset( FTC_MruList list ); - - - FT_EXPORT( void ) - FTC_MruList_Done( FTC_MruList list ); - - FT_EXPORT( FTC_MruNode ) - FTC_MruList_Find( FTC_MruList list, - FT_Pointer key ); - - FT_EXPORT( FT_Error ) - FTC_MruList_New( FTC_MruList list, - FT_Pointer key, - FTC_MruNode *anode ); - - FT_EXPORT( FT_Error ) - FTC_MruList_Lookup( FTC_MruList list, - FT_Pointer key, - FTC_MruNode *pnode ); - - - FT_EXPORT( void ) - FTC_MruList_Remove( FTC_MruList list, - FTC_MruNode node ); - - FT_EXPORT( void ) - FTC_MruList_RemoveSelection( FTC_MruList list, - FTC_MruNode_CompareFunc selection, - FT_Pointer key ); - - -#ifdef FTC_INLINE - -#define FTC_MRULIST_LOOKUP_CMP( list, key, compare, node, error ) \ - FT_BEGIN_STMNT \ - FTC_MruNode* _pfirst = &(list)->nodes; \ - FTC_MruNode_CompareFunc _compare = (FTC_MruNode_CompareFunc)(compare); \ - FTC_MruNode _first, _node; \ - \ - \ - error = 0; \ - _first = *(_pfirst); \ - _node = NULL; \ - \ - if ( _first ) \ - { \ - _node = _first; \ - do \ - { \ - if ( _compare( _node, (key) ) ) \ - { \ - if ( _node != _first ) \ - FTC_MruNode_Up( _pfirst, _node ); \ - \ - *(FTC_MruNode*)&(node) = _node; \ - goto _MruOk; \ - } \ - _node = _node->next; \ - \ - } while ( _node != _first) ; \ - } \ - \ - error = FTC_MruList_New( (list), (key), (FTC_MruNode*)&(node) ); \ - _MruOk: \ - ; \ - FT_END_STMNT - -#define FTC_MRULIST_LOOKUP( list, key, node, error ) \ - FTC_MRULIST_LOOKUP_CMP( list, key, (list)->clazz.node_compare, node, error ) - -#else /* !FTC_INLINE */ - -#define FTC_MRULIST_LOOKUP( list, key, node, error ) \ - error = FTC_MruList_Lookup( (list), (key), (FTC_MruNode*)&(node) ) - -#endif /* !FTC_INLINE */ - - -#define FTC_MRULIST_LOOP( list, node ) \ - FT_BEGIN_STMNT \ - FTC_MruNode _first = (list)->nodes; \ - \ - \ - if ( _first ) \ - { \ - FTC_MruNode _node = _first; \ - \ - \ - do \ - { \ - *(FTC_MruNode*)&(node) = _node; - - -#define FTC_MRULIST_LOOP_END() \ - _node = _node->next; \ - \ - } while ( _node != _first ); \ - } \ - FT_END_STMNT - - /* */ - -FT_END_HEADER - - -#endif /* __FTCMRU_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/cache/ftcsbits.h b/reactos/lib/freetype/include/freetype/cache/ftcsbits.h index b2ef0f1818d..6f8ef99cf78 100644 --- a/reactos/lib/freetype/include/freetype/cache/ftcsbits.h +++ b/reactos/lib/freetype/include/freetype/cache/ftcsbits.h @@ -4,7 +4,7 @@ /* */ /* A small-bitmap cache (specification). */ /* */ -/* Copyright 2000-2001, 2002, 2003 by */ +/* Copyright 2000-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,72 +22,251 @@ #include #include FT_CACHE_H -#include FT_CACHE_INTERNAL_GLYPH_H +#include FT_CACHE_IMAGE_H FT_BEGIN_HEADER -#define FTC_SBIT_ITEMS_PER_NODE 16 - typedef struct FTC_SNodeRec_ + /*************************************************************************/ + /* */ + /*
*/ + /* cache_subsystem */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* FTC_SBit */ + /* */ + /* */ + /* A handle to a small bitmap descriptor. See the @FTC_SBitRec */ + /* structure for details. */ + /* */ + typedef struct FTC_SBitRec_* FTC_SBit; + + + /*************************************************************************/ + /* */ + /* */ + /* FTC_SBitRec */ + /* */ + /* */ + /* A very compact structure used to describe a small glyph bitmap. */ + /* */ + /* */ + /* width :: The bitmap width in pixels. */ + /* */ + /* height :: The bitmap height in pixels. */ + /* */ + /* left :: The horizontal distance from the pen position to the */ + /* left bitmap border (a.k.a. `left side bearing', or */ + /* `lsb'). */ + /* */ + /* top :: The vertical distance from the pen position (on the */ + /* baseline) to the upper bitmap border (a.k.a. `top */ + /* side bearing'). The distance is positive for upwards */ + /* Y coordinates. */ + /* */ + /* format :: The format of the glyph bitmap (monochrome or gray). */ + /* */ + /* max_grays :: Maximum gray level value (in the range 1 to 255). */ + /* */ + /* pitch :: The number of bytes per bitmap line. May be positive */ + /* or negative. */ + /* */ + /* xadvance :: The horizontal advance width in pixels. */ + /* */ + /* yadvance :: The vertical advance height in pixels. */ + /* */ + /* buffer :: A pointer to the bitmap pixels. */ + /* */ + typedef struct FTC_SBitRec_ { - FTC_GNodeRec gnode; - FT_UInt count; - FTC_SBitRec sbits[FTC_SBIT_ITEMS_PER_NODE]; + FT_Byte width; + FT_Byte height; + FT_Char left; + FT_Char top; - } FTC_SNodeRec, *FTC_SNode; + FT_Byte format; + FT_Byte max_grays; + FT_Short pitch; + FT_Char xadvance; + FT_Char yadvance; + + FT_Byte* buffer; + + } FTC_SBitRec; -#define FTC_SNODE( x ) ( (FTC_SNode)( x ) ) -#define FTC_SNODE_GINDEX( x ) FTC_GNODE( x )->gindex -#define FTC_SNODE_FAMILY( x ) FTC_GNODE( x )->family - - typedef FT_UInt - (*FTC_SFamily_GetCountFunc)( FTC_Family family, - FTC_Manager manager ); - - typedef FT_Error - (*FTC_SFamily_LoadGlyphFunc)( FTC_Family family, - FT_UInt gindex, - FTC_Manager manager, - FT_Face *aface ); - - typedef struct FTC_SFamilyClassRec_ - { - FTC_MruListClassRec clazz; - FTC_SFamily_GetCountFunc family_get_count; - FTC_SFamily_LoadGlyphFunc family_load_glyph; - - } FTC_SFamilyClassRec; - - typedef const FTC_SFamilyClassRec* FTC_SFamilyClass; - -#define FTC_SFAMILY_CLASS( x ) ((FTC_SFamilyClass)(x)) - -#define FTC_CACHE__SFAMILY_CLASS( x ) \ - FTC_SFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS( x )->family_class ) + /*************************************************************************/ + /* */ + /* */ + /* FTC_SBitCache */ + /* */ + /* */ + /* A handle to a small bitmap cache. These are special cache objects */ + /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */ + /* much more efficient way than the traditional glyph image cache */ + /* implemented by @FTC_ImageCache. */ + /* */ + typedef struct FTC_SBitCacheRec_* FTC_SBitCache; - FT_EXPORT( void ) - FTC_SNode_Free( FTC_SNode snode, - FTC_Cache cache ); + /*************************************************************************/ + /* */ + /* */ + /* FTC_SBit_Cache */ + /* */ + /* */ + /* DEPRECATED. Use @FTC_SBitCache instead. */ + /* */ + typedef FTC_SBitCache FTC_SBit_Cache; + + /*************************************************************************/ + /* */ + /* */ + /* FTC_SBitCache_New */ + /* */ + /* */ + /* Creates a new cache to store small glyph bitmaps. */ + /* */ + /* */ + /* manager :: A handle to the source cache manager. */ + /* */ + /* */ + /* acache :: A handle to the new sbit cache. NULL in case of error. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ FT_EXPORT( FT_Error ) - FTC_SNode_New( FTC_SNode *psnode, - FTC_GQuery gquery, - FTC_Cache cache ); - - FT_EXPORT( FT_ULong ) - FTC_SNode_Weight( FTC_SNode inode ); + FTC_SBitCache_New( FTC_Manager manager, + FTC_SBitCache *acache ); - FT_EXPORT( FT_Bool ) - FTC_SNode_Compare( FTC_SNode snode, - FTC_GQuery gquery, - FTC_Cache cache ); + /*************************************************************************/ + /* */ + /* */ + /* FTC_SBitCache_Lookup */ + /* */ + /* */ + /* Looks up a given small glyph bitmap in a given sbit cache and */ + /* "lock" it to prevent its flushing from the cache until needed */ + /* */ + /* */ + /* cache :: A handle to the source sbit cache. */ + /* */ + /* type :: A pointer to the glyph image type descriptor. */ + /* */ + /* gindex :: The glyph index. */ + /* */ + /* */ + /* sbit :: A handle to a small bitmap descriptor. */ + /* */ + /* anode :: Used to return the address of of the corresponding cache */ + /* node after incrementing its reference count (see note */ + /* below). */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* The small bitmap descriptor and its bit buffer are owned by the */ + /* cache and should never be freed by the application. They might */ + /* as well disappear from memory on the next cache lookup, so don't */ + /* treat them as persistent data. */ + /* */ + /* The descriptor's `buffer' field is set to 0 to indicate a missing */ + /* glyph bitmap. */ + /* */ + /* If "anode" is _not_ NULL, it receives the address of the cache */ + /* node containing the bitmap, after increasing its reference count. */ + /* This ensures that the node (as well as the image) will always be */ + /* kept in the cache until you call @FTC_Node_Unref to "release" it. */ + /* */ + /* If "anode" is NULL, the cache node is left unchanged, which means */ + /* that the bitmap could be flushed out of the cache on the next */ + /* call to one of the caching sub-system APIs. Don't assume that it */ + /* is persistent! */ + /* */ + FT_EXPORT( FT_Error ) + FTC_SBitCache_Lookup( FTC_SBitCache cache, + FTC_ImageType type, + FT_UInt gindex, + FTC_SBit *sbit, + FTC_Node *anode ); + /* */ + + /*************************************************************************/ + /* */ + /* */ + /* FTC_SBit_Cache_New */ + /* */ + /* */ + /* DEPRECATED. Use @FTC_SBitCache_New instead. */ + /* */ + /* Creates a new cache to store small glyph bitmaps. */ + /* */ + /* */ + /* manager :: A handle to the source cache manager. */ + /* */ + /* */ + /* acache :: A handle to the new sbit cache. NULL in case of error. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FTC_SBit_Cache_New( FTC_Manager manager, + FTC_SBit_Cache *acache ); + + + /*************************************************************************/ + /* */ + /* */ + /* FTC_SBit_Cache_Lookup */ + /* */ + /* */ + /* DEPRECATED. Use @FTC_SBitCache_Lookup instead. */ + /* */ + /* Looks up a given small glyph bitmap in a given sbit cache. */ + /* */ + /* */ + /* cache :: A handle to the source sbit cache. */ + /* */ + /* desc :: A pointer to the glyph image descriptor. */ + /* */ + /* gindex :: The glyph index. */ + /* */ + /* */ + /* sbit :: A handle to a small bitmap descriptor. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* The small bitmap descriptor and its bit buffer are owned by the */ + /* cache and should never be freed by the application. They might */ + /* as well disappear from memory on the next cache lookup, so don't */ + /* treat them as persistent data. */ + /* */ + /* The descriptor's `buffer' field is set to 0 to indicate a missing */ + /* glyph bitmap. */ + /* */ + FT_EXPORT( FT_Error ) + FTC_SBit_Cache_Lookup( FTC_SBit_Cache cache, + FTC_Image_Desc* desc, + FT_UInt gindex, + FTC_SBit *sbit ); + + FT_END_HEADER #endif /* __FTCSBITS_H__ */ diff --git a/reactos/lib/freetype/include/freetype/config/ftconfig.h b/reactos/lib/freetype/include/freetype/config/ftconfig.h index d23b73e3937..4f5d7fe8e23 100644 --- a/reactos/lib/freetype/include/freetype/config/ftconfig.h +++ b/reactos/lib/freetype/include/freetype/config/ftconfig.h @@ -137,7 +137,7 @@ FT_BEGIN_HEADER #error "no 32bit type found -- please check your configuration files" #endif - /* look up an integer type that is at least 32 bits */ + /* now, lookup for an integer type that is at least 32 bits */ #if FT_SIZEOF_INT >= 4 typedef int FT_Fast; @@ -192,11 +192,6 @@ FT_BEGIN_HEADER #endif /* FT_SIZEOF_LONG == 8 */ -#define FT_BEGIN_STMNT do { -#define FT_END_STMNT } while ( 0 ) -#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT - - /*************************************************************************/ /* */ /* A 64-bit data type will create compilation problems if you compile */ diff --git a/reactos/lib/freetype/include/freetype/config/ftheader.h b/reactos/lib/freetype/include/freetype/config/ftheader.h index 52d18195cdb..2bd5bd61c27 100644 --- a/reactos/lib/freetype/include/freetype/config/ftheader.h +++ b/reactos/lib/freetype/include/freetype/config/ftheader.h @@ -4,7 +4,7 @@ /* */ /* Build macros of the FreeType 2 library. */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -281,7 +281,7 @@ /* A macro used in #include statements to name the file containing */ /* the module management API of FreeType 2. */ /* */ -#define FT_MODULE_H +#define FT_MODULE_H /*************************************************************************/ @@ -433,10 +433,7 @@ /* see the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need */ /* to store small glyph bitmaps, as it will use less memory. */ /* */ - /* This macro is deprecated. Simply include @FT_CACHE_H to have all */ - /* glyph image-related cache declarations. */ - /* */ -#define FT_CACHE_IMAGE_H FT_CACHE_H +#define FT_CACHE_IMAGE_H /*************************************************************************/ @@ -453,10 +450,7 @@ /* in @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, */ /* including scalable outlines. */ /* */ - /* This macro is deprecated. Simply include @FT_CACHE_H to have all */ - /* small bitmaps-related cache declarations. */ - /* */ -#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H +#define FT_CACHE_SMALL_BITMAPS_H /*************************************************************************/ @@ -468,10 +462,7 @@ /* A macro used in #include statements to name the file containing */ /* the `charmap' API of the FreeType 2 cache sub-system. */ /* */ - /* This macro is deprecated. Simply include @FT_CACHE_H to have all */ - /* charmap-based cache declarations. */ - /* */ -#define FT_CACHE_CHARMAP_H FT_CACHE_H +#define FT_CACHE_CHARMAP_H /*************************************************************************/ @@ -517,30 +508,26 @@ /* */ -#define FT_TRIGONOMETRY_H -#define FT_STROKER_H -#define FT_SYNTHESIS_H -#define FT_ERROR_DEFINITIONS_H +#define FT_TRIGONOMETRY_H +#define FT_STROKER_H +#define FT_SYNTHESIS_H +#define FT_ERROR_DEFINITIONS_H -#define FT_CACHE_MANAGER_H +#define FT_CACHE_MANAGER_H -#define FT_CACHE_INTERNAL_MRU_H -#define FT_CACHE_INTERNAL_MANAGER_H -#define FT_CACHE_INTERNAL_CACHE_H -#define FT_CACHE_INTERNAL_GLYPH_H -#define FT_CACHE_INTERNAL_IMAGE_H -#define FT_CACHE_INTERNAL_SBITS_H +#define FT_CACHE_INTERNAL_LRU_H +#define FT_CACHE_INTERNAL_GLYPH_H +#define FT_CACHE_INTERNAL_CACHE_H +#define FT_XFREE86_H -#define FT_XFREE86_H +#define FT_INCREMENTAL_H -#define FT_INCREMENTAL_H - -#define FT_TRUETYPE_UNPATENTED_H +#define FT_TRUETYPE_UNPATENTED_H /* now include internal headers definitions from */ -#define FT_INTERNAL_INTERNAL_H +#define FT_INTERNAL_INTERNAL_H #include FT_INTERNAL_INTERNAL_H diff --git a/reactos/lib/freetype/include/freetype/config/ftoption.h b/reactos/lib/freetype/include/freetype/config/ftoption.h index 0bf80453be2..0e02192c405 100644 --- a/reactos/lib/freetype/include/freetype/config/ftoption.h +++ b/reactos/lib/freetype/include/freetype/config/ftoption.h @@ -257,7 +257,7 @@ FT_BEGIN_HEADER /* The maximum number of modules that can be registered in a single */ /* FreeType library object. 32 is the default. */ /* */ -#define FT_MAX_MODULES 32767 +#define FT_MAX_MODULES 32 /*************************************************************************/ @@ -399,7 +399,7 @@ FT_BEGIN_HEADER /* Do not #undef this macro here, since the build system might */ /* define it for certain configurations only. */ /* */ - #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER +/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ /*************************************************************************/ @@ -411,7 +411,10 @@ FT_BEGIN_HEADER /* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook */ /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally actived */ /* */ -#define TT_CONFIG_OPTION_UNPATENTED_HINTING + /* XXX: WARNING: THIS DOESN'T WORK AS ADVERTISED YET. PLEASE DO NOT */ + /* DEFINE FOR THE MOMENT.. */ + /* */ +/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */ /*************************************************************************/ diff --git a/reactos/lib/freetype/include/freetype/config/ftstdlib.h b/reactos/lib/freetype/include/freetype/config/ftstdlib.h index 871590ffd93..7868fd402a1 100644 --- a/reactos/lib/freetype/include/freetype/config/ftstdlib.h +++ b/reactos/lib/freetype/include/freetype/config/ftstdlib.h @@ -5,7 +5,7 @@ /* ANSI-specific library and header configuration file (specification */ /* only). */ /* */ -/* Copyright 2002, 2003, 2004 by */ +/* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -73,11 +73,10 @@ #include -#define ft_isalnum isalnum -#define ft_isupper isupper -#define ft_islower islower -#define ft_isdigit isdigit -#define ft_isxdigit isxdigit +#define ft_isalnum isalnum +#define ft_isupper isupper +#define ft_islower islower +#define ft_xdigit isxdigit #include @@ -110,7 +109,7 @@ #define ft_qsort qsort #define ft_exit exit /* only used to exit from unhandled exceptions */ -#define ft_atol atol +#define ft_atoi atoi /**********************************************************************/ diff --git a/reactos/lib/freetype/include/freetype/freetype.h b/reactos/lib/freetype/include/freetype/freetype.h index ff7d987924e..413e6c6b270 100644 --- a/reactos/lib/freetype/include/freetype/freetype.h +++ b/reactos/lib/freetype/include/freetype/freetype.h @@ -16,15 +16,6 @@ /***************************************************************************/ -#ifndef FT_FREETYPE_H -#error "`ft2build.h' hasn't been included yet!" -#error "Please always use macros to include FreeType header files." -#error "Example:" -#error " #include " -#error " #include FT_FREETYPE_H" -#endif - - #ifndef __FREETYPE_H__ #define __FREETYPE_H__ @@ -44,7 +35,7 @@ /* */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 1 -#define FREETYPE_PATCH 8 +#define FREETYPE_PATCH 5 #include @@ -590,37 +581,6 @@ FT_BEGIN_HEADER /* the font file, for the cases when they are needed, with the Adobe */ /* values as well. */ /* */ - /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */ - /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ - /* FT_ENCODING_UNICODE). Use `FT_Get_BDF_Charset_ID' to find out */ - /* which encoding is really present. If, for example, the */ - /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */ - /* the font is encoded in KOI8-R. */ - /* */ - /* FT_ENCODING_NONE is always set (with a single exception) by the */ - /* winfonts driver. Use `FT_Get_WinFNT_Header' and examine the */ - /* `charset' field of the `FT_WinFNT_HeaderRec' structure to find out */ - /* which encoding is really present. For example, FT_WinFNT_ID_CP1251 */ - /* (204) means Windows code page 1251 (for Russian). */ - /* */ - /* FT_ENCODING_NONE is set if `platform_id' is `TT_PLATFORM_MACINTOSH' */ - /* and `encoding_id' is not `TT_MAC_ID_ROMAN' (otherwise it is set to */ - /* FT_ENCODING_APPLE_ROMAN). */ - /* */ - /* If `platform_id' is `TT_PLATFORM_MACINTOSH', use the function */ - /* `FT_Get_CMap_Language_ID' to query the Mac language ID which may be */ - /* needed to be able to distinguish Apple encoding variants. See */ - /* */ - /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */ - /* */ - /* to get an idea how to do that. Basically, if the language ID is 0, */ - /* dont use it, otherwise subtract 1 from the language ID. Then */ - /* examine `encoding_id'. If, for example, `encoding_id' is */ - /* `TT_MAC_ID_ROMAN' and the language ID (minus 1) is */ - /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ - /* `TT_MAC_ID_ARABIC' with `TT_MAC_LANGID_FARSI' means the Farsi */ - /* variant the Arabic encoding. */ - /* */ typedef enum FT_Encoding_ { FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ), @@ -972,7 +932,7 @@ FT_BEGIN_HEADER /* FT_FACE_FLAG_XXX */ /* */ /* */ - /* A list of bit flags used in the `face_flags' field of the */ + /* A list of bit flags used in the 'face_flags' field of the */ /* @FT_FaceRec structure. They inform client applications of */ /* properties of the corresponding face. */ /* */ @@ -2061,9 +2021,7 @@ FT_BEGIN_HEADER /* will be loaded. */ /* */ /* */ - /* glyph_index :: The index of the glyph in the font file. For */ - /* CID-keyed fonts (either in PS or in CFF format) */ - /* this argument specifies the CID value. */ + /* glyph_index :: The index of the glyph in the font file. */ /* */ /* load_flags :: A flag indicating what to load for this glyph. The */ /* @FT_LOAD_XXX constants can be used to control the */ diff --git a/reactos/lib/freetype/include/freetype/ftbbox.h b/reactos/lib/freetype/include/freetype/ftbbox.h index f98c89eb2d6..e6616135a2d 100644 --- a/reactos/lib/freetype/include/freetype/ftbbox.h +++ b/reactos/lib/freetype/include/freetype/ftbbox.h @@ -4,7 +4,7 @@ /* */ /* FreeType exact bbox computation (specification). */ /* */ -/* Copyright 1996-2001, 2003 by */ +/* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -34,12 +34,6 @@ #include #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/include/freetype/ftbdf.h b/reactos/lib/freetype/include/freetype/ftbdf.h index aa411440d96..3d2d04b3dc1 100644 --- a/reactos/lib/freetype/include/freetype/ftbdf.h +++ b/reactos/lib/freetype/include/freetype/ftbdf.h @@ -22,12 +22,6 @@ #include #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/include/freetype/ftcache.h b/reactos/lib/freetype/include/freetype/ftcache.h index c6dc14aeca2..fd13f5d0902 100644 --- a/reactos/lib/freetype/include/freetype/ftcache.h +++ b/reactos/lib/freetype/include/freetype/ftcache.h @@ -4,7 +4,7 @@ /* */ /* FreeType Cache subsystem (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -63,8 +63,8 @@ FT_BEGIN_HEADER /* FTC_Face_Requester */ /* */ /* FTC_Manager_New */ - /* FTC_Manager_LookupFace */ - /* FTC_Manager_LookupSize */ + /* FTC_Manager_Lookup_Face */ + /* FTC_Manager_Lookup_Size */ /* */ /* FTC_Node */ /* FTC_Node_Ref */ @@ -108,10 +108,10 @@ FT_BEGIN_HEADER /* FTC_FaceID */ /* */ /* */ - /* An opaque pointer type that is used to identity face objects. The */ + /* A generic pointer type that is used to identity face objects. The */ /* contents of such objects is application-dependent. */ /* */ - typedef struct FTC_FaceIDRec_* FTC_FaceID; + typedef FT_Pointer FTC_FaceID; /*************************************************************************/ @@ -257,16 +257,22 @@ FT_BEGIN_HEADER /* Creates a new cache manager. */ /* */ /* */ - /* library :: The parent FreeType library handle to use. */ + /* library :: The parent FreeType library handle to use. */ /* */ - /* max_bytes :: Maximum number of bytes to use for cached data. */ - /* Use 0 for defaults. */ + /* max_faces :: Maximum number of faces to keep alive in manager. */ + /* Use 0 for defaults. */ /* */ - /* requester :: An application-provided callback used to translate */ - /* face IDs into real @FT_Face objects. */ + /* max_sizes :: Maximum number of sizes to keep alive in manager. */ + /* Use 0 for defaults. */ /* */ - /* req_data :: A generic pointer that is passed to the requester */ - /* each time it is called (see @FTC_Face_Requester). */ + /* max_bytes :: Maximum number of bytes to use for cached data. */ + /* Use 0 for defaults. */ + /* */ + /* requester :: An application-provided callback used to translate */ + /* face IDs into real @FT_Face objects. */ + /* */ + /* req_data :: A generic pointer that is passed to the requester */ + /* each time it is called (see @FTC_Face_Requester). */ /* */ /* */ /* amanager :: A handle to a new manager object. 0 in case of */ @@ -319,7 +325,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ /* */ - /* FTC_Manager_LookupFace */ + /* FTC_Manager_Lookup_Face */ /* */ /* */ /* Retrieves the @FT_Face object that corresponds to a given face ID */ @@ -342,480 +348,64 @@ FT_BEGIN_HEADER /* */ /* The @FT_Face object doesn't necessarily have a current size object */ /* (i.e., face->size can be 0). If you need a specific `font size', */ - /* use @FTC_Manager_LookupSize instead. */ + /* use @FTC_Manager_Lookup_Size instead. */ /* */ /* Never change the face's transformation matrix (i.e., never call */ /* the @FT_Set_Transform function) on a returned face! If you need */ /* to transform glyphs, do it yourself after glyph loading. */ /* */ FT_EXPORT( FT_Error ) - FTC_Manager_LookupFace( FTC_Manager manager, - FTC_FaceID face_id, - FT_Face *aface ); - - - /*************************************************************************/ - /* */ - /* */ - /* FTC_ScalerRec */ - /* */ - /* */ - /* A structure used to describe a given character size in either */ - /* pixels or points to the cache manager. See */ - /* @FTC_Manager_LookupSize. */ - /* */ - /* */ - /* face_id :: The source face ID. */ - /* */ - /* width :: The character width. */ - /* */ - /* height :: The character height. */ - /* */ - /* pixel :: A Boolean. If TRUE, the `width' and `height' fields */ - /* are interpreted as integer pixel character sizes. */ - /* Otherwise, they are expressed as 1/64th of points. */ - /* */ - /* x_res :: Only used when `pixel' is FALSE to indicate the */ - /* horizontal resolution in dpi. */ - /* */ - /* y_res :: Only used when `pixel' is FALSE to indicate the */ - /* vertical resolution in dpi. */ - /* */ - /* */ - /* This type is mainly used to retrieve @FT_Size objects through the */ - /* cache manager. */ - /* */ - typedef struct FTC_ScalerRec_ - { - FTC_FaceID face_id; - FT_UInt width; - FT_UInt height; - FT_Int pixel; - FT_UInt x_res; - FT_UInt y_res; - - } FTC_ScalerRec, *FTC_Scaler; + FTC_Manager_Lookup_Face( FTC_Manager manager, + FTC_FaceID face_id, + FT_Face *aface ); /*************************************************************************/ /* */ /* */ - /* FTC_Manager_LookupSize */ + /* FTC_Manager_Lookup_Size */ /* */ /* */ - /* Retrieve the @FT_Size object that corresponds to a given */ - /* @FTC_Scaler through a cache manager. */ + /* Retrieves the @FT_Face and @FT_Size objects that correspond to a */ + /* given font. */ /* */ /* */ /* manager :: A handle to the cache manager. */ /* */ - /* scaler :: A scaler handle. */ + /* font :: The font to use. */ /* */ /* */ - /* asize :: A handle to the size object. */ + /* aface :: A pointer to the handle of the face object. Set it to */ + /* zero if you don't need it. */ + /* */ + /* asize :: A pointer to the handle of the size object. Set it to */ + /* zero if you don't need it. */ /* */ /* */ /* FreeType error code. 0 means success. */ /* */ /* */ - /* The returned @FT_Size object is always owned by the manager. You */ - /* should never try to discard it by yourself. */ + /* The returned @FT_Face object is always owned by the manager. You */ + /* should never try to discard it yourself. */ /* */ - /* You can access the parent @FT_Face object simply as `size->face' */ - /* if you need it. Note that this object is also owned by the */ - /* manager. */ + /* Never change the face's transformation matrix (i.e., never call */ + /* the @FT_Set_Transform function) on a returned face! If you need */ + /* to transform glyphs, do it yourself after glyph loading. */ + /* */ + /* Similarly, the returned @FT_Size object is always owned by the */ + /* manager. You should never try to discard it, and never change its */ + /* settings with @FT_Set_Pixel_Sizes or @FT_Set_Char_Size! */ + /* */ + /* The returned size object is the face's current size, which means */ + /* that you can call @FT_Load_Glyph with the face if you need to. */ /* */ FT_EXPORT( FT_Error ) - FTC_Manager_LookupSize( FTC_Manager manager, - FTC_Scaler scaler, - FT_Size *asize ); + FTC_Manager_Lookup_Size( FTC_Manager manager, + FTC_Font font, + FT_Face *aface, + FT_Size *asize ); - /*************************************************************************/ - /* */ - /* */ - /* FTC_Node_Unref */ - /* */ - /* */ - /* Decrement a cache node's internal reference count. When the count */ - /* reaches 0, it is not destroyed but becomes eligible for subsequent */ - /* cache flushes. */ - /* */ - /* */ - /* node :: The cache node handle. */ - /* */ - /* manager :: The cache manager handle. */ - /* */ - FT_EXPORT( void ) - FTC_Node_Unref( FTC_Node node, - FTC_Manager manager ); - - - /* remove all nodes belonging to a given face_id */ - FT_EXPORT( void ) - FTC_Manager_RemoveFaceID( FTC_Manager manager, - FTC_FaceID face_id ); - - - /*************************************************************************/ - /* */ - /*
*/ - /* cache_subsystem */ - /* */ - /*************************************************************************/ - - /************************************************************************ - * - * @type: - * FTC_CMapCache - * - * @description: - * An opaque handle used to manager a charmap cache. This cache is - * to hold character codes -> glyph indices mappings. - */ - typedef struct FTC_CMapCacheRec_* FTC_CMapCache; - - - /*************************************************************************/ - /* */ - /* @function: */ - /* FTC_CMapCache_New */ - /* */ - /* @description: */ - /* Create a new charmap cache. */ - /* */ - /* @input: */ - /* manager :: A handle to the cache manager. */ - /* */ - /* @output: */ - /* acache :: A new cache handle. NULL in case of error. */ - /* */ - /* @return: */ - /* FreeType error code. 0 means success. */ - /* */ - /* @note: */ - /* Like all other caches, this one will be destroyed with the cache */ - /* manager. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_CMapCache_New( FTC_Manager manager, - FTC_CMapCache *acache ); - - - /* retrieve the index of a given charmap */ - FT_EXPORT( FT_Int ) - FT_Get_CharMap_Index( FT_CharMap charmap ); - - - /*************************************************************************/ - /* */ - /* @function: */ - /* FTC_CMapCache_Lookup */ - /* */ - /* @description: */ - /* Translate a character code into a glyph index, using the charmap */ - /* cache. */ - /* */ - /* @input: */ - /* cache :: A charmap cache handle. */ - /* */ - /* face_id :: source face id */ - /* */ - /* cmap_index :: index of charmap in source face */ - /* */ - /* char_code :: The character code (in the corresponding charmap). */ - /* */ - /* @return: */ - /* Glyph index. 0 means `no glyph'. */ - /* */ - FT_EXPORT( FT_UInt ) - FTC_CMapCache_Lookup( FTC_CMapCache cache, - FTC_FaceID face_id, - FT_Int cmap_index, - FT_UInt32 char_code ); - - - /*************************************************************************/ - /* */ - /*
*/ - /* cache_subsystem */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** IMAGE CACHE OBJECT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - typedef struct FTC_ImageTypeRec_ - { - FTC_FaceID face_id; - FT_Int width; - FT_Int height; - FT_Int32 flags; - - } FTC_ImageTypeRec; - - typedef struct FTC_ImageTypeRec_* FTC_ImageType; - - /* */ - -#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \ - ( FTC_FONT_COMPARE( &(d1)->font, &(d2)->font ) && \ - (d1)->flags == (d2)->flags ) - -#define FTC_IMAGE_TYPE_HASH( d ) \ - (FT_UFast)( FTC_FONT_HASH( &(d)->font ) ^ \ - ( (d)->flags << 4 ) ) - - - /*************************************************************************/ - /* */ - /* */ - /* FTC_ImageCache */ - /* */ - /* */ - /* A handle to an glyph image cache object. They are designed to */ - /* hold many distinct glyph images while not exceeding a certain */ - /* memory threshold. */ - /* */ - typedef struct FTC_ImageCacheRec_* FTC_ImageCache; - - - /*************************************************************************/ - /* */ - /* */ - /* FTC_ImageCache_New */ - /* */ - /* */ - /* Creates a new glyph image cache. */ - /* */ - /* */ - /* manager :: The parent manager for the image cache. */ - /* */ - /* */ - /* acache :: A handle to the new glyph image cache object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_ImageCache_New( FTC_Manager manager, - FTC_ImageCache *acache ); - - - /*************************************************************************/ - /* */ - /* */ - /* FTC_ImageCache_Lookup */ - /* */ - /* */ - /* Retrieves a given glyph image from a glyph image cache. */ - /* */ - /* */ - /* cache :: A handle to the source glyph image cache. */ - /* */ - /* type :: A pointer to a glyph image type descriptor. */ - /* */ - /* gindex :: The glyph index to retrieve. */ - /* */ - /* */ - /* aglyph :: The corresponding @FT_Glyph object. 0 in case of */ - /* failure. */ - /* */ - /* anode :: Used to return the address of of the corresponding cache */ - /* node after incrementing its reference count (see note */ - /* below). */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* The returned glyph is owned and managed by the glyph image cache. */ - /* Never try to transform or discard it manually! You can however */ - /* create a copy with @FT_Glyph_Copy and modify the new one. */ - /* */ - /* If `anode' is _not_ NULL, it receives the address of the cache */ - /* node containing the glyph image, after increasing its reference */ - /* count. This ensures that the node (as well as the FT_Glyph) will */ - /* always be kept in the cache until you call @FTC_Node_Unref to */ - /* `release' it. */ - /* */ - /* If `anode' is NULL, the cache node is left unchanged, which means */ - /* that the FT_Glyph could be flushed out of the cache on the next */ - /* call to one of the caching sub-system APIs. Don't assume that it */ - /* is persistent! */ - /* */ - FT_EXPORT( FT_Error ) - FTC_ImageCache_Lookup( FTC_ImageCache cache, - FTC_ImageType type, - FT_UInt gindex, - FT_Glyph *aglyph, - FTC_Node *anode ); - - - /*************************************************************************/ - /* */ - /* */ - /* FTC_SBit */ - /* */ - /* */ - /* A handle to a small bitmap descriptor. See the @FTC_SBitRec */ - /* structure for details. */ - /* */ - typedef struct FTC_SBitRec_* FTC_SBit; - - - /*************************************************************************/ - /* */ - /* */ - /* FTC_SBitRec */ - /* */ - /* */ - /* A very compact structure used to describe a small glyph bitmap. */ - /* */ - /* */ - /* width :: The bitmap width in pixels. */ - /* */ - /* height :: The bitmap height in pixels. */ - /* */ - /* left :: The horizontal distance from the pen position to the */ - /* left bitmap border (a.k.a. `left side bearing', or */ - /* `lsb'). */ - /* */ - /* top :: The vertical distance from the pen position (on the */ - /* baseline) to the upper bitmap border (a.k.a. `top */ - /* side bearing'). The distance is positive for upwards */ - /* Y coordinates. */ - /* */ - /* format :: The format of the glyph bitmap (monochrome or gray). */ - /* */ - /* max_grays :: Maximum gray level value (in the range 1 to 255). */ - /* */ - /* pitch :: The number of bytes per bitmap line. May be positive */ - /* or negative. */ - /* */ - /* xadvance :: The horizontal advance width in pixels. */ - /* */ - /* yadvance :: The vertical advance height in pixels. */ - /* */ - /* buffer :: A pointer to the bitmap pixels. */ - /* */ - typedef struct FTC_SBitRec_ - { - FT_Byte width; - FT_Byte height; - FT_Char left; - FT_Char top; - - FT_Byte format; - FT_Byte max_grays; - FT_Short pitch; - FT_Char xadvance; - FT_Char yadvance; - - FT_Byte* buffer; - - } FTC_SBitRec; - - - /*************************************************************************/ - /* */ - /* */ - /* FTC_SBitCache */ - /* */ - /* */ - /* A handle to a small bitmap cache. These are special cache objects */ - /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */ - /* much more efficient way than the traditional glyph image cache */ - /* implemented by @FTC_ImageCache. */ - /* */ - typedef struct FTC_SBitCacheRec_* FTC_SBitCache; - - - /*************************************************************************/ - /* */ - /* */ - /* FTC_SBitCache_New */ - /* */ - /* */ - /* Creates a new cache to store small glyph bitmaps. */ - /* */ - /* */ - /* manager :: A handle to the source cache manager. */ - /* */ - /* */ - /* acache :: A handle to the new sbit cache. NULL in case of error. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_EXPORT( FT_Error ) - FTC_SBitCache_New( FTC_Manager manager, - FTC_SBitCache *acache ); - - - /*************************************************************************/ - /* */ - /* */ - /* FTC_SBitCache_Lookup */ - /* */ - /* */ - /* Looks up a given small glyph bitmap in a given sbit cache and */ - /* `lock' it to prevent its flushing from the cache until needed. */ - /* */ - /* */ - /* cache :: A handle to the source sbit cache. */ - /* */ - /* type :: A pointer to the glyph image type descriptor. */ - /* */ - /* gindex :: The glyph index. */ - /* */ - /* */ - /* sbit :: A handle to a small bitmap descriptor. */ - /* */ - /* anode :: Used to return the address of of the corresponding cache */ - /* node after incrementing its reference count (see note */ - /* below). */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* The small bitmap descriptor and its bit buffer are owned by the */ - /* cache and should never be freed by the application. They might */ - /* as well disappear from memory on the next cache lookup, so don't */ - /* treat them as persistent data. */ - /* */ - /* The descriptor's `buffer' field is set to 0 to indicate a missing */ - /* glyph bitmap. */ - /* */ - /* If `anode' is _not_ NULL, it receives the address of the cache */ - /* node containing the bitmap, after increasing its reference count. */ - /* This ensures that the node (as well as the image) will always be */ - /* kept in the cache until you call @FTC_Node_Unref to `release' it. */ - /* */ - /* If `anode' is NULL, the cache node is left unchanged, which means */ - /* that the bitmap could be flushed out of the cache on the next */ - /* call to one of the caching sub-system APIs. Don't assume that it */ - /* is persistent! */ - /* */ - FT_EXPORT( FT_Error ) - FTC_SBitCache_Lookup( FTC_SBitCache cache, - FTC_ImageType type, - FT_UInt gindex, - FTC_SBit *sbit, - FTC_Node *anode ); - - - /* */ - FT_END_HEADER #endif /* __FTCACHE_H__ */ diff --git a/reactos/lib/freetype/include/freetype/ftglyph.h b/reactos/lib/freetype/include/freetype/ftglyph.h index 14050a21d90..9c2a999b964 100644 --- a/reactos/lib/freetype/include/freetype/ftglyph.h +++ b/reactos/lib/freetype/include/freetype/ftglyph.h @@ -36,12 +36,6 @@ #include #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER @@ -241,8 +235,7 @@ FT_BEGIN_HEADER /* FT_Glyph_Copy */ /* */ /* */ - /* A function used to copy a glyph image. Note that the created */ - /* @FT_Glyph object must be released with @FT_Done_Glyph. */ + /* A function used to copy a glyph image. */ /* */ /* */ /* source :: A handle to the source glyph object. */ @@ -479,7 +472,8 @@ FT_BEGIN_HEADER /* } */ /* */ /* */ - /* This function does nothing if the glyph format isn't scalable. */ + /* This function will always fail if the glyph's format isn't */ + /* scalable. */ /* */ FT_EXPORT( FT_Error ) FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, diff --git a/reactos/lib/freetype/include/freetype/ftgzip.h b/reactos/lib/freetype/include/freetype/ftgzip.h index 5d7228bb493..673b4885bc1 100644 --- a/reactos/lib/freetype/include/freetype/ftgzip.h +++ b/reactos/lib/freetype/include/freetype/ftgzip.h @@ -22,13 +22,6 @@ #include #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - FT_BEGIN_HEADER /*************************************************************************/ diff --git a/reactos/lib/freetype/include/freetype/ftimage.h b/reactos/lib/freetype/include/freetype/ftimage.h index 28759650770..d54ef2dec01 100644 --- a/reactos/lib/freetype/include/freetype/ftimage.h +++ b/reactos/lib/freetype/include/freetype/ftimage.h @@ -53,8 +53,8 @@ FT_BEGIN_HEADER /* */ /* The type FT_Pos is a 32-bit integer used to store vectorial */ /* coordinates. Depending on the context, these can represent */ - /* distances in integer font units, or 16,16, or 26.6 fixed float */ - /* pixel coordinates. */ + /* distances in integer font units, or 26.6 fixed float pixel */ + /* coordinates. */ /* */ typedef signed long FT_Pos; diff --git a/reactos/lib/freetype/include/freetype/ftincrem.h b/reactos/lib/freetype/include/freetype/ftincrem.h index 6a1aa1fc31a..e3477120e59 100644 --- a/reactos/lib/freetype/include/freetype/ftincrem.h +++ b/reactos/lib/freetype/include/freetype/ftincrem.h @@ -22,12 +22,6 @@ #include #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/include/freetype/ftlist.h b/reactos/lib/freetype/include/freetype/ftlist.h index ae9801b9d8f..1c5101700bb 100644 --- a/reactos/lib/freetype/include/freetype/ftlist.h +++ b/reactos/lib/freetype/include/freetype/ftlist.h @@ -4,7 +4,7 @@ /* */ /* Generic list support for FreeType (specification). */ /* */ -/* Copyright 1996-2001, 2003 by */ +/* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -31,12 +31,6 @@ #include #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/include/freetype/ftmm.h b/reactos/lib/freetype/include/freetype/ftmm.h index 7f565bef947..5e681b2c4fc 100644 --- a/reactos/lib/freetype/include/freetype/ftmm.h +++ b/reactos/lib/freetype/include/freetype/ftmm.h @@ -100,6 +100,21 @@ FT_BEGIN_HEADER /* */ + typedef FT_Error + (*FT_Get_MM_Func)( FT_Face face, + FT_Multi_Master* master ); + + typedef FT_Error + (*FT_Set_MM_Design_Func)( FT_Face face, + FT_UInt num_coords, + FT_Long* coords ); + + typedef FT_Error + (*FT_Set_MM_Blend_Func)( FT_Face face, + FT_UInt num_coords, + FT_Long* coords ); + + /*************************************************************************/ /* */ /* */ diff --git a/reactos/lib/freetype/include/freetype/ftmodapi.h b/reactos/lib/freetype/include/freetype/ftmodapi.h deleted file mode 100644 index caf081d6d09..00000000000 --- a/reactos/lib/freetype/include/freetype/ftmodapi.h +++ /dev/null @@ -1,314 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftmodule.h */ -/* */ -/* FreeType modules public interface (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTMODULE_H__ -#define __FTMODULE_H__ - - -#include -#include FT_FREETYPE_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /*
*/ - /* module_management */ - /* */ - /* */ - /* Module Management */ - /* */ - /* <Abstract> */ - /* How to add, upgrade, and remove modules from FreeType. */ - /* */ - /* <Description> */ - /* The definitions below are used to manage modules within FreeType. */ - /* Modules can be added, upgraded, and removed at runtime. */ - /* */ - /*************************************************************************/ - - - /* module bit flags */ -#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */ -#define FT_MODULE_RENDERER 2 /* this module is a renderer */ -#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */ -#define FT_MODULE_STYLER 8 /* this module is a styler */ - -#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ - /* scalable fonts */ -#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ - /* support vector outlines */ -#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ - /* own hinter */ - - - /* deprecated values */ -#define ft_module_font_driver FT_MODULE_FONT_DRIVER -#define ft_module_renderer FT_MODULE_RENDERER -#define ft_module_hinter FT_MODULE_HINTER -#define ft_module_styler FT_MODULE_STYLER - -#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE -#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES -#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER - - - typedef void - (*FT_Module_Interface)( void ); - - typedef FT_Error - (*FT_Module_Constructor)( FT_Module module ); - - typedef void - (*FT_Module_Destructor)( FT_Module module ); - - typedef FT_Module_Interface - (*FT_Module_Requester)( FT_Module module, - const char* name ); - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Module_Class */ - /* */ - /* <Description> */ - /* The module class descriptor. */ - /* */ - /* <Fields> */ - /* module_flags :: Bit flags describing the module. */ - /* */ - /* module_size :: The size of one module object/instance in */ - /* bytes. */ - /* */ - /* module_name :: The name of the module. */ - /* */ - /* module_version :: The version, as a 16.16 fixed number */ - /* (major.minor). */ - /* */ - /* module_requires :: The version of FreeType this module requires */ - /* (starts at version 2.0, i.e 0x20000) */ - /* */ - /* module_init :: A function used to initialize (not create) a */ - /* new module object. */ - /* */ - /* module_done :: A function used to finalize (not destroy) a */ - /* given module object */ - /* */ - /* get_interface :: Queries a given module for a specific */ - /* interface by name. */ - /* */ - typedef struct FT_Module_Class_ - { - FT_ULong module_flags; - FT_Long module_size; - const FT_String* module_name; - FT_Fixed module_version; - FT_Fixed module_requires; - - const void* module_interface; - - FT_Module_Constructor module_init; - FT_Module_Destructor module_done; - FT_Module_Requester get_interface; - - } FT_Module_Class; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Add_Module */ - /* */ - /* <Description> */ - /* Adds a new module to a given library instance. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library object. */ - /* */ - /* <Input> */ - /* clazz :: A pointer to class descriptor for the module. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - /* <Note> */ - /* An error will be returned if a module already exists by that name, */ - /* or if the module requires a version of FreeType that is too great. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Add_Module( FT_Library library, - const FT_Module_Class* clazz ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Module */ - /* */ - /* <Description> */ - /* Finds a module by its name. */ - /* */ - /* <Input> */ - /* library :: A handle to the library object. */ - /* */ - /* module_name :: The module's name (as an ASCII string). */ - /* */ - /* <Return> */ - /* A module handle. 0 if none was found. */ - /* */ - /* <Note> */ - /* You should better be familiar with FreeType internals to know */ - /* which module to look for :-) */ - /* */ - FT_EXPORT( FT_Module ) - FT_Get_Module( FT_Library library, - const char* module_name ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Remove_Module */ - /* */ - /* <Description> */ - /* Removes a given module from a library instance. */ - /* */ - /* <InOut> */ - /* library :: A handle to a library object. */ - /* */ - /* <Input> */ - /* module :: A handle to a module object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - /* <Note> */ - /* The module object is destroyed by the function in case of success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Remove_Module( FT_Library library, - FT_Module module ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Library */ - /* */ - /* <Description> */ - /* This function is used to create a new FreeType library instance */ - /* from a given memory object. It is thus possible to use libraries */ - /* with distinct memory allocators within the same program. */ - /* */ - /* <Input> */ - /* memory :: A handle to the original memory object. */ - /* */ - /* <Output> */ - /* alibrary :: A pointer to handle of a new library object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_New_Library( FT_Memory memory, - FT_Library *alibrary ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Done_Library */ - /* */ - /* <Description> */ - /* Discards a given library object. This closes all drivers and */ - /* discards all resource objects. */ - /* */ - /* <Input> */ - /* library :: A handle to the target library. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Done_Library( FT_Library library ); - - - - typedef void - (*FT_DebugHook_Func)( void* arg ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Set_Debug_Hook */ - /* */ - /* <Description> */ - /* Sets a debug hook function for debugging the interpreter of a font */ - /* format. */ - /* */ - /* <InOut> */ - /* library :: A handle to the library object. */ - /* */ - /* <Input> */ - /* hook_index :: The index of the debug hook. You should use the */ - /* values defined in ftobjs.h, e.g. */ - /* FT_DEBUG_HOOK_TRUETYPE. */ - /* */ - /* debug_hook :: The function used to debug the interpreter. */ - /* */ - /* <Note> */ - /* Currently, four debug hook slots are available, but only two (for */ - /* the TrueType and the Type 1 interpreter) are defined. */ - /* */ - FT_EXPORT( void ) - FT_Set_Debug_Hook( FT_Library library, - FT_UInt hook_index, - FT_DebugHook_Func debug_hook ); - - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Add_Default_Modules */ - /* */ - /* <Description> */ - /* Adds the set of default drivers to a given library object. */ - /* This is only useful when you create a library object with */ - /* FT_New_Library() (usually to plug a custom memory manager). */ - /* */ - /* <InOut> */ - /* library :: A handle to a new library object. */ - /* */ - FT_EXPORT( void ) - FT_Add_Default_Modules( FT_Library library ); - - - /* */ - - -FT_END_HEADER - -#endif /* __FTMODULE_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/ftoutln.h b/reactos/lib/freetype/include/freetype/ftoutln.h index 79ed35b5970..19b5724a5c8 100644 --- a/reactos/lib/freetype/include/freetype/ftoutln.h +++ b/reactos/lib/freetype/include/freetype/ftoutln.h @@ -5,7 +5,7 @@ /* Support for the FT_Outline type used to store glyph shapes of */ /* most scalable font formats (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -24,12 +24,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER @@ -395,72 +389,6 @@ FT_BEGIN_HEADER FT_Raster_Params* params ); - /************************************************************************** - * - * @enum: - * FT_Orientation - * - * @description: - * A list of values used to describe an outline's contour orientation. - * - * The TrueType and Postscript specifications use different conventions - * to determine whether outline contours should be filled or unfilled. - * - * @values: - * FT_ORIENTATION_TRUETYPE :: - * According to the TrueType specification, clockwise contours must - * be filled, and counter-clockwise ones must be unfilled. - * - * FT_ORIENTATION_POSTSCRIPT :: - * According to the Postscript specification, counter-clockwise contours - * must be filled, and clockwise ones must be unfilled. - * - * FT_ORIENTATION_FILL_RIGHT :: - * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to - * remember that in TrueType, everything that is to the right of - * the drawing direction of a contour must be filled. - * - * FT_ORIENTATION_FILL_LEFT :: - * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to - * remember that in Postscript, everything that is to the left of - * the drawing direction of a contour must be filled. - */ - typedef enum - { - FT_ORIENTATION_TRUETYPE = 0, - FT_ORIENTATION_POSTSCRIPT = 1, - FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE, - FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT - - } FT_Orientation; - - - /************************************************************************** - * - * @function: - * FT_Outline_Get_Orientation - * - * @description: - * This function analyzes a glyph outline and tries to compute its - * fill orientation (see @FT_Orientation). This is done by computing - * the direction of each global horizontal and/or vertical extrema - * within the outline. - * - * Note that this will return @FT_ORIENTATION_TRUETYPE for empty - * outlines. - * - * @input: - * outline :: - * A handle to the source outline. - * - * @return: - * The orientation. - * - */ - FT_EXPORT( FT_Orientation ) - FT_Outline_Get_Orientation( FT_Outline* outline ); - - /* */ diff --git a/reactos/lib/freetype/include/freetype/ftpfr.h b/reactos/lib/freetype/include/freetype/ftpfr.h index c9a5675445a..7b687dacc2e 100644 --- a/reactos/lib/freetype/include/freetype/ftpfr.h +++ b/reactos/lib/freetype/include/freetype/ftpfr.h @@ -22,12 +22,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/include/freetype/ftsizes.h b/reactos/lib/freetype/include/freetype/ftsizes.h index f0ec9159977..0fd6f0ffbaf 100644 --- a/reactos/lib/freetype/include/freetype/ftsizes.h +++ b/reactos/lib/freetype/include/freetype/ftsizes.h @@ -4,7 +4,7 @@ /* */ /* FreeType size objects management (specification). */ /* */ -/* Copyright 1996-2001, 2003 by */ +/* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -32,12 +32,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER @@ -107,9 +101,7 @@ FT_BEGIN_HEADER /* FT_Done_Size */ /* */ /* <Description> */ - /* Discards a given size object. Note that @FT_Done_Face */ - /* automatically discards all size objects allocated with */ - /* @FT_New_Size. */ + /* Discards a given size object. */ /* */ /* <Input> */ /* size :: A handle to a target size object. */ diff --git a/reactos/lib/freetype/include/freetype/ftsnames.h b/reactos/lib/freetype/include/freetype/ftsnames.h index 0e2d9a4adcc..356f9834904 100644 --- a/reactos/lib/freetype/include/freetype/ftsnames.h +++ b/reactos/lib/freetype/include/freetype/ftsnames.h @@ -7,7 +7,7 @@ /* */ /* This is _not_ used to retrieve glyph names! */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -26,12 +26,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/include/freetype/ftstroke.h b/reactos/lib/freetype/include/freetype/ftstroke.h index a3052e858e0..a92c68d622a 100644 --- a/reactos/lib/freetype/include/freetype/ftstroke.h +++ b/reactos/lib/freetype/include/freetype/ftstroke.h @@ -4,7 +4,7 @@ /* */ /* FreeType path stroker (specification). */ /* */ -/* Copyright 2002, 2003, 2004 by */ +/* Copyright 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -21,45 +21,42 @@ #include <ft2build.h> #include FT_OUTLINE_H -#include FT_GLYPH_H FT_BEGIN_HEADER - /*@************************************************************* - * - * @type: - * FT_Stroker - * - * @description: - * Opaque handler to a path stroker object. - */ - typedef struct FT_StrokerRec_* FT_Stroker; +/*@************************************************************* + * + * @type: FT_Stroker + * + * @description: + * opaque handler to a path stroker object + */ + typedef struct FT_StrokerRec_* FT_Stroker; - /*@************************************************************* - * - * @enum: - * FT_Stroker_LineJoin - * - * @description: - * These values determine how two joining lines are rendered - * in a stroker. - * - * @values: - * FT_STROKER_LINEJOIN_ROUND :: - * Used to render rounded line joins. Circular arcs are used - * to join two lines smoothly. - * - * FT_STROKER_LINEJOIN_BEVEL :: - * Used to render beveled line joins; i.e., the two joining lines - * are extended until they intersect. - * - * FT_STROKER_LINEJOIN_MITER :: - * Same as beveled rendering, except that an additional line - * break is added if the angle between the two joining lines - * is too closed (this is useful to avoid unpleasant spikes - * in beveled rendering). - */ +/*@************************************************************* + * + * @enum: FT_Stroker_LineJoin + * + * @description: + * these values determine how two joining lines are rendered + * in a stroker. + * + * @values: + * FT_STROKER_LINEJOIN_ROUND :: + * used to render rounded line joins. circular arcs are used + * to join two lines smoothly + * + * FT_STROKER_LINEJOIN_BEVEL :: + * used to render beveled line joins; i.e. the two joining lines + * are extended until they intersect + * + * FT_STROKER_LINEJOIN_MITER :: + * same as beveled rendering, except that an additional line + * break is added if the angle between the two joining lines + * is too closed (this is useful to avoid unpleasant spikes + * in beveled rendering). + */ typedef enum { FT_STROKER_LINEJOIN_ROUND = 0, @@ -69,28 +66,27 @@ FT_BEGIN_HEADER } FT_Stroker_LineJoin; - /*@************************************************************* - * - * @enum: - * FT_Stroker_LineCap - * - * @description: - * These values determine how the end of opened sub-paths are - * rendered in a stroke. - * - * @values: - * FT_STROKER_LINECAP_BUTT :: - * The end of lines is rendered as a full stop on the last - * point itself. - * - * FT_STROKER_LINECAP_ROUND :: - * The end of lines is rendered as a half-circle around the - * last point. - * - * FT_STROKER_LINECAP_SQUARE :: - * The end of lines is rendered as a square around the - * last point. - */ +/*@************************************************************* + * + * @enum: FT_Stroker_LineCap + * + * @description: + * these values determine how the end of opened sub-paths are + * rendered in a stroke + * + * @values: + * FT_STROKER_LINECAP_BUTT :: + * the end of lines is rendered as a full stop on the last + * point itself + * + * FT_STROKER_LINECAP_ROUND :: + * the end of lines is rendered as a half-circle around the + * last point + * + * FT_STROKER_LINECAP_SQUARE :: + * the end of lines is rendered as a square around the + * last point + */ typedef enum { FT_STROKER_LINECAP_BUTT = 0, @@ -99,134 +95,12 @@ FT_BEGIN_HEADER } FT_Stroker_LineCap; + /* */ - /************************************************************** - * - * @enum: - * FT_StrokerBorder - * - * @description: - * These values are used to select a given stroke border - * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder. - * - * @values: - * FT_STROKER_BORDER_LEFT :: - * Select the left border, relative to the drawing direction. - * - * FT_STROKER_BORDER_RIGHT :: - * Select the right border, relative to the drawing direction. - * - * @note: - * Applications are generally interested in the `inside' and `outside' - * borders. However, there is no direct mapping between these and - * the `left' / `right' ones, since this really depends on the glyph's - * drawing orientation, which varies between font formats. - * - * You can however use @FT_Outline_GetInsideBorder and - * @FT_Outline_GetOutsideBorder to get these. - */ - typedef enum - { - FT_STROKER_BORDER_LEFT = 0, - FT_STROKER_BORDER_RIGHT - - } FT_StrokerBorder; - - - /************************************************************** - * - * @function: - * FT_Outline_GetInsideBorder - * - * @description: - * Retrieve the @FT_StrokerBorder value corresponding to the - * `inside' borders of a given outline. - * - * @input: - * outline :: - * The source outline handle. - * - * @return: - * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid - * outlines. - */ - FT_EXPORT( FT_StrokerBorder ) - FT_Outline_GetInsideBorder( FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Outline_GetOutsideBorder - * - * @description: - * Retrieve the @FT_StrokerBorder value corresponding to the - * `outside' borders of a given outline. - * - * @input: - * outline :: - * The source outline handle. - * - * @return: - * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid - * outlines. - */ - FT_EXPORT( FT_StrokerBorder ) - FT_Outline_GetOutsideBorder( FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Stroker_New - * - * @description: - * Create a new stroker object. - * - * @input: - * memory :: - * The memory manager handle. - * - * @output: - * A new stroker object handle. NULL in case of error. - * - * @return: - * FreeType error code. 0 means success. - */ FT_EXPORT( FT_Error ) FT_Stroker_New( FT_Memory memory, FT_Stroker *astroker ); - - /************************************************************** - * - * @function: - * FT_Stroker_Set - * - * @description: - * Reset a stroker object's attributes. - * - * @input: - * stroker :: - * The target stroker handle. - * - * radius :: - * The border radius. - * - * line_cap :: - * The line cap style. - * - * line_join :: - * The line join style. - * - * miter_limit :: - * The miter limit for the FT_STROKER_LINEJOIN_MITER style, - * expressed as 16.16 fixed point value. - * - * @note: - * The radius is expressed in the same units that the outline - * coordinates. - */ FT_EXPORT( void ) FT_Stroker_Set( FT_Stroker stroker, FT_Fixed radius, @@ -235,208 +109,29 @@ FT_BEGIN_HEADER FT_Fixed miter_limit ); - /************************************************************** - * - * @function: - * FT_Stroker_Rewind - * - * @description: - * Reset a stroker object without changing its attributes. - * You should call this function before beginning a new - * series of calls to @FT_Stroker_BeginSubPath or - * @FT_Stroker_EndSubPath. - * - * @input: - * stroker :: - * The target stroker handle. - */ - FT_EXPORT( void ) - FT_Stroker_Rewind( FT_Stroker stroker ); - - - /************************************************************** - * - * @function: - * FT_Stroker_ParseOutline - * - * @description: - * A convenience function used to parse a whole outline with - * the stroker. The resulting outline(s) can be retrieved - * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export. - * - * @input: - * stroker :: - * The target stroker handle. - * - * outline :: - * The source outline. - * - * opened :: - * A boolean. If TRUE, the outline is treated as an open path - * instead of a closed one. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * If `opened' is 0 (the default), the outline is treated as a closed - * path, and the stroker will generate two distinct `border' outlines. - * - * If `opened' is 1, the outline is processed as an open path, and the - * stroker will generate a single `stroke' outline. - * - * This function calls @FT_Stroker_Rewind automatically. - */ FT_EXPORT( FT_Error ) FT_Stroker_ParseOutline( FT_Stroker stroker, FT_Outline* outline, FT_Bool opened ); - - /************************************************************** - * - * @function: - * FT_Stroker_BeginSubPath - * - * @description: - * Start a new sub-path in the stroker. - * - * @input: - * stroker :: - * The target stroker handle. - * - * to :: - * A pointer to the start vector. - * - * open :: - * A boolean. If TRUE, the sub-path is treated as an open one. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * This function is useful when you need to stroke a path that is - * not stored as a @FT_Outline object. - */ FT_EXPORT( FT_Error ) FT_Stroker_BeginSubPath( FT_Stroker stroker, FT_Vector* to, FT_Bool open ); - - /************************************************************** - * - * @function: - * FT_Stroker_EndSubPath - * - * @description: - * Close the current sub-path in the stroker. - * - * @input: - * stroker :: - * The target stroker handle. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * You should call this function after @FT_Stroker_BeginSubPath. - * If the subpath was not `opened', this function will `draw' a - * single line segment to the start position when needed. - */ FT_EXPORT( FT_Error ) FT_Stroker_EndSubPath( FT_Stroker stroker ); - /************************************************************** - * - * @function: - * FT_Stroker_LineTo - * - * @description: - * `Draw' a single line segment in the stroker's current sub-path, - * from the last position. - * - * @input: - * stroker :: - * The target stroker handle. - * - * to :: - * A pointer to the destination point. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * You should call this function between @FT_Stroker_BeginSubPath and - * @FT_Stroker_EndSubPath. - */ FT_EXPORT( FT_Error ) FT_Stroker_LineTo( FT_Stroker stroker, FT_Vector* to ); - - /************************************************************** - * - * @function: - * FT_Stroker_ConicTo - * - * @description: - * `Draw; a single quadratic bezier in the stroker's current sub-path, - * from the last position. - * - * @input: - * stroker :: - * The target stroker handle. - * - * control :: - * A pointer to a Bézier control point. - * - * to :: - * A pointer to the destination point. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * You should call this function between @FT_Stroker_BeginSubPath and - * @FT_Stroker_EndSubPath. - */ FT_EXPORT( FT_Error ) FT_Stroker_ConicTo( FT_Stroker stroker, FT_Vector* control, FT_Vector* to ); - - /************************************************************** - * - * @function: - * FT_Stroker_CubicTo - * - * @description: - * `Draw' a single cubic Bézier in the stroker's current sub-path, - * from the last position. - * - * @input: - * stroker :: - * The target stroker handle. - * - * control1 :: - * A pointer to the first Bézier control point. - * - * control2 :: - * A pointer to second Bézier control point. - * - * to :: - * A pointer to the destination point. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * You should call this function between @FT_Stroker_BeginSubPath and - * @FT_Stroker_EndSubPath. - */ FT_EXPORT( FT_Error ) FT_Stroker_CubicTo( FT_Stroker stroker, FT_Vector* control1, @@ -444,240 +139,19 @@ FT_BEGIN_HEADER FT_Vector* to ); - /************************************************************** - * - * @function: - * FT_Stroker_GetBorderCounts - * - * @description: - * Vall this function once you have finished parsing your paths - * with the stroker. It will return the number of points and - * contours necessary to export one of the `border' or `stroke' - * outlines generated by the stroker. - * - * @input: - * stroker :: - * The target stroker handle. - * - * border :: - * The border index. - * - * @output: - * anum_points :: - * The number of points. - * - * anum_contours :: - * The number of contours. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * When an outline, or a sub-path, is `closed', the stroker generates - * two independent `border' outlines, named `left' and `right'. - * - * When the outline, or a sub-path, is `opened', the stroker merges - * the `border' outlines with caps. The `left' border receives all - * points, while the `right' border becomes empty. - * - * Use the function @FT_Stroker_GetCounts instead if you want to - * retrieve the counts associated to both borders. - */ - FT_EXPORT( FT_Error ) - FT_Stroker_GetBorderCounts( FT_Stroker stroker, - FT_StrokerBorder border, - FT_UInt *anum_points, - FT_UInt *anum_contours ); - - - /************************************************************** - * - * @function: - * FT_Stroker_ExportBorder - * - * @description: - * Call this function after @FT_Stroker_GetBorderCounts to - * export the corresponding border to your own @FT_Outline - * structure. - * - * Note that this function will append the border points and - * contours to your outline, but will not try to resize its - * arrays. - * - * @input: - * stroker :: - * The target stroker handle. - * - * border :: - * The border index. - * - * outline :: - * The target outline handle. - * - * @note: - * Always call this function after @FT_Stroker_GetBorderCounts to - * get sure that there is enough room in your @FT_Outline object to - * receive all new data. - * - * When an outline, or a sub-path, is `closed', the stroker generates - * two independent `border' outlines, named `left' and `right' - * - * When the outline, or a sub-path, is `opened', the stroker merges - * the `border' outlines with caps. The `left' border receives all - * points, while the `right' border becomes empty. - * - * Use the function @FT_Stroker_Export instead if you want to - * retrieve all borders at once. - */ - FT_EXPORT( void ) - FT_Stroker_ExportBorder( FT_Stroker stroker, - FT_StrokerBorder border, - FT_Outline* outline ); - - - /************************************************************** - * - * @function: - * FT_Stroker_GetCounts - * - * @description: - * Call this function once you have finished parsing your paths - * with the stroker. It returns the number of points and - * contours necessary to export all points/borders from the stroked - * outline/path. - * - * @input: - * stroker :: - * The target stroker handle. - * - * @output: - * anum_points :: - * The number of points. - * - * anum_contours :: - * The number of contours. - * - * @return: - * FreeType error code. 0 means success. - */ FT_EXPORT( FT_Error ) FT_Stroker_GetCounts( FT_Stroker stroker, FT_UInt *anum_points, FT_UInt *anum_contours ); - - /************************************************************** - * - * @function: - * FT_Stroker_Export - * - * @description: - * Call this function after @FT_Stroker_GetBorderCounts to - * export the all borders to your own @FT_Outline structure. - * - * Note that this function will append the border points and - * contours to your outline, but will not try to resize its - * arrays. - * - * @input: - * stroker :: - * The target stroker handle. - * - * outline :: - * The target outline handle. - */ FT_EXPORT( void ) FT_Stroker_Export( FT_Stroker stroker, FT_Outline* outline ); - - /************************************************************** - * - * @function: - * FT_Stroker_Done - * - * @description: - * Destroy a stroker object. - * - * @input: - * stroker :: - * A stroker handle. Can be NULL. - */ FT_EXPORT( void ) FT_Stroker_Done( FT_Stroker stroker ); - /************************************************************** - * - * @function: - * FT_Glyph_Stroke - * - * @description: - * Stroke a given outline glyph object with a given stroker. - * - * @inout: - * pglyph :: Source glyph handle on input, new glyph handle - * on output. - * - * @input: - * stroker :: - * A stroker handle. - * - * destroy :: - * A Boolean. If TRUE, the source glyph object is destroyed - * on success. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * The source glyph is untouched in case of error. - */ - FT_EXPORT( FT_Error ) - FT_Glyph_Stroke( FT_Glyph *pglyph, - FT_Stroker stroker, - FT_Bool destroy ); - - - /************************************************************** - * - * @function: - * FT_Glyph_StrokeBorder - * - * @description: - * Stroke a given outline glyph object with a given stroker, but - * only return either its inside or outside border. - * - * @inout: - * pglyph :: - * Source glyph handle on input, new glyph handle on output. - * - * @input: - * stroker :: - * A stroker handle. - * - * inside :: - * A Boolean. If TRUE, return the inside border, otherwise - * the outside border. - * - * destroy :: - * A Boolean. If TRUE, the source glyph object is destroyed - * on success. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * The source glyph is untouched in case of error. - */ - FT_EXPORT( FT_Error ) - FT_Glyph_StrokeBorder( FT_Glyph *pglyph, - FT_Stroker stroker, - FT_Bool inside, - FT_Bool destroy ); - - /* */ - FT_END_HEADER #endif /* __FT_STROKE_H__ */ diff --git a/reactos/lib/freetype/include/freetype/ftsynth.h b/reactos/lib/freetype/include/freetype/ftsynth.h index f0c738532f3..2424ff6273c 100644 --- a/reactos/lib/freetype/include/freetype/ftsynth.h +++ b/reactos/lib/freetype/include/freetype/ftsynth.h @@ -5,7 +5,7 @@ /* FreeType synthesizing code for emboldening and slanting */ /* (specification). */ /* */ -/* Copyright 2000-2001, 2003 by */ +/* Copyright 2000-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -41,12 +41,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/include/freetype/fttrigon.h b/reactos/lib/freetype/include/freetype/fttrigon.h index 0462265e3c7..cf0650e2f5d 100644 --- a/reactos/lib/freetype/include/freetype/fttrigon.h +++ b/reactos/lib/freetype/include/freetype/fttrigon.h @@ -21,12 +21,6 @@ #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/include/freetype/ftwinfnt.h b/reactos/lib/freetype/include/freetype/ftwinfnt.h index a19a12d9720..9b308af27d1 100644 --- a/reactos/lib/freetype/include/freetype/ftwinfnt.h +++ b/reactos/lib/freetype/include/freetype/ftwinfnt.h @@ -22,12 +22,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER @@ -49,132 +43,10 @@ FT_BEGIN_HEADER /* */ /*************************************************************************/ - - /************************************************************************* - * - * @enum: - * FT_WinFNT_ID_XXX - * - * @description: - * A list of valid values for the `charset' byte in - * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX - * encodings (except for cp1361) can be found at ftp://ftp.unicode.org - * in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is - * roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT. - * - * @values: - * FT_WinFNT_ID_DEFAULT :: - * This is used for font enumeration and font creation as a - * `don't care' value. Valid font files don't contain this value. - * When querying for information about the character set of the font - * that is currently selected into a specified device context, this - * return value (of the related Windows API) simply denotes failure. - * - * FT_WinFNT_ID_SYMBOL :: - * There is no known mapping table available. - * - * FT_WinFNT_ID_MAC :: - * Mac Roman encoding. - * - * FT_WinFNT_ID_OEM :: - * From Michael Pöttgen <michael@poettgen.de>: - * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM - * is used for the charset of vector fonts, like `modern.fon', - * `roman.fon', and `script.fon' on Windows. - * - * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value - * specifies a character set that is operating-system dependent. - * - * The `IFIMETRICS' documentation from the `Windows Driver - * Development Kit' says: This font supports an OEM-specific - * character set. The OEM character set is system dependent. - * - * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the - * second default codepage that most international versions of - * Windows have. It is one of the OEM codepages from - * - * http://www.microsoft.com/globaldev/reference/cphome.mspx, - * - * and is used for the `DOS boxes', to support legacy applications. - * A German Windows version for example usually uses ANSI codepage - * 1252 and OEM codepage 850. - * - * FT_WinFNT_ID_CP874 :: - * A superset of Thai TIS 620 and ISO 8859-11. - * - * FT_WinFNT_ID_CP932 :: - * A superset of Japanese Shift-JIS (with minor deviations). - * - * FT_WinFNT_ID_CP936 :: - * A superset of simplified Chinese GB 2312-1980 (with different - * ordering and minor deviations). - * - * FT_WinFNT_ID_CP949 :: - * A superset of Korean Hangul KS C 5601-1987 (with different - * ordering and minor deviations). - * - * FT_WinFNT_ID_CP950 :: - * A superset of traditional Chinese Big 5 ETen (with different - * ordering and minor deviations). - * - * FT_WinFNT_ID_CP1250 :: - * A superset of East European ISO 8859-2 (with slightly different - * ordering). - * - * FT_WinFNT_ID_CP1251 :: - * A superset of Russian ISO 8859-5 (with different ordering). - * - * FT_WinFNT_ID_CP1252 :: - * ANSI encoding. A superset of ISO 8859-1. - * - * FT_WinFNT_ID_CP1253 :: - * A superset of Greek ISO 8859-7 (with minor modifications). - * - * FT_WinFNT_ID_CP1254 :: - * A superset of Turkish ISO 8859-9. - * - * FT_WinFNT_ID_CP1255 :: - * A superset of Hebrew ISO 8859-8 (with some modifications). - * - * FT_WinFNT_ID_CP1256 :: - * A superset of Arabic ISO 8859-6 (with different ordering). - * - * FT_WinFNT_ID_CP1257 :: - * A superset of Baltic ISO 8859-13 (with some deviations). - * - * FT_WinFNT_ID_CP1258 :: - * For Vietnamese. This encoding doesn't cover all necessary - * characters. - * - * FT_WinFNT_ID_CP1361 :: - * Korean (Johab). - */ - -#define FT_WinFNT_ID_CP1252 0 -#define FT_WinFNT_ID_DEFAULT 1 -#define FT_WinFNT_ID_SYMBOL 2 -#define FT_WinFNT_ID_MAC 77 -#define FT_WinFNT_ID_CP932 128 -#define FT_WinFNT_ID_CP949 129 -#define FT_WinFNT_ID_CP1361 130 -#define FT_WinFNT_ID_CP936 134 -#define FT_WinFNT_ID_CP950 136 -#define FT_WinFNT_ID_CP1253 161 -#define FT_WinFNT_ID_CP1254 162 -#define FT_WinFNT_ID_CP1258 163 -#define FT_WinFNT_ID_CP1255 177 -#define FT_WinFNT_ID_CP1256 178 -#define FT_WinFNT_ID_CP1257 186 -#define FT_WinFNT_ID_CP1251 204 -#define FT_WinFNT_ID_CP874 222 -#define FT_WinFNT_ID_CP1250 238 -#define FT_WinFNT_ID_OEM 255 - - /*************************************************************************/ /* */ /* <Struct> */ - /* FT_WinFNT_HeaderRec */ + /* FT_WinFNT_HeaderRec_ */ /* */ /* <Description> */ /* Windows FNT Header info. */ diff --git a/reactos/lib/freetype/include/freetype/ftxf86.h b/reactos/lib/freetype/include/freetype/ftxf86.h index aa93275a464..5a7582f9172 100644 --- a/reactos/lib/freetype/include/freetype/ftxf86.h +++ b/reactos/lib/freetype/include/freetype/ftxf86.h @@ -4,7 +4,7 @@ /* */ /* Support functions for X11. */ /* */ -/* Copyright 2002, 2003 by */ +/* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,13 +22,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - FT_BEGIN_HEADER /* this comment is intentionally disabled for now, to prevent this */ diff --git a/reactos/lib/freetype/include/freetype/internal/ftcalc.h b/reactos/lib/freetype/include/freetype/internal/ftcalc.h index 7866c46273a..af1f6407202 100644 --- a/reactos/lib/freetype/include/freetype/internal/ftcalc.h +++ b/reactos/lib/freetype/include/freetype/internal/ftcalc.h @@ -4,7 +4,7 @@ /* */ /* Arithmetic computations (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -27,8 +27,7 @@ FT_BEGIN_HEADER - FT_EXPORT( FT_Int32 ) - FT_SqrtFixed( FT_Int32 x ); + FT_EXPORT( FT_Int32 ) FT_SqrtFixed( FT_Int32 x ); #define SQRT_32( x ) FT_Sqrt32( x ) @@ -60,39 +59,6 @@ FT_BEGIN_HEADER /*************************************************************************/ -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_MulDiv_No_Round */ - /* */ - /* <Description> */ - /* A very simple function used to perform the computation `(a*b)/c' */ - /* (without rounding) with maximal accuracy (it uses a 64-bit */ - /* intermediate integer whenever necessary). */ - /* */ - /* This function isn't necessarily as fast as some processor specific */ - /* operations, but is at least completely portable. */ - /* */ - /* <Input> */ - /* a :: The first multiplier. */ - /* b :: The second multiplier. */ - /* c :: The divisor. */ - /* */ - /* <Return> */ - /* The result of `(a*b)/c'. This function never traps when trying to */ - /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */ - /* on the signs of `a' and `b'. */ - /* */ - FT_BASE( FT_Long ) - FT_MulDiv_No_Round( FT_Long a, - FT_Long b, - FT_Long c ); - -#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ - - #define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 ) #define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 ) #define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 ) diff --git a/reactos/lib/freetype/include/freetype/internal/ftdriver.h b/reactos/lib/freetype/include/freetype/internal/ftdriver.h index 02f585d6b08..1f1c55aaa53 100644 --- a/reactos/lib/freetype/include/freetype/internal/ftdriver.h +++ b/reactos/lib/freetype/include/freetype/internal/ftdriver.h @@ -155,15 +155,11 @@ FT_BEGIN_HEADER /* add data from AFM or PFM files on a Type 1 */ /* face, or a CIDMap on a CID-keyed face. */ /* */ - /* get_advances :: A function handle used to return advance */ - /* widths of 'count' glyphs (in font units), */ - /* starting at `first'. The `vertical' flag must */ - /* be set to get vertical advance heights. The */ - /* `advances' buffer is caller-allocated. */ - /* Currently not implemented. The idea of this */ - /* function is to be able to perform */ - /* device-independent text layout without loading */ - /* a single glyph image. */ + /* get_advances :: A function handle used to return the advances */ + /* of 'count' glyphs, starting at `index'. the */ + /* `vertical' flags must be set when vertical */ + /* advances are queried. The advances buffer is */ + /* caller-allocated. */ /* */ /* <Note> */ /* Most function pointers, with the exception of `load_glyph' and */ diff --git a/reactos/lib/freetype/include/freetype/internal/ftgloadr.h b/reactos/lib/freetype/include/freetype/internal/ftgloadr.h index abc56e25664..284f4e3b6ac 100644 --- a/reactos/lib/freetype/include/freetype/internal/ftgloadr.h +++ b/reactos/lib/freetype/include/freetype/internal/ftgloadr.h @@ -110,15 +110,15 @@ FT_BEGIN_HEADER FT_BASE( void ) FT_GlyphLoader_Rewind( FT_GlyphLoader loader ); - /* check that there is enough space to add `n_points' and `n_contours' */ - /* to the glyph loader */ + /* check that there is enough room to add 'n_points' and 'n_contours' */ + /* to the glyph loader */ FT_BASE( FT_Error ) FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader, FT_UInt n_points, FT_UInt n_contours ); - /* check that there is enough space to add `n_subs' sub-glyphs to */ - /* a glyph loader */ + /* check that there is enough room to add 'n_subs' sub-glyphs to */ + /* a glyph loader */ FT_BASE( FT_Error ) FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader, FT_UInt n_subs ); diff --git a/reactos/lib/freetype/include/freetype/internal/ftmemory.h b/reactos/lib/freetype/include/freetype/internal/ftmemory.h index 63f37aff7ce..8da5fadc3c6 100644 --- a/reactos/lib/freetype/include/freetype/internal/ftmemory.h +++ b/reactos/lib/freetype/include/freetype/internal/ftmemory.h @@ -4,7 +4,7 @@ /* */ /* The FreeType memory management macros (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2004 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -180,12 +180,6 @@ FT_BEGIN_HEADER #define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) ) -#define FT_ARRAY_COPY( dest, source, count ) \ - FT_MEM_COPY( dest, source, (count) * sizeof( *(dest) ) ) - -#define FT_ARRAY_MOVE( dest, source, count ) \ - FT_MEM_MOVE( dest, source, (count) * sizeof( *(dest) ) ) - /*************************************************************************/ /* */ diff --git a/reactos/lib/freetype/include/freetype/internal/ftobjs.h b/reactos/lib/freetype/include/freetype/internal/ftobjs.h index 75569b7f818..79319e8742b 100644 --- a/reactos/lib/freetype/include/freetype/internal/ftobjs.h +++ b/reactos/lib/freetype/include/freetype/internal/ftobjs.h @@ -34,7 +34,7 @@ #include FT_INTERNAL_GLYPH_LOADER_H #include FT_INTERNAL_DRIVER_H #include FT_INTERNAL_AUTOHINT_H -#include FT_INTERNAL_SERVICE_H +#include FT_INTERNAL_OBJECT_H #ifdef FT_CONFIG_OPTION_INCREMENTAL #include FT_INCREMENTAL_H @@ -79,15 +79,6 @@ FT_BEGIN_HEADER #endif -#define FT_PAD_FLOOR( x, n ) ( (x) & ~((n)-1) ) -#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n ) -#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + ((n)-1), n ) - -#define FT_PIX_FLOOR( x ) ( (x) & ~63 ) -#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 ) -#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 ) - - /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ @@ -280,52 +271,51 @@ FT_BEGIN_HEADER /* FreeType. */ /* */ /* <Fields> */ - /* max_points :: */ - /* The maximal number of points used to store the vectorial outline */ - /* of any glyph in this face. If this value cannot be known in */ - /* advance, or if the face isn't scalable, this should be set to 0. */ - /* Only relevant for scalable formats. */ + /* max_points :: The maximal number of points used to store the */ + /* vectorial outline of any glyph in this face. */ + /* If this value cannot be known in advance, or */ + /* if the face isn't scalable, this should be set */ + /* to 0. Only relevant for scalable formats. */ /* */ - /* max_contours :: */ - /* The maximal number of contours used to store the vectorial */ - /* outline of any glyph in this face. If this value cannot be */ - /* known in advance, or if the face isn't scalable, this should be */ - /* set to 0. Only relevant for scalable formats. */ + /* max_contours :: The maximal number of contours used to store */ + /* the vectorial outline of any glyph in this */ + /* face. If this value cannot be known in */ + /* advance, or if the face isn't scalable, this */ + /* should be set to 0. Only relevant for */ + /* scalable formats. */ /* */ - /* transform_matrix :: */ - /* A 2x2 matrix of 16.16 coefficients used to transform glyph */ - /* outlines after they are loaded from the font. Only used by the */ - /* convenience functions. */ + /* transform_matrix :: A 2x2 matrix of 16.16 coefficients used to */ + /* transform glyph outlines after they are loaded */ + /* from the font. Only used by the convenience */ + /* functions. */ /* */ - /* transform_delta :: */ - /* A translation vector used to transform glyph outlines after they */ - /* are loaded from the font. Only used by the convenience */ - /* functions. */ + /* transform_delta :: A translation vector used to transform glyph */ + /* outlines after they are loaded from the font. */ + /* Only used by the convenience functions. */ /* */ - /* transform_flags :: */ - /* Some flags used to classify the transform. Only used by the */ - /* convenience functions. */ + /* transform_flags :: Some flags used to classify the transform. */ + /* Only used by the convenience functions. */ /* */ - /* services :: */ - /* A cache for frequently used services. It should be only */ - /* accessed with the macro `FT_FACE_LOOKUP_SERVICE'. */ + /* postscript_name :: Postscript font name for this face. */ /* */ /* incremental_interface :: */ - /* If non-null, the interface through which glyph data and metrics */ - /* are loaded incrementally for faces that do not provide all of */ - /* this data when first opened. This field exists only if */ - /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */ + /* If non-null, the interface through */ + /* which glyph data and metrics are loaded */ + /* incrementally for faces that do not provide */ + /* all of this data when first opened. */ + /* This field exists only if */ + /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */ /* */ typedef struct FT_Face_InternalRec_ { - FT_UShort max_points; - FT_Short max_contours; + FT_UShort max_points; + FT_Short max_contours; - FT_Matrix transform_matrix; - FT_Vector transform_delta; - FT_Int transform_flags; + FT_Matrix transform_matrix; + FT_Vector transform_delta; + FT_Int transform_flags; - FT_ServiceCacheRec services; + const char* postscript_name; #ifdef FT_CONFIG_OPTION_INCREMENTAL FT_Incremental_InterfaceRec* incremental_interface; @@ -476,10 +466,6 @@ FT_BEGIN_HEADER FT_Get_Module_Interface( FT_Library library, const char* mod_name ); - FT_BASE( FT_Pointer ) - ft_module_get_service( FT_Module module, - const char* service_id ); - /* */ @@ -718,12 +704,6 @@ FT_BEGIN_HEADER /* generic :: Client data variable. Used to extend the */ /* Library class by higher levels and clients. */ /* */ - /* version_major :: The major version number of the library. */ - /* */ - /* version_minor :: The minor version number of the library. */ - /* */ - /* version_patch :: The current patch level of the library. */ - /* */ /* num_modules :: The number of modules currently registered */ /* within this library. This is set to 0 for new */ /* libraries. New modules are added through the */ @@ -774,6 +754,8 @@ FT_BEGIN_HEADER FT_DebugHook_Func debug_hooks[4]; + FT_MetaClassRec meta_class; + } FT_LibraryRec; diff --git a/reactos/lib/freetype/include/freetype/internal/ftserv.h b/reactos/lib/freetype/include/freetype/internal/ftserv.h deleted file mode 100644 index e5ed8895b36..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/ftserv.h +++ /dev/null @@ -1,260 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftserv.h */ -/* */ -/* The FreeType services (specification only). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - /*************************************************************************/ - /* */ - /* Each module can export one or more `services'. Each service is */ - /* identified by a constant string and modeled by a pointer; the latter */ - /* generally corresponds to a structure containing function pointers. */ - /* */ - /* Note that a service's data cannot be a mere function pointer because */ - /* in C it is possible that function pointers might be implemented */ - /* differently than data pointers (e.g. 48 bits instead of 32). */ - /* */ - /*************************************************************************/ - - -#ifndef __FTSERV_H__ -#define __FTSERV_H__ - - -FT_BEGIN_HEADER - - - /* - * @macro: - * FT_FACE_FIND_SERVICE - * - * @description: - * This macro is used to look up a service from a face's driver module. - * - * @input: - * face :: - * The source face handle. - * - * id :: - * A string describing the service as defined in the service's - * header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to - * `multi-masters'). It is automatically prefixed with - * `FT_SERVICE_ID_'. - * - * @output: - * ptr :: - * A variable that receives the service pointer. Will be NULL - * if not found. - */ -#define FT_FACE_FIND_SERVICE( face, ptr, id ) \ - FT_BEGIN_STMNT \ - FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \ - /* the strange cast is to allow C++ compilation */ \ - FT_Pointer* Pptr = (FT_Pointer*) &(ptr); \ - \ - \ - *Pptr = NULL; \ - if ( module->clazz->get_interface ) \ - *Pptr = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \ - FT_END_STMNT - - - /* - * @macro: - * FT_FACE_FIND_GLOBAL_SERVICE - * - * @description: - * This macro is used to look up a service from all modules. - * - * @input: - * face :: - * The source face handle. - * - * id :: - * A string describing the service as defined in the service's - * header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to - * `multi-masters'). It is automatically prefixed with - * `FT_SERVICE_ID_'. - * - * @output: - * ptr :: - * A variable that receives the service pointer. Will be NULL - * if not found. - */ -#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \ - FT_BEGIN_STMNT \ - FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \ - /* the strange cast is to allow C++ compilation */ \ - FT_Pointer* Pptr = (FT_Pointer*) &(ptr); \ - \ - \ - *Pptr = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \ - FT_END_STMNT - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** S E R V I C E D E S C R I P T O R S *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* - * The following structure is used to _describe_ a given service - * to the library. This is useful to build simple static service lists. - */ - typedef struct FT_ServiceDescRec_ - { - const char* serv_id; /* service name */ - const void* serv_data; /* service pointer/data */ - - } FT_ServiceDescRec; - - typedef const FT_ServiceDescRec* FT_ServiceDesc; - - - /* - * Parse a list of FT_ServiceDescRec descriptors and look for - * a specific service by ID. Note that the last element in the - * array must be { NULL, NULL }, and that the function should - * return NULL if the service isn't available. - * - * This function can be used by modules to implement their - * `get_service' method. - */ - FT_BASE( FT_Pointer ) - ft_service_list_lookup( FT_ServiceDesc service_descriptors, - const char* service_id ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** S E R V I C E S C A C H E *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* - * This structure is used to store a cache for several frequently used - * services. It is the type of `face->internal->services'. You - * should only use FT_FACE_LOOKUP_SERVICE to access it. - * - * All fields should have the type FT_Pointer to relax compilation - * dependencies. We assume the developer isn't completely stupid. - * - * Each field must be named `service_XXXX' where `XXX' corresponds to - * the correct FT_SERVICE_ID_XXXX macro. See the definition of - * FT_FACE_LOOKUP_SERVICE below how this is implemented. - * - */ - typedef struct FT_ServiceCacheRec_ - { - FT_Pointer service_POSTSCRIPT_FONT_NAME; - FT_Pointer service_MULTI_MASTERS; - FT_Pointer service_GLYPH_DICT; - FT_Pointer service_PFR_METRICS; - FT_Pointer service_WINFNT; - - } FT_ServiceCacheRec, *FT_ServiceCache; - - - /* - * A magic number used within the services cache. - */ -#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)-2) /* magic number */ - - - /* - * @macro: - * FT_FACE_LOOKUP_SERVICE - * - * @description: - * This macro is used to lookup a service from a face's driver module - * using its cache. - * - * @input: - * face:: - * The source face handle containing the cache. - * - * field :: - * The field name in the cache. - * - * id :: - * The service ID. - * - * @output: - * ptr :: - * A variable receiving the service data. NULL if not available. - */ -#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \ - FT_BEGIN_STMNT \ - /* the strange cast is to allow C++ compilation */ \ - FT_Pointer* pptr = (FT_Pointer*)&(ptr); \ - FT_Pointer svc; \ - \ - \ - svc = FT_FACE(face)->internal->services. service_ ## id ; \ - if ( svc == FT_SERVICE_UNAVAILABLE ) \ - svc = NULL; \ - else if ( svc == NULL ) \ - { \ - FT_FACE_FIND_SERVICE( face, svc, id ); \ - \ - FT_FACE(face)->internal->services. service_ ## id = \ - (FT_Pointer)( svc != NULL ? svc \ - : FT_SERVICE_UNAVAILABLE ); \ - } \ - *pptr = svc; \ - FT_END_STMNT - - - /* - * A macro used to define new service structure types. - */ - -#define FT_DEFINE_SERVICE( name ) \ - typedef struct FT_Service_ ## name ## Rec_ \ - FT_Service_ ## name ## Rec ; \ - typedef struct FT_Service_ ## name ## Rec_ \ - const * FT_Service_ ## name ; \ - struct FT_Service_ ## name ## Rec_ - - /* */ - - /* - * The header files containing the services. - */ - -#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h> -#define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h> -#define FT_SERVICE_POSTSCRIPT_CMAPS_H <freetype/internal/services/svpscmap.h> -#define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h> -#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h> -#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h> -#define FT_SERVICE_XFREE86_NAME_H <freetype/internal/services/svxf86nm.h> -#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h> -#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h> -#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h> -#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h> - - /* */ - -FT_END_HEADER - -#endif /* __FTSERV_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/internal.h b/reactos/lib/freetype/include/freetype/internal/internal.h index 03487894213..872f6ac7977 100644 --- a/reactos/lib/freetype/include/freetype/internal/internal.h +++ b/reactos/lib/freetype/include/freetype/internal/internal.h @@ -27,17 +27,26 @@ #define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h> #define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h> #define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h> +#define FT_INTERNAL_EXTENSION_H <freetype/internal/ftextend.h> #define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h> #define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h> #define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h> +#define FT_INTERNAL_EXTEND_H <freetype/internal/ftextend.h> #define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h> #define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h> #define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h> -#define FT_INTERNAL_SERVICE_H <freetype/internal/ftserv.h> +#define FT_INTERNAL_HASH_H <freetype/internal/fthash.h> +#define FT_INTERNAL_OBJECT_H <freetype/internal/ftobject.h> #define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h> #define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h> +#define FT_INTERNAL_TYPE42_TYPES_H <freetype/internal/t42types.h> +#define FT_INTERNAL_CFF_TYPES_H <freetype/internal/cfftypes.h> +#define FT_INTERNAL_FNT_TYPES_H <freetype/internal/fnttypes.h> +#define FT_INTERNAL_BDF_TYPES_H <freetype/internal/bdftypes.h> +#define FT_INTERNAL_PFR_H <freetype/internal/pfr.h> +#define FT_INTERNAL_POSTSCRIPT_NAMES_H <freetype/internal/psnames.h> #define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h> #define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h> #define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h> diff --git a/reactos/lib/freetype/include/freetype/internal/psaux.h b/reactos/lib/freetype/include/freetype/internal/psaux.h index 8d419be087f..c7093fe5470 100644 --- a/reactos/lib/freetype/include/freetype/internal/psaux.h +++ b/reactos/lib/freetype/include/freetype/internal/psaux.h @@ -24,7 +24,6 @@ #include <ft2build.h> #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_TYPE1_TYPES_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H FT_BEGIN_HEADER @@ -124,7 +123,7 @@ FT_BEGIN_HEADER FT_Int max_elems; FT_Int num_elems; FT_Byte** elements; /* addresses of table elements */ - FT_PtrDist* lengths; /* lengths of table elements */ + FT_Int* lengths; /* lengths of table elements */ FT_Memory memory; PS_Table_FuncsRec funcs; @@ -330,20 +329,18 @@ FT_BEGIN_HEADER void (*skip_spaces)( PS_Parser parser ); void - (*skip_PS_token)( PS_Parser parser ); + (*skip_alpha)( PS_Parser parser ); FT_Long (*to_int)( PS_Parser parser ); FT_Fixed (*to_fixed)( PS_Parser parser, FT_Int power_ten ); - FT_Error (*to_bytes)( PS_Parser parser, FT_Byte* bytes, - FT_Long max_bytes, - FT_Long* pnum_bytes, - FT_Bool delimiters ); + FT_Int max_bytes, + FT_Int* pnum_bytes ); FT_Int (*to_coord_array)( PS_Parser parser, @@ -651,14 +648,14 @@ FT_BEGIN_HEADER T1_Decoder_ZoneRec zones[T1_MAX_SUBRS_CALLS + 1]; T1_Decoder_Zone zone; - FT_Service_PsCMaps psnames; /* for seac */ + PSNames_Service psnames; /* for seac */ FT_UInt num_glyphs; FT_Byte** glyph_names; FT_Int lenIV; /* internal for sub routine calls */ FT_UInt num_subrs; FT_Byte** subrs; - FT_PtrDist* subrs_len; /* array of subrs length (optional) */ + FT_Int* subrs_len; /* array of subrs length (optional) */ FT_Matrix font_matrix; FT_Vector font_offset; diff --git a/reactos/lib/freetype/include/freetype/internal/services/svbdf.h b/reactos/lib/freetype/include/freetype/internal/services/svbdf.h deleted file mode 100644 index 0f7fc6115d6..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svbdf.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************/ -/* */ -/* svbdf.h */ -/* */ -/* The FreeType BDF services (specification). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SVBDF_H__ -#define __SVBDF_H__ - -#include FT_BDF_H -#include FT_INTERNAL_SERVICE_H - - -FT_BEGIN_HEADER - - -#define FT_SERVICE_ID_BDF "bdf" - - typedef FT_Error - (*FT_BDF_GetCharsetIdFunc)( FT_Face face, - const char* *acharset_encoding, - const char* *acharset_registry ); - - typedef FT_Error - (*FT_BDF_GetPropertyFunc)( FT_Face face, - const char* prop_name, - BDF_PropertyRec *aproperty ); - - - FT_DEFINE_SERVICE( BDF ) - { - FT_BDF_GetCharsetIdFunc get_charset_id; - FT_BDF_GetPropertyFunc get_property; - }; - - /* */ - - -FT_END_HEADER - - -#endif /* __SVBDF_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/services/svgldict.h b/reactos/lib/freetype/include/freetype/internal/services/svgldict.h deleted file mode 100644 index e5e56b253c1..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svgldict.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************/ -/* */ -/* svgldict.h */ -/* */ -/* The FreeType glyph dictionary services (specification). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SVGLDICT_H__ -#define __SVGLDICT_H__ - -#include FT_INTERNAL_SERVICE_H - - -FT_BEGIN_HEADER - - - /* - * A service used to retrieve glyph names, as well as to find the - * index of a given glyph name in a font. - * - */ - -#define FT_SERVICE_ID_GLYPH_DICT "glyph-dict" - - - typedef FT_Error - (*FT_GlyphDict_GetNameFunc)( FT_Face face, - FT_UInt glyph_index, - FT_Pointer buffer, - FT_UInt buffer_max ); - - typedef FT_UInt - (*FT_GlyphDict_NameIndexFunc)( FT_Face face, - FT_String* glyph_name ); - - - FT_DEFINE_SERVICE( GlyphDict ) - { - FT_GlyphDict_GetNameFunc get_name; - FT_GlyphDict_NameIndexFunc name_index; /* optional */ - }; - - /* */ - - -FT_END_HEADER - - -#endif /* __SVGLDICT_H__ */ diff --git a/reactos/lib/freetype/include/freetype/internal/services/svmm.h b/reactos/lib/freetype/include/freetype/internal/services/svmm.h deleted file mode 100644 index 926975ce88b..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svmm.h +++ /dev/null @@ -1,68 +0,0 @@ -/***************************************************************************/ -/* */ -/* svmm.h */ -/* */ -/* The FreeType Multiple Masters services (specification). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SVMM_H__ -#define __SVMM_H__ - -#include FT_INTERNAL_SERVICE_H - - -FT_BEGIN_HEADER - - - /* - * A service used to manage multiple-masters data in a given face. - * - * See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H). - * - */ - -#define FT_SERVICE_ID_MULTI_MASTERS "multi-masters" - - - typedef FT_Error - (*FT_Get_MM_Func)( FT_Face face, - FT_Multi_Master* master ); - - typedef FT_Error - (*FT_Set_MM_Design_Func)( FT_Face face, - FT_UInt num_coords, - FT_Long* coords ); - - typedef FT_Error - (*FT_Set_MM_Blend_Func)( FT_Face face, - FT_UInt num_coords, - FT_Long* coords ); - - - FT_DEFINE_SERVICE( MultiMasters ) - { - FT_Get_MM_Func get_mm; - FT_Set_MM_Design_Func set_mm_design; - FT_Set_MM_Blend_Func set_mm_blend; - }; - - /* */ - - -FT_END_HEADER - -#endif /* __SVMM_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/services/svpfr.h b/reactos/lib/freetype/include/freetype/internal/services/svpfr.h deleted file mode 100644 index b61050543e8..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svpfr.h +++ /dev/null @@ -1,65 +0,0 @@ -/***************************************************************************/ -/* */ -/* svpfr.h */ -/* */ -/* Internal PFR service functions (specification). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SVPFR_H__ -#define __SVPFR_H__ - -#include FT_INTERNAL_SERVICE_H - - -FT_BEGIN_HEADER - - -#define FT_SERVICE_ID_PFR_METRICS "pfr-metrics" - - - typedef FT_Error - (*FT_PFR_GetMetricsFunc)( FT_Face face, - FT_UInt *aoutline, - FT_UInt *ametrics, - FT_Fixed *ax_scale, - FT_Fixed *ay_scale ); - - typedef FT_Error - (*FT_PFR_GetKerningFunc)( FT_Face face, - FT_UInt left, - FT_UInt right, - FT_Vector *avector ); - - typedef FT_Error - (*FT_PFR_GetAdvanceFunc)( FT_Face face, - FT_UInt gindex, - FT_Pos *aadvance ); - - - FT_DEFINE_SERVICE( PfrMetrics ) - { - FT_PFR_GetMetricsFunc get_metrics; - FT_PFR_GetKerningFunc get_kerning; - FT_PFR_GetAdvanceFunc get_advance; - - }; - - /* */ - -FT_END_HEADER - -#endif /* __SVPFR_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/services/svpostnm.h b/reactos/lib/freetype/include/freetype/internal/services/svpostnm.h deleted file mode 100644 index 7f1700adb39..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svpostnm.h +++ /dev/null @@ -1,58 +0,0 @@ -/***************************************************************************/ -/* */ -/* svpostnm.h */ -/* */ -/* The FreeType PostScript name services (specification). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SVPOSTNM_H__ -#define __SVPOSTNM_H__ - -#include FT_INTERNAL_SERVICE_H - - -FT_BEGIN_HEADER - - /* - * A trivial service used to retrieve the PostScript name of a given - * font when available. The `get_name' field should never be NULL. - * - * The correponding function can return NULL to indicate that the - * PostScript name is not available. - * - * The name is owned by the face and will be destroyed with it. - */ - -#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name" - - - typedef const char* - (*FT_PsName_GetFunc)( FT_Face face ); - - - FT_DEFINE_SERVICE( PsFontName ) - { - FT_PsName_GetFunc get_ps_font_name; - }; - - /* */ - - -FT_END_HEADER - - -#endif /* __SVPOSTNM_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/services/svpscmap.h b/reactos/lib/freetype/include/freetype/internal/services/svpscmap.h deleted file mode 100644 index ade96ef8f16..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svpscmap.h +++ /dev/null @@ -1,113 +0,0 @@ -/***************************************************************************/ -/* */ -/* svpscmap.h */ -/* */ -/* The FreeType PostScript charmap service (specification). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SVPSCMAP_H__ -#define __SVPSCMAP_H__ - - -FT_BEGIN_HEADER - - -#define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps" - - - /* - * Adobe glyph name to unicode value - */ - typedef FT_UInt32 - (*PS_Unicode_ValueFunc)( const char* glyph_name ); - - /* - * Unicode value to Adobe glyph name index. 0xFFFF if not found. - */ - typedef FT_UInt - (*PS_Unicode_Index_Func)( FT_UInt num_glyphs, - const char** glyph_names, - FT_ULong unicode ); - - /* - * Macintosh name id to glyph name. NULL if invalid index. - */ - typedef const char* - (*PS_Macintosh_Name_Func)( FT_UInt name_index ); - - /* - * Adobe standard string ID to glyph name. NULL if invalid index. - */ - typedef const char* - (*PS_Adobe_Std_Strings_Func)( FT_UInt string_index ); - - /* - * Simple unicode -> glyph index charmap built from font glyph names - * table. - */ - typedef struct PS_UniMap_ - { - FT_UInt unicode; - FT_UInt glyph_index; - - } PS_UniMap; - - - typedef struct PS_Unicodes_ - { - FT_UInt num_maps; - PS_UniMap* maps; - - } PS_Unicodes; - - - typedef FT_Error - (*PS_Unicodes_InitFunc)( FT_Memory memory, - FT_UInt num_glyphs, - const char** glyph_names, - PS_Unicodes* unicodes ); - - typedef FT_UInt - (*PS_Unicodes_CharIndexFunc)( PS_Unicodes* unicodes, - FT_UInt unicode ); - - typedef FT_ULong - (*PS_Unicodes_CharNextFunc)( PS_Unicodes* unicodes, - FT_ULong unicode ); - - - FT_DEFINE_SERVICE( PsCMaps ) - { - PS_Unicode_ValueFunc unicode_value; - - PS_Unicodes_InitFunc unicodes_init; - PS_Unicodes_CharIndexFunc unicodes_char_index; - PS_Unicodes_CharNextFunc unicodes_char_next; - - PS_Macintosh_Name_Func macintosh_name; - PS_Adobe_Std_Strings_Func adobe_std_strings; - const unsigned short* adobe_std_encoding; - const unsigned short* adobe_expert_encoding; - }; - - /* */ - - -FT_END_HEADER - - -#endif /* __SVPSCMAP_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/services/svpsinfo.h b/reactos/lib/freetype/include/freetype/internal/services/svpsinfo.h deleted file mode 100644 index 73c02cdb738..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svpsinfo.h +++ /dev/null @@ -1,55 +0,0 @@ -/***************************************************************************/ -/* */ -/* svpsinfo.h */ -/* */ -/* The FreeType PostScript info service (specification). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SVPSINFO_H__ -#define __SVPSINFO_H__ - -#include FT_INTERNAL_SERVICE_H -#include FT_INTERNAL_TYPE1_TYPES_H - - -FT_BEGIN_HEADER - - -#define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info" - - - typedef FT_Error - (*PS_GetFontInfoFunc)( FT_Face face, - PS_FontInfoRec* afont_info ); - - typedef FT_Int - (*PS_HasGlyphNamesFunc)( FT_Face face ); - - - FT_DEFINE_SERVICE( PsInfo ) - { - PS_GetFontInfoFunc ps_get_font_info; - PS_HasGlyphNamesFunc ps_has_glyph_names; - }; - - /* */ - - -FT_END_HEADER - - -#endif /* __SVPSINFO_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/services/svsfnt.h b/reactos/lib/freetype/include/freetype/internal/services/svsfnt.h deleted file mode 100644 index 06a5b1c23d3..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svsfnt.h +++ /dev/null @@ -1,69 +0,0 @@ -/***************************************************************************/ -/* */ -/* svsfnt.h */ -/* */ -/* The FreeType PostScript name services (specification). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SVSFNT_H__ -#define __SVSFNT_H__ - -#include FT_INTERNAL_SERVICE_H -#include FT_TRUETYPE_TABLES_H - - -FT_BEGIN_HEADER - - - /* - * SFNT table loading service. - */ - -#define FT_SERVICE_ID_SFNT_TABLE "sfnt-table" - - - /* - * Used to implement FT_Load_Sfnt_Table(). - */ - typedef FT_Error - (*FT_SFNT_TableLoadFunc)( FT_Face face, - FT_ULong tag, - FT_Long offset, - FT_Byte* buffer, - FT_ULong* length ); - - /* - * Used to implement FT_Get_Sfnt_Table(). - */ - typedef void* - (*FT_SFNT_TableGetFunc)( FT_Face face, - FT_Sfnt_Tag tag ); - - - FT_DEFINE_SERVICE( SFNT_Table ) - { - FT_SFNT_TableLoadFunc load_table; - FT_SFNT_TableGetFunc get_table; - }; - - /* */ - - -FT_END_HEADER - - -#endif /* __SVSFNT_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/services/svttcmap.h b/reactos/lib/freetype/include/freetype/internal/services/svttcmap.h deleted file mode 100644 index f92fcd0e2c4..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svttcmap.h +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************/ -/* */ -/* svsttcmap.h */ -/* */ -/* The FreeType TrueType/sfnt cmap extra information service. */ -/* */ -/* Copyright 2003 by */ -/* Masatake YAMATO, Redhat K.K. */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/* Development of this service is support of - Information-technology Promotion Agency, Japan. */ - -#ifndef __SVTTCMAP_H__ -#define __SVTTCMAP_H__ - -#include FT_INTERNAL_SERVICE_H -#include FT_TRUETYPE_TABLES_H - - -FT_BEGIN_HEADER - - -#define FT_SERVICE_ID_TT_CMAP "tt-cmaps" - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* TT_CMapInfo */ - /* */ - /* <Description> */ - /* A structure used to store TrueType/sfnt specific cmap information */ - /* which is not covered by the generic @FT_CharMap structure. This */ - /* structure can be accessed with the @FT_Get_TT_CMap_Info function. */ - /* */ - /* <Fields> */ - /* language :: */ - /* The language ID used in Mac fonts. Definitions of values are in */ - /* freetype/ttnameid.h. */ - /* */ - typedef struct TT_CMapInfo_ - { - FT_ULong language; - - } TT_CMapInfo; - - - typedef FT_Error - (*TT_CMap_Info_GetFunc)( FT_CharMap charmap, - TT_CMapInfo *cmap_info ); - - - FT_DEFINE_SERVICE( TTCMaps ) - { - TT_CMap_Info_GetFunc get_cmap_info; - }; - - /* */ - - -FT_END_HEADER - -#endif /* __SVTTCMAP_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/services/svwinfnt.h b/reactos/lib/freetype/include/freetype/internal/services/svwinfnt.h deleted file mode 100644 index 57f7765d92f..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svwinfnt.h +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************/ -/* */ -/* svwinfnt.h */ -/* */ -/* The FreeType Windows FNT/FONT service (specification). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SVWINFNT_H__ -#define __SVWINFNT_H__ - -#include FT_INTERNAL_SERVICE_H -#include FT_WINFONTS_H - - -FT_BEGIN_HEADER - - -#define FT_SERVICE_ID_WINFNT "winfonts" - - typedef FT_Error - (*FT_WinFnt_GetHeaderFunc)( FT_Face face, - FT_WinFNT_HeaderRec *aheader ); - - - FT_DEFINE_SERVICE( WinFnt ) - { - FT_WinFnt_GetHeaderFunc get_header; - }; - - /* */ - - -FT_END_HEADER - - -#endif /* __SVWINFNT_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/services/svxf86nm.h b/reactos/lib/freetype/include/freetype/internal/services/svxf86nm.h deleted file mode 100644 index 3a33abcd8de..00000000000 --- a/reactos/lib/freetype/include/freetype/internal/services/svxf86nm.h +++ /dev/null @@ -1,55 +0,0 @@ -/***************************************************************************/ -/* */ -/* svxf86nm.h */ -/* */ -/* The FreeType XFree86 services (specification only). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SVXF86NM_H__ -#define __SVXF86NM_H__ - -#include FT_INTERNAL_SERVICE_H - - -FT_BEGIN_HEADER - - - /* - * A trivial service used to return the name of a face's font driver, - * according to the XFree86 nomenclature. Note that the service data - * is a simple constant string pointer. - */ - -#define FT_SERVICE_ID_XF86_NAME "xf86-driver-name" - -#define FT_XF86_FORMAT_TRUETYPE "TrueType" -#define FT_XF86_FORMAT_TYPE_1 "Type 1" -#define FT_XF86_FORMAT_BDF "BDF" -#define FT_XF86_FORMAT_PCF "PCF" -#define FT_XF86_FORMAT_TYPE_42 "Type 42" -#define FT_XF86_FORMAT_CID "CID Type 1" -#define FT_XF86_FORMAT_CFF "CFF" -#define FT_XF86_FORMAT_PFR "PFR" -#define FT_XF86_FORMAT_WINFNT "Windows FNT" - - /* */ - - -FT_END_HEADER - - -#endif /* __SVXF86NM_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/include/freetype/internal/sfnt.h b/reactos/lib/freetype/include/freetype/internal/sfnt.h index 2a9a645db18..10b2275531a 100644 --- a/reactos/lib/freetype/include/freetype/internal/sfnt.h +++ b/reactos/lib/freetype/include/freetype/internal/sfnt.h @@ -125,6 +125,11 @@ FT_BEGIN_HEADER (*TT_Done_Face_Func)( TT_Face face ); + typedef FT_Module_Interface + (*SFNT_Get_Interface_Func)( FT_Module module, + const char* func_interface ); + + /*************************************************************************/ /* */ /* <FuncType> */ @@ -250,27 +255,20 @@ FT_BEGIN_HEADER /* returns its metrics. */ /* */ /* <Input> */ - /* face :: */ - /* The target face object. */ + /* face :: The target face object. */ /* */ - /* strike_index :: */ - /* The strike index. */ + /* x_ppem :: The horizontal resolution in points per EM. */ /* */ - /* glyph_index :: */ - /* The current glyph index. */ + /* y_ppem :: The vertical resolution in points per EM. */ /* */ - /* load_flags :: */ - /* The current load flags. */ + /* glyph_index :: The current glyph index. */ /* */ - /* stream :: */ - /* The input stream. */ + /* stream :: The input stream. */ /* */ /* <Output> */ - /* amap :: */ - /* The target pixmap. */ + /* amap :: The target pixmap. */ /* */ - /* ametrics :: */ - /* A big sbit metrics structure for the glyph image. */ + /* ametrics :: A big sbit metrics structure for the glyph image. */ /* */ /* <Return> */ /* FreeType error code. 0 means success. Returns an error if no */ @@ -314,8 +312,8 @@ FT_BEGIN_HEADER /* */ typedef FT_Error (*TT_Set_SBit_Strike_Func)( TT_Face face, - FT_UInt x_ppem, - FT_UInt y_ppem, + FT_Int x_ppem, + FT_Int y_ppem, FT_ULong *astrike_index ); @@ -368,6 +366,57 @@ FT_BEGIN_HEADER FT_Bool vertical ); + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* TT_CharMap_Load_Func */ + /* */ + /* <Description> */ + /* Loads a given TrueType character map into memory. */ + /* */ + /* <Input> */ + /* face :: A handle to the parent face object. */ + /* */ + /* stream :: A handle to the current stream object. */ + /* */ + /* <InOut> */ + /* cmap :: A pointer to a cmap object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The function assumes that the stream is already in use (i.e., */ + /* opened). In case of error, all partially allocated tables are */ + /* released. */ + /* */ + typedef FT_Error + (*TT_CharMap_Load_Func)( TT_Face face, + TT_CMapTable cmap, + FT_Stream input ); + + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* TT_CharMap_Free_Func */ + /* */ + /* <Description> */ + /* Destroys a character mapping table. */ + /* */ + /* <Input> */ + /* face :: A handle to the parent face object. */ + /* */ + /* cmap :: A handle to a cmap object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + typedef FT_Error + (*TT_CharMap_Free_Func)( TT_Face face, + TT_CMapTable cmap ); + + /*************************************************************************/ /* */ /* <FuncType> */ @@ -408,6 +457,22 @@ FT_BEGIN_HEADER (*TT_Free_Table_Func)( TT_Face face ); + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* SFNT_Load_Table_Func */ + /* */ + /* <Description> */ + /* Loads a given SFNT table into memory. */ + /* */ + typedef FT_Error + (*SFNT_Load_Table_Func)( FT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ); + + /*************************************************************************/ /* */ /* <Struct> */ @@ -427,7 +492,7 @@ FT_BEGIN_HEADER TT_Init_Face_Func init_face; TT_Load_Face_Func load_face; TT_Done_Face_Func done_face; - FT_Module_Requester get_interface; + SFNT_Get_Interface_Func get_interface; TT_Load_Any_Func load_any; TT_Load_SFNT_HeaderRec_Func load_sfnt_header; @@ -466,6 +531,10 @@ FT_BEGIN_HEADER TT_Get_PS_Name_Func get_psname; TT_Free_Table_Func free_psnames; + /* see `ttcmap.h' */ + TT_CharMap_Load_Func load_charmap; + TT_CharMap_Free_Func free_charmap; + } SFNT_Interface; diff --git a/reactos/lib/freetype/include/freetype/internal/t1types.h b/reactos/lib/freetype/include/freetype/internal/t1types.h index 702bb1e4c68..f6f68f4a58e 100644 --- a/reactos/lib/freetype/include/freetype/internal/t1types.h +++ b/reactos/lib/freetype/include/freetype/internal/t1types.h @@ -5,7 +5,7 @@ /* Basic Type1/Type2 type definitions and interface (specification */ /* only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -23,9 +23,8 @@ #include <ft2build.h> #include FT_TYPE1_TABLES_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include FT_INTERNAL_POSTSCRIPT_HINTS_H -#include FT_INTERNAL_SERVICE_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H FT_BEGIN_HEADER @@ -102,21 +101,21 @@ FT_BEGIN_HEADER FT_Int num_subrs; FT_Byte** subrs; - FT_PtrDist* subrs_len; + FT_Int* subrs_len; FT_Int num_glyphs; FT_String** glyph_names; /* array of glyph names */ FT_Byte** charstrings; /* array of glyph charstrings */ - FT_PtrDist* charstrings_len; + FT_Int* charstrings_len; - FT_Byte paint_type; + FT_Byte* paint_type; FT_Byte font_type; FT_Matrix font_matrix; FT_Vector font_offset; FT_BBox font_bbox; FT_Long font_id; - FT_Fixed stroke_width; + FT_Fixed* stroke_width; } T1_FontRec, *T1_Font; @@ -142,6 +141,17 @@ FT_BEGIN_HEADER /*************************************************************************/ + /*************************************************************************/ + /* */ + /* This structure/class is defined here because it is common to the */ + /* following formats: TTF, OpenType-TT, and OpenType-CFF. */ + /* */ + /* Note, however, that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */ + /* are not shared between font drivers, and are thus defined normally in */ + /* `ttobjs.h'. */ + /* */ + /*************************************************************************/ + typedef struct T1_FaceRec_* T1_Face; typedef struct CID_FaceRec_* CID_Face; @@ -159,7 +169,7 @@ FT_BEGIN_HEADER /* support for Multiple Masters fonts */ PS_Blend blend; - + /* since FT 2.1 - interface to PostScript hinter */ const void* pshinter; @@ -173,10 +183,8 @@ FT_BEGIN_HEADER void* psaux; CID_FaceInfoRec cid; void* afm_data; - FT_Byte* binary_data; /* used if hex data has been converted */ - FT_Stream cid_stream; CID_Subrs subrs; - + /* since FT 2.1 - interface to PostScript hinter */ void* pshinter; diff --git a/reactos/lib/freetype/include/freetype/internal/tttypes.h b/reactos/lib/freetype/include/freetype/internal/tttypes.h index 1e451ac1803..736d9075157 100644 --- a/reactos/lib/freetype/include/freetype/internal/tttypes.h +++ b/reactos/lib/freetype/include/freetype/internal/tttypes.h @@ -105,6 +105,41 @@ FT_BEGIN_HEADER } SFNT_HeaderRec, *SFNT_Header; + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_TableDirRec */ + /* */ + /* <Description> */ + /* This structure models a TrueType table directory. It is used to */ + /* access the various tables of the font face. */ + /* */ + /* <Fields> */ + /* version :: The version number; starts with 0x00010000. */ + /* */ + /* numTables :: The number of tables. */ + /* */ + /* searchRange :: Unused. */ + /* */ + /* entrySelector :: Unused. */ + /* */ + /* rangeShift :: Unused. */ + /* */ + /* <Note> */ + /* This structure is only used during font opening. */ + /* */ + typedef struct TT_TableDirRec_ + { + FT_Fixed version; /* should be 0x10000 */ + FT_UShort numTables; /* number of tables */ + + FT_UShort searchRange; /* These parameters are only used */ + FT_UShort entrySelector; /* for a dichotomy search in the */ + FT_UShort rangeShift; /* directory. We ignore them. */ + + } TT_TableDirRec; + + /*************************************************************************/ /* */ /* <Struct> */ @@ -133,6 +168,61 @@ FT_BEGIN_HEADER } TT_TableRec, *TT_Table; + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_CMapDirRec */ + /* */ + /* <Description> */ + /* This structure describes the directory of the `cmap' table, */ + /* containing the font's character mappings table. */ + /* */ + /* <Fields> */ + /* tableVersionNumber :: The version number. */ + /* */ + /* numCMaps :: The number of charmaps in the font. */ + /* */ + /* <Note> */ + /* This structure is only used during font loading. */ + /* */ + typedef struct TT_CMapDirRec_ + { + FT_UShort tableVersionNumber; + FT_UShort numCMaps; + + } TT_CMapDirRec, *TT_CMapDir; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_CMapDirEntryRec */ + /* */ + /* <Description> */ + /* This structure describes a charmap in a TrueType font. */ + /* */ + /* <Fields> */ + /* platformID :: An ID used to specify for which platform this */ + /* charmap is defined (FreeType manages all platforms). */ + /* */ + /* encodingID :: A platform-specific ID used to indicate which source */ + /* encoding is used in this charmap. */ + /* */ + /* offset :: The offset of the charmap relative to the start of */ + /* the `cmap' table. */ + /* */ + /* <Note> */ + /* This structure is only used during font loading. */ + /* */ + typedef struct TT_CMapDirEntryRec_ + { + FT_UShort platformID; + FT_UShort platformEncodingID; + FT_Long offset; + + } TT_CMapDirEntryRec, *TT_CMapDirEntry; + + /*************************************************************************/ /* */ /* <Struct> */ @@ -818,6 +908,201 @@ FT_BEGIN_HEADER } TT_Post_NamesRec, *TT_Post_Names; + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /*** ***/ + /*** ***/ + /*** TRUETYPE CHARMAPS SUPPORT ***/ + /*** ***/ + /*** ***/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + /* format 0 */ + + typedef struct TT_CMap0_ + { + FT_ULong language; /* for Mac fonts (originally ushort) */ + + FT_Byte* glyphIdArray; + + } TT_CMap0Rec, *TT_CMap0; + + + /* format 2 */ + + typedef struct TT_CMap2SubHeaderRec_ + { + FT_UShort firstCode; /* first valid low byte */ + FT_UShort entryCount; /* number of valid low bytes */ + FT_Short idDelta; /* delta value to glyphIndex */ + FT_UShort idRangeOffset; /* offset from here to 1st code */ + + } TT_CMap2SubHeaderRec, *TT_CMap2SubHeader; + + + typedef struct TT_CMap2Rec_ + { + FT_ULong language; /* for Mac fonts (originally ushort) */ + + FT_UShort* subHeaderKeys; /* high byte mapping table */ + /* value = subHeader index * 8 */ + TT_CMap2SubHeader subHeaders; + FT_UShort* glyphIdArray; + FT_UShort numGlyphId; /* control value */ + + } TT_CMap2Rec, *TT_CMap2; + + + /* format 4 */ + + typedef struct TT_CMap4Segment_ + { + FT_UShort endCount; + FT_UShort startCount; + FT_Short idDelta; + FT_UShort idRangeOffset; + + } TT_CMap4SegmentRec, *TT_CMap4Segment; + + + typedef struct TT_CMap4Rec_ + { + FT_ULong language; /* for Mac fonts (originally ushort) */ + + FT_UShort segCountX2; /* number of segments * 2 */ + FT_UShort searchRange; /* these parameters can be used */ + FT_UShort entrySelector; /* for a binary search */ + FT_UShort rangeShift; + + TT_CMap4Segment segments; + FT_UShort* glyphIdArray; + FT_UShort numGlyphId; /* control value */ + + TT_CMap4Segment last_segment; /* last used segment; this is a small */ + /* cache to potentially increase speed */ + } TT_CMap4Rec, *TT_CMap4; + + + /* format 6 */ + + typedef struct TT_CMap6_ + { + FT_ULong language; /* for Mac fonts (originally ushort) */ + + FT_UShort firstCode; /* first character code of subrange */ + FT_UShort entryCount; /* number of character codes in subrange */ + + FT_UShort* glyphIdArray; + + } TT_CMap6Rec, *TT_CMap6; + + + /* auxiliary table for format 8 and 12 */ + + typedef struct TT_CMapGroupRec_ + { + FT_ULong startCharCode; + FT_ULong endCharCode; + FT_ULong startGlyphID; + + } TT_CMapGroupRec, *TT_CMapGroup; + + + /* FreeType handles format 8 and 12 identically. It is not necessary to + cover mixed 16bit and 32bit codes since FreeType always uses FT_ULong + for input character codes -- converting Unicode surrogates to 32bit + character codes must be done by the application. */ + + typedef struct TT_CMap8_12Rec_ + { + FT_ULong language; /* for Mac fonts */ + + FT_ULong nGroups; + TT_CMapGroup groups; + + TT_CMapGroup last_group; /* last used group; this is a small */ + /* cache to potentially increase speed */ + } TT_CMap8_12Rec, *TT_CMap8_12; + + + /* format 10 */ + + typedef struct TT_CMap10Rec_ + { + FT_ULong language; /* for Mac fonts */ + + FT_ULong startCharCode; /* first character covered */ + FT_ULong numChars; /* number of characters covered */ + + FT_UShort* glyphs; + + } TT_CMap10Rec, *TT_CMap10; + + + typedef struct TT_CMapTableRec_* TT_CMapTable; + + + typedef FT_UInt + (*TT_CharMap_Func)( TT_CMapTable charmap, + FT_ULong char_code ); + + typedef FT_ULong + (*TT_CharNext_Func)( TT_CMapTable charmap, + FT_ULong char_code ); + + + /* charmap table */ + typedef struct TT_CMapTableRec_ + { + FT_UShort platformID; + FT_UShort platformEncodingID; + FT_UShort format; + FT_ULong length; /* must be ulong for formats 8, 10, and 12 */ + + FT_Bool loaded; + FT_ULong offset; + + union + { + TT_CMap0Rec cmap0; + TT_CMap2Rec cmap2; + TT_CMap4Rec cmap4; + TT_CMap6Rec cmap6; + TT_CMap8_12Rec cmap8_12; + TT_CMap10Rec cmap10; + } c; + + TT_CharMap_Func get_index; + TT_CharNext_Func get_next_char; + + } TT_CMapTableRec; + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* TT_CharMapRec */ + /* */ + /* <Description> */ + /* The TrueType character map object type. */ + /* */ + /* <Fields> */ + /* root :: The parent character map structure. */ + /* */ + /* cmap :: The used character map. */ + /* */ + typedef struct TT_CharMapRec_ + { + FT_CharMapRec root; + TT_CMapTableRec cmap; + + } TT_CharMapRec; + + /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ @@ -836,8 +1121,9 @@ FT_BEGIN_HEADER /* This structure/class is defined here because it is common to the */ /* following formats: TTF, OpenType-TT, and OpenType-CFF. */ /* */ - /* Note, however, that the classes TT_Size and TT_GlyphSlot are not */ - /* shared between font drivers, and are thus defined in `ttobjs.h'. */ + /* Note, however, that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */ + /* are not shared between font drivers, and are thus defined in */ + /* `ttobjs.h'. */ /* */ /*************************************************************************/ @@ -859,6 +1145,17 @@ FT_BEGIN_HEADER typedef struct TT_FaceRec_* TT_Face; + /*************************************************************************/ + /* */ + /* <Type> */ + /* TT_CharMap */ + /* */ + /* <Description> */ + /* A handle to a TrueType character mapping object. */ + /* */ + typedef struct TT_CharMapRec_* TT_CharMap; + + /* a function type used for the truetype bytecode interpreter hooks */ typedef FT_Error (*TT_Interpreter)( void* exec_context ); @@ -1044,6 +1341,15 @@ FT_BEGIN_HEADER /* cmap_size :: The size in bytes of the `cmap_table' */ /* described above. */ /* */ + /* num_charmaps :: The number of character mappings in the */ + /* font. */ + /* */ + /* charmaps :: The array of charmap objects for this font */ + /* file. Note that this field is a typeless */ + /* pointer. The Reason is that the format of */ + /* charmaps varies with the underlying font */ + /* format and cannot be determined here. */ + /* */ /* goto_table :: A function called by each TrueType table */ /* loader to position a stream's cursor to */ /* the start of a given table according to */ @@ -1069,9 +1375,10 @@ FT_BEGIN_HEADER /* It must be called after the header was */ /* read, and before the `forget'. */ /* */ - /* sfnt :: A pointer to the SFNT service. */ + /* sfnt :: A pointer to the SFNT `driver' interface. */ /* */ - /* psnames :: A pointer to the PostScript names service. */ + /* psnames :: A pointer to the `PSNames' module */ + /* interface. */ /* */ /* hdmx :: The face's horizontal device metrics */ /* (`hdmx' table). This table is optional in */ @@ -1190,15 +1497,14 @@ FT_BEGIN_HEADER TT_Loader_ReadGlyphFunc read_simple_glyph; TT_Loader_ReadGlyphFunc read_composite_glyph; - /* a typeless pointer to the SFNT_Interface table used to load */ - /* the basic TrueType tables in the face object */ + /* a typeless pointer to the SFNT_Interface table used to load */ + /* the basic TrueType tables in the face object */ void* sfnt; - /* a typeless pointer to the FT_Service_PsCMapsRec table used to */ - /* handle glyph names <-> unicode & Mac values */ + /* a typeless pointer to the PSNames_Interface table used to */ + /* handle glyph names <-> unicode & Mac values */ void* psnames; - /***********************************************************************/ /* */ /* Optional TrueType/OpenType tables */ @@ -1270,8 +1576,6 @@ FT_BEGIN_HEADER FT_Generic extra; - const char* postscript_name; - } TT_FaceRec; diff --git a/reactos/lib/freetype/include/freetype/t1tables.h b/reactos/lib/freetype/include/freetype/t1tables.h index af8c416117d..70ea43897fe 100644 --- a/reactos/lib/freetype/include/freetype/t1tables.h +++ b/reactos/lib/freetype/include/freetype/t1tables.h @@ -24,12 +24,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/include/freetype/ttnameid.h b/reactos/lib/freetype/include/freetype/ttnameid.h index 848374fe227..8b56686bb44 100644 --- a/reactos/lib/freetype/include/freetype/ttnameid.h +++ b/reactos/lib/freetype/include/freetype/ttnameid.h @@ -291,7 +291,6 @@ FT_BEGIN_HEADER #define TT_ADOBE_ID_STANDARD 0 #define TT_ADOBE_ID_EXPERT 1 #define TT_ADOBE_ID_CUSTOM 2 -#define TT_ADOBE_ID_LATIN_1 3 /*************************************************************************/ diff --git a/reactos/lib/freetype/include/freetype/tttables.h b/reactos/lib/freetype/include/freetype/tttables.h index 22247913efb..2d2e63c9080 100644 --- a/reactos/lib/freetype/include/freetype/tttables.h +++ b/reactos/lib/freetype/include/freetype/tttables.h @@ -24,12 +24,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER @@ -572,6 +566,11 @@ FT_BEGIN_HEADER /* */ + /* internal use only */ + typedef void* + (*FT_Get_Sfnt_Table_Func)( FT_Face face, + FT_Sfnt_Tag tag ); + /*************************************************************************/ /* */ @@ -663,27 +662,6 @@ FT_BEGIN_HEADER FT_Byte* buffer, FT_ULong* length ); - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_CMap_Language_ID */ - /* */ - /* <Description> */ - /* Return TrueType/sfnt specific cmap language ID. Definitions of */ - /* language ID values are in freetype/ttnameid.h. */ - /* */ - /* <Input> */ - /* charmap :: */ - /* The target charmap. */ - /* */ - /* <Return> */ - /* The language ID of `charmap'. If `charmap' doesn't belong to a */ - /* TrueType/sfnt face, just return 0 as the default value. */ - /* */ - FT_EXPORT( FT_ULong ) - FT_Get_CMap_Language_ID( FT_CharMap charmap ); - /* */ diff --git a/reactos/lib/freetype/include/freetype/tttags.h b/reactos/lib/freetype/include/freetype/tttags.h index ac64758b103..df09f2a69c4 100644 --- a/reactos/lib/freetype/include/freetype/tttags.h +++ b/reactos/lib/freetype/include/freetype/tttags.h @@ -23,12 +23,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/include/freetype/ttunpat.h b/reactos/lib/freetype/include/freetype/ttunpat.h index 0bc0a6fe092..e4885aaa32d 100644 --- a/reactos/lib/freetype/include/freetype/ttunpat.h +++ b/reactos/lib/freetype/include/freetype/ttunpat.h @@ -25,12 +25,6 @@ #include <ft2build.h> #include FT_FREETYPE_H -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - FT_BEGIN_HEADER diff --git a/reactos/lib/freetype/src/autofit/Jamfile b/reactos/lib/freetype/src/autofit/Jamfile deleted file mode 100644 index 3253c821ede..00000000000 --- a/reactos/lib/freetype/src/autofit/Jamfile +++ /dev/null @@ -1,18 +0,0 @@ -SubDir FT2_TOP src autofit ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = afangles afglobal afhints aflatin afloader afmodule ; - } - else - { - _sources = autofit ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/autofir Jamfile diff --git a/reactos/lib/freetype/src/autofit/afangles.c b/reactos/lib/freetype/src/autofit/afangles.c deleted file mode 100644 index 10a8cff2576..00000000000 --- a/reactos/lib/freetype/src/autofit/afangles.c +++ /dev/null @@ -1,214 +0,0 @@ -#include "aftypes.h" - - /* this table was generated for AF_ANGLE_PI = 256 */ -#define AF_ANGLE_MAX_ITERS 8 -#define AF_TRIG_MAX_ITERS 9 - - static const FT_Fixed - af_angle_arctan_table[9] = - { - 90, 64, 38, 20, 10, 5, 3, 1, 1 - }; - - - static FT_Int - af_angle_prenorm( FT_Vector* vec ) - { - FT_Fixed x, y, z; - FT_Int shift; - - - x = vec->x; - y = vec->y; - - z = ( ( x >= 0 ) ? x : - x ) | ( (y >= 0) ? y : -y ); - shift = 0; - - if ( z < ( 1L << 27 ) ) - { - do - { - shift++; - z <<= 1; - } while ( z < ( 1L << 27 ) ); - - vec->x = x << shift; - vec->y = y << shift; - } - else if ( z > ( 1L << 28 ) ) - { - do - { - shift++; - z >>= 1; - } while ( z > ( 1L << 28 ) ); - - vec->x = x >> shift; - vec->y = y >> shift; - shift = -shift; - } - return shift; - } - - - static void - af_angle_pseudo_polarize( FT_Vector* vec ) - { - FT_Fixed theta; - FT_Fixed yi, i; - FT_Fixed x, y; - const FT_Fixed *arctanptr; - - - x = vec->x; - y = vec->y; - - /* Get the vector into the right half plane */ - theta = 0; - if ( x < 0 ) - { - x = -x; - y = -y; - theta = 2 * AF_ANGLE_PI2; - } - - if ( y > 0 ) - theta = - theta; - - arctanptr = af_angle_arctan_table; - - if ( y < 0 ) - { - /* Rotate positive */ - yi = y + ( x << 1 ); - x = x - ( y << 1 ); - y = yi; - theta -= *arctanptr++; /* Subtract angle */ - } - else - { - /* Rotate negative */ - yi = y - ( x << 1 ); - x = x + ( y << 1 ); - y = yi; - theta += *arctanptr++; /* Add angle */ - } - - i = 0; - do - { - if ( y < 0 ) - { - /* Rotate positive */ - yi = y + ( x >> i ); - x = x - ( y >> i ); - y = yi; - theta -= *arctanptr++; - } - else - { - /* Rotate negative */ - yi = y - ( x >> i ); - x = x + ( y >> i ); - y = yi; - theta += *arctanptr++; - } - } while ( ++i < AF_TRIG_MAX_ITERS ); - - /* round theta */ - if ( theta >= 0 ) - theta = FT_PAD_ROUND( theta, 4 ); - else - theta = - FT_PAD_ROUND( theta, 4 ); - - vec->x = x; - vec->y = theta; - } - - - /* documentation is in fttrigon.h */ - - FT_LOCAL_DEF( AF_Angle ) - af_angle_atan( FT_Fixed dx, - FT_Fixed dy ) - { - FT_Vector v; - - - if ( dx == 0 && dy == 0 ) - return 0; - - v.x = dx; - v.y = dy; - af_angle_prenorm( &v ); - af_angle_pseudo_polarize( &v ); - - return v.y; - } - - - - FT_LOCAL_DEF( AF_Angle ) - af_angle_diff( AF_Angle angle1, - AF_Angle angle2 ) - { - AF_Angle delta = angle2 - angle1; - - delta %= AF_ANGLE_2PI; - if ( delta < 0 ) - delta += AF_ANGLE_2PI; - - if ( delta > AF_ANGLE_PI ) - delta -= AF_ANGLE_2PI; - - return delta; - } - - - /* well, this needs to be somewhere, right :-) - */ - - FT_LOCAL_DEF( void ) - af_sort_pos( FT_UInt count, - FT_Pos* table ) - { - FT_UInt i, j; - FT_Pos swap; - - - for ( i = 1; i < count; i++ ) - { - for ( j = i; j > 0; j-- ) - { - if ( table[j] > table[j - 1] ) - break; - - swap = table[j]; - table[j] = table[j - 1]; - table[j - 1] = swap; - } - } - } - - - FT_LOCAL_DEF( void ) - af_sort_widths( FT_UInt count, - AF_Width table ) - { - FT_UInt i, j; - AF_WidthRec swap; - - - for ( i = 1; i < count; i++ ) - { - for ( j = i; j > 0; j-- ) - { - if ( table[j].org > table[j - 1].org ) - break; - - swap = table[j]; - table[j] = table[j - 1]; - table[j - 1] = swap; - } - } - } diff --git a/reactos/lib/freetype/src/autofit/afglobal.c b/reactos/lib/freetype/src/autofit/afglobal.c deleted file mode 100644 index 636203637ed..00000000000 --- a/reactos/lib/freetype/src/autofit/afglobal.c +++ /dev/null @@ -1,231 +0,0 @@ -#include "afglobal.h" -#include "aflatin.h" - - /* populate this list when you add new scripts - */ - static AF_ScriptClass const af_script_classes[] = - { - & af_latin_script_class, - - NULL /* do not remove */ - }; - -#define AF_SCRIPT_LIST_DEFAULT 0 /* index of default script in 'af_script_classes' */ -#define AF_SCRIPT_LIST_NONE 255 /* indicates an uncovered glyph */ - - /* - * note that glyph_scripts[] is used to map each glyph into - * an index into the 'af_script_classes' array. - * - */ - typedef struct AF_FaceGlobalsRec_ - { - FT_Face face; - FT_UInt glyph_count; /* same as face->num_glyphs */ - FT_Byte* glyph_scripts; - - AF_ScriptMetrics metrics[ AF_SCRIPT_MAX ]; - - } AF_FaceGlobalsRec; - - - - - /* this function is used to compute the script index of each glyph - * within a given face - */ - static FT_Error - af_face_globals_compute_script_coverage( AF_FaceGlobals globals ) - { - FT_Error error = 0; - FT_Face face = globals->face; - FT_CharMap old_charmap = face->charmap; - FT_Byte* gscripts = globals->glyph_scripts; - FT_UInt ss; - - /* the value 255 means "uncovered glyph" - */ - FT_MEM_SET( globals->glyph_scripts, - AF_SCRIPT_LIST_NONE, - globals->glyph_count ); - - error = FT_Select_Charmap( face, FT_ENCODING_UNICODE ); - if ( error ) - { - /* ignore this error, we'll simply use Latin as the standard - * script. XXX: Shouldn't we rather disable hinting ?? - */ - error = 0; - goto Exit; - } - - /* scan each script in a Unicode charmap - */ - for ( ss = 0; af_script_classes[ss]; ss++ ) - { - AF_ScriptClass clazz = af_script_classes[ss]; - AF_Script_UniRange range; - - /* scan all unicode points in the range, and set the corresponding - * glyph script index - */ - for ( range = clazz->script_uni_ranges; range->first != 0; range++ ) - { - FT_ULong charcode = range->first; - FT_UInt gindex; - - gindex = FT_Get_Char_Index( face, charcode ); - - if ( gindex != 0 && - gindex < globals->glyph_count && - gscripts[ gindex ] == AF_SCRIPT_LIST_NONE ) - { - gscripts[ gindex ] = (FT_Byte) ss; - } - for (;;) - { - charcode = FT_Get_Next_Char( face, charcode, &gindex ); - - if ( gindex == 0 || charcode > range->last ) - break; - - if ( gindex < globals->glyph_count && - gscripts[ gindex ] == AF_SCRIPT_LIST_NONE ) - { - gscripts[ gindex ] = (FT_Byte) ss; - } - } - } - } - - Exit: - /* by default, all uncovered glyphs are set to the latin script - * XXX: shouldnt' we disable hinting or do something similar ? - */ - { - FT_UInt nn; - - for ( nn = 0; nn < globals->glyph_count; nn++ ) - { - if ( gscripts[ nn ] == AF_SCRIPT_LIST_NONE ) - gscripts[ nn ] = AF_SCRIPT_LIST_DEFAULT; - } - } - - FT_Set_Charmap( face, old_charmap ); - return error; - } - - - - FT_LOCAL_DEF( FT_Error ) - af_face_globals_new( FT_Face face, - AF_FaceGlobals *aglobals ) - { - FT_Error error; - FT_Memory memory; - AF_FaceGlobals globals; - - memory = face->memory; - - if ( !FT_ALLOC( globals, sizeof(*globals) + - face->num_glyphs*sizeof(FT_Byte) ) ) - { - globals->face = face; - globals->glyph_count = face->num_glyphs; - globals->glyph_scripts = (FT_Byte*)( globals+1 ); - - error = af_face_globals_compute_script_coverage( globals ); - if ( error ) - { - af_face_globals_free( globals ); - globals = NULL; - } - } - - *aglobals = globals; - return error; - } - - - FT_LOCAL_DEF( void ) - af_face_globals_free( AF_FaceGlobals globals ) - { - if ( globals ) - { - FT_Memory memory = globals->face->memory; - FT_UInt nn; - - for ( nn = 0; nn < AF_SCRIPT_MAX; nn++ ) - { - if ( globals->metrics[nn] ) - { - AF_ScriptClass clazz = af_script_classes[nn]; - - FT_ASSERT( globals->metrics[nn]->clazz == clazz ); - - if ( clazz->script_metrics_done ) - clazz->script_metrics_done( globals->metrics[nn] ); - - FT_FREE( globals->metrics[nn] ); - } - } - - globals->glyph_count = 0; - globals->glyph_scripts = NULL; /* no need to free this one !! */ - globals->face = NULL; - FT_FREE( globals ); - } - } - - - FT_LOCAL_DEF( FT_Error ) - af_face_globals_get_metrics( AF_FaceGlobals globals, - FT_UInt gindex, - AF_ScriptMetrics *ametrics ) - { - AF_ScriptMetrics metrics = NULL; - FT_UInt index; - AF_ScriptClass clazz; - FT_Error error = 0; - - if ( gindex >= globals->glyph_count ) - { - error = FT_Err_Invalid_Argument; - goto Exit; - } - - index = globals->glyph_scripts[ gindex ]; - clazz = af_script_classes[ index ]; - metrics = globals->metrics[ clazz->script ]; - if ( metrics == NULL ) - { - /* create the global metrics object when needed - */ - FT_Memory memory = globals->face->memory; - - if ( FT_ALLOC( metrics, clazz->script_metrics_size ) ) - goto Exit; - - metrics->clazz = clazz; - - if ( clazz->script_metrics_init ) - { - error = clazz->script_metrics_init( metrics, globals->face ); - if ( error ) - { - if ( clazz->script_metrics_done ) - clazz->script_metrics_done( metrics ); - - FT_FREE( metrics ); - goto Exit; - } - } - - globals->metrics[ clazz->script ] = metrics; - } - - Exit: - *ametrics = metrics; - return error; - } diff --git a/reactos/lib/freetype/src/autofit/afglobal.h b/reactos/lib/freetype/src/autofit/afglobal.h deleted file mode 100644 index 64f35c3fff9..00000000000 --- a/reactos/lib/freetype/src/autofit/afglobal.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __AF_GLOBAL_H__ -#define __AF_GLOBAL_H__ - -#include "aftypes.h" - -FT_BEGIN_HEADER - - /**************************************************************************/ - /**************************************************************************/ - /***** *****/ - /***** F A C E G L O B A L S *****/ - /***** *****/ - /**************************************************************************/ - /**************************************************************************/ - - - /* - * models the global hints data for a given face, decomposed into - * script-specific items.. - * - */ - typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals; - - - FT_LOCAL( FT_Error ) - af_face_globals_new( FT_Face face, - AF_FaceGlobals *aglobals ); - - FT_LOCAL( FT_Error ) - af_face_globals_get_metrics( AF_FaceGlobals globals, - FT_UInt gindex, - AF_ScriptMetrics *ametrics ); - - FT_LOCAL( void ) - af_face_globals_free( AF_FaceGlobals globals ); - - /* */ - -FT_END_HEADER - -#endif /* __AF_GLOBALS_H__ */ diff --git a/reactos/lib/freetype/src/autofit/afhints.c b/reactos/lib/freetype/src/autofit/afhints.c deleted file mode 100644 index 4cc55ebefd0..00000000000 --- a/reactos/lib/freetype/src/autofit/afhints.c +++ /dev/null @@ -1,934 +0,0 @@ -#include "afhints.h" - -#ifdef AF_DEBUG - -#include <stdio.h> - - void - af_glyph_hints_dump_edges( AF_GlyphHints hints ) - { - AF_Edge edges; - AF_Edge edge_limit; - AF_Segment segments; - FT_Int dimension; - - - edges = hints->horz_edges; - edge_limit = edges + hints->num_hedges; - segments = hints->horz_segments; - - for ( dimension = 1; dimension >= 0; dimension-- ) - { - AF_Edge edge; - - - printf ( "Table of %s edges:\n", - !dimension ? "vertical" : "horizontal" ); - printf ( " [ index | pos | dir | link |" - " serif | blue | opos | pos ]\n" ); - - for ( edge = edges; edge < edge_limit; edge++ ) - { - printf ( " [ %5d | %4d | %5s | %4d | %5d | %c | %5.2f | %5.2f ]\n", - edge - edges, - (int)edge->fpos, - edge->dir == AF_DIR_UP - ? "up" - : ( edge->dir == AF_DIR_DOWN - ? "down" - : ( edge->dir == AF_DIR_LEFT - ? "left" - : ( edge->dir == AF_DIR_RIGHT - ? "right" - : "none" ) ) ), - edge->link ? ( edge->link - edges ) : -1, - edge->serif ? ( edge->serif - edges ) : -1, - edge->blue_edge ? 'y' : 'n', - edge->opos / 64.0, - edge->pos / 64.0 ); - } - - edges = hints->vert_edges; - edge_limit = edges + hints->num_vedges; - segments = hints->vert_segments; - } - } - - - /* A function used to dump the array of linked segments */ - void - af_glyph_hints_dump_segments( AF_GlyphHints hints ) - { - AF_Segment segments; - AF_Segment segment_limit; - AF_Point points; - FT_Int dimension; - - - points = hints->points; - segments = hints->horz_segments; - segment_limit = segments + hints->num_hsegments; - - for ( dimension = 1; dimension >= 0; dimension-- ) - { - AF_Segment seg; - - - printf ( "Table of %s segments:\n", - !dimension ? "vertical" : "horizontal" ); - printf ( " [ index | pos | dir | link | serif |" - " numl | first | start ]\n" ); - - for ( seg = segments; seg < segment_limit; seg++ ) - { - printf ( " [ %5d | %4d | %5s | %4d | %5d | %4d | %5d | %5d ]\n", - seg - segments, - (int)seg->pos, - seg->dir == AF_DIR_UP - ? "up" - : ( seg->dir == AF_DIR_DOWN - ? "down" - : ( seg->dir == AF_DIR_LEFT - ? "left" - : ( seg->dir == AF_DIR_RIGHT - ? "right" - : "none" ) ) ), - seg->link ? ( seg->link - segments ) : -1, - seg->serif ? ( seg->serif - segments ) : -1, - (int)seg->num_linked, - seg->first - points, - seg->last - points ); - } - - segments = hints->vert_segments; - segment_limit = segments + hints->num_vsegments; - } - } - -#endif /* AF_DEBUG */ - - - /* compute the direction value of a given vector */ - FT_LOCAL_DEF( AF_Direction ) - af_direction_compute( FT_Pos dx, - FT_Pos dy ) - { - AF_Direction dir; - FT_Pos ax = ABS( dx ); - FT_Pos ay = ABS( dy ); - - - dir = AF_DIR_NONE; - - /* atan(1/12) == 4.7 degrees */ - - /* test for vertical direction */ - if ( ax * 12 < ay ) - { - dir = dy > 0 ? AF_DIR_UP : AF_DIR_DOWN; - } - /* test for horizontal direction */ - else if ( ay * 12 < ax ) - { - dir = dx > 0 ? AF_DIR_RIGHT : AF_DIR_LEFT; - } - - return dir; - } - - - /* compute all inflex points in a given glyph */ - static void - af_glyph_hints_compute_inflections( AF_GlyphHints hints ) - { - AF_Point* contour = hints->contours; - AF_Point* contour_limit = contour + hints->num_contours; - - - /* do each contour separately */ - for ( ; contour < contour_limit; contour++ ) - { - AF_Point point = contour[0]; - AF_Point first = point; - AF_Point start = point; - AF_Point end = point; - AF_Point before; - AF_Point after; - AF_Angle angle_in, angle_seg, angle_out; - AF_Angle diff_in, diff_out; - FT_Int finished = 0; - - - /* compute first segment in contour */ - first = point; - - start = end = first; - do - { - end = end->next; - if ( end == first ) - goto Skip; - - } while ( end->fx == first->fx && end->fy == first->fy ); - - angle_seg = af_angle_atan( end->fx - start->fx, - end->fy - start->fy ); - - /* extend the segment start whenever possible */ - before = start; - do - { - do - { - start = before; - before = before->prev; - if ( before == first ) - goto Skip; - - } while ( before->fx == start->fx && before->fy == start->fy ); - - angle_in = af_angle_atan( start->fx - before->fx, - start->fy - before->fy ); - - } while ( angle_in == angle_seg ); - - first = start; - diff_in = af_angle_diff( angle_in, angle_seg ); - - /* now, process all segments in the contour */ - do - { - /* first, extend current segment's end whenever possible */ - after = end; - do - { - do - { - end = after; - after = after->next; - if ( after == first ) - finished = 1; - - } while ( end->fx == after->fx && end->fy == after->fy ); - - angle_out = af_angle_atan( after->fx - end->fx, - after->fy - end->fy ); - - } while ( angle_out == angle_seg ); - - diff_out = af_angle_diff( angle_seg, angle_out ); - - if ( ( diff_in ^ diff_out ) < 0 ) - { - /* diff_in and diff_out have different signs, we have */ - /* inflection points here... */ - do - { - start->flags |= AF_FLAG_INFLECTION; - start = start->next; - - } while ( start != end ); - - start->flags |= AF_FLAG_INFLECTION; - } - - start = end; - end = after; - angle_seg = angle_out; - diff_in = diff_out; - - } while ( !finished ); - - Skip: - ; - } - } - - - - FT_LOCAL_DEF( void ) - af_glyph_hints_init( AF_GlyphHints hints, - FT_Memory memory ) - { - FT_ZERO( hints ); - hints->memory = memory; - } - - - - FT_LOCAL_DEF( void ) - af_glyph_hints_done( AF_GlyphHints hints ) - { - if ( hints && hints->memory ) - { - FT_Memory memory = hints->memory; - AF_Dimension dim; - - /* note that we don't need to free the segment and edge - * buffers, since they're really within the hints->points array - */ - for ( dim = 0; dim < 2; dim++ ) - { - AF_AxisHints axis = &hints->axis[ dim ]; - - axis->num_segments = 0; - axis->num_edges = 0; - axis->segments = NULL; - axis->edges = NULL; - } - - FT_FREE( hints->contours ); - hints->max_contours = 0; - hints->num_contours = 0; - - FT_FREE( hints->points ); - hints->num_points = 0; - hints->max_points = 0; - - hints->memory = NULL; - } - } - - - - FT_LOCAL_DEF( FT_Error ) - af_glyph_hints_reset( AF_GlyphHints hints, - AF_Scaler scaler, - FT_Outline* outline ) - { - FT_Error error = FT_Err_Ok; - AF_Point points; - FT_UInt old_max, new_max; - FT_Fixed x_scale = scaler->x_scale; - FT_Fixed y_scale = scaler->y_scale; - FT_Pos x_delta = scaler->x_delta; - FT_Pos y_delta = scaler->y_delta; - FT_Memory memory = hints->memory; - - hints->scaler_flags = scaler->flags; - hints->other_flags = 0; - - hints->num_points = 0; - hints->num_contours = 0; - - hints->axis[0].num_segments = 0; - hints->axis[0].num_edges = 0; - hints->axis[1].num_segments = 0; - hints->axis[1].num_edges = 0; - - /* first of all, reallocate the contours array when necessary - */ - new_max = (FT_UInt) outline->n_contours; - old_max = hints->max_contours; - if ( new_max > old_max ) - { - new_max = (new_max + 3) & ~3; - - if ( FT_RENEW_ARRAY( hints->contours, old_max, new_max ) ) - goto Exit; - - hints->max_contours = new_max; - } - - /* then, reallocate the points, segments & edges arrays if needed -- - * note that we reserved two additional point positions, used to - * hint metrics appropriately - */ - new_max = (FT_UInt)( outline->n_points + 2 ); - old_max = hints->max_points; - if ( new_max > old_max ) - { - FT_Byte* items; - FT_ULong off1, off2, off3; - - /* we store in a single buffer the following arrays: - * - * - an array of N AF_PointRec items - * - an array of 2*N AF_SegmentRec items - * - an array of 2*N AF_EdgeRec items - * - */ - - new_max = ( new_max + 2 + 7 ) & ~7; - -#undef OFF_INCREMENT -#define OFF_INCREMENT( _off, _type, _count ) \ - ( FT_PAD_CEIL( _off, sizeof(_type) ) + (_count)*sizeof(_type)) - - off1 = OFF_INCREMENT( 0, AF_PointRec, new_max ); - off2 = OFF_INCREMENT( off1, AF_SegmentRec, new_max ); - off3 = OFF_INCREMENT( off2, AF_EdgeRec, new_max*2 ); - - FT_FREE( hints->points ); - - if ( FT_ALLOC( items, off3 ) ) - { - hints->max_points = 0; - hints->axis[0].segments = NULL; - hints->axis[0].edges = NULL; - hints->axis[1].segments = NULL; - hints->axis[1].edges = NULL; - goto Exit; - } - - /* readjust some pointers - */ - hints->max_points = new_max; - hints->points = (AF_Point) items; - - hints->axis[0].segments = (AF_Segment)( items + off1 ); - hints->axis[1].segments = hints->axis[0].segments + new_max; - - hints->axis[0].edges = (AF_Edge) ( items + off2 ); - hints->axis[1].edges = hints->axis[0].edges + new_max; - } - - hints->num_points = outline->n_points; - hints->num_contours = outline->n_contours; - - - /* We can't rely on the value of `FT_Outline.flags' to know the fill */ - /* direction used for a glyph, given that some fonts are broken (e.g. */ - /* the Arphic ones). We thus recompute it each time we need to. */ - /* */ - hints->axis[ AF_DIMENSION_HORZ ].major_dir = AF_DIR_UP; - hints->axis[ AF_DIMENSION_VERT ].major_dir = AF_DIR_LEFT; - - if ( FT_Outline_Get_Orientation( outline ) == FT_ORIENTATION_POSTSCRIPT ) - { - hints->axis[ AF_DIMENSION_HORZ ].major_dir = AF_DIR_DOWN; - hints->axis[ AF_DIMENSION_VERT ].major_dir = AF_DIR_RIGHT; - } - - hints->x_scale = x_scale; - hints->y_scale = y_scale; - hints->x_delta = x_delta; - hints->y_delta = y_delta; - - points = hints->points; - if ( hints->num_points == 0 ) - goto Exit; - - { - AF_Point point; - AF_Point point_limit = points + hints->num_points; - - - /* compute coordinates & bezier flags */ - { - FT_Vector* vec = outline->points; - char* tag = outline->tags; - - - for ( point = points; point < point_limit; point++, vec++, tag++ ) - { - point->fx = vec->x; - point->fy = vec->y; - point->ox = point->x = FT_MulFix( vec->x, x_scale ) + x_delta; - point->oy = point->y = FT_MulFix( vec->y, y_scale ) + y_delta; - - switch ( FT_CURVE_TAG( *tag ) ) - { - case FT_CURVE_TAG_CONIC: - point->flags = AF_FLAG_CONIC; - break; - case FT_CURVE_TAG_CUBIC: - point->flags = AF_FLAG_CUBIC; - break; - default: - point->flags = 0; - ; - } - } - } - - /* compute `next' and `prev' */ - { - FT_Int contour_index; - AF_Point prev; - AF_Point first; - AF_Point end; - - - contour_index = 0; - - first = points; - end = points + outline->contours[0]; - prev = end; - - for ( point = points; point < point_limit; point++ ) - { - point->prev = prev; - if ( point < end ) - { - point->next = point + 1; - prev = point; - } - else - { - point->next = first; - contour_index++; - if ( point + 1 < point_limit ) - { - end = points + outline->contours[contour_index]; - first = point + 1; - prev = end; - } - } - } - } - - /* set-up the contours array */ - { - AF_Point* contour = hints->contours; - AF_Point* contour_limit = contour + hints->num_contours; - short* end = outline->contours; - short idx = 0; - - - for ( ; contour < contour_limit; contour++, end++ ) - { - contour[0] = points + idx; - idx = (short)( end[0] + 1 ); - } - } - - /* compute directions of in & out vectors */ - { - for ( point = points; point < point_limit; point++ ) - { - AF_Point prev; - AF_Point next; - FT_Pos in_x, in_y, out_x, out_y; - - - prev = point->prev; - in_x = point->fx - prev->fx; - in_y = point->fy - prev->fy; - - point->in_dir = af_direction_compute( in_x, in_y ); - - next = point->next; - out_x = next->fx - point->fx; - out_y = next->fy - point->fy; - - point->out_dir = af_direction_compute( out_x, out_y ); - - if ( point->flags & ( AF_FLAG_CONIC | AF_FLAG_CUBIC ) ) - { - Is_Weak_Point: - point->flags |= AF_FLAG_WEAK_INTERPOLATION; - } - else if ( point->out_dir == point->in_dir ) - { - AF_Angle angle_in, angle_out, delta; - - - if ( point->out_dir != AF_DIR_NONE ) - goto Is_Weak_Point; - - angle_in = af_angle_atan( in_x, in_y ); - angle_out = af_angle_atan( out_x, out_y ); - delta = af_angle_diff( angle_in, angle_out ); - - if ( delta < 2 && delta > -2 ) - goto Is_Weak_Point; - } - else if ( point->in_dir == -point->out_dir ) - goto Is_Weak_Point; - } - } - } - - /* compute inflection points - */ - af_glyph_hints_compute_inflections( hints ); - - Exit: - return error; - } - - - - - /* - * - * E D G E P O I N T G R I D - F I T T I N G - * - */ - - - FT_LOCAL_DEF( void ) - af_glyph_hints_align_edge_points( AF_GlyphHints hints, - AF_Dimension dim ) - { - AF_AxisHints axis = & hints->axis[ dim ]; - AF_Edge edges = axis->edges; - AF_Edge edge_limit = edges + axis->num_edges; - AF_Edge edge; - - for ( edge = edges; edge < edge_limit; edge++ ) - { - /* move the points of each segment */ - /* in each edge to the edge's position */ - AF_Segment seg = edge->first; - - - do - { - AF_Point point = seg->first; - - - for (;;) - { - if ( dim == AF_DIMENSION_HORZ ) - { - point->x = edge->pos; - point->flags |= AF_FLAG_TOUCH_X; - } - else - { - point->y = edge->pos; - point->flags |= AF_FLAG_TOUCH_Y; - } - - if ( point == seg->last ) - break; - - point = point->next; - } - - seg = seg->edge_next; - - } while ( seg != edge->first ); - } - } - - - /* - * - * S T R O N G P O I N T I N T E R P O L A T I O N - * - */ - - - /* hint the strong points -- this is equivalent to the TrueType `IP' */ - /* hinting instruction */ - FT_LOCAL_DEF( void ) - af_glyph_hints_align_strong_points( AF_GlyphHints hints, - AF_Dimension dim ) - { - AF_Point points = hints->points; - AF_Point point_limit = points + hints->num_points; - AF_AxisHints axis = &hints->axis[dim]; - AF_Edge edges = axis->edges; - AF_Edge edge_limit = edges + axis->num_edges; - AF_Flags touch_flag; - - - if ( dim == AF_DIMENSION_HORZ ) - touch_flag = AF_FLAG_TOUCH_X; - else - touch_flag = AF_FLAG_TOUCH_Y; - - if ( edges < edge_limit ) - { - AF_Point point; - AF_Edge edge; - - for ( point = points; point < point_limit; point++ ) - { - FT_Pos u, ou, fu; /* point position */ - FT_Pos delta; - - - if ( point->flags & touch_flag ) - continue; - - /* if this point is candidate to weak interpolation, we will */ - /* interpolate it after all strong points have been processed */ - if ( ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) && - !( point->flags & AF_FLAG_INFLECTION ) ) - continue; - - if ( dim == AF_DIMENSION_VERT ) - { - u = point->fy; - ou = point->oy; - } - else - { - u = point->fx; - ou = point->ox; - } - - fu = u; - - /* is the point before the first edge? */ - edge = edges; - delta = edge->fpos - u; - if ( delta >= 0 ) - { - u = edge->pos - ( edge->opos - ou ); - goto Store_Point; - } - - /* is the point after the last edge? */ - edge = edge_limit - 1; - delta = u - edge->fpos; - if ( delta >= 0 ) - { - u = edge->pos + ( ou - edge->opos ); - goto Store_Point; - } - - { - FT_UInt min, max, mid; - FT_Pos fpos; - - - /* find enclosing edges */ - min = 0; - max = edge_limit - edges; - - while ( min < max ) - { - mid = ( max + min ) >> 1; - edge = edges + mid; - fpos = edge->fpos; - - if ( u < fpos ) - max = mid; - else if ( u > fpos ) - min = mid + 1; - else - { - /* we are on the edge */ - u = edge->pos; - goto Store_Point; - } - } - - { - AF_Edge before = edges + min - 1; - AF_Edge after = edges + min + 0; - - - /* assert( before && after && before != after ) */ - if ( before->scale == 0 ) - before->scale = FT_DivFix( after->pos - before->pos, - after->fpos - before->fpos ); - - u = before->pos + FT_MulFix( fu - before->fpos, - before->scale ); - } - } - - - Store_Point: - - /* save the point position */ - if ( dim == AF_DIMENSION_HORZ ) - point->x = u; - else - point->y = u; - - point->flags |= touch_flag; - } - } - } - - - /* - * - * W E A K P O I N T I N T E R P O L A T I O N - * - */ - - static void - af_iup_shift( AF_Point p1, - AF_Point p2, - AF_Point ref ) - { - AF_Point p; - FT_Pos delta = ref->u - ref->v; - - - for ( p = p1; p < ref; p++ ) - p->u = p->v + delta; - - for ( p = ref + 1; p <= p2; p++ ) - p->u = p->v + delta; - } - - - static void - af_iup_interp( AF_Point p1, - AF_Point p2, - AF_Point ref1, - AF_Point ref2 ) - { - AF_Point p; - FT_Pos u; - FT_Pos v1 = ref1->v; - FT_Pos v2 = ref2->v; - FT_Pos d1 = ref1->u - v1; - FT_Pos d2 = ref2->u - v2; - - - if ( p1 > p2 ) - return; - - if ( v1 == v2 ) - { - for ( p = p1; p <= p2; p++ ) - { - u = p->v; - - if ( u <= v1 ) - u += d1; - else - u += d2; - - p->u = u; - } - return; - } - - if ( v1 < v2 ) - { - for ( p = p1; p <= p2; p++ ) - { - u = p->v; - - if ( u <= v1 ) - u += d1; - else if ( u >= v2 ) - u += d2; - else - u = ref1->u + FT_MulDiv( u - v1, ref2->u - ref1->u, v2 - v1 ); - - p->u = u; - } - } - else - { - for ( p = p1; p <= p2; p++ ) - { - u = p->v; - - if ( u <= v2 ) - u += d2; - else if ( u >= v1 ) - u += d1; - else - u = ref1->u + FT_MulDiv( u - v1, ref2->u - ref1->u, v2 - v1 ); - - p->u = u; - } - } - } - - - FT_LOCAL_DEF( void ) - af_glyph_hints_align_weak_points( AF_GlyphHints hints, - AF_Dimension dim ) - { - AF_Point points = hints->points; - AF_Point point_limit = points + hints->num_points; - AF_Point* contour = hints->contours; - AF_Point* contour_limit = contour + hints->num_contours; - AF_Flags touch_flag; - AF_Point point; - AF_Point end_point; - AF_Point first_point; - - - /* PASS 1: Move segment points to edge positions */ - - if ( dim == AF_DIMENSION_HORZ ) - { - touch_flag = AF_FLAG_TOUCH_X; - - for ( point = points; point < point_limit; point++ ) - { - point->u = point->x; - point->v = point->ox; - } - } - else - { - touch_flag = AF_FLAG_TOUCH_Y; - - for ( point = points; point < point_limit; point++ ) - { - point->u = point->y; - point->v = point->oy; - } - } - - point = points; - - for ( ; contour < contour_limit; contour++ ) - { - point = *contour; - end_point = point->prev; - first_point = point; - - while ( point <= end_point && !( point->flags & touch_flag ) ) - point++; - - if ( point <= end_point ) - { - AF_Point first_touched = point; - AF_Point cur_touched = point; - - - point++; - while ( point <= end_point ) - { - if ( point->flags & touch_flag ) - { - /* we found two successive touched points; we interpolate */ - /* all contour points between them */ - af_iup_interp( cur_touched + 1, point - 1, - cur_touched, point ); - cur_touched = point; - } - point++; - } - - if ( cur_touched == first_touched ) - { - /* this is a special case: only one point was touched in the */ - /* contour; we thus simply shift the whole contour */ - af_iup_shift( first_point, end_point, cur_touched ); - } - else - { - /* now interpolate after the last touched point to the end */ - /* of the contour */ - af_iup_interp( cur_touched + 1, end_point, - cur_touched, first_touched ); - - /* if the first contour point isn't touched, interpolate */ - /* from the contour start to the first touched point */ - if ( first_touched > points ) - af_iup_interp( first_point, first_touched - 1, - cur_touched, first_touched ); - } - } - } - - /* now save the interpolated values back to x/y */ - if ( dim == AF_DIMENSION_HORZ ) - { - for ( point = points; point < point_limit; point++ ) - point->x = point->u; - } - else - { - for ( point = points; point < point_limit; point++ ) - point->y = point->u; - } - } diff --git a/reactos/lib/freetype/src/autofit/afhints.h b/reactos/lib/freetype/src/autofit/afhints.h deleted file mode 100644 index 7283cc39e59..00000000000 --- a/reactos/lib/freetype/src/autofit/afhints.h +++ /dev/null @@ -1,241 +0,0 @@ -#ifndef __AFHINTS_H__ -#define __AFHINTS_H__ - -#include "aftypes.h" - -FT_BEGIN_HEADER - - /* - * The definition of outline glyph hints. These are shared by all - * script analysis routines (until now) - * - */ - - typedef enum - { - AF_DIMENSION_HORZ = 0, /* x coordinates, i.e. vertical segments & edges */ - AF_DIMENSION_VERT = 1, /* y coordinates, i.e. horizontal segments & edges */ - - AF_DIMENSION_MAX /* do not remove */ - - } AF_Dimension; - - - /* hint directions -- the values are computed so that two vectors are */ - /* in opposite directions iff `dir1+dir2 == 0' */ - typedef enum - { - AF_DIR_NONE = 4, - AF_DIR_RIGHT = 1, - AF_DIR_LEFT = -1, - AF_DIR_UP = 2, - AF_DIR_DOWN = -2 - - } AF_Direction; - - - /* point hint flags */ - typedef enum - { - AF_FLAG_NONE = 0, - - /* point type flags */ - AF_FLAG_CONIC = (1 << 0), - AF_FLAG_CUBIC = (1 << 1), - AF_FLAG_CONTROL = AF_FLAG_CONIC | AF_FLAG_CUBIC, - - /* point extremum flags */ - AF_FLAG_EXTREMA_X = (1 << 2), - AF_FLAG_EXTREMA_Y = (1 << 3), - - /* point roundness flags */ - AF_FLAG_ROUND_X = (1 << 4), - AF_FLAG_ROUND_Y = (1 << 5), - - /* point touch flags */ - AF_FLAG_TOUCH_X = (1 << 6), - AF_FLAG_TOUCH_Y = (1 << 7), - - /* candidates for weak interpolation have this flag set */ - AF_FLAG_WEAK_INTERPOLATION = (1 << 8), - - /* all inflection points in the outline have this flag set */ - AF_FLAG_INFLECTION = (1 << 9) - - } AF_Flags; - - - /* edge hint flags */ - typedef enum - { - AF_EDGE_NORMAL = 0, - AF_EDGE_ROUND = (1 << 0), - AF_EDGE_SERIF = (1 << 1), - AF_EDGE_DONE = (1 << 2) - - } AF_Edge_Flags; - - - - typedef struct AF_PointRec_* AF_Point; - typedef struct AF_SegmentRec_* AF_Segment; - typedef struct AF_EdgeRec_* AF_Edge; - - - typedef struct AF_PointRec_ - { - AF_Flags flags; /* point flags used by hinter */ - FT_Pos ox, oy; /* original, scaled position */ - FT_Pos fx, fy; /* original, unscaled position (font units) */ - FT_Pos x, y; /* current position */ - FT_Pos u, v; /* current (x,y) or (y,x) depending on context */ - - AF_Direction in_dir; /* direction of inwards vector */ - AF_Direction out_dir; /* direction of outwards vector */ - - AF_Point next; /* next point in contour */ - AF_Point prev; /* previous point in contour */ - - } AF_PointRec; - - - typedef struct AF_SegmentRec_ - { - AF_Edge_Flags flags; /* edge/segment flags for this segment */ - AF_Direction dir; /* segment direction */ - FT_Pos pos; /* position of segment */ - FT_Pos min_coord; /* minimum coordinate of segment */ - FT_Pos max_coord; /* maximum coordinate of segment */ - - AF_Edge edge; /* the segment's parent edge */ - AF_Segment edge_next; /* link to next segment in parent edge */ - - AF_Segment link; /* (stem) link segment */ - AF_Segment serif; /* primary segment for serifs */ - FT_Pos num_linked; /* number of linked segments */ - FT_Pos score; /* used during stem matching */ - - AF_Point first; /* first point in edge segment */ - AF_Point last; /* last point in edge segment */ - AF_Point* contour; /* ptr to first point of segment's contour */ - - } AF_SegmentRec; - - - typedef struct AF_EdgeRec_ - { - FT_Pos fpos; /* original, unscaled position (font units) */ - FT_Pos opos; /* original, scaled position */ - FT_Pos pos; /* current position */ - - AF_Edge_Flags flags; /* edge flags */ - AF_Direction dir; /* edge direction */ - FT_Fixed scale; /* used to speed up interpolation between edges */ - AF_Width blue_edge; /* non-NULL if this is a blue edge */ - - AF_Edge link; - AF_Edge serif; - FT_Int num_linked; - - FT_Int score; - - AF_Segment first; - AF_Segment last; - - } AF_EdgeRec; - - - typedef struct AF_AxisHintsRec_ - { - FT_Int num_segments; - AF_Segment segments; - - FT_Int num_edges; - AF_Edge edges; - - AF_Direction major_dir; - - } AF_AxisHintsRec, *AF_AxisHints; - - - typedef struct AF_GlyphHintsRec_ - { - FT_Memory memory; - - FT_Fixed x_scale; - FT_Pos x_delta; - - FT_Fixed y_scale; - FT_Pos y_delta; - - FT_Pos edge_distance_threshold; - - FT_Int max_points; - FT_Int num_points; - AF_Point points; - - FT_Int max_contours; - FT_Int num_contours; - AF_Point* contours; - - AF_AxisHintsRec axis[ AF_DIMENSION_MAX ]; - - FT_UInt32 scaler_flags; /* copy of scaler flags */ - FT_UInt32 other_flags; /* free for script-specific implementations */ - AF_ScriptMetrics metrics; - - } AF_GlyphHintsRec; - - -#define AF_HINTS_TEST_SCALER(h,f) ( (h)->scaler_flags & (f) ) -#define AF_HINTS_TEST_OTHER(h,f) ( (h)->other_flags & (f) ) - -#define AF_HINTS_DO_HORIZONTAL(h) \ - !AF_HINTS_TEST_SCALER(h,AF_SCALER_FLAG_NO_HORIZONTAL) - -#define AF_HINTS_DO_VERTICAL(h) \ - !AF_HINTS_TEST_SCALER(h,AF_SCALER_FLAG_NO_VERTICAL) - -#define AF_HINTS_DO_ADVANCE(h) \ - !AF_HINTS_TEST_SCALER(h,AF_SCALER_FLAG_NO_ADVANCE) - - - FT_LOCAL( AF_Direction ) - af_direction_compute( FT_Pos dx, - FT_Pos dy ); - - - FT_LOCAL( void ) - af_glyph_hints_init( AF_GlyphHints hints, - FT_Memory memory ); - - - - /* recomputes all AF_Point in a AF_GlyphHints from the definitions - * in a source outline - */ - FT_LOCAL( FT_Error ) - af_glyph_hints_reset( AF_GlyphHints hints, - AF_Scaler scaler, - FT_Outline* outline ); - - FT_LOCAL( void ) - af_glyph_hints_align_edge_points( AF_GlyphHints hints, - AF_Dimension dim ); - - FT_LOCAL( void ) - af_glyph_hints_align_strong_points( AF_GlyphHints hints, - AF_Dimension dim ); - - FT_LOCAL( void ) - af_glyph_hints_align_weak_points( AF_GlyphHints hints, - AF_Dimension dim ); - - FT_LOCAL( void ) - af_glyph_hints_done( AF_GlyphHints hints ); - -/* */ - -FT_END_HEADER - -#endif /* __AFHINTS_H__ */ diff --git a/reactos/lib/freetype/src/autofit/aflatin.c b/reactos/lib/freetype/src/autofit/aflatin.c deleted file mode 100644 index 0ddc562acfb..00000000000 --- a/reactos/lib/freetype/src/autofit/aflatin.c +++ /dev/null @@ -1,1784 +0,0 @@ -#include "aflatin.h" - - /***************************************************************************/ - /***************************************************************************/ - /***** *****/ - /***** L A T I N G L O B A L M E T R I C S *****/ - /***** *****/ - /***************************************************************************/ - /***************************************************************************/ - - static void - af_latin_metrics_init_widths( AF_LatinMetrics metrics, - FT_Face face ) - { - /* scan the array of segments in each direction */ - AF_GlyphHintsRec hints[1]; - - af_glyph_hints_init( hints, face->memory ); - - metrics->axis[ AF_DIMENSION_HORZ ].width_count = 0; - metrics->axis[ AF_DIMENSION_VERT ].width_count = 0; - - /* For now, compute the standard width and height from the `o' */ - { - FT_Error error; - FT_UInt glyph_index; - AF_Dimension dim; - AF_ScalerRec scaler[1]; - - - glyph_index = FT_Get_Char_Index( face, 'o' ); - if ( glyph_index == 0 ) - goto Exit; - - error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); - if ( error || face->glyph->outline.n_points <= 0 ) - goto Exit; - - scaler->x_scale = scaler->y_scale = 0x10000L; - scaler->x_delta = scaler->y_delta = 0; - scaler->face = face; - scaler->render_mode = 0; - scaler->flags = 0; - - error = af_glyph_hints_reset( hints, scaler, &face->glyph->outline ); - if ( error ) - goto Exit; - - for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ ) - { - AF_LatinAxis axis = & metrics->axis[ dim ]; - AF_AxisHints axhints = & hints->axis[ dim ]; - AF_Segment seg, limit, link; - FT_UInt num_widths = 0; - FT_Pos edge_distance_threshold = 32000; - - af_latin_hints_compute_segments( hints, dim ); - af_latin_hints_link_segments ( hints, dim ); - - seg = axhints->segments; - limit = seg + axhints->num_segments; - - for ( ; seg < limit; seg++ ) - { - link = seg->link; - /* we only consider stem segments there! */ - if ( link && link->link == seg && link > seg ) - { - FT_Pos dist; - - - dist = seg->pos - link->pos; - if ( dist < 0 ) - dist = -dist; - - if ( num_widths < AF_LATIN_MAX_WIDTHS ) - axis->widths[ num_widths++ ].org = dist; - } - } - - af_sort_widths( num_widths, axis->widths ); - axis->width_count = num_widths; - - /* we will now try to find the smallest width */ - if ( num_widths > 0 && axis->widths[0].org < edge_distance_threshold ) - edge_distance_threshold = axis->widths[0].org; - - /* Now, compute the edge distance threshold as a fraction of the */ - /* smallest width in the font. Set it in `hinter->glyph' too! */ - if ( edge_distance_threshold == 32000 ) - edge_distance_threshold = 50; - - /* let's try 20% */ - axis->edge_distance_threshold = edge_distance_threshold / 5; - } - } - - Exit: - af_glyph_hints_done( hints ); - } - - - -#define AF_LATIN_MAX_TEST_CHARACTERS 12 - - - static const char* const af_latin_blue_chars[ AF_LATIN_MAX_BLUES ] = - { - "THEZOCQS", - "HEZLOCUS", - "fijkdbh", - "xzroesc", - "xzroesc", - "pqgjy" - }; - - - static void - af_latin_metrics_init_blues( AF_LatinMetrics metrics, - FT_Face face ) - { - FT_Pos flats [ AF_LATIN_MAX_TEST_CHARACTERS ]; - FT_Pos rounds[ AF_LATIN_MAX_TEST_CHARACTERS ]; - FT_Int num_flats; - FT_Int num_rounds; - FT_Int bb; - AF_LatinBlue blue; - FT_Error error; - AF_LatinAxis axis = &metrics->axis[ AF_DIMENSION_VERT ]; - FT_GlyphSlot glyph = face->glyph; - - /* we compute the blues simply by loading each character from the */ - /* 'af_latin_blue_chars[blues]' string, then compute its top-most or */ - /* bottom-most points (depending on `AF_IS_TOP_BLUE') */ - - AF_LOG(( "blue zones computation\n" )); - AF_LOG(( "------------------------------------------------\n" )); - - for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ ) - { - const char* p = af_latin_blue_chars[bb]; - const char* limit = p + AF_LATIN_MAX_TEST_CHARACTERS; - FT_Pos* blue_ref; - FT_Pos* blue_shoot; - - AF_LOG(( "blue %3d: ", blue )); - - num_flats = 0; - num_rounds = 0; - - for ( ; p < limit && *p; p++ ) - { - FT_UInt glyph_index; - FT_Vector* extremum; - FT_Vector* points; - FT_Vector* point_limit; - FT_Vector* point; - FT_Bool round; - - - AF_LOG(( "'%c'", *p )); - - /* load the character in the face -- skip unknown or empty ones */ - glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p ); - if ( glyph_index == 0 ) - continue; - - error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); - if ( error || glyph->outline.n_points <= 0 ) - continue; - - /* now compute min or max point indices and coordinates */ - points = glyph->outline.points; - point_limit = points + glyph->outline.n_points; - point = points; - extremum = point; - point++; - - if ( AF_LATIN_IS_TOP_BLUE( bb ) ) - { - for ( ; point < point_limit; point++ ) - if ( point->y > extremum->y ) - extremum = point; - } - else - { - for ( ; point < point_limit; point++ ) - if ( point->y < extremum->y ) - extremum = point; - } - - AF_LOG(( "%5d", (int)extremum->y )); - - /* now, check whether the point belongs to a straight or round */ - /* segment; we first need to find in which contour the extremum */ - /* lies, then see its previous and next points */ - { - FT_Int idx = (FT_Int)( extremum - points ); - FT_Int n; - FT_Int first, last, prev, next, end; - FT_Pos dist; - - - last = -1; - first = 0; - - for ( n = 0; n < glyph->outline.n_contours; n++ ) - { - end = glyph->outline.contours[n]; - if ( end >= idx ) - { - last = end; - break; - } - first = end + 1; - } - - /* XXX: should never happen! */ - if ( last < 0 ) - continue; - - /* now look for the previous and next points that are not on the */ - /* same Y coordinate. Threshold the `closeness'... */ - - prev = idx; - next = prev; - - do - { - if ( prev > first ) - prev--; - else - prev = last; - - dist = points[prev].y - extremum->y; - if ( dist < -5 || dist > 5 ) - break; - - } while ( prev != idx ); - - do - { - if ( next < last ) - next++; - else - next = first; - - dist = points[next].y - extremum->y; - if ( dist < -5 || dist > 5 ) - break; - - } while ( next != idx ); - - /* now, set the `round' flag depending on the segment's kind */ - round = FT_BOOL( - FT_CURVE_TAG( glyph->outline.tags[prev] ) != FT_CURVE_TAG_ON || - FT_CURVE_TAG( glyph->outline.tags[next] ) != FT_CURVE_TAG_ON ); - - AF_LOG(( "%c ", round ? 'r' : 'f' )); - } - - if ( round ) - rounds[num_rounds++] = extremum->y; - else - flats[num_flats++] = extremum->y; - } - - AF_LOG(( "\n" )); - - if ( num_flats == 0 && num_rounds == 0 ) - { - /* we couldn't find a single glyph to compute this blue zone, - * we will simply ignore it then - */ - AF_LOG(( "empty !!\n" )); - continue; - } - - /* we have computed the contents of the `rounds' and `flats' tables, */ - /* now determine the reference and overshoot position of the blue -- */ - /* we simply take the median value after a simple sort */ - af_sort_pos( num_rounds, rounds ); - af_sort_pos( num_flats, flats ); - - blue = & axis->blues[ axis->blue_count ]; - blue_ref = & blue->ref.org; - blue_shoot = & blue->shoot.org; - - axis->blue_count ++; - - if ( num_flats == 0 ) - { - *blue_ref = - *blue_shoot = rounds[num_rounds / 2]; - } - else if ( num_rounds == 0 ) - { - *blue_ref = - *blue_shoot = flats[num_flats / 2]; - } - else - { - *blue_ref = flats[num_flats / 2]; - *blue_shoot = rounds[num_rounds / 2]; - } - - /* there are sometimes problems: if the overshoot position of top */ - /* zones is under its reference position, or the opposite for bottom */ - /* zones. We must thus check everything there and correct the errors */ - if ( *blue_shoot != *blue_ref ) - { - FT_Pos ref = *blue_ref; - FT_Pos shoot = *blue_shoot; - FT_Bool over_ref = FT_BOOL( shoot > ref ); - - - if ( AF_LATIN_IS_TOP_BLUE( bb ) ^ over_ref ) - *blue_shoot = *blue_ref = ( shoot + ref ) / 2; - } - - blue->flags = 0; - if ( AF_LATIN_IS_TOP_BLUE(bb) ) - blue->flags |= AF_LATIN_BLUE_TOP; - - AF_LOG(( "-- ref = %ld, shoot = %ld\n", *blue_ref, *blue_shoot )); - } - - return; - } - - - static FT_Error - af_latin_metrics_init( AF_LatinMetrics metrics, - FT_Face face ) - { - FT_Error error; - FT_CharMap oldmap = face->charmap; - - /* do we have a Unicode charmap in there? */ - error = FT_Select_Charmap( face, FT_ENCODING_UNICODE ); - if ( error ) goto Exit; - - metrics->units_per_em = face->units_per_EM; - - af_latin_metrics_init_widths( metrics, face ); - af_latin_metrics_init_blues( metrics, face ); - - Exit: - FT_Set_Charmap( face, oldmap ); - return error; - } - - - static void - af_latin_metrics_scale_dim( AF_LatinMetrics metrics, - AF_Scaler scaler, - AF_Dimension dim ) - { - FT_Fixed scale; - FT_Pos delta; - AF_LatinAxis axis; - FT_UInt nn; - - if ( dim == AF_DIMENSION_HORZ ) - { - scale = scaler->x_scale; - delta = scaler->x_delta; - } - else - { - scale = scaler->y_scale; - delta = scaler->y_delta; - } - - axis = & metrics->axis[ dim ]; - - if ( axis->org_scale == scale && axis->org_delta == delta ) - return; - - axis->org_scale = scale; - axis->org_delta = delta; - - /* XXX: TODO: Correct Y and X scale according to Chester rules - */ - axis->scale = scale; - axis->delta = delta; - - if ( dim == AF_DIMENSION_HORZ ) - { - metrics->scaler.x_scale = scale; - metrics->scaler.x_delta = delta; - } - else - { - metrics->scaler.y_scale = scale; - metrics->scaler.y_delta = delta; - } - - /* scale the standard widths - */ - for ( nn = 0; nn < axis->width_count; nn++ ) - { - AF_Width width = axis->widths + nn; - - width->cur = FT_MulFix( width->org, scale ); - width->fit = width->cur; - } - - if ( dim == AF_DIMENSION_VERT ) - { - /* scale the blue zones - */ - for ( nn = 0; nn < axis->blue_count; nn++ ) - { - AF_LatinBlue blue = & axis->blues[nn]; - FT_Pos dist; - - blue->ref.cur = FT_MulFix( blue->ref.org, scale ) + delta; - blue->ref.fit = blue->ref.cur; - - blue->shoot.cur = FT_MulFix( blue->shoot.org, scale ) + delta; - blue->shoot.fit = blue->shoot.cur; - - /* a blue zone is only active when it is less than 3/4 pixels tall - */ - dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale ); - if ( dist >= 48 || dist <= -48 ) - blue->flags |= ~AF_LATIN_BLUE_ACTIVE; - } - } - } - - - FT_LOCAL_DEF( void ) - af_latin_metrics_scale( AF_LatinMetrics metrics, - AF_Scaler scaler ) - { - metrics->scaler = scaler[0]; - - af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ ); - af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT ); - } - - - /***************************************************************************/ - /***************************************************************************/ - /***** *****/ - /***** L A T I N G L Y P H A N A L Y S I S *****/ - /***** *****/ - /***************************************************************************/ - /***************************************************************************/ - - FT_LOCAL_DEF( void ) - af_latin_hints_compute_segments( AF_GlyphHints hints, - AF_Dimension dim ) - { - AF_AxisHints axis = &hints->axis[dim]; - AF_Segment segments = axis->segments; - AF_Segment segment = segments; - FT_Int num_segments = 0; - AF_Point* contour = hints->contours; - AF_Point* contour_limit = contour + hints->num_contours; - AF_Direction major_dir, segment_dir; - -#ifdef AF_HINT_METRICS - AF_Point min_point = 0; - AF_Point max_point = 0; - FT_Pos min_coord = 32000; - FT_Pos max_coord = -32000; -#endif - - major_dir = ABS( axis->major_dir ); - segment_dir = major_dir; - - /* set up (u,v) in each point */ - if ( dim == AF_DIMENSION_HORZ ) - { - AF_Point point = hints->points; - AF_Point limit = point + hints->num_points; - - for ( ; point < limit; point++ ) - { - point->u = point->fx; - point->v = point->fy; - } - } - else - { - AF_Point point = hints->points; - AF_Point limit = point + hints->num_points; - - for ( ; point < limit; point++ ) - { - point->u = point->fy; - point->v = point->fx; - } - } - - - /* do each contour separately */ - for ( ; contour < contour_limit; contour++ ) - { - AF_Point point = contour[0]; - AF_Point last = point->prev; - int on_edge = 0; - FT_Pos min_pos = 32000; /* minimum segment pos != min_coord */ - FT_Pos max_pos = -32000; /* maximum segment pos != max_coord */ - FT_Bool passed; - - -#ifdef AF_HINT_METRICS - if ( point->u < min_coord ) - { - min_coord = point->u; - min_point = point; - } - if ( point->u > max_coord ) - { - max_coord = point->u; - max_point = point; - } -#endif - - if ( point == last ) /* skip singletons -- just in case */ - continue; - - if ( ABS( last->out_dir ) == major_dir && - ABS( point->out_dir ) == major_dir ) - { - /* we are already on an edge, try to locate its start */ - last = point; - - for (;;) - { - point = point->prev; - if ( ABS( point->out_dir ) != major_dir ) - { - point = point->next; - break; - } - if ( point == last ) - break; - } - } - - last = point; - passed = 0; - - for (;;) - { - FT_Pos u, v; - - - if ( on_edge ) - { - u = point->u; - if ( u < min_pos ) - min_pos = u; - if ( u > max_pos ) - max_pos = u; - - if ( point->out_dir != segment_dir || point == last ) - { - /* we are just leaving an edge; record a new segment! */ - segment->last = point; - segment->pos = ( min_pos + max_pos ) >> 1; - - /* a segment is round if either its first or last point */ - /* is a control point */ - if ( ( segment->first->flags | point->flags ) & - AF_FLAG_CONTROL ) - segment->flags |= AF_EDGE_ROUND; - - /* compute segment size */ - min_pos = max_pos = point->v; - - v = segment->first->v; - if ( v < min_pos ) - min_pos = v; - if ( v > max_pos ) - max_pos = v; - - segment->min_coord = min_pos; - segment->max_coord = max_pos; - - on_edge = 0; - num_segments++; - segment++; - /* fallthrough */ - } - } - - /* now exit if we are at the start/end point */ - if ( point == last ) - { - if ( passed ) - break; - passed = 1; - } - - if ( !on_edge && ABS( point->out_dir ) == major_dir ) - { - /* this is the start of a new segment! */ - segment_dir = point->out_dir; - - /* clear all segment fields */ - FT_ZERO( segment ); - - segment->dir = segment_dir; - segment->flags = AF_EDGE_NORMAL; - min_pos = max_pos = point->u; - segment->first = point; - segment->last = point; - segment->contour = contour; - segment->score = 32000; - segment->link = NULL; - on_edge = 1; - -#ifdef AF_HINT_METRICS - if ( point == max_point ) - max_point = 0; - - if ( point == min_point ) - min_point = 0; -#endif - } - - point = point->next; - } - - } /* contours */ - -#ifdef AF_HINT_METRICS - /* we need to ensure that there are edges on the left-most and */ - /* right-most points of the glyph in order to hint the metrics; */ - /* we do this by inserting fake segments when needed */ - if ( dim == AF_DIMENSION_HORZ ) - { - AF_Point point = hints->points; - AF_Point point_limit = point + hints->num_points; - - FT_Pos min_pos = 32000; - FT_Pos max_pos = -32000; - - - min_point = 0; - max_point = 0; - - /* compute minimum and maximum points */ - for ( ; point < point_limit; point++ ) - { - FT_Pos x = point->fx; - - - if ( x < min_pos ) - { - min_pos = x; - min_point = point; - } - if ( x > max_pos ) - { - max_pos = x; - max_point = point; - } - } - - /* insert minimum segment */ - if ( min_point ) - { - /* clear all segment fields */ - FT_ZERO( segment ); - - segment->dir = segment_dir; - segment->flags = AF_EDGE_NORMAL; - segment->first = min_point; - segment->last = min_point; - segment->pos = min_pos; - segment->score = 32000; - segment->link = NULL; - - num_segments++; - segment++; - } - - /* insert maximum segment */ - if ( max_point ) - { - /* clear all segment fields */ - FT_ZERO( segment ); - - segment->dir = segment_dir; - segment->flags = AF_EDGE_NORMAL; - segment->first = max_point; - segment->last = max_point; - segment->pos = max_pos; - segment->score = 32000; - segment->link = NULL; - - num_segments++; - segment++; - } - } -#endif /* AF_HINT_METRICS */ - - axis->num_segments = num_segments; - } - - - FT_LOCAL_DEF( void ) - af_latin_hints_link_segments( AF_GlyphHints hints, - AF_Dimension dim ) - { - AF_AxisHints axis = &hints->axis[dim]; - AF_Segment segments = axis->segments; - AF_Segment segment_limit = segments + axis->num_segments; - AF_Direction major_dir = axis->major_dir; - AF_Segment seg1, seg2; - - /* now compare each segment to the others */ - for ( seg1 = segments; seg1 < segment_limit; seg1++ ) - { - /* the fake segments are introduced to hint the metrics -- */ - /* we must never link them to anything */ - if ( seg1->first == seg1->last || seg1->dir != major_dir ) - continue; - - for ( seg2 = segments; seg2 < segment_limit; seg2++ ) - if ( seg2 != seg1 && seg1->dir + seg2->dir == 0 ) - { - FT_Pos pos1 = seg1->pos; - FT_Pos pos2 = seg2->pos; - FT_Pos dist = pos2 - pos1; - - - if ( dist < 0 ) - continue; - - { - FT_Pos min = seg1->min_coord; - FT_Pos max = seg1->max_coord; - FT_Pos len, score; - - - if ( min < seg2->min_coord ) - min = seg2->min_coord; - - if ( max > seg2->max_coord ) - max = seg2->max_coord; - - len = max - min; - if ( len >= 8 ) - { - score = dist + 3000 / len; - - if ( score < seg1->score ) - { - seg1->score = score; - seg1->link = seg2; - } - - if ( score < seg2->score ) - { - seg2->score = score; - seg2->link = seg1; - } - } - } - } - } - - /* now, compute the `serif' segments */ - for ( seg1 = segments; seg1 < segment_limit; seg1++ ) - { - seg2 = seg1->link; - - if ( seg2 ) - { - seg2->num_linked++; - if ( seg2->link != seg1 ) - { - seg1->link = 0; - seg1->serif = seg2->link; - } - } - } - } - - - FT_LOCAL_DEF( void ) - af_latin_hints_compute_edges( AF_GlyphHints hints, - AF_Dimension dim ) - { - AF_AxisHints axis = &hints->axis[dim]; - AF_Edge edges = axis->edges; - AF_Edge edge, edge_limit; - - AF_Segment segments = axis->segments; - AF_Segment segment_limit = segments + axis->num_segments; - AF_Segment seg; - - AF_Direction up_dir; - FT_Fixed scale; - FT_Pos edge_distance_threshold; - - - scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale - : hints->y_scale; - - up_dir = ( dim == AF_DIMENSION_HORZ ) ? AF_DIR_UP - : AF_DIR_RIGHT; - - /*********************************************************************/ - /* */ - /* We will begin by generating a sorted table of edges for the */ - /* current direction. To do so, we simply scan each segment and try */ - /* to find an edge in our table that corresponds to its position. */ - /* */ - /* If no edge is found, we create and insert a new edge in the */ - /* sorted table. Otherwise, we simply add the segment to the edge's */ - /* list which will be processed in the second step to compute the */ - /* edge's properties. */ - /* */ - /* Note that the edges table is sorted along the segment/edge */ - /* position. */ - /* */ - /*********************************************************************/ - - edge_distance_threshold = FT_MulFix( hints->edge_distance_threshold, - scale ); - if ( edge_distance_threshold > 64 / 4 ) - edge_distance_threshold = 64 / 4; - - edge_distance_threshold = FT_DivFix( edge_distance_threshold, - scale ); - - edge_limit = edges; - for ( seg = segments; seg < segment_limit; seg++ ) - { - AF_Edge found = 0; - - - /* look for an edge corresponding to the segment */ - for ( edge = edges; edge < edge_limit; edge++ ) - { - FT_Pos dist; - - - dist = seg->pos - edge->fpos; - if ( dist < 0 ) - dist = -dist; - - if ( dist < edge_distance_threshold ) - { - found = edge; - break; - } - } - - if ( !found ) - { - /* insert a new edge in the list and */ - /* sort according to the position */ - while ( edge > edges && edge[-1].fpos > seg->pos ) - { - edge[0] = edge[-1]; - edge--; - } - edge_limit++; - - /* clear all edge fields */ - FT_MEM_ZERO( edge, sizeof ( *edge ) ); - - /* add the segment to the new edge's list */ - edge->first = seg; - edge->last = seg; - edge->fpos = seg->pos; - edge->opos = edge->pos = FT_MulFix( seg->pos, scale ); - seg->edge_next = seg; - } - else - { - /* if an edge was found, simply add the segment to the edge's */ - /* list */ - seg->edge_next = edge->first; - edge->last->edge_next = seg; - edge->last = seg; - } - } - axis->num_edges = (FT_Int)( edge_limit - edges ); - - - /*********************************************************************/ - /* */ - /* Good, we will now compute each edge's properties according to */ - /* segments found on its position. Basically, these are: */ - /* */ - /* - edge's main direction */ - /* - stem edge, serif edge or both (which defaults to stem then) */ - /* - rounded edge, straight or both (which defaults to straight) */ - /* - link for edge */ - /* */ - /*********************************************************************/ - - /* first of all, set the `edge' field in each segment -- this is */ - /* required in order to compute edge links */ - - /* Note that I've tried to remove this loop, setting - * the "edge" field of each segment directly in the - * code above. For some reason, it slows down execution - * speed -- on a Sun. - */ - for ( edge = edges; edge < edge_limit; edge++ ) - { - seg = edge->first; - if ( seg ) - do - { - seg->edge = edge; - seg = seg->edge_next; - } - while ( seg != edge->first ); - } - - /* now, compute each edge properties */ - for ( edge = edges; edge < edge_limit; edge++ ) - { - FT_Int is_round = 0; /* does it contain round segments? */ - FT_Int is_straight = 0; /* does it contain straight segments? */ - FT_Pos ups = 0; /* number of upwards segments */ - FT_Pos downs = 0; /* number of downwards segments */ - - - seg = edge->first; - - do - { - FT_Bool is_serif; - - - /* check for roundness of segment */ - if ( seg->flags & AF_EDGE_ROUND ) - is_round++; - else - is_straight++; - - /* check for segment direction */ - if ( seg->dir == up_dir ) - ups += seg->max_coord-seg->min_coord; - else - downs += seg->max_coord-seg->min_coord; - - /* check for links -- if seg->serif is set, then seg->link must */ - /* be ignored */ - is_serif = (FT_Bool)( seg->serif && seg->serif->edge != edge ); - - if ( seg->link || is_serif ) - { - AF_Edge edge2; - AF_Segment seg2; - - - edge2 = edge->link; - seg2 = seg->link; - - if ( is_serif ) - { - seg2 = seg->serif; - edge2 = edge->serif; - } - - if ( edge2 ) - { - FT_Pos edge_delta; - FT_Pos seg_delta; - - - edge_delta = edge->fpos - edge2->fpos; - if ( edge_delta < 0 ) - edge_delta = -edge_delta; - - seg_delta = seg->pos - seg2->pos; - if ( seg_delta < 0 ) - seg_delta = -seg_delta; - - if ( seg_delta < edge_delta ) - edge2 = seg2->edge; - } - else - edge2 = seg2->edge; - - if ( is_serif ) - { - edge->serif = edge2; - edge2->flags |= AF_EDGE_SERIF; - } - else - edge->link = edge2; - } - - seg = seg->edge_next; - - } while ( seg != edge->first ); - - /* set the round/straight flags */ - edge->flags = AF_EDGE_NORMAL; - - if ( is_round > 0 && is_round >= is_straight ) - edge->flags |= AF_EDGE_ROUND; - - /* set the edge's main direction */ - edge->dir = AF_DIR_NONE; - - if ( ups > downs ) - edge->dir = up_dir; - - else if ( ups < downs ) - edge->dir = -up_dir; - - else if ( ups == downs ) - edge->dir = 0; /* both up and down! */ - - /* gets rid of serifs if link is set */ - /* XXX: This gets rid of many unpleasant artefacts! */ - /* Example: the `c' in cour.pfa at size 13 */ - - if ( edge->serif && edge->link ) - edge->serif = 0; - } - } - - - FT_LOCAL_DEF( void ) - af_latin_hints_detect_features( AF_GlyphHints hints, - AF_Dimension dim ) - { - af_latin_hints_compute_segments( hints, dim ); - af_latin_hints_link_segments ( hints, dim ); - af_latin_hints_compute_edges ( hints, dim ); - } - - - FT_LOCAL_DEF( void ) - af_latin_hints_compute_blue_edges( AF_GlyphHints hints, - AF_LatinMetrics metrics ) - { - AF_AxisHints axis = &hints->axis[ AF_DIMENSION_VERT ]; - AF_Edge edge = axis->edges; - AF_Edge edge_limit = edge + axis->num_edges; - AF_LatinAxis latin = &metrics->axis[ AF_DIMENSION_VERT ]; - FT_Fixed scale = latin->scale; - - - /* compute which blue zones are active, i.e. have their scaled */ - /* size < 3/4 pixels */ - - /* for each horizontal edge search the blue zone which is closest */ - for ( ; edge < edge_limit; edge++ ) - { - FT_Int bb; - AF_Width best_blue = NULL; - FT_Pos best_dist; /* initial threshold */ - - - /* compute the initial threshold as a fraction of the EM size */ - best_dist = FT_MulFix( metrics->units_per_em / 40, scale ); - - if ( best_dist > 64 / 2 ) - best_dist = 64 / 2; - - for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ ) - { - AF_LatinBlue blue = latin->blues + bb; - FT_Bool is_top_blue, is_major_dir; - - /* skip inactive blue zones (i.e. those that are too small - */ - if ( !(blue->flags & AF_LATIN_BLUE_ACTIVE) ) - continue; - - /* if it is a top zone, check for right edges -- if it is a bottom */ - /* zone, check for left edges */ - /* */ - /* of course, that's for TrueType */ - is_top_blue = (blue->flags & AF_LATIN_BLUE_TOP) != 0; - is_major_dir = FT_BOOL( edge->dir == axis->major_dir ); - - /* if it is a top zone, the edge must be against the major */ - /* direction; if it is a bottom zone, it must be in the major */ - /* direction */ - if ( is_top_blue ^ is_major_dir ) - { - FT_Pos dist; - - - /* first of all, compare it to the reference position */ - dist = edge->fpos - blue->ref.org; - if ( dist < 0 ) - dist = -dist; - - dist = FT_MulFix( dist, scale ); - if ( dist < best_dist ) - { - best_dist = dist; - best_blue = & blue->ref; - } - - /* now, compare it to the overshoot position if the edge is */ - /* rounded, and if the edge is over the reference position of a */ - /* top zone, or under the reference position of a bottom zone */ - if ( edge->flags & AF_EDGE_ROUND && dist != 0 ) - { - FT_Bool is_under_ref = FT_BOOL( edge->fpos < blue->ref.org ); - - - if ( is_top_blue ^ is_under_ref ) - { - blue = latin->blues + bb; - dist = edge->fpos - blue->shoot.org; - if ( dist < 0 ) - dist = -dist; - - dist = FT_MulFix( dist, scale ); - if ( dist < best_dist ) - { - best_dist = dist; - best_blue = & blue->shoot; - } - } - } - } - } - - if ( best_blue ) - edge->blue_edge = best_blue; - } - } - - - static FT_Error - af_latin_hints_init( AF_GlyphHints hints, - FT_Outline* outline, - AF_LatinMetrics metrics ) - { - FT_Error error; - FT_Render_Mode mode; - - error = af_glyph_hints_reset( hints, &metrics->scaler, outline ); - if (error) - goto Exit; - - - /* compute flags depending on render mode, etc... - */ - - mode = metrics->scaler.render_mode; - - /* we snap the width of vertical stems for the monochrome and - * horizontal LCD rendering targets only. - */ - if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD ) - hints->other_flags |= AF_LATIN_HINTS_HORZ_SNAP; - - /* we snap the width of horizontal stems for the monochrome and - * vertical LCD rendering targets only. - */ - if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V ) - hints->other_flags |= AF_LATIN_HINTS_VERT_SNAP; - - /* XXX - */ - if ( mode != FT_RENDER_MODE_LIGHT ) - hints->other_flags |= AF_LATIN_HINTS_STEM_ADJUST; - - if ( mode == FT_RENDER_MODE_MONO ) - hints->other_flags |= AF_LATIN_HINTS_MONO; - - /* analyze glyph outline - */ - if ( AF_HINTS_DO_HORIZONTAL(hints) ) - af_latin_hints_detect_features( hints, AF_DIMENSION_HORZ ); - - if ( AF_HINTS_DO_VERTICAL(hints) ) - { - af_latin_hints_detect_features( hints, AF_DIMENSION_VERT ); - af_latin_hints_compute_blue_edges( hints, metrics ); - } - - Exit: - return error; - } - - /***************************************************************************/ - /***************************************************************************/ - /***** *****/ - /***** L A T I N G L Y P H G R I D - F I T T I N G *****/ - /***** *****/ - /***************************************************************************/ - /***************************************************************************/ - - /* snap a given width in scaled coordinates to one of the */ - /* current standard widths */ - static FT_Pos - af_latin_snap_width( AF_Width widths, - FT_Int count, - FT_Pos width ) - { - int n; - FT_Pos best = 64 + 32 + 2; - FT_Pos reference = width; - FT_Pos scaled; - - - for ( n = 0; n < count; n++ ) - { - FT_Pos w; - FT_Pos dist; - - - w = widths[n].cur; - dist = width - w; - if ( dist < 0 ) - dist = -dist; - if ( dist < best ) - { - best = dist; - reference = w; - } - } - - scaled = FT_PIX_ROUND( reference ); - - if ( width >= reference ) - { - if ( width < scaled + 48 ) - width = reference; - } - else - { - if ( width > scaled - 48 ) - width = reference; - } - - return width; - } - - - /* compute the snapped width of a given stem */ - - static FT_Pos - af_latin_compute_stem_width( AF_GlyphHints hints, - AF_Dimension dim, - FT_Pos width, - AF_Edge_Flags base_flags, - AF_Edge_Flags stem_flags ) - { - AF_LatinMetrics metrics = (AF_LatinMetrics) hints->metrics; - AF_LatinAxis axis = & metrics->axis[ dim ]; - FT_Pos dist = width; - FT_Int sign = 0; - FT_Int vertical = AF_HINTS_DO_VERTICAL( hints ); - - - if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ) - return width; - - if ( dist < 0 ) - { - dist = -width; - sign = 1; - } - - if ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) || - ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) ) - { - /* smooth hinting process: very lightly quantize the stem width */ - /* */ - - /* leave the widths of serifs alone */ - - if ( ( stem_flags & AF_EDGE_SERIF ) && vertical && ( dist < 3 * 64 ) ) - goto Done_Width; - - else if ( ( base_flags & AF_EDGE_ROUND ) ) - { - if ( dist < 80 ) - dist = 64; - } - else if ( dist < 56 ) - dist = 56; - - if ( axis->width_count > 0 ) - { - FT_Pos delta; - - /* compare to standard width - */ - if ( axis->width_count > 0 ) - { - delta = dist - axis->widths[0].cur; - - if ( delta < 0 ) - delta = -delta; - - if ( delta < 40 ) - { - dist = axis->widths[ 0 ].cur; - if ( dist < 48 ) - dist = 48; - - goto Done_Width; - } - } - - if ( dist < 3 * 64 ) - { - delta = dist & 63; - dist &= -64; - - if ( delta < 10 ) - dist += delta; - - else if ( delta < 32 ) - dist += 10; - - else if ( delta < 54 ) - dist += 54; - - else - dist += delta; - } - else - dist = ( dist + 32 ) & ~63; - } - } - else - { - /* strong hinting process: snap the stem width to integer pixels */ - /* */ - dist = af_latin_snap_width( axis->widths, axis->width_count, dist ); - - if ( vertical ) - { - /* in the case of vertical hinting, always round */ - /* the stem heights to integer pixels */ - if ( dist >= 64 ) - dist = ( dist + 16 ) & ~63; - else - dist = 64; - } - else - { - if ( AF_LATIN_HINTS_DO_MONO( hints ) ) - { - /* monochrome horizontal hinting: snap widths to integer pixels */ - /* with a different threshold */ - if ( dist < 64 ) - dist = 64; - else - dist = ( dist + 32 ) & ~63; - } - else - { - /* for horizontal anti-aliased hinting, we adopt a more subtle */ - /* approach: we strengthen small stems, round stems whose size */ - /* is between 1 and 2 pixels to an integer, otherwise nothing */ - if ( dist < 48 ) - dist = ( dist + 64 ) >> 1; - - else if ( dist < 128 ) - dist = ( dist + 22 ) & ~63; - else - /* round otherwise to prevent color fringes in LCD mode */ - dist = ( dist + 32 ) & ~63; - } - } - } - - Done_Width: - if ( sign ) - dist = -dist; - - return dist; - } - - - - /* align one stem edge relative to the previous stem edge */ - static void - af_latin_align_linked_edge( AF_GlyphHints hints, - AF_Dimension dim, - AF_Edge base_edge, - AF_Edge stem_edge ) - { - FT_Pos dist = stem_edge->opos - base_edge->opos; - - FT_Pos fitted_width = af_latin_compute_stem_width( hints, - dim, - dist, - base_edge->flags, - stem_edge->flags ); - - stem_edge->pos = base_edge->pos + fitted_width; - } - - - static void - af_latin_align_serif_edge( AF_GlyphHints hints, - AF_Edge base, - AF_Edge serif ) - { - FT_UNUSED( hints ); - - serif->pos = base->pos + (serif->opos - base->opos); - } - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** E D G E H I N T I N G ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - FT_LOCAL_DEF( void ) - af_latin_hint_edges( AF_GlyphHints hints, - AF_Dimension dim ) - { - AF_AxisHints axis = & hints->axis[dim]; - AF_Edge edges = axis->edges; - AF_Edge edge_limit = edges + axis->num_edges; - FT_Int n_edges; - AF_Edge edge; - AF_Edge anchor = 0; - FT_Int has_serifs = 0; - - - /* we begin by aligning all stems relative to the blue zone */ - /* if needed -- that's only for horizontal edges */ - if ( dim == AF_DIMENSION_VERT ) - { - for ( edge = edges; edge < edge_limit; edge++ ) - { - AF_Width blue; - AF_Edge edge1, edge2; - - - if ( edge->flags & AF_EDGE_DONE ) - continue; - - blue = edge->blue_edge; - edge1 = NULL; - edge2 = edge->link; - - if ( blue ) - { - edge1 = edge; - } - else if ( edge2 && edge2->blue_edge ) - { - blue = edge2->blue_edge; - edge1 = edge2; - edge2 = edge; - } - - if ( !edge1 ) - continue; - - edge1->pos = blue->fit; - edge1->flags |= AF_EDGE_DONE; - - if ( edge2 && !edge2->blue_edge ) - { - af_latin_align_linked_edge( hints, dim, edge1, edge2 ); - edge2->flags |= AF_EDGE_DONE; - } - - if ( !anchor ) - anchor = edge; - } - } - - /* now we will align all stem edges, trying to maintain the */ - /* relative order of stems in the glyph */ - for ( edge = edges; edge < edge_limit; edge++ ) - { - AF_Edge edge2; - - - if ( edge->flags & AF_EDGE_DONE ) - continue; - - /* skip all non-stem edges */ - edge2 = edge->link; - if ( !edge2 ) - { - has_serifs++; - continue; - } - - /* now align the stem */ - - /* this should not happen, but it's better to be safe */ - if ( edge2->blue_edge || edge2 < edge ) - { - af_latin_align_linked_edge( hints, dim, edge2, edge ); - edge->flags |= AF_EDGE_DONE; - continue; - } - - if ( !anchor ) - { - FT_Pos org_len, org_center, cur_len; - FT_Pos cur_pos1, error1, error2, u_off, d_off; - - - org_len = edge2->opos - edge->opos; - cur_len = af_latin_compute_stem_width( hints, dim, org_len, - edge->flags, edge2->flags ); - if ( cur_len <= 64 ) - u_off = d_off = 32; - else - { - u_off = 38; - d_off = 26; - } - - if ( cur_len < 96 ) - { - org_center = edge->opos + ( org_len >> 1 ); - - cur_pos1 = FT_PIX_ROUND( org_center ); - - error1 = org_center - ( cur_pos1 - u_off ); - if ( error1 < 0 ) - error1 = -error1; - - error2 = org_center - ( cur_pos1 + d_off ); - if ( error2 < 0 ) - error2 = -error2; - - if ( error1 < error2 ) - cur_pos1 -= u_off; - else - cur_pos1 += d_off; - - edge->pos = cur_pos1 - cur_len / 2; - edge2->pos = cur_pos1 + cur_len / 2; - - } - else - edge->pos = FT_PIX_ROUND( edge->opos ); - - anchor = edge; - - edge->flags |= AF_EDGE_DONE; - - af_latin_align_linked_edge( hints, dim, edge, edge2 ); - } - else - { - FT_Pos org_pos, org_len, org_center, cur_len; - FT_Pos cur_pos1, cur_pos2, delta1, delta2; - - - org_pos = anchor->pos + ( edge->opos - anchor->opos ); - org_len = edge2->opos - edge->opos; - org_center = org_pos + ( org_len >> 1 ); - - cur_len = af_latin_compute_stem_width( hints, dim, org_len, - edge->flags, edge2->flags ); - - if ( cur_len < 96 ) - { - FT_Pos u_off, d_off; - - - cur_pos1 = FT_PIX_ROUND( org_center ); - - if (cur_len <= 64 ) - u_off = d_off = 32; - else - { - u_off = 38; - d_off = 26; - } - - delta1 = org_center - ( cur_pos1 - u_off ); - if ( delta1 < 0 ) - delta1 = -delta1; - - delta2 = org_center - ( cur_pos1 + d_off ); - if ( delta2 < 0 ) - delta2 = -delta2; - - if ( delta1 < delta2 ) - cur_pos1 -= u_off; - else - cur_pos1 += d_off; - - edge->pos = cur_pos1 - cur_len / 2; - edge2->pos = cur_pos1 + cur_len / 2; - } - else - { - org_pos = anchor->pos + ( edge->opos - anchor->opos ); - org_len = edge2->opos - edge->opos; - org_center = org_pos + ( org_len >> 1 ); - - cur_len = af_latin_compute_stem_width( hints, dim, org_len, - edge->flags, edge2->flags ); - - cur_pos1 = FT_PIX_ROUND( org_pos ); - delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center ); - if ( delta1 < 0 ) - delta1 = -delta1; - - cur_pos2 = FT_PIX_ROUND( org_pos + org_len ) - cur_len; - delta2 = ( cur_pos2 + ( cur_len >> 1 ) - org_center ); - if ( delta2 < 0 ) - delta2 = -delta2; - - edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2; - edge2->pos = edge->pos + cur_len; - } - - edge->flags |= AF_EDGE_DONE; - edge2->flags |= AF_EDGE_DONE; - - if ( edge > edges && edge->pos < edge[-1].pos ) - edge->pos = edge[-1].pos; - } - } - - /* make sure that lowercase m's maintain their symmetry */ - - /* In general, lowercase m's have six vertical edges if they are sans */ - /* serif, or twelve if they are avec serif. This implementation is */ - /* based on that assumption, and seems to work very well with most */ - /* faces. However, if for a certain face this assumption is not */ - /* true, the m is just rendered like before. In addition, any stem */ - /* correction will only be applied to symmetrical glyphs (even if the */ - /* glyph is not an m), so the potential for unwanted distortion is */ - /* relatively low. */ - - /* We don't handle horizontal edges since we can't easily assure that */ - /* the third (lowest) stem aligns with the base line; it might end up */ - /* one pixel higher or lower. */ - - n_edges = edge_limit - edges; - if ( dim == AF_DIMENSION_HORZ && ( n_edges == 6 || n_edges == 12 ) ) - { - AF_Edge edge1, edge2, edge3; - FT_Pos dist1, dist2, span, delta; - - - if ( n_edges == 6 ) - { - edge1 = edges; - edge2 = edges + 2; - edge3 = edges + 4; - } - else - { - edge1 = edges + 1; - edge2 = edges + 5; - edge3 = edges + 9; - } - - dist1 = edge2->opos - edge1->opos; - dist2 = edge3->opos - edge2->opos; - - span = dist1 - dist2; - if ( span < 0 ) - span = -span; - - if ( span < 8 ) - { - delta = edge3->pos - ( 2 * edge2->pos - edge1->pos ); - edge3->pos -= delta; - if ( edge3->link ) - edge3->link->pos -= delta; - - /* move the serifs along with the stem */ - if ( n_edges == 12 ) - { - ( edges + 8 )->pos -= delta; - ( edges + 11 )->pos -= delta; - } - - edge3->flags |= AF_EDGE_DONE; - if ( edge3->link ) - edge3->link->flags |= AF_EDGE_DONE; - } - } - - if ( has_serifs || !anchor ) - { - /* now hint the remaining edges (serifs and single) in order - * to complete our processing - */ - for ( edge = edges; edge < edge_limit; edge++ ) - { - if ( edge->flags & AF_EDGE_DONE ) - continue; - - if ( edge->serif ) - af_latin_align_serif_edge( hints, edge->serif, edge ); - else if ( !anchor ) - { - edge->pos = FT_PIX_ROUND( edge->opos ); - anchor = edge; - } - else - edge->pos = anchor->pos + - FT_PIX_ROUND( edge->opos - anchor->opos ); - - edge->flags |= AF_EDGE_DONE; - - if ( edge > edges && edge->pos < edge[-1].pos ) - edge->pos = edge[-1].pos; - - if ( edge + 1 < edge_limit && - edge[1].flags & AF_EDGE_DONE && - edge->pos > edge[1].pos ) - edge->pos = edge[1].pos; - } - } - } - - - static FT_Error - af_latin_hints_apply( AF_GlyphHints hints, - AF_LatinMetrics metrics ) - { - AF_Dimension dim; - - FT_UNUSED( metrics ); - - for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ ) - { - if ( (dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL(hints)) || - (dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL(hints)) ) - { - af_latin_hint_edges( hints, dim ); - af_glyph_hints_align_edge_points( hints, dim ); - af_glyph_hints_align_strong_points( hints, dim ); - af_glyph_hints_align_weak_points( hints, dim ); - } - } - return 0; - } - - /***************************************************************************/ - /***************************************************************************/ - /***** *****/ - /***** L A T I N S C R I P T C L A S S *****/ - /***** *****/ - /***************************************************************************/ - /***************************************************************************/ - - static const AF_Script_UniRangeRec af_latin_uniranges[] = - { - { 32, 127 }, /* XXX: TODO: Add new Unicode ranges here !! */ - { 160, 255 }, - { 0, 0 } - }; - - FT_LOCAL_DEF( const AF_ScriptClassRec ) af_latin_script_class = - { - AF_SCRIPT_LATIN, - af_latin_uniranges, - - sizeof( AF_LatinMetricsRec ), - (AF_Script_InitMetricsFunc) af_latin_metrics_init, - (AF_Script_ScaleMetricsFunc) af_latin_metrics_scale, - (AF_Script_DoneMetricsFunc) NULL, - - (AF_Script_InitHintsFunc) af_latin_hints_init, - (AF_Script_ApplyHintsFunc) af_latin_hints_apply - }; - diff --git a/reactos/lib/freetype/src/autofit/aflatin.h b/reactos/lib/freetype/src/autofit/aflatin.h deleted file mode 100644 index da51cad69c8..00000000000 --- a/reactos/lib/freetype/src/autofit/aflatin.h +++ /dev/null @@ -1,169 +0,0 @@ -#ifndef __AFLATIN_H__ -#define __AFLATIN_H__ - -#include "afhints.h" - -FT_BEGIN_HEADER - - /* - * the latin-specific script class - * - */ - FT_LOCAL( const AF_ScriptClassRec ) af_latin_script_class; - - /***************************************************************************/ - /***************************************************************************/ - /***** *****/ - /***** L A T I N G L O B A L M E T R I C S *****/ - /***** *****/ - /***************************************************************************/ - /***************************************************************************/ - - /* - * the following declarations could be embedded in the file "aflatin.c" - * they've been made semi-public to allow alternate script hinters to - * re-use some of them - */ - - /* - * Latin (global) metrics management - * - */ - - enum - { - AF_LATIN_BLUE_CAPITAL_TOP, - AF_LATIN_BLUE_CAPITAL_BOTTOM, - AF_LATIN_BLUE_SMALL_F_TOP, - AF_LATIN_BLUE_SMALL_TOP, - AF_LATIN_BLUE_SMALL_BOTTOM, - AF_LATIN_BLUE_SMALL_MINOR, - - AF_LATIN_BLUE_MAX - }; - -#define AF_LATIN_IS_TOP_BLUE( b ) ( (b) == AF_LATIN_BLUE_CAPITAL_TOP || \ - (b) == AF_LATIN_BLUE_SMALL_F_TOP || \ - (b) == AF_LATIN_BLUE_SMALL_TOP ) - -#define AF_LATIN_MAX_WIDTHS 16 -#define AF_LATIN_MAX_BLUES AF_LATIN_BLUE_MAX - - enum - { - AF_LATIN_BLUE_ACTIVE = (1 << 0), - AF_LATIN_BLUE_TOP = (1 << 1), - - AF_LATIN_BLUE_FLAG_MAX - }; - - - typedef struct AF_LatinBlueRec_ - { - AF_WidthRec ref; - AF_WidthRec shoot; - FT_UInt flags; - - } AF_LatinBlueRec, *AF_LatinBlue; - - - typedef struct AF_LatinAxisRec_ - { - FT_Fixed scale; - FT_Pos delta; - - FT_UInt width_count; - AF_WidthRec widths[ AF_LATIN_MAX_WIDTHS ]; - FT_Pos edge_distance_threshold; - - /* ignored for horizontal metrics */ - FT_Bool control_overshoot; - FT_UInt blue_count; - AF_LatinBlueRec blues[ AF_LATIN_BLUE_MAX ]; - - FT_Fixed org_scale; - FT_Pos org_delta; - - } AF_LatinAxisRec, *AF_LatinAxis; - - - typedef struct AF_LatinMetricsRec_ - { - AF_ScriptMetricsRec root; - FT_UInt units_per_em; - AF_LatinAxisRec axis[ AF_DIMENSION_MAX ]; - AF_ScalerRec scaler; - - } AF_LatinMetricsRec, *AF_LatinMetrics; - - - - FT_LOCAL( FT_Error ) - af_latin_metrics_init( AF_LatinMetrics metrics, - FT_Face face ); - - FT_LOCAL( void ) - af_latin_metrics_scale( AF_LatinMetrics metrics, - AF_Scaler scaler ); - - - - /***************************************************************************/ - /***************************************************************************/ - /***** *****/ - /***** L A T I N G L Y P H A N A L Y S I S *****/ - /***** *****/ - /***************************************************************************/ - /***************************************************************************/ - - enum - { - AF_LATIN_HINTS_HORZ_SNAP = (1 << 0), /* enable stem width snapping */ - AF_LATIN_HINTS_VERT_SNAP = (1 << 1), /* enable stem height snapping */ - AF_LATIN_HINTS_STEM_ADJUST = (1 << 2), /* enable stem width/height adjustment */ - AF_LATIN_HINTS_MONO = (1 << 3) /* indicate monochrome rendering */ - }; - -#define AF_LATIN_HINTS_DO_HORZ_SNAP(h) \ - AF_HINTS_TEST_OTHER(h,AF_LATIN_HINTS_HORZ_SNAP) - -#define AF_LATIN_HINTS_DO_VERT_SNAP(h) \ - AF_HINTS_TEST_OTHER(h,AF_LATIN_HINTS_VERT_SNAP) - -#define AF_LATIN_HINTS_DO_STEM_ADJUST(h) \ - AF_HINTS_TEST_OTHER(h,AF_LATIN_HINTS_STEM_ADJUST) - -#define AF_LATIN_HINTS_DO_MONO(h) \ - AF_HINTS_TEST_OTHER(h,AF_LATIN_HINTS_MONO) - - - /* this shouldn't normally be exported. However, other scripts might - * like to use this function as-is - */ - FT_LOCAL( void ) - af_latin_hints_compute_segments( AF_GlyphHints hints, - AF_Dimension dim ); - - /* this shouldn't normally be exported. However, other scripts might - * want to use this function as-is - */ - FT_LOCAL( void ) - af_latin_hints_link_segments( AF_GlyphHints hints, - AF_Dimension dim ); - - /* this shouldn't normally be exported. However, other scripts might - * want to use this function as-is - */ - FT_LOCAL( void ) - af_latin_hints_compute_edges( AF_GlyphHints hints, - AF_Dimension dim ); - - FT_LOCAL( void ) - af_latin_hints_detect_features( AF_GlyphHints hints, - AF_Dimension dim ); - -/* */ - -FT_END_HEADER - -#endif /* __AFLATIN_H__ */ diff --git a/reactos/lib/freetype/src/autofit/afloader.c b/reactos/lib/freetype/src/autofit/afloader.c deleted file mode 100644 index f51a6cf2ba0..00000000000 --- a/reactos/lib/freetype/src/autofit/afloader.c +++ /dev/null @@ -1,431 +0,0 @@ -#include "afloader.h" -#include "afhints.h" -#include "afglobal.h" -#include "aflatin.h" - - FT_LOCAL_DEF( FT_Error ) - af_loader_init( AF_Loader loader, - FT_Memory memory ) - { - FT_Error error; - - FT_ZERO( loader ); - - af_glyph_hints_init( &loader->hints, memory ); - - error = FT_GlyphLoader_New( memory, &loader->gloader ); - if ( !error ) - { - error = FT_GlyphLoader_CreateExtra( loader->gloader ); - if ( error ) - { - FT_GlyphLoader_Done( loader->gloader ); - loader->gloader = NULL; - } - } - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - af_loader_reset( AF_Loader loader, - FT_Face face ) - { - FT_Error error = 0; - - loader->face = face; - loader->gloader = face->glyph->internal->loader; - loader->globals = (AF_FaceGlobals) face->autohint.data; - - if ( loader->globals == NULL ) - { - error = af_face_globals_new( face, &loader->globals ); - if ( !error ) - { - face->autohint.data = (FT_Pointer) loader->globals; - face->autohint.finalizer = (FT_Generic_Finalizer) af_face_globals_free; - } - } - return error; - } - - - FT_LOCAL_DEF( void ) - af_loader_done( AF_Loader loader ) - { - loader->face = NULL; - loader->globals = NULL; - - FT_GlyphLoader_Done( loader->gloader ); - loader->gloader = NULL; - } - - - static FT_Error - af_loader_load_g( AF_Loader loader, - AF_Scaler scaler, - FT_UInt glyph_index, - FT_Int32 load_flags, - FT_UInt depth ) - { - FT_Error error = 0; - FT_Face face = loader->face; - AF_FaceGlobals globals = loader->globals; - FT_GlyphLoader gloader = loader->gloader; - AF_ScriptMetrics metrics = loader->metrics; - AF_GlyphHints hints = &loader->hints; - FT_GlyphSlot slot = face->glyph; - FT_Slot_Internal internal = slot->internal; - - error = FT_Load_Glyph( face, glyph_index, load_flags ); - if ( error ) - goto Exit; - - loader->transformed = internal->glyph_transformed; - if ( loader->transformed ) - { - FT_Matrix inverse; - - loader->trans_matrix = internal->glyph_matrix; - loader->trans_delta = internal->glyph_delta; - - inverse = loader->trans_matrix; - FT_Matrix_Invert( &inverse ); - FT_Vector_Transform( &loader->trans_delta, &inverse ); - } - - /* set linear metrics */ - slot->linearHoriAdvance = slot->metrics.horiAdvance; - slot->linearVertAdvance = slot->metrics.vertAdvance; - - switch ( slot->format ) - { - case FT_GLYPH_FORMAT_OUTLINE: - /* translate the loaded glyph when an internal transform - * is needed - */ - if ( loader->transformed ) - { - FT_Vector* point = slot->outline.points; - FT_Vector* limit = point + slot->outline.n_points; - - for ( ; point < limit; point++ ) - { - point->x += loader->trans_delta.x; - point->y += loader->trans_delta.y; - } - } - - /* copy the outline points in the loader's current */ - /* extra points which is used to keep original glyph coordinates */ - error = FT_GlyphLoader_CheckPoints( gloader, - slot->outline.n_points + 2, - slot->outline.n_contours ); - if ( error ) - goto Exit; - - FT_ARRAY_COPY( gloader->current.extra_points, - slot->outline.points, - slot->outline.n_points ); - - FT_ARRAY_COPY( gloader->current.outline.contours, - slot->outline.contours, - slot->outline.n_contours ); - - FT_ARRAY_COPY( gloader->current.outline.tags, - slot->outline.tags, - slot->outline.n_points ); - - gloader->current.outline.n_points = slot->outline.n_points; - gloader->current.outline.n_contours = slot->outline.n_contours; - - /* compute original phantom points */ - loader->pp1.x = hints->x_delta; - loader->pp1.y = hints->y_delta; - loader->pp2.x = FT_MulFix( slot->metrics.horiAdvance, - hints->x_scale ) + hints->x_delta; - loader->pp2.y = hints->y_delta; - - /* be sure to check for spacing glyphs */ - if ( slot->outline.n_points == 0 ) - goto Hint_Metrics; - - /* now load the slot image into the auto-outline and run the */ - /* automatic hinting process */ - error = metrics->clazz->script_hints_init( hints, - &gloader->current.outline, - metrics ); - if ( error ) - goto Exit; - - /* apply the hints */ - metrics->clazz->script_hints_apply( hints, - &gloader->current.outline, - metrics ); - /* we now need to hint the metrics according to the change in */ - /* width/positioning that occured during the hinting process */ - { - FT_Pos old_advance, old_rsb, old_lsb, new_lsb; - AF_AxisHints axis = &hints->axis[ AF_DIMENSION_HORZ ]; - AF_Edge edge1 = axis->edges; /* leftmost edge */ - AF_Edge edge2 = edge1 + axis->num_edges - 1; /* rightmost edge */ - - - old_advance = loader->pp2.x; - old_rsb = old_advance - edge2->opos; - old_lsb = edge1->opos; - new_lsb = edge1->pos; - - loader->pp1.x = FT_PIX_ROUND( new_lsb - old_lsb ); - loader->pp2.x = FT_PIX_ROUND( edge2->pos + old_rsb ); - -#if 0 - /* try to fix certain bad advance computations */ - if ( loader->pp2.x + loader->pp1.x == edge2->pos && old_rsb > 4 ) - loader->pp2.x += 64; -#endif - } - - /* good, we simply add the glyph to our loader's base */ - FT_GlyphLoader_Add( gloader ); - break; - - case FT_GLYPH_FORMAT_COMPOSITE: - { - FT_UInt nn, num_subglyphs = slot->num_subglyphs; - FT_UInt num_base_subgs, start_point; - FT_SubGlyph subglyph; - - - start_point = gloader->base.outline.n_points; - - /* first of all, copy the subglyph descriptors in the glyph loader */ - error = FT_GlyphLoader_CheckSubGlyphs( gloader, num_subglyphs ); - if ( error ) - goto Exit; - - FT_ARRAY_COPY( gloader->current.subglyphs, - slot->subglyphs, - num_subglyphs ); - - gloader->current.num_subglyphs = num_subglyphs; - num_base_subgs = gloader->base.num_subglyphs; - - /* now, read each subglyph independently */ - for ( nn = 0; nn < num_subglyphs; nn++ ) - { - FT_Vector pp1, pp2; - FT_Pos x, y; - FT_UInt num_points, num_new_points, num_base_points; - - - /* gloader.current.subglyphs can change during glyph loading due */ - /* to re-allocation -- we must recompute the current subglyph on */ - /* each iteration */ - subglyph = gloader->base.subglyphs + num_base_subgs + nn; - - pp1 = loader->pp1; - pp2 = loader->pp2; - - num_base_points = gloader->base.outline.n_points; - - error = af_loader_load_g( loader, scaler, subglyph->index, - load_flags, depth + 1 ); - if ( error ) - goto Exit; - - /* recompute subglyph pointer */ - subglyph = gloader->base.subglyphs + num_base_subgs + nn; - - if ( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS ) - { - pp1 = loader->pp1; - pp2 = loader->pp2; - } - else - { - loader->pp1 = pp1; - loader->pp2 = pp2; - } - - num_points = gloader->base.outline.n_points; - num_new_points = num_points - num_base_points; - - /* now perform the transform required for this subglyph */ - - if ( subglyph->flags & ( FT_SUBGLYPH_FLAG_SCALE | - FT_SUBGLYPH_FLAG_XY_SCALE | - FT_SUBGLYPH_FLAG_2X2 ) ) - { - FT_Vector* cur = gloader->base.outline.points + - num_base_points; - FT_Vector* org = gloader->base.extra_points + - num_base_points; - FT_Vector* limit = cur + num_new_points; - - - for ( ; cur < limit; cur++, org++ ) - { - FT_Vector_Transform( cur, &subglyph->transform ); - FT_Vector_Transform( org, &subglyph->transform ); - } - } - - /* apply offset */ - - if ( !( subglyph->flags & FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ) ) - { - FT_Int k = subglyph->arg1; - FT_UInt l = subglyph->arg2; - FT_Vector* p1; - FT_Vector* p2; - - - if ( start_point + k >= num_base_points || - l >= (FT_UInt)num_new_points ) - { - error = FT_Err_Invalid_Composite; - goto Exit; - } - - l += num_base_points; - - /* for now, only use the current point coordinates; */ - /* we may consider another approach in the near future */ - p1 = gloader->base.outline.points + start_point + k; - p2 = gloader->base.outline.points + start_point + l; - - x = p1->x - p2->x; - y = p1->y - p2->y; - } - else - { - x = FT_MulFix( subglyph->arg1, hints->x_scale ) + hints->x_delta; - y = FT_MulFix( subglyph->arg2, hints->y_scale ) + hints->y_delta; - - x = FT_PIX_ROUND(x); - y = FT_PIX_ROUND(y); - } - - { - FT_Outline dummy = gloader->base.outline; - - - dummy.points += num_base_points; - dummy.n_points = (short)num_new_points; - - FT_Outline_Translate( &dummy, x, y ); - } - } - } - break; - - default: - /* we don't support other formats (yet?) */ - error = FT_Err_Unimplemented_Feature; - } - - Hint_Metrics: - if ( depth == 0 ) - { - FT_BBox bbox; - - - /* transform the hinted outline if needed */ - if ( loader->transformed ) - FT_Outline_Transform( &gloader->base.outline, &loader->trans_matrix ); - - /* we must translate our final outline by -pp1.x and compute */ - /* the new metrics */ - if ( loader->pp1.x ) - FT_Outline_Translate( &gloader->base.outline, -loader->pp1.x, 0 ); - - FT_Outline_Get_CBox( &gloader->base.outline, &bbox ); - - bbox.xMin = FT_PIX_FLOOR( bbox.xMin ); - bbox.yMin = FT_PIX_FLOOR( bbox.yMin ); - bbox.xMax = FT_PIX_CEIL( bbox.xMax ); - bbox.yMax = FT_PIX_CEIL( bbox.yMax ); - - slot->metrics.width = bbox.xMax - bbox.xMin; - slot->metrics.height = bbox.yMax - bbox.yMin; - slot->metrics.horiBearingX = bbox.xMin; - slot->metrics.horiBearingY = bbox.yMax; - - /* for mono-width fonts (like Andale, Courier, etc.) we need */ - /* to keep the original rounded advance width */ -#if 0 - if ( !FT_IS_FIXED_WIDTH( slot->face ) ) - slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x; - else - slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance, - x_scale ); -#else - slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x; -#endif - - slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance ); - - /* now copy outline into glyph slot */ - FT_GlyphLoader_Rewind( loader->gloader ); - error = FT_GlyphLoader_CopyPoints( loader->gloader, gloader ); - if ( error ) - goto Exit; - - slot->outline = slot->internal->loader->base.outline; - slot->format = FT_GLYPH_FORMAT_OUTLINE; - } - -#ifdef DEBUG_HINTER - af_debug_hinter = hinter; -#endif - - Exit: - return error; - } - - - - - FT_LOCAL_DEF( FT_Error ) - af_loader_load_glyph( AF_Loader loader, - FT_Face face, - FT_UInt gindex, - FT_UInt32 load_flags ) - { - FT_Error error; - FT_Size size = face->size; - AF_ScalerRec scaler; - - if ( !size ) - return FT_Err_Invalid_Argument; - - FT_ZERO( &scaler ); - - scaler.face = face; - scaler.x_scale = size->metrics.x_scale; - scaler.x_delta = 0; /* XXX: TODO: add support for sub-pixel hinting */ - scaler.y_scale = size->metrics.y_scale; - scaler.y_delta = 0; /* XXX: TODO: add support for sub-pixel hinting */ - - scaler.render_mode = FT_LOAD_TARGET_MODE( load_flags ); - scaler.flags = 0; /* XXX: fix this */ - - error = af_loader_reset( loader, face ); - if ( !error ) - { - AF_ScriptMetrics metrics; - - error = af_face_globals_get_metrics( loader->globals, gindex, &metrics ); - if ( !error ) - { - metrics->clazz->script_metrics_scale( metrics, &scaler ); - - load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM; - load_flags &= ~FT_LOAD_RENDER; - - error = af_loader_load_g( loader, &scaler, gindex, load_flags, 0 ); - } - } - return error; - } diff --git a/reactos/lib/freetype/src/autofit/afloader.h b/reactos/lib/freetype/src/autofit/afloader.h deleted file mode 100644 index b4a8417cddc..00000000000 --- a/reactos/lib/freetype/src/autofit/afloader.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef __AF_LOADER_H__ -#define __AF_LOADER_H__ - -#include "afhints.h" -#include "afglobal.h" - -FT_BEGIN_HEADER - - typedef struct AF_LoaderRec_ - { - FT_Face face; /* current face */ - AF_FaceGlobals globals; /* current face globals */ - FT_GlyphLoader gloader; /* glyph loader */ - AF_GlyphHintsRec hints; - AF_ScriptMetrics metrics; - FT_Bool transformed; - FT_Matrix trans_matrix; - FT_Vector trans_delta; - FT_Vector pp1; - FT_Vector pp2; - - } AF_LoaderRec, *AF_Loader; - - - FT_LOCAL( FT_Error ) - af_loader_init( AF_Loader loader, - FT_Memory memory ); - - - FT_LOCAL( FT_Error ) - af_loader_reset( AF_Loader loader, - FT_Face face ); - - - FT_LOCAL( void ) - af_loader_done( AF_Loader loader ); - - - FT_LOCAL( FT_Error ) - af_loader_load_glyph( AF_Loader loader, - FT_Face face, - FT_UInt gindex, - FT_UInt32 load_flags ); - -/* */ - -FT_END_HEADER - -#endif /* __AF_LOADER_H__ */ diff --git a/reactos/lib/freetype/src/autofit/afmodule.c b/reactos/lib/freetype/src/autofit/afmodule.c deleted file mode 100644 index d088c24ae55..00000000000 --- a/reactos/lib/freetype/src/autofit/afmodule.c +++ /dev/null @@ -1,68 +0,0 @@ -#include "afmodule.h" -#include "afloader.h" -#include FT_INTERNAL_OBJECTS_H - - typedef struct FT_AutofitterRec_ - { - FT_ModuleRec root; - AF_LoaderRec loader[1]; - - } FT_AutofitterRec, *FT_Autofitter; - - - FT_CALLBACK_DEF( FT_Error ) - af_autofitter_init( FT_Autofitter module ) - { - return af_loader_init( module->loader, module->root.library->memory ); - } - - - FT_CALLBACK_DEF( void ) - af_autofitter_done( FT_Autofitter module ) - { - af_loader_done( module->loader ); - } - - - FT_CALLBACK_DEF( FT_Error ) - af_autofitter_load_glyph( FT_Autofitter module, - FT_GlyphSlot slot, - FT_Size size, - FT_UInt glyph_index, - FT_Int32 load_flags ) - { - return af_loader_load_glyph( module->loader, slot->face, - glyph_index, load_flags ); - } - - - - FT_CALLBACK_TABLE_DEF - const FT_AutoHinter_ServiceRec af_autofitter_service = - { - NULL, - NULL, - NULL, - (FT_AutoHinter_GlyphLoadFunc) af_autofitter_load_glyph - }; - - - FT_CALLBACK_TABLE_DEF - const FT_Module_Class autofit_module_class = - { - FT_MODULE_HINTER, - sizeof ( FT_AutofitterRec ), - - "autofitter", - 0x10000L, /* version 1.0 of the autofitter */ - 0x20000L, /* requires FreeType 2.0 or above */ - - (const void*) &af_autofitter_service, - - (FT_Module_Constructor) af_autofitter_init, - (FT_Module_Destructor) af_autofitter_done, - (FT_Module_Requester) 0 - }; - - -/* END */ diff --git a/reactos/lib/freetype/src/autofit/afmodule.h b/reactos/lib/freetype/src/autofit/afmodule.h deleted file mode 100644 index b898cb375fd..00000000000 --- a/reactos/lib/freetype/src/autofit/afmodule.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef __AFMODULE_H__ -#define __AFMODULE_H__ - -#include <ft2build.h> -#include FT_MODULE_H - - -FT_BEGIN_HEADER - - FT_CALLBACK_TABLE - const FT_Module_Class autofit_module_class; - - -FT_END_HEADER - -#endif /* __AFMODULE_H__ */ diff --git a/reactos/lib/freetype/src/autofit/aftypes.h b/reactos/lib/freetype/src/autofit/aftypes.h deleted file mode 100644 index 3f968fc332d..00000000000 --- a/reactos/lib/freetype/src/autofit/aftypes.h +++ /dev/null @@ -1,266 +0,0 @@ -#ifndef __AFTYPES_H__ -#define __AFTYPES_H__ - -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_OUTLINE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H - -FT_BEGIN_HEADER - - /**************************************************************************/ - /**************************************************************************/ - /***** *****/ - /***** D E B U G G I N G *****/ - /***** *****/ - /**************************************************************************/ - /**************************************************************************/ - -#define xxAF_DEBUG - -#ifdef AF_DEBUG - -# include <stdio.h> -# define AF_LOG( x ) printf ## x - -#else - -# define AF_LOG( x ) do ; while ( 0 ) /* nothing */ - -#endif /* AF_DEBUG */ - - /**************************************************************************/ - /**************************************************************************/ - /***** *****/ - /***** U T I L I T Y *****/ - /***** *****/ - /**************************************************************************/ - /**************************************************************************/ - - typedef struct AF_WidthRec_ - { - FT_Pos org; /* original position/width in font units */ - FT_Pos cur; /* current/scaled position/width in device sub-pixels */ - FT_Pos fit; /* current/fitted position/width in device sub-pixels */ - - } AF_WidthRec, *AF_Width; - - - FT_LOCAL( void ) - af_sort_pos( FT_UInt count, - FT_Pos* table ); - - FT_LOCAL( void ) - af_sort_widths( FT_UInt count, - AF_Width widths ); - - - /**************************************************************************/ - /**************************************************************************/ - /***** *****/ - /***** A N G L E T Y P E S *****/ - /***** *****/ - /**************************************************************************/ - /**************************************************************************/ - - /* - * Angle type. The auto-fitter doesn't need a very high angular accuracy, - * and this allows us to speed up some computations considerably with a - * light Cordic algorithm (see afangles.c) - * - */ - - typedef FT_Int AF_Angle; - -#define AF_ANGLE_PI 128 -#define AF_ANGLE_2PI (AF_ANGLE_PI*2) -#define AF_ANGLE_PI2 (AF_ANGLE_PI/2) -#define AF_ANGLE_PI4 (AF_ANGLE_PI/4) - - /* - * compute the angle of a given 2-D vector - * - */ - FT_LOCAL( AF_Angle ) - af_angle_atan( FT_Pos dx, - FT_Pos dy ); - - - /* - * computes "angle2 - angle1", the result is always within - * the range [ -AF_ANGLE_PI .. AF_ANGLE_PI-1 ] - * - */ - FT_LOCAL( AF_Angle ) - af_angle_diff( AF_Angle angle1, - AF_Angle angle2 ); - - - /**************************************************************************/ - /**************************************************************************/ - /***** *****/ - /***** O U T L I N E S *****/ - /***** *****/ - /**************************************************************************/ - /**************************************************************************/ - - /* opaque handle to glyph-specific hints. see "afhints.h" for more - * details - */ - typedef struct AF_GlyphHintsRec_* AF_GlyphHints; - - /* this structure is used to model an input glyph outline to - * the auto-hinter. The latter will set the "hints" field - * depending on the glyph's script - */ - typedef struct AF_OutlineRec_ - { - FT_Face face; - FT_Outline outline; - FT_UInt outline_resolution; - - FT_Int advance; - FT_UInt metrics_resolution; - - AF_GlyphHints hints; - - } AF_OutlineRec; - - - /**************************************************************************/ - /**************************************************************************/ - /***** *****/ - /***** S C A L E R S *****/ - /***** *****/ - /**************************************************************************/ - /**************************************************************************/ - - /* - * A scaler models the target pixel device that will receive the - * auto-hinted glyph image - * - */ - - typedef enum - { - AF_SCALER_FLAG_NO_HORIZONTAL = 1, /* disable horizontal hinting */ - AF_SCALER_FLAG_NO_VERTICAL = 2, /* disable vertical hinting */ - AF_SCALER_FLAG_NO_ADVANCE = 4 /* disable advance hinting */ - - } AF_ScalerFlags; - - - typedef struct AF_ScalerRec_ - { - FT_Face face; /* source font face */ - FT_Fixed x_scale; /* from font units to 1/64th device pixels */ - FT_Fixed y_scale; /* from font units to 1/64th device pixels */ - FT_Pos x_delta; /* in 1/64th device pixels */ - FT_Pos y_delta; /* in 1/64th device pixels */ - FT_Render_Mode render_mode; /* monochrome, anti-aliased, LCD, etc.. */ - FT_UInt32 flags; /* additionnal control flags, see above */ - - } AF_ScalerRec, *AF_Scaler; - - - - /**************************************************************************/ - /**************************************************************************/ - /***** *****/ - /***** S C R I P T S *****/ - /***** *****/ - /**************************************************************************/ - /**************************************************************************/ - - /* - * the list of know scripts. Each different script correspond to the - * following information: - * - * - a set of Unicode ranges to test weither the face supports the - * script - * - * - a specific global analyzer that will compute global metrics - * specific to the script. - * - * - a specific glyph analyzer that will compute segments and - * edges for each glyph covered by the script - * - * - a specific grid-fitting algorithm that will distort the - * scaled glyph outline according to the results of the glyph - * analyzer - * - * note that a given analyzer and/or grid-fitting algorithm can be - * used by more than one script - */ - typedef enum - { - AF_SCRIPT_LATIN = 0, - /* add new scripts here. don't forget to update the list in "afglobal.c" */ - - AF_SCRIPT_MAX /* do not remove */ - - } AF_Script; - - - - typedef struct AF_ScriptClassRec_ const* AF_ScriptClass; - - typedef struct AF_ScriptMetricsRec_ - { - AF_ScriptClass clazz; - - } AF_ScriptMetricsRec, *AF_ScriptMetrics; - - - /* this function parses a FT_Face to compute global metrics for - * a specific script - */ - typedef FT_Error (*AF_Script_InitMetricsFunc)( AF_ScriptMetrics metrics, - FT_Face face ); - - typedef void (*AF_Script_ScaleMetricsFunc)( AF_ScriptMetrics metrics, - AF_Scaler scaler ); - - typedef void (*AF_Script_DoneMetricsFunc)( AF_ScriptMetrics metrics ); - - - typedef FT_Error (*AF_Script_InitHintsFunc)( AF_GlyphHints hints, - FT_Outline* outline, - AF_ScriptMetrics metrics ); - - typedef void (*AF_Script_ApplyHintsFunc)( AF_GlyphHints hints, - FT_Outline* outline, - AF_ScriptMetrics metrics ); - - - typedef struct AF_Script_UniRangeRec_ - { - FT_UInt32 first; - FT_UInt32 last; - - } AF_Script_UniRangeRec; - - typedef const AF_Script_UniRangeRec * AF_Script_UniRange; - - typedef struct AF_ScriptClassRec_ - { - AF_Script script; - AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */ - - FT_UInt script_metrics_size; - AF_Script_InitMetricsFunc script_metrics_init; - AF_Script_ScaleMetricsFunc script_metrics_scale; - AF_Script_DoneMetricsFunc script_metrics_done; - - AF_Script_InitHintsFunc script_hints_init; - AF_Script_ApplyHintsFunc script_hints_apply; - - } AF_ScriptClassRec; - - -/* */ - -FT_END_HEADER - -#endif /* __AFTYPES_H__ */ diff --git a/reactos/lib/freetype/src/autofit/autofit.c b/reactos/lib/freetype/src/autofit/autofit.c deleted file mode 100644 index 91e4db307f7..00000000000 --- a/reactos/lib/freetype/src/autofit/autofit.c +++ /dev/null @@ -1,8 +0,0 @@ -#define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> -#include "afangles.c" -#include "afglobal.c" -#include "afhints.c" -#include "aflatin.c" -#include "afloader.c" -#include "afmodule.c" diff --git a/reactos/lib/freetype/src/autohint/ahglobal.c b/reactos/lib/freetype/src/autohint/ahglobal.c index 273a1e52246..4183b010999 100644 --- a/reactos/lib/freetype/src/autohint/ahglobal.c +++ b/reactos/lib/freetype/src/autohint/ahglobal.c @@ -30,7 +30,7 @@ /* cf. AH_BLUE_XXX constants in ahtypes.h */ static - const char* const blue_chars[AH_BLUE_MAX] = + const char* blue_chars[AH_BLUE_MAX] = { "THEZOCQS", "HEZLOCUS", diff --git a/reactos/lib/freetype/src/autohint/ahglyph.c b/reactos/lib/freetype/src/autohint/ahglyph.c index ad2f46efe8e..85c3b380e65 100644 --- a/reactos/lib/freetype/src/autohint/ahglyph.c +++ b/reactos/lib/freetype/src/autohint/ahglyph.c @@ -418,7 +418,7 @@ /* first of all, reallocate the contours array if necessary */ if ( num_contours > outline->max_contours ) { - FT_Int new_contours = FT_PAD_CEIL( num_contours, 4 ); + FT_Int new_contours = ( num_contours + 3 ) & -4; if ( FT_RENEW_ARRAY( outline->contours, @@ -435,7 +435,7 @@ /* */ if ( num_points + 2 > outline->max_points ) { - FT_Int news = FT_PAD_CEIL( num_points, 8 ); + FT_Int news = ( num_points + 2 + 7 ) & -8; FT_Int max = outline->max_points; diff --git a/reactos/lib/freetype/src/autohint/ahhint.c b/reactos/lib/freetype/src/autohint/ahhint.c index a79e19db600..c4c8cfc50d1 100644 --- a/reactos/lib/freetype/src/autohint/ahhint.c +++ b/reactos/lib/freetype/src/autohint/ahhint.c @@ -4,7 +4,7 @@ /* */ /* Glyph hinter (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004 Catharon Productions Inc. */ +/* Copyright 2000-2001, 2002, 2003 Catharon Productions Inc. */ /* Author: David Turner */ /* */ /* This file is part of the Catharon Typography Project and shall only */ @@ -71,7 +71,7 @@ } } - scaled = FT_PIX_ROUND( reference ); + scaled = ( reference + 32 ) & -64; if ( width >= reference ) { @@ -167,7 +167,7 @@ dist += delta; } else - dist = ( dist + 32 ) & ~63; + dist = ( dist + 32 ) & -64; } } else @@ -181,7 +181,7 @@ /* in the case of vertical hinting, always round */ /* the stem heights to integer pixels */ if ( dist >= 64 ) - dist = ( dist + 16 ) & ~63; + dist = ( dist + 16 ) & -64; else dist = 64; } @@ -196,7 +196,7 @@ if ( dist < 64 ) dist = 64; else - dist = ( dist + 32 ) & ~63; + dist = ( dist + 32 ) & -64; } else { @@ -207,10 +207,10 @@ dist = ( dist + 64 ) >> 1; else if ( dist < 128 ) - dist = ( dist + 22 ) & ~63; + dist = ( dist + 22 ) & -64; else /* XXX: round otherwise to prevent color fringes in LCD mode */ - dist = ( dist + 32 ) & ~63; + dist = ( dist + 32 ) & -64; } } } @@ -284,7 +284,7 @@ dist += delta; } else - dist = ( dist + 32 ) & ~63; + dist = ( dist + 32 ) & -64; } } else @@ -298,7 +298,7 @@ /* in the case of vertical hinting, always round */ /* the stem heights to integer pixels */ if ( dist >= 64 ) - dist = ( dist + 16 ) & ~63; + dist = ( dist + 16 ) & -64; else dist = 64; } @@ -313,7 +313,7 @@ if ( dist < 64 ) dist = 64; else - dist = ( dist + 32 ) & ~63; + dist = ( dist + 32 ) & -64; } else { @@ -324,10 +324,10 @@ dist = ( dist + 64 ) >> 1; else if ( dist < 128 ) - dist = ( dist + 22 ) & ~63; + dist = ( dist + 22 ) & -64; else /* XXX: round otherwise to prevent color fringes in LCD mode */ - dist = ( dist + 32 ) & ~63; + dist = ( dist + 32 ) & -64; } } } @@ -396,7 +396,7 @@ if ( base->flags & AH_EDGE_DONE ) { if ( dist >= 64 ) - dist = ( dist + 8 ) & ~63; + dist = ( dist + 8 ) & -64; else if ( dist <= 32 && !vertical ) dist = ( dist + 33 ) >> 1; @@ -545,7 +545,7 @@ { org_center = edge->opos + ( org_len >> 1 ); - cur_pos1 = FT_PIX_ROUND( org_center ); + cur_pos1 = ( org_center + 32 ) & -64; error1 = org_center - ( cur_pos1 - u_off ); if ( error1 < 0 ) @@ -565,7 +565,7 @@ } else - edge->pos = FT_PIX_ROUND( edge->opos ); + edge->pos = ( edge->opos + 32 ) & -64; anchor = edge; @@ -575,7 +575,7 @@ #else /* !FT_CONFIG_CHESTER_STEM */ - edge->pos = FT_PIX_ROUND( edge->opos ); + edge->pos = ( edge->opos + 32 ) & -64; anchor = edge; edge->flags |= AH_EDGE_DONE; @@ -614,7 +614,7 @@ FT_Pos u_off, d_off; - cur_pos1 = FT_PIX_ROUND( org_center ); + cur_pos1 = ( org_center + 32 ) & -64; if (cur_len <= 64 ) u_off = d_off = 32; @@ -649,12 +649,12 @@ cur_len = ah_compute_stem_width( hinter, dimension, org_len, edge->flags, edge2->flags ); - cur_pos1 = FT_PIX_ROUND( org_pos ); + cur_pos1 = ( org_pos + 32 ) & -64; delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center ); if ( delta1 < 0 ) delta1 = -delta1; - cur_pos2 = FT_PIX_ROUND( org_pos + org_len ) - cur_len; + cur_pos2 = ( ( org_pos + org_len + 32 ) & -64 ) - cur_len; delta2 = ( cur_pos2 + ( cur_len >> 1 ) - org_center ); if ( delta2 < 0 ) delta2 = -delta2; @@ -665,12 +665,12 @@ #else /* !FT_CONFIG_CHESTER_STEM */ - cur_pos1 = FT_PIX_ROUND( org_pos ); + cur_pos1 = ( org_pos + 32 ) & -64; delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center ); if ( delta1 < 0 ) delta1 = -delta1; - cur_pos2 = FT_PIX_ROUND( org_pos + org_len ) - cur_len; + cur_pos2 = ( ( org_pos + org_len + 32 ) & -64 ) - cur_len; delta2 = ( cur_pos2 + ( cur_len >> 1 ) - org_center ); if ( delta2 < 0 ) delta2 = -delta2; @@ -703,7 +703,7 @@ /* the third (lowest) stem aligns with the base line; it might end up */ /* one pixel higher or lower. */ - n_edges = (FT_Int)( edge_limit - edges ); + n_edges = edge_limit - edges; if ( !dimension && ( n_edges == 6 || n_edges == 12 ) ) { AH_EdgeRec *edge1, *edge2, *edge3; @@ -764,12 +764,12 @@ ah_align_serif_edge( hinter, edge->serif, edge, dimension ); else if ( !anchor ) { - edge->pos = FT_PIX_ROUND( edge->opos ); + edge->pos = ( edge->opos + 32 ) & -64; anchor = edge; } else edge->pos = anchor->pos + - FT_PIX_ROUND( edge->opos - anchor->opos ); + ( ( edge->opos-anchor->opos + 32 ) & -64 ); edge->flags |= AH_EDGE_DONE; @@ -943,7 +943,7 @@ /* find enclosing edges */ min = 0; - max = (FT_UInt)( edge_limit - edges ); + max = edge_limit - edges; while ( min < max ) { @@ -1299,16 +1299,15 @@ if ( delta2 < 32 ) delta2 = 0; else if ( delta2 < 64 ) - delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 ); + delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & -32 ); else - delta2 = FT_PIX_ROUND( delta2 ); + delta2 = ( delta2 + 32 ) & -64; if ( delta < 0 ) delta2 = -delta2; scaled->blue_refs[n] = - FT_PIX_ROUND( FT_MulFix( design->blue_refs[n], y_scale ) ); - + ( FT_MulFix( design->blue_refs[n], y_scale ) + 32 ) & -64; scaled->blue_shoots[n] = scaled->blue_refs[n] + delta2; } @@ -1494,14 +1493,14 @@ if ( error ) goto Exit; - FT_ARRAY_COPY( gloader->current.extra_points, slot->outline.points, - slot->outline.n_points ); + FT_MEM_COPY( gloader->current.extra_points, slot->outline.points, + slot->outline.n_points * sizeof ( FT_Vector ) ); - FT_ARRAY_COPY( gloader->current.outline.contours, slot->outline.contours, - slot->outline.n_contours ); + FT_MEM_COPY( gloader->current.outline.contours, slot->outline.contours, + slot->outline.n_contours * sizeof ( short ) ); - FT_ARRAY_COPY( gloader->current.outline.tags, slot->outline.tags, - slot->outline.n_points ); + FT_MEM_COPY( gloader->current.outline.tags, slot->outline.tags, + slot->outline.n_points * sizeof ( char ) ); gloader->current.outline.n_points = slot->outline.n_points; gloader->current.outline.n_contours = slot->outline.n_contours; @@ -1552,8 +1551,8 @@ old_lsb = edge1->opos; new_lsb = edge1->pos; - hinter->pp1.x = FT_PIX_ROUND( new_lsb - old_lsb ); - hinter->pp2.x = FT_PIX_ROUND( edge2->pos + old_rsb ); + hinter->pp1.x = ( ( new_lsb - old_lsb ) + 32 ) & -64; + hinter->pp2.x = ( ( edge2->pos + old_rsb ) + 32 ) & -64; #if 0 /* try to fix certain bad advance computations */ @@ -1580,8 +1579,8 @@ if ( error ) goto Exit; - FT_ARRAY_COPY( gloader->current.subglyphs, slot->subglyphs, - num_subglyphs ); + FT_MEM_COPY( gloader->current.subglyphs, slot->subglyphs, + num_subglyphs * sizeof ( FT_SubGlyph ) ); gloader->current.num_subglyphs = num_subglyphs; num_base_subgs = gloader->base.num_subglyphs; @@ -1678,8 +1677,8 @@ x = FT_MulFix( subglyph->arg1, x_scale ); y = FT_MulFix( subglyph->arg2, y_scale ); - x = FT_PIX_ROUND(x); - y = FT_PIX_ROUND(y); + x = ( x + 32 ) & -64; + y = ( y + 32 ) & -64; } { @@ -1716,10 +1715,10 @@ FT_Outline_Translate( &gloader->base.outline, -hinter->pp1.x, 0 ); FT_Outline_Get_CBox( &gloader->base.outline, &bbox ); - bbox.xMin = FT_PIX_FLOOR( bbox.xMin ); - bbox.yMin = FT_PIX_FLOOR( bbox.yMin ); - bbox.xMax = FT_PIX_CEIL( bbox.xMax ); - bbox.yMax = FT_PIX_CEIL( bbox.yMax ); + bbox.xMin &= -64; + bbox.yMin &= -64; + bbox.xMax = ( bbox.xMax + 63 ) & -64; + bbox.yMax = ( bbox.yMax + 63 ) & -64; slot->metrics.width = bbox.xMax - bbox.xMin; slot->metrics.height = bbox.yMax - bbox.yMin; @@ -1734,7 +1733,7 @@ slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance, x_scale ); - slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance ); + slot->metrics.horiAdvance = ( slot->metrics.horiAdvance + 32 ) & -64; /* now copy outline into glyph slot */ ah_loader_rewind( slot->internal->loader ); @@ -1803,7 +1802,7 @@ if ( shoot > 0 ) { FT_Pos scaled = FT_MulFix( shoot, y_scale ); - FT_Pos fitted = FT_PIX_ROUND( scaled ); + FT_Pos fitted = ( scaled + 32 ) & -64; if ( scaled != fitted ) @@ -1851,9 +1850,9 @@ hinter->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT ); - load_flags |= FT_LOAD_NO_SCALE - | FT_LOAD_IGNORE_TRANSFORM; - load_flags &= ~FT_LOAD_RENDER; + + load_flags |= FT_LOAD_NO_SCALE + | FT_LOAD_IGNORE_TRANSFORM ; error = ah_hinter_load( hinter, glyph_index, load_flags, 0 ); diff --git a/reactos/lib/freetype/src/base/ftbdf.c b/reactos/lib/freetype/src/base/ftbdf.c index d2f133db778..63e3071c11d 100644 --- a/reactos/lib/freetype/src/base/ftbdf.c +++ b/reactos/lib/freetype/src/base/ftbdf.c @@ -17,8 +17,27 @@ #include <ft2build.h> +#include FT_INTERNAL_BDF_TYPES_H #include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_BDF_H + + + static FT_Bool + test_font_type( FT_Face face, + const char* name ) + { + if ( face && face->driver ) + { + FT_Module driver = (FT_Module)face->driver; + + + if ( driver->clazz && driver->clazz->module_name ) + { + if ( ft_strcmp( driver->clazz->module_name, name ) == 0 ) + return 1; + } + } + return 0; + } FT_EXPORT_DEF( FT_Error ) @@ -33,15 +52,14 @@ error = FT_Err_Invalid_Argument; - if ( face ) + if ( test_font_type( face, "bdf" ) ) { - FT_Service_BDF service; + BDF_Public_Face bdf_face = (BDF_Public_Face)face; - FT_FACE_FIND_SERVICE( face, service, BDF ); - - if ( service && service->get_charset_id ) - error = service->get_charset_id( face, &encoding, ®istry ); + encoding = (const char*) bdf_face->charset_encoding; + registry = (const char*) bdf_face->charset_registry; + error = 0; } if ( acharset_encoding ) @@ -66,18 +84,22 @@ aproperty->type = BDF_PROPERTY_TYPE_NONE; - if ( face ) + if ( face != NULL && face->driver != NULL ) { - FT_Service_BDF service; + FT_Driver driver = face->driver; + BDF_GetPropertyFunc func; - FT_FACE_FIND_SERVICE( face, service, BDF ); - - if ( service && service->get_property ) - error = service->get_property( face, prop_name, aproperty ); + if ( driver->root.clazz->get_interface ) + { + func = (BDF_GetPropertyFunc)driver->root.clazz->get_interface( + FT_MODULE( driver ), "get_bdf_property" ); + if ( func ) + error = func( face, prop_name, aproperty ); + } } - return error; + return error; } diff --git a/reactos/lib/freetype/src/base/ftcalc.c b/reactos/lib/freetype/src/base/ftcalc.c index 4fb2366276e..29a3a59fc04 100644 --- a/reactos/lib/freetype/src/base/ftcalc.c +++ b/reactos/lib/freetype/src/base/ftcalc.c @@ -74,8 +74,8 @@ FT_EXPORT_DEF( FT_Fixed ) FT_RoundFix( FT_Fixed a ) { - return ( a >= 0 ) ? ( a + 0x8000L ) & ~0xFFFFL - : -((-a + 0x8000L ) & ~0xFFFFL ); + return ( a >= 0 ) ? ( a + 0x8000L ) & -0x10000L + : -((-a + 0x8000L ) & -0x10000L ); } @@ -84,8 +84,8 @@ FT_EXPORT_DEF( FT_Fixed ) FT_CeilFix( FT_Fixed a ) { - return ( a >= 0 ) ? ( a + 0xFFFFL ) & ~0xFFFFL - : -((-a + 0xFFFFL ) & ~0xFFFFL ); + return ( a >= 0 ) ? ( a + 0xFFFFL ) & -0x10000L + : -((-a + 0xFFFFL ) & -0x10000L ); } @@ -94,8 +94,8 @@ FT_EXPORT_DEF( FT_Fixed ) FT_FloorFix( FT_Fixed a ) { - return ( a >= 0 ) ? a & ~0xFFFFL - : -((-a) & ~0xFFFFL ); + return ( a >= 0 ) ? a & -0x10000L + : -((-a) & -0x10000L ); } @@ -155,33 +155,6 @@ } -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER - - /* documentation is in ftcalc.h */ - - FT_BASE_DEF( FT_Long ) - FT_MulDiv_No_Round( FT_Long a, - FT_Long b, - FT_Long c ) - { - FT_Int s; - FT_Long d; - - - s = 1; - if ( a < 0 ) { a = -a; s = -1; } - if ( b < 0 ) { b = -b; s = -s; } - if ( c < 0 ) { c = -c; s = -s; } - - d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c - : 0x7FFFFFFFL ); - - return ( s > 0 ) ? d : -d; - } - -#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ - - /* documentation is in freetype.h */ FT_EXPORT_DEF( FT_Long ) @@ -330,8 +303,9 @@ s ^= c; c = ABS( c ); if ( a <= 46340L && b <= 46340L && c <= 176095L && c > 0 ) + { a = ( a * b + ( c >> 1 ) ) / c; - + } else if ( c > 0 ) { FT_Int64 temp, temp2; @@ -351,43 +325,6 @@ } -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER - - FT_BASE_DEF( FT_Long ) - FT_MulDiv_No_Round( FT_Long a, - FT_Long b, - FT_Long c ) - { - long s; - - - if ( a == 0 || b == c ) - return a; - - s = a; a = ABS( a ); - s ^= b; b = ABS( b ); - s ^= c; c = ABS( c ); - - if ( a <= 46340L && b <= 46340L && c > 0 ) - a = a * b / c; - - else if ( c > 0 ) - { - FT_Int64 temp; - - - ft_multo64( a, b, &temp ); - a = ft_div64by32( temp.hi, temp.lo, c ); - } - else - a = 0x7FFFFFFFL; - - return ( s < 0 ? -a : a ); - } - -#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ - - /* documentation is in freetype.h */ FT_EXPORT_DEF( FT_Long ) diff --git a/reactos/lib/freetype/src/base/ftdbgmem.c b/reactos/lib/freetype/src/base/ftdbgmem.c index 152220c605d..dc4a1bbf2b4 100644 --- a/reactos/lib/freetype/src/base/ftdbgmem.c +++ b/reactos/lib/freetype/src/base/ftdbgmem.c @@ -4,7 +4,7 @@ /* */ /* Memory debugger (body). */ /* */ -/* Copyright 2001, 2002, 2003, 2004 by */ +/* Copyright 2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -604,7 +604,7 @@ p = getenv( "FT2_ALLOC_TOTAL_MAX" ); if ( p != NULL ) { - FT_Long total_max = ft_atol(p); + FT_Long total_max = atol(p); if ( total_max > 0 ) { @@ -616,7 +616,7 @@ p = getenv( "FT2_ALLOC_COUNT_MAX" ); if ( p != NULL ) { - FT_Long total_count = ft_atol(p); + FT_Long total_count = atol(p); if ( total_count > 0 ) { diff --git a/reactos/lib/freetype/src/base/ftgloadr.c b/reactos/lib/freetype/src/base/ftgloadr.c index 0308f713c88..5a2eb51606e 100644 --- a/reactos/lib/freetype/src/base/ftgloadr.c +++ b/reactos/lib/freetype/src/base/ftgloadr.c @@ -4,7 +4,7 @@ /* */ /* The FreeType glyph loader (body). */ /* */ -/* Copyright 2002, 2003, 2004 by */ +/* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -19,7 +19,6 @@ #include <ft2build.h> #include FT_INTERNAL_GLYPH_LOADER_H #include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_OBJECTS_H #undef FT_COMPONENT #define FT_COMPONENT trace_gloader @@ -206,7 +205,7 @@ if ( new_max > old_max ) { - new_max = FT_PAD_CEIL( new_max, 8 ); + new_max = ( new_max + 7 ) & -8; if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) || FT_RENEW_ARRAY( base->tags, old_max, new_max ) ) @@ -226,7 +225,7 @@ n_contours; if ( new_max > old_max ) { - new_max = FT_PAD_CEIL( new_max, 4 ); + new_max = ( new_max + 3 ) & -4; if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) ) goto Exit; @@ -262,7 +261,7 @@ old_max = loader->max_subglyphs; if ( new_max > old_max ) { - new_max = FT_PAD_CEIL( new_max, 2 ); + new_max = ( new_max + 1 ) & -2; if ( FT_RENEW_ARRAY( base->subglyphs, old_max, new_max ) ) goto Exit; @@ -337,17 +336,17 @@ FT_Outline* in = &source->base.outline; - FT_ARRAY_COPY( out->points, in->points, - num_points ); - FT_ARRAY_COPY( out->tags, in->tags, - num_points ); - FT_ARRAY_COPY( out->contours, in->contours, - num_contours ); + FT_MEM_COPY( out->points, in->points, + num_points * sizeof ( FT_Vector ) ); + FT_MEM_COPY( out->tags, in->tags, + num_points * sizeof ( char ) ); + FT_MEM_COPY( out->contours, in->contours, + num_contours * sizeof ( short ) ); /* do we need to copy the extra points? */ if ( target->use_extra && source->use_extra ) - FT_ARRAY_COPY( target->base.extra_points, source->base.extra_points, - num_points ); + FT_MEM_COPY( target->base.extra_points, source->base.extra_points, + num_points * sizeof ( FT_Vector ) ); out->n_points = (short)num_points; out->n_contours = (short)num_contours; diff --git a/reactos/lib/freetype/src/base/ftglyph.c b/reactos/lib/freetype/src/base/ftglyph.c index e6311b53f28..fad5a620daf 100644 --- a/reactos/lib/freetype/src/base/ftglyph.c +++ b/reactos/lib/freetype/src/base/ftglyph.c @@ -4,7 +4,7 @@ /* */ /* FreeType convenience functions to handle glyphs (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -253,11 +253,14 @@ goto Exit; /* copy it */ - FT_ARRAY_COPY( target->points, source->points, source->n_points ); + FT_MEM_COPY( target->points, source->points, + source->n_points * sizeof ( FT_Vector ) ); - FT_ARRAY_COPY( target->tags, source->tags, source->n_points ); + FT_MEM_COPY( target->tags, source->tags, + source->n_points * sizeof ( FT_Byte ) ); - FT_ARRAY_COPY( target->contours, source->contours, source->n_contours ); + FT_MEM_COPY( target->contours, source->contours, + source->n_contours * sizeof ( FT_Short ) ); /* copy all flags, except the `FT_OUTLINE_OWNER' one */ target->flags = source->flags | FT_OUTLINE_OWNER; @@ -418,7 +421,7 @@ FT_Get_Glyph( FT_GlyphSlot slot, FT_Glyph *aglyph ) { - FT_Library library; + FT_Library library = slot->library; FT_Error error; FT_Glyph glyph; @@ -428,8 +431,6 @@ if ( !slot ) return FT_Err_Invalid_Slot_Handle; - library = slot->library; - if ( !aglyph ) return FT_Err_Invalid_Argument; @@ -543,10 +544,10 @@ if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT || bbox_mode == FT_GLYPH_BBOX_PIXELS ) { - acbox->xMin = FT_PIX_FLOOR( acbox->xMin ); - acbox->yMin = FT_PIX_FLOOR( acbox->yMin ); - acbox->xMax = FT_PIX_CEIL( acbox->xMax ); - acbox->yMax = FT_PIX_CEIL( acbox->yMax ); + acbox->xMin &= -64; + acbox->yMin &= -64; + acbox->xMax = ( acbox->xMax + 63 ) & -64; + acbox->yMax = ( acbox->yMax + 63 ) & -64; } /* convert to integer pixels if needed */ diff --git a/reactos/lib/freetype/src/base/ftmm.c b/reactos/lib/freetype/src/base/ftmm.c index 0bb2813092c..229a0431654 100644 --- a/reactos/lib/freetype/src/base/ftmm.c +++ b/reactos/lib/freetype/src/base/ftmm.c @@ -4,7 +4,7 @@ /* */ /* Multiple Master font support (body). */ /* */ -/* Copyright 1996-2001, 2003 by */ +/* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -19,7 +19,6 @@ #include <ft2build.h> #include FT_MULTIPLE_MASTERS_H #include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_MULTIPLE_MASTERS_H /*************************************************************************/ @@ -32,15 +31,15 @@ #define FT_COMPONENT trace_mm - static FT_Error - ft_face_get_mm_service( FT_Face face, - FT_Service_MultiMasters *aservice ) + /* documentation is in ftmm.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Get_Multi_Master( FT_Face face, + FT_Multi_Master *amaster ) { FT_Error error; - *aservice = NULL; - if ( !face ) return FT_Err_Invalid_Face_Handle; @@ -48,34 +47,14 @@ if ( FT_HAS_MULTIPLE_MASTERS( face ) ) { - FT_FACE_LOOKUP_SERVICE( face, - *aservice, - MULTI_MASTERS ); - - if ( aservice ) - error = FT_Err_Ok; - } - - return error; - } + FT_Driver driver = face->driver; + FT_Get_MM_Func func; - /* documentation is in ftmm.h */ - - FT_EXPORT_DEF( FT_Error ) - FT_Get_Multi_Master( FT_Face face, - FT_Multi_Master *amaster ) - { - FT_Error error; - FT_Service_MultiMasters service; - - - error = ft_face_get_mm_service( face, &service ); - if ( !error ) - { - error = FT_Err_Invalid_Argument; - if ( service->get_mm ) - error = service->get_mm( face, amaster ); + func = (FT_Get_MM_Func)driver->root.clazz->get_interface( + FT_MODULE( driver ), "get_mm" ); + if ( func ) + error = func( face, amaster ); } return error; @@ -89,16 +68,24 @@ FT_UInt num_coords, FT_Long* coords ) { - FT_Error error; - FT_Service_MultiMasters service; + FT_Error error; - error = ft_face_get_mm_service( face, &service ); - if ( !error ) + if ( !face ) + return FT_Err_Invalid_Face_Handle; + + error = FT_Err_Invalid_Argument; + + if ( FT_HAS_MULTIPLE_MASTERS( face ) ) { - error = FT_Err_Invalid_Argument; - if ( service->set_mm_design ) - error = service->set_mm_design( face, num_coords, coords ); + FT_Driver driver = face->driver; + FT_Set_MM_Design_Func func; + + + func = (FT_Set_MM_Design_Func)driver->root.clazz->get_interface( + FT_MODULE( driver ), "set_mm_design" ); + if ( func ) + error = func( face, num_coords, coords ); } return error; @@ -112,16 +99,24 @@ FT_UInt num_coords, FT_Fixed* coords ) { - FT_Error error; - FT_Service_MultiMasters service; + FT_Error error; - error = ft_face_get_mm_service( face, &service ); - if ( !error ) + if ( !face ) + return FT_Err_Invalid_Face_Handle; + + error = FT_Err_Invalid_Argument; + + if ( FT_HAS_MULTIPLE_MASTERS( face ) ) { - error = FT_Err_Invalid_Argument; - if ( service->set_mm_blend ) - error = service->set_mm_blend( face, num_coords, coords ); + FT_Driver driver = face->driver; + FT_Set_MM_Blend_Func func; + + + func = (FT_Set_MM_Blend_Func)driver->root.clazz->get_interface( + FT_MODULE( driver ), "set_mm_blend" ); + if ( func ) + error = func( face, num_coords, coords ); } return error; diff --git a/reactos/lib/freetype/src/base/ftobjs.c b/reactos/lib/freetype/src/base/ftobjs.c index b48288c3c71..8fdcc883e1f 100644 --- a/reactos/lib/freetype/src/base/ftobjs.c +++ b/reactos/lib/freetype/src/base/ftobjs.c @@ -4,7 +4,7 @@ /* */ /* The FreeType private base classes (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -27,35 +27,6 @@ #include FT_TRUETYPE_IDS_H #include FT_OUTLINE_H -#include FT_SERVICE_SFNT_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_TT_CMAP_H - - - FT_BASE_DEF( FT_Pointer ) - ft_service_list_lookup( FT_ServiceDesc service_descriptors, - const char* service_id ) - { - FT_Pointer result = NULL; - FT_ServiceDesc desc = service_descriptors; - - - if ( desc && service_id ) - { - for ( ; desc->serv_id != NULL; desc++ ) - { - if ( ft_strcmp( desc->serv_id, service_id ) == 0 ) - { - result = (FT_Pointer)desc->serv_data; - break; - } - } - } - - return result; - } - FT_BASE_DEF( void ) ft_validator_init( FT_Validator valid, @@ -576,14 +547,15 @@ if ( ( load_flags & FT_LOAD_LINEAR_DESIGN ) == 0 && ( face->face_flags & FT_FACE_FLAG_SCALABLE ) ) { + FT_UInt EM = face->units_per_EM; FT_Size_Metrics* metrics = &face->size->metrics; slot->linearHoriAdvance = FT_MulDiv( slot->linearHoriAdvance, - metrics->x_scale, 64 ); + (FT_Long)metrics->x_ppem << 16, EM ); slot->linearVertAdvance = FT_MulDiv( slot->linearVertAdvance, - metrics->y_scale, 64 ); + (FT_Long)metrics->y_ppem << 16, EM ); } if ( ( load_flags & FT_LOAD_IGNORE_TRANSFORM ) == 0 ) @@ -669,28 +641,6 @@ } - static void - destroy_charmaps( FT_Face face, - FT_Memory memory ) - { - FT_Int n; - - - for ( n = 0; n < face->num_charmaps; n++ ) - { - FT_CMap cmap = FT_CMAP( face->charmaps[n] ); - - - FT_CMap_Done( cmap ); - - face->charmaps[n] = NULL; - } - - FT_FREE( face->charmaps ); - face->num_charmaps = 0; - } - - /* destructor for faces list */ static void destroy_face( FT_Memory memory, @@ -711,9 +661,9 @@ /* discard all sizes for this face */ FT_List_Finalize( &face->sizes_list, - (FT_List_Destructor)destroy_size, - memory, - driver ); + (FT_List_Destructor)destroy_size, + memory, + driver ); face->size = 0; /* now discard client data */ @@ -721,8 +671,25 @@ face->generic.finalizer( face ); /* discard charmaps */ - destroy_charmaps( face, memory ); - + { + FT_Int n; + + + for ( n = 0; n < face->num_charmaps; n++ ) + { + FT_CMap cmap = FT_CMAP( face->charmaps[n] ); + + + FT_CMap_Done( cmap ); + + face->charmaps[n] = NULL; + } + + FT_FREE( face->charmaps ); + face->num_charmaps = 0; + } + + /* finalize format-specific stuff */ if ( clazz->done_face ) clazz->done_face( face ); @@ -737,6 +704,7 @@ /* get rid of it */ if ( face->internal ) { + FT_FREE( face->internal->postscript_name ); FT_FREE( face->internal ); } FT_FREE( face ); @@ -780,7 +748,7 @@ /* caller should have already checked that `face' is valid */ - FT_ASSERT( face ); + FT_ASSERT ( face ); first = face->charmaps; @@ -929,7 +897,6 @@ Fail: if ( error ) { - destroy_charmaps( face, memory ); clazz->done_face( face ); FT_FREE( internal ); FT_FREE( face ); @@ -1142,10 +1109,9 @@ FT_Error error = FT_Err_Cannot_Open_Resource; FT_Memory memory = library->memory; FT_Byte* pfb_data; - int i, type, flags; - FT_Long len; + int i, type, flags, len; FT_Long pfb_len, pfb_pos, pfb_lenpos; - FT_Long rlen, temp; + FT_Long rlen, junk, temp; FT_Long *offsets; @@ -1164,11 +1130,12 @@ /* Find all the POST resource offsets */ for ( i = 0; i < resource_cnt; ++i ) { - (void)FT_STREAM_SKIP( 4 ); /* resource id and resource name */ + (void)FT_READ_USHORT( junk ); /* resource id */ + (void)FT_READ_USHORT( junk ); /* rsource name */ if ( FT_READ_LONG( temp ) ) goto Exit; offsets[i] = resource_data + ( temp & 0xFFFFFFL ); - (void)FT_STREAM_SKIP( 4 ); /* mbz */ + (void)FT_READ_LONG( junk ); /* mbz */ } /* Find the length of all the POST resources, concatenated. Assume */ @@ -1187,14 +1154,14 @@ if ( FT_ALLOC( pfb_data, (FT_Long)pfb_len + 2 ) ) goto Exit; - pfb_data[0] = 0x80; - pfb_data[1] = 1; /* Ascii section */ - pfb_data[2] = 0; /* 4-byte length, fill in later */ - pfb_data[3] = 0; - pfb_data[4] = 0; - pfb_data[5] = 0; - pfb_pos = 7; - pfb_lenpos = 2; + pfb_pos = 0; + pfb_data[pfb_pos++] = 0x80; + pfb_data[pfb_pos++] = 1; /* Ascii section */ + pfb_lenpos = pfb_pos; + pfb_data[pfb_pos++] = 0; /* 4-byte length, fill in later */ + pfb_data[pfb_pos++] = 0; + pfb_data[pfb_pos++] = 0; + pfb_data[pfb_pos++] = 0; len = 0; type = 1; @@ -1212,10 +1179,10 @@ len += rlen; else { - pfb_data[pfb_lenpos ] = (FT_Byte)( len ); - pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 ); - pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 ); - pfb_data[pfb_lenpos + 3] = (FT_Byte)( len >> 24 ); + pfb_data[pfb_lenpos ] = len & 0xFF; + pfb_data[pfb_lenpos + 1] = ( len >> 8 ) & 0xFF; + pfb_data[pfb_lenpos + 2] = ( len >> 16 ) & 0xFF; + pfb_data[pfb_lenpos + 3] = ( len >> 24 ) & 0xFF; if ( ( flags >> 8 ) == 5 ) /* End of font mark */ break; @@ -1225,8 +1192,8 @@ type = flags >> 8; len = rlen; - pfb_data[pfb_pos++] = (FT_Byte)type; - pfb_lenpos = (FT_Byte)pfb_pos; + pfb_data[pfb_pos++] = type; + pfb_lenpos = pfb_pos; pfb_data[pfb_pos++] = 0; /* 4-byte length, fill in later */ pfb_data[pfb_pos++] = 0; pfb_data[pfb_pos++] = 0; @@ -1240,10 +1207,10 @@ pfb_data[pfb_pos++] = 0x80; pfb_data[pfb_pos++] = 3; - pfb_data[pfb_lenpos ] = (FT_Byte)( len ); - pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 ); - pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 ); - pfb_data[pfb_lenpos + 3] = (FT_Byte)( len >> 24 ); + pfb_data[pfb_lenpos ] = len & 0xFF; + pfb_data[pfb_lenpos + 1] = ( len >> 8 ) & 0xFF; + pfb_data[pfb_lenpos + 2] = ( len >> 16 ) & 0xFF; + pfb_data[pfb_lenpos + 3] = ( len >> 24 ) & 0xFF; return open_face_from_buffer( library, pfb_data, @@ -1280,7 +1247,7 @@ FT_Error error; int i; FT_Long flag_offset= 0xFFFFFFL; - FT_Long rlen; + FT_Long rlen, junk; int is_cff; @@ -1295,11 +1262,12 @@ for ( i = 0; i <= face_index; ++i ) { - (void)FT_STREAM_SKIP( 4 ); /* resource id and resource name */ + (void)FT_READ_USHORT( junk ); /* resource id */ + (void)FT_READ_USHORT( junk ); /* rsource name */ if ( FT_READ_LONG( flag_offset ) ) goto Exit; flag_offset &= 0xFFFFFFL; - (void)FT_STREAM_SKIP( 4 ); /* mbz */ + (void)FT_READ_LONG( junk ); /* mbz */ } if ( flag_offset == 0xFFFFFFL ) @@ -1350,10 +1318,9 @@ { FT_Error error; unsigned char head[16], head2[16]; - FT_Long rdata_pos, map_pos, rdata_len; + FT_Long rdata_pos, map_pos, rdata_len, map_len; int allzeros, allmatch, i, cnt, subcnt; - FT_Long type_list, rpos; - FT_ULong tag; + FT_Long type_list, tag, rpos, junk; error = FT_Stream_Seek( stream, resource_offset ); @@ -1375,7 +1342,10 @@ ( head[ 9] << 16 ) | ( head[10] << 8 ) | head[11]; - /* map_len = head[12] .. head[15] */ + map_len = ( head[12] << 24 ) | + ( head[13] << 16 ) | + ( head[14] << 8 ) | + head[15]; if ( rdata_pos + rdata_len != map_pos || map_pos == resource_offset ) return FT_Err_Unknown_File_Format; @@ -1384,7 +1354,7 @@ if ( error ) goto Exit; - head2[15] = (FT_Byte)( head[15] + 1 ); /* make it be different */ + head2[15] = head[15] + 1; /* make it be different */ error = FT_Stream_Read( stream, (FT_Byte*)head2, 16 ); if ( error ) @@ -1405,9 +1375,9 @@ /* If we've gotten this far then it's probably a mac resource file. */ /* Now, does it contain any interesting resources? */ - /* Skip handle to next resource map, the file resource number, and */ - /* attributes. */ - (void)FT_STREAM_SKIP( 4 + 2 + 2 ); + (void)FT_READ_LONG( junk ); /* skip handle to next resource map */ + (void)FT_READ_USHORT( junk ); /* skip file resource number */ + (void)FT_READ_USHORT( junk ); /* skip attributes */ if ( FT_READ_USHORT( type_list ) ) goto Exit; @@ -1527,8 +1497,14 @@ if ( FT_ERROR_BASE( error ) == FT_Err_Unknown_File_Format ) error = IsMacResource( library, stream, 0, face_index, aface ); - /* Only meaningful on sytems with hfs+ drivers (or Macs) */ - +#ifdef FT_MACINTOSH + /* + I know this section is within code which is normally turned off + for the Mac. It provides an alternative approach to reading the + mac resource forks on OS/X in the event that a user does not wish + to compile ftmac.c. + */ + if ( ( FT_ERROR_BASE( error ) == FT_Err_Unknown_File_Format || FT_ERROR_BASE( error ) == FT_Err_Invalid_Stream_Operation ) && ( args->flags & FT_OPEN_PATHNAME ) ) @@ -1541,10 +1517,8 @@ memory = library->memory; - if ( FT_ALLOC( newpath, - ft_strlen( args->pathname ) + ft_strlen( "/rsrc" ) + 1 ) ) - goto Fail; - + FT_ALLOC( newpath, + ft_strlen( args->pathname ) + ft_strlen( "/rsrc" ) + 1 ); ft_strcpy( newpath, args->pathname ); ft_strcat( newpath, "/rsrc" ); @@ -1559,7 +1533,8 @@ FT_FREE( newpath ); } - Fail: +#endif /* FT_MACINTOSH */ + return error; } @@ -1673,7 +1648,7 @@ FT_ERROR_BASE( error ) != FT_Err_Invalid_Stream_Operation ) goto Fail2; -#if !defined( FT_MACINTOSH ) && defined( FT_CONFIG_OPTION_MAC_FONTS ) +#ifndef FT_MACINTOSH error = load_mac_face( library, stream, face_index, aface, args ); if ( !error ) { @@ -1688,7 +1663,7 @@ if ( FT_ERROR_BASE( error ) != FT_Err_Unknown_File_Format ) goto Fail2; -#endif /* !FT_MACINTOSH && FT_CONFIG_OPTION_MAC_FONTS */ +#endif /* !FT_MACINTOSH */ /* no driver is able to handle this format */ error = FT_Err_Unknown_File_Format; @@ -1983,17 +1958,17 @@ { /* Compute root ascender, descender, test height, and max_advance */ - metrics->ascender = FT_PIX_CEIL( FT_MulFix( face->ascender, - metrics->y_scale ) ); + metrics->ascender = ( FT_MulFix( face->ascender, + metrics->y_scale ) + 63 ) & -64; - metrics->descender = FT_PIX_FLOOR( FT_MulFix( face->descender, - metrics->y_scale ) ); + metrics->descender = ( FT_MulFix( face->descender, + metrics->y_scale ) + 0 ) & -64; - metrics->height = FT_PIX_ROUND( FT_MulFix( face->height, - metrics->y_scale ) ); + metrics->height = ( FT_MulFix( face->height, + metrics->y_scale ) + 32 ) & -64; - metrics->max_advance = FT_PIX_ROUND( FT_MulFix( face->max_advance_width, - metrics->x_scale ) ); + metrics->max_advance = ( FT_MulFix( face->max_advance_width, + metrics->x_scale ) + 32 ) & -64; } @@ -2039,11 +2014,11 @@ char_height = 1 * 64; /* Compute pixel sizes in 26.6 units with rounding */ - dim_x = ( char_width * horz_resolution + 36 ) / 72; - dim_y = ( char_height * vert_resolution + 36 ) / 72; + dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64; + dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64; - metrics->x_ppem = (FT_UShort)( ( dim_x + 32 ) >> 6 ); - metrics->y_ppem = (FT_UShort)( ( dim_y + 32 ) >> 6 ); + metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); + metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); metrics->x_scale = 0x10000L; metrics->y_scale = 0x10000L; @@ -2086,6 +2061,7 @@ metrics = &face->size->metrics; clazz = driver->clazz; + /* default processing -- this can be overridden by the driver */ if ( pixel_width == 0 ) pixel_width = pixel_height; @@ -2097,12 +2073,6 @@ if ( pixel_height < 1 ) pixel_height = 1; - /* use `>=' to avoid potention compiler warning on 16bit platforms */ - if ( pixel_width >= 0xFFFFU ) - pixel_width = 0xFFFFU; - if ( pixel_height >= 0xFFFFU ) - pixel_height = 0xFFFFU; - metrics->x_ppem = (FT_UShort)pixel_width; metrics->y_ppem = (FT_UShort)pixel_height; @@ -2164,8 +2134,8 @@ if ( kern_mode != FT_KERNING_UNFITTED ) { - akerning->x = FT_PIX_ROUND( akerning->x ); - akerning->y = FT_PIX_ROUND( akerning->y ); + akerning->x = ( akerning->x + 32 ) & -64; + akerning->y = ( akerning->y + 32 ) & -64; } } } @@ -2398,15 +2368,21 @@ if ( face && FT_HAS_GLYPH_NAMES( face ) ) { - FT_Service_GlyphDict service; + /* now, lookup for glyph name */ + FT_Driver driver = face->driver; + FT_Module_Class* clazz = FT_MODULE_CLASS( driver ); - FT_FACE_LOOKUP_SERVICE( face, - service, - GLYPH_DICT ); + if ( clazz->get_interface ) + { + FT_Face_GetGlyphNameIndexFunc requester; - if ( service && service->name_index ) - result = service->name_index( face, glyph_name ); + + requester = (FT_Face_GetGlyphNameIndexFunc)clazz->get_interface( + FT_MODULE( driver ), "name_index" ); + if ( requester ) + result = requester( face, glyph_name ); + } } return result; @@ -2432,15 +2408,21 @@ glyph_index <= (FT_UInt)face->num_glyphs && FT_HAS_GLYPH_NAMES( face ) ) { - FT_Service_GlyphDict service; + /* now, lookup for glyph name */ + FT_Driver driver = face->driver; + FT_Module_Class* clazz = FT_MODULE_CLASS( driver ); - FT_FACE_LOOKUP_SERVICE( face, - service, - GLYPH_DICT ); + if ( clazz->get_interface ) + { + FT_Face_GetGlyphNameFunc requester; - if ( service && service->get_name ) - error = service->get_name( face, glyph_index, buffer, buffer_max ); + + requester = (FT_Face_GetGlyphNameFunc)clazz->get_interface( + FT_MODULE( driver ), "glyph_name" ); + if ( requester ) + error = requester( face, glyph_index, buffer, buffer_max ); + } } return error; @@ -2458,19 +2440,25 @@ if ( !face ) goto Exit; + result = face->internal->postscript_name; if ( !result ) { - FT_Service_PsFontName service; + /* now, look up glyph name */ + FT_Driver driver = face->driver; + FT_Module_Class* clazz = FT_MODULE_CLASS( driver ); - FT_FACE_LOOKUP_SERVICE( face, - service, - POSTSCRIPT_FONT_NAME ); + if ( clazz->get_interface ) + { + FT_Face_GetPostscriptNameFunc requester; - if ( service && service->get_ps_font_name ) - result = service->get_ps_font_name( face ); + + requester = (FT_Face_GetPostscriptNameFunc)clazz->get_interface( + FT_MODULE( driver ), "postscript_name" ); + if ( requester ) + result = requester( face ); + } } - Exit: return result; } @@ -2482,17 +2470,21 @@ FT_Get_Sfnt_Table( FT_Face face, FT_Sfnt_Tag tag ) { - void* table = 0; - FT_Service_SFNT_Table service; + void* table = 0; + FT_Get_Sfnt_Table_Func func; + FT_Driver driver; - if ( face && FT_IS_SFNT( face ) ) - { - FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE ); - if ( service != NULL ) - table = service->get_table( face, tag ); - } + if ( !face || !FT_IS_SFNT( face ) ) + goto Exit; + driver = face->driver; + func = (FT_Get_Sfnt_Table_Func)driver->root.clazz->get_interface( + FT_MODULE( driver ), "get_sfnt" ); + if ( func ) + table = func( face, tag ); + + Exit: return table; } @@ -2506,39 +2498,20 @@ FT_Byte* buffer, FT_ULong* length ) { - FT_Service_SFNT_Table service; + SFNT_Load_Table_Func func; + FT_Driver driver; if ( !face || !FT_IS_SFNT( face ) ) return FT_Err_Invalid_Face_Handle; - FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE ); - if ( service == NULL ) + driver = face->driver; + func = (SFNT_Load_Table_Func) driver->root.clazz->get_interface( + FT_MODULE( driver ), "load_sfnt" ); + if ( !func ) return FT_Err_Unimplemented_Feature; - return service->load_table( face, tag, offset, buffer, length ); - } - - - FT_EXPORT_DEF( FT_ULong ) - FT_Get_CMap_Language_ID( FT_CharMap charmap ) - { - FT_Service_TTCMaps service; - FT_Face face; - TT_CMapInfo cmap_info; - - - if ( !charmap || !charmap->face ) - return 0; - - face = charmap->face; - FT_FACE_FIND_SERVICE( face, service, TT_CMAP ); - if ( service == NULL ) - return 0; - if ( service->get_cmap_info( charmap, &cmap_info )) - return 0; - - return cmap_info.language; + return func( face, tag, offset, buffer, length ); } @@ -3088,50 +3061,6 @@ } - FT_BASE_DEF( FT_Pointer ) - ft_module_get_service( FT_Module module, - const char* service_id ) - { - FT_Pointer result = NULL; - - if ( module ) - { - FT_ASSERT( module->clazz && module->clazz->get_interface ); - - /* first, look for the service in the module - */ - if ( module->clazz->get_interface ) - result = module->clazz->get_interface( module, service_id ); - - if ( result == NULL ) - { - /* we didn't find it, look in all other modules then - */ - FT_Library library = module->library; - FT_Module* cur = library->modules; - FT_Module* limit = cur + library->num_modules; - - for ( ; cur < limit; cur++ ) - { - if ( cur[0] != module ) - { - FT_ASSERT( cur[0]->clazz ); - - if ( cur[0]->clazz->get_interface ) - { - result = cur[0]->clazz->get_interface( cur[0], service_id ); - if ( result != NULL ) - break; - } - } - } - } - } - - return result; - } - - /* documentation is in ftmodule.h */ FT_EXPORT_DEF( FT_Error ) diff --git a/reactos/lib/freetype/src/base/ftoutln.c b/reactos/lib/freetype/src/base/ftoutln.c index 5cae931f67e..c59043bc049 100644 --- a/reactos/lib/freetype/src/base/ftoutln.c +++ b/reactos/lib/freetype/src/base/ftoutln.c @@ -4,7 +4,7 @@ /* */ /* FreeType outline management (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -26,7 +26,6 @@ #include <ft2build.h> #include FT_OUTLINE_H #include FT_INTERNAL_OBJECTS_H -#include FT_TRIGONOMETRY_H /*************************************************************************/ @@ -358,11 +357,14 @@ source->n_contours != target->n_contours ) return FT_Err_Invalid_Argument; - FT_ARRAY_COPY( target->points, source->points, source->n_points ); + FT_MEM_COPY( target->points, source->points, + source->n_points * sizeof ( FT_Vector ) ); - FT_ARRAY_COPY( target->tags, source->tags, source->n_points ); + FT_MEM_COPY( target->tags, source->tags, + source->n_points * sizeof ( FT_Byte ) ); - FT_ARRAY_COPY( target->contours, source->contours, source->n_contours ); + FT_MEM_COPY( target->contours, source->contours, + source->n_contours * sizeof ( FT_Short ) ); /* copy all flags, except the `FT_OUTLINE_OWNER' one */ is_owner = target->flags & FT_OUTLINE_OWNER; @@ -653,143 +655,4 @@ } - typedef struct FT_OrientationExtremumRec_ - { - FT_Int index; - FT_Long pos; - FT_Int first; - FT_Int last; - - } FT_OrientationExtremumRec; - - - static FT_Orientation - ft_orientation_extremum_compute( FT_OrientationExtremumRec* extremum, - FT_Outline* outline ) - { - FT_Vector *point, *first, *last, *prev, *next; - FT_Vector* points = outline->points; - FT_Angle angle_in, angle_out; - - - /* compute the previous and next points in the same contour */ - point = points + extremum->index; - first = points + extremum->first; - last = points + extremum->last; - - prev = point; - next = point; - - do - { - prev = ( prev == first ) ? last : prev - 1; - if ( prev == point ) - return FT_ORIENTATION_TRUETYPE; /* degenerate case */ - - } while ( prev->x != point->x || prev->y != point->y ); - - do - { - next = ( next == last ) ? first : next + 1; - if ( next == point ) - return FT_ORIENTATION_TRUETYPE; /* shouldn't happen */ - - } while ( next->x != point->x || next->y != point->y ); - - /* now compute the orientation of the `out' vector relative */ - /* to the `in' vector. */ - angle_in = FT_Atan2( point->x - prev->x, point->y - prev->y ); - angle_out = FT_Atan2( next->x - point->x, next->y - point->y ); - - return ( FT_Angle_Diff( angle_in, angle_out ) >= 0 ) - ? FT_ORIENTATION_TRUETYPE - : FT_ORIENTATION_POSTSCRIPT; - } - - - FT_EXPORT_DEF( FT_Orientation ) - FT_Outline_Get_Orientation( FT_Outline* outline ) - { - FT_Orientation result = FT_ORIENTATION_TRUETYPE; - - - if ( outline && outline->n_points > 0 ) - { - FT_OrientationExtremumRec xmin, ymin, xmax, ymax; - FT_Int n; - FT_Int first, last; - FT_Vector* points = outline->points; - - - xmin.pos = ymin.pos = +32768L; - xmax.pos = ymax.pos = -32768L; - - xmin.index = ymin.index = xmax.index = ymax.index = -1; - - first = 0; - for ( n = 0; n < outline->n_contours; n++, first = last + 1 ) - { - last = outline->contours[n]; - - /* skip single-point contours; these are degenerated cases */ - if ( last > first + 1 ) - { - FT_Int i; - - - for ( i = first; i < last; i++ ) - { - FT_Pos x = points[i].x; - FT_Pos y = points[i].y; - - - if ( x < xmin.pos ) - { - xmin.pos = x; - xmin.index = i; - xmin.first = first; - xmin.last = last; - } - if ( x > xmax.pos ) - { - xmax.pos = x; - xmax.index = i; - xmax.first = first; - xmax.last = last; - } - if ( y < ymin.pos ) - { - ymin.pos = y; - ymin.index = i; - ymin.first = first; - ymin.last = last; - } - if ( y > ymax.pos ) - { - ymax.pos = y; - ymax.index = i; - ymax.first = first; - ymax.last = last; - } - } - } - - if ( xmin.index >= 0 ) - result = ft_orientation_extremum_compute( &xmin, outline ); - - else if ( xmax.index >= 0 ) - result = ft_orientation_extremum_compute( &xmax, outline ); - - else if ( ymin.index >= 0 ) - result = ft_orientation_extremum_compute( &ymin, outline ); - - else if ( ymax.index >= 0 ) - result = ft_orientation_extremum_compute( &ymax, outline ); - } - } - - return result; - } - - /* END */ diff --git a/reactos/lib/freetype/src/base/ftpfr.c b/reactos/lib/freetype/src/base/ftpfr.c index fb959e37fc9..d9594cb788a 100644 --- a/reactos/lib/freetype/src/base/ftpfr.c +++ b/reactos/lib/freetype/src/base/ftpfr.c @@ -16,20 +16,34 @@ /***************************************************************************/ #include <ft2build.h> +#include FT_INTERNAL_PFR_H #include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_PFR_H /* check the format */ - static FT_Service_PfrMetrics - ft_pfr_check( FT_Face face ) + static FT_Error + ft_pfr_check( FT_Face face, + FT_PFR_Service *aservice ) { - FT_Service_PfrMetrics service; + FT_Error error = FT_Err_Bad_Argument; - FT_FACE_LOOKUP_SERVICE( face, service, PFR_METRICS ); + if ( face && face->driver ) + { + FT_Module module = (FT_Module) face->driver; + const char* name = module->clazz->module_name; - return service; + + if ( name[0] == 'p' && + name[1] == 'f' && + name[2] == 'r' && + name[4] == 0 ) + { + *aservice = (FT_PFR_Service) module->clazz->module_interface; + error = 0; + } + } + return error; } @@ -40,12 +54,12 @@ FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_y_scale ) { - FT_Error error = FT_Err_Ok; - FT_Service_PfrMetrics service; + FT_Error error; + FT_PFR_Service service; - service = ft_pfr_check( face ); - if ( service ) + error = ft_pfr_check( face, &service ); + if ( !error ) { error = service->get_metrics( face, aoutline_resolution, @@ -53,27 +67,6 @@ ametrics_x_scale, ametrics_y_scale ); } - else if ( face ) - { - FT_Fixed x_scale, y_scale; - - - /* this is not a PFR font */ - *aoutline_resolution = face->units_per_EM; - *ametrics_resolution = face->units_per_EM; - - x_scale = y_scale = 0x10000L; - if ( face->size ) - { - x_scale = face->size->metrics.x_scale; - y_scale = face->size->metrics.y_scale; - } - *ametrics_x_scale = x_scale; - *ametrics_y_scale = y_scale; - } - else - error = FT_Err_Invalid_Argument; - return error; } @@ -84,19 +77,15 @@ FT_UInt right, FT_Vector *avector ) { - FT_Error error; - FT_Service_PfrMetrics service; + FT_Error error; + FT_PFR_Service service; - service = ft_pfr_check( face ); - if ( service ) + error = ft_pfr_check( face, &service ); + if ( !error ) + { error = service->get_kerning( face, left, right, avector ); - else if ( face ) - error = FT_Get_Kerning( face, left, right, - FT_KERNING_UNSCALED, avector ); - else - error = FT_Err_Invalid_Argument; - + } return error; } @@ -106,19 +95,15 @@ FT_UInt gindex, FT_Pos *aadvance ) { - FT_Error error; - FT_Service_PfrMetrics service; + FT_Error error; + FT_PFR_Service service; - service = ft_pfr_check( face ); - if ( service ) + error = ft_pfr_check( face, &service ); + if ( !error ) { error = service->get_advance( face, gindex, aadvance ); } - else - /* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */ - error = FT_Err_Invalid_Argument; - return error; } diff --git a/reactos/lib/freetype/src/base/ftstroke.c b/reactos/lib/freetype/src/base/ftstroke.c index 942820ad960..d6d5be3211e 100644 --- a/reactos/lib/freetype/src/base/ftstroke.c +++ b/reactos/lib/freetype/src/base/ftstroke.c @@ -4,7 +4,7 @@ /* */ /* FreeType path stroker (body). */ /* */ -/* Copyright 2002, 2003, 2004 by */ +/* Copyright 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -19,31 +19,8 @@ #include <ft2build.h> #include FT_STROKER_H #include FT_TRIGONOMETRY_H -#include FT_OUTLINE_H #include FT_INTERNAL_MEMORY_H #include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H - - FT_EXPORT_DEF( FT_StrokerBorder ) - FT_Outline_GetInsideBorder( FT_Outline* outline ) - { - FT_Orientation o = FT_Outline_Get_Orientation( outline ); - - - return o == FT_ORIENTATION_TRUETYPE ? FT_STROKER_BORDER_RIGHT - : FT_STROKER_BORDER_LEFT ; - } - - - FT_EXPORT_DEF( FT_StrokerBorder ) - FT_Outline_GetOutsideBorder( FT_Outline* outline ) - { - FT_Orientation o = FT_Outline_Get_Orientation( outline ); - - - return o == FT_ORIENTATION_TRUETYPE ? FT_STROKER_BORDER_LEFT - : FT_STROKER_BORDER_RIGHT ; - } /***************************************************************************/ @@ -244,7 +221,6 @@ FT_Bool movable; FT_Int start; /* index of current sub-path start point */ FT_Memory memory; - FT_Bool valid; } FT_StrokeBorderRec, *FT_StrokeBorder; @@ -492,7 +468,6 @@ border->num_points = 0; border->max_points = 0; border->start = -1; - border->valid = 0; } @@ -501,7 +476,6 @@ { border->num_points = 0; border->start = -1; - border->valid = 0; } @@ -517,7 +491,6 @@ border->num_points = 0; border->max_points = 0; border->start = -1; - border->valid = 0; } @@ -547,7 +520,7 @@ } else if ( in_contour == 0 ) goto Fail; - + if ( tags[0] & FT_STROKE_TAG_END ) { if ( in_contour == 0 ) @@ -561,8 +534,6 @@ if ( in_contour != 0 ) goto Fail; - border->valid = 1; - Exit: *anum_points = num_points; *anum_contours = num_contours; @@ -580,9 +551,9 @@ FT_Outline* outline ) { /* copy point locations */ - FT_ARRAY_COPY( outline->points + outline->n_points, - border->points, - border->num_points ); + FT_MEM_COPY( outline->points + outline->n_points, + border->points, + border->num_points * sizeof ( FT_Vector ) ); /* copy tags */ { @@ -690,18 +661,10 @@ stroker->line_join = line_join; stroker->miter_limit = miter_limit; - FT_Stroker_Rewind( stroker ); - } + stroker->valid = 0; - - FT_EXPORT_DEF( void ) - FT_Stroker_Rewind( FT_Stroker stroker ) - { - if ( stroker ) - { - ft_stroke_border_reset( &stroker->borders[0] ); - ft_stroke_border_reset( &stroker->borders[1] ); - } + ft_stroke_border_reset( &stroker->borders[0] ); + ft_stroke_border_reset( &stroker->borders[1] ); } @@ -1384,6 +1347,7 @@ { FT_Error error = 0; + if ( stroker->subpath_open ) { FT_StrokeBorder right = stroker->borders; @@ -1416,14 +1380,6 @@ FT_Angle turn; FT_Int inside_side; - /* close the path if needed */ - if ( stroker->center.x != stroker->subpath_start.x || - stroker->center.y != stroker->subpath_start.y ) - { - error = FT_Stroker_LineTo( stroker, &stroker->subpath_start ); - if ( error ) - goto Exit; - } /* process the corner */ stroker->angle_out = stroker->subpath_angle; @@ -1452,9 +1408,14 @@ goto Exit; } - /* then end our two subpaths */ + /* we will first end our two subpaths */ ft_stroke_border_close( stroker->borders + 0 ); ft_stroke_border_close( stroker->borders + 1 ); + + /* now, add the reversed left subpath to "right" */ + error = ft_stroker_add_reverse_left( stroker, 0 ); + if ( error ) + goto Exit; } Exit: @@ -1462,35 +1423,6 @@ } - FT_EXPORT_DEF( FT_Error ) - FT_Stroker_GetBorderCounts( FT_Stroker stroker, - FT_StrokerBorder border, - FT_UInt *anum_points, - FT_UInt *anum_contours ) - { - FT_UInt num_points = 0, num_contours = 0; - FT_Error error; - - - if ( !stroker || border > 1 ) - { - error = FT_Err_Invalid_Argument; - goto Exit; - } - - error = ft_stroke_border_get_counts( stroker->borders + border, - &num_points, &num_contours ); - Exit: - if ( anum_points ) - *anum_points = num_points; - - if ( anum_contours ) - *anum_contours = num_contours; - - return error; - } - - FT_EXPORT_DEF( FT_Error ) FT_Stroker_GetCounts( FT_Stroker stroker, FT_UInt *anum_points, @@ -1514,6 +1446,8 @@ num_points = count1 + count3; num_contours = count2 + count4; + stroker->valid = 1; + Exit: *anum_points = num_points; *anum_contours = num_contours; @@ -1521,29 +1455,15 @@ } - FT_EXPORT_DEF( void ) - FT_Stroker_ExportBorder( FT_Stroker stroker, - FT_StrokerBorder border, - FT_Outline* outline ) - { - if ( border == FT_STROKER_BORDER_LEFT || - border == FT_STROKER_BORDER_RIGHT ) - { - FT_StrokeBorder sborder = & stroker->borders[border]; - - - if ( sborder->valid ) - ft_stroke_border_export( sborder, outline ); - } - } - - FT_EXPORT_DEF( void ) FT_Stroker_Export( FT_Stroker stroker, FT_Outline* outline ) { - FT_Stroker_ExportBorder( stroker, FT_STROKER_BORDER_LEFT, outline ); - FT_Stroker_ExportBorder( stroker, FT_STROKER_BORDER_RIGHT, outline ); + if ( stroker->valid ) + { + ft_stroke_border_export( stroker->borders + 0, outline ); + ft_stroke_border_export( stroker->borders + 1, outline ); + } } @@ -1574,8 +1494,6 @@ if ( !outline || !stroker ) return FT_Err_Invalid_Argument; - FT_Stroker_Rewind( stroker ); - first = 0; for ( n = 0; n < outline->n_contours; n++ ) @@ -1746,156 +1664,4 @@ } - extern const FT_Glyph_Class ft_outline_glyph_class; - - - FT_EXPORT_DEF( FT_Error ) - FT_Glyph_Stroke( FT_Glyph *pglyph, - FT_Stroker stroker, - FT_Bool destroy ) - { - FT_Error error = FT_Err_Invalid_Argument; - FT_Glyph glyph = NULL; - - - if ( pglyph == NULL ) - goto Exit; - - glyph = *pglyph; - if ( glyph == NULL || glyph->clazz != &ft_outline_glyph_class ) - goto Exit; - - { - FT_Glyph copy; - - - error = FT_Glyph_Copy( glyph, © ); - if ( error ) - goto Exit; - - glyph = copy; - } - - { - FT_OutlineGlyph oglyph = (FT_OutlineGlyph) glyph; - FT_Outline* outline = &oglyph->outline; - FT_UInt num_points, num_contours; - - - error = FT_Stroker_ParseOutline( stroker, outline, 0 ); - if ( error ) - goto Fail; - - (void)FT_Stroker_GetCounts( stroker, &num_points, &num_contours ); - - FT_Outline_Done( glyph->library, outline ); - - error = FT_Outline_New( glyph->library, - num_points, num_contours, outline ); - if ( error ) - goto Fail; - - outline->n_points = 0; - outline->n_contours = 0; - - FT_Stroker_Export( stroker, outline ); - } - - if ( destroy ) - FT_Done_Glyph( *pglyph ); - - *pglyph = glyph; - goto Exit; - - Fail: - FT_Done_Glyph( glyph ); - glyph = NULL; - - if ( !destroy ) - *pglyph = NULL; - - Exit: - return error; - } - - - FT_EXPORT_DEF( FT_Error ) - FT_Glyph_StrokeBorder( FT_Glyph *pglyph, - FT_Stroker stroker, - FT_Bool inside, - FT_Bool destroy ) - { - FT_Error error = FT_Err_Invalid_Argument; - FT_Glyph glyph = NULL; - - - if ( pglyph == NULL ) - goto Exit; - - glyph = *pglyph; - if ( glyph == NULL || glyph->clazz != &ft_outline_glyph_class ) - goto Exit; - - { - FT_Glyph copy; - - - error = FT_Glyph_Copy( glyph, © ); - if ( error ) - goto Exit; - - glyph = copy; - } - - { - FT_OutlineGlyph oglyph = (FT_OutlineGlyph) glyph; - FT_StrokerBorder border; - FT_Outline* outline = &oglyph->outline; - FT_UInt num_points, num_contours; - - - border = FT_Outline_GetOutsideBorder( outline ); - if ( inside ) - border = 1 - border; - - error = FT_Stroker_ParseOutline( stroker, outline, 0 ); - if ( error ) - goto Fail; - - (void)FT_Stroker_GetBorderCounts( stroker, border, - &num_points, &num_contours ); - - FT_Outline_Done( glyph->library, outline ); - - error = FT_Outline_New( glyph->library, - num_points, - num_contours, - outline ); - if ( error ) - goto Fail; - - outline->n_points = 0; - outline->n_contours = 0; - - FT_Stroker_ExportBorder( stroker, border, outline ); - } - - if ( destroy ) - FT_Done_Glyph( *pglyph ); - - *pglyph = glyph; - goto Exit; - - Fail: - FT_Done_Glyph( glyph ); - glyph = NULL; - - if ( !destroy ) - *pglyph = NULL; - - Exit: - return error; - } - - /* END */ diff --git a/reactos/lib/freetype/src/base/ftsynth.c b/reactos/lib/freetype/src/base/ftsynth.c index cee36822fd2..72979faae57 100644 --- a/reactos/lib/freetype/src/base/ftsynth.c +++ b/reactos/lib/freetype/src/base/ftsynth.c @@ -4,7 +4,7 @@ /* */ /* FreeType synthesizing code for emboldening and slanting (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003 by */ +/* Copyright 2000-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -279,8 +279,7 @@ first = last + 1; } - slot->metrics.horiAdvance = - ( slot->metrics.horiAdvance + distance*4 ) & ~63; + slot->metrics.horiAdvance = ( slot->metrics.horiAdvance + distance*4 ) & -64; } diff --git a/reactos/lib/freetype/src/base/fttrigon.c b/reactos/lib/freetype/src/base/fttrigon.c index 5347dd852a3..82cd3b246fb 100644 --- a/reactos/lib/freetype/src/base/fttrigon.c +++ b/reactos/lib/freetype/src/base/fttrigon.c @@ -17,7 +17,6 @@ #include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H #include FT_TRIGONOMETRY_H @@ -272,9 +271,9 @@ /* round theta */ if ( theta >= 0 ) - theta = FT_PAD_ROUND( theta, 32 ); + theta = ( theta + 16 ) & -32; else - theta = - FT_PAD_ROUND( -theta, 32 ); + theta = - (( -theta + 16 ) & -32); vec->x = x; vec->y = theta; diff --git a/reactos/lib/freetype/src/base/fttype1.c b/reactos/lib/freetype/src/base/fttype1.c index 553b84f56f8..d8b188647d7 100644 --- a/reactos/lib/freetype/src/base/fttype1.c +++ b/reactos/lib/freetype/src/base/fttype1.c @@ -4,7 +4,7 @@ /* */ /* FreeType utility file for PS names support (body). */ /* */ -/* Copyright 2002, 2003 by */ +/* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,9 +17,9 @@ #include <ft2build.h> +#include FT_INTERNAL_TYPE1_TYPES_H +#include FT_INTERNAL_TYPE42_TYPES_H #include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_SERVICE_H -#include FT_SERVICE_POSTSCRIPT_INFO_H /* documentation is in t1tables.h */ @@ -28,39 +28,56 @@ FT_Get_PS_Font_Info( FT_Face face, PS_FontInfoRec* afont_info ) { - FT_Error error = FT_Err_Invalid_Argument; + PS_FontInfo font_info = NULL; + FT_Error error = FT_Err_Invalid_Argument; + const char* driver_name; - if ( face ) + if ( face && face->driver && face->driver->root.clazz ) { - FT_Service_PsInfo service = NULL; - - - FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO ); - - if ( service && service->ps_get_font_info ) - error = service->ps_get_font_info( face, afont_info ); + driver_name = face->driver->root.clazz->module_name; + if ( ft_strcmp( driver_name, "type1" ) == 0 ) + font_info = &((T1_Face)face)->type1.font_info; + else if ( ft_strcmp( driver_name, "t1cid" ) == 0 ) + font_info = &((CID_Face)face)->cid.font_info; + else if ( ft_strcmp( driver_name, "type42" ) == 0 ) + font_info = &((T42_Face)face)->type1.font_info; + } + if ( font_info != NULL ) + { + *afont_info = *font_info; + error = FT_Err_Ok; } return error; } + /* XXX: Bad hack, but I didn't want to change several drivers here. */ + /* documentation is in t1tables.h */ FT_EXPORT_DEF( FT_Int ) FT_Has_PS_Glyph_Names( FT_Face face ) { - FT_Int result = 0; - FT_Service_PsInfo service = NULL; + FT_Int result = 0; + const char* driver_name; - if ( face ) + if ( face && face->driver && face->driver->root.clazz ) { - FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO ); + /* Currently, only the type1, type42, and cff drivers provide */ + /* reliable glyph names... */ - if ( service && service->ps_has_glyph_names ) - result = service->ps_has_glyph_names( face ); + /* We could probably hack the TrueType driver to recognize */ + /* certain cases where the glyph names are most certainly */ + /* correct (e.g. using a 20 or 22 format `post' table), but */ + /* this will probably happen later... */ + + driver_name = face->driver->root.clazz->module_name; + result = ( ft_strcmp( driver_name, "type1" ) == 0 || + ft_strcmp( driver_name, "type42" ) == 0 || + ft_strcmp( driver_name, "cff" ) == 0 ); } return result; diff --git a/reactos/lib/freetype/src/base/ftwinfnt.c b/reactos/lib/freetype/src/base/ftwinfnt.c index 46f618c5182..2cbe343d1c7 100644 --- a/reactos/lib/freetype/src/base/ftwinfnt.c +++ b/reactos/lib/freetype/src/base/ftwinfnt.c @@ -18,30 +18,38 @@ #include <ft2build.h> #include FT_WINFONTS_H +#include FT_INTERNAL_FNT_TYPES_H #include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_WINFNT_H FT_EXPORT_DEF( FT_Error ) FT_Get_WinFNT_Header( FT_Face face, FT_WinFNT_HeaderRec *header ) { - FT_Service_WinFnt service; - FT_Error error; + FT_Error error; error = FT_Err_Invalid_Argument; - if ( face != NULL ) + if ( face != NULL && face->driver != NULL ) { - FT_FACE_LOOKUP_SERVICE( face, service, WINFNT ); + FT_Module driver = (FT_Module) face->driver; - if ( service != NULL ) + + if ( driver->clazz && driver->clazz->module_name && + ft_strcmp( driver->clazz->module_name, "winfonts" ) == 0 ) { - error = service->get_header( face, header ); + FNT_Face fnt_face = (FNT_Face)face; + FNT_Font font = fnt_face->font; + + + if ( font ) + { + FT_MEM_COPY( header, &font->header, sizeof ( *header ) ); + error = FT_Err_Ok; + } } } - return error; } diff --git a/reactos/lib/freetype/src/base/ftxf86.c b/reactos/lib/freetype/src/base/ftxf86.c index 04e80236e61..1f5e42ced47 100644 --- a/reactos/lib/freetype/src/base/ftxf86.c +++ b/reactos/lib/freetype/src/base/ftxf86.c @@ -4,7 +4,7 @@ /* */ /* FreeType utility file for X11 support (body). */ /* */ -/* Copyright 2002, 2003 by */ +/* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -19,16 +19,59 @@ #include <ft2build.h> #include FT_XFREE86_H #include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_XFREE86_NAME_H + + /* XXX: This really is a sad hack, but I didn't want to change every */ + /* driver just to support this at the moment, since other important */ + /* changes are coming anyway. */ + + typedef struct FT_FontFormatRec_ + { + const char* driver_name; + const char* format_name; + + } FT_FontFormatRec; + FT_EXPORT_DEF( const char* ) FT_Get_X11_Font_Format( FT_Face face ) { + static const FT_FontFormatRec font_formats[] = + { + { "type1", "Type 1" }, + { "truetype", "TrueType" }, + { "bdf", "BDF" }, + { "pcf", "PCF" }, + { "type42", "Type 42" }, + { "cidtype1", "CID Type 1" }, + { "cff", "CFF" }, + { "pfr", "PFR" }, + { "winfonts", "Windows FNT" } + }; + const char* result = NULL; - if ( face ) - FT_FACE_FIND_SERVICE( face, result, XF86_NAME ); + if ( face && face->driver ) + { + FT_Module driver = (FT_Module)face->driver; + + + if ( driver->clazz && driver->clazz->module_name ) + { + FT_Int n; + FT_Int count = sizeof( font_formats ) / sizeof ( font_formats[0] ); + + + result = driver->clazz->module_name; + + for ( n = 0; n < count; n++ ) + if ( ft_strcmp( result, font_formats[n].driver_name ) == 0 ) + { + result = font_formats[n].format_name; + break; + } + } + } return result; } diff --git a/reactos/lib/freetype/src/bdf/bdfdrivr.c b/reactos/lib/freetype/src/bdf/bdfdrivr.c index a231fcd4fce..dbd4a2f6475 100644 --- a/reactos/lib/freetype/src/bdf/bdfdrivr.c +++ b/reactos/lib/freetype/src/bdf/bdfdrivr.c @@ -31,9 +31,6 @@ THE SOFTWARE. #include FT_INTERNAL_OBJECTS_H #include FT_BDF_H -#include FT_SERVICE_BDF_H -#include FT_SERVICE_XFREE86_NAME_H - #include "bdf.h" #include "bdfdrivr.h" @@ -172,118 +169,6 @@ THE SOFTWARE. }; - static FT_Error - bdf_interpret_style( BDF_Face bdf ) - { - FT_Error error = BDF_Err_Ok; - FT_Face face = FT_FACE( bdf ); - FT_Memory memory = face->memory; - bdf_font_t* font = bdf->bdffont; - bdf_property_t* prop; - - char *istr = NULL, *bstr = NULL; - char *sstr = NULL, *astr = NULL; - - int parts = 0, len = 0; - - - face->style_flags = 0; - - prop = bdf_get_font_property( font, (char *)"SLANT" ); - if ( prop && prop->format == BDF_ATOM && - prop->value.atom && - ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' || - *(prop->value.atom) == 'I' || *(prop->value.atom) == 'i' ) ) - { - face->style_flags |= FT_STYLE_FLAG_ITALIC; - istr = ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' ) - ? (char *)"Oblique" - : (char *)"Italic"; - len += ft_strlen( istr ); - parts++; - } - - prop = bdf_get_font_property( font, (char *)"WEIGHT_NAME" ); - if ( prop && prop->format == BDF_ATOM && - prop->value.atom && - ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) ) - { - face->style_flags |= FT_STYLE_FLAG_BOLD; - bstr = (char *)"Bold"; - len += ft_strlen( bstr ); - parts++; - } - - prop = bdf_get_font_property( font, (char *)"SETWIDTH_NAME" ); - if ( prop && prop->format == BDF_ATOM && - prop->value.atom && *(prop->value.atom) && - !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) - { - sstr = (char *)(prop->value.atom); - len += ft_strlen( sstr ); - parts++; - } - - prop = bdf_get_font_property( font, (char *)"ADD_STYLE_NAME" ); - if ( prop && prop->format == BDF_ATOM && - prop->value.atom && *(prop->value.atom) && - !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) - { - astr = (char *)(prop->value.atom); - len += ft_strlen( astr ); - parts++; - } - - if ( !parts || !len ) - face->style_name = (char *)"Regular"; - else - { - char *style, *s; - unsigned int i; - - - if ( FT_ALLOC( style, len + parts ) ) - return error; - - s = style; - - if ( astr ) - { - ft_strcpy( s, astr ); - for ( i = 0; i < ft_strlen( astr ); i++, s++ ) - if ( *s == ' ' ) - *s = '-'; /* replace spaces with dashes */ - *(s++) = ' '; - } - if ( bstr ) - { - ft_strcpy( s, bstr ); - s += ft_strlen( bstr ); - *(s++) = ' '; - } - if ( istr ) - { - ft_strcpy( s, istr ); - s += ft_strlen( istr ); - *(s++) = ' '; - } - if ( sstr ) - { - ft_strcpy( s, sstr ); - for ( i = 0; i < ft_strlen( sstr ); i++, s++ ) - if ( *s == ' ' ) - *s = '-'; /* replace spaces with dashes */ - *(s++) = ' '; - } - *(--s) = '\0'; /* overwrite last ' ', terminate the string */ - - face->style_name = style; /* allocated string */ - } - - return error; - } - - FT_CALLBACK_DEF( FT_Error ) BDF_Face_Done( BDF_Face face ) { @@ -364,17 +249,39 @@ THE SOFTWARE. FT_FACE_FLAG_FAST_GLYPHS; prop = bdf_get_font_property( font, "SPACING" ); - if ( prop && prop->format == BDF_ATOM && - prop->value.atom && - ( *(prop->value.atom) == 'M' || *(prop->value.atom) == 'm' || - *(prop->value.atom) == 'C' || *(prop->value.atom) == 'c' ) ) - root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; + if ( prop != NULL ) + if ( prop->format == BDF_ATOM ) + if ( prop->value.atom != NULL ) + if ( ( *(prop->value.atom) == 'M' ) || + ( *(prop->value.atom) == 'm' ) || + ( *(prop->value.atom) == 'C' ) || + ( *(prop->value.atom) == 'c' ) ) + root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; /* FZ XXX: TO DO: FT_FACE_FLAGS_VERTICAL */ /* FZ XXX: I need a font to implement this */ + root->style_flags = 0; + prop = bdf_get_font_property( font, "SLANT" ); + if ( prop != NULL ) + if ( prop->format == BDF_ATOM ) + if ( prop->value.atom != NULL ) + if ( ( *(prop->value.atom) == 'O' ) || + ( *(prop->value.atom) == 'o' ) || + ( *(prop->value.atom) == 'I' ) || + ( *(prop->value.atom) == 'i' ) ) + root->style_flags |= FT_STYLE_FLAG_ITALIC; + + prop = bdf_get_font_property( font, "WEIGHT_NAME" ); + if ( prop != NULL ) + if ( prop->format == BDF_ATOM ) + if ( prop->value.atom != NULL ) + if ( ( *(prop->value.atom) == 'B' ) || + ( *(prop->value.atom) == 'b' ) ) + root->style_flags |= FT_STYLE_FLAG_BOLD; + prop = bdf_get_font_property( font, "FAMILY_NAME" ); - if ( prop && prop->value.atom ) + if ( ( prop != NULL ) && ( prop->value.atom != NULL ) ) { int l = ft_strlen( prop->value.atom ) + 1; @@ -386,8 +293,16 @@ THE SOFTWARE. else root->family_name = 0; - if ( ( error = bdf_interpret_style( face ) ) != 0 ) - goto Exit; + root->style_name = (char *)"Regular"; + if ( root->style_flags & FT_STYLE_FLAG_BOLD ) + { + if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) + root->style_name = (char *)"Bold Italic"; + else + root->style_name = (char *)"Bold"; + } + else if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) + root->style_name = (char *)"Italic"; root->num_glyphs = font->glyphs_size; /* unencoded included */ @@ -402,26 +317,26 @@ THE SOFTWARE. FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) ); prop = bdf_get_font_property( font, "PIXEL_SIZE" ); - if ( prop ) + if ( prop != NULL ) bsize->height = (FT_Short)prop->value.int32; prop = bdf_get_font_property( font, "AVERAGE_WIDTH" ); - if ( prop ) + if ( prop != NULL ) bsize->width = (FT_Short)( ( prop->value.int32 + 5 ) / 10 ); prop = bdf_get_font_property( font, "POINT_SIZE" ); - if ( prop ) + if ( prop != NULL ) /* convert from 722.7 decipoints to 72 points per inch */ bsize->size = (FT_Pos)( ( prop->value.int32 * 64 * 7200 + 36135L ) / 72270L ); prop = bdf_get_font_property( font, "RESOLUTION_X" ); - if ( prop ) + if ( prop != NULL ) bsize->x_ppem = (FT_Pos)( ( prop->value.int32 * bsize->size + 36 ) / 72 ); prop = bdf_get_font_property( font, "RESOLUTION_Y" ); - if ( prop ) + if ( prop != NULL ) bsize->y_ppem = (FT_Pos)( ( prop->value.int32 * bsize->size + 36 ) / 72 ); @@ -463,12 +378,12 @@ THE SOFTWARE. bdf_get_font_property( font, "CHARSET_REGISTRY" ); charset_encoding = bdf_get_font_property( font, "CHARSET_ENCODING" ); - if ( charset_registry && charset_encoding ) + if ( ( charset_registry != NULL ) && ( charset_encoding != NULL ) ) { - if ( charset_registry->format == BDF_ATOM && - charset_encoding->format == BDF_ATOM && - charset_registry->value.atom && - charset_encoding->value.atom ) + if ( ( charset_registry->format == BDF_ATOM ) && + ( charset_encoding->format == BDF_ATOM ) && + ( charset_registry->value.atom != NULL ) && + ( charset_encoding->value.atom != NULL ) ) { const char* s; @@ -734,12 +649,6 @@ THE SOFTWARE. } - /* - * - * BDF SERVICE - * - */ - static FT_Error bdf_get_bdf_property( BDF_Face face, const char* prop_name, @@ -751,7 +660,7 @@ THE SOFTWARE. FT_ASSERT( face && face->bdffont ); prop = bdf_get_font_property( face->bdffont, prop_name ); - if ( prop ) + if ( prop != NULL ) { switch ( prop->format ) { @@ -780,38 +689,6 @@ THE SOFTWARE. return BDF_Err_Invalid_Argument; } - static FT_Error - bdf_get_charset_id( BDF_Face face, - const char* *acharset_encoding, - const char* *acharset_registry ) - { - *acharset_encoding = face->charset_encoding; - *acharset_registry = face->charset_registry; - - return 0; - } - - - static const FT_Service_BDFRec bdf_service_bdf = - { - (FT_BDF_GetCharsetIdFunc)bdf_get_charset_id, - (FT_BDF_GetPropertyFunc) bdf_get_bdf_property - }; - - - /* - * - * SERVICES LIST - * - */ - - static const FT_ServiceDescRec bdf_services[] = - { - { FT_SERVICE_ID_BDF, &bdf_service_bdf }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_BDF }, - { NULL, NULL } - }; - static FT_Module_Interface bdf_driver_requester( FT_Module module, @@ -819,9 +696,11 @@ THE SOFTWARE. { FT_UNUSED( module ); - return ft_service_list_lookup( bdf_services, name ); - } + if ( name && ft_strcmp( name, "get_bdf_property" ) == 0 ) + return (FT_Module_Interface)bdf_get_bdf_property; + return NULL; + } FT_CALLBACK_TABLE_DEF diff --git a/reactos/lib/freetype/src/bdf/bdfdrivr.h b/reactos/lib/freetype/src/bdf/bdfdrivr.h index 148041ff24d..1e0224c33d2 100644 --- a/reactos/lib/freetype/src/bdf/bdfdrivr.h +++ b/reactos/lib/freetype/src/bdf/bdfdrivr.h @@ -2,7 +2,7 @@ FreeType font driver for bdf fonts - Copyright (C) 2001, 2002, 2003 by + Copyright (C) 2001, 2002 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/reactos/lib/freetype/src/bdf/bdflib.c b/reactos/lib/freetype/src/bdf/bdflib.c index b4066db46a0..2d90b4c5bb1 100644 --- a/reactos/lib/freetype/src/bdf/bdflib.c +++ b/reactos/lib/freetype/src/bdf/bdflib.c @@ -163,7 +163,7 @@ { (char *)"_MULE_RELATIVE_COMPOSE", BDF_INTEGER, 1, { 0 } }, }; - static const unsigned long + static unsigned long _num_bdf_properties = sizeof ( _bdf_properties ) / sizeof ( _bdf_properties[0] ); @@ -391,7 +391,7 @@ /* An empty string for empty fields. */ - static const char empty[1] = { 0 }; /* XXX eliminate this */ + static char empty[1] = { 0 }; /* XXX eliminate this */ /* Assume the line is NULL-terminated and that the `list' parameter */ @@ -468,7 +468,7 @@ } /* Assign the field appropriately. */ - list->field[list->used++] = ( ep > sp ) ? sp : (char*)empty; + list->field[list->used++] = ( ep > sp ) ? sp : empty; sp = ep; @@ -511,7 +511,7 @@ } if ( final_empty ) - list->field[list->used++] = (char*)empty; + list->field[list->used++] = empty; if ( list->used == list->size ) { diff --git a/reactos/lib/freetype/src/cache/Jamfile b/reactos/lib/freetype/src/cache/Jamfile index b269c9557bb..099fd5e3653 100644 --- a/reactos/lib/freetype/src/cache/Jamfile +++ b/reactos/lib/freetype/src/cache/Jamfile @@ -1,4 +1,4 @@ -# FreeType 2 src/cache Jamfile (c) 2001, 2003, 2004 David Turner +# FreeType 2 src/cache Jamfile (c) 2001 David Turner # SubDir FT2_TOP $(FT2_SRC_DIR) cache ; @@ -14,15 +14,7 @@ HDRMACRO [ FT2_SubDir include ftcache.h ] ; if $(FT2_MULTI) { - _sources = ftcmru - ftcmanag - ftccache - ftcglyph - ftcsbits - ftcimage - ftcbasic - ftccmap - ; + _sources = ftlru ftcmanag ftccache ftcglyph ftcsbits ftcimage ftccmap ; } else { diff --git a/reactos/lib/freetype/src/cache/descrip.mms b/reactos/lib/freetype/src/cache/descrip.mms index 4d967dc1815..ea12f2e3766 100644 --- a/reactos/lib/freetype/src/cache/descrip.mms +++ b/reactos/lib/freetype/src/cache/descrip.mms @@ -3,7 +3,7 @@ # -# Copyright 2001, 2002, 2003, 2004 by +# Copyright 2001, 2002 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -20,6 +20,7 @@ OBJS=ftcache.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -ftcache.obj : ftcache.c +ftcache.obj : ftcache.c ftlru.c ftcmanag.c ftccache.c ftcglyph.c ftcimage.c \ + ftcsbits.c ftccmap.c # EOF diff --git a/reactos/lib/freetype/src/cache/ftcache.c b/reactos/lib/freetype/src/cache/ftcache.c index d41e91e5ec1..07e85e1ea47 100644 --- a/reactos/lib/freetype/src/cache/ftcache.c +++ b/reactos/lib/freetype/src/cache/ftcache.c @@ -4,7 +4,7 @@ /* */ /* The FreeType Caching sub-system (body only). */ /* */ -/* Copyright 2000-2001, 2003 by */ +/* Copyright 2000-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -19,13 +19,13 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT #include <ft2build.h> -#include "ftcmru.c" +#include "ftlru.c" #include "ftcmanag.c" #include "ftccache.c" -#include "ftccmap.c" #include "ftcglyph.c" #include "ftcimage.c" #include "ftcsbits.c" -#include "ftcbasic.c" +#include "ftccmap.c" + /* END */ diff --git a/reactos/lib/freetype/src/cache/ftcbasic.c b/reactos/lib/freetype/src/cache/ftcbasic.c deleted file mode 100644 index f7d7ab048ef..00000000000 --- a/reactos/lib/freetype/src/cache/ftcbasic.c +++ /dev/null @@ -1,420 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftcbasic.c */ -/* */ -/* The FreeType basic cache interface (body). */ -/* */ -/* Copyright 2003, 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include <ft2build.h> -#include FT_CACHE_H -#include FT_CACHE_INTERNAL_GLYPH_H -#include FT_CACHE_INTERNAL_IMAGE_H -#include FT_CACHE_INTERNAL_SBITS_H -#include FT_INTERNAL_MEMORY_H - -#include "ftcerror.h" - - - /* - * Basic Families - * - */ - typedef struct FTC_BasicAttrRec_ - { - FTC_ScalerRec scaler; - FT_UInt load_flags; - - } FTC_BasicAttrRec, *FTC_BasicAttrs; - -#define FTC_BASIC_ATTR_COMPARE( a, b ) \ - ( FTC_SCALER_COMPARE( &(a)->scaler, &(b)->scaler ) && \ - (a)->load_flags == (b)->load_flags ) - -#define FTC_BASIC_ATTR_HASH( a ) \ - ( FTC_SCALER_HASH( &(a)->scaler ) + 31*(a)->load_flags ) - - - typedef struct FTC_BasicQueryRec_ - { - FTC_GQueryRec gquery; - FTC_BasicAttrRec attrs; - - } FTC_BasicQueryRec, *FTC_BasicQuery; - - - typedef struct FTC_BasicFamilyRec_ - { - FTC_FamilyRec family; - FTC_BasicAttrRec attrs; - - } FTC_BasicFamilyRec, *FTC_BasicFamily; - - - static FT_Bool - ftc_basic_family_compare( FTC_BasicFamily family, - FTC_BasicQuery query ) - { - return FT_BOOL( FTC_BASIC_ATTR_COMPARE( &family->attrs, &query->attrs ) ); - } - - - static FT_Error - ftc_basic_family_init( FTC_BasicFamily family, - FTC_BasicQuery query, - FTC_Cache cache ) - { - FTC_Family_Init( FTC_FAMILY( family ), cache ); - family->attrs = query->attrs; - return 0; - } - - - static FT_UInt - ftc_basic_family_get_count( FTC_BasicFamily family, - FTC_Manager manager ) - { - FT_Error error; - FT_Face face; - FT_UInt result = 0; - - - error = FTC_Manager_LookupFace( manager, family->attrs.scaler.face_id, - &face ); - if ( !error ) - result = face->num_glyphs; - - return result; - } - - - static FT_Error - ftc_basic_family_load_bitmap( FTC_BasicFamily family, - FT_UInt gindex, - FTC_Manager manager, - FT_Face *aface ) - { - FT_Error error; - FT_Size size; - - - error = FTC_Manager_LookupSize( manager, &family->attrs.scaler, &size ); - if ( !error ) - { - FT_Face face = size->face; - - - error = FT_Load_Glyph( face, gindex, - family->attrs.load_flags | FT_LOAD_RENDER ); - if ( !error ) - *aface = face; - } - - return error; - } - - - static FT_Error - ftc_basic_family_load_glyph( FTC_BasicFamily family, - FT_UInt gindex, - FTC_Cache cache, - FT_Glyph *aglyph ) - { - FT_Error error; - FTC_Scaler scaler = &family->attrs.scaler; - FT_Face face; - FT_Size size; - - - /* we will now load the glyph image */ - error = FTC_Manager_LookupSize( cache->manager, - scaler, - &size ); - if ( !error ) - { - face = size->face; - - error = FT_Load_Glyph( face, gindex, family->attrs.load_flags ); - if ( !error ) - { - if ( face->glyph->format == FT_GLYPH_FORMAT_BITMAP || - face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ) - { - /* ok, copy it */ - FT_Glyph glyph; - - - error = FT_Get_Glyph( face->glyph, &glyph ); - if ( !error ) - { - *aglyph = glyph; - goto Exit; - } - } - else - error = FTC_Err_Invalid_Argument; - } - } - - Exit: - return error; - } - - - static FT_Bool - ftc_basic_gnode_compare_faceid( FTC_GNode gnode, - FTC_FaceID face_id, - FTC_Cache cache ) - { - FTC_BasicFamily family = (FTC_BasicFamily)gnode->family; - FT_Bool result; - - - result = FT_BOOL( family->attrs.scaler.face_id == face_id ); - if ( result ) - { - /* we must call this function to avoid this node from appearing - * in later lookups with the same face_id! - */ - FTC_GNode_UnselectFamily( gnode, cache ); - } - return result; - } - - - /* - * - * basic image cache - * - */ - - static const FTC_IFamilyClassRec ftc_basic_image_family_class = - { - { - sizeof( FTC_BasicFamilyRec ), - (FTC_MruNode_CompareFunc)ftc_basic_family_compare, - (FTC_MruNode_InitFunc) ftc_basic_family_init, - (FTC_MruNode_ResetFunc) NULL, - (FTC_MruNode_DoneFunc) NULL - }, - (FTC_IFamily_LoadGlyphFunc)ftc_basic_family_load_glyph - }; - - - static const FTC_GCacheClassRec ftc_basic_image_cache_class = - { - { - (FTC_Node_NewFunc) FTC_INode_New, - (FTC_Node_WeightFunc) FTC_INode_Weight, - (FTC_Node_CompareFunc)FTC_GNode_Compare, - (FTC_Node_CompareFunc)ftc_basic_gnode_compare_faceid, - (FTC_Node_FreeFunc) FTC_INode_Free, - - sizeof( FTC_GCacheRec ), - (FTC_Cache_InitFunc) FTC_GCache_Init, - (FTC_Cache_DoneFunc) FTC_GCache_Done - }, - (FTC_MruListClass)&ftc_basic_image_family_class - }; - - - FT_EXPORT_DEF( FT_Error ) - FTC_ImageCache_New( FTC_Manager manager, - FTC_ImageCache *acache ) - { - return FTC_GCache_New( manager, &ftc_basic_image_cache_class, - (FTC_GCache*)acache ); - } - - - /* documentation is in ftcimage.h */ - - FT_EXPORT_DEF( FT_Error ) - FTC_ImageCache_Lookup( FTC_ImageCache cache, - FTC_ImageType type, - FT_UInt gindex, - FT_Glyph *aglyph, - FTC_Node *anode ) - { - FTC_BasicQueryRec query; - FTC_INode node; - FT_Error error; - FT_UInt32 hash; - - - /* some argument checks are delayed to FTC_Cache_Lookup */ - if ( !aglyph ) - { - error = FTC_Err_Invalid_Argument; - goto Exit; - } - - *aglyph = NULL; - if ( anode ) - *anode = NULL; - - query.attrs.scaler.face_id = type->face_id; - query.attrs.scaler.width = type->width; - query.attrs.scaler.height = type->height; - query.attrs.scaler.pixel = 1; - query.attrs.load_flags = type->flags; - - query.attrs.scaler.x_res = 0; /* make compilers happy */ - query.attrs.scaler.y_res = 0; - - hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + gindex; - -#if 1 /* inlining is about 50% faster! */ - FTC_GCACHE_LOOKUP_CMP( cache, - ftc_basic_family_compare, - FTC_GNode_Compare, - hash, gindex, - &query, - node, - error ); -#else - error = FTC_GCache_Lookup( FTC_GCACHE( cache ), - hash, gindex, - FTC_GQUERY( &query ), - (FTC_Node*) &node ); -#endif - if ( !error ) - { - *aglyph = FTC_INODE( node )->glyph; - - if ( anode ) - { - *anode = FTC_NODE( node ); - FTC_NODE( node )->ref_count++; - } - } - - Exit: - return error; - } - - - /* - * - * basic small bitmap cache - * - */ - - - static const FTC_SFamilyClassRec ftc_basic_sbit_family_class = - { - { - sizeof( FTC_BasicFamilyRec ), - (FTC_MruNode_CompareFunc)ftc_basic_family_compare, - (FTC_MruNode_InitFunc) ftc_basic_family_init, - (FTC_MruNode_ResetFunc) NULL, - (FTC_MruNode_DoneFunc) NULL - }, - (FTC_SFamily_GetCountFunc) ftc_basic_family_get_count, - (FTC_SFamily_LoadGlyphFunc)ftc_basic_family_load_bitmap - }; - - - static const FTC_GCacheClassRec ftc_basic_sbit_cache_class = - { - { - (FTC_Node_NewFunc) FTC_SNode_New, - (FTC_Node_WeightFunc) FTC_SNode_Weight, - (FTC_Node_CompareFunc)FTC_SNode_Compare, - (FTC_Node_CompareFunc)ftc_basic_gnode_compare_faceid, - (FTC_Node_FreeFunc) FTC_SNode_Free, - - sizeof( FTC_GCacheRec ), - (FTC_Cache_InitFunc) FTC_GCache_Init, - (FTC_Cache_DoneFunc) FTC_GCache_Done - }, - (FTC_MruListClass)&ftc_basic_sbit_family_class - }; - - - FT_EXPORT_DEF( FT_Error ) - FTC_SBitCache_New( FTC_Manager manager, - FTC_SBitCache *acache ) - { - return FTC_GCache_New( manager, &ftc_basic_sbit_cache_class, - (FTC_GCache*)acache ); - } - - - FT_EXPORT_DEF( FT_Error ) - FTC_SBitCache_Lookup( FTC_SBitCache cache, - FTC_ImageType type, - FT_UInt gindex, - FTC_SBit *ansbit, - FTC_Node *anode ) - { - FT_Error error; - FTC_BasicQueryRec query; - FTC_SNode node; - FT_UInt32 hash; - - - if ( anode ) - *anode = NULL; - - /* other argument checks delayed to FTC_Cache_Lookup */ - if ( !ansbit ) - return FTC_Err_Invalid_Argument; - - *ansbit = NULL; - - query.attrs.scaler.face_id = type->face_id; - query.attrs.scaler.width = type->width; - query.attrs.scaler.height = type->height; - query.attrs.scaler.pixel = 1; - query.attrs.load_flags = type->flags; - - query.attrs.scaler.x_res = 0; /* make compilers happy */ - query.attrs.scaler.y_res = 0; - - /* beware, the hash must be the same for all glyph ranges! */ - hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + - gindex / FTC_SBIT_ITEMS_PER_NODE; - -#if 1 /* inlining is about 50% faster! */ - FTC_GCACHE_LOOKUP_CMP( cache, - ftc_basic_family_compare, - FTC_SNode_Compare, - hash, gindex, - &query, - node, - error ); -#else - error = FTC_GCache_Lookup( FTC_GCACHE( cache ), - hash, - gindex, - FTC_GQUERY( &query ), - (FTC_Node*)&node ); -#endif - if ( error ) - goto Exit; - - *ansbit = node->sbits + ( gindex - FTC_GNODE( node )->gindex ); - - if ( anode ) - { - *anode = FTC_NODE( node ); - FTC_NODE( node )->ref_count++; - } - - Exit: - return error; - } - - -/* END */ diff --git a/reactos/lib/freetype/src/cache/ftccache.c b/reactos/lib/freetype/src/cache/ftccache.c index 7e0630260f3..cc01c397811 100644 --- a/reactos/lib/freetype/src/cache/ftccache.c +++ b/reactos/lib/freetype/src/cache/ftccache.c @@ -17,7 +17,7 @@ #include <ft2build.h> -#include FT_CACHE_INTERNAL_MANAGER_H +#include FT_CACHE_MANAGER_H #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DEBUG_H @@ -40,13 +40,53 @@ /*************************************************************************/ /*************************************************************************/ + FT_EXPORT_DEF( void ) + ftc_node_done( FTC_Node node, + FTC_Cache cache ) + { + FTC_Family family; + FTC_FamilyEntry entry; + + + entry = cache->manager->families.entries + node->fam_index; + family = entry->family; + + /* remove from parent set table - eventually destroy the set */ + if ( --family->num_nodes == 0 ) + FT_LruList_Remove( cache->families, (FT_LruNode) family ); + } + + /* add a new node to the head of the manager's circular MRU list */ static void ftc_node_mru_link( FTC_Node node, FTC_Manager manager ) { - FTC_MruNode_Prepend( (FTC_MruNode*)&manager->nodes_list, - (FTC_MruNode)node ); + FTC_Node first = manager->nodes_list; + + + if ( first ) + { + FTC_Node last = first->mru_prev; + + + FT_ASSERT( last->mru_next == first ); + + node->mru_prev = last; + node->mru_next = first; + + last->mru_next = node; + first->mru_prev = node; + } + else + { + FT_ASSERT( manager->num_nodes == 0 ); + + node->mru_next = node; + node->mru_prev = node; + } + + manager->nodes_list = node; manager->num_nodes++; } @@ -56,8 +96,29 @@ ftc_node_mru_unlink( FTC_Node node, FTC_Manager manager ) { - FTC_MruNode_Remove( (FTC_MruNode*)&manager->nodes_list, - (FTC_MruNode)node ); + FTC_Node first = manager->nodes_list; + FTC_Node prev = node->mru_prev; + FTC_Node next = node->mru_next; + + + FT_ASSERT( first != NULL && manager->num_nodes > 0 ); + FT_ASSERT( next->mru_prev == node ); + FT_ASSERT( prev->mru_next == node ); + + next->mru_prev = prev; + prev->mru_next = next; + + if ( node == first ) + { + /* this is the last node in the list; update its head pointer */ + if ( node == next ) + manager->nodes_list = NULL; + else + manager->nodes_list = next; + } + + node->mru_next = NULL; + node->mru_prev = NULL; manager->num_nodes--; } @@ -67,167 +128,120 @@ ftc_node_mru_up( FTC_Node node, FTC_Manager manager ) { - FTC_MruNode_Up( (FTC_MruNode*)&manager->nodes_list, - (FTC_MruNode)node ); - } + FTC_Node first = manager->nodes_list; - /* Note that this function cannot fail. If we cannot re-size the - * buckets array appropriately, we simply degrade the hash table's - * performance! - */ - static void - ftc_cache_resize( FTC_Cache cache ) - { - for (;;) + if ( node != first ) { - FTC_Node node, *pnode; - FT_UInt p = cache->p; - FT_UInt mask = cache->mask; - FT_UInt count = mask + p + 1; /* number of buckets */ + FTC_Node prev = node->mru_prev; + FTC_Node next = node->mru_next; + FTC_Node last; - /* do we need to shrink the buckets array? */ - if ( cache->slack < 0 ) - { - FTC_Node new_list = NULL; + prev->mru_next = next; + next->mru_prev = prev; + last = first->mru_prev; + node->mru_next = first; + node->mru_prev = last; + first->mru_prev = node; + last->mru_next = node; - /* try to expand the buckets array _before_ splitting - * the bucket lists - */ - if ( p >= mask ) - { - FT_Memory memory = cache->memory; - - - /* if we can't expand the array, leave immediately */ - if ( FT_MEM_RENEW_ARRAY( cache->buckets, (mask+1)*2, (mask+1)*4 ) ) - break; - } - - /* split a single bucket */ - pnode = cache->buckets + p; - - for (;;) - { - node = *pnode; - if ( node == NULL ) - break; - - if ( node->hash & ( mask + 1 ) ) - { - *pnode = node->link; - node->link = new_list; - new_list = node; - } - else - pnode = &node->link; - } - - cache->buckets[p + mask + 1] = new_list; - - cache->slack += FTC_HASH_MAX_LOAD; - - if ( p >= mask ) - { - cache->mask = 2 * mask + 1; - cache->p = 0; - } - else - cache->p = p + 1; - } - - /* do we need to expand the buckets array? */ - else if ( cache->slack > (FT_Long)count * FTC_HASH_SUB_LOAD ) - { - FT_UInt old_index = p + mask; - FTC_Node* pold; - - - if ( old_index + 1 <= FTC_HASH_INITIAL_SIZE ) - break; - - if ( p == 0 ) - { - FT_Memory memory = cache->memory; - - - /* if we can't shrink the array, leave immediately */ - if ( FT_MEM_RENEW_ARRAY( cache->buckets, - ( mask + 1 ) * 2, mask + 1 ) ) - break; - - cache->mask >>= 1; - p = cache->mask; - } - else - p--; - - pnode = cache->buckets + p; - while ( *pnode ) - pnode = &(*pnode)->link; - - pold = cache->buckets + old_index; - *pnode = *pold; - *pold = NULL; - - cache->slack -= FTC_HASH_MAX_LOAD; - cache->p = p; - } - else /* the hash table is balanced */ - break; + manager->nodes_list = node; } } /* remove a node from its cache's hash table */ - static void - ftc_node_hash_unlink( FTC_Node node0, + static FT_Error + ftc_node_hash_unlink( FTC_Node node, FTC_Cache cache ) { + FT_Error error = 0; FTC_Node *pnode; - FT_UInt idx; + FT_UInt idx, num_buckets; - idx = (FT_UInt)( node0->hash & cache->mask ); + idx = (FT_UInt)( node->hash & cache->mask ); if ( idx < cache->p ) - idx = (FT_UInt)( node0->hash & ( 2 * cache->mask + 1 ) ); + idx = (FT_UInt)( node->hash & ( 2 * cache->mask + 1 ) ); pnode = cache->buckets + idx; for (;;) { - FTC_Node node = *pnode; - - - if ( node == NULL ) + if ( *pnode == NULL ) { FT_ERROR(( "ftc_node_hash_unlink: unknown node!\n" )); - return; + return FTC_Err_Ok; } - if ( node == node0 ) + if ( *pnode == node ) + { + *pnode = node->link; + node->link = NULL; break; + } pnode = &(*pnode)->link; } - *pnode = node0->link; - node0->link = NULL; + num_buckets = ( cache->p + cache->mask + 1 ); - cache->slack++; - ftc_cache_resize( cache ); + if ( ++cache->slack > (FT_Long)num_buckets * FTC_HASH_SUB_LOAD ) + { + FT_UInt p = cache->p; + FT_UInt mask = cache->mask; + FT_UInt old_index = p + mask; + FTC_Node* pold; + + + if ( old_index + 1 <= FTC_HASH_INITIAL_SIZE ) + goto Exit; + + if ( p == 0 ) + { + FT_Memory memory = cache->memory; + + + cache->mask >>= 1; + p = cache->mask; + + if ( FT_RENEW_ARRAY( cache->buckets, ( mask + 1 ) * 2, (mask+1) ) ) + { + FT_ERROR(( "ftc_node_hash_unlink: couldn't shunk buckets!\n" )); + goto Exit; + } + } + else + p--; + + pnode = cache->buckets + p; + while ( *pnode ) + pnode = &(*pnode)->link; + + pold = cache->buckets + old_index; + *pnode = *pold; + *pold = NULL; + + cache->slack -= FTC_HASH_MAX_LOAD; + cache->p = p; + } + + Exit: + return error; } - /* add a node to the `top' of its cache's hash table */ - static void + + /* add a node to the "top" of its cache's hash table */ + static FT_Error ftc_node_hash_link( FTC_Node node, FTC_Cache cache ) { FTC_Node *pnode; FT_UInt idx; + FT_Error error = 0; idx = (FT_UInt)( node->hash & cache->mask ); @@ -239,29 +253,85 @@ node->link = *pnode; *pnode = node; - cache->slack--; - ftc_cache_resize( cache ); + if ( --cache->slack < 0 ) + { + FT_UInt p = cache->p; + FT_UInt mask = cache->mask; + FTC_Node new_list; + + + /* split a single bucket */ + new_list = NULL; + pnode = cache->buckets + p; + + for (;;) + { + node = *pnode; + if ( node == NULL ) + break; + + if ( node->hash & ( mask + 1 ) ) + { + *pnode = node->link; + node->link = new_list; + new_list = node; + } + else + pnode = &node->link; + } + + cache->buckets[p + mask + 1] = new_list; + + cache->slack += FTC_HASH_MAX_LOAD; + + if ( p >= mask ) + { + FT_Memory memory = cache->memory; + + + if ( FT_RENEW_ARRAY( cache->buckets, + ( mask + 1 ) * 2, ( mask + 1 ) * 4 ) ) + { + FT_ERROR(( "ftc_node_hash_link: couldn't expand buckets!\n" )); + goto Exit; + } + + cache->mask = 2 * mask + 1; + cache->p = 0; + } + else + cache->p = p + 1; + } + + Exit: + return error; } + + /* remove a node from the cache manager */ FT_EXPORT_DEF( void ) ftc_node_destroy( FTC_Node node, FTC_Manager manager ) { - FTC_Cache cache; + FT_Memory memory = manager->library->memory; + FTC_Cache cache; + FTC_FamilyEntry entry; + FTC_Cache_Class clazz; #ifdef FT_DEBUG_ERROR /* find node's cache */ - if ( node->cache_index >= manager->num_caches ) + if ( node->fam_index >= manager->families.count ) { FT_ERROR(( "ftc_node_destroy: invalid node handle\n" )); return; } #endif - cache = manager->caches[node->cache_index]; + entry = manager->families.entries + node->fam_index; + cache = entry->cache; #ifdef FT_DEBUG_ERROR if ( cache == NULL ) @@ -271,7 +341,9 @@ } #endif - manager->cur_weight -= cache->clazz.node_weight( node, cache ); + clazz = cache->clazz; + + manager->cur_weight -= clazz->node_weight( node, cache ); /* remove node from mru list */ ftc_node_mru_unlink( node, manager ); @@ -280,7 +352,10 @@ ftc_node_hash_unlink( node, cache ); /* now finalize it */ - cache->clazz.node_free( node, cache ); + if ( clazz->node_done ) + clazz->node_done( node, cache ); + + FT_FREE( node ); #if 0 /* check, just in case of general corruption :-) */ @@ -294,35 +369,120 @@ /*************************************************************************/ /*************************************************************************/ /***** *****/ - /***** ABSTRACT CACHE CLASS *****/ + /***** CACHE FAMILY DEFINITIONS *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ FT_EXPORT_DEF( FT_Error ) - FTC_Cache_Init( FTC_Cache cache ) + ftc_family_init( FTC_Family family, + FTC_Query query, + FTC_Cache cache ) { - FT_Memory memory = cache->memory; + FT_Error error; + FTC_Manager manager = cache->manager; + FT_Memory memory = manager->library->memory; + FTC_FamilyEntry entry; + + + family->cache = cache; + family->num_nodes = 0; + + /* now add to manager's family table */ + error = ftc_family_table_alloc( &manager->families, memory, &entry ); + if ( !error ) + { + entry->cache = cache; + entry->family = family; + family->fam_index = entry->index; + + query->family = family; /* save family in query */ + } + + return error; + } + + + FT_EXPORT_DEF( void ) + ftc_family_done( FTC_Family family ) + { + if ( family && family->cache ) + { + FTC_Manager manager = family->cache->manager; + + + /* remove from manager's family table */ + ftc_family_table_free( &manager->families, family->fam_index ); + } + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** ABSTRACT CACHE CLASS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + + FT_EXPORT_DEF( FT_Error ) + ftc_cache_init( FTC_Cache cache ) + { + FT_Memory memory = cache->memory; + FTC_Cache_Class clazz = cache->clazz; + FT_Error error; cache->p = 0; cache->mask = FTC_HASH_INITIAL_SIZE - 1; cache->slack = FTC_HASH_INITIAL_SIZE * FTC_HASH_MAX_LOAD; - return ( FT_MEM_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 ) ); + if ( FT_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 ) ) + goto Exit; + + /* now, initialize the lru list of families for this cache */ + if ( clazz->family_size > 0 ) + { + FT_LruList_ClassRec* lru_class = &cache->family_class; + + + lru_class->list_size = sizeof( FT_LruListRec ); + lru_class->list_init = NULL; + lru_class->list_done = NULL; + + lru_class->node_size = clazz->family_size; + lru_class->node_init = (FT_LruNode_InitFunc) clazz->family_init; + lru_class->node_done = (FT_LruNode_DoneFunc) clazz->family_done; + lru_class->node_flush = (FT_LruNode_FlushFunc) NULL; + lru_class->node_compare = (FT_LruNode_CompareFunc)clazz->family_compare; + + error = FT_LruList_New( (FT_LruList_Class) lru_class, + 0, /* max items == 0 => unbounded list */ + cache, + memory, + &cache->families ); + if ( error ) + FT_FREE( cache->buckets ); + } + + Exit: + return error; } FT_EXPORT_DEF( void ) - FTC_Cache_Clear( FTC_Cache cache ) + ftc_cache_clear( FTC_Cache cache ) { if ( cache ) { - FTC_Manager manager = cache->manager; - FT_UFast i; - FT_UInt count; - + FT_Memory memory = cache->memory; + FTC_Cache_Class clazz = cache->clazz; + FTC_Manager manager = cache->manager; + FT_UFast i; + FT_UInt count; count = cache->p + cache->mask + 1; @@ -340,249 +500,309 @@ ftc_node_mru_unlink( node, manager ); /* now finalize it */ - manager->cur_weight -= cache->clazz.node_weight( node, cache ); + manager->cur_weight -= clazz->node_weight( node, cache ); - cache->clazz.node_free( node, cache ); + if ( clazz->node_done ) + clazz->node_done( node, cache ); + + FT_FREE( node ); node = next; } cache->buckets[i] = NULL; } - ftc_cache_resize( cache ); + + cache->p = 0; + + /* destroy the families */ + if ( cache->families ) + FT_LruList_Reset( cache->families ); } } FT_EXPORT_DEF( void ) - FTC_Cache_Done( FTC_Cache cache ) + ftc_cache_done( FTC_Cache cache ) { - if ( cache->memory ) + if ( cache ) { FT_Memory memory = cache->memory; - FTC_Cache_Clear( cache ); + ftc_cache_clear( cache ); FT_FREE( cache->buckets ); cache->mask = 0; - cache->p = 0; cache->slack = 0; - cache->memory = NULL; - } - } - - - static void - ftc_cache_add( FTC_Cache cache, - FT_UInt32 hash, - FTC_Node node ) - { - node->hash = hash; - node->cache_index = (FT_UInt16) cache->index; - node->ref_count = 0; - - ftc_node_hash_link( node, cache ); - ftc_node_mru_link( node, cache->manager ); - - { - FTC_Manager manager = cache->manager; - - - manager->cur_weight += cache->clazz.node_weight( node, cache ); - - if ( manager->cur_weight >= manager->max_weight ) + if ( cache->families ) { - node->ref_count++; - FTC_Manager_Compress( manager ); - node->ref_count--; + FT_LruList_Destroy( cache->families ); + cache->families = NULL; } } } + /* Look up a node in "top" of its cache's hash table. */ + /* If not found, create a new node. */ + /* */ FT_EXPORT_DEF( FT_Error ) - FTC_Cache_NewNode( FTC_Cache cache, - FT_UInt32 hash, - FT_Pointer query, - FTC_Node *anode ) - { - FT_Error error; - FTC_Node node; - - /* - * Try to allocate a new cache node. Note that in case of - * out-of-memory error (OOM), we'll flush the cache a bit, - * then try again. - * - * On each try, the `tries' variable gives the number - * of old nodes we want to flush from the manager's global list - * before the next allocation attempt. It barely doubles on - * each iteration. - * - */ - error = cache->clazz.node_new( &node, query, cache ); - if ( error ) - goto FlushCache; - - AddNode: - /* don't assume that the cache has the same number of buckets, since - * our allocation request might have triggered global cache flushing - */ - ftc_cache_add( cache, hash, node ); - - Exit: - *anode = node; - return error; - - FlushCache: - node = NULL; - if ( error != FT_Err_Out_Of_Memory ) - goto Exit; - - { - FTC_Manager manager = cache->manager; - FT_UInt count, tries = 1; - - - for (;;) - { - error = cache->clazz.node_new( &node, query, cache ); - if ( !error ) - break; - - node = NULL; - if ( error != FT_Err_Out_Of_Memory ) - goto Exit; - - count = FTC_Manager_FlushN( manager, tries ); - if ( count == 0 ) - goto Exit; - - if ( count == tries ) - { - count = tries * 2; - if ( count < tries || count > manager->num_nodes ) - count = manager->num_nodes; - } - tries = count; - } - } - goto AddNode; - } - - - FT_EXPORT_DEF( FT_Error ) - FTC_Cache_Lookup( FTC_Cache cache, - FT_UInt32 hash, - FT_Pointer query, + ftc_cache_lookup( FTC_Cache cache, + FTC_Query query, FTC_Node *anode ) { - FT_UFast idx; - FTC_Node* bucket; - FTC_Node* pnode; - FTC_Node node; - FT_Error error = 0; - - FTC_Node_CompareFunc compare = cache->clazz.node_compare; + FT_Error error = FTC_Err_Ok; + FTC_Manager manager; + FT_LruNode lru; + FT_UInt free_count = 0; - if ( cache == NULL || anode == NULL ) - return FT_Err_Invalid_Argument; + if ( !cache || !query || !anode ) + return FTC_Err_Invalid_Argument; - idx = hash & cache->mask; - if ( idx < cache->p ) - idx = hash & ( cache->mask * 2 + 1 ); + *anode = NULL; + + query->hash = 0; + query->family = NULL; + + manager = cache->manager; + + /* here's a small note explaining what's happening in the code below. + * + * We need to deal intelligently with out-of-memory (OOM) conditions + * when trying to create a new family or cache node during the lookup. + * + * When an OOM is detected, we try to free one or more "old" nodes + * from the cache, then try again. It may be necessary to do that + * several times, so a loop is needed. + * + * The local variable "free_count" holds the number of "old" nodes to + * discard on each attempt. It starts at 1 and doubles on each + * iteration. The loop stops when: + * + * - a non-OOM error is detected + * - a succesful lookup is performed + * - there are no more unused nodes in the cache + * + * For the record, remember that all used nodes appear _before_ + * unused ones in the manager's MRU node list. + */ - bucket = cache->buckets + idx; - pnode = bucket; for (;;) { - node = *pnode; - if ( node == NULL ) - goto NewNode; - - if ( node->hash == hash && compare( node, query, cache ) ) - break; - - pnode = &node->link; - } - - if ( node != *bucket ) - { - *pnode = node->link; - node->link = *bucket; - *bucket = node; - } - - /* move to head of MRU list */ - { - FTC_Manager manager = cache->manager; - - - if ( node != manager->nodes_list ) - ftc_node_mru_up( node, manager ); - } - *anode = node; - return error; - - NewNode: - return FTC_Cache_NewNode( cache, hash, query, anode ); - } - - - FT_EXPORT_DEF( void ) - FTC_Cache_RemoveFaceID( FTC_Cache cache, - FTC_FaceID face_id ) - { - FT_UFast i, count; - FTC_Manager manager = cache->manager; - FTC_Node frees = NULL; - - - count = cache->p + cache->mask; - for ( i = 0; i < count; i++ ) - { - FTC_Node* bucket = cache->buckets + i; - FTC_Node* pnode = bucket; - - - for ( ;; ) { - FTC_Node node = *pnode; + /* first of all, find the relevant family */ + FT_LruList list = cache->families; + FT_LruNode fam, *pfam; + FT_LruNode_CompareFunc compare = list->clazz->node_compare; - - if ( node == NULL ) - break; - - if ( cache->clazz.node_remove_faceid( node, face_id, cache ) ) + pfam = &list->nodes; + for (;;) { - *pnode = node->link; - node->link = frees; - frees = node; + fam = *pfam; + if ( fam == NULL ) + { + error = FT_LruList_Lookup( list, query, &lru ); + if ( error ) + goto Fail; + + goto Skip; + } + + if ( compare( fam, query, list->data ) ) + break; + + pfam = &fam->next; + } + + FT_ASSERT( fam != NULL ); + + /* move to top of list when needed */ + if ( fam != list->nodes ) + { + *pfam = fam->next; + fam->next = list->nodes; + list->nodes = fam; + } + + lru = fam; + + Skip: + ; + } + + { + FTC_Family family = (FTC_Family) lru; + FT_UFast hash = query->hash; + FTC_Node* bucket; + FT_UInt idx; + + + idx = hash & cache->mask; + if ( idx < cache->p ) + idx = hash & ( cache->mask * 2 + 1 ); + + bucket = cache->buckets + idx; + + + if ( query->family != family || + family->fam_index >= manager->families.size ) + { + FT_ERROR(( + "ftc_cache_lookup: invalid query (bad 'family' field)\n" )); + error = FTC_Err_Invalid_Argument; + goto Exit; + } + + if ( *bucket ) + { + FTC_Node* pnode = bucket; + FTC_Node_CompareFunc compare = cache->clazz->node_compare; + + + for ( ;; ) + { + FTC_Node node; + + + node = *pnode; + if ( node == NULL ) + break; + + if ( node->hash == hash && + (FT_UInt)node->fam_index == family->fam_index && + compare( node, query, cache ) ) + { + /* move to head of bucket list */ + if ( pnode != bucket ) + { + *pnode = node->link; + node->link = *bucket; + *bucket = node; + } + + /* move to head of MRU list */ + if ( node != manager->nodes_list ) + ftc_node_mru_up( node, manager ); + + *anode = node; + goto Exit; + } + + pnode = &node->link; + } + } + + /* didn't find a node, create a new one */ + { + FTC_Cache_Class clazz = cache->clazz; + FT_Memory memory = cache->memory; + FTC_Node node; + + + if ( FT_ALLOC( node, clazz->node_size ) ) + goto Fail; + + node->fam_index = (FT_UShort) family->fam_index; + node->hash = query->hash; + node->ref_count = 0; + + error = clazz->node_init( node, query, cache ); + if ( error ) + { + FT_FREE( node ); + goto Fail; + } + + error = ftc_node_hash_link( node, cache ); + if ( error ) + { + clazz->node_done( node, cache ); + FT_FREE( node ); + goto Fail; + } + + ftc_node_mru_link( node, cache->manager ); + + cache->manager->cur_weight += clazz->node_weight( node, cache ); + + /* now try to compress the node pool when necessary */ + if ( manager->cur_weight >= manager->max_weight ) + { + node->ref_count++; + FTC_Manager_Compress( manager ); + node->ref_count--; + } + + *anode = node; + } + + /* all is well, exit now + */ + goto Exit; + } + + Fail: + if ( error != FTC_Err_Out_Of_Memory ) + goto Exit; + + /* There is not enough memory; try to release some unused nodes + * from the cache to make room for a new one. + */ + { + FT_UInt new_count; + + + new_count = 1 + free_count * 2; + + /* check overflow and bounds */ + if ( new_count < free_count || free_count > manager->num_nodes ) + goto Exit; + + free_count = new_count; + + /* try to remove "new_count" nodes from the list */ + { + FTC_Node first = manager->nodes_list; + FTC_Node node; + + + if ( first == NULL ) /* empty list! */ + goto Exit; + + /* go to last node - it's a circular list */ + node = first->mru_prev; + for ( ; node && new_count > 0; new_count-- ) + { + FTC_Node prev = node->mru_prev; + + + /* Used nodes always appear before unused one in the MRU + * list. If we find one here, we'd better stop right now + * our iteration. + */ + if ( node->ref_count > 0 ) + { + /* if there are no unused nodes in the list, we'd better exit */ + if ( new_count == free_count ) + goto Exit; + + break; + } + + ftc_node_destroy( node, manager ); + + if ( node == first ) + break; + + node = prev; + } } - else - pnode = &node->link; } } - /* remove all nodes in the free list */ - while ( frees ) - { - FTC_Node node; - - - node = frees; - frees = node->link; - - manager->cur_weight -= cache->clazz.node_weight( node, cache ); - ftc_node_mru_unlink( node, manager ); - - cache->clazz.node_free( node, cache ); - - cache->slack++; - } - - ftc_cache_resize( cache ); + Exit: + return error; } diff --git a/reactos/lib/freetype/src/cache/ftccmap.c b/reactos/lib/freetype/src/cache/ftccmap.c index 63dea49247b..bdb83abb530 100644 --- a/reactos/lib/freetype/src/cache/ftccmap.c +++ b/reactos/lib/freetype/src/cache/ftccmap.c @@ -4,7 +4,7 @@ /* */ /* FreeType CharMap cache (body) */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004 by */ +/* Copyright 2000-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -19,7 +19,8 @@ #include <ft2build.h> #include FT_FREETYPE_H #include FT_CACHE_H -#include FT_CACHE_INTERNAL_MANAGER_H +#include FT_CACHE_CHARMAP_H +#include FT_CACHE_MANAGER_H #include FT_INTERNAL_MEMORY_H #include FT_INTERNAL_DEBUG_H #include FT_TRUETYPE_IDS_H @@ -29,7 +30,6 @@ #undef FT_COMPONENT #define FT_COMPONENT trace_cache - /*************************************************************************/ /* */ /* Each FTC_CMapNode contains a simple array to map a range of character */ @@ -47,44 +47,56 @@ /* number of glyph indices / character code per node */ #define FTC_CMAP_INDICES_MAX 128 - /* compute a query/node hash */ -#define FTC_CMAP_HASH( faceid, index, charcode ) \ - ( FTC_FACE_ID_HASH( faceid ) + 211 * ( index ) + \ - ( (char_code) / FTC_CMAP_INDICES_MAX ) ) - /* the charmap query */ - typedef struct FTC_CMapQueryRec_ - { - FTC_FaceID face_id; - FT_UInt cmap_index; - FT_UInt32 char_code; - - } FTC_CMapQueryRec, *FTC_CMapQuery; - -#define FTC_CMAP_QUERY( x ) ((FTC_CMapQuery)(x)) -#define FTC_CMAP_QUERY_HASH( x ) \ - FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->char_code ) - - /* the cmap cache node */ typedef struct FTC_CMapNodeRec_ { FTC_NodeRec node; - FTC_FaceID face_id; - FT_UInt cmap_index; FT_UInt32 first; /* first character in node */ FT_UInt16 indices[FTC_CMAP_INDICES_MAX]; /* array of glyph indices */ } FTC_CMapNodeRec, *FTC_CMapNode; + #define FTC_CMAP_NODE( x ) ( (FTC_CMapNode)( x ) ) -#define FTC_CMAP_NODE_HASH( x ) \ - FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->first ) + + + /* compute node hash value from cmap family and "requested" glyph index */ +#define FTC_CMAP_HASH( cfam, cquery ) \ + ( (cfam)->hash + ( (cquery)->char_code / FTC_CMAP_INDICES_MAX ) ) /* if (indices[n] == FTC_CMAP_UNKNOWN), we assume that the corresponding */ /* glyph indices haven't been queried through FT_Get_Glyph_Index() yet */ #define FTC_CMAP_UNKNOWN ( (FT_UInt16)-1 ) + /* the charmap query */ + typedef struct FTC_CMapQueryRec_ + { + FTC_QueryRec query; + FTC_CMapDesc desc; + FT_UInt32 char_code; + + } FTC_CMapQueryRec, *FTC_CMapQuery; + + +#define FTC_CMAP_QUERY( x ) ( (FTC_CMapQuery)( x ) ) + + + /* the charmap family */ + typedef struct FTC_CMapFamilyRec_ + { + FTC_FamilyRec family; + FT_UInt32 hash; + FTC_CMapDescRec desc; + FT_UInt index; + + } FTC_CMapFamilyRec, *FTC_CMapFamily; + + +#define FTC_CMAP_FAMILY( x ) ( (FTC_CMapFamily)( x ) ) +#define FTC_CMAP_FAMILY_MEMORY( x ) FTC_FAMILY( x )->memory + + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -94,44 +106,27 @@ /*************************************************************************/ - /* no need for specific finalizer; we use `ftc_node_done' directly */ - - FT_CALLBACK_DEF( void ) - ftc_cmap_node_free( FTC_CMapNode node, - FTC_Cache cache ) - { - FT_Memory memory = cache->memory; - - - FT_FREE( node ); - } - + /* no need for specific finalizer; we use "ftc_node_done" directly */ /* initialize a new cmap node */ FT_CALLBACK_DEF( FT_Error ) - ftc_cmap_node_new( FTC_CMapNode *anode, - FTC_CMapQuery query, - FTC_Cache cache ) + ftc_cmap_node_init( FTC_CMapNode cnode, + FTC_CMapQuery cquery, + FTC_Cache cache ) { - FT_Error error; - FT_Memory memory = cache->memory; - FTC_CMapNode node; - FT_UInt nn; + FT_UInt32 first; + FT_UInt n; + FT_UNUSED( cache ); - if ( !FT_NEW( node ) ) - { - node->face_id = query->face_id; - node->cmap_index = query->cmap_index; - node->first = (query->char_code / FTC_CMAP_INDICES_MAX) * - FTC_CMAP_INDICES_MAX; + first = ( cquery->char_code / FTC_CMAP_INDICES_MAX ) * + FTC_CMAP_INDICES_MAX; - for ( nn = 0; nn < FTC_CMAP_INDICES_MAX; nn++ ) - node->indices[nn] = FTC_CMAP_UNKNOWN; - } + cnode->first = first; + for ( n = 0; n < FTC_CMAP_INDICES_MAX; n++ ) + cnode->indices[n] = FTC_CMAP_UNKNOWN; - *anode = node; - return error; + return 0; } @@ -147,27 +142,185 @@ /* compare a cmap node to a given query */ FT_CALLBACK_DEF( FT_Bool ) - ftc_cmap_node_compare( FTC_CMapNode node, - FTC_CMapQuery query ) + ftc_cmap_node_compare( FTC_CMapNode cnode, + FTC_CMapQuery cquery ) { - if ( node->face_id == query->face_id && - node->cmap_index == query->cmap_index ) + FT_UInt32 offset = (FT_UInt32)( cquery->char_code - cnode->first ); + + + return FT_BOOL( offset < FTC_CMAP_INDICES_MAX ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** CHARMAP FAMILY *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + FT_CALLBACK_DEF( FT_Error ) + ftc_cmap_family_init( FTC_CMapFamily cfam, + FTC_CMapQuery cquery, + FTC_Cache cache ) + { + FTC_Manager manager = cache->manager; + FTC_CMapDesc desc = cquery->desc; + FT_UInt32 hash = 0; + FT_Error error; + FT_Face face; + + + /* setup charmap descriptor */ + cfam->desc = *desc; + + /* let's see whether the rest is correct too */ + error = FTC_Manager_Lookup_Face( manager, desc->face_id, &face ); + if ( !error ) { - FT_UInt32 offset = (FT_UInt32)( query->char_code - node->first ); + FT_UInt count = face->num_charmaps; + FT_UInt idx = count; + FT_CharMap* cur = face->charmaps; - return FT_BOOL( offset < FTC_CMAP_INDICES_MAX ); + switch ( desc->type ) + { + case FTC_CMAP_BY_INDEX: + idx = desc->u.index; + hash = idx * 33; + break; + + case FTC_CMAP_BY_ENCODING: + if ( desc->u.encoding == FT_ENCODING_UNICODE ) + { + /* Since the `interesting' table, pid/eid (3,10), is normally the + * last one, we loop backwards. This looses with type1 fonts with + * non-BMP characters (<.0001%), this wins with .ttf with non-BMP + * chars (.01% ?), and this is the same about 99.99% of the time! + */ + + FT_UInt unicmap_idx = count; /* some UCS-2 map, if we found it */ + + + cur += count - 1; + + for ( idx = 0; idx < count; idx++, cur-- ) + { + if ( cur[0]->encoding == FT_ENCODING_UNICODE ) + { + unicmap_idx = idx; /* record we found a Unicode charmap */ + + /* XXX If some new encodings to represent UCS-4 are added, + * they should be added here. + */ + if ( ( cur[0]->platform_id == TT_PLATFORM_MICROSOFT && + cur[0]->encoding_id == TT_MS_ID_UCS_4 ) || + ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && + cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) ) + + /* Hurray! We found a UCS-4 charmap. We can stop the scan! */ + { + idx = count - 1 - idx; + goto Found_idx_for_FTC_CMAP_BY_ENCODING; + } + } + } + + /* We do not have any UCS-4 charmap. Sigh. + * Let's see if we have some other kind of Unicode charmap, though. + */ + if ( unicmap_idx < count ) + idx = count - 1 - unicmap_idx; + } + else + { + for ( idx = 0; idx < count; idx++, cur++ ) + if ( cur[0]->encoding == desc->u.encoding ) + break; + } + + Found_idx_for_FTC_CMAP_BY_ENCODING: + hash = idx * 67; + break; + + case FTC_CMAP_BY_ID: + for ( idx = 0; idx < count; idx++, cur++ ) + { + if ( (FT_UInt)cur[0]->platform_id == desc->u.id.platform && + (FT_UInt)cur[0]->encoding_id == desc->u.id.encoding ) + { + hash = ( ( desc->u.id.platform << 8 ) | desc->u.id.encoding ) * 7; + break; + } + } + break; + + default: + ; + } + + if ( idx >= count ) + goto Bad_Descriptor; + + /* compute hash value, both in family and query */ + cfam->index = idx; + cfam->hash = hash ^ FTC_FACE_ID_HASH( desc->face_id ); + FTC_QUERY( cquery )->hash = FTC_CMAP_HASH( cfam, cquery ); + + error = ftc_family_init( FTC_FAMILY( cfam ), + FTC_QUERY( cquery ), cache ); } - return 0; + return error; + + Bad_Descriptor: + FT_TRACE1(( "ftp_cmap_family_init: invalid charmap descriptor\n" )); + return FTC_Err_Invalid_Argument; } FT_CALLBACK_DEF( FT_Bool ) - ftc_cmap_node_remove_faceid( FTC_CMapNode node, - FTC_FaceID face_id ) + ftc_cmap_family_compare( FTC_CMapFamily cfam, + FTC_CMapQuery cquery ) { - return FT_BOOL( node->face_id == face_id ); + FT_Int result = 0; + + + /* first, compare face id and type */ + if ( cfam->desc.face_id != cquery->desc->face_id || + cfam->desc.type != cquery->desc->type ) + goto Exit; + + switch ( cfam->desc.type ) + { + case FTC_CMAP_BY_INDEX: + result = ( cfam->desc.u.index == cquery->desc->u.index ); + break; + + case FTC_CMAP_BY_ENCODING: + result = ( cfam->desc.u.encoding == cquery->desc->u.encoding ); + break; + + case FTC_CMAP_BY_ID: + result = ( cfam->desc.u.id.platform == cquery->desc->u.id.platform && + cfam->desc.u.id.encoding == cquery->desc->u.id.encoding ); + break; + + default: + ; + } + + if ( result ) + { + /* when found, update the 'family' and 'hash' field of the query */ + FTC_QUERY( cquery )->family = FTC_FAMILY( cfam ); + FTC_QUERY( cquery )->hash = FTC_CMAP_HASH( cfam, cquery ); + } + + Exit: + return FT_BOOL( result ); } @@ -181,17 +334,23 @@ FT_CALLBACK_TABLE_DEF - const FTC_CacheClassRec ftc_cmap_cache_class = + const FTC_Cache_ClassRec ftc_cmap_cache_class = { - (FTC_Node_NewFunc) ftc_cmap_node_new, + sizeof ( FTC_CacheRec ), + (FTC_Cache_InitFunc) ftc_cache_init, + (FTC_Cache_ClearFunc)ftc_cache_clear, + (FTC_Cache_DoneFunc) ftc_cache_done, + + sizeof ( FTC_CMapFamilyRec ), + (FTC_Family_InitFunc) ftc_cmap_family_init, + (FTC_Family_CompareFunc)ftc_cmap_family_compare, + (FTC_Family_DoneFunc) ftc_family_done, + + sizeof ( FTC_CMapNodeRec ), + (FTC_Node_InitFunc) ftc_cmap_node_init, (FTC_Node_WeightFunc) ftc_cmap_node_weight, (FTC_Node_CompareFunc)ftc_cmap_node_compare, - (FTC_Node_CompareFunc)ftc_cmap_node_remove_faceid, - (FTC_Node_FreeFunc) ftc_cmap_node_free, - - sizeof ( FTC_CacheRec ), - (FTC_Cache_InitFunc) FTC_Cache_Init, - (FTC_Cache_DoneFunc) FTC_Cache_Done, + (FTC_Node_DoneFunc) ftc_node_done }; @@ -201,84 +360,99 @@ FTC_CMapCache_New( FTC_Manager manager, FTC_CMapCache *acache ) { - return FTC_Manager_RegisterCache( manager, - &ftc_cmap_cache_class, - FTC_CACHE_P( acache ) ); + return FTC_Manager_Register_Cache( + manager, + (FTC_Cache_Class)&ftc_cmap_cache_class, + FTC_CACHE_P( acache ) ); } +#ifdef FTC_CACHE_USE_INLINE + +#define GEN_CACHE_FAMILY_COMPARE( f, q, c ) \ + ftc_cmap_family_compare( (FTC_CMapFamily)(f), (FTC_CMapQuery)(q) ) + +#define GEN_CACHE_NODE_COMPARE( n, q, c ) \ + ftc_cmap_node_compare( (FTC_CMapNode)(n), (FTC_CMapQuery)(q) ) + +#define GEN_CACHE_LOOKUP ftc_cmap_cache_lookup + +#include "ftccache.i" + +#else /* !FTC_CACHE_USE_INLINE */ + +#define ftc_cmap_cache_lookup ftc_cache_lookup + +#endif /* !FTC_CACHE_USE_INLINE */ + + /* documentation is in ftccmap.h */ FT_EXPORT_DEF( FT_UInt ) - FTC_CMapCache_Lookup( FTC_CMapCache cmap_cache, - FTC_FaceID face_id, - FT_Int cmap_index, + FTC_CMapCache_Lookup( FTC_CMapCache cache, + FTC_CMapDesc desc, FT_UInt32 char_code ) { - FTC_Cache cache = FTC_CACHE( cmap_cache ); - FTC_CMapQueryRec query; + FTC_CMapQueryRec cquery; FTC_CMapNode node; FT_Error error; FT_UInt gindex = 0; - FT_UInt32 hash; - if ( !cache ) + if ( !cache || !desc ) { FT_ERROR(( "FTC_CMapCache_Lookup: bad arguments, returning 0!\n" )); return 0; } - query.face_id = face_id; - query.cmap_index = (FT_UInt)cmap_index; - query.char_code = char_code; + cquery.desc = desc; + cquery.char_code = char_code; - hash = FTC_CMAP_HASH( face_id, cmap_index, char_code ); - -#if 1 - FTC_CACHE_LOOKUP_CMP( cache, ftc_cmap_node_compare, hash, &query, - node, error ); -#else - error = FTC_Cache_Lookup( cache, hash, &query, (FTC_Node*) &node ); -#endif - if ( error ) - goto Exit; - - FT_ASSERT( (FT_UInt)( char_code - node->first ) < FTC_CMAP_INDICES_MAX ); - - gindex = node->indices[char_code - node->first]; - if ( gindex == FTC_CMAP_UNKNOWN ) + error = ftc_cmap_cache_lookup( FTC_CACHE( cache ), + FTC_QUERY( &cquery ), + (FTC_Node*)&node ); + if ( !error ) { - FT_Face face; + FT_UInt offset = (FT_UInt)( char_code - node->first ); - gindex = 0; + FT_ASSERT( offset < FTC_CMAP_INDICES_MAX ); - error = FTC_Manager_LookupFace( cache->manager, node->face_id, &face ); - if ( error ) - goto Exit; - - if ( (FT_UInt)cmap_index < (FT_UInt)face->num_charmaps ) + gindex = node->indices[offset]; + if ( gindex == FTC_CMAP_UNKNOWN ) { - FT_CharMap old, cmap = NULL; + FT_Face face; - old = face->charmap; - cmap = face->charmaps[cmap_index]; + /* we need to use FT_Get_Char_Index */ + gindex = 0; + + error = FTC_Manager_Lookup_Face( FTC_CACHE(cache)->manager, + desc->face_id, + &face ); + if ( !error ) + { + FT_CharMap old, cmap = NULL; + FT_UInt cmap_index; + + + /* save old charmap, select new one */ + old = face->charmap; + cmap_index = FTC_CMAP_FAMILY( FTC_QUERY( &cquery )->family )->index; + cmap = face->charmaps[cmap_index]; - if ( old != cmap ) FT_Set_Charmap( face, cmap ); - gindex = FT_Get_Char_Index( face, char_code ); + /* perform lookup */ + gindex = FT_Get_Char_Index( face, char_code ); + node->indices[offset] = (FT_UInt16)gindex; - if ( old != cmap ) + /* restore old charmap */ FT_Set_Charmap( face, old ); + } } - - node->indices[char_code - node->first] = gindex; } - Exit: return gindex; } diff --git a/reactos/lib/freetype/src/cache/ftcglyph.c b/reactos/lib/freetype/src/cache/ftcglyph.c index eb48d6696e9..aa21228a79b 100644 --- a/reactos/lib/freetype/src/cache/ftcglyph.c +++ b/reactos/lib/freetype/src/cache/ftcglyph.c @@ -4,7 +4,7 @@ /* */ /* FreeType Glyph Image (FT_Glyph) cache (body). */ /* */ -/* Copyright 2000-2001, 2003 by */ +/* Copyright 2000-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -20,6 +20,7 @@ #include FT_CACHE_H #include FT_CACHE_INTERNAL_GLYPH_H #include FT_ERRORS_H +#include FT_LIST_H #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DEBUG_H @@ -28,47 +29,45 @@ /* create a new chunk node, setting its cache index and ref count */ FT_EXPORT_DEF( void ) - FTC_GNode_Init( FTC_GNode gnode, - FT_UInt gindex, - FTC_Family family ) + ftc_glyph_node_init( FTC_GlyphNode gnode, + FT_UInt gindex, + FTC_GlyphFamily gfam ) { - gnode->family = family; - gnode->gindex = gindex; - family->num_nodes++; + FT_UInt len; + FT_UInt start = FTC_GLYPH_FAMILY_START( gfam, gindex ); + + + gnode->item_start = (FT_UShort)start; + + len = gfam->item_total - start; + if ( len > gfam->item_count ) + len = gfam->item_count; + + gnode->item_count = (FT_UShort)len; + gfam->family.num_nodes++; } FT_EXPORT_DEF( void ) - FTC_GNode_UnselectFamily( FTC_GNode gnode, - FTC_Cache cache ) - { - FTC_Family family = gnode->family; - - - gnode->family = NULL; - if ( family && --family->num_nodes <= 0 ) - FTC_MruList_Remove( &FTC_GCACHE( cache )->families, - (FTC_MruNode)family ); - } - - - FT_EXPORT_DEF( void ) - FTC_GNode_Done( FTC_GNode gnode, - FTC_Cache cache ) + ftc_glyph_node_done( FTC_GlyphNode gnode, + FTC_Cache cache ) { /* finalize the node */ - gnode->gindex = 0; + gnode->item_count = 0; + gnode->item_start = 0; - FTC_GNode_UnselectFamily( gnode, cache ); + ftc_node_done( FTC_NODE( gnode ), cache ); } FT_EXPORT_DEF( FT_Bool ) - FTC_GNode_Compare( FTC_GNode gnode, - FTC_GQuery gquery ) + ftc_glyph_node_compare( FTC_GlyphNode gnode, + FTC_GlyphQuery gquery ) { - return FT_BOOL( gnode->family == gquery->family && - gnode->gindex == gquery->gindex ); + FT_UInt start = (FT_UInt)gnode->item_start; + FT_UInt count = (FT_UInt)gnode->item_count; + + return FT_BOOL( (FT_UInt)( gquery->gindex - start ) < count ); } @@ -80,34 +79,26 @@ /*************************************************************************/ /*************************************************************************/ - FT_EXPORT_DEF( void ) - FTC_Family_Init( FTC_Family family, - FTC_Cache cache ) - { - FTC_GCacheClass clazz = FTC_CACHE__GCACHE_CLASS( cache ); - - - family->clazz = clazz->family_class; - family->num_nodes = 0; - family->cache = cache; - } - FT_EXPORT_DEF( FT_Error ) - FTC_GCache_Init( FTC_GCache cache ) + ftc_glyph_family_init( FTC_GlyphFamily gfam, + FT_UInt32 hash, + FT_UInt item_count, + FT_UInt item_total, + FTC_GlyphQuery gquery, + FTC_Cache cache ) { - FT_Error error; + FT_Error error; - error = FTC_Cache_Init( FTC_CACHE( cache ) ); + + error = ftc_family_init( FTC_FAMILY( gfam ), FTC_QUERY( gquery ), cache ); if ( !error ) { - FTC_GCacheClass clazz = (FTC_GCacheClass)FTC_CACHE( cache )->org_class; - - FTC_MruList_Init( &cache->families, - clazz->family_class, - 0, /* no maximum here! */ - cache, - FTC_CACHE( cache )->memory ); + gfam->hash = hash; + gfam->item_total = item_total; + gfam->item_count = item_count; + + FTC_GLYPH_FAMILY_FOUND( gfam, gquery ); } return error; @@ -115,40 +106,9 @@ FT_EXPORT_DEF( void ) - FTC_GCache_Done( FTC_GCache cache ) + ftc_glyph_family_done( FTC_GlyphFamily gfam ) { - FTC_Cache_Done( (FTC_Cache)cache ); - FTC_MruList_Done( &cache->families ); - } - - - FT_EXPORT_DEF( FT_Error ) - FTC_GCache_New( FTC_Manager manager, - FTC_GCacheClass clazz, - FTC_GCache *acache ) - { - return FTC_Manager_RegisterCache( manager, (FTC_CacheClass)clazz, - (FTC_Cache*)acache ); - } - - - FT_EXPORT_DEF( FT_Error ) - FTC_GCache_Lookup( FTC_GCache cache, - FT_UInt32 hash, - FT_UInt gindex, - FTC_GQuery query, - FTC_Node *anode ) - { - FT_Error error; - - - query->gindex = gindex; - - FTC_MRULIST_LOOKUP( &cache->families, query, query->family, error ); - if ( !error ) - error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, anode ); - - return error; + ftc_family_done( FTC_FAMILY( gfam ) ); } diff --git a/reactos/lib/freetype/src/cache/ftcimage.c b/reactos/lib/freetype/src/cache/ftcimage.c index 2c942d12326..fa1b6ac7177 100644 --- a/reactos/lib/freetype/src/cache/ftcimage.c +++ b/reactos/lib/freetype/src/cache/ftcimage.c @@ -4,7 +4,7 @@ /* */ /* FreeType Image cache (body). */ /* */ -/* Copyright 2000-2001, 2003 by */ +/* Copyright 2000-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -18,65 +18,133 @@ #include <ft2build.h> #include FT_CACHE_H -#include FT_CACHE_INTERNAL_IMAGE_H +#include FT_CACHE_IMAGE_H +#include FT_CACHE_INTERNAL_GLYPH_H #include FT_INTERNAL_MEMORY_H #include "ftcerror.h" - /* finalize a given glyph image node */ - FT_EXPORT_DEF( void ) - FTC_INode_Free( FTC_INode inode, - FTC_Cache cache ) + /* the FT_Glyph image node type */ + typedef struct FTC_ImageNodeRec_ { - FT_Memory memory = cache->memory; + FTC_GlyphNodeRec gnode; + FT_Glyph glyph; + + } FTC_ImageNodeRec, *FTC_ImageNode; +#define FTC_IMAGE_NODE( x ) ( (FTC_ImageNode)( x ) ) +#define FTC_IMAGE_NODE_GINDEX( x ) FTC_GLYPH_NODE_GINDEX( x ) + + + /* the glyph image query */ + typedef struct FTC_ImageQueryRec_ + { + FTC_GlyphQueryRec gquery; + FTC_ImageTypeRec type; + + } FTC_ImageQueryRec, *FTC_ImageQuery; + + +#define FTC_IMAGE_QUERY( x ) ( (FTC_ImageQuery)( x ) ) + + + /* the glyph image set type */ + typedef struct FTC_ImageFamilyRec_ + { + FTC_GlyphFamilyRec gfam; + FTC_ImageTypeRec type; + + } FTC_ImageFamilyRec, *FTC_ImageFamily; + + +#define FTC_IMAGE_FAMILY( x ) ( (FTC_ImageFamily)( x ) ) +#define FTC_IMAGE_FAMILY_MEMORY( x ) FTC_GLYPH_FAMILY_MEMORY( &(x)->gfam ) + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GLYPH IMAGE NODES *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + /* finalize a given glyph image node */ + FT_CALLBACK_DEF( void ) + ftc_image_node_done( FTC_ImageNode inode, + FTC_Cache cache ) + { if ( inode->glyph ) { FT_Done_Glyph( inode->glyph ); inode->glyph = NULL; } - FTC_GNode_Done( FTC_GNODE( inode ), cache ); - FT_FREE( inode ); + ftc_glyph_node_done( FTC_GLYPH_NODE( inode ), cache ); } /* initialize a new glyph image node */ - FT_EXPORT_DEF( FT_Error ) - FTC_INode_New( FTC_INode *pinode, - FTC_GQuery gquery, - FTC_Cache cache ) + FT_CALLBACK_DEF( FT_Error ) + ftc_image_node_init( FTC_ImageNode inode, + FTC_GlyphQuery gquery, + FTC_Cache cache ) { - FT_Memory memory = cache->memory; - FT_Error error; - FTC_INode inode; + FTC_ImageFamily ifam = FTC_IMAGE_FAMILY( gquery->query.family ); + FT_Error error; + FT_Face face; + FT_Size size; - if ( !FT_NEW( inode ) ) + /* initialize its inner fields */ + ftc_glyph_node_init( FTC_GLYPH_NODE( inode ), + gquery->gindex, + FTC_GLYPH_FAMILY( ifam ) ); + + /* we will now load the glyph image */ + error = FTC_Manager_Lookup_Size( FTC_FAMILY( ifam )->cache->manager, + &ifam->type.font, + &face, &size ); + if ( !error ) { - FTC_GNode gnode = FTC_GNODE( inode ); - FTC_Family family = gquery->family; - FT_UInt gindex = gquery->gindex; - FTC_IFamilyClass clazz = FTC_CACHE__IFAMILY_CLASS( cache ); + FT_UInt gindex = FTC_GLYPH_NODE_GINDEX( inode ); - /* initialize its inner fields */ - FTC_GNode_Init( gnode, gindex, family ); + error = FT_Load_Glyph( face, gindex, ifam->type.flags ); + if ( !error ) + { + if ( face->glyph->format == FT_GLYPH_FORMAT_BITMAP || + face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ) + { + /* ok, copy it */ + FT_Glyph glyph; - /* we will now load the glyph image */ - error = clazz->family_load_glyph( family, gindex, cache, - &inode->glyph ); + + error = FT_Get_Glyph( face->glyph, &glyph ); + if ( !error ) + { + inode->glyph = glyph; + goto Exit; + } + } + else + error = FTC_Err_Invalid_Argument; + } } - *pinode = inode; + /* in case of error */ + ftc_glyph_node_done( FTC_GLYPH_NODE(inode), cache ); + + Exit: return error; } - FT_EXPORT_DEF( FT_ULong ) - FTC_INode_Weight( FTC_INode inode ) + FT_CALLBACK_DEF( FT_ULong ) + ftc_image_node_weight( FTC_ImageNode inode ) { FT_ULong size = 0; FT_Glyph glyph = inode->glyph; @@ -117,4 +185,215 @@ } + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GLYPH IMAGE SETS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + FT_CALLBACK_DEF( FT_Error ) + ftc_image_family_init( FTC_ImageFamily ifam, + FTC_ImageQuery iquery, + FTC_Cache cache ) + { + FTC_Manager manager = cache->manager; + FT_Error error; + FT_Face face; + + + ifam->type = iquery->type; + + /* we need to compute "iquery.item_total" now */ + error = FTC_Manager_Lookup_Face( manager, + iquery->type.font.face_id, + &face ); + if ( !error ) + { + error = ftc_glyph_family_init( FTC_GLYPH_FAMILY( ifam ), + FTC_IMAGE_TYPE_HASH( &ifam->type ), + 1, + face->num_glyphs, + FTC_GLYPH_QUERY( iquery ), + cache ); + } + + return error; + } + + + FT_CALLBACK_DEF( FT_Bool ) + ftc_image_family_compare( FTC_ImageFamily ifam, + FTC_ImageQuery iquery ) + { + FT_Bool result; + + + result = FT_BOOL( FTC_IMAGE_TYPE_COMPARE( &ifam->type, &iquery->type ) ); + if ( result ) + FTC_GLYPH_FAMILY_FOUND( ifam, iquery ); + + return result; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GLYPH IMAGE CACHE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + + FT_CALLBACK_TABLE_DEF + const FTC_Cache_ClassRec ftc_image_cache_class = + { + sizeof ( FTC_CacheRec ), + (FTC_Cache_InitFunc) ftc_cache_init, + (FTC_Cache_ClearFunc)ftc_cache_clear, + (FTC_Cache_DoneFunc) ftc_cache_done, + + sizeof ( FTC_ImageFamilyRec ), + (FTC_Family_InitFunc) ftc_image_family_init, + (FTC_Family_CompareFunc)ftc_image_family_compare, + (FTC_Family_DoneFunc) ftc_glyph_family_done, + + sizeof ( FTC_ImageNodeRec ), + (FTC_Node_InitFunc) ftc_image_node_init, + (FTC_Node_WeightFunc) ftc_image_node_weight, + (FTC_Node_CompareFunc)ftc_glyph_node_compare, + (FTC_Node_DoneFunc) ftc_image_node_done + }; + + + /* documentation is in ftcimage.h */ + + FT_EXPORT_DEF( FT_Error ) + FTC_ImageCache_New( FTC_Manager manager, + FTC_ImageCache *acache ) + { + return FTC_Manager_Register_Cache( + manager, + (FTC_Cache_Class)&ftc_image_cache_class, + FTC_CACHE_P( acache ) ); + } + + + /* documentation is in ftcimage.h */ + + FT_EXPORT_DEF( FT_Error ) + FTC_ImageCache_Lookup( FTC_ImageCache cache, + FTC_ImageType type, + FT_UInt gindex, + FT_Glyph *aglyph, + FTC_Node *anode ) + { + FTC_ImageQueryRec iquery; + FTC_ImageNode node; + FT_Error error; + + + /* some argument checks are delayed to ftc_cache_lookup */ + if ( !aglyph ) + return FTC_Err_Invalid_Argument; + + if ( anode ) + *anode = NULL; + + iquery.gquery.gindex = gindex; + iquery.type = *type; + + error = ftc_cache_lookup( FTC_CACHE( cache ), + FTC_QUERY( &iquery ), + (FTC_Node*)&node ); + if ( !error ) + { + *aglyph = node->glyph; + + if ( anode ) + { + *anode = (FTC_Node)node; + FTC_NODE( node )->ref_count++; + } + } + + return error; + } + + + /* backwards-compatibility functions */ + + FT_EXPORT_DEF( FT_Error ) + FTC_Image_Cache_New( FTC_Manager manager, + FTC_Image_Cache *acache ) + { + return FTC_ImageCache_New( manager, (FTC_ImageCache*)acache ); + } + + + FT_EXPORT_DEF( FT_Error ) + FTC_Image_Cache_Lookup( FTC_Image_Cache icache, + FTC_Image_Desc* desc, + FT_UInt gindex, + FT_Glyph *aglyph ) + { + FTC_ImageTypeRec type0; + + + if ( !desc ) + return FTC_Err_Invalid_Argument; + + type0.font = desc->font; + + /* convert image type flags to load flags */ + { + FT_UInt load_flags = FT_LOAD_DEFAULT; + FT_UInt type = desc->image_type; + + + /* determine load flags, depending on the font description's */ + /* image type */ + + if ( ftc_image_format( type ) == ftc_image_format_bitmap ) + { + if ( type & ftc_image_flag_monochrome ) + load_flags |= FT_LOAD_MONOCHROME; + + /* disable embedded bitmaps loading if necessary */ + if ( type & ftc_image_flag_no_sbits ) + load_flags |= FT_LOAD_NO_BITMAP; + } + else + { + /* we want an outline, don't load embedded bitmaps */ + load_flags |= FT_LOAD_NO_BITMAP; + + if ( type & ftc_image_flag_unscaled ) + load_flags |= FT_LOAD_NO_SCALE; + } + + /* always render glyphs to bitmaps */ + load_flags |= FT_LOAD_RENDER; + + if ( type & ftc_image_flag_unhinted ) + load_flags |= FT_LOAD_NO_HINTING; + + if ( type & ftc_image_flag_autohinted ) + load_flags |= FT_LOAD_FORCE_AUTOHINT; + + type0.flags = load_flags; + } + + return FTC_ImageCache_Lookup( (FTC_ImageCache)icache, + &type0, + gindex, + aglyph, + NULL ); + } + + /* END */ diff --git a/reactos/lib/freetype/src/cache/ftcmanag.c b/reactos/lib/freetype/src/cache/ftcmanag.c index 6d60e4cf744..7cdb8f9da77 100644 --- a/reactos/lib/freetype/src/cache/ftcmanag.c +++ b/reactos/lib/freetype/src/cache/ftcmanag.c @@ -4,7 +4,7 @@ /* */ /* FreeType Cache Manager (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004 by */ +/* Copyright 2000-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -18,7 +18,8 @@ #include <ft2build.h> #include FT_CACHE_H -#include FT_CACHE_INTERNAL_MANAGER_H +#include FT_CACHE_MANAGER_H +#include FT_CACHE_INTERNAL_LRU_H #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DEBUG_H #include FT_SIZES_H @@ -32,170 +33,32 @@ #define FTC_LRU_GET_MANAGER( lru ) ( (FTC_Manager)(lru)->user_data ) - static FT_Error - ftc_scaler_lookup_size( FTC_Manager manager, - FTC_Scaler scaler, - FT_Size *asize ) + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FACE LRU IMPLEMENTATION *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + typedef struct FTC_FaceNodeRec_* FTC_FaceNode; + typedef struct FTC_SizeNodeRec_* FTC_SizeNode; + + + typedef struct FTC_FaceNodeRec_ { - FT_Face face; - FT_Size size = NULL; - FT_Error error; + FT_LruNodeRec lru; + FT_Face face; - - error = FTC_Manager_LookupFace( manager, scaler->face_id, &face ); - if ( error ) - goto Exit; - - error = FT_New_Size( face, &size ); - if ( error ) - goto Exit; - - FT_Activate_Size( size ); - - if ( scaler->pixel ) - error = FT_Set_Pixel_Sizes( face, scaler->width, scaler->height ); - else - error = FT_Set_Char_Size( face, scaler->width, scaler->height, - scaler->x_res, scaler->y_res ); - if ( error ) - { - FT_Done_Size( size ); - size = NULL; - } - - Exit: - *asize = size; - return error; - } + } FTC_FaceNodeRec; typedef struct FTC_SizeNodeRec_ { - FTC_MruNodeRec node; - FT_Size size; - FTC_ScalerRec scaler; + FT_LruNodeRec lru; + FT_Size size; - } FTC_SizeNodeRec, *FTC_SizeNode; - - - FT_CALLBACK_DEF( void ) - ftc_size_node_done( FTC_SizeNode node ) - { - FT_Size size = node->size; - - - if ( size ) - FT_Done_Size( size ); - } - - - FT_CALLBACK_DEF( FT_Bool ) - ftc_size_node_compare( FTC_SizeNode node, - FTC_Scaler scaler ) - { - FTC_Scaler scaler0 = &node->scaler; - - - if ( FTC_SCALER_COMPARE( scaler0, scaler ) ) - { - FT_Activate_Size( node->size ); - return 1; - } - return 0; - } - - - FT_CALLBACK_DEF( FT_Error ) - ftc_size_node_init( FTC_SizeNode node, - FTC_Scaler scaler, - FTC_Manager manager ) - { - node->scaler = scaler[0]; - - return ftc_scaler_lookup_size( manager, scaler, &node->size ); - } - - - FT_CALLBACK_DEF( FT_Error ) - ftc_size_node_reset( FTC_SizeNode node, - FTC_Scaler scaler, - FTC_Manager manager ) - { - FT_Done_Size( node->size ); - - node->scaler = scaler[0]; - - return ftc_scaler_lookup_size( manager, scaler, &node->size ); - } - - - static const FTC_MruListClassRec ftc_size_list_class = - { - sizeof( FTC_SizeNodeRec ), - (FTC_MruNode_CompareFunc)ftc_size_node_compare, - (FTC_MruNode_InitFunc) ftc_size_node_init, - (FTC_MruNode_ResetFunc) ftc_size_node_reset, - (FTC_MruNode_DoneFunc) ftc_size_node_done - }; - - - /* helper function used by ftc_face_node_done */ - static FT_Bool - ftc_size_node_compare_faceid( FTC_SizeNode node, - FTC_FaceID face_id ) - { - return FT_BOOL( node->scaler.face_id == face_id ); - } - - - FT_EXPORT_DEF( FT_Error ) - FTC_Manager_LookupSize( FTC_Manager manager, - FTC_Scaler scaler, - FT_Size *asize ) - { - FT_Error error; - FTC_SizeNode node; - - - if ( asize == NULL ) - return FTC_Err_Bad_Argument; - - *asize = NULL; - - if ( !manager ) - return FTC_Err_Invalid_Cache_Handle; - -#ifdef FTC_INLINE - - FTC_MRULIST_LOOKUP_CMP( &manager->sizes, scaler, ftc_size_node_compare, - node, error ); - -#else - error = FTC_MruList_Lookup( &manager->sizes, scaler, (FTC_MruNode*)&node ); -#endif - - if ( !error ) - *asize = node->size; - - return error; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FACE MRU IMPLEMENTATION *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - typedef struct FTC_FaceNodeRec_ - { - FTC_MruNodeRec node; - FTC_FaceID face_id; - FT_Face face; - - } FTC_FaceNodeRec, *FTC_FaceNode; + } FTC_SizeNodeRec; FT_CALLBACK_DEF( FT_Error ) @@ -206,8 +69,6 @@ FT_Error error; - node->face_id = face_id; - error = manager->request_face( face_id, manager->library, manager->request_data, @@ -223,49 +84,55 @@ } + /* helper function for ftc_face_node_done() */ + FT_CALLBACK_DEF( FT_Bool ) + ftc_size_node_select( FTC_SizeNode node, + FT_Face face ) + { + return FT_BOOL( node->size->face == face ); + } + + FT_CALLBACK_DEF( void ) ftc_face_node_done( FTC_FaceNode node, FTC_Manager manager ) { - /* we must begin by removing all scalers for the target face */ - /* from the manager's list */ - FTC_MruList_RemoveSelection( - & manager->sizes, - (FTC_MruNode_CompareFunc)ftc_size_node_compare_faceid, - node->face_id ); + FT_Face face = node->face; + + + /* we must begin by removing all sizes for the target face */ + /* from the manager's list */ + FT_LruList_Remove_Selection( manager->sizes_list, + (FT_LruNode_SelectFunc)ftc_size_node_select, + face ); /* all right, we can discard the face now */ - FT_Done_Face( node->face ); - node->face = NULL; - node->face_id = NULL; + FT_Done_Face( face ); + node->face = NULL; } - FT_CALLBACK_DEF( FT_Bool ) - ftc_face_node_compare( FTC_FaceNode node, - FTC_FaceID face_id ) + FT_CALLBACK_TABLE_DEF + const FT_LruList_ClassRec ftc_face_list_class = { - return FT_BOOL( node->face_id == face_id ); - } + sizeof ( FT_LruListRec ), + (FT_LruList_InitFunc)0, + (FT_LruList_DoneFunc)0, - - static const FTC_MruListClassRec ftc_face_list_class = - { - sizeof( FTC_FaceNodeRec), - - (FTC_MruNode_CompareFunc)ftc_face_node_compare, - (FTC_MruNode_InitFunc) ftc_face_node_init, - (FTC_MruNode_ResetFunc) NULL, - (FTC_MruNode_DoneFunc) ftc_face_node_done + sizeof ( FTC_FaceNodeRec ), + (FT_LruNode_InitFunc) ftc_face_node_init, + (FT_LruNode_DoneFunc) ftc_face_node_done, + (FT_LruNode_FlushFunc) 0, /* no flushing needed */ + (FT_LruNode_CompareFunc)0, /* direct comparison of FTC_FaceID handles */ }; /* documentation is in ftcache.h */ FT_EXPORT_DEF( FT_Error ) - FTC_Manager_LookupFace( FTC_Manager manager, - FTC_FaceID face_id, - FT_Face *aface ) + FTC_Manager_Lookup_Face( FTC_Manager manager, + FTC_FaceID face_id, + FT_Face *aface ) { FT_Error error; FTC_FaceNode node; @@ -279,16 +146,9 @@ if ( !manager ) return FTC_Err_Invalid_Cache_Handle; - /* we break encapsulation for the sake of speed */ -#ifdef FTC_INLINE - - FTC_MRULIST_LOOKUP_CMP( &manager->faces, face_id, ftc_face_node_compare, - node, error ); - -#else - error = FTC_MruList_Lookup( &manager->faces, face_id, (FTC_MruNode*)&node ); -#endif - + error = FT_LruList_Lookup( manager->faces_list, + (FT_LruKey)face_id, + (FT_LruNode*)&node ); if ( !error ) *aface = node->face; @@ -296,6 +156,283 @@ } + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** SIZES LRU IMPLEMENTATION *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + typedef struct FTC_SizeQueryRec_ + { + FT_Face face; + FT_UInt width; + FT_UInt height; + + } FTC_SizeQueryRec, *FTC_SizeQuery; + + + FT_CALLBACK_DEF( FT_Error ) + ftc_size_node_init( FTC_SizeNode node, + FTC_SizeQuery query ) + { + FT_Face face = query->face; + FT_Size size; + FT_Error error; + + + node->size = NULL; + error = FT_New_Size( face, &size ); + if ( !error ) + { + FT_Activate_Size( size ); + error = FT_Set_Pixel_Sizes( query->face, + query->width, + query->height ); + if ( error ) + FT_Done_Size( size ); + else + node->size = size; + } + return error; + } + + + FT_CALLBACK_DEF( void ) + ftc_size_node_done( FTC_SizeNode node ) + { + if ( node->size ) + { + FT_Done_Size( node->size ); + node->size = NULL; + } + } + + + FT_CALLBACK_DEF( FT_Error ) + ftc_size_node_flush( FTC_SizeNode node, + FTC_SizeQuery query ) + { + FT_Size size = node->size; + FT_Error error; + + + if ( size->face == query->face ) + { + FT_Activate_Size( size ); + error = FT_Set_Pixel_Sizes( query->face, query->width, query->height ); + if ( error ) + { + FT_Done_Size( size ); + node->size = NULL; + } + } + else + { + FT_Done_Size( size ); + node->size = NULL; + + error = ftc_size_node_init( node, query ); + } + return error; + } + + + FT_CALLBACK_DEF( FT_Bool ) + ftc_size_node_compare( FTC_SizeNode node, + FTC_SizeQuery query ) + { + FT_Size size = node->size; + + + return FT_BOOL( size->face == query->face && + (FT_UInt)size->metrics.x_ppem == query->width && + (FT_UInt)size->metrics.y_ppem == query->height ); + } + + + FT_CALLBACK_TABLE_DEF + const FT_LruList_ClassRec ftc_size_list_class = + { + sizeof ( FT_LruListRec ), + (FT_LruList_InitFunc)0, + (FT_LruList_DoneFunc)0, + + sizeof ( FTC_SizeNodeRec ), + (FT_LruNode_InitFunc) ftc_size_node_init, + (FT_LruNode_DoneFunc) ftc_size_node_done, + (FT_LruNode_FlushFunc) ftc_size_node_flush, + (FT_LruNode_CompareFunc)ftc_size_node_compare + }; + + + /* documentation is in ftcache.h */ + + FT_EXPORT_DEF( FT_Error ) + FTC_Manager_Lookup_Size( FTC_Manager manager, + FTC_Font font, + FT_Face *aface, + FT_Size *asize ) + { + FT_Error error; + + + /* check for valid `manager' delayed to FTC_Manager_Lookup_Face() */ + if ( aface ) + *aface = 0; + + if ( asize ) + *asize = 0; + + error = FTC_Manager_Lookup_Face( manager, font->face_id, aface ); + if ( !error ) + { + FTC_SizeQueryRec query; + FTC_SizeNode node; + + + query.face = *aface; + query.width = font->pix_width; + query.height = font->pix_height; + + error = FT_LruList_Lookup( manager->sizes_list, + (FT_LruKey)&query, + (FT_LruNode*)&node ); + if ( !error ) + { + /* select the size as the current one for this face */ + FT_Activate_Size( node->size ); + + if ( asize ) + *asize = node->size; + } + } + + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** SET TABLE MANAGEMENT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + ftc_family_table_init( FTC_FamilyTable table ) + { + table->count = 0; + table->size = 0; + table->entries = NULL; + table->free = FTC_FAMILY_ENTRY_NONE; + } + + + static void + ftc_family_table_done( FTC_FamilyTable table, + FT_Memory memory ) + { + FT_FREE( table->entries ); + table->free = 0; + table->count = 0; + table->size = 0; + } + + + FT_EXPORT_DEF( FT_Error ) + ftc_family_table_alloc( FTC_FamilyTable table, + FT_Memory memory, + FTC_FamilyEntry *aentry ) + { + FTC_FamilyEntry entry; + FT_Error error = 0; + + + /* re-allocate table size when needed */ + if ( table->free == FTC_FAMILY_ENTRY_NONE && table->count >= table->size ) + { + FT_UInt old_size = table->size; + FT_UInt new_size, idx; + + + if ( old_size == 0 ) + new_size = 8; + else + { + new_size = old_size * 2; + + /* check for (unlikely) overflow */ + if ( new_size < old_size ) + new_size = 65534; + } + + if ( FT_RENEW_ARRAY( table->entries, old_size, new_size ) ) + return error; + + table->size = new_size; + + entry = table->entries + old_size; + table->free = old_size; + + for ( idx = old_size; idx + 1 < new_size; idx++, entry++ ) + { + entry->link = idx + 1; + entry->index = idx; + } + + entry->link = FTC_FAMILY_ENTRY_NONE; + entry->index = idx; + } + + if ( table->free != FTC_FAMILY_ENTRY_NONE ) + { + entry = table->entries + table->free; + table->free = entry->link; + } + else if ( table->count < table->size ) + { + entry = table->entries + table->count++; + } + else + { + FT_ERROR(( "ftc_family_table_alloc: internal bug!" )); + return FTC_Err_Invalid_Argument; + } + + entry->link = FTC_FAMILY_ENTRY_NONE; + table->count++; + + *aentry = entry; + return error; + } + + + FT_EXPORT_DEF( void ) + ftc_family_table_free( FTC_FamilyTable table, + FT_UInt idx ) + { + /* simply add it to the linked list of free entries */ + if ( idx < table->count ) + { + FTC_FamilyEntry entry = table->entries + idx; + + + if ( entry->link != FTC_FAMILY_ENTRY_NONE ) + FT_ERROR(( "ftc_family_table_free: internal bug!\n" )); + else + { + entry->link = table->free; + table->free = entry->index; + table->count--; + } + } + } + + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -338,28 +475,41 @@ if ( max_bytes == 0 ) max_bytes = FTC_MAX_BYTES_DEFAULT; + error = FT_LruList_New( &ftc_face_list_class, + max_faces, + manager, + memory, + &manager->faces_list ); + if ( error ) + goto Exit; + + error = FT_LruList_New( &ftc_size_list_class, + max_sizes, + manager, + memory, + &manager->sizes_list ); + if ( error ) + goto Exit; + manager->library = library; - manager->memory = memory; manager->max_weight = max_bytes; + manager->cur_weight = 0; manager->request_face = requester; manager->request_data = req_data; - FTC_MruList_Init( &manager->faces, - &ftc_face_list_class, - max_faces, - manager, - memory ); - - FTC_MruList_Init( &manager->sizes, - &ftc_size_list_class, - max_sizes, - manager, - memory ); + ftc_family_table_init( &manager->families ); *amanager = manager; Exit: + if ( error && manager ) + { + FT_LruList_Destroy( manager->faces_list ); + FT_LruList_Destroy( manager->sizes_list ); + FT_FREE( manager ); + } + return error; } @@ -376,29 +526,31 @@ if ( !manager || !manager->library ) return; - memory = manager->memory; + memory = manager->library->memory; /* now discard all caches */ - for (idx = manager->num_caches; idx-- > 0; ) + for (idx = 0; idx < FTC_MAX_CACHES; idx++ ) { FTC_Cache cache = manager->caches[idx]; if ( cache ) { - cache->clazz.cache_done( cache ); + cache->clazz->cache_done( cache ); FT_FREE( cache ); - manager->caches[idx] = NULL; + manager->caches[idx] = 0; } } - manager->num_caches = 0; + + /* discard families table */ + ftc_family_table_done( &manager->families, memory ); /* discard faces and sizes */ - FTC_MruList_Done( &manager->sizes ); - FTC_MruList_Done( &manager->faces ); + FT_LruList_Destroy( manager->faces_list ); + manager->faces_list = 0; - manager->library = NULL; - manager->memory = NULL; + FT_LruList_Destroy( manager->sizes_list ); + manager->sizes_list = 0; FT_FREE( manager ); } @@ -411,8 +563,8 @@ { if ( manager ) { - FTC_MruList_Reset( &manager->sizes ); - FTC_MruList_Reset( &manager->faces ); + FT_LruList_Reset( manager->sizes_list ); + FT_LruList_Reset( manager->faces_list ); } /* XXX: FIXME: flush the caches? */ } @@ -424,7 +576,7 @@ FTC_Manager_Check( FTC_Manager manager ) { FTC_Node node, first; - + first = manager->nodes_list; @@ -432,22 +584,26 @@ if ( first ) { FT_ULong weight = 0; - + node = first; do { - FTC_Cache cache = manager->caches[node->cache_index]; + FTC_FamilyEntry entry = manager->families.entries + node->fam_index; + FTC_Cache cache; - - if ( (FT_UInt)node->cache_index >= manager->num_caches ) - FT_ERROR(( "FTC_Manager_Check: invalid node (cache index = %ld\n", - node->cache_index )); + if ( (FT_UInt)node->fam_index >= manager->families.count || + entry->link != FTC_FAMILY_ENTRY_NONE ) + FT_ERROR(( "FTC_Manager_Check: invalid node (family index = %ld\n", + node->fam_index )); else - weight += cache->clazz.node_weight( node, cache ); + { + cache = entry->cache; + weight += cache->clazz->node_weight( node, cache ); + } - node = FTC_NODE__NEXT( node ); + node = node->mru_next; } while ( node != first ); @@ -466,7 +622,7 @@ do { count++; - node = FTC_NODE__NEXT( node ); + node = node->mru_next; } while ( node != first ); @@ -508,14 +664,14 @@ if ( manager->cur_weight < manager->max_weight || first == NULL ) return; - /* go to last node -- it's a circular list */ - node = FTC_NODE__PREV( first ); + /* go to last node - it's a circular list */ + node = first->mru_prev; do { - FTC_Node prev; + FTC_Node prev = node->mru_prev; - prev = ( node == first ) ? NULL : FTC_NODE__PREV( node ); + prev = ( node == first ) ? NULL : node->mru_prev; if ( node->ref_count <= 0 ) ftc_node_destroy( node, manager ); @@ -529,9 +685,9 @@ /* documentation is in ftcmanag.h */ FT_EXPORT_DEF( FT_Error ) - FTC_Manager_RegisterCache( FTC_Manager manager, - FTC_CacheClass clazz, - FTC_Cache *acache ) + FTC_Manager_Register_Cache( FTC_Manager manager, + FTC_Cache_Class clazz, + FTC_Cache *acache ) { FT_Error error = FTC_Err_Invalid_Argument; FTC_Cache cache = NULL; @@ -539,37 +695,50 @@ if ( manager && clazz && acache ) { - FT_Memory memory = manager->memory; + FT_Memory memory = manager->library->memory; + FT_UInt idx = 0; - if ( manager->num_caches >= FTC_MAX_CACHES ) + /* check for an empty cache slot in the manager's table */ + for ( idx = 0; idx < FTC_MAX_CACHES; idx++ ) + { + if ( manager->caches[idx] == 0 ) + break; + } + + /* return an error if there are too many registered caches */ + if ( idx >= FTC_MAX_CACHES ) { error = FTC_Err_Too_Many_Caches; - FT_ERROR(( "%s: too many registered caches\n", - "FTC_Manager_Register_Cache" )); + FT_ERROR(( "FTC_Manager_Register_Cache:" )); + FT_ERROR(( " too many registered caches\n" )); goto Exit; } if ( !FT_ALLOC( cache, clazz->cache_size ) ) { - cache->manager = manager; - cache->memory = memory; - cache->clazz = clazz[0]; - cache->org_class = clazz; + cache->manager = manager; + cache->memory = memory; + cache->clazz = clazz; /* THIS IS VERY IMPORTANT! IT WILL WRETCH THE MANAGER */ /* IF IT IS NOT SET CORRECTLY */ - cache->index = manager->num_caches; + cache->cache_index = idx; - error = clazz->cache_init( cache ); - if ( error ) + if ( clazz->cache_init ) { - clazz->cache_done( cache ); - FT_FREE( cache ); - goto Exit; + error = clazz->cache_init( cache ); + if ( error ) + { + if ( clazz->cache_done ) + clazz->cache_done( cache ); + + FT_FREE( cache ); + goto Exit; + } } - manager->caches[manager->num_caches++] = cache; + manager->caches[idx] = cache; } } @@ -579,66 +748,17 @@ } - FT_EXPORT_DEF( FT_UInt ) - FTC_Manager_FlushN( FTC_Manager manager, - FT_UInt count ) - { - FTC_Node first = manager->nodes_list; - FTC_Node node; - FT_UInt result; - - - /* try to remove `count' nodes from the list */ - if ( first == NULL ) /* empty list! */ - return 0; - - /* go to last node - it's a circular list */ - node = FTC_NODE__PREV(first); - for ( result = 0; result < count; ) - { - FTC_Node prev = FTC_NODE__PREV( node ); - - - /* don't touch locked nodes */ - if ( node->ref_count <= 0 ) - { - ftc_node_destroy( node, manager ); - result++; - } - - if ( prev == manager->nodes_list ) - break; - - node = prev; - } - return result; - } - - - FT_EXPORT_DEF( void ) - FTC_Manager_RemoveFaceID( FTC_Manager manager, - FTC_FaceID face_id ) - { - FT_UInt nn; - - /* this will remove all FTC_SizeNode that correspond to - * the face_id as well - */ - FTC_MruList_RemoveSelection( &manager->faces, NULL, face_id ); - - for ( nn = 0; nn < manager->num_caches; nn++ ) - FTC_Cache_RemoveFaceID( manager->caches[nn], face_id ); - } - - /* documentation is in ftcmanag.h */ FT_EXPORT_DEF( void ) FTC_Node_Unref( FTC_Node node, FTC_Manager manager ) { - if ( node && (FT_UInt)node->cache_index < manager->num_caches ) + if ( node && (FT_UInt)node->fam_index < manager->families.count && + manager->families.entries[node->fam_index].cache ) + { node->ref_count--; + } } diff --git a/reactos/lib/freetype/src/cache/ftcmru.c b/reactos/lib/freetype/src/cache/ftcmru.c deleted file mode 100644 index 4b2a7fff501..00000000000 --- a/reactos/lib/freetype/src/cache/ftcmru.c +++ /dev/null @@ -1,355 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftcmru.c */ -/* */ -/* FreeType MRU support (body). */ -/* */ -/* Copyright 2003, 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include <ft2build.h> -#include FT_CACHE_H -#include FT_CACHE_INTERNAL_MRU_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H - -#include "ftcerror.h" - - - FT_EXPORT_DEF( void ) - FTC_MruNode_Prepend( FTC_MruNode *plist, - FTC_MruNode node ) - { - FTC_MruNode first = *plist; - - - if ( first ) - { - FTC_MruNode last = first->prev; - - -#ifdef FT_DEBUG_ERROR - { - FTC_MruNode cnode = first; - - - do - { - if ( cnode == node ) - { - fprintf( stderr, "FTC_MruNode_Prepend: invalid action!\n" ); - exit( 2 ); - } - cnode = cnode->next; - - } while ( cnode != first ); - } -#endif - - first->prev = node; - last->next = node; - node->next = first; - node->prev = last; - } - else - { - node->next = node; - node->prev = node; - } - *plist = node; - } - - - FT_EXPORT_DEF( void ) - FTC_MruNode_Up( FTC_MruNode *plist, - FTC_MruNode node ) - { - FTC_MruNode first = *plist; - - - FT_ASSERT( first != NULL ); - - if ( first != node ) - { - FTC_MruNode prev, next, last; - - -#ifdef FT_DEBUG_ERROR - { - FTC_MruNode cnode = first; - do - { - if ( cnode == node ) - goto Ok; - cnode = cnode->next; - - } while ( cnode != first ); - - fprintf( stderr, "FTC_MruNode_Up: invalid action!\n" ); - exit( 2 ); - Ok: - } -#endif - prev = node->prev; - next = node->next; - - prev->next = next; - next->prev = prev; - - last = first->prev; - - last->next = node; - first->prev = node; - - node->next = first; - node->prev = last; - - *plist = node; - } - } - - - FT_EXPORT_DEF( void ) - FTC_MruNode_Remove( FTC_MruNode *plist, - FTC_MruNode node ) - { - FTC_MruNode first = *plist; - FTC_MruNode prev, next; - - - FT_ASSERT( first != NULL ); - -#ifdef FT_DEBUG_ERROR - { - FTC_MruNode cnode = first; - - - do - { - if ( cnode == node ) - goto Ok; - cnode = cnode->next; - - } while ( cnode != first ); - - fprintf( stderr, "FTC_MruNode_Remove: invalid action!\n" ); - exit( 2 ); - Ok: - } -#endif - - prev = node->prev; - next = node->next; - - prev->next = next; - next->prev = prev; - - if ( node == next ) - { - FT_ASSERT( first == node ); - FT_ASSERT( prev == node ); - - *plist = NULL; - } - else if ( node == first ) - *plist = next; - } - - - FT_EXPORT_DEF( void ) - FTC_MruList_Init( FTC_MruList list, - FTC_MruListClass clazz, - FT_UInt max_nodes, - FT_Pointer data, - FT_Memory memory ) - { - list->num_nodes = 0; - list->max_nodes = max_nodes; - list->nodes = NULL; - list->clazz = *clazz; - list->data = data; - list->memory = memory; - } - - - FT_EXPORT( void ) - FTC_MruList_Reset( FTC_MruList list ) - { - while ( list->nodes ) - FTC_MruList_Remove( list, list->nodes ); - - FT_ASSERT( list->num_nodes == 0 ); - } - - - FT_EXPORT( void ) - FTC_MruList_Done( FTC_MruList list ) - { - FTC_MruList_Reset( list ); - } - - - FT_EXPORT_DEF( FTC_MruNode ) - FTC_MruList_Find( FTC_MruList list, - FT_Pointer key ) - { - FTC_MruNode_CompareFunc compare = list->clazz.node_compare; - FTC_MruNode first, node; - - - first = list->nodes; - node = NULL; - - if ( first ) - { - node = first; - do - { - if ( compare( node, key ) ) - { - if ( node != first ) - FTC_MruNode_Up( &list->nodes, node ); - - return node; - } - - node = node->next; - - } while ( node != first); - } - - return NULL; - } - - - FT_EXPORT_DEF( FT_Error ) - FTC_MruList_New( FTC_MruList list, - FT_Pointer key, - FTC_MruNode *anode ) - { - FT_Error error; - FTC_MruNode node; - FT_Memory memory = list->memory; - - - if ( list->num_nodes >= list->max_nodes && list->max_nodes > 0 ) - { - node = list->nodes->prev; - - FT_ASSERT( node ); - - if ( list->clazz.node_reset ) - { - FTC_MruNode_Up( &list->nodes, node ); - - error = list->clazz.node_reset( node, key, list->data ); - if ( !error ) - goto Exit; - } - - FTC_MruNode_Remove( &list->nodes, node ); - list->num_nodes--; - - if ( list->clazz.node_done ) - list->clazz.node_done( node, list->data ); - } - else if ( FT_ALLOC( node, list->clazz.node_size ) ) - goto Exit; - - error = list->clazz.node_init( node, key, list->data ); - if ( error ) - goto Fail; - - FTC_MruNode_Prepend( &list->nodes, node ); - list->num_nodes++; - - Exit: - *anode = node; - return error; - - Fail: - if ( list->clazz.node_done ) - list->clazz.node_done( node, list->data ); - - FT_FREE( node ); - goto Exit; - } - - - FT_EXPORT( FT_Error ) - FTC_MruList_Lookup( FTC_MruList list, - FT_Pointer key, - FTC_MruNode *anode ) - { - FTC_MruNode node; - - - node = FTC_MruList_Find( list, key ); - if ( node == NULL ) - return FTC_MruList_New( list, key, anode ); - - *anode = node; - return 0; - } - - - FT_EXPORT_DEF( void ) - FTC_MruList_Remove( FTC_MruList list, - FTC_MruNode node ) - { - FTC_MruNode_Remove( &list->nodes, node ); - list->num_nodes--; - - { - FT_Memory memory = list->memory; - - - if ( list->clazz.node_done ) - list->clazz.node_done( node, list->data ); - - FT_FREE( node ); - } - } - - - FT_EXPORT_DEF( void ) - FTC_MruList_RemoveSelection( FTC_MruList list, - FTC_MruNode_CompareFunc selection, - FT_Pointer key ) - { - FTC_MruNode first, node, next; - - - first = list->nodes; - while ( first && selection( first, key ) ) - { - FTC_MruList_Remove( list, first ); - first = list->nodes; - } - - if ( first ) - { - node = first->next; - while ( node != first ) - { - next = node->next; - - if ( selection( node, key ) ) - FTC_MruList_Remove( list, node ); - - node = next; - } - } - } - - -/* END */ diff --git a/reactos/lib/freetype/src/cache/ftcsbits.c b/reactos/lib/freetype/src/cache/ftcsbits.c index 98f68ee8ca7..2faf80f33ed 100644 Binary files a/reactos/lib/freetype/src/cache/ftcsbits.c and b/reactos/lib/freetype/src/cache/ftcsbits.c differ diff --git a/reactos/lib/freetype/src/cache/rules.mk b/reactos/lib/freetype/src/cache/rules.mk index 154f126dc30..617ca48dae8 100644 --- a/reactos/lib/freetype/src/cache/rules.mk +++ b/reactos/lib/freetype/src/cache/rules.mk @@ -25,9 +25,8 @@ CACHE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CACHE_DIR)) # Cache driver sources (i.e., C files) # -CACHE_DRV_SRC := $(CACHE_DIR)/ftcmru.c \ +CACHE_DRV_SRC := $(CACHE_DIR)/ftlru.c \ $(CACHE_DIR)/ftcmanag.c \ - $(CACHE_DIR)/ftcbasic.c \ $(CACHE_DIR)/ftccache.c \ $(CACHE_DIR)/ftcglyph.c \ $(CACHE_DIR)/ftcsbits.c \ @@ -36,11 +35,10 @@ CACHE_DRV_SRC := $(CACHE_DIR)/ftcmru.c \ # Cache driver headers # -CACHE_DRV_H := $(CACHE_H_DIR)/ftcmru.h \ +CACHE_DRV_H := $(CACHE_H_DIR)/ftlru.h \ $(CACHE_H_DIR)/ftcmanag.h \ $(CACHE_H_DIR)/ftcglyph.h \ $(CACHE_H_DIR)/ftcimage.h \ - $(CACHE_H_DIR)/ftccmap.h \ $(CACHE_DIR)/ftcerror.h diff --git a/reactos/lib/freetype/src/cff/Jamfile b/reactos/lib/freetype/src/cff/Jamfile index dcf24c818a1..cf7cf631336 100644 --- a/reactos/lib/freetype/src/cff/Jamfile +++ b/reactos/lib/freetype/src/cff/Jamfile @@ -1,4 +1,4 @@ -# FreeType 2 src/cff Jamfile (c) 2001, 2002 David Turner +# FreeType 2 src/cff Jamfile (c) 2001 David Turner # SubDir FT2_TOP $(FT2_SRC_DIR) cff ; diff --git a/reactos/lib/freetype/src/cff/cff.c b/reactos/lib/freetype/src/cff/cff.c index e6d8954c9ab..013c329cab3 100644 --- a/reactos/lib/freetype/src/cff/cff.c +++ b/reactos/lib/freetype/src/cff/cff.c @@ -4,7 +4,7 @@ /* */ /* FreeType OpenType driver component (body only). */ /* */ -/* Copyright 1996-2001, 2002 by */ +/* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/reactos/lib/freetype/src/cff/cffcmap.c b/reactos/lib/freetype/src/cff/cffcmap.c index c50718a74a5..5ed9d5dcf9a 100644 --- a/reactos/lib/freetype/src/cff/cffcmap.c +++ b/reactos/lib/freetype/src/cff/cffcmap.c @@ -19,8 +19,6 @@ #include "cffcmap.h" #include "cffload.h" -#include "cfferrs.h" - /*************************************************************************/ /*************************************************************************/ @@ -39,7 +37,7 @@ cmap->gids = encoding->codes; - + return 0; } @@ -60,7 +58,7 @@ if ( char_code < 256 ) result = cmap->gids[char_code]; - + return result; } @@ -71,27 +69,27 @@ { FT_UInt result = 0; FT_UInt32 char_code = *pchar_code; - + *pchar_code = 0; if ( char_code < 255 ) { FT_UInt code = (FT_UInt)(char_code + 1); - + for (;;) { if ( code >= 256 ) break; - + result = cmap->gids[code]; if ( result != 0 ) { *pchar_code = code; break; } - + code++; } } @@ -125,28 +123,28 @@ { FT_UInt32 u1 = ((CFF_CMapUniPair)pair1)->unicode; FT_UInt32 u2 = ((CFF_CMapUniPair)pair2)->unicode; - + if ( u1 < u2 ) return -1; - + if ( u1 > u2 ) return +1; - + return 0; - } + } FT_CALLBACK_DEF( FT_Error ) cff_cmap_unicode_init( CFF_CMapUnicode cmap ) { - FT_Error error; - FT_UInt count; - TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); - FT_Memory memory = FT_FACE_MEMORY( face ); - CFF_Font cff = (CFF_Font)face->extra.data; - CFF_Charset charset = &cff->charset; - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; + FT_Error error; + FT_UInt count; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); + FT_Memory memory = FT_FACE_MEMORY( face ); + CFF_Font cff = (CFF_Font)face->extra.data; + CFF_Charset charset = &cff->charset; + PSNames_Service psnames = (PSNames_Service)cff->psnames; cmap->num_pairs = 0; @@ -169,7 +167,7 @@ gname = cff_index_get_sid_string( &cff->string_index, sid, psnames ); - + /* build unsorted pair table by matching glyph names */ if ( gname ) { @@ -181,7 +179,7 @@ pair->gindex = n; pair++; } - + FT_FREE( gname ); } } @@ -223,7 +221,7 @@ FT_Face face = FT_CMAP_FACE( cmap ); FT_Memory memory = FT_FACE_MEMORY( face ); - + FT_FREE( cmap->pairs ); cmap->num_pairs = 0; } diff --git a/reactos/lib/freetype/src/cff/cffdrivr.c b/reactos/lib/freetype/src/cff/cffdrivr.c index 077d28ec702..54929b7155f 100644 --- a/reactos/lib/freetype/src/cff/cffdrivr.c +++ b/reactos/lib/freetype/src/cff/cffdrivr.c @@ -4,7 +4,7 @@ /* */ /* OpenType font driver implementation (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,19 +22,14 @@ #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_SFNT_H #include FT_TRUETYPE_IDS_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_SERVICE_POSTSCRIPT_INFO_H -#include FT_SERVICE_TT_CMAP_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include "cffdrivr.h" #include "cffgload.h" #include "cffload.h" -#include "cffcmap.h" #include "cfferrs.h" -#include FT_SERVICE_XFREE86_NAME_H -#include FT_SERVICE_GLYPH_DICT_H /*************************************************************************/ /* */ @@ -215,10 +210,17 @@ } - /* - * GLYPH DICT SERVICE - * - */ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** C H A R A C T E R M A P P I N G S ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ static FT_Error cff_get_glyph_name( CFF_Face face, @@ -226,19 +228,21 @@ FT_Pointer buffer, FT_UInt buffer_max ) { - CFF_Font font = (CFF_Font)face->extra.data; - FT_Memory memory = FT_FACE_MEMORY( face ); - FT_String* gname; - FT_UShort sid; - FT_Service_PsCMaps psnames; - FT_Error error; + CFF_Font font = (CFF_Font)face->extra.data; + FT_Memory memory = FT_FACE_MEMORY( face ); + FT_String* gname; + FT_UShort sid; + PSNames_Service psnames; + FT_Error error; - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); + psnames = (PSNames_Service)FT_Get_Module_Interface( + face->root.driver->root.library, "psnames" ); + if ( !psnames ) { FT_ERROR(( "cff_get_glyph_name:" )); - FT_ERROR(( " cannot get glyph name from CFF & CEF fonts\n" )); + FT_ERROR(( " cannot open CFF & CEF fonts\n" )); FT_ERROR(( " " )); FT_ERROR(( " without the `PSNames' module\n" )); error = CFF_Err_Unknown_File_Format; @@ -271,26 +275,42 @@ } + /*************************************************************************/ + /* */ + /* <Function> */ + /* cff_get_name_index */ + /* */ + /* <Description> */ + /* Uses the psnames module and the CFF font's charset to to return a */ + /* a given glyph name's glyph index. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face object. */ + /* */ + /* glyph_name :: The glyph name. */ + /* */ + /* <Return> */ + /* Glyph index. 0 means `undefined character code'. */ + /* */ static FT_UInt cff_get_name_index( CFF_Face face, FT_String* glyph_name ) { - CFF_Font cff; - CFF_Charset charset; - FT_Service_PsCMaps psnames; - FT_Memory memory = FT_FACE_MEMORY( face ); - FT_String* name; - FT_UShort sid; - FT_UInt i; - FT_Int result; + CFF_Font cff; + CFF_Charset charset; + PSNames_Service psnames; + FT_Memory memory = FT_FACE_MEMORY( face ); + FT_String* name; + FT_UShort sid; + FT_UInt i; + FT_Int result; cff = (CFF_FontRec *)face->extra.data; charset = &cff->charset; - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); - if ( !psnames ) - return 0; + psnames = (PSNames_Service)FT_Get_Module_Interface( + face->root.driver->root.library, "psnames" ); for ( i = 0; i < cff->num_glyphs; i++ ) { @@ -314,76 +334,6 @@ } - static const FT_Service_GlyphDictRec cff_service_glyph_dict = - { - (FT_GlyphDict_GetNameFunc) cff_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)cff_get_name_index, - }; - - - /* - * POSTSCRIPT INFO SERVICE - * - */ - - static FT_Int - cff_ps_has_glyph_names( FT_Face face ) - { - return ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) > 0; - } - - - static const FT_Service_PsInfoRec cff_service_ps_info = - { - (PS_GetFontInfoFunc) NULL, /* unsupported with CFF fonts */ - (PS_HasGlyphNamesFunc)cff_ps_has_glyph_names - }; - - - /* - * TT CMAP INFO - * - * If the charmap is a synthetic Unicode encoding cmap or - * a Type 1 standard (or expert) encoding cmap, hide TT CMAP INFO - * service defined in SFNT module. - * - * Otherwise call the service function in the sfnt module. - * - */ - static FT_Error - cff_get_cmap_info( FT_CharMap charmap, - TT_CMapInfo *cmap_info ) - { - FT_CMap cmap = FT_CMAP( charmap ); - FT_Error error = CFF_Err_Ok; - - - cmap_info->language = 0; - - if ( cmap->clazz != &cff_cmap_encoding_class_rec && - cmap->clazz != &cff_cmap_unicode_class_rec ) - { - FT_Face face = FT_CMAP_FACE( cmap ); - FT_Library library = FT_FACE_LIBRARY( face ); - FT_Module sfnt = FT_Get_Module( library, "sfnt" ); - FT_Service_TTCMaps service = ft_module_get_service ( - sfnt, FT_SERVICE_ID_TT_CMAP ); - - - if ( service && service->get_cmap_info ) - error = service->get_cmap_info( charmap, cmap_info ); - } - - return error; - } - - - static const FT_Service_TTCMapsRec cff_service_get_cmap_info = - { - (TT_CMap_Info_GetFunc)cff_get_cmap_info - }; - - /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ @@ -396,31 +346,24 @@ /*************************************************************************/ /*************************************************************************/ - static const FT_ServiceDescRec cff_services[] = - { - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CFF }, - { FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info }, -#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES - { FT_SERVICE_ID_GLYPH_DICT, &cff_service_glyph_dict }, -#endif - { FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info }, - { NULL, NULL } - }; - - static FT_Module_Interface cff_get_interface( CFF_Driver driver, const char* module_interface ) { - FT_Module sfnt; - FT_Module_Interface result; + FT_Module sfnt; - result = ft_service_list_lookup( cff_services, module_interface ); - if ( result != NULL ) - return result; +#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES - /* we pass our request to the `sfnt' module */ + if ( ft_strcmp( (const char*)module_interface, "glyph_name" ) == 0 ) + return (FT_Module_Interface)cff_get_glyph_name; + + if ( ft_strcmp( (const char*)module_interface, "name_index" ) == 0 ) + return (FT_Module_Interface)cff_get_name_index; + +#endif + + /* we simply pass our request to the `sfnt' module */ sfnt = FT_Get_Module( driver->root.root.library, "sfnt" ); return sfnt ? sfnt->clazz->get_interface( sfnt, module_interface ) : 0; diff --git a/reactos/lib/freetype/src/cff/cffgload.c b/reactos/lib/freetype/src/cff/cffgload.c index af2b206a3e2..43d68494147 100644 --- a/reactos/lib/freetype/src/cff/cffgload.c +++ b/reactos/lib/freetype/src/cff/cffgload.c @@ -4,7 +4,7 @@ /* */ /* OpenType Glyph Loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -366,7 +366,7 @@ decoder->num_globals = cff->num_global_subrs; decoder->globals = cff->global_subrs; decoder->globals_bias = cff_compute_bias( decoder->num_globals ); - + decoder->hint_mode = hint_mode; } @@ -398,7 +398,7 @@ } - /* check that there is enough space for `count' more points */ + /* check that there is enough room for `count' more points */ static FT_Error check_points( CFF_Builder* builder, FT_Int count ) @@ -451,7 +451,7 @@ } - /* check space for a new contour, then add it */ + /* check room for a new contour, then add it */ static FT_Error cff_builder_add_contour( CFF_Builder* builder ) { @@ -545,10 +545,6 @@ FT_UShort glyph_sid; - /* CID-keyed fonts don't have glyph names */ - if ( !cff->charset.sids ) - return -1; - /* check range of standard char code */ if ( charcode < 0 || charcode > 255 ) return -1; @@ -644,13 +640,13 @@ FT_Int bchar, FT_Int achar ) { - FT_Error error; - CFF_Builder* builder = &decoder->builder; - FT_Int bchar_index, achar_index; - TT_Face face = decoder->builder.face; - FT_Vector left_bearing, advance; - FT_Byte* charstring; - FT_ULong charstring_len; + FT_Error error; + FT_Int bchar_index, achar_index, n_base_points; + FT_Outline* base = decoder->builder.base; + TT_Face face = decoder->builder.face; + FT_Vector left_bearing, advance; + FT_Byte* charstring; + FT_ULong charstring_len; #ifdef FT_CONFIG_OPTION_INCREMENTAL @@ -680,9 +676,9 @@ /* If we are trying to load a composite glyph, do not load the */ /* accent character and return the array of subglyphs. */ - if ( builder->no_recurse ) + if ( decoder->builder.no_recurse ) { - FT_GlyphSlot glyph = (FT_GlyphSlot)builder->glyph; + FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph; FT_GlyphLoader loader = glyph->internal->loader; FT_SubGlyph subg; @@ -705,8 +701,8 @@ /* subglyph 1 = accent character */ subg->index = achar_index; subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES; - subg->arg1 = (FT_Int)( adx >> 16 ); - subg->arg2 = (FT_Int)( ady >> 16 ); + subg->arg1 = (FT_Int)adx; + subg->arg2 = (FT_Int)ady; /* set up remaining glyph fields */ glyph->num_subglyphs = 2; @@ -716,8 +712,6 @@ loader->current.num_subglyphs = 2; } - FT_GlyphLoader_Prepare( builder->loader ); - /* First load `bchar' in builder */ error = cff_get_glyph_data( face, bchar_index, &charstring, &charstring_len ); @@ -732,17 +726,16 @@ cff_free_glyph_data( face, &charstring, charstring_len ); } + n_base_points = base->n_points; + /* Save the left bearing and width of the base character */ /* as they will be erased by the next load. */ - left_bearing = builder->left_bearing; - advance = builder->advance; + left_bearing = decoder->builder.left_bearing; + advance = decoder->builder.advance; - builder->left_bearing.x = 0; - builder->left_bearing.y = 0; - - builder->pos_x = adx; - builder->pos_y = ady; + decoder->builder.left_bearing.x = 0; + decoder->builder.left_bearing.y = 0; /* Now load `achar' on top of the base outline. */ error = cff_get_glyph_data( face, achar_index, @@ -760,11 +753,20 @@ /* Restore the left side bearing and advance width */ /* of the base character. */ - builder->left_bearing = left_bearing; - builder->advance = advance; + decoder->builder.left_bearing = left_bearing; + decoder->builder.advance = advance; - builder->pos_x = 0; - builder->pos_y = 0; + /* Finally, move the accent. */ + if ( decoder->builder.load_points ) + { + FT_Outline dummy; + + + dummy.n_points = (short)( base->n_points - n_base_points ); + dummy.points = base->points + n_base_points; + + FT_Outline_Translate( &dummy, adx, ady ); + } Exit: return error; @@ -901,7 +903,7 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( !( val & 0xFFFFL ) ) - FT_TRACE4(( " %ld", (FT_Int32)( val >> 16 ) )); + FT_TRACE4(( " %d", (FT_Int32)( val >> 16 ) )); else FT_TRACE4(( " %.2f", val / 65536.0 )); #endif @@ -1221,7 +1223,7 @@ for ( maskbyte = 0; maskbyte < (FT_UInt)(( decoder->num_hints + 7 ) >> 3); maskbyte++, ip++ ) - FT_TRACE4(( "0x%02X", *ip )); + FT_TRACE4(( "%02X", *ip )); } #else ip += ( decoder->num_hints + 7 ) >> 3; @@ -1647,11 +1649,11 @@ case cff_op_flex1: { - FT_Pos start_x, start_y; /* record start x, y values for */ - /* alter use */ - FT_Fixed dx = 0, dy = 0; /* used in horizontal/vertical */ - /* algorithm below */ - FT_Int horizontal, count; + FT_Pos start_x, start_y; /* record start x, y values for alter */ + /* use */ + FT_Int dx = 0, dy = 0; /* used in horizontal/vertical */ + /* algorithm below */ + FT_Int horizontal, count; FT_TRACE4(( " flex1" )); @@ -1673,8 +1675,8 @@ /* grab up to the last argument */ for ( count = 5; count > 0; count-- ) { - dx += args[0]; - dy += args[1]; + dx += (FT_Int)args[0]; + dy += (FT_Int)args[1]; args += 2; } @@ -1730,7 +1732,7 @@ x += args[0]; y += args[1]; cff_builder_add_point( builder, x, y, - (FT_Bool)( count == 4 || count == 1 ) ); + (FT_Bool)( count == 3 || count == 0 ) ); args += 2; } @@ -1745,36 +1747,34 @@ if ( num_args == 4 ) { error = cff_operator_seac( decoder, - args[0], - args[1], + args[0] >> 16, + args[1] >> 16, (FT_Int)( args[2] >> 16 ), (FT_Int)( args[3] >> 16 ) ); args += 4; } - else + + if ( !error ) + error = CFF_Err_Ok; + + cff_builder_close_contour( builder ); + + /* close hints recording session */ + if ( hinter ) { - if ( !error ) - error = CFF_Err_Ok; + if (hinter->close( hinter->hints, builder->current->n_points ) ) + goto Syntax_Error; - cff_builder_close_contour( builder ); - - /* close hints recording session */ - if ( hinter ) - { - if (hinter->close( hinter->hints, builder->current->n_points ) ) - goto Syntax_Error; - - /* apply hints to the loaded glyph outline now */ - hinter->apply( hinter->hints, - builder->current, - (PSH_Globals)builder->hints_globals, - decoder->hint_mode ); - } - - /* add current outline to the glyph slot */ - FT_GlyphLoader_Add( builder->loader ); + /* apply hints to the loaded glyph outline now */ + hinter->apply( hinter->hints, + builder->current, + (PSH_Globals)builder->hints_globals, + decoder->hint_mode ); } + /* add current outline to the glyph slot */ + FT_GlyphLoader_Add( builder->loader ); + /* return now! */ FT_TRACE4(( "\n\n" )); return error; @@ -2315,13 +2315,6 @@ FT_ULong charstring_len; - /* in a CID-keyed font, consider `glyph_index' as a CID and map */ - /* it immediately to the real glyph_index -- if it isn't a */ - /* subsetted font, glyph_indices and CIDs are identical, though */ - if ( cff->top_font.font_dict.cid_registry != 0xFFFFU && - cff->charset.cids ) - glyph_index = cff->charset.cids[glyph_index]; - cff_decoder_init( &decoder, face, size, glyph, hinting, FT_LOAD_TARGET_MODE(load_flags) ); @@ -2369,7 +2362,7 @@ cff_builder_done( &decoder.builder ); } -#ifdef FT_CONFIG_OPTION_INCREMENTAL + #ifdef FT_CONFIG_OPTION_INCREMENTAL /* Incremental fonts can optionally override the metrics. */ if ( !error && @@ -2486,11 +2479,11 @@ if ( hinting ) { - metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance ); - metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance ); + metrics->horiAdvance = ( metrics->horiAdvance + 32 ) & -64; + metrics->vertAdvance = ( metrics->vertAdvance + 32 ) & -64; - metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX ); - metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY ); + metrics->vertBearingX = ( metrics->vertBearingX + 32 ) & -64; + metrics->vertBearingY = ( metrics->vertBearingY + 32 ) & -64; } } diff --git a/reactos/lib/freetype/src/cff/cffload.c b/reactos/lib/freetype/src/cff/cffload.c index bbec294ed91..cc95e790eb5 100644 --- a/reactos/lib/freetype/src/cff/cffload.c +++ b/reactos/lib/freetype/src/cff/cffload.c @@ -4,7 +4,7 @@ /* */ /* OpenType and CFF data/program tables loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -20,7 +20,7 @@ #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_STREAM_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include FT_TRUETYPE_TAGS_H #include "cffload.h" @@ -1172,7 +1172,7 @@ } - /* allocate a table containing pointers to an index's elements */ + /* allocate a table containing pointers to an index's elements */ static FT_Error cff_index_get_pointers( CFF_Index idx, FT_Byte*** table ) @@ -1211,7 +1211,7 @@ FT_Byte** pbytes, FT_ULong* pbyte_len ) { - FT_Error error = CFF_Err_Ok; + FT_Error error = 0; if ( idx && idx->count > element ) @@ -1312,26 +1312,18 @@ FT_LOCAL_DEF( FT_String* ) - cff_index_get_sid_string( CFF_Index idx, - FT_UInt sid, - FT_Service_PsCMaps psnames ) + cff_index_get_sid_string( CFF_Index idx, + FT_UInt sid, + PSNames_Service psnames_service ) { - /* value 0xFFFFU indicates a missing dictionary entry */ - if ( sid == 0xFFFFU ) - return 0; - /* if it is not a standard string, return it */ if ( sid > 390 ) return cff_index_get_name( idx, sid - 391 ); - /* CID-keyed CFF fonts don't have glyph names */ - if ( !psnames ) - return 0; - /* that's a standard string, fetch a copy from the PSName module */ { FT_String* name = 0; - const char* adobe_name = psnames->adobe_std_strings( sid ); + const char* adobe_name = psnames_service->adobe_std_strings( sid ); FT_UInt len; @@ -1501,7 +1493,6 @@ FT_FREE( charset->sids ); - FT_FREE( charset->cids ); charset->format = 0; charset->offset = 0; } @@ -1512,8 +1503,7 @@ FT_UInt num_glyphs, FT_Stream stream, FT_ULong base_offset, - FT_ULong offset, - FT_Bool invert ) + FT_ULong offset ) { FT_Memory memory = stream->memory; FT_Error error = 0; @@ -1613,8 +1603,8 @@ case 0: if ( num_glyphs > 229 ) { - FT_ERROR(( "cff_charset_load: implicit charset larger than\n" - "predefined charset (Adobe ISO-Latin)!\n" )); + FT_ERROR(("cff_charset_load: implicit charset larger than\n" + "predefined charset (Adobe ISO-Latin)!\n" )); error = CFF_Err_Invalid_File_Format; goto Exit; } @@ -1624,7 +1614,8 @@ goto Exit; /* Copy the predefined charset into the allocated memory. */ - FT_ARRAY_COPY( charset->sids, cff_isoadobe_charset, num_glyphs ); + FT_MEM_COPY( charset->sids, cff_isoadobe_charset, + num_glyphs * sizeof ( FT_UShort ) ); break; @@ -1642,7 +1633,8 @@ goto Exit; /* Copy the predefined charset into the allocated memory. */ - FT_ARRAY_COPY( charset->sids, cff_expert_charset, num_glyphs ); + FT_MEM_COPY( charset->sids, cff_expert_charset, + num_glyphs * sizeof ( FT_UShort ) ); break; @@ -1660,7 +1652,8 @@ goto Exit; /* Copy the predefined charset into the allocated memory. */ - FT_ARRAY_COPY( charset->sids, cff_expertsubset_charset, num_glyphs ); + FT_MEM_COPY( charset->sids, cff_expertsubset_charset, + num_glyphs * sizeof ( FT_UShort ) ); break; @@ -1670,36 +1663,17 @@ } } - /* we have to invert the `sids' array for subsetted CID-keyed fonts */ - if ( invert ) - { - FT_UInt i; - FT_UShort max_cid = 0; - - - for ( i = 0; i < num_glyphs; i++ ) - if ( charset->sids[i] > max_cid ) - max_cid = charset->sids[i]; - max_cid++; - - if ( FT_NEW_ARRAY( charset->cids, max_cid ) ) - goto Exit; - FT_MEM_ZERO( charset->cids, sizeof ( FT_UShort ) * max_cid ); - - for ( i = 0; i < num_glyphs; i++ ) - charset->cids[charset->sids[i]] = i; - } - Exit: + /* Clean up if there was an error. */ if ( error ) - { - FT_FREE( charset->sids ); - FT_FREE( charset->cids ); - charset->format = 0; - charset->offset = 0; - charset->sids = 0; - } + if ( charset->sids ) + { + FT_FREE( charset->sids ); + charset->format = 0; + charset->offset = 0; + charset->sids = 0; + } return error; } @@ -1906,12 +1880,15 @@ { case 0: /* First, copy the code to SID mapping. */ - FT_ARRAY_COPY( encoding->sids, cff_standard_encoding, 256 ); + FT_MEM_COPY( encoding->sids, cff_standard_encoding, + 256 * sizeof ( FT_UShort ) ); + goto Populate; case 1: /* First, copy the code to SID mapping. */ - FT_ARRAY_COPY( encoding->sids, cff_expert_encoding, 256 ); + FT_MEM_COPY( encoding->sids, cff_expert_encoding, + 256 * sizeof ( FT_UShort ) ); Populate: /* Construct code to GID mapping from code to SID mapping */ @@ -1972,7 +1949,7 @@ { FT_Error error; CFF_ParserRec parser; - FT_Byte* dict = NULL; + FT_Byte* dict; FT_ULong dict_len; CFF_FontRecDict top = &font->font_dict; CFF_Private priv = &font->private_dict; @@ -1990,20 +1967,6 @@ top->font_matrix.yy = 0x10000L; top->cid_count = 8720; - /* we use the implementation specific SID value 0xFFFF to indicate */ - /* missing entries */ - top->version = 0xFFFFU; - top->notice = 0xFFFFU; - top->copyright = 0xFFFFU; - top->full_name = 0xFFFFU; - top->family_name = 0xFFFFU; - top->weight = 0xFFFFU; - top->embedded_postscript = 0xFFFFU; - - top->cid_registry = 0xFFFFU; - top->cid_ordering = 0xFFFFU; - top->cid_font_name = 0xFFFFU; - error = cff_index_access_element( idx, font_index, &dict, &dict_len ) || cff_parser_run( &parser, dict, dict + dict_len ); @@ -2013,7 +1976,7 @@ goto Exit; /* if it is a CID font, we stop there */ - if ( top->cid_registry != 0xFFFFU ) + if ( top->cid_registry ) goto Exit; /* parse the private dictionary, if any */ @@ -2154,15 +2117,8 @@ if ( error ) goto Exit; - if ( FT_STREAM_SEEK( base_offset + dict->charstrings_offset ) ) - goto Exit; - - error = cff_new_index( &font->charstrings_index, stream, 0 ); - if ( error ) - goto Exit; - /* now, check for a CID font */ - if ( dict->cid_registry != 0xFFFFU ) + if ( dict->cid_registry ) { CFF_IndexRec fd_index; CFF_SubFont sub; @@ -2205,7 +2161,7 @@ /* now load the FD Select array */ error = CFF_Load_FD_Select( &font->fd_select, - font->charstrings_index.count, + (FT_UInt)dict->cid_count, stream, base_offset + dict->cid_fd_select_offset ); @@ -2226,6 +2182,13 @@ goto Exit; } + if ( FT_STREAM_SEEK( base_offset + dict->charstrings_offset ) ) + goto Exit; + + error = cff_new_index( &font->charstrings_index, stream, 0 ); + if ( error ) + goto Exit; + /* explicit the global subrs */ font->num_global_subrs = font->global_subrs_index.count; font->num_glyphs = font->charstrings_index.count; @@ -2236,38 +2199,25 @@ if ( error ) goto Exit; - /* read the Charset and Encoding tables if available */ + /* read the Charset and Encoding tables when available */ if ( font->num_glyphs > 0 ) { - FT_Bool invert; - - - invert = dict->cid_registry != 0xFFFFU && - font->charstrings_index.count != dict->cid_count; error = cff_charset_load( &font->charset, font->num_glyphs, stream, - base_offset, dict->charset_offset, invert ); + base_offset, dict->charset_offset ); if ( error ) goto Exit; - /* CID-keyed CFFs don't have an encoding */ - if ( dict->cid_registry == 0xFFFFU ) - { - error = cff_encoding_load( &font->encoding, - &font->charset, - font->num_glyphs, - stream, - base_offset, - dict->encoding_offset ); - if ( error ) - goto Exit; - } - else - /* CID-keyed fonts only need CIDs */ - FT_FREE( font->charset.sids ); + error = cff_encoding_load( &font->encoding, + &font->charset, + font->num_glyphs, + stream, + base_offset, + dict->encoding_offset ); + if ( error ) + goto Exit; } - /* get the font name (/CIDFontName for CID-keyed fonts, */ - /* /FontName otherwise) */ + /* get the font name */ font->font_name = cff_index_get_name( &font->name_index, face_index ); Exit: diff --git a/reactos/lib/freetype/src/cff/cffload.h b/reactos/lib/freetype/src/cff/cffload.h index ccf8ada1c3c..4cadfe6bbbf 100644 --- a/reactos/lib/freetype/src/cff/cffload.h +++ b/reactos/lib/freetype/src/cff/cffload.h @@ -4,7 +4,7 @@ /* */ /* OpenType & CFF data/program tables loader (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -21,8 +21,8 @@ #include <ft2build.h> -#include "cfftypes.h" -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_CFF_TYPES_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H FT_BEGIN_HEADER @@ -36,9 +36,9 @@ FT_BEGIN_HEADER FT_UInt element ); FT_LOCAL( FT_String* ) - cff_index_get_sid_string( CFF_Index idx, - FT_UInt sid, - FT_Service_PsCMaps psnames ); + cff_index_get_sid_string( CFF_Index idx, + FT_UInt sid, + PSNames_Service psnames_interface ); FT_LOCAL( FT_Error ) @@ -62,7 +62,7 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Byte ) - cff_fd_select_get( CFF_FDSelect fdselect, + cff_fd_select_get( CFF_FDSelect select, FT_UInt glyph_index ); diff --git a/reactos/lib/freetype/src/cff/cffobjs.c b/reactos/lib/freetype/src/cff/cffobjs.c index 6abb84b608c..f0700d1890b 100644 --- a/reactos/lib/freetype/src/cff/cffobjs.c +++ b/reactos/lib/freetype/src/cff/cffobjs.c @@ -24,7 +24,7 @@ #include FT_TRUETYPE_IDS_H #include FT_TRUETYPE_TAGS_H #include FT_INTERNAL_SFNT_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include FT_INTERNAL_POSTSCRIPT_HINTS_H #include "cffobjs.h" #include "cffload.h" @@ -244,6 +244,8 @@ } + + FT_LOCAL_DEF( FT_Error ) cff_face_init( FT_Stream stream, CFF_Face face, @@ -251,37 +253,30 @@ FT_Int num_params, FT_Parameter* params ) { - FT_Error error; - SFNT_Service sfnt; - FT_Service_PsCMaps psnames; - PSHinter_Service pshinter; - FT_Bool pure_cff = 1; - FT_Bool sfnt_format = 0; + FT_Error error; + SFNT_Service sfnt; + PSNames_Service psnames; + PSHinter_Service pshinter; + FT_Bool pure_cff = 1; + FT_Bool sfnt_format = 0; -#if 0 - FT_FACE_FIND_GLOBAL_SERVICE( face, sfnt, SFNT ); - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_NAMES ); - FT_FACE_FIND_GLOBAL_SERVICE( face, pshinter, POSTSCRIPT_HINTER ); - if ( !sfnt ) - goto Bad_Format; -#else sfnt = (SFNT_Service)FT_Get_Module_Interface( face->root.driver->root.library, "sfnt" ); if ( !sfnt ) goto Bad_Format; - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); + psnames = (PSNames_Service)FT_Get_Module_Interface( + face->root.driver->root.library, "psnames" ); pshinter = (PSHinter_Service)FT_Get_Module_Interface( face->root.driver->root.library, "pshinter" ); -#endif /* create input stream from resource */ if ( FT_STREAM_SEEK( 0 ) ) goto Exit; - /* check whether we have a valid OpenType file */ + /* check that we have a valid OpenType file */ error = sfnt->init_face( stream, face, face_index, num_params, params ); if ( !error ) { @@ -298,7 +293,7 @@ sfnt_format = 1; /* now, the font can be either an OpenType/CFF font, or an SVG CEF */ - /* font; in the latter case it doesn't have a `head' table */ + /* font; in the later case it doesn't have a `head' table */ error = face->goto_table( face, TTAG_head, stream, 0 ); if ( !error ) { @@ -312,7 +307,7 @@ } else { - /* load the `cmap' table explicitly */ + /* load the `cmap' table by hand */ error = sfnt->load_charmaps( face, stream ); if ( error ) goto Exit; @@ -322,7 +317,7 @@ /* FreeType 2 */ } - /* now load the CFF part of the file */ + /* now, load the CFF part of the file */ error = face->goto_table( face, TTAG_CFF, stream, 0 ); if ( error ) goto Exit; @@ -337,11 +332,10 @@ /* now load and parse the CFF table in the file */ { - CFF_Font cff; - CFF_FontRecDict dict; - FT_Memory memory = face->root.memory; - FT_Face root; - FT_Int32 flags; + CFF_Font cff; + FT_Memory memory = face->root.memory; + FT_Face root; + FT_Int32 flags; if ( FT_NEW( cff ) ) @@ -353,7 +347,7 @@ goto Exit; cff->pshinter = pshinter; - cff->psnames = (void*)psnames; + cff->psnames = psnames; /* Complement the root flags with some interesting information. */ /* Note that this is only necessary for pure CFF and CEF fonts. */ @@ -361,29 +355,26 @@ root = &face->root; root->num_glyphs = cff->num_glyphs; - dict = &cff->top_font.font_dict; - - /* we need the `PSNames' module for CFF and CEF formats */ - /* which aren't CID-keyed */ - if ( dict->cid_registry == 0xFFFFU && !psnames ) - { - FT_ERROR(( "cff_face_init:" )); - FT_ERROR(( " cannot open CFF & CEF fonts\n" )); - FT_ERROR(( " " )); - FT_ERROR(( " without the `PSNames' module\n" )); - goto Bad_Format; - } - if ( pure_cff ) { - char* style_name = NULL; + CFF_FontRecDict dict = &cff->top_font.font_dict; + /* we need the `PSNames' module for pure-CFF and CEF formats */ + if ( !psnames ) + { + FT_ERROR(( "cff_face_init:" )); + FT_ERROR(( " cannot open CFF & CEF fonts\n" )); + FT_ERROR(( " " )); + FT_ERROR(( " without the `PSNames' module\n" )); + goto Bad_Format; + } + /* Set up num_faces. */ root->num_faces = cff->num_faces; /* compute number of glyphs */ - if ( dict->cid_registry != 0xFFFFU ) + if ( dict->cid_registry ) root->num_glyphs = dict->cid_count; else root->num_glyphs = cff->charstrings_index.count; @@ -394,6 +385,7 @@ root->bbox.xMax = ( dict->font_bbox.xMax + 0xFFFFU ) >> 16; root->bbox.yMax = ( dict->font_bbox.yMax + 0xFFFFU ) >> 16; + root->ascender = (FT_Short)( root->bbox.yMax ); root->descender = (FT_Short)( root->bbox.yMin ); root->height = (FT_Short)( @@ -404,70 +396,17 @@ else root->units_per_EM = 1000; - root->underline_position = - (FT_Short)( dict->underline_position >> 16 ); - root->underline_thickness = - (FT_Short)( dict->underline_thickness >> 16 ); + root->underline_position = dict->underline_position >> 16; + root->underline_thickness = dict->underline_thickness >> 16; /* retrieve font family & style name */ - root->family_name = cff_index_get_name( &cff->name_index, - face_index ); - - if ( root->family_name ) - { - char* full = cff_index_get_sid_string( &cff->string_index, - dict->full_name, - psnames ); - char* fullp = full; - char* family = root->family_name; - - - if ( full ) - { - while ( *fullp ) - { - if ( *fullp == *family ) - { - family++; - fullp++; - } - else - { - if ( *fullp == ' ' || *fullp == '-' ) - fullp++; - else if ( *family == ' ' || *family == '-' ) - family++; - else - { - if ( !*family ) - { - style_name = cff_strcpy( memory, fullp ); - FT_FREE( full ); - } - break; - } - } - } - } - } + root->family_name = cff_index_get_name( &cff->name_index, face_index ); + if ( dict->cid_registry ) + root->style_name = cff_strcpy( memory, "Regular" ); /* XXXX */ else - { - char *cid_font_name = - cff_index_get_sid_string( &cff->string_index, - dict->cid_font_name, - psnames ); - - - /* do we have a `/FontName' for a CID-keyed font? */ - if ( cid_font_name ) - root->family_name = cid_font_name; - } - - if ( style_name ) - root->style_name = style_name; - else - /* assume "Regular" style if we don't know better */ - root->style_name = cff_strcpy( memory, (char *)"Regular" ); + root->style_name = cff_index_get_sid_string( &cff->string_index, + dict->weight, + psnames ); /*******************************************************************/ /* */ @@ -490,6 +429,10 @@ flags |= FT_FACE_FLAG_KERNING; #endif +#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES + flags |= FT_FACE_FLAG_GLYPH_NAMES; +#endif + root->face_flags = flags; /*******************************************************************/ @@ -501,29 +444,13 @@ if ( dict->italic_angle ) flags |= FT_STYLE_FLAG_ITALIC; - { - char *weight = cff_index_get_sid_string( &cff->string_index, - dict->weight, - psnames ); - - - if ( weight ) - if ( !ft_strcmp( weight, "Bold" ) || - !ft_strcmp( weight, "Black" ) ) - flags |= FT_STYLE_FLAG_BOLD; - FT_FREE( weight ); - } + /* XXX: may not be correct */ + if ( cff->top_font.private_dict.force_bold ) + flags |= FT_STYLE_FLAG_BOLD; root->style_flags = flags; } -#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES - /* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */ - /* has unset this flag because of the 3.0 `post' table */ - if ( dict->cid_registry == 0xFFFFU ) - root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES; -#endif - /*******************************************************************/ /* */ /* Compute char maps. */ @@ -552,12 +479,7 @@ goto Skip_Unicode; /* Standard Unicode (deprecated) */ } - /* since CID-keyed fonts don't contain glyph names, we can't */ - /* construct a cmap */ - if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU ) - goto Exit; - - /* we didn't find a Unicode charmap -- synthetize one */ + /* we didn't find a Unicode charmap, synthetize one */ cmaprec.face = root; cmaprec.platform_id = 3; cmaprec.encoding_id = 1; diff --git a/reactos/lib/freetype/src/cff/cffobjs.h b/reactos/lib/freetype/src/cff/cffobjs.h index 49d566550de..cf60ecfb254 100644 --- a/reactos/lib/freetype/src/cff/cffobjs.h +++ b/reactos/lib/freetype/src/cff/cffobjs.h @@ -4,7 +4,7 @@ /* */ /* OpenType objects manager (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,9 +22,9 @@ #include <ft2build.h> #include FT_INTERNAL_OBJECTS_H -#include "cfftypes.h" +#include FT_INTERNAL_CFF_TYPES_H #include FT_INTERNAL_TRUETYPE_TYPES_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H FT_BEGIN_HEADER @@ -89,6 +89,15 @@ FT_BEGIN_HEADER } CFF_Transform; + /* this is only used in the case of a pure CFF font with no charmap */ + typedef struct CFF_CharMapRec_ + { + TT_CharMapRec root; + PS_Unicodes unicodes; + + } CFF_CharMapRec, *CFF_CharMap; + + /***********************************************************************/ /* */ /* TrueType driver class. */ diff --git a/reactos/lib/freetype/src/cff/cffparse.h b/reactos/lib/freetype/src/cff/cffparse.h index 8f3fa588592..2de95a2c5bb 100644 --- a/reactos/lib/freetype/src/cff/cffparse.h +++ b/reactos/lib/freetype/src/cff/cffparse.h @@ -4,7 +4,7 @@ /* */ /* CFF token stream parser (specification) */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -21,7 +21,7 @@ #include <ft2build.h> -#include "cfftypes.h" +#include FT_INTERNAL_CFF_TYPES_H #include FT_INTERNAL_OBJECTS_H diff --git a/reactos/lib/freetype/src/cff/cfftoken.h b/reactos/lib/freetype/src/cff/cfftoken.h index 659d1576aab..65a84683e8f 100644 --- a/reactos/lib/freetype/src/cff/cfftoken.h +++ b/reactos/lib/freetype/src/cff/cfftoken.h @@ -43,10 +43,10 @@ CFF_FIELD_NUM ( 17, charstrings_offset ) CFF_FIELD_CALLBACK( 18, private_dict ) CFF_FIELD_NUM ( 0x114, synthetic_base ) - CFF_FIELD_STRING ( 0x115, embedded_postscript ) + CFF_FIELD_STRING ( 0x115, postscript ) + CFF_FIELD_STRING ( 0x116, base_font_name ) #if 0 - CFF_FIELD_STRING ( 0x116, base_font_name ) CFF_FIELD_DELTA ( 0x117, base_font_blend, 16 ) CFF_FIELD_CALLBACK( 0x118, multiple_master ) CFF_FIELD_CALLBACK( 0x119, blend_axit_types ) diff --git a/reactos/lib/freetype/src/cff/cfftypes.h b/reactos/lib/freetype/src/cff/cfftypes.h deleted file mode 100644 index 9ddc663dea6..00000000000 --- a/reactos/lib/freetype/src/cff/cfftypes.h +++ /dev/null @@ -1,255 +0,0 @@ -/***************************************************************************/ -/* */ -/* cfftypes.h */ -/* */ -/* Basic OpenType/CFF type definitions and interface (specification */ -/* only). */ -/* */ -/* Copyright 1996-2001, 2002, 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __CFFTYPES_H__ -#define __CFFTYPES_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* CFF_IndexRec */ - /* */ - /* <Description> */ - /* A structure used to model a CFF Index table. */ - /* */ - /* <Fields> */ - /* stream :: The source input stream. */ - /* */ - /* count :: The number of elements in the index. */ - /* */ - /* off_size :: The size in bytes of object offsets in index. */ - /* */ - /* data_offset :: The position of first data byte in the index's */ - /* bytes. */ - /* */ - /* offsets :: A table of element offsets in the index. */ - /* */ - /* bytes :: If the index is loaded in memory, its bytes. */ - /* */ - typedef struct CFF_IndexRec_ - { - FT_Stream stream; - FT_UInt count; - FT_Byte off_size; - FT_ULong data_offset; - - FT_ULong* offsets; - FT_Byte* bytes; - - } CFF_IndexRec, *CFF_Index; - - - typedef struct CFF_EncodingRec_ - { - FT_UInt format; - FT_ULong offset; - - FT_UInt count; - FT_UShort sids [256]; /* avoid dynamic allocations */ - FT_UShort codes[256]; - - } CFF_EncodingRec, *CFF_Encoding; - - - typedef struct CFF_CharsetRec_ - { - - FT_UInt format; - FT_ULong offset; - - FT_UShort* sids; - FT_UShort* cids; /* the inverse mapping of `sids'; only needed */ - /* for CID-keyed fonts */ - } CFF_CharsetRec, *CFF_Charset; - - - typedef struct CFF_FontRecDictRec_ - { - FT_UInt version; - FT_UInt notice; - FT_UInt copyright; - FT_UInt full_name; - FT_UInt family_name; - FT_UInt weight; - FT_Bool is_fixed_pitch; - FT_Fixed italic_angle; - FT_Fixed underline_position; - FT_Fixed underline_thickness; - FT_Int paint_type; - FT_Int charstring_type; - FT_Matrix font_matrix; - FT_UShort units_per_em; - FT_Vector font_offset; - FT_ULong unique_id; - FT_BBox font_bbox; - FT_Pos stroke_width; - FT_ULong charset_offset; - FT_ULong encoding_offset; - FT_ULong charstrings_offset; - FT_ULong private_offset; - FT_ULong private_size; - FT_Long synthetic_base; - FT_UInt embedded_postscript; - - /* these should only be used for the top-level font dictionary */ - FT_UInt cid_registry; - FT_UInt cid_ordering; - FT_ULong cid_supplement; - - FT_Long cid_font_version; - FT_Long cid_font_revision; - FT_Long cid_font_type; - FT_ULong cid_count; - FT_ULong cid_uid_base; - FT_ULong cid_fd_array_offset; - FT_ULong cid_fd_select_offset; - FT_UInt cid_font_name; - - } CFF_FontRecDictRec, *CFF_FontRecDict; - - - typedef struct CFF_PrivateRec_ - { - FT_Byte num_blue_values; - FT_Byte num_other_blues; - FT_Byte num_family_blues; - FT_Byte num_family_other_blues; - - FT_Pos blue_values[14]; - FT_Pos other_blues[10]; - FT_Pos family_blues[14]; - FT_Pos family_other_blues[10]; - - FT_Fixed blue_scale; - FT_Pos blue_shift; - FT_Pos blue_fuzz; - FT_Pos standard_width; - FT_Pos standard_height; - - FT_Byte num_snap_widths; - FT_Byte num_snap_heights; - FT_Pos snap_widths[13]; - FT_Pos snap_heights[13]; - FT_Bool force_bold; - FT_Fixed force_bold_threshold; - FT_Int lenIV; - FT_Int language_group; - FT_Fixed expansion_factor; - FT_Long initial_random_seed; - FT_ULong local_subrs_offset; - FT_Pos default_width; - FT_Pos nominal_width; - - } CFF_PrivateRec, *CFF_Private; - - - typedef struct CFF_FDSelectRec_ - { - FT_Byte format; - FT_UInt range_count; - - /* that's the table, taken from the file `as is' */ - FT_Byte* data; - FT_UInt data_size; - - /* small cache for format 3 only */ - FT_UInt cache_first; - FT_UInt cache_count; - FT_Byte cache_fd; - - } CFF_FDSelectRec, *CFF_FDSelect; - - - /* A SubFont packs a font dict and a private dict together. They are */ - /* needed to support CID-keyed CFF fonts. */ - typedef struct CFF_SubFontRec_ - { - CFF_FontRecDictRec font_dict; - CFF_PrivateRec private_dict; - - CFF_IndexRec local_subrs_index; - FT_UInt num_local_subrs; - FT_Byte** local_subrs; - - } CFF_SubFontRec, *CFF_SubFont; - - - /* maximum number of sub-fonts in a CID-keyed file */ -#define CFF_MAX_CID_FONTS 32 - - - typedef struct CFF_FontRec_ - { - FT_Stream stream; - FT_Memory memory; - FT_UInt num_faces; - FT_UInt num_glyphs; - - FT_Byte version_major; - FT_Byte version_minor; - FT_Byte header_size; - FT_Byte absolute_offsize; - - - CFF_IndexRec name_index; - CFF_IndexRec top_dict_index; - CFF_IndexRec string_index; - CFF_IndexRec global_subrs_index; - - CFF_EncodingRec encoding; - CFF_CharsetRec charset; - - CFF_IndexRec charstrings_index; - CFF_IndexRec font_dict_index; - CFF_IndexRec private_index; - CFF_IndexRec local_subrs_index; - - FT_String* font_name; - FT_UInt num_global_subrs; - FT_Byte** global_subrs; - - CFF_SubFontRec top_font; - FT_UInt num_subfonts; - CFF_SubFont subfonts[CFF_MAX_CID_FONTS]; - - CFF_FDSelectRec fd_select; - - /* interface to PostScript hinter */ - void* pshinter; - - /* interface to Postscript Names service */ - void* psnames; - - } CFF_FontRec, *CFF_Font; - - -FT_END_HEADER - -#endif /* __CFFTYPES_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/src/cff/rules.mk b/reactos/lib/freetype/src/cff/rules.mk index 4100c806875..579f144e019 100644 --- a/reactos/lib/freetype/src/cff/rules.mk +++ b/reactos/lib/freetype/src/cff/rules.mk @@ -34,7 +34,6 @@ CFF_DRV_SRC := $(CFF_DIR)/cffobjs.c \ # CFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \ $(CFF_DIR)/cfftoken.h \ - $(CFF_DIR)/cfftypes.h \ $(CFF_DIR)/cfferrs.h diff --git a/reactos/lib/freetype/src/cid/cidgload.c b/reactos/lib/freetype/src/cid/cidgload.c index 4c21097e45e..e07fb717c66 100644 --- a/reactos/lib/freetype/src/cid/cidgload.c +++ b/reactos/lib/freetype/src/cid/cidgload.c @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 Glyph Loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -44,7 +44,7 @@ CID_FaceInfo cid = &face->cid; FT_Byte* p; FT_UInt fd_select; - FT_Stream stream = face->cid_stream; + FT_Stream stream = face->root.stream; FT_Error error = 0; FT_Byte* charstring = 0; FT_Memory memory = face->root.memory; @@ -412,11 +412,11 @@ if ( hinting ) { - metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance ); - metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance ); + metrics->horiAdvance = ( metrics->horiAdvance + 32 ) & -64; + metrics->vertAdvance = ( metrics->vertAdvance + 32 ) & -64; - metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX ); - metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY ); + metrics->vertBearingX = ( metrics->vertBearingX + 32 ) & -64; + metrics->vertBearingY = ( metrics->vertBearingY + 32 ) & -64; } } @@ -426,10 +426,10 @@ /* grid fit the bounding box if necessary */ if ( hinting ) { - cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); - cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); - cbox.xMax = FT_PIX_CEIL( cbox.xMax ); - cbox.yMax = FT_PIX_CEIL( cbox.yMax ); + cbox.xMin &= -64; + cbox.yMin &= -64; + cbox.xMax = ( cbox.xMax + 63 ) & -64; + cbox.yMax = ( cbox.yMax + 63 ) & -64; } metrics->width = cbox.xMax - cbox.xMin; diff --git a/reactos/lib/freetype/src/cid/cidload.c b/reactos/lib/freetype/src/cid/cidload.c index 5b69ba59a57..7b0aba6af9f 100644 --- a/reactos/lib/freetype/src/cid/cidload.c +++ b/reactos/lib/freetype/src/cid/cidload.c @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 font loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -39,7 +39,7 @@ /* read a single offset */ FT_LOCAL_DEF( FT_Long ) - cid_get_offset( FT_Byte* *start, + cid_get_offset( FT_Byte** start, FT_Byte offsize ) { FT_Long result; @@ -164,9 +164,9 @@ temp_scale = ABS( temp[3] ); - /* Set units per EM based on FontMatrix values. We set the value to */ + /* Set Units per EM based on FontMatrix values. We set the value to */ /* `1000/temp_scale', because temp_scale was already multiplied by */ - /* 1000 (in `t1_tofixed', from psobjs.c). */ + /* 1000 (in t1_tofixed(), from psobjs.c). */ root->units_per_EM = (FT_UShort)( FT_DivFix( 0x10000L, FT_DivFix( temp_scale, 1000 ) ) ); @@ -191,7 +191,7 @@ offset->y = temp[5] >> 16; } - return CID_Err_Ok; /* this is a callback function; */ + return CID_Err_Ok; /* this is a callback function; */ /* we must return an error code */ } @@ -258,61 +258,42 @@ parser->root.cursor = base; parser->root.limit = base + size; - parser->root.error = CID_Err_Ok; + parser->root.error = 0; { FT_Byte* cur = base; FT_Byte* limit = cur + size; - for (;;) + for ( ;cur < limit; cur++ ) { - FT_Byte* newlimit; - - - parser->root.cursor = cur; - cid_parser_skip_spaces( parser ); - - if ( parser->root.cursor >= limit ) - newlimit = limit - 1 - 17; - else - newlimit = parser->root.cursor - 17; - /* look for `%ADOBeginFontDict' */ - for ( ; cur < newlimit; cur++ ) + if ( *cur == '%' && cur + 20 < limit && + ft_strncmp( (char*)cur, "%ADOBeginFontDict", 17 ) == 0 ) { - if ( *cur == '%' && - ft_strncmp( (char*)cur, "%ADOBeginFontDict", 17 ) == 0 ) - { - /* if /FDArray was found, then cid->num_dicts is > 0, and */ - /* we can start increasing parser->num_dict */ - if ( face->cid.num_dicts > 0 ) - parser->num_dict++; - } + cur += 17; + + /* if /FDArray was found, then cid->num_dicts is > 0, and */ + /* we can start increasing parser->num_dict */ + if ( face->cid.num_dicts > 0 ) + parser->num_dict++; } - - cur = parser->root.cursor; - /* no error can occur in cid_parser_skip_spaces */ - if ( cur >= limit ) - break; - - cid_parser_skip_PS_token( parser ); - if ( parser->root.cursor >= limit || parser->root.error ) - break; - /* look for immediates */ - if ( *cur == '/' && cur + 2 < limit ) + else if ( *cur == '/' && cur + 2 < limit ) { - FT_PtrDist len; + FT_Int len; cur++; - len = parser->root.cursor - cur; + parser->root.cursor = cur; + cid_parser_skip_alpha( parser ); + + len = (FT_Int)( parser->root.cursor - cur ); if ( len > 0 && len < 22 ) { /* now compare the immediate name to the keyword table */ - T1_Field keyword = (T1_Field)cid_field_records; + T1_Field keyword = (T1_Field) cid_field_records; for (;;) @@ -324,10 +305,10 @@ if ( !name ) break; - if ( cur[0] == name[0] && - len == ft_strlen( (const char*)name ) ) + if ( cur[0] == name[0] && + len == (FT_Int)ft_strlen( (const char*)name ) ) { - FT_PtrDist n; + FT_Int n; for ( n = 1; n < len; n++ ) @@ -337,11 +318,14 @@ if ( n >= len ) { /* we found it - run the parsing callback */ + cid_parser_skip_spaces( parser ); parser->root.error = cid_load_keyword( face, loader, keyword ); if ( parser->root.error ) return parser->root.error; + + cur = parser->root.cursor; break; } } @@ -349,8 +333,6 @@ } } } - - cur = parser->root.cursor; } } return parser->root.error; @@ -363,7 +345,7 @@ { CID_FaceInfo cid = &face->cid; FT_Memory memory = face->root.memory; - FT_Stream stream = face->cid_stream; + FT_Stream stream = face->root.stream; FT_Error error; FT_Int n; CID_Subrs subr; @@ -388,7 +370,7 @@ /* reallocate offsets array if needed */ if ( num_subrs + 1 > max_offsets ) { - FT_UInt new_max = FT_PAD_CEIL( num_subrs + 1, 4 ); + FT_UInt new_max = ( num_subrs + 1 + 3 ) & -4; if ( FT_RENEW_ARRAY( offsets, max_offsets, new_max ) ) @@ -399,7 +381,7 @@ /* read the subrmap's offsets */ if ( FT_STREAM_SEEK( cid->data_offset + dict->subrmap_offset ) || - FT_FRAME_ENTER( ( num_subrs + 1 ) * dict->sd_bytes ) ) + FT_FRAME_ENTER( ( num_subrs + 1 ) * dict->sd_bytes ) ) goto Fail; p = (FT_Byte*)stream->cursor; @@ -487,111 +469,11 @@ } - static FT_Error - cid_hex_to_binary( FT_Byte* data, - FT_Long data_len, - FT_ULong offset, - CID_Face face ) - { - FT_Stream stream = face->root.stream; - FT_Error error; - - FT_Byte buffer[256]; - FT_Byte *p, *plimit; - FT_Byte *d, *dlimit; - FT_Byte val; - - FT_Bool upper_nibble, done; - - - if ( FT_STREAM_SEEK( offset ) ) - goto Exit; - - d = data; - dlimit = d + data_len; - p = buffer; - plimit = p; - - upper_nibble = 1; - done = 0; - - while ( d < dlimit ) - { - if ( p >= plimit ) - { - FT_ULong oldpos = FT_STREAM_POS(); - FT_ULong size = stream->size - oldpos; - - - if ( size == 0 ) - { - error = CID_Err_Syntax_Error; - goto Exit; - } - - if ( FT_STREAM_READ( buffer, 256 > size ? size : 256 ) ) - goto Exit; - p = buffer; - plimit = p + FT_STREAM_POS() - oldpos; - } - - if ( ft_isdigit( *p ) ) - val = *p - '0'; - else if ( *p >= 'a' && *p <= 'f' ) - val = *p - 'a'; - else if ( *p >= 'A' && *p <= 'F' ) - val = *p - 'A' + 10; - else if ( *p == ' ' || - *p == '\t' || - *p == '\r' || - *p == '\n' || - *p == '\f' || - *p == '\0' ) - { - p++; - continue; - } - else if ( *p == '>' ) - { - val = 0; - done = 1; - } - else - { - error = CID_Err_Syntax_Error; - goto Exit; - } - - if ( upper_nibble ) - *d = val << 4; - else - { - *d += val; - d++; - } - - upper_nibble = 1 - upper_nibble; - - if ( done ) - break; - - p++; - } - - error = CID_Err_Ok; - - Exit: - return error; - } - - FT_LOCAL_DEF( FT_Error ) - cid_face_open( CID_Face face, - FT_Int face_index ) + cid_face_open( CID_Face face ) { CID_Loader loader; CID_Parser* parser; - FT_Memory memory = face->root.memory; FT_Error error; @@ -609,30 +491,7 @@ if ( error ) goto Exit; - if ( face_index < 0 ) - goto Exit; - - if ( parser->binary_length ) - { - /* we must convert the data section from hexadecimal to binary */ - if ( FT_ALLOC( face->binary_data, parser->binary_length ) || - cid_hex_to_binary( face->binary_data, parser->binary_length, - parser->data_offset, face ) ) - goto Exit; - - if ( FT_NEW( face->cid_stream ) ) - goto Exit; - - FT_Stream_OpenMemory( face->cid_stream, - face->binary_data, parser->binary_length ); - face->cid.data_offset = 0; - } - else - { - face->cid_stream = face->root.stream; - face->cid.data_offset = loader.parser.data_offset; - } - + face->cid.data_offset = loader.parser.data_offset; error = cid_read_subrs( face ); Exit: diff --git a/reactos/lib/freetype/src/cid/cidload.h b/reactos/lib/freetype/src/cid/cidload.h index 8c172ffee2d..a7f4bceab37 100644 --- a/reactos/lib/freetype/src/cid/cidload.h +++ b/reactos/lib/freetype/src/cid/cidload.h @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 font loader (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -41,8 +41,7 @@ FT_BEGIN_HEADER FT_Byte offsize ); FT_LOCAL( FT_Error ) - cid_face_open( CID_Face face, - FT_Int face_index ); + cid_face_open( CID_Face face ); FT_END_HEADER diff --git a/reactos/lib/freetype/src/cid/cidobjs.c b/reactos/lib/freetype/src/cid/cidobjs.c index 6999217a6f6..313d315055b 100644 --- a/reactos/lib/freetype/src/cid/cidobjs.c +++ b/reactos/lib/freetype/src/cid/cidobjs.c @@ -4,7 +4,7 @@ /* */ /* CID objects manager (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -23,7 +23,7 @@ #include "cidgload.h" #include "cidload.h" -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include FT_INTERNAL_POSTSCRIPT_AUX_H #include FT_INTERNAL_POSTSCRIPT_HINTS_H @@ -199,12 +199,12 @@ if ( face->subrs ) { FT_Int n; - + for ( n = 0; n < cid->num_dicts; n++ ) { CID_Subrs subr = face->subrs + n; - + if ( subr->code ) { @@ -234,9 +234,6 @@ face->root.family_name = 0; face->root.style_name = 0; - - FT_FREE( face->binary_data ); - FT_FREE( face->cid_stream ); } } @@ -271,19 +268,27 @@ FT_Int num_params, FT_Parameter* params ) { - FT_Error error; - FT_Service_PsCMaps psnames; - PSAux_Service psaux; - PSHinter_Service pshinter; + FT_Error error; + PSNames_Service psnames; + PSAux_Service psaux; + PSHinter_Service pshinter; FT_UNUSED( num_params ); FT_UNUSED( params ); + FT_UNUSED( face_index ); FT_UNUSED( stream ); face->root.num_faces = 1; - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); + psnames = (PSNames_Service)face->psnames; + if ( !psnames ) + { + psnames = (PSNames_Service)FT_Get_Module_Interface( + FT_FACE_LIBRARY( face ), "psnames" ); + + face->psnames = psnames; + } psaux = (PSAux_Service)face->psaux; if ( !psaux ) @@ -307,7 +312,7 @@ if ( FT_STREAM_SEEK( 0 ) ) goto Exit; - error = cid_face_open( face, face_index ); + error = cid_face_open( face ); if ( error ) goto Exit; @@ -418,10 +423,8 @@ root->height = (FT_Short)( ( ( root->ascender - root->descender ) * 12 ) / 10 ); - root->underline_position = - (FT_Short)( info->underline_position >> 16 ); - root->underline_thickness = - (FT_Short)( info->underline_thickness >> 16 ); + root->underline_position = info->underline_position >> 16; + root->underline_thickness = info->underline_thickness >> 16; root->internal->max_points = 0; root->internal->max_contours = 0; diff --git a/reactos/lib/freetype/src/cid/cidparse.c b/reactos/lib/freetype/src/cid/cidparse.c index 3f18749f607..397a66ff8f0 100644 --- a/reactos/lib/freetype/src/cid/cidparse.c +++ b/reactos/lib/freetype/src/cid/cidparse.c @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 parser (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -58,8 +58,6 @@ FT_ULong base_offset, offset, ps_len; FT_Byte buffer[256 + 10]; FT_Int buff_len; - FT_Byte *cur, *limit; - FT_Byte *arg1, *arg2; FT_MEM_ZERO( parser, sizeof ( *parser ) ); @@ -69,7 +67,7 @@ base_offset = FT_STREAM_POS(); - /* first of all, check the font format in the header */ + /* first of all, check the font format in the header */ if ( FT_FRAME_ENTER( 31 ) ) goto Exit; @@ -84,17 +82,15 @@ if ( error ) goto Exit; - Again: - /* now, read the rest of the file until we find a `StartData' */ + /* now, read the rest of the file, until we find a `StartData' */ buff_len = 256; for (;;) { - FT_Byte* p; + FT_Byte *p, *limit = buffer + 256; FT_ULong top_position; /* fill input buffer */ - limit = buffer + 256; buff_len -= 256; if ( buff_len > 0 ) FT_MEM_MOVE( buffer, limit, buff_len ); @@ -105,7 +101,7 @@ goto Exit; top_position = FT_STREAM_POS() - buff_len; - buff_len = 256 + 10; + buff_len = 256 + 10; /* look for `StartData' */ for ( p = buffer; p < limit; p++ ) @@ -120,12 +116,12 @@ } Found: - /* we have found the start of the binary data. We will now */ - /* rewind and extract the frame corresponding to the PostScript */ - /* section */ + /* we have found the start of the binary data. We will now */ + /* rewind and extract the frame of corresponding to the Postscript */ + /* section */ ps_len = offset - base_offset; - if ( FT_STREAM_SEEK( base_offset ) || + if ( FT_STREAM_SEEK( base_offset ) || FT_FRAME_EXTRACT( ps_len, parser->postscript ) ) goto Exit; @@ -136,45 +132,6 @@ parser->root.limit = parser->root.cursor + ps_len; parser->num_dict = -1; - /* Finally, we check whether `StartData' was real -- it could be */ - /* in a comment or string. We also get its arguments to find out */ - /* whether the data is represented in binary or hex format. */ - - arg1 = parser->root.cursor; - cid_parser_skip_PS_token( parser ); - cid_parser_skip_spaces ( parser ); - arg2 = parser->root.cursor; - cid_parser_skip_PS_token( parser ); - cid_parser_skip_spaces ( parser ); - - limit = parser->root.limit; - cur = parser->root.cursor; - - while ( cur < limit ) - { - if ( *cur == 'S' && ft_strncmp( (char*)cur, "StartData", 9 ) == 0 ) - { - if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 ) - parser->binary_length = ft_atol( (const char *)arg2 ); - - limit = parser->root.limit; - cur = parser->root.cursor; - goto Exit; - } - - cid_parser_skip_PS_token( parser ); - cid_parser_skip_spaces ( parser ); - arg1 = arg2; - arg2 = cur; - cur = parser->root.cursor; - } - - /* we haven't found the correct `StartData'; go back and continue */ - /* searching */ - FT_FRAME_RELEASE( parser->postscript ); - if ( !FT_STREAM_SEEK( offset ) ) - goto Again; - Exit: return error; } diff --git a/reactos/lib/freetype/src/cid/cidparse.h b/reactos/lib/freetype/src/cid/cidparse.h index ca37deab936..1b3e0b9670a 100644 --- a/reactos/lib/freetype/src/cid/cidparse.h +++ b/reactos/lib/freetype/src/cid/cidparse.h @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 parser (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -50,9 +50,6 @@ FT_BEGIN_HEADER /* data_offset :: The start position of the binary data (i.e., the */ /* end of the data to be parsed. */ /* */ - /* binary_length :: The length of the data after the `StartData' */ - /* command if the data format is hexadecimal. */ - /* */ /* cid :: A structure which holds the information about */ /* the current font. */ /* */ @@ -68,8 +65,6 @@ FT_BEGIN_HEADER FT_ULong data_offset; - FT_Long binary_length; - CID_FaceInfo cid; FT_Int num_dict; @@ -92,10 +87,8 @@ FT_BEGIN_HEADER /* */ /*************************************************************************/ -#define cid_parser_skip_spaces( p ) \ - (p)->root.funcs.skip_spaces( &(p)->root ) -#define cid_parser_skip_PS_token( p ) \ - (p)->root.funcs.skip_PS_token( &(p)->root ) +#define cid_parser_skip_spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) +#define cid_parser_skip_alpha( p ) (p)->root.funcs.skip_alpha ( &(p)->root ) #define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root ) #define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) diff --git a/reactos/lib/freetype/src/cid/cidriver.c b/reactos/lib/freetype/src/cid/cidriver.c index f5639b9f760..471f196379d 100644 --- a/reactos/lib/freetype/src/cid/cidriver.c +++ b/reactos/lib/freetype/src/cid/cidriver.c @@ -21,12 +21,10 @@ #include "cidgload.h" #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include "ciderrs.h" -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_XFREE86_NAME_H -#include FT_SERVICE_POSTSCRIPT_INFO_H /*************************************************************************/ /* */ @@ -38,11 +36,6 @@ #define FT_COMPONENT trace_ciddriver - /* - * POSTSCRIPT NAME SERVICE - * - */ - static const char* cid_get_postscript_name( CID_Face face ) { @@ -56,47 +49,6 @@ } - static const FT_Service_PsFontNameRec cid_service_ps_name = - { - (FT_PsName_GetFunc) cid_get_postscript_name - }; - - - /* - * POSTSCRIPT INFO SERVICE - * - */ - - static FT_Error - cid_ps_get_font_info( FT_Face face, - PS_FontInfoRec* afont_info ) - { - *afont_info = ((CID_Face)face)->cid.font_info; - return 0; - } - - - static const FT_Service_PsInfoRec cid_service_ps_info = - { - (PS_GetFontInfoFunc) cid_ps_get_font_info, - (PS_HasGlyphNamesFunc)NULL /* unsupported with CID fonts */ - }; - - - /* - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec cid_services[] = - { - { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cid_service_ps_name }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CID }, - { FT_SERVICE_ID_POSTSCRIPT_INFO, &cid_service_ps_info }, - { NULL, NULL } - }; - - static FT_Module_Interface cid_get_interface( FT_Driver driver, const FT_String* cid_interface ) @@ -104,7 +56,10 @@ FT_UNUSED( driver ); FT_UNUSED( cid_interface ); - return ft_service_list_lookup( cid_services, cid_interface ); + if ( ft_strcmp( (const char*)cid_interface, "postscript_name" ) == 0 ) + return (FT_Module_Interface)cid_get_postscript_name; + + return 0; } diff --git a/reactos/lib/freetype/src/gzip/adler32.c b/reactos/lib/freetype/src/gzip/adler32.c index f905d083883..337589818fe 100644 --- a/reactos/lib/freetype/src/gzip/adler32.c +++ b/reactos/lib/freetype/src/gzip/adler32.c @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: adler32.c,v 1.4 2004/02/06 21:53:10 rcampbell Exp $ */ +/* @(#) $Id: adler32.c,v 1.5 2004/02/15 21:45:34 gvg Exp $ */ #include "zlib.h" diff --git a/reactos/lib/freetype/src/gzip/infblock.c b/reactos/lib/freetype/src/gzip/infblock.c index d6e2dc297da..8d3e2104296 100644 --- a/reactos/lib/freetype/src/gzip/infblock.c +++ b/reactos/lib/freetype/src/gzip/infblock.c @@ -156,8 +156,7 @@ int r ) uInt bl, bd; inflate_huft *tl, *td; - inflate_trees_fixed(&bl, &bd, (const inflate_huft**)&tl, - (const inflate_huft**)&td, z); + inflate_trees_fixed(&bl, &bd, &tl, &td, z); s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); if (s->sub.decode.codes == Z_NULL) { diff --git a/reactos/lib/freetype/src/gzip/inffixed.h b/reactos/lib/freetype/src/gzip/inffixed.h index 4d4760ea00e..77f7e763145 100644 --- a/reactos/lib/freetype/src/gzip/inffixed.h +++ b/reactos/lib/freetype/src/gzip/inffixed.h @@ -7,9 +7,9 @@ subject to change. Applications should only use zlib.h. */ -local const uInt fixed_bl = 9; -local const uInt fixed_bd = 5; -local const inflate_huft fixed_tl[] = { +local uInt fixed_bl = 9; +local uInt fixed_bd = 5; +local inflate_huft fixed_tl[] = { {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192}, {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160}, @@ -139,7 +139,7 @@ local const inflate_huft fixed_tl[] = { {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191}, {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255} }; -local const inflate_huft fixed_td[] = { +local inflate_huft fixed_td[] = { {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097}, {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385}, {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193}, diff --git a/reactos/lib/freetype/src/gzip/inftrees.c b/reactos/lib/freetype/src/gzip/inftrees.c index 9002bf5b899..2bceb467413 100644 --- a/reactos/lib/freetype/src/gzip/inftrees.c +++ b/reactos/lib/freetype/src/gzip/inftrees.c @@ -401,11 +401,11 @@ local inflate_huft *fixed_td; local int inflate_trees_fixed( /* bl, bd, tl, td, z) */ -uIntf *bl, /* literal desired/actual bit depth */ -uIntf *bd, /* distance desired/actual bit depth */ -const inflate_huft * FAR *tl, /* literal/length tree result */ -const inflate_huft * FAR *td, /* distance tree result */ -z_streamp z /* for memory allocation */ +uIntf *bl, /* literal desired/actual bit depth */ +uIntf *bd, /* distance desired/actual bit depth */ +inflate_huft * FAR *tl, /* literal/length tree result */ +inflate_huft * FAR *td, /* distance tree result */ +z_streamp z /* for memory allocation */ ) { #ifdef BUILDFIXED diff --git a/reactos/lib/freetype/src/gzip/inftrees.h b/reactos/lib/freetype/src/gzip/inftrees.h index 07bf2aa0bf8..92d2f284ef8 100644 --- a/reactos/lib/freetype/src/gzip/inftrees.h +++ b/reactos/lib/freetype/src/gzip/inftrees.h @@ -56,8 +56,8 @@ local int inflate_trees_dynamic OF(( local int inflate_trees_fixed OF(( uIntf *, /* literal desired/actual bit depth */ uIntf *, /* distance desired/actual bit depth */ - const inflate_huft * FAR *, /* literal/length tree result */ - const inflate_huft * FAR *, /* distance tree result */ + inflate_huft * FAR *, /* literal/length tree result */ + inflate_huft * FAR *, /* distance tree result */ z_streamp)); /* for memory allocation */ #endif /* _INFTREES_H */ diff --git a/reactos/lib/freetype/src/gzip/infutil.c b/reactos/lib/freetype/src/gzip/infutil.c index 6087b406473..87358d714cd 100644 --- a/reactos/lib/freetype/src/gzip/infutil.c +++ b/reactos/lib/freetype/src/gzip/infutil.c @@ -11,7 +11,7 @@ /* And'ing with mask[n] masks the lower n bits */ -local const uInt inflate_mask[17] = { +local uInt inflate_mask[17] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff diff --git a/reactos/lib/freetype/src/gzip/zconf.h b/reactos/lib/freetype/src/gzip/zconf.h index 55f29714675..53c21455c5f 100644 --- a/reactos/lib/freetype/src/gzip/zconf.h +++ b/reactos/lib/freetype/src/gzip/zconf.h @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: zconf.h,v 1.4 2004/02/06 21:53:10 rcampbell Exp $ */ +/* @(#) $Id: zconf.h,v 1.5 2004/02/15 21:45:34 gvg Exp $ */ #ifndef _ZCONF_H #define _ZCONF_H diff --git a/reactos/lib/freetype/src/gzip/zutil.c b/reactos/lib/freetype/src/gzip/zutil.c index 3ea92c8561c..032eccdfde7 100644 --- a/reactos/lib/freetype/src/gzip/zutil.c +++ b/reactos/lib/freetype/src/gzip/zutil.c @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: zutil.c,v 1.4 2004/02/06 21:53:10 rcampbell Exp $ */ +/* @(#) $Id: zutil.c,v 1.5 2004/02/15 21:45:34 gvg Exp $ */ #include "zutil.h" diff --git a/reactos/lib/freetype/src/gzip/zutil.h b/reactos/lib/freetype/src/gzip/zutil.h index 259bab8cf4e..206e9241574 100644 --- a/reactos/lib/freetype/src/gzip/zutil.h +++ b/reactos/lib/freetype/src/gzip/zutil.h @@ -8,7 +8,7 @@ subject to change. Applications should only use zlib.h. */ -/* @(#) $Id: zutil.h,v 1.4 2004/02/06 21:53:10 rcampbell Exp $ */ +/* @(#) $Id: zutil.h,v 1.5 2004/02/15 21:45:34 gvg Exp $ */ #ifndef _Z_UTIL_H #define _Z_UTIL_H diff --git a/reactos/lib/freetype/src/pcf/pcfdrivr.c b/reactos/lib/freetype/src/pcf/pcfdrivr.c index 8807332dfdc..3681b1cbfc4 100644 --- a/reactos/lib/freetype/src/pcf/pcfdrivr.c +++ b/reactos/lib/freetype/src/pcf/pcfdrivr.c @@ -44,8 +44,6 @@ THE SOFTWARE. #undef FT_COMPONENT #define FT_COMPONENT trace_pcfread -#include FT_SERVICE_BDF_H -#include FT_SERVICE_XFREE86_NAME_H typedef struct PCF_CMapRec_ { @@ -473,12 +471,6 @@ THE SOFTWARE. } - /* - * - * BDF SERVICE - * - */ - static FT_Error pcf_get_bdf_property( PCF_Face face, const char* prop_name, @@ -511,46 +503,16 @@ THE SOFTWARE. } - static FT_Error - pcf_get_charset_id( PCF_Face face, - const char* *acharset_encoding, - const char* *acharset_registry ) - { - *acharset_encoding = face->charset_encoding; - *acharset_registry = face->charset_registry; - - return 0; - } - - - static FT_Service_BDFRec pcf_service_bdf = - { - (FT_BDF_GetCharsetIdFunc)pcf_get_charset_id, - (FT_BDF_GetPropertyFunc) pcf_get_bdf_property - }; - - - /* - * - * SERVICE LIST - * - */ - - static FT_ServiceDescRec pcf_services[] = - { - { FT_SERVICE_ID_BDF, &pcf_service_bdf }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PCF }, - { NULL, NULL } - }; - - static FT_Module_Interface pcf_driver_requester( FT_Module module, const char* name ) { FT_UNUSED( module ); - return ft_service_list_lookup( pcf_services, name ); + if ( name && ft_strcmp( name, "get_bdf_property" ) == 0 ) + return (FT_Module_Interface) pcf_get_bdf_property; + + return NULL; } diff --git a/reactos/lib/freetype/src/pcf/pcfread.c b/reactos/lib/freetype/src/pcf/pcfread.c index f29512fad48..1b377b5b1e0 100644 --- a/reactos/lib/freetype/src/pcf/pcfread.c +++ b/reactos/lib/freetype/src/pcf/pcfread.c @@ -862,116 +862,6 @@ THE SOFTWARE. } - static FT_Error - pcf_interpret_style( PCF_Face pcf ) - { - FT_Error error = PCF_Err_Ok; - FT_Face face = FT_FACE( pcf ); - FT_Memory memory = face->memory; - - PCF_Property prop; - - char *istr = NULL, *bstr = NULL; - char *sstr = NULL, *astr = NULL; - - int parts = 0, len = 0; - - - face->style_flags = 0; - - prop = pcf_find_property( pcf, "SLANT" ); - if ( prop && prop->isString && - ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' || - *(prop->value.atom) == 'I' || *(prop->value.atom) == 'i' ) ) - { - face->style_flags |= FT_STYLE_FLAG_ITALIC; - istr = ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' ) - ? (char *)"Oblique" - : (char *)"Italic"; - len += ft_strlen( istr ); - parts++; - } - - prop = pcf_find_property( pcf, "WEIGHT_NAME" ); - if ( prop && prop->isString && - ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) ) - { - face->style_flags |= FT_STYLE_FLAG_BOLD; - bstr = (char *)"Bold"; - len += ft_strlen( bstr ); - parts++; - } - - prop = pcf_find_property( pcf, "SETWIDTH_NAME" ); - if ( prop && prop->isString && - *(prop->value.atom) && - !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) - { - sstr = (char *)(prop->value.atom); - len += ft_strlen( sstr ); - parts++; - } - - prop = pcf_find_property( pcf, "ADD_STYLE_NAME" ); - if ( prop && prop->isString && - *(prop->value.atom) && - !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) - { - astr = (char *)(prop->value.atom); - len += ft_strlen( astr ); - parts++; - } - - if ( !parts || !len ) - face->style_name = (char *)"Regular"; - else - { - char *style, *s; - unsigned int i; - - - if ( FT_ALLOC( style, len + parts ) ) - return error; - - s = style; - - if ( astr ) - { - ft_strcpy( s, astr ); - for ( i = 0; i < ft_strlen( astr ); i++, s++ ) - if ( *s == ' ' ) - *s = '-'; /* replace spaces with dashes */ - *(s++) = ' '; - } - if ( bstr ) - { - ft_strcpy( s, bstr ); - s += ft_strlen( bstr ); - *(s++) = ' '; - } - if ( istr ) - { - ft_strcpy( s, istr ); - s += ft_strlen( istr ); - *(s++) = ' '; - } - if ( sstr ) - { - ft_strcpy( s, sstr ); - for ( i = 0; i < ft_strlen( sstr ); i++, s++ ) - if ( *s == ' ' ) - *s = '-'; /* replace spaces with dashes */ - *(s++) = ' '; - } - *(--s) = '\0'; /* overwrite last ' ', terminate the string */ - - face->style_name = style; /* allocated string */ - } - - return error; - } - - FT_LOCAL_DEF( FT_Error ) pcf_load_font( FT_Stream stream, PCF_Face face ) @@ -1040,21 +930,49 @@ THE SOFTWARE. if ( face->accel.constantWidth ) root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; - if ( ( error = pcf_interpret_style( face ) ) != 0 ) - goto Exit; + root->style_flags = 0; + prop = pcf_find_property( face, "SLANT" ); + if ( prop != NULL ) + if ( prop->isString ) + if ( ( *(prop->value.atom) == 'O' ) || + ( *(prop->value.atom) == 'o' ) || + ( *(prop->value.atom) == 'I' ) || + ( *(prop->value.atom) == 'i' ) ) + root->style_flags |= FT_STYLE_FLAG_ITALIC; + + prop = pcf_find_property( face, "WEIGHT_NAME" ); + if ( prop != NULL ) + if ( prop->isString ) + if ( ( *(prop->value.atom) == 'B' ) || + ( *(prop->value.atom) == 'b' ) ) + root->style_flags |= FT_STYLE_FLAG_BOLD; + + root->style_name = (char *)"Regular"; + + if ( root->style_flags & FT_STYLE_FLAG_BOLD ) { + if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) + root->style_name = (char *)"Bold Italic"; + else + root->style_name = (char *)"Bold"; + } + else if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) + root->style_name = (char *)"Italic"; prop = pcf_find_property( face, "FAMILY_NAME" ); - if ( prop && prop->isString ) + if ( prop != NULL ) { - int l = ft_strlen( prop->value.atom ) + 1; + if ( prop->isString ) + { + int l = ft_strlen( prop->value.atom ) + 1; - if ( FT_NEW_ARRAY( root->family_name, l ) ) - goto Exit; - ft_strcpy( root->family_name, prop->value.atom ); + if ( FT_NEW_ARRAY( root->family_name, l ) ) + goto Exit; + ft_strcpy( root->family_name, prop->value.atom ); + } } else - root->family_name = NULL; + root->family_name = 0; /* Note: We shift all glyph indices by +1 since we must * respect the convention that glyph 0 always corresponds @@ -1075,26 +993,26 @@ THE SOFTWARE. FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) ); prop = pcf_find_property( face, "PIXEL_SIZE" ); - if ( prop ) + if ( prop != NULL ) bsize->height = (FT_Short)prop->value.integer; prop = pcf_find_property( face, "AVERAGE_WIDTH" ); - if ( prop ) + if ( prop != NULL ) bsize->width = (FT_Short)( ( prop->value.integer + 5 ) / 10 ); prop = pcf_find_property( face, "POINT_SIZE" ); - if ( prop ) + if ( prop != NULL ) /* convert from 722,7 decipoints to 72 points per inch */ bsize->size = (FT_Pos)( ( prop->value.integer * 64 * 7200 + 36135L ) / 72270L ); prop = pcf_find_property( face, "RESOLUTION_X" ); - if ( prop ) + if ( prop != NULL ) bsize->x_ppem = (FT_Pos)( ( prop->value.integer * bsize->size + 36 ) / 72 ); prop = pcf_find_property( face, "RESOLUTION_Y" ); - if ( prop ) + if ( prop != NULL ) bsize->y_ppem = (FT_Pos)( ( prop->value.integer * bsize->size + 36 ) / 72 ); @@ -1113,19 +1031,23 @@ THE SOFTWARE. charset_registry = pcf_find_property( face, "CHARSET_REGISTRY" ); charset_encoding = pcf_find_property( face, "CHARSET_ENCODING" ); - if ( charset_registry && charset_registry->isString && - charset_encoding && charset_encoding->isString ) + if ( ( charset_registry != NULL ) && + ( charset_encoding != NULL ) ) { - if ( FT_NEW_ARRAY( face->charset_encoding, - ft_strlen( charset_encoding->value.atom ) + 1 ) ) - goto Exit; + if ( ( charset_registry->isString ) && + ( charset_encoding->isString ) ) + { + if ( FT_NEW_ARRAY( face->charset_encoding, + ft_strlen( charset_encoding->value.atom ) + 1 ) ) + goto Exit; - if ( FT_NEW_ARRAY( face->charset_registry, - ft_strlen( charset_registry->value.atom ) + 1 ) ) - goto Exit; + if ( FT_NEW_ARRAY( face->charset_registry, + ft_strlen( charset_registry->value.atom ) + 1 ) ) + goto Exit; - ft_strcpy( face->charset_registry, charset_registry->value.atom ); - ft_strcpy( face->charset_encoding, charset_encoding->value.atom ); + ft_strcpy( face->charset_registry, charset_registry->value.atom ); + ft_strcpy( face->charset_encoding, charset_encoding->value.atom ); + } } } } diff --git a/reactos/lib/freetype/src/pfr/pfrdrivr.c b/reactos/lib/freetype/src/pfr/pfrdrivr.c index 4e0d6fdb472..3935e2e544d 100644 --- a/reactos/lib/freetype/src/pfr/pfrdrivr.c +++ b/reactos/lib/freetype/src/pfr/pfrdrivr.c @@ -19,13 +19,10 @@ #include <ft2build.h> #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H -#include FT_SERVICE_PFR_H -#include FT_SERVICE_XFREE86_NAME_H +#include FT_INTERNAL_PFR_H #include "pfrdrivr.h" #include "pfrobjs.h" -#include "pfrerror.h" - static FT_Error pfr_get_kerning( PFR_Face face, @@ -54,28 +51,23 @@ } - /* - * PFR METRICS SERVICE - * - */ - static FT_Error - pfr_get_advance( PFR_Face face, - FT_UInt gindex, - FT_Pos *anadvance ) + pfr_get_advance( PFR_Face face, + FT_UInt gindex, + FT_Pos *aadvance ) { FT_Error error = PFR_Err_Bad_Argument; - *anadvance = 0; + *aadvance = 0; if ( face ) { - PFR_PhyFont phys = &face->phy_font; + PFR_PhyFont phys = &face->phy_font; if ( gindex < phys->num_chars ) { - *anadvance = phys->chars[gindex].advance; + *aadvance = phys->chars[ gindex ].advance; error = 0; } } @@ -86,18 +78,18 @@ static FT_Error pfr_get_metrics( PFR_Face face, - FT_UInt *anoutline_resolution, + FT_UInt *aoutline_resolution, FT_UInt *ametrics_resolution, FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_y_scale ) { - PFR_PhyFont phys = &face->phy_font; + PFR_PhyFont phys = &face->phy_font; FT_Fixed x_scale, y_scale; FT_Size size = face->root.size; - if ( anoutline_resolution ) - *anoutline_resolution = phys->outline_resolution; + if ( aoutline_resolution ) + *aoutline_resolution = phys->outline_resolution; if ( ametrics_resolution ) *ametrics_resolution = phys->metrics_resolution; @@ -120,42 +112,19 @@ if ( ametrics_y_scale ) *ametrics_y_scale = y_scale; - return PFR_Err_Ok; + return 0; } FT_CALLBACK_TABLE_DEF - const FT_Service_PfrMetricsRec pfr_metrics_service_rec = + const FT_PFR_ServiceRec pfr_service_rec = { - (FT_PFR_GetMetricsFunc)pfr_get_metrics, - (FT_PFR_GetKerningFunc)pfr_face_get_kerning, - (FT_PFR_GetAdvanceFunc)pfr_get_advance + (FT_PFR_GetMetricsFunc) pfr_get_metrics, + (FT_PFR_GetKerningFunc) pfr_get_kerning, + (FT_PFR_GetAdvanceFunc) pfr_get_advance }; - /* - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec pfr_services[] = - { - { FT_SERVICE_ID_PFR_METRICS, &pfr_metrics_service_rec }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PFR }, - { NULL, NULL } - }; - - - static FT_Module_Interface - pfr_get_service( FT_Driver driver, - const FT_String* service_id ) - { - FT_UNUSED( driver ); - - return ft_service_list_lookup( pfr_services, service_id ); - } - - FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec pfr_driver_class = { @@ -169,31 +138,31 @@ 0x10000L, 0x20000L, - NULL, + (FT_PFR_Service) &pfr_service_rec, /* format interface */ (FT_Module_Constructor)NULL, (FT_Module_Destructor) NULL, - (FT_Module_Requester) pfr_get_service + (FT_Module_Requester) NULL }, sizeof( PFR_FaceRec ), sizeof( PFR_SizeRec ), sizeof( PFR_SlotRec ), - (FT_Face_InitFunc) pfr_face_init, - (FT_Face_DoneFunc) pfr_face_done, - (FT_Size_InitFunc) NULL, - (FT_Size_DoneFunc) NULL, - (FT_Slot_InitFunc) pfr_slot_init, - (FT_Slot_DoneFunc) pfr_slot_done, + (FT_Face_InitFunc) pfr_face_init, + (FT_Face_DoneFunc) pfr_face_done, + (FT_Size_InitFunc) NULL, + (FT_Size_DoneFunc) NULL, + (FT_Slot_InitFunc) pfr_slot_init, + (FT_Slot_DoneFunc) pfr_slot_done, - (FT_Size_ResetPointsFunc)NULL, - (FT_Size_ResetPixelsFunc)NULL, - (FT_Slot_LoadFunc) pfr_slot_load, + (FT_Size_ResetPointsFunc) NULL, + (FT_Size_ResetPixelsFunc) NULL, + (FT_Slot_LoadFunc) pfr_slot_load, - (FT_Face_GetKerningFunc) pfr_get_kerning, - (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc)0 + (FT_Face_GetKerningFunc) pfr_get_kerning, + (FT_Face_AttachFunc) 0, + (FT_Face_GetAdvancesFunc) 0 }; diff --git a/reactos/lib/freetype/src/pfr/pfrgload.c b/reactos/lib/freetype/src/pfr/pfrgload.c index 87ba6846e83..cb5c60b88e3 100644 --- a/reactos/lib/freetype/src/pfr/pfrgload.c +++ b/reactos/lib/freetype/src/pfr/pfrgload.c @@ -4,7 +4,7 @@ /* */ /* FreeType PFR glyph loader (body). */ /* */ -/* Copyright 2002, 2003 by */ +/* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -198,7 +198,7 @@ /* indicate that a new contour has started */ glyph->path_begun = 1; - /* check that there is space for a new contour and a new point */ + /* check that there is room for a new contour and a new point */ error = FT_GlyphLoader_CheckPoints( loader, 1, 1 ); if ( !error ) /* add new start point */ @@ -276,7 +276,7 @@ /* re-allocate array when necessary */ if ( count > glyph->max_xy_control ) { - FT_UInt new_max = FT_PAD_CEIL( count, 8 ); + FT_UInt new_max = ( count + 7 ) & -8; if ( FT_RENEW_ARRAY( glyph->x_control, diff --git a/reactos/lib/freetype/src/pfr/pfrload.c b/reactos/lib/freetype/src/pfr/pfrload.c index 19ced45d133..e92ead95b5f 100644 --- a/reactos/lib/freetype/src/pfr/pfrload.c +++ b/reactos/lib/freetype/src/pfr/pfrload.c @@ -365,7 +365,7 @@ /* re-allocate when needed */ if ( phy_font->num_strikes + count > phy_font->max_strikes ) { - FT_UInt new_max = FT_PAD_CEIL( phy_font->num_strikes + count, 4 ); + FT_UInt new_max = ( phy_font->num_strikes + count + 3 ) & -4; if ( FT_RENEW_ARRAY( phy_font->strikes, @@ -511,6 +511,89 @@ } +#if 0 + + /* load kerning pair data */ + FT_CALLBACK_DEF( FT_Error ) + pfr_extra_item_load_kerning_pairs( FT_Byte* p, + FT_Byte* limit, + PFR_PhyFont phy_font ) + { + FT_Int count; + FT_UShort base_adj; + FT_UInt flags; + FT_UInt num_pairs; + PFR_KernPair pairs; + FT_Error error = 0; + FT_Memory memory = phy_font->memory; + + + /* allocate a new kerning item */ + /* XXX: there may be multiple extra items for kerning */ + if ( phy_font->kern_pairs != NULL ) + goto Exit; + + FT_TRACE2(( "pfr_extra_item_load_kerning_pairs()\n" )); + + PFR_CHECK( 4 ); + + num_pairs = PFR_NEXT_BYTE( p ); + base_adj = PFR_NEXT_SHORT( p ); + flags = PFR_NEXT_BYTE( p ); + +#ifndef PFR_CONFIG_NO_CHECKS + count = 3; + + if ( flags & PFR_KERN_2BYTE_CHAR ) + count += 2; + + if ( flags & PFR_KERN_2BYTE_ADJ ) + count += 1; + + PFR_CHECK( num_pairs * count ); +#endif + + if ( FT_NEW_ARRAY( pairs, num_pairs ) ) + goto Exit; + + phy_font->num_kern_pairs = num_pairs; + phy_font->kern_pairs = pairs; + + for (count = num_pairs ; count > 0; count--, pairs++ ) + { + if ( flags & PFR_KERN_2BYTE_CHAR ) + { + pairs->glyph1 = PFR_NEXT_USHORT( p ); + pairs->glyph2 = PFR_NEXT_USHORT( p ); + } + else + { + pairs->glyph1 = PFR_NEXT_BYTE( p ); + pairs->glyph2 = PFR_NEXT_BYTE( p ); + } + + if ( flags & PFR_KERN_2BYTE_ADJ ) + pairs->kerning.x = base_adj + PFR_NEXT_SHORT( p ); + else + pairs->kerning.x = base_adj + PFR_NEXT_INT8( p ); + + pairs->kerning.y = 0; + + FT_TRACE2(( "kerning %d <-> %d : %ld\n", + pairs->glyph1, pairs->glyph2, pairs->kerning.x )); + } + + Exit: + return error; + + Too_Short: + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_extra_item_load_kerning_pairs: " + "invalid kerning pairs table\n" )); + goto Exit; + } + +#else /* 0 */ /* load kerning pair data */ FT_CALLBACK_DEF( FT_Error ) @@ -607,154 +690,15 @@ "invalid kerning pairs table\n" )); goto Exit; } - - - /* - * The kerning data embedded in a PFR font are (charcode,charcode) - * pairs; we need to translate them to (gindex,gindex) and sort - * the resulting array. - */ - static FT_UInt - pfr_get_gindex( PFR_Char chars, - FT_UInt count, - FT_UInt charcode ) - { - FT_UInt min = 0; - FT_UInt max = count; - - - while ( min < max ) - { - FT_UInt mid = ( min + max ) >> 1; - PFR_Char c = chars + mid; - - - if ( c->char_code == charcode ) - return mid + 1; - - if ( c->char_code < charcode ) - min = mid + 1; - else - max = mid; - } - return 0; - } - - - FT_CALLBACK_DEF( int ) - pfr_compare_kern_pairs( const void* pair1, - const void* pair2 ) - { - FT_UInt32 p1 = PFR_KERN_PAIR_INDEX( (PFR_KernPair)pair1 ); - FT_UInt32 p2 = PFR_KERN_PAIR_INDEX( (PFR_KernPair)pair2 ); - - - if ( p1 < p2 ) - return -1; - if ( p1 > p2 ) - return 1; - return 0; - } - - - static FT_Error - pfr_sort_kerning_pairs( FT_Stream stream, - PFR_PhyFont phy_font ) - { - FT_Error error; - FT_Memory memory = stream->memory; - PFR_KernPair pairs; - PFR_KernItem item; - PFR_Char chars = phy_font->chars; - FT_UInt num_chars = phy_font->num_chars; - FT_UInt count; - - - /* create kerning pairs array - */ - if ( FT_NEW_ARRAY( phy_font->kern_pairs, phy_font->num_kern_pairs ) ) - goto Exit; - - /* load all kerning items into the array, - * converting character codes into glyph indices - */ - pairs = phy_font->kern_pairs; - item = phy_font->kern_items; - count = 0; - - for ( ; item; item = item->next ) - { - FT_UInt limit = count + item->pair_count; - FT_Byte* p; - - - if ( limit > phy_font->num_kern_pairs ) - { - error = PFR_Err_Invalid_Table; - goto Exit; - } - - if ( FT_STREAM_SEEK( item->offset ) || - FT_FRAME_ENTER( item->pair_count * item->pair_size ) ) - goto Exit; - - p = stream->cursor; - - for ( ; count < limit; count++ ) - { - PFR_KernPair pair = pairs + count; - FT_UInt char1, char2; - FT_Int kerning; - - - if ( item->flags & PFR_KERN_2BYTE_CHAR ) - { - char1 = FT_NEXT_USHORT( p ); - char2 = FT_NEXT_USHORT( p ); - } - else - { - char1 = FT_NEXT_BYTE( p ); - char2 = FT_NEXT_BYTE( p ); - } - - if ( item->flags & PFR_KERN_2BYTE_ADJ ) - kerning = item->base_adj + FT_NEXT_SHORT( p ); - else - kerning = item->base_adj + FT_NEXT_CHAR( p ); - - pair->glyph1 = pfr_get_gindex( chars, num_chars, char1 ); - pair->glyph2 = pfr_get_gindex( chars, num_chars, char2 ); - pair->kerning = kerning; - } - - FT_FRAME_EXIT(); - } - - /* sort the resulting array - */ - ft_qsort( pairs, count, - sizeof ( PFR_KernPairRec ), - pfr_compare_kern_pairs ); - - Exit: - if ( error ) - { - /* disable kerning data in case of error - */ - phy_font->num_kern_pairs = 0; - } - - return error; - } +#endif /* 0 */ static const PFR_ExtraItemRec pfr_phy_font_extra_items[] = { - { 1, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_bitmap_info }, - { 2, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_font_id }, - { 3, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_stem_snaps }, - { 4, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_kerning_pairs }, + { 1, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_bitmap_info }, + { 2, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_font_id }, + { 3, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_stem_snaps }, + { 4, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_kerning_pairs }, { 0, NULL } }; @@ -826,7 +770,6 @@ FT_FREE( phy_font->blue_values ); phy_font->num_blue_values = 0; - FT_FREE( phy_font->kern_pairs ); { PFR_KernItem item, next; @@ -1065,9 +1008,6 @@ phy_font->bct_offset = FT_STREAM_POS(); phy_font->cursor = NULL; - /* now sort kerning pairs */ - error = pfr_sort_kerning_pairs( stream, phy_font ); - Exit: return error; diff --git a/reactos/lib/freetype/src/pfr/pfrobjs.c b/reactos/lib/freetype/src/pfr/pfrobjs.c index 4c6179aa577..402db95d3d6 100644 --- a/reactos/lib/freetype/src/pfr/pfrobjs.c +++ b/reactos/lib/freetype/src/pfr/pfrobjs.c @@ -419,9 +419,8 @@ { FT_Error error = PFR_Err_Ok; PFR_PhyFont phy_font = &face->phy_font; - PFR_KernPair pairs = phy_font->kern_pairs; + PFR_KernItem item = phy_font->kern_items; FT_UInt32 idx = PFR_KERN_INDEX( glyph1, glyph2 ); - FT_UInt min, max; FT_UNUSED( error ); /* just needed as syntactical sugar */ @@ -429,26 +428,68 @@ kerning->x = 0; kerning->y = 0; - min = 0; - max = phy_font->num_kern_pairs; - - while ( min < max ) + /* find the kerning item containing our pair */ + while ( item ) { - FT_UInt mid = ( min + max ) >> 1; - PFR_KernPair pair = pairs + mid; - FT_UInt32 pidx = PFR_KERN_PAIR_INDEX( pair ); - + if ( item->pair1 <= idx && idx <= item->pair2 ) + goto Found_Item; - if ( pidx == idx ) + item = item->next; + } + + /* not found */ + return; + + Found_Item: + { + /* perform simply binary search within the item */ + FT_UInt min, mid, max; + FT_Stream stream = face->root.stream; + FT_Byte* p; + + + if ( FT_STREAM_SEEK( item->offset ) || + FT_FRAME_ENTER( item->pair_count * item->pair_size ) ) + return; + + min = 0; + max = item->pair_count; + while ( min < max ) { - kerning->x = pair->kerning; - break; + FT_UInt char1, char2, charcode; + + + mid = ( min + max ) >> 1; + p = stream->cursor + mid*item->pair_size; + + if ( item->flags & PFR_KERN_2BYTE_CHAR ) + { + char1 = FT_NEXT_USHORT( p ); + char2 = FT_NEXT_USHORT( p ); + } + else + { + char1 = FT_NEXT_USHORT( p ); + char2 = FT_NEXT_USHORT( p ); + } + charcode = PFR_KERN_INDEX( char1, char2 ); + + if ( idx == charcode ) + { + if ( item->flags & PFR_KERN_2BYTE_ADJ ) + kerning->x = item->base_adj + FT_NEXT_SHORT( p ); + else + kerning->x = item->base_adj + FT_NEXT_CHAR( p ); + + break; + } + if ( idx > charcode ) + min = mid + 1; + else + max = mid; } - - if ( pidx < idx ) - min = mid + 1; - else - max = mid; + + FT_FRAME_EXIT(); } } diff --git a/reactos/lib/freetype/src/pfr/pfrsbit.c b/reactos/lib/freetype/src/pfr/pfrsbit.c index da8fdba337f..84aeb7a047a 100644 --- a/reactos/lib/freetype/src/pfr/pfrsbit.c +++ b/reactos/lib/freetype/src/pfr/pfrsbit.c @@ -635,7 +635,7 @@ glyph->root.metrics.height = (FT_Long)ysize << 6; glyph->root.metrics.horiBearingX = xpos << 6; glyph->root.metrics.horiBearingY = ypos << 6; - glyph->root.metrics.horiAdvance = FT_PIX_ROUND( ( advance >> 2 ) ); + glyph->root.metrics.horiAdvance = ( ( advance >> 2 ) + 32 ) & -64; glyph->root.metrics.vertBearingX = - glyph->root.metrics.width >> 1; glyph->root.metrics.vertBearingY = 0; glyph->root.metrics.vertAdvance = size->root.metrics.height; @@ -651,12 +651,11 @@ error = ft_glyphslot_alloc_bitmap( &glyph->root, len ); if ( !error ) { - error = pfr_load_bitmap_bits( - p, - stream->limit, - format, - FT_BOOL(face->header.color_flags & 2), - &glyph->root.bitmap ); + error = pfr_load_bitmap_bits( p, + stream->limit, + format, + face->header.color_flags & 2, + &glyph->root.bitmap ); } } } diff --git a/reactos/lib/freetype/src/pfr/pfrtypes.h b/reactos/lib/freetype/src/pfr/pfrtypes.h index a10a2b26c8e..21b4e3d2ea9 100644 --- a/reactos/lib/freetype/src/pfr/pfrtypes.h +++ b/reactos/lib/freetype/src/pfr/pfrtypes.h @@ -209,14 +209,11 @@ FT_BEGIN_HEADER #define PFR_KERN_INDEX( g1, g2 ) \ ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) ) -#define PFR_KERN_PAIR_INDEX( pair ) \ - PFR_KERN_INDEX( (pair)->glyph1, (pair)->glyph2 ) - typedef struct PFR_KernPairRec_ { FT_UInt glyph1; FT_UInt glyph2; - FT_Int kerning; + FT_Vector kerning; } PFR_KernPairRec, *PFR_KernPair; @@ -233,7 +230,7 @@ FT_BEGIN_HEADER FT_BBox bbox; FT_UInt flags; FT_UInt standard_advance; - + FT_Int ascent; /* optional, bbox.yMax if not present */ FT_Int descent; /* optional, bbox.yMin if not present */ FT_Int leading; /* optional, 0 if not present */ @@ -261,7 +258,6 @@ FT_BEGIN_HEADER FT_UInt num_kern_pairs; PFR_KernItem kern_items; PFR_KernItem* kern_items_tail; - PFR_KernPair kern_pairs; /* not part of the spec, but used during load */ FT_UInt32 bct_offset; @@ -285,8 +281,8 @@ FT_BEGIN_HEADER typedef enum PFR_KernFlags_ { - PFR_KERN_2BYTE_CHAR = 0x01, - PFR_KERN_2BYTE_ADJ = 0x02 + PFR_KERN_2BYTE_ADJ = 0x01, + PFR_KERN_2BYTE_CHAR = 0x02 } PFR_KernFlags; diff --git a/reactos/lib/freetype/src/psaux/psauxmod.c b/reactos/lib/freetype/src/psaux/psauxmod.c index 756ec1c5652..d6024178b87 100644 --- a/reactos/lib/freetype/src/psaux/psauxmod.c +++ b/reactos/lib/freetype/src/psaux/psauxmod.c @@ -39,7 +39,7 @@ ps_parser_init, ps_parser_done, ps_parser_skip_spaces, - ps_parser_skip_PS_token, + ps_parser_skip_alpha, ps_parser_to_int, ps_parser_to_fixed, ps_parser_to_bytes, diff --git a/reactos/lib/freetype/src/psaux/psobjs.c b/reactos/lib/freetype/src/psaux/psobjs.c index 5ce8721f1c9..fca38baf589 100644 --- a/reactos/lib/freetype/src/psaux/psobjs.c +++ b/reactos/lib/freetype/src/psaux/psobjs.c @@ -142,7 +142,7 @@ /* table :: The target table. */ /* */ /* <Input> */ - /* idx :: The index of the object in the table. */ + /* idx :: The index of the object in the table. */ /* */ /* object :: The address of the object to copy in memory. */ /* */ @@ -181,7 +181,7 @@ /* increase size by 25% and round up to the nearest multiple of 1024 */ new_size += ( new_size >> 2 ) + 1; - new_size = FT_PAD_CEIL( new_size, 1024 ); + new_size = ( new_size + 1023 ) & -1024; } error = reallocate_t1_table( table, new_size ); @@ -267,101 +267,53 @@ /*************************************************************************/ /* In the PostScript Language Reference Manual (PLRM) the following */ - /* characters are called `whitespace characters'. */ + /* characters are called `white-space characters'. */ #define IS_T1_WHITESPACE( c ) ( (c) == ' ' || (c) == '\t' ) #define IS_T1_LINESPACE( c ) ( (c) == '\r' || (c) == '\n' || (c) == '\f' ) #define IS_T1_NULLSPACE( c ) ( (c) == '\0' ) - /* According to the PLRM all whitespace characters are equivalent, */ - /* except in comments and strings. */ + /* According to the PLRM all white-space characters are equivalent, */ + /* except in comments and strings. */ #define IS_T1_SPACE( c ) ( IS_T1_WHITESPACE( c ) || \ IS_T1_LINESPACE( c ) || \ IS_T1_NULLSPACE( c ) ) - /* The following array is used by various functions to quickly convert */ - /* digits (both decimal and non-decimal) into numbers. */ - -#if 'A' == 65 - /* ASCII */ - - char ft_char_table[128] = - { - /* 0x00 */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, - }; - - /* no character >= 0x80 can represent a valid number */ -#define OP >= - -#endif /* 'A' == 65 */ - -#if 'A' == 193 - /* EBCDIC */ - - char ft_char_table[128] = - { - /* 0x80 */ - -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1, - -1, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, - -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1, - -1, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, - -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, - } - - /* no character < 0x80 can represent a valid number */ -#define OP < - -#endif /* 'A' == 193 */ - - - /* first character must be already part of the comment */ - static void - skip_comment( FT_Byte* *acur, - FT_Byte* limit ) - { - FT_Byte* cur = *acur; - - - while ( cur < limit ) - { - if ( IS_T1_LINESPACE( *cur ) ) - break; - cur++; - } - - *acur = cur; - } - - - static void - skip_spaces( FT_Byte* *acur, + skip_spaces( FT_Byte** acur, FT_Byte* limit ) + { + FT_Byte* cur = *acur; + + + while ( cur < limit ) + { + FT_Byte c = *cur; + + + if ( !IS_T1_SPACE( c ) ) + break; + cur++; + } + + *acur = cur; + } + + + static void + skip_alpha( FT_Byte** acur, + FT_Byte* limit ) { FT_Byte* cur = *acur; while ( cur < limit ) { - if ( !IS_T1_SPACE( *cur ) ) - { - if ( *cur == '%' ) - /* According to the PLRM, a comment is equal to a space. */ - skip_comment( &cur, limit ); - else - break; - } + FT_Byte c = *cur; + + + if ( IS_T1_SPACE( c ) ) + break; cur++; } @@ -369,165 +321,6 @@ } - /* first character must be `(' */ - - static void - skip_literal_string( FT_Byte* *acur, - FT_Byte* limit ) - { - FT_Byte* cur = *acur; - FT_Int embed = 0; - - - while ( cur < limit ) - { - if ( *cur == '\\' ) - cur++; - else if ( *cur == '(' ) - embed++; - else if ( *cur == ')' ) - { - embed--; - if ( embed == 0 ) - { - cur++; - break; - } - } - cur++; - } - - *acur = cur; - } - - - /* first character must be `<' */ - - static void - skip_string( PS_Parser parser ) - { - FT_Byte* cur = parser->cursor; - FT_Byte* limit = parser->limit; - - - while ( ++cur < limit ) - { - int d; - - - /* All whitespace characters are ignored. */ - skip_spaces( &cur, limit ); - if ( cur >= limit ) - break; - - if ( *cur OP 0x80 ) - break; - - d = ft_char_table[*cur & 0x7F]; - if ( d < 0 || d >= 16 ) - break; - } - - if ( cur < limit && *cur != '>' ) - parser->error = PSaux_Err_Invalid_File_Format; - else - cur++; - - parser->cursor = cur; - } - - - /***********************************************************************/ - /* */ - /* All exported parsing routines handle leading whitespace and stop at */ - /* the first character which isn't part of the just handled token. */ - /* */ - /***********************************************************************/ - - - FT_LOCAL_DEF( void ) - ps_parser_skip_PS_token( PS_Parser parser ) - { - /* Note: PostScript allows any non-delimiting, non-whitespace */ - /* character in a name (PS Ref Manual, 3rd ed, p31). */ - /* PostScript delimiters are (, ), <, >, [, ], {, }, /, and %. */ - - FT_Byte* cur = parser->cursor; - FT_Byte* limit = parser->limit; - - - skip_spaces( &cur, limit ); /* this also skips comments */ - if ( cur >= limit ) - goto Exit; - - /* self-delimiting, single-character tokens */ - if ( *cur == '[' || *cur == ']' || - *cur == '{' || *cur == '}' ) - { - cur++; - goto Exit; - } - - if ( *cur == '(' ) /* (...) */ - { - skip_literal_string( &cur, limit ); - goto Exit; - } - - if ( *cur == '<' ) /* <...> */ - { - if ( cur + 1 < limit && *(cur + 1) == '<' ) /* << */ - { - cur++; - cur++; - goto Exit; - } - parser->cursor = cur; - skip_string( parser ); - return; - } - - if ( *cur == '>' ) - { - cur++; - if ( cur >= limit || *cur != '>' ) /* >> */ - { - parser->error = PSaux_Err_Invalid_File_Format; - goto Exit; - } - cur++; - goto Exit; - } - - if ( *cur == '/' ) - cur++; - - /* anything else */ - while ( cur < limit ) - { - if ( IS_T1_SPACE( *cur ) || - *cur == '(' || - *cur == '/' || - *cur == '%' || - *cur == '[' || *cur == ']' || - *cur == '{' || *cur == '}' || - *cur == '<' || *cur == '>' ) - break; - - if ( *cur == ')' ) - { - parser->error = PSaux_Err_Invalid_File_Format; - goto Exit; - } - - cur++; - } - - Exit: - parser->cursor = cur; - } - - FT_LOCAL_DEF( void ) ps_parser_skip_spaces( PS_Parser parser ) { @@ -535,8 +328,12 @@ } - /* `token' here means either something between balanced delimiters */ - /* or the next token; the delimiters are not removed. */ + FT_LOCAL_DEF( void ) + ps_parser_skip_alpha( PS_Parser parser ) + { + skip_alpha( &parser->cursor, parser->limit ); + } + FT_LOCAL_DEF( void ) ps_parser_to_token( PS_Parser parser, @@ -552,87 +349,72 @@ token->start = 0; token->limit = 0; - /* first of all, skip leading whitespace */ + /* first of all, skip space */ ps_parser_skip_spaces( parser ); cur = parser->cursor; limit = parser->limit; - if ( cur >= limit ) - return; - - switch ( *cur ) + if ( cur < limit ) { - /************* check for literal string *****************/ - case '(': - token->type = T1_TOKEN_TYPE_STRING; - token->start = cur; - skip_literal_string( &cur, limit ); - if ( cur < limit ) - token->limit = cur; - break; - - /************* check for programs/array *****************/ - case '{': - token->type = T1_TOKEN_TYPE_ARRAY; - ender = '}'; - goto Lookup_Ender; - - /************* check for table/array ********************/ - case '[': - token->type = T1_TOKEN_TYPE_ARRAY; - ender = ']'; - /* fall through */ - - Lookup_Ender: - embed = 1; - starter = *cur; - token->start = cur++; - - /* we need this to catch `[ ]' */ - parser->cursor = cur; - ps_parser_skip_spaces( parser ); - cur = parser->cursor; - - while ( cur < limit && !parser->error ) + switch ( *cur ) { - if ( *cur == starter ) - embed++; - else if ( *cur == ender ) + /************* check for strings ***********************/ + case '(': + token->type = T1_TOKEN_TYPE_STRING; + ender = ')'; + goto Lookup_Ender; + + /************* check for programs/array ****************/ + case '{': + token->type = T1_TOKEN_TYPE_ARRAY; + ender = '}'; + goto Lookup_Ender; + + /************* check for table/array ******************/ + case '[': + token->type = T1_TOKEN_TYPE_ARRAY; + ender = ']'; + + Lookup_Ender: + embed = 1; + starter = *cur++; + token->start = cur; + while ( cur < limit ) { - embed--; - if ( embed <= 0 ) + if ( *cur == starter ) + embed++; + else if ( *cur == ender ) { - token->limit = ++cur; - break; + embed--; + if ( embed <= 0 ) + { + token->limit = cur++; + break; + } } + cur++; } + break; - parser->cursor = cur; - ps_parser_skip_PS_token( parser ); - /* we need this to catch `[XXX ]' */ - ps_parser_skip_spaces ( parser ); - cur = parser->cursor; - } - break; + /* **************** otherwise, it's any token **********/ + default: + token->start = cur++; + token->type = T1_TOKEN_TYPE_ANY; + while ( cur < limit && !IS_T1_SPACE( *cur ) ) + cur++; - /* ************ otherwise, it is any token **************/ - default: - token->start = cur; - token->type = T1_TOKEN_TYPE_ANY; - ps_parser_skip_PS_token( parser ); - cur = parser->cursor; - if ( !parser->error ) token->limit = cur; - } + } - if ( !token->limit ) - { - token->start = 0; - token->type = T1_TOKEN_TYPE_NONE; - } + if ( !token->limit ) + { + token->start = 0; + token->type = T1_TOKEN_TYPE_NONE; + } - parser->cursor = cur; + parser->cursor = cur; + } } @@ -647,9 +429,7 @@ *pnum_tokens = -1; - /* this also handles leading whitespace */ ps_parser_to_token( parser, &master ); - if ( master.type == T1_TOKEN_TYPE_ARRAY ) { FT_Byte* old_cursor = parser->cursor; @@ -658,9 +438,8 @@ T1_Token limit = cur + max_tokens; - /* don't include outermost delimiters */ - parser->cursor = master.start + 1; - parser->limit = master.limit - 1; + parser->cursor = master.start; + parser->limit = master.limit; while ( parser->cursor < parser->limit ) { @@ -685,161 +464,150 @@ } - /* first character must be already part of the number */ - static FT_Long T1Radix( FT_Long radixBase, - FT_Byte* *acur, + FT_Byte** cur, FT_Byte* limit ) { - FT_Long result = 0; - FT_Byte* cur = *acur; + FT_Long result = 0; + FT_Byte radixEndChar0 = + (FT_Byte)( radixBase > 10 ? '9' + 1 : '0' + radixBase ); + FT_Byte radixEndChar1 = + (FT_Byte)( 'A' + radixBase - 10 ); + FT_Byte radixEndChar2 = + (FT_Byte)( 'a' + radixBase - 10 ); - if ( radixBase < 2 || radixBase > 36 ) - return 0; - - while ( cur < limit ) + while( *cur < limit ) { - int d; + if ( (*cur)[0] >= '0' && (*cur)[0] < radixEndChar0 ) + result = result * radixBase + (*cur)[0] - '0'; + else if ( radixBase > 10 && + (*cur)[0] >= 'A' && (*cur)[0] < radixEndChar1 ) + result = result * radixBase + ( (*cur)[0] - 'A' + 10 ); - if ( *cur OP 0x80 ) - break; + else if ( radixBase > 10 && + (*cur)[0] >= 'a' && (*cur)[0] < radixEndChar2 ) + result = result * radixBase + ( (*cur)[0] - 'a' + 10 ); - d = ft_char_table[*cur & 0x7F]; - if ( d < 0 || d >= radixBase ) - break; + else + return result; - result = result * radixBase + d; - - cur++; + (*cur)++; } return result; } - /* first character must be already part of the number */ - static FT_Long - ps_toint( FT_Byte* *acur, + t1_toint( FT_Byte** cursor, FT_Byte* limit ) { FT_Long result = 0; - FT_Byte* cur = *acur; - FT_Byte c; + FT_Byte* cur = *cursor; + FT_Byte c = '\0', d; - if ( cur >= limit ) - goto Exit; - - c = *cur; - if ( c == '-' ) - cur++; - - while ( cur < limit ) + for ( ; cur < limit; cur++ ) { - int d; + c = *cur; + d = (FT_Byte)( c - '0' ); + if ( d < 10 ) + break; - - if ( *cur == '#' ) + if ( c == '-' ) { cur++; - result = T1Radix( result, &cur, limit ); break; } + } - if ( *cur OP 0x80 ) - break; + if ( cur < limit ) + { + do + { + d = (FT_Byte)( cur[0] - '0' ); + if ( d >= 10 ) + { + if ( cur[0] == '#' ) + { + cur++; + result = T1Radix( result, &cur, limit ); + } + break; + } - d = ft_char_table[*cur & 0x7F]; - if ( d < 0 || d >= 10 ) - break; - result = result * 10 + d; + result = result * 10 + d; + cur++; - cur++; - }; + } while ( cur < limit ); - if ( c == '-' ) - result = -result; + if ( c == '-' ) + result = -result; + } - Exit: - *acur = cur; + *cursor = cur; return result; } - /* first character must be `<' if `delimiters' is non-zero */ - + /* <...>: hexadecimal string */ static FT_Error - ps_tobytes( FT_Byte* *acur, + ps_tobytes( FT_Byte** cursor, FT_Byte* limit, - FT_Long max_bytes, + FT_Int max_bytes, FT_Byte* bytes, - FT_Long* pnum_bytes, - FT_Bool delimiters ) + FT_Int* pnum_bytes ) { FT_Error error = PSaux_Err_Ok; - FT_Byte* cur = *acur; - FT_Long n = 0; + FT_Byte* cur = *cursor; + FT_Int n = 0; + FT_Byte b; - if ( cur >= limit ) - goto Exit; + skip_spaces( &cur, limit ); - if ( delimiters ) + if ( *cur != '<' ) { - if ( *cur != '<' ) - { - error = PSaux_Err_Invalid_File_Format; - goto Exit; - } - - cur++; + error = PSaux_Err_Invalid_File_Format; + goto Exit; } - max_bytes = max_bytes * 2; + cur++; - for ( n = 0; cur < limit; n++, cur++ ) + for ( ; cur < limit; n++ ) { - int d; + FT_Byte* cur2 = cur; - if ( n >= max_bytes ) - /* buffer is full */ + if ( n + 1 > max_bytes * 2 ) goto Exit; - /* All whitespace characters are ignored. */ + /* All white-space charcters are ignored. */ skip_spaces( &cur, limit ); - if ( cur >= limit ) - break; - if ( *cur OP 0x80 ) - break; + b = T1Radix( 16, &cur, cur + 1 ); - d = ft_char_table[*cur & 0x7F]; - if ( d < 0 || d >= 16 ) + if ( cur == cur2 ) break; /* <f> == <f0> != <0f> */ - bytes[n / 2] = (FT_Byte)( ( n % 2 ) ? bytes[n / 2] + d - : d * 16 ); + bytes[n / 2] = ( n % 2 ) ? bytes[n / 2] + b + : b * 16; } - if ( delimiters ) + skip_spaces( &cur, limit ); + + if ( *cur != '>' ) { - if ( cur < limit && *cur != '>' ) - { - error = PSaux_Err_Invalid_File_Format; - goto Exit; - } - - cur++; + error = PSaux_Err_Invalid_File_Format; + goto Exit; } - *acur = cur; + *cursor = ++cur; Exit: *pnum_bytes = ( n + 1 ) / 2; @@ -848,23 +616,22 @@ } - /* first character must be already part of the number */ - static FT_Long - ps_tofixed( FT_Byte* *acur, + t1_tofixed( FT_Byte** cursor, FT_Byte* limit, FT_Long power_ten ) { - FT_Byte* cur = *acur; + FT_Byte* cur = *cursor; FT_Long num, divider, result; FT_Int sign = 0; + FT_Byte d; if ( cur >= limit ) return 0; /* first of all, check the sign */ - if ( *cur == '-' && cur + 1 < limit ) + if ( *cur == '-' ) { sign = 1; cur++; @@ -872,7 +639,7 @@ /* then, read the integer part, if any */ if ( *cur != '.' ) - result = ps_toint( &cur, limit ) << 16; + result = t1_toint( &cur, limit ) << 16; else result = 0; @@ -889,14 +656,8 @@ for (;;) { - int d; - - - if ( *cur OP 0x80 ) - break; - - d = ft_char_table[*cur & 0x7F]; - if ( d < 0 || d >= 10 ) + d = (FT_Byte)( *cur - '0' ); + if ( d >= 10 ) break; if ( divider < 10000000L ) @@ -915,7 +676,7 @@ if ( cur + 1 < limit && ( *cur == 'e' || *cur == 'E' ) ) { cur++; - power_ten += ps_toint( &cur, limit ); + power_ten += t1_toint( &cur, limit ); } Exit: @@ -940,20 +701,18 @@ if ( sign ) result = -result; - *acur = cur; + *cursor = cur; return result; } - /* first character must be a delimiter or a part of a number */ - static FT_Int - ps_tocoordarray( FT_Byte* *acur, + t1_tocoordarray( FT_Byte** cursor, FT_Byte* limit, FT_Int max_coords, FT_Short* coords ) { - FT_Byte* cur = *acur; + FT_Byte* cur = *cursor; FT_Int count = 0; FT_Byte c, ender; @@ -961,8 +720,8 @@ if ( cur >= limit ) goto Exit; - /* check for the beginning of an array; otherwise, only one number */ - /* will be read */ + /* check for the beginning of an array; if not, only one number will */ + /* be read */ c = *cur; ender = 0; @@ -976,23 +735,24 @@ cur++; /* now, read the coordinates */ - while ( cur < limit ) + for ( ; cur < limit; ) { /* skip whitespace in front of data */ - skip_spaces( &cur, limit ); - if ( cur >= limit ) - goto Exit; - - if ( count >= max_coords ) - break; - - if ( c == ender ) + for (;;) { + c = *cur; + if ( c != ' ' && c != '\t' ) + break; + cur++; - break; + if ( cur >= limit ) + goto Exit; } - coords[count] = (FT_Short)( ps_tofixed( &cur, limit, 0 ) >> 16 ); + if ( count >= max_coords || c == ender ) + break; + + coords[count] = (FT_Short)( t1_tofixed( &cur, limit, 0 ) >> 16 ); count++; if ( !ender ) @@ -1000,30 +760,27 @@ } Exit: - *acur = cur; + *cursor = cur; return count; } - /* first character must be a delimiter or a part of a number */ - static FT_Int - ps_tofixedarray( FT_Byte* *acur, + t1_tofixedarray( FT_Byte** cursor, FT_Byte* limit, FT_Int max_values, FT_Fixed* values, FT_Int power_ten ) { - FT_Byte* cur = *acur; + FT_Byte* cur = *cursor; FT_Int count = 0; FT_Byte c, ender; - if ( cur >= limit ) - goto Exit; + if ( cur >= limit ) goto Exit; - /* Check for the beginning of an array. Otherwise, only one number */ - /* will be read. */ + /* check for the beginning of an array. If not, only one number will */ + /* be read */ c = *cur; ender = 0; @@ -1037,23 +794,24 @@ cur++; /* now, read the values */ - while ( cur < limit ) + for ( ; cur < limit; ) { /* skip whitespace in front of data */ - skip_spaces( &cur, limit ); - if ( cur >= limit ) - goto Exit; - - if ( count >= max_values ) - break; - - if ( c == ender ) + for (;;) { + c = *cur; + if ( c != ' ' && c != '\t' ) + break; + cur++; - break; + if ( cur >= limit ) + goto Exit; } - values[count] = ps_tofixed( &cur, limit, power_ten ); + if ( count >= max_values || c == ender ) + break; + + values[count] = t1_tofixed( &cur, limit, power_ten ); count++; if ( !ender ) @@ -1061,7 +819,7 @@ } Exit: - *acur = cur; + *cursor = cur; return count; } @@ -1069,7 +827,7 @@ #if 0 static FT_String* - ps_tostring( FT_Byte** cursor, + t1_tostring( FT_Byte** cursor, FT_Byte* limit, FT_Memory memory ) { @@ -1129,41 +887,40 @@ static int - ps_tobool( FT_Byte* *acur, + t1_tobool( FT_Byte** cursor, FT_Byte* limit ) { - FT_Byte* cur = *acur; + FT_Byte* cur = *cursor; FT_Bool result = 0; /* return 1 if we find `true', 0 otherwise */ if ( cur + 3 < limit && - cur[0] == 't' && - cur[1] == 'r' && - cur[2] == 'u' && - cur[3] == 'e' ) + cur[0] == 't' && + cur[1] == 'r' && + cur[2] == 'u' && + cur[3] == 'e' ) { result = 1; cur += 5; } else if ( cur + 4 < limit && - cur[0] == 'f' && - cur[1] == 'a' && - cur[2] == 'l' && - cur[3] == 's' && - cur[4] == 'e' ) + cur[0] == 'f' && + cur[1] == 'a' && + cur[2] == 'l' && + cur[3] == 's' && + cur[4] == 'e' ) { result = 0; cur += 6; } - *acur = cur; + *cursor = cur; return result; } - /* load a simple field (i.e. non-table) into the current list of objects */ - + /* Load a simple field (i.e. non-table) into the current list of objects */ FT_LOCAL_DEF( FT_Error ) ps_parser_load_field( PS_Parser parser, const T1_Field field, @@ -1179,7 +936,6 @@ FT_Error error; - /* this also skips leading whitespace */ ps_parser_to_token( parser, &token ); if ( !token.type ) goto Fail; @@ -1189,7 +945,7 @@ cur = token.start; limit = token.limit; - /* we must detect arrays in /FontBBox */ + /* we must detect arrays */ if ( field->type == T1_FIELD_TYPE_BBOX ) { T1_TokenRec token2; @@ -1197,9 +953,8 @@ FT_Byte* old_limit = parser->limit; - /* don't include delimiters */ - parser->cursor = token.start + 1; - parser->limit = token.limit - 1; + parser->cursor = token.start; + parser->limit = token.limit; ps_parser_to_token( parser, &token2 ); parser->cursor = old_cur; @@ -1211,16 +966,12 @@ else if ( token.type == T1_TOKEN_TYPE_ARRAY ) { FieldArray: - /* if this is an array and we have no blend, an error occurs */ + /* if this is an array, and we have no blend, an error occurs */ if ( max_objects == 0 ) goto Fail; count = max_objects; - idx = 1; - - /* don't include delimiters */ - cur++; - limit--; + idx = 1; } for ( ; count > 0; count--, idx++ ) @@ -1230,25 +981,23 @@ FT_String* string; - skip_spaces( &cur, limit ); - switch ( field->type ) { case T1_FIELD_TYPE_BOOL: - val = ps_tobool( &cur, limit ); + val = t1_tobool( &cur, limit ); goto Store_Integer; case T1_FIELD_TYPE_FIXED: - val = ps_tofixed( &cur, limit, 0 ); + val = t1_tofixed( &cur, limit, 0 ); goto Store_Integer; case T1_FIELD_TYPE_FIXED_1000: - val = ps_tofixed( &cur, limit, 3 ); + val = t1_tofixed( &cur, limit, 3 ); goto Store_Integer; case T1_FIELD_TYPE_INTEGER: - val = ps_toint( &cur, limit ); - /* fall through */ + val = t1_toint( &cur, limit ); + goto Store_Integer; Store_Integer: switch ( field->size ) @@ -1277,25 +1026,15 @@ FT_UInt len = (FT_UInt)( limit - cur ); - if ( cur >= limit ) - break; - - /* with synthetic fonts, it is possible to find a field twice */ + /* with synthetic fonts, it's possible to find a field twice */ if ( *(FT_String**)q ) break; if ( field->type == T1_FIELD_TYPE_KEY ) { - /* don't include leading `/' */ len--; cur++; } - else - { - /* don't include delimiting parentheses */ - cur++; - len -= 2; - } if ( FT_ALLOC( string, len + 1 ) ) goto Exit; @@ -1313,7 +1052,10 @@ FT_BBox* bbox = (FT_BBox*)q; - (void)ps_tofixedarray( &token.start, token.limit, 4, temp, 0 ); + /* we need the '[' and ']' delimiters */ + token.start--; + token.limit++; + (void)t1_tofixedarray( &token.start, token.limit, 4, temp, 0 ); bbox->xMin = FT_RoundFix( temp[0] ); bbox->yMin = FT_RoundFix( temp[1] ); @@ -1328,7 +1070,7 @@ } } -#if 0 /* obsolete -- keep for reference */ +#if 0 /* obsolete - keep for reference */ if ( pflags ) *pflags |= 1L << field->flag_bit; #else @@ -1371,8 +1113,7 @@ fieldrec.type = T1_FIELD_TYPE_FIXED; #endif - ps_parser_to_token_array( parser, elements, - T1_MAX_TABLE_ELEMENTS, &num_elements ); + ps_parser_to_token_array( parser, elements, 32, &num_elements ); if ( num_elements < 0 ) goto Fail; @@ -1418,25 +1159,21 @@ FT_LOCAL_DEF( FT_Long ) ps_parser_to_int( PS_Parser parser ) { - ps_parser_skip_spaces( parser ); - return ps_toint( &parser->cursor, parser->limit ); + return t1_toint( &parser->cursor, parser->limit ); } FT_LOCAL_DEF( FT_Error ) ps_parser_to_bytes( PS_Parser parser, FT_Byte* bytes, - FT_Long max_bytes, - FT_Long* pnum_bytes, - FT_Bool delimiters ) + FT_Int max_bytes, + FT_Int* pnum_bytes ) { - ps_parser_skip_spaces( parser ); return ps_tobytes( &parser->cursor, parser->limit, max_bytes, bytes, - pnum_bytes, - delimiters ); + pnum_bytes ); } @@ -1444,8 +1181,7 @@ ps_parser_to_fixed( PS_Parser parser, FT_Int power_ten ) { - ps_parser_skip_spaces( parser ); - return ps_tofixed( &parser->cursor, parser->limit, power_ten ); + return t1_tofixed( &parser->cursor, parser->limit, power_ten ); } @@ -1454,8 +1190,7 @@ FT_Int max_coords, FT_Short* coords ) { - ps_parser_skip_spaces( parser ); - return ps_tocoordarray( &parser->cursor, parser->limit, + return t1_tocoordarray( &parser->cursor, parser->limit, max_coords, coords ); } @@ -1466,8 +1201,7 @@ FT_Fixed* values, FT_Int power_ten ) { - ps_parser_skip_spaces( parser ); - return ps_tofixedarray( &parser->cursor, parser->limit, + return t1_tofixedarray( &parser->cursor, parser->limit, max_values, values, power_ten ); } @@ -1477,14 +1211,14 @@ FT_LOCAL_DEF( FT_String* ) T1_ToString( PS_Parser parser ) { - return ps_tostring( &parser->cursor, parser->limit, parser->memory ); + return t1_tostring( &parser->cursor, parser->limit, parser->memory ); } FT_LOCAL_DEF( FT_Bool ) T1_ToBool( PS_Parser parser ) { - return ps_tobool( &parser->cursor, parser->limit ); + return t1_tobool( &parser->cursor, parser->limit ); } #endif /* 0 */ @@ -1496,7 +1230,7 @@ FT_Byte* limit, FT_Memory memory ) { - parser->error = PSaux_Err_Ok; + parser->error = 0; parser->base = base; parser->limit = limit; parser->cursor = base; @@ -1670,7 +1404,7 @@ } - /* check space for a new contour, then add it */ + /* check room for a new contour, then add it */ FT_LOCAL_DEF( FT_Error ) t1_builder_add_contour( T1_Builder builder ) { diff --git a/reactos/lib/freetype/src/psaux/psobjs.h b/reactos/lib/freetype/src/psaux/psobjs.h index c2cbf2c79b3..8b214f652ba 100644 --- a/reactos/lib/freetype/src/psaux/psobjs.h +++ b/reactos/lib/freetype/src/psaux/psobjs.h @@ -78,7 +78,7 @@ FT_BEGIN_HEADER ps_parser_skip_spaces( PS_Parser parser ); FT_LOCAL( void ) - ps_parser_skip_PS_token( PS_Parser parser ); + ps_parser_skip_alpha( PS_Parser parser ); FT_LOCAL( void ) ps_parser_to_token( PS_Parser parser, @@ -108,14 +108,6 @@ FT_BEGIN_HEADER ps_parser_to_int( PS_Parser parser ); - FT_LOCAL( FT_Error ) - ps_parser_to_bytes( PS_Parser parser, - FT_Byte* bytes, - FT_Long max_bytes, - FT_Long* pnum_bytes, - FT_Bool delimiters ); - - FT_LOCAL( FT_Fixed ) ps_parser_to_fixed( PS_Parser parser, FT_Int power_ten ); diff --git a/reactos/lib/freetype/src/psaux/t1cmap.c b/reactos/lib/freetype/src/psaux/t1cmap.c index dcd99be49fd..3fdf2ee3ce3 100644 --- a/reactos/lib/freetype/src/psaux/t1cmap.c +++ b/reactos/lib/freetype/src/psaux/t1cmap.c @@ -4,7 +4,7 @@ /* */ /* Type 1 character map support (body). */ /* */ -/* Copyright 2002, 2003 by */ +/* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -35,8 +35,8 @@ t1_cmap_std_init( T1_CMapStd cmap, FT_Int is_expert ) { - T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); + PSNames_Service psnames = (PSNames_Service)face->psnames; cmap->num_glyphs = face->type1.num_glyphs; @@ -263,26 +263,26 @@ { FT_UInt32 u1 = ((T1_CMapUniPair)pair1)->unicode; FT_UInt32 u2 = ((T1_CMapUniPair)pair2)->unicode; - + if ( u1 < u2 ) return -1; - + if ( u1 > u2 ) return +1; - + return 0; - } + } FT_CALLBACK_DEF( FT_Error ) t1_cmap_unicode_init( T1_CMapUnicode cmap ) { - FT_Error error; - FT_UInt count; - T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); - FT_Memory memory = FT_FACE_MEMORY( face ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + FT_Error error; + FT_UInt count; + T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); + FT_Memory memory = FT_FACE_MEMORY( face ); + PSNames_Service psnames = (PSNames_Service)face->psnames; cmap->num_pairs = 0; @@ -316,7 +316,7 @@ } } } - + new_count = (FT_UInt)( pair - cmap->pairs ); if ( new_count == 0 ) { diff --git a/reactos/lib/freetype/src/psaux/t1cmap.h b/reactos/lib/freetype/src/psaux/t1cmap.h index aa93d746c17..0d68c999c12 100644 --- a/reactos/lib/freetype/src/psaux/t1cmap.h +++ b/reactos/lib/freetype/src/psaux/t1cmap.h @@ -4,7 +4,7 @@ /* */ /* Type 1 character map support (specification). */ /* */ -/* Copyright 2002, 2003 by */ +/* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,6 +22,7 @@ #include <ft2build.h> #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_TYPE1_TYPES_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H FT_BEGIN_HEADER @@ -46,16 +47,16 @@ FT_BEGIN_HEADER FT_UInt num_glyphs; const char* const* glyph_names; - + } T1_CMapStdRec; FT_CALLBACK_TABLE const FT_CMap_ClassRec t1_cmap_standard_class_rec; - + FT_CALLBACK_TABLE const FT_CMap_ClassRec t1_cmap_expert_class_rec; - + /*************************************************************************/ /*************************************************************************/ @@ -66,20 +67,20 @@ FT_BEGIN_HEADER /*************************************************************************/ typedef struct T1_CMapCustomRec_* T1_CMapCustom; - + typedef struct T1_CMapCustomRec_ { FT_CMapRec cmap; FT_UInt first; FT_UInt count; FT_UShort* indices; - + } T1_CMapCustomRec; FT_CALLBACK_TABLE const FT_CMap_ClassRec t1_cmap_custom_class_rec; - + /*************************************************************************/ /*************************************************************************/ @@ -96,7 +97,7 @@ FT_BEGIN_HEADER { FT_UInt32 unicode; FT_UInt gindex; - + } T1_CMapUniPairRec, *T1_CMapUniPair; @@ -114,7 +115,7 @@ FT_BEGIN_HEADER /* */ - + FT_END_HEADER #endif /* __T1CMAP_H__ */ diff --git a/reactos/lib/freetype/src/psaux/t1decode.c b/reactos/lib/freetype/src/psaux/t1decode.c index db1911e7bd6..dd8719f12af 100644 --- a/reactos/lib/freetype/src/psaux/t1decode.c +++ b/reactos/lib/freetype/src/psaux/t1decode.c @@ -4,7 +4,7 @@ /* */ /* PostScript Type 1 decoding routines (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004 by */ +/* Copyright 2000-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -125,9 +125,9 @@ t1_lookup_glyph_by_stdcharcode( T1_Decoder decoder, FT_Int charcode ) { - FT_UInt n; - const FT_String* glyph_name; - FT_Service_PsCMaps psnames = decoder->psnames; + FT_UInt n; + const FT_String* glyph_name; + PSNames_Service psnames = decoder->psnames; /* check range of standard char code */ @@ -143,7 +143,7 @@ if ( name && name[0] == glyph_name[0] && - ft_strcmp( name, glyph_name ) == 0 ) + ft_strcmp( name,glyph_name ) == 0 ) return n; } @@ -262,6 +262,10 @@ if ( error ) goto Exit; +#if 0 + n_base_points = base->n_points; +#endif + /* save the left bearing and width of the base character */ /* as they will be erased by the next load. */ @@ -286,8 +290,23 @@ decoder->builder.left_bearing = left_bearing; decoder->builder.advance = advance; + /* XXX: old code doesn't work with PostScript hinter */ +#if 0 + /* Finally, move the accent */ + if ( decoder->builder.load_points ) + { + FT_Outline dummy; + + + dummy.n_points = (short)( base->n_points - n_base_points ); + dummy.points = base->points + n_base_points; + + FT_Outline_Translate( &dummy, adx - asb, ady ); + } +#else decoder->builder.pos_x = 0; decoder->builder.pos_y = 0; +#endif Exit: return error; @@ -1110,10 +1129,11 @@ /* retrieve PSNames interface from list of current modules */ { - FT_Service_PsCMaps psnames = 0; + PSNames_Service psnames = 0; - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); + psnames = (PSNames_Service)FT_Get_Module_Interface( + FT_FACE_LIBRARY(face), "psnames" ); if ( !psnames ) { FT_ERROR(( "t1_decoder_init: " )); diff --git a/reactos/lib/freetype/src/psaux/t1decode.h b/reactos/lib/freetype/src/psaux/t1decode.h index 00728db501e..fcb853ce804 100644 --- a/reactos/lib/freetype/src/psaux/t1decode.h +++ b/reactos/lib/freetype/src/psaux/t1decode.h @@ -4,7 +4,7 @@ /* */ /* PostScript Type 1 decoding routines (specification). */ /* */ -/* Copyright 2000-2001, 2002, 2003 by */ +/* Copyright 2000-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,6 +22,7 @@ #include <ft2build.h> #include FT_INTERNAL_POSTSCRIPT_AUX_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include FT_INTERNAL_TYPE1_TYPES_H diff --git a/reactos/lib/freetype/src/pshinter/Jamfile b/reactos/lib/freetype/src/pshinter/Jamfile index ee02a144be6..bdde744b0ed 100644 --- a/reactos/lib/freetype/src/pshinter/Jamfile +++ b/reactos/lib/freetype/src/pshinter/Jamfile @@ -1,4 +1,4 @@ -# FreeType 2 src/pshinter Jamfile (c) 2001, 2003 David Turner +# FreeType 2 src/pshinter Jamfile (c) 2001 David Turner # SubDir FT2_TOP $(FT2_SRC_DIR) pshinter ; diff --git a/reactos/lib/freetype/src/pshinter/pshalgo.c b/reactos/lib/freetype/src/pshinter/pshalgo.c index 30ad1fbdd7d..3e76529ac92 100644 --- a/reactos/lib/freetype/src/pshinter/pshalgo.c +++ b/reactos/lib/freetype/src/pshinter/pshalgo.c @@ -2,9 +2,9 @@ /* */ /* pshalgo.c */ /* */ -/* PostScript hinting algorithm (body). */ +/* PostScript hinting algorithm 3 (body). */ /* */ -/* Copyright 2001, 2002, 2003, 2004 by */ +/* Copyright 2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -375,11 +375,11 @@ len += delta; } else - len = FT_PIX_ROUND( len ); + len = ( len + 32 ) & -64; } if ( do_snapping ) - len = FT_PIX_ROUND( len ); + len = ( len + 32 ) & -64; return len; } @@ -417,8 +417,8 @@ psh_hint_snap_stem_side_delta( FT_Fixed pos, FT_Fixed len ) { - FT_Fixed delta1 = FT_PIX_ROUND( pos ) - pos; - FT_Fixed delta2 = FT_PIX_ROUND( pos + len ) - pos - len; + FT_Fixed delta1 = ( ( pos + 32 ) & -64 ) - pos; + FT_Fixed delta2 = ( ( pos + len + 32 ) & -64 ) - pos - len; if ( ABS( delta1 ) <= ABS( delta2 ) ) @@ -534,10 +534,10 @@ * around the nearest pixel center */ #if 1 - pos = FT_PIX_FLOOR( pos + ( len >> 1 ) ); + pos = ( pos + ( len >> 1 ) ) & -64; #else /* this seems to be a bug! */ - pos = pos + FT_PIX_FLOOR( len >> 1 ); + pos = ( pos + ( ( len >> 1 ) & -64 ) ); #endif len = 64; } @@ -562,7 +562,7 @@ if ( len < 64 ) len = 64; else - len = FT_PIX_ROUND( len ); + len = ( len + 32 ) & -64; switch ( align.align ) { @@ -583,9 +583,9 @@ default: hint->cur_len = len; if ( len & 64 ) - pos = FT_PIX_FLOOR( pos + ( len >> 1 ) ) + 32; + pos = ( ( pos + ( len >> 1 ) ) & -64 ) + 32; else - pos = FT_PIX_ROUND( pos + ( len >> 1 ) ); + pos = ( pos + ( len >> 1 ) + 32 ) & -64; hint->cur_pos = pos - ( len >> 1 ); hint->cur_len = len; @@ -739,13 +739,13 @@ if ( ( len / 64 ) & 1 ) { - delta_a = FT_PIX_FLOOR( center ) + 32 - center; - delta_b = FT_PIX_ROUND( center ) - center; + delta_a = ( center & -64 ) + 32 - center; + delta_b = ( ( center + 32 ) & - 64 ) - center; } else { - delta_a = FT_PIX_ROUND( center ) - center; - delta_b = FT_PIX_FLOOR( center ) + 32 - center; + delta_a = ( ( center + 32 ) & - 64 ) - center; + delta_b = ( center & -64 ) + 32 - center; } /* We choose between B) and C) above based on the amount @@ -762,6 +762,7 @@ FT_Fixed side_delta = psh_hint_snap_stem_side_delta ( pos, len ); + if ( ABS( side_delta ) < ABS( delta_b ) ) pos += side_delta; else @@ -1110,7 +1111,7 @@ /* clear all fields */ FT_MEM_ZERO( glyph, sizeof ( *glyph ) ); - memory = glyph->memory = globals->memory; + memory = globals->memory; /* allocate and setup points + contours arrays */ if ( FT_NEW_ARRAY( glyph->points, outline->n_points ) || @@ -1217,6 +1218,7 @@ } } + glyph->memory = memory; glyph->outline = outline; glyph->globals = globals; @@ -1938,7 +1940,7 @@ scaled = FT_MulFix( globals->blues.normal_top.zones->org_ref, y_scale ); - fitted = FT_PIX_ROUND( scaled ); + fitted = ( scaled + 32 ) & -64; if (scaled != fitted ) { y_scale = FT_MulDiv( y_scale, fitted, scaled ); diff --git a/reactos/lib/freetype/src/pshinter/pshglob.c b/reactos/lib/freetype/src/pshinter/pshglob.c index 3971c590202..3ae57283cd6 100644 --- a/reactos/lib/freetype/src/pshinter/pshglob.c +++ b/reactos/lib/freetype/src/pshinter/pshglob.c @@ -448,7 +448,7 @@ zone->cur_delta = FT_MulFix( zone->org_delta, scale ); /* round scaled reference position */ - zone->cur_ref = FT_PIX_ROUND( zone->cur_ref ); + zone->cur_ref = ( zone->cur_ref + 32 ) & -64; #if 0 if ( zone->cur_ref > zone->cur_top ) @@ -654,7 +654,7 @@ write->org = priv->standard_height[0]; - write++; + write++; read = priv->snap_heights; for ( count = priv->num_snap_heights; count > 0; count-- ) { diff --git a/reactos/lib/freetype/src/pshinter/pshrec.c b/reactos/lib/freetype/src/pshinter/pshrec.c index 13e0795c564..b0fee3d9530 100644 --- a/reactos/lib/freetype/src/pshinter/pshrec.c +++ b/reactos/lib/freetype/src/pshinter/pshrec.c @@ -68,7 +68,7 @@ if ( new_max > old_max ) { /* try to grow the table */ - new_max = FT_PAD_CEIL( new_max, 8 ); + new_max = ( new_max + 7 ) & -8; if ( !FT_RENEW_ARRAY( table->hints, old_max, new_max ) ) table->max_hints = new_max; } @@ -142,7 +142,7 @@ if ( new_max > old_max ) { - new_max = FT_PAD_CEIL( new_max, 8 ); + new_max = ( new_max + 7 ) & -8; if ( !FT_RENEW_ARRAY( mask->bytes, old_max, new_max ) ) mask->max_bits = new_max * 8; } @@ -239,7 +239,7 @@ if ( new_max > old_max ) { - new_max = FT_PAD_CEIL( new_max, 8 ); + new_max = ( new_max + 7 ) & -8; if ( !FT_RENEW_ARRAY( table->masks, old_max, new_max ) ) table->max_masks = new_max; } @@ -1012,7 +1012,7 @@ FT_ERROR(( "ps_hints_t2mask: " "called with invalid bitcount %d (instead of %d)\n", bit_count, count1 + count2 )); - + /* simply ignore the operator */ return; } @@ -1057,7 +1057,7 @@ FT_ERROR(( "ps_hints_t2counter: " "called with invalid bitcount %d (instead of %d)\n", bit_count, count1 + count2 )); - + /* simply ignore the operator */ return; } diff --git a/reactos/lib/freetype/src/pshinter/pshrec.h b/reactos/lib/freetype/src/pshinter/pshrec.h index 0159e9cd5d7..29d3718901f 100644 --- a/reactos/lib/freetype/src/pshinter/pshrec.h +++ b/reactos/lib/freetype/src/pshinter/pshrec.h @@ -4,7 +4,7 @@ /* */ /* Postscript (Type1/Type2) hints recorder (specification). */ /* */ -/* Copyright 2001, 2002, 2003 by */ +/* Copyright 2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/reactos/lib/freetype/src/psnames/psmodule.c b/reactos/lib/freetype/src/psnames/psmodule.c index f6d6ae3285c..af364285c09 100644 --- a/reactos/lib/freetype/src/psnames/psmodule.c +++ b/reactos/lib/freetype/src/psnames/psmodule.c @@ -17,8 +17,8 @@ #include <ft2build.h> +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H #include "psmodule.h" #include "pstables.h" @@ -176,10 +176,10 @@ /* Builds a table that maps Unicode values to glyph indices */ static FT_Error - ps_unicodes_init( FT_Memory memory, - FT_UInt num_glyphs, - const char** glyph_names, - PS_Unicodes* table ) + ps_build_unicode_table( FT_Memory memory, + FT_UInt num_glyphs, + const char** glyph_names, + PS_Unicodes* table ) { FT_Error error; @@ -242,8 +242,8 @@ static FT_UInt - ps_unicodes_char_index( PS_Unicodes* table, - FT_ULong unicode ) + ps_lookup_unicode( PS_Unicodes* table, + FT_ULong unicode ) { PS_UniMap *min, *max, *mid; @@ -273,8 +273,8 @@ static FT_ULong - ps_unicodes_char_next( PS_Unicodes* table, - FT_ULong unicode ) + ps_next_unicode( PS_Unicodes* table, + FT_ULong unicode ) { PS_UniMap *min, *max, *mid; @@ -335,52 +335,40 @@ static - const FT_Service_PsCMapsRec pscmaps_interface = + const PSNames_Interface psnames_interface = { #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST - (PS_Unicode_ValueFunc) ps_unicode_value, - (PS_Unicodes_InitFunc) ps_unicodes_init, - (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index, - (PS_Unicodes_CharNextFunc) ps_unicodes_char_next, + (PS_Unicode_Value_Func) ps_unicode_value, + (PS_Build_Unicodes_Func) ps_build_unicode_table, + (PS_Lookup_Unicode_Func) ps_lookup_unicode, #else 0, 0, 0, - 0, #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ - (PS_Macintosh_Name_Func) ps_get_macintosh_name, - (PS_Adobe_Std_Strings_Func)ps_get_standard_strings, + (PS_Macintosh_Name_Func) ps_get_macintosh_name, + (PS_Adobe_Std_Strings_Func) ps_get_standard_strings, t1_standard_encoding, - t1_expert_encoding + t1_expert_encoding, + +#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + (PS_Next_Unicode_Func) ps_next_unicode +#else + 0 +#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ + }; - static const FT_ServiceDescRec pscmaps_services[] = - { - { FT_SERVICE_ID_POSTSCRIPT_CMAPS, &pscmaps_interface }, - { NULL, NULL } - }; - - - static FT_Pointer - psnames_get_service( FT_Module module, - const char* service_id ) - { - FT_UNUSED( module ); - - return ft_service_list_lookup( pscmaps_services, service_id ); - } - #endif /* !FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES */ - FT_CALLBACK_TABLE_DEF const FT_Module_Class psnames_module_class = { @@ -393,15 +381,13 @@ #ifdef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES 0, +#else + (void*)&psnames_interface, /* module specific interface */ +#endif + (FT_Module_Constructor)0, (FT_Module_Destructor) 0, (FT_Module_Requester) 0 -#else - (void*)&pscmaps_interface, /* module specific interface */ - (FT_Module_Constructor)0, - (FT_Module_Destructor) 0, - (FT_Module_Requester) psnames_get_service -#endif }; diff --git a/reactos/lib/freetype/src/raster/ftrend1.c b/reactos/lib/freetype/src/raster/ftrend1.c index a17ef9b6138..b6c0f028249 100644 --- a/reactos/lib/freetype/src/raster/ftrend1.c +++ b/reactos/lib/freetype/src/raster/ftrend1.c @@ -140,10 +140,10 @@ /* compute the control box, and grid fit it */ FT_Outline_Get_CBox( outline, &cbox ); - cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); - cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); - cbox.xMax = FT_PIX_CEIL( cbox.xMax ); - cbox.yMax = FT_PIX_CEIL( cbox.yMax ); + cbox.xMin &= -64; + cbox.yMin &= -64; + cbox.xMax = ( cbox.xMax + 63 ) & -64; + cbox.yMax = ( cbox.yMax + 63 ) & -64; width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); @@ -161,7 +161,7 @@ if ( !( mode & FT_RENDER_MODE_MONO ) ) { /* we pad to 32 bits, only for backwards compatibility with FT 1.x */ - pitch = FT_PAD_CEIL( width, 4 ); + pitch = ( width + 3 ) & -4; bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; bitmap->num_grays = 256; } @@ -193,9 +193,9 @@ /* render outline into the bitmap */ error = render->raster_render( render->raster, ¶ms ); - + FT_Outline_Translate( outline, cbox.xMin, cbox.yMin ); - + if ( error ) goto Exit; diff --git a/reactos/lib/freetype/src/sfnt/Jamfile b/reactos/lib/freetype/src/sfnt/Jamfile index 257b3442cb7..adddfb6fd24 100644 --- a/reactos/lib/freetype/src/sfnt/Jamfile +++ b/reactos/lib/freetype/src/sfnt/Jamfile @@ -1,4 +1,4 @@ -# FreeType 2 src/sfnt Jamfile (c) 2001, 2002, 2004 David Turner +# FreeType 2 src/sfnt Jamfile (c) 2001, 2002 David Turner # SubDir FT2_TOP $(FT2_SRC_DIR) sfnt ; @@ -8,7 +8,7 @@ SubDir FT2_TOP $(FT2_SRC_DIR) sfnt ; if $(FT2_MULTI) { - _sources = sfobjs sfdriver ttcmap0 ttpost ttload ttsbit ; + _sources = sfobjs sfdriver ttcmap ttcmap0 ttpost ttload ttsbit ; } else { diff --git a/reactos/lib/freetype/src/sfnt/rules.mk b/reactos/lib/freetype/src/sfnt/rules.mk index f1323854914..14078974713 100644 --- a/reactos/lib/freetype/src/sfnt/rules.mk +++ b/reactos/lib/freetype/src/sfnt/rules.mk @@ -26,6 +26,7 @@ SFNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR)) # SFNT driver sources (i.e., C files) # SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c \ + $(SFNT_DIR)/ttcmap.c \ $(SFNT_DIR)/ttcmap0.c \ $(SFNT_DIR)/ttsbit.c \ $(SFNT_DIR)/ttpost.c \ diff --git a/reactos/lib/freetype/src/sfnt/sfdriver.c b/reactos/lib/freetype/src/sfnt/sfdriver.c index c2bf948c7cf..ea504bdd7bd 100644 --- a/reactos/lib/freetype/src/sfnt/sfdriver.c +++ b/reactos/lib/freetype/src/sfnt/sfdriver.c @@ -22,10 +22,9 @@ #include "sfdriver.h" #include "ttload.h" +#include "ttcmap.h" #include "sfobjs.h" -#include "sferrors.h" - #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS #include "ttsbit.h" #endif @@ -34,18 +33,6 @@ #include "ttpost.h" #endif -#include "ttcmap0.h" - -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_SFNT_H -#include FT_SERVICE_TT_CMAP_H - - - /* - * SFNT TABLE SERVICE - * - */ static void* get_sfnt_table( TT_Face face, @@ -92,22 +79,11 @@ } - static const FT_Service_SFNT_TableRec sfnt_service_sfnt_table = - { - (FT_SFNT_TableLoadFunc)tt_face_load_any, - (FT_SFNT_TableGetFunc) get_sfnt_table - }; - - #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES - /* - * GLYPH DICT SERVICE - * - */ static FT_Error - sfnt_get_glyph_name( TT_Face face, + get_sfnt_glyph_name( TT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max ) @@ -133,30 +109,16 @@ } - static const FT_Service_GlyphDictRec sfnt_service_glyph_dict = - { - (FT_GlyphDict_GetNameFunc) sfnt_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)NULL - }; - -#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ - - - /* - * POSTSCRIPT NAME SERVICE - * - */ - static const char* - sfnt_get_ps_name( TT_Face face ) + get_sfnt_postscript_name( TT_Face face ) { FT_Int n, found_win, found_apple; const char* result = NULL; /* shouldn't happen, but just in case to avoid memory leaks */ - if ( face->postscript_name ) - return face->postscript_name; + if ( face->root.internal->postscript_name ) + return face->root.internal->postscript_name; /* scan the name table to see whether we have a Postscript name here, */ /* either in Macintosh or Windows platform encodings */ @@ -253,42 +215,12 @@ } Exit: - face->postscript_name = result; + face->root.internal->postscript_name = result; return result; } - static const FT_Service_PsFontNameRec sfnt_service_ps_name = - { - (FT_PsName_GetFunc)sfnt_get_ps_name - }; - - /* - * TT CMAP INFO - * - */ - static const FT_Service_TTCMapsRec tt_service_get_cmap_info = - { - (TT_CMap_Info_GetFunc)tt_get_cmap_info - }; - - - /* - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec sfnt_services[] = - { - { FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table }, - { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name }, -#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES - { FT_SERVICE_ID_GLYPH_DICT, &sfnt_service_glyph_dict }, -#endif - { FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info }, - - { NULL, NULL } - }; +#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ FT_CALLBACK_DEF( FT_Module_Interface ) @@ -303,7 +235,15 @@ if ( ft_strcmp( module_interface, "load_sfnt" ) == 0 ) return (FT_Module_Interface)tt_face_load_any; - return ft_service_list_lookup( sfnt_services, module_interface ); +#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES + if ( ft_strcmp( module_interface, "glyph_name" ) == 0 ) + return (FT_Module_Interface)get_sfnt_glyph_name; +#endif + + if ( ft_strcmp( module_interface, "postscript_name" ) == 0 ) + return (FT_Module_Interface)get_sfnt_postscript_name; + + return 0; } @@ -372,6 +312,9 @@ #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ + /* see `ttcmap.h' */ + tt_face_load_charmap, + tt_face_free_charmap, }; diff --git a/reactos/lib/freetype/src/sfnt/sfnt.c b/reactos/lib/freetype/src/sfnt/sfnt.c index 90c1bee911e..6e0757aa856 100644 --- a/reactos/lib/freetype/src/sfnt/sfnt.c +++ b/reactos/lib/freetype/src/sfnt/sfnt.c @@ -4,7 +4,7 @@ /* */ /* Single object library component. */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -20,6 +20,7 @@ #include <ft2build.h> #include "ttload.c" +#include "ttcmap.c" #include "ttcmap0.c" #include "sfobjs.c" #include "sfdriver.c" diff --git a/reactos/lib/freetype/src/sfnt/sfobjs.c b/reactos/lib/freetype/src/sfnt/sfobjs.c index cb304fdc182..33a71ae3f9d 100644 --- a/reactos/lib/freetype/src/sfnt/sfobjs.c +++ b/reactos/lib/freetype/src/sfnt/sfobjs.c @@ -21,9 +21,10 @@ #include "ttload.h" #include "ttcmap0.h" #include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include FT_TRUETYPE_IDS_H #include FT_TRUETYPE_TAGS_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H + #include "sferrors.h" @@ -364,7 +365,11 @@ face->goto_table = sfnt->goto_table; } - FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS ); + if ( !face->psnames ) + { + face->psnames = (PSNames_Service) + FT_Get_Module_Interface( library, "psnames" ); + } /* check that we have a valid TrueType file */ error = sfnt->load_sfnt_header( face, stream, face_index, &sfnt_header ); @@ -400,7 +405,7 @@ FT_Int num_params, FT_Parameter* params ) { - FT_Error error, psnames_error; + FT_Error error; FT_Bool has_outline; FT_Bool is_apple_sbit; @@ -462,7 +467,7 @@ /* the following tables are optional in PCL fonts -- */ /* don't check for errors */ (void)LOAD_( names ); - psnames_error = LOAD_( psnames ); + (void)LOAD_( psnames ); /* do not load the metrics headers and tables if this is an Apple */ /* sbit font file */ @@ -529,9 +534,9 @@ FT_FACE_FLAG_HORIZONTAL; /* horizontal data */ #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES - if ( psnames_error == SFNT_Err_Ok && - face->postscript.FormatType != 0x00030000L ) - flags |= FT_FACE_FLAG_GLYPH_NAMES; + /* might need more polish to detect the presence of a Postscript */ + /* name table in the font */ + flags |= FT_FACE_FLAG_GLYPH_NAMES; #endif /* fixed width font? */ @@ -638,14 +643,14 @@ FT_Bitmap_Size* bsize = root->available_sizes + n; TT_SBit_Strike strike = face->sbit_strikes + n; FT_UShort fupem = face->header.Units_Per_EM; - FT_Short height = (FT_Short)( face->horizontal.Ascender - - face->horizontal.Descender + - face->horizontal.Line_Gap ); + FT_Short height = face->horizontal.Ascender - + face->horizontal.Descender + + face->horizontal.Line_Gap; FT_Short avg = face->os2.xAvgCharWidth; /* assume 72dpi */ - bsize->height = + bsize->height = (FT_Short)( ( height * strike->y_ppem + fupem/2 ) / fupem ); bsize->width = (FT_Short)( ( avg * strike->y_ppem + fupem/2 ) / fupem ); diff --git a/reactos/lib/freetype/src/sfnt/ttcmap0.c b/reactos/lib/freetype/src/sfnt/ttcmap0.c index dd1c76aaa7b..4c9dadfbb42 100644 --- a/reactos/lib/freetype/src/sfnt/ttcmap0.c +++ b/reactos/lib/freetype/src/sfnt/ttcmap0.c @@ -144,19 +144,6 @@ } - FT_CALLBACK_DEF( FT_Error ) - tt_cmap0_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 4; - - - cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); - - return FT_Err_Ok; - } - - FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap0_class_rec = { @@ -169,8 +156,7 @@ (FT_CMap_CharNextFunc) tt_cmap0_char_next }, 0, - (TT_CMap_ValidateFunc) tt_cmap0_validate, - (TT_CMap_Info_GetFunc) tt_cmap0_get_info + (TT_CMap_ValidateFunc) tt_cmap0_validate }; #endif /* TT_CONFIG_CMAP_FORMAT_0 */ @@ -392,13 +378,10 @@ else { /* a 16-bit character code */ + p += char_hi * 2; /* jump to key entry */ + sub = subs + ( TT_PEEK_USHORT( p ) & -8 ); /* jump to sub-header */ - /* jump to key entry */ - p += char_hi * 2; - /* jump to sub-header */ - sub = subs + ( FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 8 ) ); - - /* check that the high byte isn't a valid one-byte value */ + /* check that the hi byte isn't a valid one-byte value */ if ( sub == subs ) goto Exit; } @@ -484,7 +467,7 @@ pos = (FT_UInt)( char_lo - start ); p += offset + pos * 2; - charcode = FT_PAD_FLOOR( charcode, 256 ) + char_lo; + charcode = ( charcode & -256 ) + char_lo; for ( ; pos < count; pos++, charcode++ ) { @@ -504,7 +487,7 @@ /* jump to next sub-header, i.e. higher byte value */ Next_SubHeader: - charcode = FT_PAD_FLOOR( charcode, 256 ) + 256; + charcode = ( charcode & -256 ) + 256; } Exit: @@ -514,19 +497,6 @@ } - FT_CALLBACK_DEF( FT_Error ) - tt_cmap2_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 4; - - - cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); - - return FT_Err_Ok; - } - - FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap2_class_rec = { @@ -539,8 +509,7 @@ (FT_CMap_CharNextFunc) tt_cmap2_char_next }, 2, - (TT_CMap_ValidateFunc) tt_cmap2_validate, - (TT_CMap_Info_GetFunc) tt_cmap2_get_info + (TT_CMap_ValidateFunc) tt_cmap2_validate }; #endif /* TT_CONFIG_CMAP_FORMAT_2 */ @@ -798,7 +767,7 @@ p = table + 6; - num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 ); /* be paranoid! */ + num_segs2 = TT_PEEK_USHORT( p ) & -2; /* be paranoid! */ #if 1 /* Some fonts have more than 170 segments in their charmaps! */ @@ -921,7 +890,7 @@ code = (FT_UInt)char_code + 1; p = table + 6; - num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT(p), 2 ); /* ensure even-ness */ + num_segs2 = TT_PEEK_USHORT(p) & -2; /* ensure even-ness */ #if 1 @@ -1089,19 +1058,6 @@ } - FT_CALLBACK_DEF( FT_Error ) - tt_cmap4_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 4; - - - cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); - - return FT_Err_Ok; - } - - FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap4_class_rec = { @@ -1114,8 +1070,7 @@ (FT_CMap_CharNextFunc) tt_cmap4_char_next }, 4, - (TT_CMap_ValidateFunc) tt_cmap4_validate, - (TT_CMap_Info_GetFunc) tt_cmap4_get_info + (TT_CMap_ValidateFunc) tt_cmap4_validate }; #endif /* TT_CONFIG_CMAP_FORMAT_4 */ @@ -1247,19 +1202,6 @@ } - FT_CALLBACK_DEF( FT_Error ) - tt_cmap6_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 4; - - - cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); - - return FT_Err_Ok; - } - - FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap6_class_rec = { @@ -1272,8 +1214,7 @@ (FT_CMap_CharNextFunc) tt_cmap6_char_next }, 6, - (TT_CMap_ValidateFunc) tt_cmap6_validate, - (TT_CMap_Info_GetFunc) tt_cmap6_get_info + (TT_CMap_ValidateFunc) tt_cmap6_validate }; #endif /* TT_CONFIG_CMAP_FORMAT_6 */ @@ -1498,18 +1439,6 @@ } - FT_CALLBACK_DEF( FT_Error ) - tt_cmap8_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 8; - - - cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p ); - return FT_Err_Ok; - } - - FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap8_class_rec = { @@ -1522,8 +1451,7 @@ (FT_CMap_CharNextFunc) tt_cmap8_char_next }, 8, - (TT_CMap_ValidateFunc) tt_cmap8_validate, - (TT_CMap_Info_GetFunc) tt_cmap8_get_info + (TT_CMap_ValidateFunc) tt_cmap8_validate }; #endif /* TT_CONFIG_CMAP_FORMAT_8 */ @@ -1643,19 +1571,6 @@ } - FT_CALLBACK_DEF( FT_Error ) - tt_cmap10_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 8; - - - cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p ); - - return FT_Err_Ok; - } - - FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap10_class_rec = { @@ -1668,8 +1583,7 @@ (FT_CMap_CharNextFunc) tt_cmap10_char_next }, 10, - (TT_CMap_ValidateFunc) tt_cmap10_validate, - (TT_CMap_Info_GetFunc) tt_cmap10_get_info + (TT_CMap_ValidateFunc) tt_cmap10_validate }; #endif /* TT_CONFIG_CMAP_FORMAT_10 */ @@ -1827,19 +1741,6 @@ } - FT_CALLBACK_DEF( FT_Error ) - tt_cmap12_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 8; - - - cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p ); - - return FT_Err_Ok; - } - - FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec tt_cmap12_class_rec = { @@ -1852,8 +1753,7 @@ (FT_CMap_CharNextFunc) tt_cmap12_char_next }, 12, - (TT_CMap_ValidateFunc) tt_cmap12_validate, - (TT_CMap_Info_GetFunc) tt_cmap12_get_info + (TT_CMap_ValidateFunc) tt_cmap12_validate }; @@ -1966,7 +1866,6 @@ FT_ERROR(( "tt_face_build_cmaps:" )); FT_ERROR(( " broken cmap sub-table ignored!\n" )); } - break; } } } @@ -1976,16 +1875,4 @@ } - FT_LOCAL( FT_Error ) - tt_get_cmap_info( FT_CharMap charmap, - TT_CMapInfo *cmap_info ) - { - FT_CMap cmap = (FT_CMap)charmap; - TT_CMap_Class clazz = (TT_CMap_Class)cmap->clazz; - - - return clazz->get_cmap_info( charmap, cmap_info ); - } - - /* END */ diff --git a/reactos/lib/freetype/src/sfnt/ttcmap0.h b/reactos/lib/freetype/src/sfnt/ttcmap0.h index 6ca9ca11002..ff1276e09b0 100644 --- a/reactos/lib/freetype/src/sfnt/ttcmap0.h +++ b/reactos/lib/freetype/src/sfnt/ttcmap0.h @@ -4,7 +4,7 @@ /* */ /* TrueType new character mapping table (cmap) support (specification). */ /* */ -/* Copyright 2002, 2003 by */ +/* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -23,7 +23,7 @@ #include <ft2build.h> #include FT_INTERNAL_TRUETYPE_TYPES_H #include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_TT_CMAP_H + FT_BEGIN_HEADER @@ -46,7 +46,6 @@ FT_BEGIN_HEADER FT_CMap_ClassRec clazz; FT_UInt format; TT_CMap_ValidateFunc validate; - TT_CMap_Info_GetFunc get_cmap_info; } TT_CMap_ClassRec; @@ -66,11 +65,6 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) tt_face_build_cmaps( TT_Face face ); - /* used in tt-cmaps service */ - FT_LOCAL( FT_Error ) - tt_get_cmap_info( FT_CharMap charmap, - TT_CMapInfo *cmap_info ); - FT_END_HEADER diff --git a/reactos/lib/freetype/src/sfnt/ttload.c b/reactos/lib/freetype/src/sfnt/ttload.c index 27323f2594d..13b7e867790 100644 --- a/reactos/lib/freetype/src/sfnt/ttload.c +++ b/reactos/lib/freetype/src/sfnt/ttload.c @@ -22,6 +22,7 @@ #include FT_INTERNAL_STREAM_H #include FT_TRUETYPE_TAGS_H #include "ttload.h" +#include "ttcmap.h" #include "sferrors.h" diff --git a/reactos/lib/freetype/src/sfnt/ttpost.c b/reactos/lib/freetype/src/sfnt/ttpost.c index 3d526db4cfd..486ba3dd255 100644 --- a/reactos/lib/freetype/src/sfnt/ttpost.c +++ b/reactos/lib/freetype/src/sfnt/ttpost.c @@ -5,7 +5,7 @@ /* Postcript name table processing for TrueType and OpenType fonts */ /* (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -50,7 +50,7 @@ #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #define MAC_NAME( x ) ( (FT_String*)psnames->macintosh_name( x ) ) @@ -441,7 +441,7 @@ FT_Fixed format; #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES - FT_Service_PsCMaps psnames; + PSNames_Service psnames; #endif @@ -452,7 +452,7 @@ return SFNT_Err_Invalid_Glyph_Index; #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES - psnames = (FT_Service_PsCMaps)face->psnames; + psnames = (PSNames_Service)face->psnames; if ( !psnames ) return SFNT_Err_Unimplemented_Feature; #endif @@ -510,7 +510,7 @@ *PSname = MAC_NAME( idx ); } } - + /* nothing to do for format == 0x00030000L */ End: diff --git a/reactos/lib/freetype/src/sfnt/ttsbit.c b/reactos/lib/freetype/src/sfnt/ttsbit.c index bb6f227a707..d4c16b15f51 100644 --- a/reactos/lib/freetype/src/sfnt/ttsbit.c +++ b/reactos/lib/freetype/src/sfnt/ttsbit.c @@ -4,7 +4,7 @@ /* */ /* TrueType and OpenType embedded bitmap support (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -622,22 +622,22 @@ FT_LOCAL_DEF( FT_Error ) tt_face_set_sbit_strike( TT_Face face, - FT_UInt x_ppem, - FT_UInt y_ppem, + FT_Int x_ppem, + FT_Int y_ppem, FT_ULong *astrike_index ) { FT_ULong i; - if ( x_ppem > 255 || + if ( x_ppem < 0 || x_ppem > 255 || y_ppem < 1 || y_ppem > 255 ) return SFNT_Err_Invalid_PPem; for ( i = 0; i < face->num_sbit_strikes; i++ ) { - if ( ( (FT_UInt)face->sbit_strikes[i].y_ppem == y_ppem ) && - ( ( x_ppem == 0 ) || - ( (FT_UInt)face->sbit_strikes[i].x_ppem == x_ppem ) ) ) + if ( ( face->sbit_strikes[i].y_ppem == y_ppem ) && + ( ( x_ppem == 0 ) || + ( face->sbit_strikes[i].x_ppem == x_ppem ) ) ) { *astrike_index = i; return SFNT_Err_Ok; diff --git a/reactos/lib/freetype/src/sfnt/ttsbit.h b/reactos/lib/freetype/src/sfnt/ttsbit.h index 89499bbb80a..edc858a60c4 100644 --- a/reactos/lib/freetype/src/sfnt/ttsbit.h +++ b/reactos/lib/freetype/src/sfnt/ttsbit.h @@ -4,7 +4,7 @@ /* */ /* TrueType and OpenType embedded bitmap support (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -37,8 +37,8 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) tt_face_set_sbit_strike( TT_Face face, - FT_UInt x_ppem, - FT_UInt y_ppem, + FT_Int x_ppem, + FT_Int y_ppem, FT_ULong *astrike_index ); FT_LOCAL( FT_Error ) diff --git a/reactos/lib/freetype/src/smooth/ftsmooth.c b/reactos/lib/freetype/src/smooth/ftsmooth.c index 40d5f504f20..cc84acd0490 100644 --- a/reactos/lib/freetype/src/smooth/ftsmooth.c +++ b/reactos/lib/freetype/src/smooth/ftsmooth.c @@ -132,10 +132,10 @@ /* compute the control box, and grid fit it */ FT_Outline_Get_CBox( outline, &cbox ); - cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); - cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); - cbox.xMax = FT_PIX_CEIL( cbox.xMax ); - cbox.yMax = FT_PIX_CEIL( cbox.yMax ); + cbox.xMin &= -64; + cbox.yMin &= -64; + cbox.xMax = ( cbox.xMax + 63 ) & -64; + cbox.yMax = ( cbox.yMax + 63 ) & -64; width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); @@ -154,7 +154,7 @@ if ( hmul ) { width = width * hmul; - pitch = FT_PAD_CEIL( width, 4 ); + pitch = ( width + 3 ) & -4; } if ( vmul ) diff --git a/reactos/lib/freetype/src/tools/docmaker/.cvsignore b/reactos/lib/freetype/src/tools/docmaker/.cvsignore deleted file mode 100644 index 0d20b6487c6..00000000000 --- a/reactos/lib/freetype/src/tools/docmaker/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.pyc diff --git a/reactos/lib/freetype/src/tools/docmaker/content.py b/reactos/lib/freetype/src/tools/docmaker/content.py index ebfeb8bf487..6d33b5db27e 100644 --- a/reactos/lib/freetype/src/tools/docmaker/content.py +++ b/reactos/lib/freetype/src/tools/docmaker/content.py @@ -56,16 +56,8 @@ class DocCode: self.lines.append( l ) def dump( self, prefix = "", width=60 ): - lines = self.dump_lines( 0, width ) - for l in lines: - print prefix + l - - def dump_lines( self, margin=0, width=60 ): - result = [] for l in self.lines: - result.append( " "*margin + l ) - return result - + print prefix + l ############################################################################# @@ -84,14 +76,8 @@ class DocPara: self.words.extend( string.split( l ) ) def dump( self, prefix = "", width = 60 ): - lines = self.dump_lines( 0, width ) - for l in lines: - print prefix + l - - def dump_lines( self, margin=0, width = 60 ): - cur = "" # current line - col = 0 # current width - result = [] + cur = "" # current line + col = 0 # current width for word in self.words: ln = len(word) @@ -99,7 +85,7 @@ class DocPara: ln = ln+1 if col + ln > width: - result.append( " "*margin + cur ) + print prefix + cur cur = word col = len(word) else: @@ -109,11 +95,8 @@ class DocPara: col = col + ln if col > 0: - result.append( " "*margin + cur ) - - return result + print prefix + cur - ############################################################################# @@ -204,17 +187,6 @@ class DocField: p.dump( prefix ) first = 0 - def dump_lines( self, margin=0, width=60 ): - result = [] - nl = None - for p in self.items: - if nl: - result.append( "" ) - - result.extend( p.dump_lines( margin, width ) ) - nl = 1 - - return result # this regular expression is used to detect field definitions # @@ -261,16 +233,6 @@ class DocMarkup: except: return None - - def get_start( self ): - try: - result = "" - for word in self.fields[0].items[0].words: - result = result + " " + word - return result[1:] - - except: - return "ERROR" def dump( self, margin ): print " "*margin + "<" + self.tag + ">" @@ -582,4 +544,4 @@ class DocBlock: m = self.get_markup( tag_name ) return m.fields[0].items except: - return None + return None \ No newline at end of file diff --git a/reactos/lib/freetype/src/tools/docmaker/docbeauty.py b/reactos/lib/freetype/src/tools/docmaker/docbeauty.py deleted file mode 100644 index 94b266b6d10..00000000000 --- a/reactos/lib/freetype/src/tools/docmaker/docbeauty.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python -# -# DocBeauty (c) 2003, 2004 David Turner <david@freetype.org> -# -# This program is used to beautify the documentation comments used -# in the FreeType 2 public headers. -# - -from sources import * -from content import * -from utils import * - -import utils - -import sys, os, time, string, getopt - -content_processor = ContentProcessor() - - -def beautify_block( block ): - if block.content: - content_processor.reset() - - markups = content_processor.process_content( block.content ) - text = [] - first = 1 - - for markup in markups: - text.extend( markup.beautify( first ) ) - first = 0 - - # now beautify the documentation "borders" themselves - lines = [ " /*************************************************************************" ] - for l in text: - lines.append( " *" + l ) - lines.append( " */" ) - - block.lines = lines - - -def usage(): - print "\nDocBeauty 0.1 Usage information\n" - print " docbeauty [options] file1 [ file2 ... ]\n" - print "using the following options:\n" - print " -h : print this page" - print " -b : backup original files with the 'orig' extension" - print "" - print " --backup : same as -b" - - -def main( argv ): - """main program loop""" - - global output_dir - - try: - opts, args = getopt.getopt( sys.argv[1:], - "hb", - [ "help", "backup" ] ) - - except getopt.GetoptError: - usage() - sys.exit( 2 ) - - if args == []: - usage() - sys.exit( 1 ) - - # process options - # - output_dir = None - do_backup = None - - for opt in opts: - if opt[0] in ( "-h", "--help" ): - usage() - sys.exit( 0 ) - - if opt[0] in ( "-b", "--backup" ): - do_backup = 1 - - # create context and processor - source_processor = SourceProcessor() - - # retrieve the list of files to process - file_list = make_file_list( args ) - for filename in file_list: - source_processor.parse_file( filename ) - for block in source_processor.blocks: - beautify_block( block ) - new_name = filename + ".new" - ok = None - try: - file = open( new_name, "wt" ) - for block in source_processor.blocks: - for line in block.lines: - file.write( line ) - file.write( "\n" ) - file.close() - except: - ok = 0 - -# if called from the command line -# -if __name__ == '__main__': - main( sys.argv ) - - -# eof diff --git a/reactos/lib/freetype/src/tools/docmaker/docmaker.py b/reactos/lib/freetype/src/tools/docmaker/docmaker.py index 9da4bbf8ea7..285bcd6a21b 100644 --- a/reactos/lib/freetype/src/tools/docmaker/docmaker.py +++ b/reactos/lib/freetype/src/tools/docmaker/docmaker.py @@ -1,16 +1,16 @@ #!/usr/bin/env python # -# DocMaker (c) 2002, 2004 David Turner <david@freetype.org> +# DocMaker 0.2 (c) 2002 David Turner <david@freetype.org> # # This program is a re-write of the original DocMaker took used # to generate the API Reference of the FreeType font engine -# by converting in-source comments into structured HTML. +# by converting in-source comments into structured HTML # # This new version is capable of outputting XML data, as well -# as accepts more liberal formatting options. +# as accepts more liberal formatting options # # It also uses regular expression matching and substitution -# to speed things significantly. +# to speed things significantly # from sources import * @@ -24,8 +24,50 @@ import utils import sys, os, time, string, glob, getopt +def file_exists( pathname ): + """checks that a given file exists""" + result = 1 + try: + file = open( pathname, "r" ) + file.close() + except: + result = None + sys.stderr.write( pathname + " couldn't be accessed\n" ) + + return result + + +def make_file_list( args = None ): + """builds a list of input files from command-line arguments""" + + file_list = [] + # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' ) + + if not args: + args = sys.argv[1 :] + + for pathname in args: + if string.find( pathname, '*' ) >= 0: + newpath = glob.glob( pathname ) + newpath.sort() # sort files -- this is important because + # of the order of files + else: + newpath = [pathname] + + file_list.extend( newpath ) + + if len( file_list ) == 0: + file_list = None + else: + # now filter the file list to remove non-existing ones + file_list = filter( file_exists, file_list ) + + return file_list + + + def usage(): - print "\nDocMaker Usage information\n" + print "\nDocMaker 0.2 Usage information\n" print " docmaker [options] file1 [ file2 ... ]\n" print "using the following options:\n" print " -h : print this page" diff --git a/reactos/lib/freetype/src/tools/docmaker/formatter.py b/reactos/lib/freetype/src/tools/docmaker/formatter.py index 63ecddc973c..36d72aeca04 100644 --- a/reactos/lib/freetype/src/tools/docmaker/formatter.py +++ b/reactos/lib/freetype/src/tools/docmaker/formatter.py @@ -2,15 +2,6 @@ from sources import * from content import * from utils import * -# This is the base Formatter class. its purpose is to convert -# a content processor's data into specific documents (i.e. table of -# contents, global index, and individual API reference indices). -# -# You'll need to sub-class it to output anything sensible. For example, -# the file tohtml.py contains the definition of the HtmlFormatter sub-class -# used to output, you guessed it, HTML. -# - class Formatter: def __init__( self, processor ): diff --git a/reactos/lib/freetype/src/tools/docmaker/sources.py b/reactos/lib/freetype/src/tools/docmaker/sources.py index 4923005624c..c270e54118e 100644 --- a/reactos/lib/freetype/src/tools/docmaker/sources.py +++ b/reactos/lib/freetype/src/tools/docmaker/sources.py @@ -200,7 +200,7 @@ class SourceBlock: self.processor = processor self.filename = filename self.lineno = lineno - self.lines = lines[:] + self.lines = lines self.format = processor.format self.content = [] @@ -212,7 +212,7 @@ class SourceBlock: # extract comment lines lines = [] - for line0 in self.lines: + for line0 in self.lines[1:]: m = self.format.column.match( line0 ) if m: lines.append( m.group(1) ) @@ -304,7 +304,7 @@ class SourceProcessor: if self.format.end.match( line ): # that's a normal block end, add it to lines and # create a new block - self.lines.append( line ) + # self.lines.append( line ) self.add_block_lines() elif self.format.column.match( line ): diff --git a/reactos/lib/freetype/src/tools/docmaker/utils.py b/reactos/lib/freetype/src/tools/docmaker/utils.py index c3e9e2700f5..6d4653db527 100644 --- a/reactos/lib/freetype/src/tools/docmaker/utils.py +++ b/reactos/lib/freetype/src/tools/docmaker/utils.py @@ -1,4 +1,4 @@ -import string, sys, os, glob +import string, sys, os # current output directory # @@ -85,44 +85,3 @@ def check_output( ): sys.exit( 2 ) else: output_dir = None - -def file_exists( pathname ): - """checks that a given file exists""" - result = 1 - try: - file = open( pathname, "r" ) - file.close() - except: - result = None - sys.stderr.write( pathname + " couldn't be accessed\n" ) - - return result - - -def make_file_list( args = None ): - """builds a list of input files from command-line arguments""" - - file_list = [] - # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' ) - - if not args: - args = sys.argv[1 :] - - for pathname in args: - if string.find( pathname, '*' ) >= 0: - newpath = glob.glob( pathname ) - newpath.sort() # sort files -- this is important because - # of the order of files - else: - newpath = [pathname] - - file_list.extend( newpath ) - - if len( file_list ) == 0: - file_list = None - else: - # now filter the file list to remove non-existing ones - file_list = filter( file_exists, file_list ) - - return file_list - diff --git a/reactos/lib/freetype/src/truetype/ttdriver.c b/reactos/lib/freetype/src/truetype/ttdriver.c index e23fc351573..193be06052f 100644 --- a/reactos/lib/freetype/src/truetype/ttdriver.c +++ b/reactos/lib/freetype/src/truetype/ttdriver.c @@ -21,7 +21,6 @@ #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_SFNT_H #include FT_TRUETYPE_IDS_H -#include FT_SERVICE_XFREE86_NAME_H #include "ttdriver.h" #include "ttgload.h" @@ -208,8 +207,8 @@ /* we need to use rounding in the following computations. Otherwise, * the resulting hinted outlines will be very slightly distorted */ - dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & ~63; - dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & ~63; + dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64; + dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64; } else { @@ -345,27 +344,17 @@ /*************************************************************************/ /*************************************************************************/ - static const FT_ServiceDescRec tt_services[] = - { - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE }, - { NULL, NULL } - }; static FT_Module_Interface tt_get_interface( TT_Driver driver, const char* tt_interface ) { - FT_Module_Interface result; - FT_Module sfntd; - SFNT_Service sfnt; + FT_Module sfntd = FT_Get_Module( driver->root.root.library, + "sfnt" ); + SFNT_Service sfnt; - result = ft_service_list_lookup( tt_services, tt_interface ); - if ( result != NULL ) - return result; - /* only return the default interface from the SFNT module */ - sfntd = FT_Get_Module( driver->root.root.library, "sfnt" ); if ( sfntd ) { sfnt = (SFNT_Service)( sfntd->clazz->module_interface ); @@ -409,20 +398,20 @@ sizeof ( FT_GlyphSlotRec ), - (FT_Face_InitFunc) tt_face_init, - (FT_Face_DoneFunc) tt_face_done, - (FT_Size_InitFunc) tt_size_init, - (FT_Size_DoneFunc) tt_size_done, - (FT_Slot_InitFunc) 0, - (FT_Slot_DoneFunc) 0, + (FT_Face_InitFunc) tt_face_init, + (FT_Face_DoneFunc) tt_face_done, + (FT_Size_InitFunc) tt_size_init, + (FT_Size_DoneFunc) tt_size_done, + (FT_Slot_InitFunc) 0, + (FT_Slot_DoneFunc) 0, - (FT_Size_ResetPointsFunc)Set_Char_Sizes, - (FT_Size_ResetPixelsFunc)Set_Pixel_Sizes, - (FT_Slot_LoadFunc) Load_Glyph, + (FT_Size_ResetPointsFunc) Set_Char_Sizes, + (FT_Size_ResetPixelsFunc) Set_Pixel_Sizes, + (FT_Slot_LoadFunc) Load_Glyph, - (FT_Face_GetKerningFunc) Get_Kerning, - (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc)0 + (FT_Face_GetKerningFunc) Get_Kerning, + (FT_Face_AttachFunc) 0, + (FT_Face_GetAdvancesFunc) 0 }; diff --git a/reactos/lib/freetype/src/truetype/ttgload.c b/reactos/lib/freetype/src/truetype/ttgload.c index 3f5e6ee9fc7..a8b82eee834 100644 --- a/reactos/lib/freetype/src/truetype/ttgload.c +++ b/reactos/lib/freetype/src/truetype/ttgload.c @@ -4,7 +4,7 @@ /* */ /* TrueType Glyph Loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -163,10 +163,10 @@ #define cur_to_org( n, zone ) \ - FT_ARRAY_COPY( (zone)->org, (zone)->cur, (n) ) + FT_MEM_COPY( (zone)->org, (zone)->cur, (n) * sizeof ( FT_Vector ) ) #define org_to_cur( n, zone ) \ - FT_ARRAY_COPY( (zone)->cur, (zone)->org, (n) ) + FT_MEM_COPY( (zone)->cur, (zone)->org, (n) * sizeof ( FT_Vector ) ) /*************************************************************************/ @@ -690,12 +690,12 @@ FT_Pos x = zone->org[n_points-2].x; - x = FT_PIX_ROUND( x ) - x; + x = ( ( x + 32 ) & -64 ) - x; translate_array( n_points, zone->org, x, 0 ); org_to_cur( n_points, zone ); - zone->cur[n_points - 1].x = FT_PIX_ROUND( zone->cur[n_points - 1].x ); + zone->cur[n_points - 1].x = ( zone->cur[n_points - 1].x + 32 ) & -64; #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER @@ -1202,8 +1202,8 @@ if ( subglyph->flags & ROUND_XY_TO_GRID ) { - x = FT_PIX_ROUND( x ); - y = FT_PIX_ROUND( y ); + x = ( x + 32 ) & -64; + y = ( y + 32 ) & -64; } } } @@ -1296,8 +1296,8 @@ /* if hinting, round the phantom points */ if ( IS_HINTED( loader->load_flags ) ) { - pp1[0].x = FT_PIX_ROUND( loader->pp1.x ); - pp1[1].x = FT_PIX_ROUND( loader->pp2.x ); + pp1[0].x = ( ( loader->pp1.x + 32 ) & -64 ); + pp1[1].x = ( ( loader->pp2.x + 32 ) & -64 ); } { @@ -1390,10 +1390,10 @@ if ( IS_HINTED( loader->load_flags ) ) { /* grid-fit the bounding box */ - bbox.xMin = FT_PIX_FLOOR( bbox.xMin ); - bbox.yMin = FT_PIX_FLOOR( bbox.yMin ); - bbox.xMax = FT_PIX_CEIL( bbox.xMax ); - bbox.yMax = FT_PIX_CEIL( bbox.yMax ); + bbox.xMin &= -64; + bbox.yMin &= -64; + bbox.xMax = ( bbox.xMax + 63 ) & -64; + bbox.yMax = ( bbox.yMax + 63 ) & -64; } } else @@ -1425,7 +1425,7 @@ /* don't forget to hint the advance when we need to */ if ( IS_HINTED( loader->load_flags ) ) - glyph->metrics.horiAdvance = FT_PIX_ROUND( glyph->metrics.horiAdvance ); + glyph->metrics.horiAdvance = ( glyph->metrics.horiAdvance + 32 ) & -64; /* Now take care of vertical metrics. In the case where there is */ /* no vertical information within the font (relatively common), make */ @@ -1538,9 +1538,9 @@ /* grid-fit them if necessary */ if ( IS_HINTED( loader->load_flags ) ) { - left = FT_PIX_FLOOR( left ); - top = FT_PIX_CEIL( top ); - advance = FT_PIX_ROUND( advance ); + left &= -64; + top = ( top + 63 ) & -64; + advance = ( advance + 32 ) & -64; } glyph->metrics.vertBearingX = left; diff --git a/reactos/lib/freetype/src/truetype/ttinterp.c b/reactos/lib/freetype/src/truetype/ttinterp.c index 0186541296a..2dca6a21293 100644 --- a/reactos/lib/freetype/src/truetype/ttinterp.c +++ b/reactos/lib/freetype/src/truetype/ttinterp.c @@ -4,7 +4,7 @@ /* */ /* TrueType bytecode interpreter (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -30,10 +30,9 @@ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER -#define TT_MULFIX FT_MulFix -#define TT_MULDIV FT_MulDiv -#define TT_MULDIV_NO_ROUND FT_MulDiv_No_Round - +#define TT_MULFIX FT_MulFix +#define TT_MULDIV FT_MulDiv +#define TT_INT64 FT_Int64 /*************************************************************************/ /* */ @@ -163,9 +162,6 @@ #define CUR_Func_move( z, p, d ) \ CUR.func_move( EXEC_ARG_ z, p, d ) -#define CUR_Func_move_orig( z, p, d ) \ - CUR.func_move_orig( EXEC_ARG_ z, p, d ) - #define CUR_Func_dualproj( x, y ) \ CUR.func_dualproj( EXEC_ARG_ x, y ) @@ -519,7 +515,8 @@ if ( *size < new_max ) { - if ( FT_REALLOC( *buff, *size, new_max * multiplier ) ) + FT_FREE( *buff ); + if ( FT_ALLOC( *buff, new_max * multiplier ) ) return error; *size = new_max; } @@ -1569,6 +1566,7 @@ if ( v != 0 ) { + zone->cur[point].x += TT_MULDIV( distance, v * 0x10000L, CUR.F_dot_P ); @@ -1580,6 +1578,7 @@ if ( v != 0 ) { + zone->cur[point].y += TT_MULDIV( distance, v * 0x10000L, CUR.F_dot_P ); @@ -1589,51 +1588,6 @@ } - /*************************************************************************/ - /* */ - /* <Function> */ - /* Direct_Move_Orig */ - /* */ - /* <Description> */ - /* Moves the *original* position of a point by a given distance along */ - /* the freedom vector. Obviously, the point will not be `touched'. */ - /* */ - /* <Input> */ - /* point :: The index of the point to move. */ - /* */ - /* distance :: The distance to apply. */ - /* */ - /* <InOut> */ - /* zone :: The affected glyph zone. */ - /* */ - static void - Direct_Move_Orig( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) - { - FT_F26Dot6 v; - - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - FT_ASSERT( !CUR.face->unpatented_hinting ); -#endif - - v = CUR.GS.freeVector.x; - - if ( v != 0 ) - zone->org[point].x += TT_MULDIV( distance, - v * 0x10000L, - CUR.F_dot_P ); - - v = CUR.GS.freeVector.y; - - if ( v != 0 ) - zone->org[point].y += TT_MULDIV( distance, - v * 0x10000L, - CUR.F_dot_P ); - } - - /*************************************************************************/ /* */ /* Special versions of Direct_Move() */ @@ -1668,38 +1622,6 @@ } - /*************************************************************************/ - /* */ - /* Special versions of Direct_Move_Orig() */ - /* */ - /* The following versions are used whenever both vectors are both */ - /* along one of the coordinate unit vectors, i.e. in 90% of the cases. */ - /* */ - /*************************************************************************/ - - - static void - Direct_Move_Orig_X( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) - { - FT_UNUSED_EXEC; - - zone->org[point].x += distance; - } - - - static void - Direct_Move_Orig_Y( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) - { - FT_UNUSED_EXEC; - - zone->org[point].y += distance; - } - - /*************************************************************************/ /* */ /* <Function> */ @@ -1734,7 +1656,7 @@ if ( distance >= 0 ) { val = distance + compensation; - if ( distance && val < 0 ) + if ( val < 0 ) val = 0; } else { @@ -1774,14 +1696,14 @@ if ( distance >= 0 ) { val = distance + compensation + 32; - if ( distance && val > 0 ) + if ( val > 0 ) val &= ~63; else val = 0; } else { - val = -FT_PIX_ROUND( compensation - distance ); + val = -( ( compensation - distance + 32 ) & -64 ); if ( val > 0 ) val = 0; } @@ -1817,13 +1739,13 @@ if ( distance >= 0 ) { - val = FT_PIX_FLOOR( distance + compensation ) + 32; - if ( distance && val < 0 ) + val = ( ( distance + compensation ) & -64 ) + 32; + if ( val < 0 ) val = 0; } else { - val = -( FT_PIX_FLOOR( compensation - distance ) + 32 ); + val = -( ( (compensation - distance) & -64 ) + 32 ); if ( val > 0 ) val = 0; } @@ -1860,7 +1782,7 @@ if ( distance >= 0 ) { val = distance + compensation; - if ( distance && val > 0 ) + if ( val > 0 ) val &= ~63; else val = 0; @@ -1904,14 +1826,14 @@ if ( distance >= 0 ) { val = distance + compensation + 63; - if ( distance && val > 0 ) + if ( val > 0 ) val &= ~63; else val = 0; } else { - val = - FT_PIX_CEIL( compensation - distance ); + val = -( ( compensation - distance + 63 ) & -64 ); if ( val > 0 ) val = 0; } @@ -1948,14 +1870,14 @@ if ( distance >= 0 ) { val = distance + compensation + 16; - if ( distance && val > 0 ) + if ( val > 0 ) val &= ~31; else val = 0; } else { - val = -FT_PAD_ROUND( compensation - distance, 32 ); + val = -( ( compensation - distance + 16 ) & -32 ); if ( val > 0 ) val = 0; } @@ -1997,7 +1919,7 @@ { val = ( distance - CUR.phase + CUR.threshold + compensation ) & -CUR.period; - if ( distance && val < 0 ) + if ( val < 0 ) val = 0; val += CUR.phase; } @@ -2045,7 +1967,7 @@ { val = ( ( distance - CUR.phase + CUR.threshold + compensation ) / CUR.period ) * CUR.period; - if ( distance && val < 0 ) + if ( val < 0 ) val = 0; val += CUR.phase; } @@ -2321,15 +2243,13 @@ if ( CUR.GS.both_x_axis ) { - CUR.func_project = Project_x; - CUR.func_move = Direct_Move_X; - CUR.func_move_orig = Direct_Move_Orig_X; + CUR.func_project = Project_x; + CUR.func_move = Direct_Move_X; } else { - CUR.func_project = Project_y; - CUR.func_move = Direct_Move_Y; - CUR.func_move_orig = Direct_Move_Orig_Y; + CUR.func_project = Project_y; + CUR.func_move = Direct_Move_Y; } if ( CUR.GS.dualVector.x == 0x4000 ) @@ -2380,23 +2300,16 @@ CUR.func_dualproj = (TT_Project_Func)Dual_Project; } - CUR.func_move = (TT_Move_Func)Direct_Move; - CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig; + CUR.func_move = (TT_Move_Func)Direct_Move; if ( CUR.F_dot_P == 0x40000000L ) { if ( CUR.GS.freeVector.x == 0x4000 ) - { - CUR.func_move = (TT_Move_Func)Direct_Move_X; - CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X; - } + CUR.func_move = (TT_Move_Func)Direct_Move_X; else { if ( CUR.GS.freeVector.y == 0x4000 ) - { - CUR.func_move = (TT_Move_Func)Direct_Move_Y; - CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y; - } + CUR.func_move = (TT_Move_Func)Direct_Move_Y; } } @@ -2974,11 +2887,11 @@ args[0] -= args[1]; -#define DO_DIV \ - if ( args[1] == 0 ) \ - CUR.error = TT_Err_Divide_By_Zero; \ - else \ - args[0] = TT_MULDIV_NO_ROUND( args[0], 64L, args[1] ); +#define DO_DIV \ + if ( args[1] == 0 ) \ + CUR.error = TT_Err_Divide_By_Zero; \ + else \ + args[0] = TT_MULDIV( args[0], 64L, args[1] ); #define DO_MUL \ @@ -2994,11 +2907,11 @@ #define DO_FLOOR \ - args[0] = FT_PIX_FLOOR( args[0] ); + args[0] &= -64; #define DO_CEILING \ - args[0] = FT_PIX_CEIL( args[0] ); + args[0] = ( args[0] + 63 ) & -64; #define DO_RS \ @@ -4106,9 +4019,9 @@ K = CUR.stack[CUR.args - L]; - FT_ARRAY_MOVE( &CUR.stack[CUR.args - L ], - &CUR.stack[CUR.args - L + 1], - ( L - 1 ) ); + FT_MEM_MOVE( &CUR.stack[CUR.args - L ], + &CUR.stack[CUR.args - L + 1], + ( L - 1 ) * sizeof ( FT_Long ) ); CUR.stack[CUR.args - 1] = K; } @@ -5288,7 +5201,7 @@ { *x = 0; *y = d; - } + } } else #endif @@ -5446,11 +5359,11 @@ last_point = 0; } - /* XXX: UNDOCUMENTED! SHC does touch the points */ + /* XXX: UNDOCUMENTED! SHC doesn't touch the points */ for ( i = first_point; i <= last_point; i++ ) { if ( zp.cur != CUR.zp2.cur || refp != i ) - MOVE_Zp2_Point( i, dx, dy, TRUE ); + MOVE_Zp2_Point( i, dx, dy, FALSE ); } } @@ -5585,11 +5498,9 @@ } /* XXX: UNDOCUMENTED! behaviour */ - if ( CUR.GS.gep1 == 0 ) /* if the point that is to be moved */ - /* is in twilight zone */ + if ( CUR.GS.gep0 == 0 ) /* if in twilight zone */ { CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0]; - CUR_Func_move_orig( &CUR.zp1, point, args[1] ); CUR.zp1.cur[point] = CUR.zp1.org[point]; } diff --git a/reactos/lib/freetype/src/truetype/ttinterp.h b/reactos/lib/freetype/src/truetype/ttinterp.h index eb0bb0bb60e..e750963ff50 100644 --- a/reactos/lib/freetype/src/truetype/ttinterp.h +++ b/reactos/lib/freetype/src/truetype/ttinterp.h @@ -4,7 +4,7 @@ /* */ /* TrueType bytecode interpreter (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -210,7 +210,6 @@ FT_BEGIN_HEADER func_freeProj; /* current freedom proj. func */ TT_Move_Func func_move; /* current point move function */ - TT_Move_Func func_move_orig; /* move original position function */ TT_Get_CVT_Func func_read_cvt; /* read a cvt entry */ TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */ diff --git a/reactos/lib/freetype/src/truetype/ttobjs.c b/reactos/lib/freetype/src/truetype/ttobjs.c index d5210f2cd07..e1e69cdf875 100644 --- a/reactos/lib/freetype/src/truetype/ttobjs.c +++ b/reactos/lib/freetype/src/truetype/ttobjs.c @@ -23,6 +23,7 @@ #include FT_TRUETYPE_IDS_H #include FT_TRUETYPE_TAGS_H #include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include "ttgload.h" #include "ttpload.h" @@ -227,7 +228,7 @@ #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING /* Determine whether unpatented hinting is to be used for this face. */ - face->unpatented_hinting = FT_BOOL + face->unpatented_hinting = ( library->debug_hooks[ FT_DEBUG_HOOK_UNPATENTED_HINTING ] != NULL ); { @@ -590,15 +591,14 @@ } /* Compute root ascender, descender, text height, and max_advance */ - metrics->ascender = - FT_PIX_ROUND( FT_MulFix( face->root.ascender, metrics->y_scale ) ); - metrics->descender = - FT_PIX_ROUND( FT_MulFix( face->root.descender, metrics->y_scale ) ); - metrics->height = - FT_PIX_ROUND( FT_MulFix( face->root.height, metrics->y_scale ) ); - metrics->max_advance = - FT_PIX_ROUND( FT_MulFix( face->root.max_advance_width, - metrics->x_scale ) ); + metrics->ascender = ( FT_MulFix( face->root.ascender, + metrics->y_scale ) + 32 ) & -64; + metrics->descender = ( FT_MulFix( face->root.descender, + metrics->y_scale ) + 32 ) & -64; + metrics->height = ( FT_MulFix( face->root.height, + metrics->y_scale ) + 32 ) & -64; + metrics->max_advance = ( FT_MulFix( face->root.max_advance_width, + metrics->x_scale ) + 32 ) & -64; #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS @@ -749,8 +749,7 @@ sbit_metrics->descender = strike->hori.descender << 6; /* XXX: Is this correct? */ - sbit_metrics->height = sbit_metrics->ascender - - sbit_metrics->descender; + sbit_metrics->height = sbit_metrics->ascender - sbit_metrics->descender; /* XXX: Is this correct? */ sbit_metrics->max_advance = ( strike->hori.min_origin_SB + diff --git a/reactos/lib/freetype/src/type1/t1driver.c b/reactos/lib/freetype/src/type1/t1driver.c index fd201db8e38..ebd6a65907e 100644 --- a/reactos/lib/freetype/src/type1/t1driver.c +++ b/reactos/lib/freetype/src/type1/t1driver.c @@ -4,7 +4,7 @@ /* */ /* Type 1 driver interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -29,13 +29,8 @@ #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H -#include FT_SERVICE_MULTIPLE_MASTERS_H -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_XFREE86_NAME_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_SERVICE_POSTSCRIPT_INFO_H /*************************************************************************/ /* */ @@ -46,10 +41,6 @@ #undef FT_COMPONENT #define FT_COMPONENT trace_t1driver - /* - * GLYPH DICT SERVICE - * - */ static FT_Error t1_get_glyph_name( T1_Face face, @@ -78,6 +69,23 @@ } + /*************************************************************************/ + /* */ + /* <Function> */ + /* t1_get_name_index */ + /* */ + /* <Description> */ + /* Uses the Type 1 font's `glyph_names' table to find a given glyph */ + /* name's glyph index. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face object. */ + /* */ + /* glyph_name :: The glyph name. */ + /* */ + /* <Return> */ + /* Glyph index. 0 means `undefined character code'. */ + /* */ static FT_UInt t1_get_name_index( T1_Face face, FT_String* glyph_name ) @@ -97,17 +105,6 @@ return 0; } - static const FT_Service_GlyphDictRec t1_service_glyph_dict = - { - (FT_GlyphDict_GetNameFunc) t1_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)t1_get_name_index - }; - - - /* - * POSTSCRIPT NAME SERVICE - * - */ static const char* t1_get_ps_name( T1_Face face ) @@ -115,82 +112,61 @@ return (const char*) face->type1.font_name; } - static const FT_Service_PsFontNameRec t1_service_ps_name = - { - (FT_PsName_GetFunc)t1_get_ps_name - }; - - - /* - * MULTIPLE MASTERS SERVICE - * - */ - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - static const FT_Service_MultiMastersRec t1_service_multi_masters = - { - (FT_Get_MM_Func) T1_Get_Multi_Master, - (FT_Set_MM_Design_Func)T1_Set_MM_Design, - (FT_Set_MM_Blend_Func) T1_Set_MM_Blend - }; -#endif - - - /* - * POSTSCRIPT INFO SERVICE - * - */ - - static FT_Error - t1_ps_get_font_info( FT_Face face, - PS_FontInfoRec* afont_info ) - { - *afont_info = ((T1_Face)face)->type1.font_info; - return 0; - } - - - static FT_Int - t1_ps_has_glyph_names( FT_Face face ) - { - FT_UNUSED( face ); - return 1; - } - - - static const FT_Service_PsInfoRec t1_service_ps_info = - { - (PS_GetFontInfoFunc) t1_ps_get_font_info, - (PS_HasGlyphNamesFunc)t1_ps_has_glyph_names - }; - - - /* - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec t1_services[] = - { - { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t1_service_ps_name }, - { FT_SERVICE_ID_GLYPH_DICT, &t1_service_glyph_dict }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_1 }, - { FT_SERVICE_ID_POSTSCRIPT_INFO, &t1_service_ps_info }, - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - { FT_SERVICE_ID_MULTI_MASTERS, &t1_service_multi_masters }, -#endif - { NULL, NULL } - }; - + /*************************************************************************/ + /* */ + /* <Function> */ + /* Get_Interface */ + /* */ + /* <Description> */ + /* Each driver can provide one or more extensions to the base */ + /* FreeType API. These can be used to access format specific */ + /* features (e.g., all TrueType/OpenType resources share a common */ + /* file structure and common tables which can be accessed through the */ + /* `sfnt' interface), or more simply generic ones (e.g., the */ + /* `postscript names' interface which can be used to retrieve the */ + /* PostScript name of a given glyph index). */ + /* */ + /* <InOut> */ + /* driver :: A handle to a driver object. */ + /* */ + /* <Input> */ + /* t1_interface :: A string designing the interface. Examples are */ + /* `sfnt', `post_names', `charmaps', etc. */ + /* */ + /* <Return> */ + /* A typeless pointer to the extension's interface (normally a table */ + /* of function pointers). Returns NULL if the requested extension */ + /* isn't available (i.e., wasn't compiled in the driver at build */ + /* time). */ + /* */ static FT_Module_Interface Get_Interface( FT_Driver driver, const FT_String* t1_interface ) { FT_UNUSED( driver ); + FT_UNUSED( t1_interface ); - return ft_service_list_lookup( t1_services, t1_interface ); + if ( ft_strcmp( (const char*)t1_interface, "glyph_name" ) == 0 ) + return (FT_Module_Interface)t1_get_glyph_name; + + if ( ft_strcmp( (const char*)t1_interface, "name_index" ) == 0 ) + return (FT_Module_Interface)t1_get_name_index; + + if ( ft_strcmp( (const char*)t1_interface, "postscript_name" ) == 0 ) + return (FT_Module_Interface)t1_get_ps_name; + +#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + if ( ft_strcmp( (const char*)t1_interface, "get_mm" ) == 0 ) + return (FT_Module_Interface)T1_Get_Multi_Master; + + if ( ft_strcmp( (const char*)t1_interface, "set_mm_design") == 0 ) + return (FT_Module_Interface)T1_Set_MM_Design; + + if ( ft_strcmp( (const char*)t1_interface, "set_mm_blend") == 0 ) + return (FT_Module_Interface)T1_Set_MM_Blend; +#endif + return 0; } diff --git a/reactos/lib/freetype/src/type1/t1gload.c b/reactos/lib/freetype/src/type1/t1gload.c index c8d1db79f45..b4573d60f71 100644 --- a/reactos/lib/freetype/src/type1/t1gload.c +++ b/reactos/lib/freetype/src/type1/t1gload.c @@ -81,7 +81,7 @@ /* For ordinary fonts get the character data stored in the face record. */ { char_string->pointer = type1->charstrings[glyph_index]; - char_string->length = (FT_Int)type1->charstrings_len[glyph_index]; + char_string->length = type1->charstrings_len[glyph_index]; } if ( !error ) @@ -97,7 +97,6 @@ { FT_Incremental_MetricsRec metrics; - metrics.bearing_x = decoder->builder.left_bearing.x; metrics.bearing_y = decoder->builder.left_bearing.y; metrics.advance = decoder->builder.advance.x; @@ -112,7 +111,7 @@ #endif /* FT_CONFIG_OPTION_INCREMENTAL */ - return error; + return error; } @@ -121,12 +120,11 @@ FT_UInt glyph_index ) { FT_Data glyph_data; - FT_Error error = T1_Parse_Glyph_And_Get_Char_String( + FT_Error error = T1_Parse_Glyph_And_Get_Char_String( decoder, glyph_index, &glyph_data ); #ifdef FT_CONFIG_OPTION_INCREMENTAL - if ( !error ) { T1_Face face = (T1_Face)decoder->builder.face; @@ -137,7 +135,6 @@ face->root.internal->incremental_interface->object, &glyph_data ); } - #endif /* FT_CONFIG_OPTION_INCREMENTAL */ return error; @@ -187,7 +184,7 @@ error = T1_Parse_Glyph( &decoder, glyph_index ); if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance ) *max_advance = decoder.builder.advance.x; - + /* ignore the error if one occurred - skip to next glyph */ } @@ -374,11 +371,11 @@ if ( hinting ) { - metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance ); - metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance ); + metrics->horiAdvance = ( metrics->horiAdvance + 32 ) & -64; + metrics->vertAdvance = ( metrics->vertAdvance + 32 ) & -64; - metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX ); - metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY ); + metrics->vertBearingX = ( metrics->vertBearingX + 32 ) & -64; + metrics->vertBearingY = ( metrics->vertBearingY + 32 ) & -64; } } @@ -388,10 +385,10 @@ /* grid fit the bounding box if necessary */ if ( hinting ) { - cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); - cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); - cbox.xMax = FT_PIX_CEIL( cbox.xMax ); - cbox.yMax = FT_PIX_CEIL( cbox.yMax ); + cbox.xMin &= -64; + cbox.yMin &= -64; + cbox.xMax = ( cbox.xMax+63 ) & -64; + cbox.yMax = ( cbox.yMax+63 ) & -64; } metrics->width = cbox.xMax - cbox.xMin; diff --git a/reactos/lib/freetype/src/type1/t1load.c b/reactos/lib/freetype/src/type1/t1load.c index f830484e1be..6bc7b928583 100644 --- a/reactos/lib/freetype/src/type1/t1load.c +++ b/reactos/lib/freetype/src/type1/t1load.c @@ -4,7 +4,7 @@ /* */ /* Type 1 font loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -41,10 +41,11 @@ /* */ /* All other common cases are handled very simply. The matching rules */ /* are defined in the file `t1tokens.h' through the use of several */ - /* macros calls PARSE_XXX. This file is included twice here; the first */ - /* time to generate parsing callback functions, the second time to */ - /* generate a table of keywords (with pointers to the associated */ - /* callback functions). */ + /* macros calls PARSE_XXX. */ + /* */ + /* This file is included twice here; the first time to generate parsing */ + /* callback functions, the second to generate a table of keywords (with */ + /* pointers to the associated callback). */ /* */ /* The function `parse_dict' simply scans *linearly* a given dictionary */ /* (either the top-level or private one) and calls the appropriate */ @@ -70,6 +71,7 @@ #include "t1errors.h" + /*************************************************************************/ /* */ /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ @@ -98,7 +100,7 @@ { PS_Blend blend; FT_Memory memory = face->root.memory; - FT_Error error = T1_Err_Ok; + FT_Error error = 0; blend = face->blend; @@ -172,7 +174,7 @@ return error; Fail: - error = T1_Err_Invalid_File_Format; + error = -1; goto Exit; } @@ -203,10 +205,8 @@ axis->minimum = map->design_points[0]; axis->maximum = map->design_points[map->num_points - 1]; } - - error = T1_Err_Ok; + error = 0; } - return error; } @@ -253,7 +253,6 @@ error = T1_Err_Ok; } - return error; } @@ -290,7 +289,7 @@ FT_Fixed p_design = designs[p]; - /* exact match? */ + /* exact match ? */ if ( design == p_design ) { the_blend = blends[p]; @@ -306,7 +305,7 @@ before = p; } - /* now interpolate if necessary */ + /* now, interpolate if needed */ if ( before < 0 ) the_blend = blends[0]; @@ -387,9 +386,9 @@ parse_blend_axis_types( T1_Face face, T1_Loader loader ) { - T1_TokenRec axis_tokens[T1_MAX_MM_AXIS]; + T1_TokenRec axis_tokens[ T1_MAX_MM_AXIS ]; FT_Int n, num_axis; - FT_Error error = T1_Err_Ok; + FT_Error error = 0; PS_Blend blend; FT_Memory memory; @@ -449,16 +448,16 @@ parse_blend_design_positions( T1_Face face, T1_Loader loader ) { - T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS]; + T1_TokenRec design_tokens[ T1_MAX_MM_DESIGNS ]; FT_Int num_designs; FT_Int num_axis; T1_Parser parser = &loader->parser; - FT_Error error = T1_Err_Ok; + FT_Error error = 0; PS_Blend blend; - /* get the array of design tokens -- compute number of designs */ + /* get the array of design tokens - compute number of designs */ T1_ToTokenArray( parser, design_tokens, T1_MAX_MM_DESIGNS, &num_designs ); if ( num_designs <= 0 || num_designs > T1_MAX_MM_DESIGNS ) { @@ -480,15 +479,15 @@ for ( n = 0; n < (FT_UInt)num_designs; n++ ) { - T1_TokenRec axis_tokens[T1_MAX_MM_DESIGNS]; + T1_TokenRec axis_tokens[ T1_MAX_MM_DESIGNS ]; T1_Token token; FT_Int axis, n_axis; /* read axis/coordinates tokens */ token = design_tokens + n; - parser->root.cursor = token->start; - parser->root.limit = token->limit; + parser->root.cursor = token->start - 1; + parser->root.limit = token->limit + 1; T1_ToTokenArray( parser, axis_tokens, T1_MAX_MM_AXIS, &n_axis ); if ( n == 0 ) @@ -506,7 +505,7 @@ goto Exit; } - /* now read each axis token into the design position */ + /* now, read each axis token into the design position */ for ( axis = 0; axis < n_axis; axis++ ) { T1_Token token2 = axis_tokens + axis; @@ -531,7 +530,7 @@ parse_blend_design_map( T1_Face face, T1_Loader loader ) { - FT_Error error = T1_Err_Ok; + FT_Error error = 0; T1_Parser parser = &loader->parser; PS_Blend blend; T1_TokenRec axis_tokens[T1_MAX_MM_AXIS]; @@ -549,7 +548,6 @@ error = T1_Err_Invalid_File_Format; goto Exit; } - old_cursor = parser->root.cursor; old_limit = parser->root.limit; @@ -558,22 +556,29 @@ goto Exit; blend = face->blend; - /* now read each axis design map */ + /* now, read each axis design map */ for ( n = 0; n < num_axis; n++ ) { PS_DesignMap map = blend->design_map + n; - T1_Token axis_token; - T1_TokenRec point_tokens[T1_MAX_MM_MAP_POINTS]; + T1_Token token; FT_Int p, num_points; - axis_token = axis_tokens + n; + token = axis_tokens + n; + parser->root.cursor = token->start; + parser->root.limit = token->limit; - parser->root.cursor = axis_token->start; - parser->root.limit = axis_token->limit; - T1_ToTokenArray( parser, point_tokens, - T1_MAX_MM_MAP_POINTS, &num_points ); + /* count the number of map points */ + { + FT_Byte* ptr = token->start; + FT_Byte* limit = token->limit; + + num_points = 0; + for ( ; ptr < limit; ptr++ ) + if ( ptr[0] == '[' ) + num_points++; + } if ( num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS ) { FT_ERROR(( "parse_blend_design_map: incorrect table\n" )); @@ -589,15 +594,6 @@ for ( p = 0; p < num_points; p++ ) { - T1_Token point_token; - - - point_token = point_tokens + p; - - /* don't include delimiting brackets */ - parser->root.cursor = point_token->start + 1; - parser->root.limit = point_token->limit - 1; - map->design_points[p] = T1_ToInt( parser ); map->blend_points [p] = T1_ToFixed( parser, 0 ); } @@ -615,7 +611,7 @@ parse_weight_vector( T1_Face face, T1_Loader loader ) { - FT_Error error = T1_Err_Ok; + FT_Error error = 0; T1_Parser parser = &loader->parser; PS_Blend blend = face->blend; T1_TokenRec master; @@ -642,9 +638,8 @@ old_cursor = parser->root.cursor; old_limit = parser->root.limit; - /* don't include the delimiting brackets */ - parser->root.cursor = master.start + 1; - parser->root.limit = master.limit - 1; + parser->root.cursor = master.start; + parser->root.limit = master.limit; for ( n = 0; n < blend->num_designs; n++ ) { @@ -680,8 +675,6 @@ #endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */ - - /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -690,6 +683,15 @@ /*************************************************************************/ /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* First of all, define the token field static variables. This is a set */ + /* of T1_FieldRec variables used later. */ + /* */ + /*************************************************************************/ + + static FT_Error t1_load_keyword( T1_Face face, T1_Loader loader, @@ -772,12 +774,32 @@ static int is_space( FT_Byte c ) { - return ( c == ' ' || c == '\t' || - c == '\r' || c == '\n' || c == '\f' || - c == '\0' ); + return ( c == ' ' || c == '\t' || c == '\r' || c == '\n' ); } + static int + is_name_char( FT_Byte c ) + { + /* Note: PostScript allows any non-delimiting, non-whitespace */ + /* in a name (PS Ref Manual, 3rd Ed, p31) */ + /* PostScript delimiters include (,),<,>,[,],{,},/ and % */ + + return ( c != '(' && + c != ')' && + c != '<' && + c != '>' && + c != '[' && + c != ']' && + c != '{' && + c != '}' && + c != '/' && + c != '%' && + ! is_space( c ) + ); + } + + static int read_binary_data( T1_Parser parser, FT_Long* size, @@ -787,21 +809,20 @@ FT_Byte* limit = parser->root.limit; - /* the binary data has one of the following formats */ - /* */ - /* `size' [white*] RD white ....... ND */ - /* `size' [white*] -| white ....... |- */ - /* */ + /* the binary data has the following format */ + /* */ + /* `size' [white*] RD white ....... ND */ + /* */ T1_Skip_Spaces( parser ); - cur = parser->root.cursor; - if ( cur < limit && ft_isdigit( *cur ) ) + if ( cur < limit && (FT_Byte)( *cur - '0' ) < 10 ) { *size = T1_ToInt( parser ); - T1_Skip_PS_Token( parser ); /* `RD' or `-|' or something else */ + T1_Skip_Spaces( parser ); + T1_Skip_Alpha ( parser ); /* `RD' or `-|' or something else */ /* there is only one whitespace char after the */ /* `RD' or `-|' token */ @@ -817,8 +838,9 @@ } - /* We now define the routines to handle the `/Encoding', `/Subrs', */ - /* and `/CharStrings' dictionaries. */ + /* we will now define the routines used to handle */ + /* the `/Encoding', `/Subrs', and `/CharStrings' */ + /* dictionaries */ static void parse_font_matrix( T1_Face face, @@ -832,6 +854,10 @@ FT_Fixed temp_scale; + if ( matrix->xx || matrix->yx ) + /* with synthetic fonts, it's possible we get here twice */ + return; + (void)T1_ToFixedArray( parser, 6, temp, 3 ); temp_scale = ABS( temp[3] ); @@ -860,8 +886,8 @@ matrix->yy = temp[3]; /* note that the offsets must be expressed in integer font units */ - offset->x = temp[4] >> 16; - offset->y = temp[5] >> 16; + offset->x = temp[4] >> 16; + offset->y = temp[5] >> 16; } @@ -869,52 +895,49 @@ parse_encoding( T1_Face face, T1_Loader loader ) { - T1_Parser parser = &loader->parser; - FT_Byte* cur; - FT_Byte* limit = parser->root.limit; + T1_Parser parser = &loader->parser; + FT_Byte* cur = parser->root.cursor; + FT_Byte* limit = parser->root.limit; - PSAux_Service psaux = (PSAux_Service)face->psaux; + PSAux_Service psaux = (PSAux_Service)face->psaux; - T1_Skip_Spaces( parser ); - cur = parser->root.cursor; - if ( cur >= limit ) + /* skip whitespace */ + while ( is_space( *cur ) ) { - FT_ERROR(( "parse_encoding: out of bounds!\n" )); - parser->root.error = T1_Err_Invalid_File_Format; - return; + cur++; + if ( cur >= limit ) + { + FT_ERROR(( "parse_encoding: out of bounds!\n" )); + parser->root.error = T1_Err_Invalid_File_Format; + return; + } } - /* if we have a number or `[', the encoding is an array, */ - /* and we must load it now */ - if ( ft_isdigit( *cur ) || *cur == '[' ) + /* if we have a number, then the encoding is an array, */ + /* and we must load it now */ + if ( (FT_Byte)( *cur - '0' ) < 10 ) { - T1_Encoding encode = &face->type1.encoding; + T1_Encoding encode = &face->type1.encoding; FT_Int count, n; - PS_Table char_table = &loader->encoding_table; - FT_Memory memory = parser->root.memory; + PS_Table char_table = &loader->encoding_table; + FT_Memory memory = parser->root.memory; FT_Error error; - FT_Bool only_immediates = 0; - /* read the number of entries in the encoding; should be 256 */ - if ( *cur == '[' ) - { - count = 256; - only_immediates = 1; - parser->root.cursor++; - } - else - count = (FT_Int)T1_ToInt( parser ); + if ( encode->char_index ) + /* with synthetic fonts, it's possible we get here twice */ + return; - T1_Skip_Spaces( parser ); - if ( parser->root.cursor >= limit ) + /* read the number of entries in the encoding, should be 256 */ + count = (FT_Int)T1_ToInt( parser ); + if ( parser->root.error ) return; /* we use a T1_Table to store our charnames */ loader->num_chars = encode->num_chars = count; - if ( FT_NEW_ARRAY( encode->char_index, count ) || - FT_NEW_ARRAY( encode->char_name, count ) || + if ( FT_NEW_ARRAY( encode->char_index, count ) || + FT_NEW_ARRAY( encode->char_name, count ) || FT_SET_ERROR( psaux->ps_table_funcs->init( char_table, count, memory ) ) ) { @@ -931,11 +954,8 @@ T1_Add_Table( char_table, n, notdef, 8 ); } - /* Now we need to read records of the form */ - /* */ - /* ... charcode /charname ... */ - /* */ - /* for each entry in our table. */ + /* Now, we will need to read a record of the form */ + /* ... charcode /charname ... for each entry in our table */ /* */ /* We simply look for a number followed by an immediate */ /* name. Note that this ignores correctly the sequence */ @@ -945,85 +965,75 @@ /* */ /* used to clean the encoding array before anything else. */ /* */ - /* Alternatively, if the array is directly given as */ - /* */ - /* /Encoding [ ... ] */ - /* */ - /* we only read immediates. */ + /* We stop when we encounter a `def'. */ - n = 0; - T1_Skip_Spaces( parser ); + cur = parser->root.cursor; + limit = parser->root.limit; + n = 0; - while ( parser->root.cursor < limit ) + for ( ; cur < limit; ) { - cur = parser->root.cursor; + FT_Byte c; - /* we stop when we encounter a `def' or `]' */ - if ( *cur == 'd' && cur + 3 < limit ) + + c = *cur; + + /* we stop when we encounter a `def' */ + if ( c == 'd' && cur + 3 < limit ) { - if ( cur[1] == 'e' && - cur[2] == 'f' && - is_space( cur[3] ) ) + if ( cur[1] == 'e' && + cur[2] == 'f' && + is_space( cur[-1] ) && + is_space( cur[3] ) ) { FT_TRACE6(( "encoding end\n" )); - cur += 3; break; } } - if ( *cur == ']' ) - { - FT_TRACE6(( "encoding end\n" )); - cur++; - break; - } - /* check whether we've found an entry */ - if ( ft_isdigit( *cur ) || only_immediates ) + /* otherwise, we must find a number before anything else */ + if ( (FT_Byte)( c - '0' ) < 10 ) { FT_Int charcode; - if ( only_immediates ) - charcode = n; - else - { - charcode = (FT_Int)T1_ToInt( parser ); - T1_Skip_Spaces( parser ); - } + parser->root.cursor = cur; + charcode = (FT_Int)T1_ToInt( parser ); + cur = parser->root.cursor; - cur = parser->root.cursor; + /* skip whitespace */ + while ( cur < limit && is_space( *cur ) ) + cur++; - if ( *cur == '/' && cur + 2 < limit && n < count ) + if ( cur < limit && *cur == '/' ) { + /* bingo, we have an immediate name -- it must be a */ + /* character name */ + FT_Byte* cur2 = cur + 1; FT_PtrDist len; - cur++; + while ( cur2 < limit && is_name_char( *cur2 ) ) + cur2++; - parser->root.cursor = cur; - T1_Skip_PS_Token( parser ); - - len = parser->root.cursor - cur; + len = cur2 - cur - 1; parser->root.error = T1_Add_Table( char_table, charcode, - cur, len + 1 ); + cur + 1, len + 1 ); char_table->elements[charcode][len] = '\0'; if ( parser->root.error ) return; - n++; + cur = cur2; } } else - T1_Skip_PS_Token( parser ); - - T1_Skip_Spaces( parser ); + cur++; } face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY; parser->root.cursor = cur; } - /* Otherwise, we should have either `StandardEncoding', */ /* `ExpertEncoding', or `ISOLatin1Encoding' */ else @@ -1053,49 +1063,46 @@ parse_subrs( T1_Face face, T1_Loader loader ) { - T1_Parser parser = &loader->parser; - PS_Table table = &loader->subrs; - FT_Memory memory = parser->root.memory; - FT_Error error; - FT_Int n, num_subrs; + T1_Parser parser = &loader->parser; + PS_Table table = &loader->subrs; + FT_Memory memory = parser->root.memory; + FT_Error error; + FT_Int n; PSAux_Service psaux = (PSAux_Service)face->psaux; - T1_Skip_Spaces( parser ); + if ( loader->num_subrs ) + /* with synthetic fonts, it's possible we get here twice */ + return; - /* test for empty array */ - if ( parser->root.cursor < parser->root.limit && - *parser->root.cursor == '[' ) + if ( parser->root.cursor + 2 > parser->root.limit && + parser->root.cursor[0] == '[' && + parser->root.cursor[1] == ']' ) { - T1_Skip_PS_Token( parser ); - T1_Skip_Spaces ( parser ); - if ( parser->root.cursor >= parser->root.limit || - *parser->root.cursor != ']' ) - parser->root.error = T1_Err_Invalid_File_Format; + /* empty array */ return; } - num_subrs = (FT_Int)T1_ToInt( parser ); + loader->num_subrs = (FT_Int)T1_ToInt( parser ); + if ( parser->root.error ) + return; /* position the parser right before the `dup' of the first subr */ - T1_Skip_PS_Token( parser ); /* `array' */ - T1_Skip_Spaces ( parser ); + T1_Skip_Spaces( parser ); + T1_Skip_Alpha( parser ); /* `array' */ + T1_Skip_Spaces( parser ); - /* initialize subrs array -- with synthetic fonts it is possible */ - /* we get here twice */ - if ( !loader->num_subrs ) - { - error = psaux->ps_table_funcs->init( table, num_subrs, memory ); - if ( error ) - goto Fail; - } + /* initialize subrs array */ + error = psaux->ps_table_funcs->init( table, loader->num_subrs, memory ); + if ( error ) + goto Fail; /* the format is simple: */ /* */ /* `index' + binary data */ /* */ - for ( n = 0; n < num_subrs; n++ ) + for ( n = 0; n < loader->num_subrs; n++ ) { FT_Long idx, size; FT_Byte* base; @@ -1106,8 +1113,6 @@ if ( ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 ) break; - T1_Skip_PS_Token( parser ); /* `dup' */ - idx = T1_ToInt( parser ); if ( !read_binary_data( parser, &size, &base ) ) @@ -1117,19 +1122,16 @@ /* (bound to `noaccess put') or by two separate tokens: */ /* `noaccess' & `put'. We position the parser right */ /* before the next `dup', if any. */ - T1_Skip_PS_Token( parser ); /* `NP' or `|' or `noaccess' */ - T1_Skip_Spaces ( parser ); + T1_Skip_Spaces( parser ); + T1_Skip_Alpha( parser ); /* `NP' or `I' or `noaccess' */ + T1_Skip_Spaces( parser ); if ( ft_strncmp( (char*)parser->root.cursor, "put", 3 ) == 0 ) { - T1_Skip_PS_Token( parser ); /* skip `put' */ - T1_Skip_Spaces ( parser ); + T1_Skip_Alpha( parser ); /* skip `put' */ + T1_Skip_Spaces( parser ); } - /* with synthetic fonts it is possible we get here twice */ - if ( loader->num_subrs ) - continue; - /* some fonts use a value of -1 for lenIV to indicate that */ /* the charstrings are unencoded */ /* */ @@ -1155,10 +1157,6 @@ if ( error ) goto Fail; } - - if ( !loader->num_subrs ) - loader->num_subrs = num_subrs; - return; Fail: @@ -1166,9 +1164,6 @@ } -#define TABLE_EXTEND 5 - - static void parse_charstrings( T1_Face face, T1_Loader loader ) @@ -1184,43 +1179,41 @@ FT_Byte* cur; FT_Byte* limit = parser->root.limit; - FT_Int n, num_glyphs; + FT_Int n; FT_UInt notdef_index = 0; FT_Byte notdef_found = 0; - num_glyphs = (FT_Int)T1_ToInt( parser ); - /* some fonts like Optima-Oblique not only define the /CharStrings */ - /* array but access it also */ - if ( num_glyphs == 0 || parser->root.error ) + if ( loader->num_glyphs ) + /* with synthetic fonts, it's possible we get here twice */ return; - /* initialize tables, leaving space for addition of .notdef, */ - /* if necessary, and a few other glyphs to handle buggy */ - /* fonts which have more glyphs than specified. */ + loader->num_glyphs = (FT_Int)T1_ToInt( parser ); + if ( parser->root.error ) + return; - /* for some non-standard fonts like `Optima' which provides */ - /* different outlines depending on the resolution it is */ - /* possible to get here twice */ - if ( !loader->num_glyphs ) - { - error = psaux->ps_table_funcs->init( - code_table, num_glyphs + 1 + TABLE_EXTEND, memory ); - if ( error ) - goto Fail; + /* initialize tables (leaving room for addition of .notdef, */ + /* if necessary). */ - error = psaux->ps_table_funcs->init( - name_table, num_glyphs + 1 + TABLE_EXTEND, memory ); - if ( error ) - goto Fail; + error = psaux->ps_table_funcs->init( code_table, + loader->num_glyphs + 1, + memory ); + if ( error ) + goto Fail; - /* Initialize table for swapping index notdef_index and */ - /* index 0 names and codes (if necessary). */ + error = psaux->ps_table_funcs->init( name_table, + loader->num_glyphs + 1, + memory ); + if ( error ) + goto Fail; - error = psaux->ps_table_funcs->init( swap_table, 4, memory ); - if ( error ) - goto Fail; - } + /* Initialize table for swapping index notdef_index and */ + /* index 0 names and codes (if necessary). */ + + error = psaux->ps_table_funcs->init( swap_table, 4, memory ); + + if ( error ) + goto Fail; n = 0; @@ -1232,7 +1225,9 @@ /* the format is simple: */ /* `/glyphname' + binary data */ - + /* */ + /* note that we stop when we find a `def' */ + /* */ T1_Skip_Spaces( parser ); cur = parser->root.cursor; @@ -1240,62 +1235,50 @@ break; /* we stop when we find a `def' or `end' keyword */ - if ( cur + 3 < limit && is_space( cur[3] ) ) - { - if ( cur[0] == 'd' && - cur[1] == 'e' && - cur[2] == 'f' ) - break; - - if ( cur[0] == 'e' && - cur[1] == 'n' && - cur[2] == 'd' ) - break; - } - - T1_Skip_PS_Token( parser ); - - if ( *cur == '/' ) + if ( *cur == 'd' && + cur + 3 < limit && + cur[1] == 'e' && + cur[2] == 'f' ) + break; + + if ( *cur == 'e' && + cur + 3 < limit && + cur[1] == 'n' && + cur[2] == 'd' ) + break; + + if ( *cur != '/' ) + T1_Skip_Alpha( parser ); + else { + FT_Byte* cur2 = cur + 1; FT_PtrDist len; - if ( cur + 1 >= limit ) - { - error = T1_Err_Invalid_File_Format; - goto Fail; - } + while ( cur2 < limit && is_name_char( *cur2 ) ) + cur2++; + len = cur2 - cur - 1; - cur++; /* skip `/' */ - len = parser->root.cursor - cur; - - if ( !read_binary_data( parser, &size, &base ) ) - return; - - /* for some non-standard fonts like `Optima' which provides */ - /* different outlines depending on the resolution it is */ - /* possible to get here twice */ - if ( loader->num_glyphs ) - continue; - - error = T1_Add_Table( name_table, n, cur, len + 1 ); + error = T1_Add_Table( name_table, n, cur + 1, len + 1 ); if ( error ) goto Fail; /* add a trailing zero to the name table */ name_table->elements[n][len] = '\0'; - /* record index of /.notdef */ - if ( *cur == '.' && - ft_strcmp( ".notdef", + /* record index of /.notdef */ + if ( ft_strcmp( (const char*)".notdef", (const char*)(name_table->elements[n]) ) == 0 ) { notdef_index = n; notdef_found = 1; } - if ( face->type1.private_dict.lenIV >= 0 && - n < num_glyphs + TABLE_EXTEND ) + parser->root.cursor = cur2; + if ( !read_binary_data( parser, &size, &base ) ) + return; + + if ( face->type1.private_dict.lenIV >= 0 ) { FT_Byte* temp; @@ -1316,24 +1299,23 @@ goto Fail; n++; + if ( n >= loader->num_glyphs ) + break; } } - if ( loader->num_glyphs ) - return; - else - loader->num_glyphs = n; + loader->num_glyphs = n; - /* if /.notdef is found but does not occupy index 0, do our magic. */ + /* if /.notdef is found but does not occupy index 0, do our magic. */ if ( ft_strcmp( (const char*)".notdef", (const char*)name_table->elements[0] ) && notdef_found ) { - /* Swap glyph in index 0 with /.notdef glyph. First, add index 0 */ - /* name and code entries to swap_table. Then place notdef_index */ - /* name and code entries into swap_table. Then swap name and code */ - /* entries at indices notdef_index and 0 using values stored in */ - /* swap_table. */ + /* Swap glyph in index 0 with /.notdef glyph. First, add index 0 */ + /* name and code entries to swap_table. Then place notdef_index name */ + /* and code entries into swap_table. Then swap name and code */ + /* entries at indices notdef_index and 0 using values stored in */ + /* swap_table. */ /* Index 0 name */ error = T1_Add_Table( swap_table, 0, @@ -1444,14 +1426,6 @@ } - /*************************************************************************/ - /* */ - /* Define the token field static variables. This is a set of */ - /* T1_FieldRec variables. */ - /* */ - /*************************************************************************/ - - static const T1_FieldRec t1_keywords[] = { @@ -1488,181 +1462,121 @@ FT_Byte* keyword_flags ) { T1_Parser parser = &loader->parser; - FT_Byte *limit, *start_binary; - FT_Bool have_integer = 0; parser->root.cursor = base; parser->root.limit = base + size; - parser->root.error = T1_Err_Ok; + parser->root.error = 0; - limit = parser->root.limit; - - T1_Skip_Spaces( parser ); - - while ( parser->root.cursor < limit ) { - FT_Byte* cur; + FT_Byte* cur = base; + FT_Byte* limit = cur + size; - cur = parser->root.cursor; - - /* look for `FontDirectory' which causes problems for some fonts */ - if ( *cur == 'F' && cur + 25 < limit && - ft_strncmp( (char*)cur, "FontDirectory", 13 ) == 0 ) + for ( ; cur < limit; cur++ ) { - FT_Byte* cur2; - - - /* skip the `FontDirectory' keyword */ - T1_Skip_PS_Token( parser ); - T1_Skip_Spaces ( parser ); - cur = cur2 = parser->root.cursor; - - /* look up the `known' keyword */ - while ( cur < limit ) + /* look for `FontDirectory', which causes problems on some fonts */ + if ( *cur == 'F' && cur + 25 < limit && + ft_strncmp( (char*)cur, "FontDirectory", 13 ) == 0 ) { - if ( *cur == 'k' && cur + 5 < limit && - ft_strncmp( (char*)cur, "known", 5 ) == 0 ) - break; - - T1_Skip_PS_Token( parser ); - T1_Skip_Spaces ( parser ); - cur = parser->root.cursor; - } - - if ( cur < limit ) - { - T1_TokenRec token; + FT_Byte* cur2; - /* skip the `known' keyword and the token following it */ - T1_Skip_PS_Token( parser ); - T1_ToToken( parser, &token ); + /* skip the `FontDirectory' keyword */ + cur += 13; + cur2 = cur; - /* if the last token was an array, skip it! */ - if ( token.type == T1_TOKEN_TYPE_ARRAY ) - cur2 = parser->root.cursor; - } - parser->root.cursor = cur2; - have_integer = 0; - } + /* lookup the `known' keyword */ + while ( cur < limit && *cur != 'k' && + ft_strncmp( (char*)cur, "known", 5 ) ) + cur++; - /* look for `eexec' */ - else if ( *cur == 'e' && cur + 5 < limit && - ft_strncmp( (char*)cur, "eexec", 5 ) == 0 ) - break; - - /* look for `closefile' which ends the eexec section */ - else if ( *cur == 'c' && cur + 9 < limit && - ft_strncmp( (char*)cur, "closefile", 9 ) == 0 ) - break; - - /* check whether we have an integer */ - else if ( ft_isdigit( *cur ) ) - { - start_binary = cur; - T1_Skip_PS_Token( parser ); - have_integer = 1; - } - - /* in valid Type 1 fonts we don't see `RD' or `-|' directly */ - /* since those tokens are handled by parse_subrs and */ - /* parse_charstrings */ - else if ( *cur == 'R' && cur + 6 < limit && *(cur + 1) == 'D' && - have_integer ) - { - FT_Long s; - FT_Byte* b; - - - parser->root.cursor = start_binary; - if ( !read_binary_data( parser, &s, &b ) ) - return T1_Err_Invalid_File_Format; - have_integer = 0; - } - - else if ( *cur == '-' && cur + 6 < limit && *(cur + 1) == '|' && - have_integer ) - { - FT_Long s; - FT_Byte* b; - - - parser->root.cursor = start_binary; - if ( !read_binary_data( parser, &s, &b ) ) - return T1_Err_Invalid_File_Format; - have_integer = 0; - } - - /* look for immediates */ - else if ( *cur == '/' && cur + 2 < limit ) - { - FT_PtrDist len; - - - cur++; - - parser->root.cursor = cur; - T1_Skip_PS_Token( parser ); - - len = parser->root.cursor - cur; - - if ( len > 0 && len < 22 && parser->root.cursor < limit ) - { - /* now compare the immediate name to the keyword table */ - T1_Field keyword = (T1_Field)t1_keywords; - FT_Byte* keyword_flag = keyword_flags; - - - for (;;) + if ( cur < limit ) { - FT_Byte* name; + T1_TokenRec token; - name = (FT_Byte*)keyword->ident; - if ( !name ) - break; + /* skip the `known' keyword and the token following it */ + cur += 5; + loader->parser.root.cursor = cur; + T1_ToToken( &loader->parser, &token ); - if ( cur[0] == name[0] && - len == ft_strlen( (const char *)name ) && - ft_memcmp( cur, name, len ) == 0 ) + /* if the last token was an array, skip it! */ + if ( token.type == T1_TOKEN_TYPE_ARRAY ) + cur2 = parser->root.cursor; + } + cur = cur2; + } + /* look for immediates */ + else if ( *cur == '/' && cur + 2 < limit ) + { + FT_Byte* cur2; + FT_PtrDist len; + + + cur++; + cur2 = cur; + while ( cur2 < limit && is_name_char( *cur2 ) ) + cur2++; + + len = cur2 - cur; + if ( len > 0 && len < 22 ) + { { - /* We found it -- run the parsing callback! */ - /* We only record the first instance of any */ - /* field to deal adequately with synthetic */ - /* fonts; /Subrs and /CharStrings are */ - /* handled specially. */ - if ( keyword_flag[0] == 0 || - ft_strcmp( (const char*)name, "Subrs" ) == 0 || - ft_strcmp( (const char*)name, "CharStrings") == 0 ) - { - parser->root.error = t1_load_keyword( face, - loader, - keyword ); - if ( parser->root.error ) - return parser->root.error; - } - keyword_flag[0] = 1; - break; - } + /* now, compare the immediate name to the keyword table */ + T1_Field keyword = (T1_Field)t1_keywords; + FT_Byte* keyword_flag = keyword_flags; - keyword++; - keyword_flag++; + + for (;;) + { + FT_Byte* name; + + + name = (FT_Byte*)keyword->ident; + if ( !name ) + break; + + if ( cur[0] == name[0] && + len == ft_strlen( (const char*)name ) ) + { + FT_PtrDist n; + + + for ( n = 1; n < len; n++ ) + if ( cur[n] != name[n] ) + break; + + if ( n >= len ) + { + /* we found it -- run the parsing callback! */ + parser->root.cursor = cur2; + T1_Skip_Spaces( parser ); + + /* we only record the first instance of any */ + /* field to deal adequately with synthetic fonts */ + if ( keyword_flag[0] == 0 ) + { + parser->root.error = t1_load_keyword( face, + loader, + keyword ); + if ( parser->root.error ) + return parser->root.error; + } + keyword_flag[0] = 1; + + cur = parser->root.cursor; + break; + } + } + keyword++; + keyword_flag++; + } + } } } - - have_integer = 0; } - else - { - T1_Skip_PS_Token( parser ); - have_integer = 0; - } - - T1_Skip_Spaces( parser ); } - return parser->root.error; } @@ -1774,7 +1688,7 @@ #endif if ( !loader.charstrings.init ) { - FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face!\n" )); + FT_ERROR(( "T1_Open_Face: no charstrings array in face!\n" )); error = T1_Err_Invalid_File_Format; } @@ -1828,21 +1742,16 @@ if ( ft_strcmp( (const char*)".notdef", (const char*)glyph_name ) != 0 ) { - if ( charcode < min_char ) - min_char = charcode; - if ( charcode > max_char ) - max_char = charcode; + if ( charcode < min_char ) min_char = charcode; + if ( charcode > max_char ) max_char = charcode; } break; } } } - - /* - * Yes, this happens: Certain PDF-embedded fonts have only a - * `.notdef' glyph defined! + /* Yes, this happens: Certain PDF-embedded fonts have only a ".notdef" + * glyph defined! */ - if ( min_char > max_char ) { min_char = 0; diff --git a/reactos/lib/freetype/src/type1/t1objs.c b/reactos/lib/freetype/src/type1/t1objs.c index 64d2885a61b..c62e72b7e12 100644 --- a/reactos/lib/freetype/src/type1/t1objs.c +++ b/reactos/lib/freetype/src/type1/t1objs.c @@ -19,7 +19,6 @@ #include <ft2build.h> #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_IDS_H #include "t1gload.h" #include "t1load.h" @@ -30,7 +29,7 @@ #include "t1afm.h" #endif -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include FT_INTERNAL_POSTSCRIPT_AUX_H @@ -230,6 +229,9 @@ FT_FREE( type1->encoding.char_name ); FT_FREE( type1->font_name ); + FT_FREE( type1->paint_type ); + FT_FREE( type1->stroke_width ); + #ifndef T1_CONFIG_OPTION_NO_AFM /* release afm data if present */ if ( face->afm_data ) @@ -276,11 +278,11 @@ FT_Int num_params, FT_Parameter* params ) { - FT_Error error; - FT_Service_PsCMaps psnames; - PSAux_Service psaux; - T1_Font type1 = &face->type1; - PS_FontInfo info = &type1->font_info; + FT_Error error; + PSNames_Service psnames; + PSAux_Service psaux; + T1_Font type1 = &face->type1; + PS_FontInfo info = &type1->font_info; FT_UNUSED( num_params ); FT_UNUSED( params ); @@ -290,8 +292,9 @@ face->root.num_faces = 1; - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); - face->psnames = psnames; + face->psnames = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), + "psnames" ); + psnames = (PSNames_Service)face->psnames; face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), "psaux" ); @@ -431,10 +434,8 @@ root->max_advance_height = root->height; - root->underline_position = - (FT_Short)( info->underline_position >> 16 ); - root->underline_thickness = - (FT_Short)( info->underline_thickness >> 16 ); + root->underline_position = info->underline_position >> 16; + root->underline_thickness = info->underline_thickness >> 16; root->internal->max_points = 0; root->internal->max_contours = 0; @@ -468,25 +469,25 @@ { case T1_ENCODING_TYPE_STANDARD: charmap.encoding = FT_ENCODING_ADOBE_STANDARD; - charmap.encoding_id = TT_ADOBE_ID_STANDARD; + charmap.encoding_id = 0; clazz = cmap_classes->standard; break; case T1_ENCODING_TYPE_EXPERT: charmap.encoding = FT_ENCODING_ADOBE_EXPERT; - charmap.encoding_id = TT_ADOBE_ID_EXPERT; + charmap.encoding_id = 1; clazz = cmap_classes->expert; break; case T1_ENCODING_TYPE_ARRAY: charmap.encoding = FT_ENCODING_ADOBE_CUSTOM; - charmap.encoding_id = TT_ADOBE_ID_CUSTOM; + charmap.encoding_id = 2; clazz = cmap_classes->custom; break; case T1_ENCODING_TYPE_ISOLATIN1: charmap.encoding = FT_ENCODING_ADOBE_LATIN_1; - charmap.encoding_id = TT_ADOBE_ID_LATIN_1; + charmap.encoding_id = 3; clazz = cmap_classes->unicode; break; diff --git a/reactos/lib/freetype/src/type1/t1parse.c b/reactos/lib/freetype/src/type1/t1parse.c index 544aa093f8d..c1783f02936 100644 --- a/reactos/lib/freetype/src/type1/t1parse.c +++ b/reactos/lib/freetype/src/type1/t1parse.c @@ -4,7 +4,7 @@ /* */ /* Type 1 parser (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -65,30 +65,53 @@ /*************************************************************************/ - static FT_Error - read_pfb_tag( FT_Stream stream, - FT_UShort *atag, - FT_Long *asize ) +#define IS_T1_WHITESPACE( c ) ( (c) == ' ' || (c) == '\t' ) +#define IS_T1_LINESPACE( c ) ( (c) == '\r' || (c) == '\n' ) + +#define IS_T1_SPACE( c ) ( IS_T1_WHITESPACE( c ) || IS_T1_LINESPACE( c ) ) + + + typedef struct PFB_Tag_ { - FT_Error error; FT_UShort tag; FT_Long size; + } PFB_Tag; - *atag = 0; - *asize = 0; - if ( !FT_READ_USHORT( tag ) ) +#undef FT_STRUCTURE +#define FT_STRUCTURE PFB_Tag + + + static + const FT_Frame_Field pfb_tag_fields[] = + { + FT_FRAME_START( 6 ), + FT_FRAME_USHORT ( tag ), + FT_FRAME_LONG_LE( size ), + FT_FRAME_END + }; + + + static FT_Error + read_pfb_tag( FT_Stream stream, + FT_UShort* tag, + FT_Long* size ) + { + FT_Error error; + PFB_Tag head; + + + *tag = 0; + *size = 0; + if ( !FT_STREAM_READ_FIELDS( pfb_tag_fields, &head ) ) { - if ( tag == 0x8001U || tag == 0x8002U ) + if ( head.tag == 0x8001U || head.tag == 0x8002U ) { - if ( !FT_READ_LONG_LE( size ) ) - *asize = size; + *tag = head.tag; + *size = head.size; } - - *atag = tag; } - return error; } @@ -104,7 +127,7 @@ FT_Long size; - psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory ); + psaux->ps_parser_funcs->init( &parser->root,0, 0, memory ); parser->stream = stream; parser->base_len = 0; @@ -219,13 +242,36 @@ } + /* return the value of an hexadecimal digit */ + static int + hexa_value( char c ) + { + unsigned int d; + + + d = (unsigned int)( c - '0' ); + if ( d <= 9 ) + return (int)d; + + d = (unsigned int)( c - 'a' ); + if ( d <= 5 ) + return (int)( d + 10 ); + + d = (unsigned int)( c - 'A' ); + if ( d <= 5 ) + return (int)( d + 10 ); + + return -1; + } + + FT_LOCAL_DEF( FT_Error ) T1_Get_Private_Dict( T1_Parser parser, PSAux_Service psaux ) { FT_Stream stream = parser->stream; FT_Memory memory = parser->root.memory; - FT_Error error = T1_Err_Ok; + FT_Error error = 0; FT_Long size; @@ -279,8 +325,7 @@ break; } - if ( FT_STREAM_READ( parser->private_dict + parser->private_len, - size ) ) + if ( FT_STREAM_READ( parser->private_dict + parser->private_len, size ) ) goto Fail; parser->private_len += size; @@ -288,9 +333,9 @@ } else { - /* We have already `loaded' the whole PFA font file into memory; */ + /* we have already `loaded' the whole PFA font file into memory; */ /* if this is a memory resource, allocate a new block to hold */ - /* the private dict. Otherwise, simply overwrite into the base */ + /* the private dict. Otherwise, simply overwrite into the base */ /* dictionary block in the heap. */ /* first of all, look at the `eexec' keyword */ @@ -299,18 +344,24 @@ FT_Byte c; - Again: for (;;) { c = cur[0]; if ( c == 'e' && cur + 9 < limit ) /* 9 = 5 letters for `eexec' + */ /* newline + 4 chars */ { - if ( cur[1] == 'e' && - cur[2] == 'x' && - cur[3] == 'e' && - cur[4] == 'c' ) + if ( cur[1] == 'e' && cur[2] == 'x' && + cur[3] == 'e' && cur[4] == 'c' ) + { + cur += 6; /* we skip the newling after the `eexec' */ + + /* XXX: Some fonts use DOS-linefeeds, i.e. \r\n; we need to */ + /* skip the extra \n if we find it */ + if ( cur[0] == '\n' ) + cur++; + break; + } } cur++; if ( cur >= limit ) @@ -322,57 +373,10 @@ } } - /* check whether `eexec' was real -- it could be in a comment */ - /* or string (as e.g. in u003043t.gsf from ghostscript) */ - - parser->root.cursor = parser->base_dict; - parser->root.limit = cur + 9; - - cur = parser->root.cursor; - limit = parser->root.limit; - - while ( cur < limit ) - { - if ( *cur == 'e' && ft_strncmp( (char*)cur, "eexec", 5 ) == 0 ) - goto Found; - - T1_Skip_PS_Token( parser ); - T1_Skip_Spaces ( parser ); - cur = parser->root.cursor; - } - - /* we haven't found the correct `eexec'; go back and continue */ - /* searching */ - - cur = limit; - limit = parser->base_dict + parser->base_len; - goto Again; - /* now determine where to write the _encrypted_ binary private */ /* dictionary. We overwrite the base dictionary for disk-based */ /* resources and allocate a new block otherwise */ - Found: - parser->root.limit = parser->base_dict + parser->base_len; - - T1_Skip_PS_Token( parser ); - cur = parser->root.cursor; - if ( *cur == '\r' ) - { - cur++; - if ( *cur == '\n' ) - cur++; - } - else if ( *cur == '\n' ) - cur++; - else - { - FT_ERROR(( "T1_Get_Private_Dict:" )); - FT_ERROR(( " `eexec' not properly terminated\n" )); - error = T1_Err_Invalid_File_Format; - goto Exit; - } - size = (FT_Long)( parser->base_len - ( cur - parser->base_dict ) ); if ( parser->in_memory ) @@ -398,38 +402,51 @@ /* the `eexec' keyword); if they all are hexadecimal digits, then */ /* we have a case of ASCII storage */ - if ( ft_isxdigit( cur[0] ) && ft_isxdigit( cur[1] ) && - ft_isxdigit( cur[2] ) && ft_isxdigit( cur[3] ) ) + if ( ( hexa_value( cur[0] ) | hexa_value( cur[1] ) | + hexa_value( cur[2] ) | hexa_value( cur[3] ) ) < 0 ) + + /* binary encoding -- `simply' copy the private dict */ + FT_MEM_COPY( parser->private_dict, cur, size ); + + else { /* ASCII hexadecimal encoding */ - FT_Long len; + + FT_Byte* write; + FT_Int count; - parser->root.cursor = cur; - (void)psaux->ps_parser_funcs->to_bytes( &parser->root, - parser->private_dict, - parser->private_len, - &len, - 0 ); - parser->private_len = len; + write = parser->private_dict; + count = 0; + + for ( ;cur < limit; cur++ ) + { + int hex1; + + + /* check for newline */ + if ( cur[0] == '\r' || cur[0] == '\n' ) + continue; + + /* exit if we have a non-hexadecimal digit that isn't a newline */ + hex1 = hexa_value( cur[0] ); + if ( hex1 < 0 || cur + 1 >= limit ) + break; + + /* otherwise, store byte */ + *write++ = (FT_Byte)( ( hex1 << 4 ) | hexa_value( cur[1] ) ); + count++; + cur++; + } /* put a safeguard */ - parser->private_dict[len] = '\0'; + parser->private_len = write - parser->private_dict; + *write++ = 0; } - else - /* binary encoding -- copy the private dict */ - FT_MEM_MOVE( parser->private_dict, cur, size ); } /* we now decrypt the encoded binary private dictionary */ psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U ); - - /* replace the four random bytes at the beginning with whitespace */ - parser->private_dict[0] = ' '; - parser->private_dict[1] = ' '; - parser->private_dict[2] = ' '; - parser->private_dict[3] = ' '; - parser->root.base = parser->private_dict; parser->root.cursor = parser->private_dict; parser->root.limit = parser->root.cursor + parser->private_len; diff --git a/reactos/lib/freetype/src/type1/t1parse.h b/reactos/lib/freetype/src/type1/t1parse.h index 6fa4ca624a2..ecc206739ef 100644 --- a/reactos/lib/freetype/src/type1/t1parse.h +++ b/reactos/lib/freetype/src/type1/t1parse.h @@ -4,7 +4,7 @@ /* */ /* Type 1 parser (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -69,9 +69,9 @@ FT_BEGIN_HEADER FT_Byte* private_dict; FT_Long private_len; - FT_Bool in_pfb; - FT_Bool in_memory; - FT_Bool single_block; + FT_Byte in_pfb; + FT_Byte in_memory; + FT_Byte single_block; } T1_ParserRec, *T1_Parser; @@ -91,8 +91,8 @@ FT_BEGIN_HEADER } while ( 0 ) -#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) -#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root ) +#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) +#define T1_Skip_Alpha( p ) (p)->root.funcs.skip_alpha ( &(p)->root ) #define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root ) #define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) diff --git a/reactos/lib/freetype/src/type42/t42drivr.c b/reactos/lib/freetype/src/type42/t42drivr.c index f4a7becbad7..d9668775c9c 100644 --- a/reactos/lib/freetype/src/type42/t42drivr.c +++ b/reactos/lib/freetype/src/type42/t42drivr.c @@ -4,7 +4,7 @@ /* */ /* High-level Type 42 driver interface (body). */ /* */ -/* Copyright 2002, 2003, 2004 by Roberto Alameda. */ +/* Copyright 2002, 2003 by Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ @@ -24,9 +24,10 @@ /* 2) Incremental fonts making use of the GlyphDirectory keyword */ /* will be loaded, but the rendering will be using the TrueType */ /* tables. */ - /* 3) As for Type1 fonts, CDevProc is not supported. */ - /* 4) The Metrics dictionary is not supported. */ - /* 5) AFM metrics are not supported. */ + /* 3) The sfnts array is expected to be ASCII, not binary. */ + /* 4) As for Type1 fonts, CDevProc is not supported. */ + /* 5) The Metrics dictionary is not supported. */ + /* 6) AFM metrics are not supported. */ /* */ /* In other words, this driver supports Type42 fonts derived from */ /* TrueType fonts in a non-CID manner, as done by usual conversion */ @@ -40,21 +41,11 @@ #include "t42error.h" #include FT_INTERNAL_DEBUG_H -#include FT_SERVICE_XFREE86_NAME_H -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_POSTSCRIPT_INFO_H #undef FT_COMPONENT #define FT_COMPONENT trace_t42 - /* - * - * GLYPH DICT SERVICE - * - */ - static FT_Error t42_get_glyph_name( T42_Face face, FT_UInt glyph_index, @@ -82,6 +73,13 @@ } + static const char* + t42_get_ps_name( T42_Face face ) + { + return (const char*)face->type1.font_name; + } + + static FT_UInt t42_get_name_index( T42_Face face, FT_String* glyph_name ) @@ -95,92 +93,30 @@ gname = face->type1.glyph_names[i]; if ( !ft_strcmp( glyph_name, gname ) ) - return (FT_UInt)ft_atol( (const char *)face->type1.charstrings[i] ); + return ft_atoi( (const char *)face->type1.charstrings[i] ); } return 0; } - static FT_Service_GlyphDictRec t42_service_glyph_dict = - { - (FT_GlyphDict_GetNameFunc) t42_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)t42_get_name_index - }; - - - /* - * - * POSTSCRIPT NAME SERVICE - * - */ - - static const char* - t42_get_ps_font_name( T42_Face face ) - { - return (const char*)face->type1.font_name; - } - - - static FT_Service_PsFontNameRec t42_service_ps_font_name = - { - (FT_PsName_GetFunc)t42_get_ps_font_name - }; - - - /* - * - * POSTSCRIPT INFO SERVICE - * - */ - - static FT_Error - t42_ps_get_font_info( FT_Face face, - PS_FontInfoRec* afont_info ) - { - *afont_info = ((T42_Face)face)->type1.font_info; - return 0; - } - - - static FT_Int - t42_ps_has_glyph_names( FT_Face face ) - { - FT_UNUSED( face ); - return 1; - } - - - static const FT_Service_PsInfoRec t42_service_ps_info = - { - (PS_GetFontInfoFunc) t42_ps_get_font_info, - (PS_HasGlyphNamesFunc)t42_ps_has_glyph_names - }; - - - /* - * - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec t42_services[] = - { - { FT_SERVICE_ID_GLYPH_DICT, &t42_service_glyph_dict }, - { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t42_service_ps_font_name }, - { FT_SERVICE_ID_POSTSCRIPT_INFO, &t42_service_ps_info }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_42 }, - { NULL, NULL } - }; - - static FT_Module_Interface T42_Get_Interface( FT_Driver driver, const FT_String* t42_interface ) { FT_UNUSED( driver ); - return ft_service_list_lookup( t42_services, t42_interface ); + /* Any additional interface are defined here */ + if (ft_strcmp( (const char*)t42_interface, "glyph_name" ) == 0 ) + return (FT_Module_Interface)t42_get_glyph_name; + + if ( ft_strcmp( (const char*)t42_interface, "name_index" ) == 0 ) + return (FT_Module_Interface)t42_get_name_index; + + if ( ft_strcmp( (const char*)t42_interface, "postscript_name" ) == 0 ) + return (FT_Module_Interface)t42_get_ps_name; + + return 0; } diff --git a/reactos/lib/freetype/src/type42/t42objs.c b/reactos/lib/freetype/src/type42/t42objs.c index a3763c811b5..bb4120571e4 100644 --- a/reactos/lib/freetype/src/type42/t42objs.c +++ b/reactos/lib/freetype/src/type42/t42objs.c @@ -53,8 +53,7 @@ if ( error ) goto Exit; - error = t42_parse_dict( face, &loader, - parser->base_dict, parser->base_len ); + error = t42_parse_dict( face, &loader, parser->base_dict, parser->base_len ); if ( type1->font_type != 42 ) { @@ -66,8 +65,7 @@ /* to the Type1 data */ type1->num_glyphs = loader.num_glyphs; - if ( !loader.charstrings.init ) - { + if ( !loader.charstrings.init ) { FT_ERROR(( "T42_Open_Face: no charstrings array in face!\n" )); error = T42_Err_Invalid_File_Format; } @@ -123,10 +121,8 @@ if ( ft_strcmp( (const char*)".notdef", (const char*)glyph_name ) != 0 ) { - if ( charcode < min_char ) - min_char = charcode; - if ( charcode > max_char ) - max_char = charcode; + if ( charcode < min_char ) min_char = charcode; + if ( charcode > max_char ) max_char = charcode; } break; } @@ -153,12 +149,12 @@ FT_Int num_params, FT_Parameter* params ) { - FT_Error error; - FT_Service_PsCMaps psnames; - PSAux_Service psaux; - FT_Face root = (FT_Face)&face->root; - T1_Font type1 = &face->type1; - PS_FontInfo info = &type1->font_info; + FT_Error error; + PSNames_Service psnames; + PSAux_Service psaux; + FT_Face root = (FT_Face)&face->root; + T1_Font type1 = &face->type1; + PS_FontInfo info = &type1->font_info; FT_UNUSED( num_params ); FT_UNUSED( params ); @@ -169,8 +165,9 @@ face->ttf_face = NULL; face->root.num_faces = 1; - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); - face->psnames = psnames; + face->psnames = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), + "psnames" ); + psnames = (PSNames_Service)face->psnames; face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), "psaux" ); @@ -193,7 +190,7 @@ goto Exit; } - /* Now load the font program into the face object */ + /* Now, load the font program into the face object */ /* Init the face object fields */ /* Now set up root face fields */ @@ -281,8 +278,8 @@ root->max_advance_width = face->ttf_face->max_advance_width; root->max_advance_height = face->ttf_face->max_advance_height; - root->underline_position = (FT_Short)( info->underline_position >> 16 ); - root->underline_thickness = (FT_Short)( info->underline_thickness >> 16 ); + root->underline_position = info->underline_position >> 16; + root->underline_thickness = info->underline_thickness >> 16; root->internal->max_points = 0; root->internal->max_contours = 0; @@ -354,7 +351,7 @@ #if 0 /* Select default charmap */ - if ( root->num_charmaps ) + if (root->num_charmaps) root->charmap = root->charmaps[0]; #endif } @@ -401,6 +398,9 @@ FT_FREE( type1->encoding.char_name ); FT_FREE( type1->font_name ); + FT_FREE( type1->paint_type ); + FT_FREE( type1->stroke_width ); + FT_FREE( face->ttf_data ); #if 0 @@ -453,6 +453,8 @@ } + + FT_LOCAL_DEF( FT_Error ) T42_Size_Init( T42_Size size ) { @@ -600,7 +602,7 @@ FT_LOCAL_DEF( FT_Error ) T42_GlyphSlot_Load( FT_GlyphSlot glyph, FT_Size size, - FT_UInt glyph_index, + FT_Int glyph_index, FT_Int32 load_flags ) { FT_Error error; diff --git a/reactos/lib/freetype/src/type42/t42objs.h b/reactos/lib/freetype/src/type42/t42objs.h index 623809573e3..6fb176917ee 100644 --- a/reactos/lib/freetype/src/type42/t42objs.h +++ b/reactos/lib/freetype/src/type42/t42objs.h @@ -4,7 +4,7 @@ /* */ /* Type 42 objects manager (specification). */ /* */ -/* Copyright 2002, 2003 by Roberto Alameda. */ +/* Copyright 2002 by Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ @@ -22,10 +22,10 @@ #include FT_FREETYPE_H #include FT_TYPE1_TABLES_H #include FT_INTERNAL_TYPE1_TYPES_H -#include "t42types.h" +#include FT_INTERNAL_TYPE42_TYPES_H #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DRIVER_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include FT_INTERNAL_POSTSCRIPT_HINTS_H @@ -102,7 +102,7 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) T42_GlyphSlot_Load( FT_GlyphSlot glyph, FT_Size size, - FT_UInt glyph_index, + FT_Int glyph_index, FT_Int32 load_flags ); FT_LOCAL( void ) diff --git a/reactos/lib/freetype/src/type42/t42parse.c b/reactos/lib/freetype/src/type42/t42parse.c index bf979479058..ae4b7fcd57d 100644 --- a/reactos/lib/freetype/src/type42/t42parse.c +++ b/reactos/lib/freetype/src/type42/t42parse.c @@ -93,6 +93,10 @@ }; +#define T42_KEYWORD_COUNT \ + ( sizeof ( t42_keywords ) / sizeof ( t42_keywords[0] ) ) + + #define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l ) #define T1_Done_Table( p ) \ do \ @@ -107,18 +111,20 @@ (p)->funcs.release( p ); \ } while ( 0 ) -#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) -#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root ) +#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) +#define T1_Skip_Alpha( p ) (p)->root.funcs.skip_alpha ( &(p)->root ) -#define T1_ToInt( p ) \ - (p)->root.funcs.to_int( &(p)->root ) -#define T1_ToBytes( p, b, m, n, d ) \ - (p)->root.funcs.to_bytes( &(p)->root, b, m, n, d ) +#define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root ) +#define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) +#define T1_ToCoordArray( p, m, c ) \ + (p)->root.funcs.to_coord_array( &(p)->root, m, c ) #define T1_ToFixedArray( p, m, f, t ) \ (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t ) #define T1_ToToken( p, t ) \ (p)->root.funcs.to_token( &(p)->root, t ) +#define T1_ToTokenArray( p, t, m, c ) \ + (p)->root.funcs.to_token_array( &(p)->root, t, m, c ) #define T1_Load_Field( p, f, o, m, pf ) \ (p)->root.funcs.load_field( &(p)->root, f, o, m, pf ) @@ -152,8 +158,8 @@ /* When creating a new Type 42 parser, we try to locate and load */ /* the base dictionary, loading the whole font into memory. */ /* */ - /* When `loading' the base dictionary, we only set up pointers */ - /* in the case of a memory-based stream. Otherwise, we allocate */ + /* When `loading' the base dictionary, we only setup pointers in */ + /* the case of a memory-based stream. Otherwise, we allocate */ /* and load the base dictionary in it. */ /* */ /* parser->in_memory is set if we have a memory stream. */ @@ -189,9 +195,9 @@ } /* Now check font format; we must see `%!PS-TrueTypeFont' */ - if ( size <= 17 || - ( ft_strncmp( (const char*)parser->base_dict, - "%!PS-TrueTypeFont", 17 ) ) ) + if (size <= 17 || + ( ft_strncmp( (const char*)parser->base_dict, + "%!PS-TrueTypeFont", 17) ) ) error = T42_Err_Unknown_File_Format; else { @@ -222,12 +228,24 @@ } + static int + t42_is_alpha( FT_Byte c ) + { + /* Note: we must accept "+" as a valid character, as it is used in */ + /* embedded type1 fonts in PDF documents. */ + /* */ + return ( ft_isalnum( c ) || + c == '.' || + c == '_' || + c == '-' || + c == '+' ); + } + + static int t42_is_space( FT_Byte c ) { - return ( c == ' ' || c == '\t' || - c == '\r' || c == '\n' || c == '\f' || - c == '\0' ); + return ( c == ' ' || c == '\t' || c == '\r' || c == '\n' ); } @@ -270,8 +288,8 @@ matrix->yy = temp[3]; /* note that the offsets must be expressed in integer font units */ - offset->x = temp[4] >> 16; - offset->y = temp[5] >> 16; + offset->x = temp[4] >> 16; + offset->y = temp[5] >> 16; } @@ -279,52 +297,45 @@ t42_parse_encoding( T42_Face face, T42_Loader loader ) { - T42_Parser parser = &loader->parser; - FT_Byte* cur; - FT_Byte* limit = parser->root.limit; + T42_Parser parser = &loader->parser; + FT_Byte* cur = parser->root.cursor; + FT_Byte* limit = parser->root.limit; PSAux_Service psaux = (PSAux_Service)face->psaux; - T1_Skip_Spaces( parser ); - cur = parser->root.cursor; - if ( cur >= limit ) + /* skip whitespace */ + while ( t42_is_space( *cur ) ) { - FT_ERROR(( "t42_parse_encoding: out of bounds!\n" )); - parser->root.error = T42_Err_Invalid_File_Format; - return; + cur++; + if ( cur >= limit ) + { + FT_ERROR(( "t42_parse_encoding: out of bounds!\n" )); + parser->root.error = T42_Err_Invalid_File_Format; + return; + } } - /* if we have a number or `[', the encoding is an array, */ - /* and we must load it now */ - if ( ft_isdigit( *cur ) || *cur == '[' ) + /* if we have a number, then the encoding is an array, */ + /* and we must load it now */ + if ( (FT_Byte)( *cur - '0' ) < 10 ) { - T1_Encoding encode = &face->type1.encoding; - FT_UInt count, n; - PS_Table char_table = &loader->encoding_table; - FT_Memory memory = parser->root.memory; + T1_Encoding encode = &face->type1.encoding; + FT_Int count, n; + PS_Table char_table = &loader->encoding_table; + FT_Memory memory = parser->root.memory; FT_Error error; - FT_Bool only_immediates = 0; - /* read the number of entries in the encoding; should be 256 */ - if ( *cur == '[' ) - { - count = 256; - only_immediates = 1; - parser->root.cursor++; - } - else - count = (FT_UInt)T1_ToInt( parser ); - - T1_Skip_Spaces( parser ); - if ( parser->root.cursor >= limit ) + /* read the number of entries in the encoding, should be 256 */ + count = (FT_Int)T1_ToInt( parser ); + if ( parser->root.error ) return; /* we use a T1_Table to store our charnames */ loader->num_chars = encode->num_chars = count; - if ( FT_NEW_ARRAY( encode->char_index, count ) || - FT_NEW_ARRAY( encode->char_name, count ) || + if ( FT_NEW_ARRAY( encode->char_index, count ) || + FT_NEW_ARRAY( encode->char_name, count ) || FT_SET_ERROR( psaux->ps_table_funcs->init( char_table, count, memory ) ) ) { @@ -341,99 +352,86 @@ T1_Add_Table( char_table, n, notdef, 8 ); } - /* Now we need to read records of the form */ - /* */ - /* ... charcode /charname ... */ - /* */ - /* for each entry in our table. */ + /* Now, we will need to read a record of the form */ + /* ... charcode /charname ... for each entry in our table */ /* */ /* We simply look for a number followed by an immediate */ /* name. Note that this ignores correctly the sequence */ - /* that is often seen in type42 fonts: */ + /* that is often seen in type1 fonts: */ /* */ /* 0 1 255 { 1 index exch /.notdef put } for dup */ /* */ /* used to clean the encoding array before anything else. */ /* */ - /* Alternatively, if the array is directly given as */ - /* */ - /* /Encoding [ ... ] */ - /* */ - /* we only read immediates. */ + /* We stop when we encounter a `def'. */ - n = 0; - T1_Skip_Spaces( parser ); + cur = parser->root.cursor; + limit = parser->root.limit; + n = 0; - while ( parser->root.cursor < limit ) + for ( ; cur < limit; ) { - cur = parser->root.cursor; + FT_Byte c; - /* we stop when we encounter `def' or `]' */ - if ( *cur == 'd' && cur + 3 < limit ) + + c = *cur; + + /* we stop when we encounter a `def' */ + if ( c == 'd' && cur + 3 < limit ) { - if ( cur[1] == 'e' && - cur[2] == 'f' && - t42_is_space( cur[3] ) ) + if ( cur[1] == 'e' && + cur[2] == 'f' && + t42_is_space( cur[-1] ) && + t42_is_space( cur[3] ) ) { FT_TRACE6(( "encoding end\n" )); - cur += 3; break; } } - if ( *cur == ']' ) - { - FT_TRACE6(( "encoding end\n" )); - cur++; - break; - } - /* check whether we've found an entry */ - if ( ft_isdigit( *cur ) || only_immediates ) + /* otherwise, we must find a number before anything else */ + if ( (FT_Byte)( c - '0' ) < 10 ) { FT_Int charcode; - if ( only_immediates ) - charcode = n; - else - { - charcode = (FT_Int)T1_ToInt( parser ); - T1_Skip_Spaces( parser ); - } - - cur = parser->root.cursor; - - if ( *cur == '/' && cur + 2 < limit && n < count ) - { - FT_PtrDist len; - + parser->root.cursor = cur; + charcode = (FT_Int)T1_ToInt( parser ); + cur = parser->root.cursor; + /* skip whitespace */ + while ( cur < limit && t42_is_space( *cur ) ) cur++; - parser->root.cursor = cur; - T1_Skip_PS_Token( parser ); + if ( cur < limit && *cur == '/' ) + { + /* bingo, we have an immediate name -- it must be a */ + /* character name */ + FT_Byte* cur2 = cur + 1; + FT_Int len; - len = parser->root.cursor - cur; + + while ( cur2 < limit && t42_is_alpha( *cur2 ) ) + cur2++; + + len = (FT_Int)( cur2 - cur - 1 ); parser->root.error = T1_Add_Table( char_table, charcode, - cur, len + 1 ); + cur + 1, len + 1 ); char_table->elements[charcode][len] = '\0'; if ( parser->root.error ) return; - n++; + cur = cur2; } } else - T1_Skip_PS_Token( parser ); - - T1_Skip_Spaces( parser ); + cur++; } face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY; parser->root.cursor = cur; } - /* Otherwise, we should have either `StandardEncoding', */ /* `ExpertEncoding', or `ISOLatin1Encoding' */ else @@ -450,8 +448,7 @@ ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 ) face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1; - else - { + else { FT_ERROR(( "t42_parse_encoding: invalid token!\n" )); parser->root.error = T42_Err_Invalid_File_Format; } @@ -459,13 +456,34 @@ } - typedef enum + static FT_UInt + t42_hexval( FT_Byte v ) { - BEFORE_START, - BEFORE_TABLE_DIR, - OTHER_TABLES + FT_UInt d; - } T42_Load_Status; + d = (FT_UInt)( v - 'A' ); + if ( d < 6 ) + { + d += 10; + goto Exit; + } + + d = (FT_UInt)( v - 'a' ); + if ( d < 6 ) + { + d += 10; + goto Exit; + } + + d = (FT_UInt)( v - '0' ); + if ( d < 10 ) + goto Exit; + + d = 0; + + Exit: + return d; + } static void @@ -474,177 +492,154 @@ { T42_Parser parser = &loader->parser; FT_Memory memory = parser->root.memory; - FT_Byte* cur; + FT_Byte* cur = parser->root.cursor; FT_Byte* limit = parser->root.limit; FT_Error error; - FT_Int num_tables = 0; - FT_ULong count, ttf_size = 0; - - FT_Long n, string_size, old_string_size, real_size; - FT_Byte* string_buf = NULL; - FT_Bool alloc = 0; - - T42_Load_Status status; + FT_Int num_tables = 0, status; + FT_ULong count, ttf_size = 0, string_size = 0; + FT_Bool in_string = 0; + FT_Byte v = 0; - /* The format is */ - /* */ - /* /sfnts [ <hexstring> <hexstring> ... ] def */ - /* */ - /* or */ - /* */ - /* /sfnts [ */ - /* <num_bin_bytes> RD <binary data> */ - /* <num_bin_bytes> RD <binary data> */ - /* ... */ - /* ] def */ - /* */ - /* with exactly one space after the `RD' token. */ + /* The format is `/sfnts [ <...> <...> ... ] def' */ - T1_Skip_Spaces( parser ); + while ( t42_is_space( *cur ) ) + cur++; - if ( parser->root.cursor >= limit || *parser->root.cursor++ != '[' ) + if (*cur++ == '[') + { + status = 0; + count = 0; + } + else { FT_ERROR(( "t42_parse_sfnts: can't find begin of sfnts vector!\n" )); error = T42_Err_Invalid_File_Format; goto Fail; } - T1_Skip_Spaces( parser ); - status = BEFORE_START; - string_size = 0; - old_string_size = 0; - count = 0; - - while ( parser->root.cursor < limit ) + while ( cur < limit - 2 ) { - cur = parser->root.cursor; + while ( t42_is_space( *cur ) ) + cur++; - if ( *cur == ']' ) + switch ( *cur ) { - parser->root.cursor++; - goto Exit; - } + case ']': + parser->root.cursor = cur++; + return; - else if ( *cur == '<' ) - { - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - goto Exit; + case '<': + in_string = 1; + string_size = 0; + cur++; + continue; - /* don't include delimiters */ - string_size = (FT_Long)( ( parser->root.cursor - cur - 2 + 1 ) / 2 ); - if ( FT_REALLOC( string_buf, old_string_size, string_size ) ) - goto Fail; - - alloc = 1; - - parser->root.cursor = cur; - (void)T1_ToBytes( parser, string_buf, string_size, &real_size, 1 ); - old_string_size = string_size; - string_size = real_size; - } - - else if ( ft_isdigit( *cur ) ) - { - string_size = T1_ToInt( parser ); - - T1_Skip_PS_Token( parser ); /* `RD' */ - - string_buf = parser->root.cursor + 1; /* one space after `RD' */ - - parser->root.cursor += string_size + 1; - if ( parser->root.cursor >= limit ) + case '>': + if ( !in_string ) { - FT_ERROR(( "t42_parse_sfnts: too many binary data!\n" )); + FT_ERROR(( "t42_parse_sfnts: found unpaired `>'!\n" )); error = T42_Err_Invalid_File_Format; goto Fail; } - } - /* A string can have a trailing zero byte for padding. Ignore it. */ - if ( string_buf[string_size - 1] == 0 && ( string_size % 2 == 1 ) ) - string_size--; + /* A string can have, as a last byte, */ + /* a zero byte for padding. If so, ignore it */ + if ( ( v == 0 ) && ( string_size % 2 == 1 ) ) + count--; + in_string = 0; + cur++; + continue; - for ( n = 0; n < string_size; n++ ) - { - switch ( status ) + case '%': + if ( !in_string ) { - case BEFORE_START: - /* load offset table, 12 bytes */ - if ( count < 12 ) - { - face->ttf_data[count++] = string_buf[n]; - continue; - } - else - { - num_tables = 16 * face->ttf_data[4] + face->ttf_data[5]; - status = BEFORE_TABLE_DIR; - ttf_size = 12 + 16 * num_tables; - - if ( FT_REALLOC( face->ttf_data, 12, ttf_size ) ) - goto Fail; - } - /* fall through */ - - case BEFORE_TABLE_DIR: - /* the offset table is read; read the table directory */ - if ( count < ttf_size ) - { - face->ttf_data[count++] = string_buf[n]; - continue; - } - else - { - int i; - FT_ULong len; - - - for ( i = 0; i < num_tables; i++ ) - { - FT_Byte* p = face->ttf_data + 12 + 16 * i + 12; - - - len = FT_PEEK_ULONG( p ); - - /* Pad to a 4-byte boundary length */ - ttf_size += ( len + 3 ) & ~3; - } - - status = OTHER_TABLES; - face->ttf_size = ttf_size; - - if ( FT_REALLOC( face->ttf_data, 12 + 16 * num_tables, - ttf_size + 1 ) ) - goto Fail; - } - /* fall through */ - - case OTHER_TABLES: - /* all other tables are just copied */ - if ( count >= ttf_size ) - { - FT_ERROR(( "t42_parse_sfnts: too many binary data!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - face->ttf_data[count++] = string_buf[n]; + /* Comment found; skip till end of line */ + while ( *cur != '\n' ) + cur++; + continue; } + else + { + FT_ERROR(( "t42_parse_sfnts: found `%' in string!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + default: + if ( !ft_xdigit( *cur ) || !ft_xdigit( *(cur + 1) ) ) + { + FT_ERROR(( "t42_parse_sfnts: found non-hex characters in string" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + v = (FT_Byte)( 16 * t42_hexval( cur[0] ) + t42_hexval( cur[1] ) ); + cur += 2; + string_size++; } - T1_Skip_Spaces( parser ); + switch ( status ) + { + case 0: /* The '[' was read, so load offset table, 12 bytes */ + if ( count < 12 ) + { + face->ttf_data[count++] = v; + continue; + } + else + { + num_tables = 16 * face->ttf_data[4] + face->ttf_data[5]; + status = 1; + ttf_size = 12 + 16 * num_tables; + + if ( FT_REALLOC( face->ttf_data, 12, ttf_size ) ) + goto Fail; + } + /* No break, fall-through */ + + case 1: /* The offset table is read; read now the table directory */ + if ( count < ttf_size ) + { + face->ttf_data[count++] = v; + continue; + } + else + { + int i; + FT_ULong len; + + + for ( i = 0; i < num_tables; i++ ) + { + FT_Byte* p = face->ttf_data + 12 + 16*i + 12; + + len = FT_PEEK_ULONG( p ); + + /* Pad to a 4-byte boundary length */ + ttf_size += ( len + 3 ) & ~3; + } + + status = 2; + face->ttf_size = ttf_size; + + if ( FT_REALLOC( face->ttf_data, 12 + 16 * num_tables, + ttf_size + 1 ) ) + goto Fail; + } + /* No break, fall-through */ + + case 2: /* We are reading normal tables; just swallow them */ + face->ttf_data[count++] = v; + + } } - /* if control reaches this point, the format was not valid */ + /* If control reaches this point, the format was not valid */ error = T42_Err_Invalid_File_Format; Fail: parser->root.error = error; - - Exit: - if ( alloc ) - FT_FREE( string_buf ); } @@ -652,75 +647,22 @@ t42_parse_charstrings( T42_Face face, T42_Loader loader ) { - T42_Parser parser = &loader->parser; - PS_Table code_table = &loader->charstrings; - PS_Table name_table = &loader->glyph_names; - PS_Table swap_table = &loader->swap_table; - FT_Memory memory = parser->root.memory; + T42_Parser parser = &loader->parser; + PS_Table code_table = &loader->charstrings; + PS_Table name_table = &loader->glyph_names; + FT_Memory memory = parser->root.memory; FT_Error error; - PSAux_Service psaux = (PSAux_Service)face->psaux; + PSAux_Service psaux = (PSAux_Service)face->psaux; FT_Byte* cur; - FT_Byte* limit = parser->root.limit; - FT_UInt n; - FT_UInt notdef_index = 0; - FT_Byte notdef_found = 0; + FT_Byte* limit = parser->root.limit; + FT_Int n; - T1_Skip_Spaces( parser ); - - if ( parser->root.cursor >= limit ) - { - FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - if ( ft_isdigit( *parser->root.cursor ) ) - { - loader->num_glyphs = (FT_UInt)T1_ToInt( parser ); - if ( parser->root.error ) - return; - } - else if ( *parser->root.cursor == '<' ) - { - /* We have `<< ... >>'. Count the number of `/' in the dictionary */ - /* to get its size. */ - FT_UInt count = 0; - - - T1_Skip_PS_Token( parser ); - T1_Skip_Spaces( parser ); - cur = parser->root.cursor; - - while ( parser->root.cursor < limit ) - { - if ( *parser->root.cursor == '/' ) - count++; - else if ( *parser->root.cursor == '>' ) - { - loader->num_glyphs = count; - parser->root.cursor = cur; /* rewind */ - break; - } - T1_Skip_PS_Token( parser ); - T1_Skip_Spaces( parser ); - } - } - else - { - FT_ERROR(( "t42_parse_charstrings: invalid token!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - if ( parser->root.cursor >= limit ) - { - FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } + loader->num_glyphs = (FT_Int)T1_ToInt( parser ); + if ( parser->root.error ) + return; /* initialize tables */ @@ -736,82 +678,57 @@ if ( error ) goto Fail; - /* Initialize table for swapping index notdef_index and */ - /* index 0 names and codes (if necessary). */ - - error = psaux->ps_table_funcs->init( swap_table, 4, memory ); - if ( error ) - goto Fail; - n = 0; for (;;) { - /* The format is simple: */ - /* `/glyphname' + index [+ def] */ - + /* the format is simple: */ + /* `/glyphname' + index + def */ + /* */ + /* note that we stop when we find an `end' */ + /* */ T1_Skip_Spaces( parser ); cur = parser->root.cursor; if ( cur >= limit ) break; - /* We stop when we find an `end' keyword or '>' */ - if ( *cur == 'e' && - cur + 3 < limit && - cur[1] == 'n' && - cur[2] == 'd' && - t42_is_space( cur[3] ) ) - break; - if ( *cur == '>' ) + /* we stop when we find an `end' keyword */ + if ( *cur == 'e' && + cur + 3 < limit && + cur[1] == 'n' && + cur[2] == 'd' ) break; - T1_Skip_PS_Token( parser ); - - if ( *cur == '/' ) + if ( *cur != '/' ) + T1_Skip_Alpha( parser ); + else { - FT_PtrDist len; + FT_Byte* cur2 = cur + 1; + FT_Int len; - if ( cur + 1 >= limit ) - { - FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } + while ( cur2 < limit && t42_is_alpha( *cur2 ) ) + cur2++; + len = (FT_Int)( cur2 - cur - 1 ); - cur++; /* skip `/' */ - len = parser->root.cursor - cur; - - error = T1_Add_Table( name_table, n, cur, len + 1 ); + error = T1_Add_Table( name_table, n, cur + 1, len + 1 ); if ( error ) goto Fail; /* add a trailing zero to the name table */ name_table->elements[n][len] = '\0'; - /* record index of /.notdef */ - if ( *cur == '.' && - ft_strcmp( ".notdef", - (const char*)(name_table->elements[n]) ) == 0 ) - { - notdef_index = n; - notdef_found = 1; - } - + parser->root.cursor = cur2; T1_Skip_Spaces( parser ); - cur = parser->root.cursor; + cur2 = cur = parser->root.cursor; + if ( cur >= limit ) + break; - (void)T1_ToInt( parser ); - if ( parser->root.cursor >= limit ) - { - FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - len = parser->root.cursor - cur; + while ( cur2 < limit && t42_is_alpha( *cur2 ) ) + cur2++; + len = (FT_Int)( cur2 - cur ); error = T1_Add_Table( code_table, n, cur, len + 1 ); if ( error ) @@ -825,79 +742,15 @@ } } - loader->num_glyphs = n; - - if ( !notdef_found ) + /* Index 0 must be a .notdef element */ + if ( ft_strcmp( (char *)name_table->elements[0], ".notdef" ) ) { - FT_ERROR(( "t42_parse_charstrings: no /.notdef glyph!\n" )); + FT_ERROR(( "t42_parse_charstrings: Index 0 is not `.notdef'!\n" )); error = T42_Err_Invalid_File_Format; goto Fail; } - /* if /.notdef does not occupy index 0, do our magic. */ - if ( ft_strcmp( (const char*)".notdef", - (const char*)name_table->elements[0] ) ) - { - /* Swap glyph in index 0 with /.notdef glyph. First, add index 0 */ - /* name and code entries to swap_table. Then place notdef_index */ - /* name and code entries into swap_table. Then swap name and code */ - /* entries at indices notdef_index and 0 using values stored in */ - /* swap_table. */ - - /* Index 0 name */ - error = T1_Add_Table( swap_table, 0, - name_table->elements[0], - name_table->lengths [0] ); - if ( error ) - goto Fail; - - /* Index 0 code */ - error = T1_Add_Table( swap_table, 1, - code_table->elements[0], - code_table->lengths [0] ); - if ( error ) - goto Fail; - - /* Index notdef_index name */ - error = T1_Add_Table( swap_table, 2, - name_table->elements[notdef_index], - name_table->lengths [notdef_index] ); - if ( error ) - goto Fail; - - /* Index notdef_index code */ - error = T1_Add_Table( swap_table, 3, - code_table->elements[notdef_index], - code_table->lengths [notdef_index] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( name_table, notdef_index, - swap_table->elements[0], - swap_table->lengths [0] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( code_table, notdef_index, - swap_table->elements[1], - swap_table->lengths [1] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( name_table, 0, - swap_table->elements[2], - swap_table->lengths [2] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( code_table, 0, - swap_table->elements[3], - swap_table->lengths [3] ); - if ( error ) - goto Fail; - - } - + loader->num_glyphs = n; return; Fail: @@ -917,16 +770,14 @@ /* if the keyword has a dedicated callback, call it */ - if ( field->type == T1_FIELD_TYPE_CALLBACK ) - { + if ( field->type == T1_FIELD_TYPE_CALLBACK ) { field->reader( (FT_Face)face, loader ); error = loader->parser.root.error; goto Exit; } - /* now the keyword is either a simple field or a table of fields; */ - /* we are now going to take care of it */ - + /* now, the keyword is either a simple field, or a table of fields; */ + /* we are now going to take care of it */ switch ( field->location ) { case T1_FIELD_LOCATION_FONT_INFO: @@ -963,27 +814,28 @@ FT_Long size ) { T42_Parser parser = &loader->parser; - FT_Byte* limit; - FT_Int n_keywords = (FT_Int)( sizeof ( t42_keywords ) / - sizeof ( t42_keywords[0] ) ); + FT_Byte* cur = base; + FT_Byte* limit = cur + size; + FT_UInt n_keywords = (FT_UInt)( sizeof ( t42_keywords ) / + sizeof ( t42_keywords[0] ) ); + FT_Byte keyword_flags[T42_KEYWORD_COUNT]; + + { + FT_UInt n; + + + for ( n = 0; n < T42_KEYWORD_COUNT; n++ ) + keyword_flags[n] = 0; + } parser->root.cursor = base; parser->root.limit = base + size; - parser->root.error = T42_Err_Ok; + parser->root.error = 0; - limit = parser->root.limit; - - T1_Skip_Spaces( parser ); - - while ( parser->root.cursor < limit ) + for ( ; cur < limit; cur++ ) { - FT_Byte* cur; - - - cur = parser->root.cursor; - - /* look for `FontDirectory' which causes problems for some fonts */ + /* look for `FontDirectory', which causes problems on some fonts */ if ( *cur == 'F' && cur + 25 < limit && ft_strncmp( (char*)cur, "FontDirectory", 13 ) == 0 ) { @@ -991,21 +843,13 @@ /* skip the `FontDirectory' keyword */ - T1_Skip_PS_Token( parser ); - T1_Skip_Spaces ( parser ); - cur = cur2 = parser->root.cursor; + cur += 13; + cur2 = cur; - /* look up the `known' keyword */ - while ( cur < limit ) - { - if ( *cur == 'k' && cur + 5 < limit && - ft_strncmp( (char*)cur, "known", 5 ) == 0 ) - break; - - T1_Skip_PS_Token( parser ); - T1_Skip_Spaces ( parser ); - cur = parser->root.cursor; - } + /* lookup the `known' keyword */ + while ( cur < limit && *cur != 'k' && + ft_strncmp( (char*)cur, "known", 5 ) ) + cur++; if ( cur < limit ) { @@ -1013,37 +857,34 @@ /* skip the `known' keyword and the token following it */ - T1_Skip_PS_Token( parser ); - T1_ToToken( parser, &token ); + cur += 5; + loader->parser.root.cursor = cur; + T1_ToToken( &loader->parser, &token ); /* if the last token was an array, skip it! */ if ( token.type == T1_TOKEN_TYPE_ARRAY ) cur2 = parser->root.cursor; } - parser->root.cursor = cur2; + cur = cur2; } - /* look for immediates */ else if ( *cur == '/' && cur + 2 < limit ) { - FT_PtrDist len; + FT_Byte* cur2; + FT_UInt i, len; cur++; + cur2 = cur; + while ( cur2 < limit && t42_is_alpha( *cur2 ) ) + cur2++; - parser->root.cursor = cur; - T1_Skip_PS_Token( parser ); - - len = parser->root.cursor - cur; - - if ( len > 0 && len < 22 && parser->root.cursor < limit ) + len = (FT_UInt)( cur2 - cur ); + if ( len > 0 && len < 22 ) /* XXX What shall it this 22? */ { - int i; + /* now, compare the immediate name to the keyword table */ - - /* now compare the immediate name to the keyword table */ - - /* loop through all known keywords */ + /* Loop through all known keywords */ for ( i = 0; i < n_keywords; i++ ) { T1_Field keyword = (T1_Field)&t42_keywords[i]; @@ -1053,27 +894,32 @@ if ( !name ) continue; - if ( cur[0] == name[0] && - len == ft_strlen( (const char *)name ) && - ft_memcmp( cur, name, len ) == 0 ) + if ( ( len == ft_strlen( (const char *)name ) ) && + ( ft_memcmp( cur, name, len ) == 0 ) ) { /* we found it -- run the parsing callback! */ - parser->root.error = t42_load_keyword( face, - loader, - keyword ); - if ( parser->root.error ) - return parser->root.error; + parser->root.cursor = cur2; + T1_Skip_Spaces( parser ); + + /* only record the first instance of each field/keyword */ + /* to deal with synthetic fonts correctly */ + if ( keyword_flags[i] == 0 ) + { + parser->root.error = t42_load_keyword(face, + loader, + keyword ); + if ( parser->root.error ) + return parser->root.error; + } + keyword_flags[i] = 1; + + cur = parser->root.cursor; break; } } } } - else - T1_Skip_PS_Token( parser ); - - T1_Skip_Spaces( parser ); } - return parser->root.error; } @@ -1105,7 +951,6 @@ T1_Release_Table( &loader->encoding_table ); T1_Release_Table( &loader->charstrings ); T1_Release_Table( &loader->glyph_names ); - T1_Release_Table( &loader->swap_table ); /* finalize parser */ t42_parser_done( parser ); diff --git a/reactos/lib/freetype/src/type42/t42parse.h b/reactos/lib/freetype/src/type42/t42parse.h index f77ec4af4f4..7339aa63b52 100644 --- a/reactos/lib/freetype/src/type42/t42parse.h +++ b/reactos/lib/freetype/src/type42/t42parse.h @@ -33,7 +33,7 @@ FT_BEGIN_HEADER FT_Byte* base_dict; FT_Long base_len; - FT_Bool in_memory; + FT_Byte in_memory; } T42_ParserRec, *T42_Parser; @@ -42,14 +42,13 @@ FT_BEGIN_HEADER { T42_ParserRec parser; /* parser used to read the stream */ - FT_UInt num_chars; /* number of characters in encoding */ + FT_Int num_chars; /* number of characters in encoding */ PS_TableRec encoding_table; /* PS_Table used to store the */ /* encoding character names */ - FT_UInt num_glyphs; + FT_Int num_glyphs; PS_TableRec glyph_names; PS_TableRec charstrings; - PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */ } T42_LoaderRec, *T42_Loader; diff --git a/reactos/lib/freetype/src/type42/t42types.h b/reactos/lib/freetype/src/type42/t42types.h deleted file mode 100644 index d44ac4e671f..00000000000 --- a/reactos/lib/freetype/src/type42/t42types.h +++ /dev/null @@ -1,54 +0,0 @@ -/***************************************************************************/ -/* */ -/* t42types.h */ -/* */ -/* Type 42 font data types (specification only). */ -/* */ -/* Copyright 2002, 2003 by Roberto Alameda. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T42TYPES_H__ -#define __T42TYPES_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_TYPE1_TABLES_H -#include FT_INTERNAL_TYPE1_TYPES_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H - - -FT_BEGIN_HEADER - - - typedef struct T42_FaceRec_ - { - FT_FaceRec root; - T1_FontRec type1; - const void* psnames; - const void* psaux; - const void* afm_data; - FT_Byte* ttf_data; - FT_ULong ttf_size; - FT_Face ttf_face; - FT_CharMapRec charmaprecs[2]; - FT_CharMap charmaps[2]; - PS_Unicodes unicode_map; - - } T42_FaceRec, *T42_Face; - - -FT_END_HEADER - -#endif /* __T1TYPES_H__ */ - - -/* END */ diff --git a/reactos/lib/freetype/src/winfonts/winfnt.c b/reactos/lib/freetype/src/winfonts/winfnt.c index abca96a5a14..b2e315f63cd 100644 --- a/reactos/lib/freetype/src/winfonts/winfnt.c +++ b/reactos/lib/freetype/src/winfonts/winfnt.c @@ -4,7 +4,7 @@ /* */ /* FreeType font driver for Windows FNT/FON files */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -21,11 +21,12 @@ #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_FNT_TYPES_H #include "winfnt.h" + #include "fnterrs.h" -#include FT_SERVICE_WINFNT_H -#include FT_SERVICE_XFREE86_NAME_H + /*************************************************************************/ /* */ @@ -37,7 +38,8 @@ #define FT_COMPONENT trace_winfnt - static const FT_Frame_Field winmz_header_fields[] = + static + const FT_Frame_Field winmz_header_fields[] = { #undef FT_STRUCTURE #define FT_STRUCTURE WinMZ_HeaderRec @@ -49,7 +51,8 @@ FT_FRAME_END }; - static const FT_Frame_Field winne_header_fields[] = + static + const FT_Frame_Field winne_header_fields[] = { #undef FT_STRUCTURE #define FT_STRUCTURE WinNE_HeaderRec @@ -62,12 +65,13 @@ FT_FRAME_END }; - static const FT_Frame_Field winfnt_header_fields[] = + static + const FT_Frame_Field winfnt_header_fields[] = { #undef FT_STRUCTURE #define FT_STRUCTURE FT_WinFNT_HeaderRec - FT_FRAME_START( 148 ), + FT_FRAME_START( 146 ), FT_FRAME_USHORT_LE( version ), FT_FRAME_ULONG_LE ( file_size ), FT_FRAME_BYTES ( copyright, 60 ), @@ -102,7 +106,7 @@ FT_FRAME_USHORT_LE( A_space ), FT_FRAME_USHORT_LE( B_space ), FT_FRAME_USHORT_LE( C_space ), - FT_FRAME_ULONG_LE ( color_table_offset ), + FT_FRAME_USHORT_LE( color_table_offset ), FT_FRAME_BYTES ( reserved1, 16 ), FT_FRAME_END }; @@ -133,8 +137,6 @@ { FT_Error error; FT_WinFNT_Header header = &font->header; - FT_Bool new_format; - FT_UInt size; /* first of all, read the FNT header */ @@ -151,16 +153,6 @@ goto Exit; } - new_format = FT_BOOL( font->header.version == 0x300 ); - size = new_format ? 148 : 118; - - if ( header->file_size < size ) - { - FT_TRACE2(( "[not a valid FNT file]\n" )); - error = FNT_Err_Unknown_File_Format; - goto Exit; - } - /* Version 2 doesn't have these fields */ if ( header->version == 0x200 ) { @@ -369,7 +361,7 @@ } - static const FT_CMap_ClassRec fnt_cmap_class_rec = + static FT_CMap_ClassRec fnt_cmap_class_rec = { sizeof ( FNT_CMapRec ), @@ -379,7 +371,7 @@ (FT_CMap_CharNextFunc) fnt_cmap_char_next }; - static FT_CMap_Class const fnt_cmap_class = &fnt_cmap_class_rec; + static FT_CMap_Class fnt_cmap_class = &fnt_cmap_class_rec; static void @@ -461,10 +453,10 @@ bsize->width = font->header.avg_width; - bsize->height = (FT_Short)( - font->header.pixel_height + font->header.external_leading ); + bsize->height = + font->header.pixel_height + font->header.external_leading; bsize->size = font->header.nominal_point_size << 6; - bsize->x_ppem = + bsize->x_ppem = (FT_Pos)( ( font->header.horizontal_resolution * bsize->size + 36 ) / 72 ); bsize->y_ppem = @@ -476,18 +468,11 @@ FT_CharMapRec charmap; - charmap.encoding = FT_ENCODING_NONE; - charmap.platform_id = 0; - charmap.encoding_id = 0; + charmap.encoding = FT_ENCODING_UNICODE; + charmap.platform_id = 3; + charmap.encoding_id = 1; charmap.face = root; - if ( font->header.charset == FT_WinFNT_ID_MAC ) - { - charmap.encoding = FT_ENCODING_APPLE_ROMAN; - charmap.platform_id = 1; -/* charmap.encoding_id = 0; */ - } - error = FT_CMap_New( fnt_cmap_class, NULL, &charmap, @@ -543,8 +528,8 @@ size->metrics.ascender = font->header.ascent * 64; - size->metrics.descender = -( font->header.pixel_height - - font->header.ascent ) * 64; + size->metrics.descender = ( font->header.pixel_height - + font->header.ascent ) * 64; size->metrics.height = font->header.pixel_height * 64; size->metrics.max_advance = font->header.max_width * 64; @@ -588,7 +573,7 @@ len = new_format ? 6 : 4; /* jump to glyph entry */ - p = font->fnt_frame + ( new_format ? 148 : 118 ) + len * glyph_index; + p = font->fnt_frame + ( new_format ? 146 : 118 ) + len * glyph_index; bitmap->width = FT_NEXT_SHORT_LE( p ); @@ -597,13 +582,6 @@ else offset = FT_NEXT_USHORT_LE( p ); - if ( offset >= font->header.file_size ) - { - FT_TRACE2(( "invalid FNT offset!\n" )); - error = FNT_Err_Invalid_File_Format; - goto Exit; - } - /* jump to glyph data */ p = font->fnt_frame + /* font->header.bits_offset */ + offset; @@ -654,49 +632,6 @@ } - static FT_Error - winfnt_get_header( FT_Face face, - FT_WinFNT_HeaderRec *aheader ) - { - FNT_Font font = ((FNT_Face)face)->font; - - - *aheader = font->header; - - return 0; - } - - - static const FT_Service_WinFntRec winfnt_service_rec = - { - winfnt_get_header - }; - - /* - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec winfnt_services[] = - { - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_WINFNT }, - { FT_SERVICE_ID_WINFNT, &winfnt_service_rec }, - { NULL, NULL } - }; - - - static FT_Module_Interface - winfnt_get_service( FT_Driver driver, - const FT_String* service_id ) - { - FT_UNUSED( driver ); - - return ft_service_list_lookup( winfnt_services, service_id ); - } - - - - FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec winfnt_driver_class = { @@ -713,7 +648,7 @@ (FT_Module_Constructor)0, (FT_Module_Destructor) 0, - (FT_Module_Requester) winfnt_get_service + (FT_Module_Requester) 0 }, sizeof( FNT_FaceRec ), diff --git a/reactos/lib/freetype/src/winfonts/winfnt.h b/reactos/lib/freetype/src/winfonts/winfnt.h index f36901e916a..4ba85e0b233 100644 --- a/reactos/lib/freetype/src/winfonts/winfnt.h +++ b/reactos/lib/freetype/src/winfonts/winfnt.h @@ -4,7 +4,7 @@ /* */ /* FreeType font driver for Windows FNT/FON files */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -21,78 +21,11 @@ #include <ft2build.h> -#include FT_WINFONTS_H #include FT_INTERNAL_DRIVER_H FT_BEGIN_HEADER - typedef struct WinMZ_HeaderRec_ - { - FT_UShort magic; - /* skipped content */ - FT_UShort lfanew; - - } WinMZ_HeaderRec; - - - typedef struct WinNE_HeaderRec_ - { - FT_UShort magic; - /* skipped content */ - FT_UShort resource_tab_offset; - FT_UShort rname_tab_offset; - - } WinNE_HeaderRec; - - - typedef struct WinNameInfoRec_ - { - FT_UShort offset; - FT_UShort length; - FT_UShort flags; - FT_UShort id; - FT_UShort handle; - FT_UShort usage; - - } WinNameInfoRec; - - - typedef struct WinResourceInfoRec_ - { - FT_UShort type_id; - FT_UShort count; - - } WinResourceInfoRec; - - -#define WINFNT_MZ_MAGIC 0x5A4D -#define WINFNT_NE_MAGIC 0x454E - - - typedef struct FNT_FontRec_ - { - FT_ULong offset; - FT_Int size_shift; - - FT_WinFNT_HeaderRec header; - - FT_Byte* fnt_frame; - FT_ULong fnt_size; - - } FNT_FontRec, *FNT_Font; - - - typedef struct FNT_FaceRec_ - { - FT_FaceRec root; - FNT_Font font; - - FT_CharMap charmap_handle; - FT_CharMapRec charmap; /* a single charmap per face */ - - } FNT_FaceRec, *FNT_Face; - FT_EXPORT_VAR( const FT_Driver_ClassRec ) winfnt_driver_class;