Changeset 609 for branches/GNU/src/binutils/libiberty
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- Location:
- branches/GNU/src/binutils/libiberty
- Files:
-
- 81 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/libiberty/COPYING.LIB
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 GNU L IBRARYGENERAL PUBLIC LICENSE2 Version 2 , June 19913 4 Copyright (C) 1991 Free Software Foundation, Inc.5 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA1 GNU LESSER GENERAL PUBLIC LICENSE 2 Version 2.1, February 1999 3 4 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 6 Everyone is permitted to copy and distribute verbatim copies 7 7 of this license document, but changing it is not allowed. 8 8 9 [This is the first released version of the library GPL. It is 10 numbered 2 because it goes with version 2 of the ordinary GPL.] 9 [This is the first released version of the Lesser GPL. It also counts 10 as the successor of the GNU Library Public License, version 2, hence 11 the version number 2.1.] 11 12 12 13 Preamble … … 17 18 free software--to make sure the software is free for all its users. 18 19 19 This license, the Library General Public License, applies to some 20 specially designated Free Software Foundation software, and to any 21 other libraries whose authors decide to use it. You can use it for 22 your libraries, too. 23 24 When we speak of free software, we are referring to freedom, not 25 price. Our General Public Licenses are designed to make sure that you 26 have the freedom to distribute copies of free software (and charge for 27 this service if you wish), that you receive source code or can get it 28 if you want it, that you can change the software or use pieces of it 29 in new free programs; and that you know you can do these things. 20 This license, the Lesser General Public License, applies to some 21 specially designated software packages--typically libraries--of the 22 Free Software Foundation and other authors who decide to use it. You 23 can use it too, but we suggest you first think carefully about whether 24 this license or the ordinary General Public License is the better 25 strategy to use in any particular case, based on the explanations below. 26 27 When we speak of free software, we are referring to freedom of use, 28 not price. Our General Public Licenses are designed to make sure that 29 you have the freedom to distribute copies of free software (and charge 30 for this service if you wish); that you receive source code or can get 31 it if you want it; that you can change the software and use pieces of 32 it in new free programs; and that you are informed that you can do 33 these things. 30 34 31 35 To protect your rights, we need to make restrictions that forbid 32 anyone to deny you these rights or to ask you to surrender the rights. 33 These restrictions translate to certain responsibilities for you if 34 you distribute copies of the library,or if you modify it.36 distributors to deny you these rights or to ask you to surrender these 37 rights. These restrictions translate to certain responsibilities for 38 you if you distribute copies of the library or if you modify it. 35 39 36 40 For example, if you distribute copies of the library, whether gratis 37 41 or for a fee, you must give the recipients all the rights that we gave 38 42 you. You must make sure that they, too, receive or can get the source 39 code. If you link a programwith the library, you must provide40 complete object files to the recipients so that they can relink them41 with the library ,after making changes to the library and recompiling43 code. If you link other code with the library, you must provide 44 complete object files to the recipients, so that they can relink them 45 with the library after making changes to the library and recompiling 42 46 it. And you must show them these terms so they know their rights. 43 47 44 Our method of protecting your rights has two steps: (1) copyright45 the library, and (2) offer you this licensewhich gives you legal48 We protect your rights with a two-step method: (1) we copyright the 49 library, and (2) we offer you this license, which gives you legal 46 50 permission to copy, distribute and/or modify the library. 47 51 48 Also, for each distributor's protection, we want to make certain 49 that everyone understands that there is no warranty for this free 50 library. If the library is modified by someone else and passed on, we 51 want its recipients to know that what they have is not the original 52 version, so that any problems introduced by others will not reflect on 53 the original authors' reputations. 54 55 56 Finally, any free program is threatened constantly by software 57 patents. We wish to avoid the danger that companies distributing free 58 software will individually obtain patent licenses, thus in effect 59 transforming the program into proprietary software. To prevent this, 60 we have made it clear that any patent must be licensed for everyone's 61 free use or not licensed at all. 62 63 Most GNU software, including some libraries, is covered by the ordinary 64 GNU General Public License, which was designed for utility programs. This 65 license, the GNU Library General Public License, applies to certain 66 designated libraries. This license is quite different from the ordinary 67 one; be sure to read it in full, and don't assume that anything in it is 68 the same as in the ordinary license. 69 70 The reason we have a separate public license for some libraries is that 71 they blur the distinction we usually make between modifying or adding to a 72 program and simply using it. Linking a program with a library, without 73 changing the library, is in some sense simply using the library, and is 74 analogous to running a utility program or application program. However, in 75 a textual and legal sense, the linked executable is a combined work, a 76 derivative of the original library, and the ordinary General Public License 77 treats it as such. 78 79 Because of this blurred distinction, using the ordinary General 80 Public License for libraries did not effectively promote software 81 sharing, because most developers did not use the libraries. We 82 concluded that weaker conditions might promote sharing better. 83 84 However, unrestricted linking of non-free programs would deprive the 85 users of those programs of all benefit from the free status of the 86 libraries themselves. This Library General Public License is intended to 87 permit developers of non-free programs to use free libraries, while 88 preserving your freedom as a user of such programs to change the free 89 libraries that are incorporated in them. (We have not seen how to achieve 90 this as regards changes in header files, but we have achieved it as regards 91 changes in the actual functions of the Library.) The hope is that this 92 will lead to faster development of free libraries. 52 To protect each distributor, we want to make it very clear that 53 there is no warranty for the free library. Also, if the library is 54 modified by someone else and passed on, the recipients should know 55 that what they have is not the original version, so that the original 56 author's reputation will not be affected by problems that might be 57 introduced by others. 58 59 60 Finally, software patents pose a constant threat to the existence of 61 any free program. We wish to make sure that a company cannot 62 effectively restrict the users of a free program by obtaining a 63 restrictive license from a patent holder. Therefore, we insist that 64 any patent license obtained for a version of the library must be 65 consistent with the full freedom of use specified in this license. 66 67 Most GNU software, including some libraries, is covered by the 68 ordinary GNU General Public License. This license, the GNU Lesser 69 General Public License, applies to certain designated libraries, and 70 is quite different from the ordinary General Public License. We use 71 this license for certain libraries in order to permit linking those 72 libraries into non-free programs. 73 74 When a program is linked with a library, whether statically or using 75 a shared library, the combination of the two is legally speaking a 76 combined work, a derivative of the original library. The ordinary 77 General Public License therefore permits such linking only if the 78 entire combination fits its criteria of freedom. The Lesser General 79 Public License permits more lax criteria for linking other code with 80 the library. 81 82 We call this license the "Lesser" General Public License because it 83 does Less to protect the user's freedom than the ordinary General 84 Public License. It also provides other free software developers Less 85 of an advantage over competing non-free programs. These disadvantages 86 are the reason we use the ordinary General Public License for many 87 libraries. However, the Lesser license provides advantages in certain 88 special circumstances. 89 90 For example, on rare occasions, there may be a special need to 91 encourage the widest possible use of a certain library, so that it becomes 92 a de-facto standard. To achieve this, non-free programs must be 93 allowed to use the library. A more frequent case is that a free 94 library does the same job as widely used non-free libraries. In this 95 case, there is little to gain by limiting the free library to free 96 software only, so we use the Lesser General Public License. 97 98 In other cases, permission to use a particular library in non-free 99 programs enables a greater number of people to use a large body of 100 free software. For example, permission to use the GNU C Library in 101 non-free programs enables many more people to use the whole GNU 102 operating system, as well as its variant, the GNU/Linux operating 103 system. 104 105 Although the Lesser General Public License is Less protective of the 106 users' freedom, it does ensure that the user of a program that is 107 linked with the Library has the freedom and the wherewithal to run 108 that program using a modified version of the Library. 93 109 94 110 The precise terms and conditions for copying, distribution and 95 111 modification follow. Pay close attention to the difference between a 96 112 "work based on the library" and a "work that uses the library". The 97 former contains code derived from the library, while the latter only 98 works together with the library. 99 100 Note that it is possible for a library to be covered by the ordinary 101 General Public License rather than by this special one. 102 103 104 GNU LIBRARY GENERAL PUBLIC LICENSE 113 former contains code derived from the library, whereas the latter must 114 be combined with the library in order to run. 115 116 117 GNU LESSER GENERAL PUBLIC LICENSE 105 118 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 106 119 107 0. This License Agreement applies to any software library which108 contains a notice placed by the copyright holder or other authorized 109 party saying it may be distributed under the terms of this Library 110 General Public License (also called "this License"). Each licensee is 111 addressed as "you".120 0. This License Agreement applies to any software library or other 121 program which contains a notice placed by the copyright holder or 122 other authorized party saying it may be distributed under the terms of 123 this Lesser General Public License (also called "this License"). 124 Each licensee is addressed as "you". 112 125 113 126 A "library" means a collection of software functions and/or data … … 261 274 262 275 263 6. As an exception to the Sections above, you may also com pile or276 6. As an exception to the Sections above, you may also combine or 264 277 link a "work that uses the Library" with the Library to produce a 265 278 work containing portions of the Library, and distribute that work … … 288 301 to use the modified definitions.) 289 302 290 b) Accompany the work with a written offer, valid for at 303 b) Use a suitable shared library mechanism for linking with the 304 Library. A suitable mechanism is one that (1) uses at run time a 305 copy of the library already present on the user's computer system, 306 rather than copying library functions into the executable, and (2) 307 will operate properly with a modified version of the library, if 308 the user installs one, as long as the modified version is 309 interface-compatible with the version that the work was made with. 310 311 c) Accompany the work with a written offer, valid for at 291 312 least three years, to give the same user the materials 292 313 specified in Subsection 6a, above, for a charge no more 293 314 than the cost of performing this distribution. 294 315 295 c) If distribution of the work is made by offering access to copy316 d) If distribution of the work is made by offering access to copy 296 317 from a designated place, offer equivalent access to copy the above 297 318 specified materials from the same place. 298 319 299 d) Verify that the user has already received a copy of these320 e) Verify that the user has already received a copy of these 300 321 materials or that you have already sent this user a copy. 301 322 … … 303 324 Library" must include any data and utility programs needed for 304 325 reproducing the executable from it. However, as a special exception, 305 the source code distributed need not include anything that is normally306 distributed (in either source or binary form) with the major326 the materials to be distributed need not include anything that is 327 normally distributed (in either source or binary form) with the major 307 328 components (compiler, kernel, and so on) of the operating system on 308 329 which the executable runs, unless that component itself accompanies … … 354 375 subject to these terms and conditions. You may not impose any further 355 376 restrictions on the recipients' exercise of the rights granted herein. 356 You are not responsible for enforcing compliance by third parties to377 You are not responsible for enforcing compliance by third parties with 357 378 this License. 358 379 … … 398 419 399 420 13. The Free Software Foundation may publish revised and/or new 400 versions of the L ibraryGeneral Public License from time to time.421 versions of the Lesser General Public License from time to time. 401 422 Such new versions will be similar in spirit to the present version, 402 423 but may differ in detail to address new problems or concerns. … … 446 467 447 468 448 Appendix:How to Apply These Terms to Your New Libraries469 How to Apply These Terms to Your New Libraries 449 470 450 471 If you develop a new library, and you want it to be of the greatest … … 463 484 464 485 This library is free software; you can redistribute it and/or 465 modify it under the terms of the GNU L ibraryGeneral Public486 modify it under the terms of the GNU Lesser General Public 466 487 License as published by the Free Software Foundation; either 467 version 2 of the License, or (at your option) any later version.488 version 2.1 of the License, or (at your option) any later version. 468 489 469 490 This library is distributed in the hope that it will be useful, 470 491 but WITHOUT ANY WARRANTY; without even the implied warranty of 471 492 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 472 Library General Public License for more details. 473 474 You should have received a copy of the GNU Library General Public 475 License along with this library; if not, write to the Free 476 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 477 MA 02111-1307, USA 493 Lesser General Public License for more details. 494 495 You should have received a copy of the GNU Lesser General Public 496 License along with this library; if not, write to the Free Software 497 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 478 498 479 499 Also add information on how to contact you by electronic and paper mail. … … 490 510 491 511 That's all there is to it! 512 513 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/ChangeLog
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 2003-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2 3 * vsnprintf.c (vsnprintf): Don't pad string with extra nulls. 4 (main): Test that we don't write too much data. 5 6 2003-04-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 7 8 * configure.in (funcs, AC_CHECK_FUNCS): Add snprintf and 9 vsnprintf. 10 * snprintf.c, vsnprintf.c: New files. 11 * Makefile.in (CFILES): Add snprintf.c and vsnprintf.c. 12 (CONFIGURED_OFILES): Add snprintf.o and vsnprintf.o. 13 Regenerate dependencies. 14 15 * functions.texi, configure, config.in: Regenerated. 16 17 2003-04-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 18 19 * mempcpy.c, stpcpy.c, stpncpy.c: New files. 20 * configure.in (funcs, AC_CHECK_FUNCS): Add mempcpy, stpcpy 21 and stpncpy. 22 * Makefile.in (CFILES): Add mempcpy.c, stpcpy.c and stpncpy.c. 23 (CONFIGURED_OFILES): Add mempcpy.o, stpcpy.o and stpncpy.o. 24 Regenerate dependencies. 25 26 * functions.texi, configure, config.in: Regenerated. 27 28 2003-04-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 29 30 * argv.c: Fix comments. 31 * calloc.c: Don't unnecessarily include "libiberty.h". 32 (bzero): Add prototype. 33 * floatformat.c: Include "ansidecl.h", rely on ANSI_PROTOTYPES. 34 * getcwd.c (getcwd): Use standard definition to avoid conflicts 35 with system headers. 36 * hashtab.c (htab_traverse): Delete unused variables. 37 * rename.c: Include "ansidecl.h". 38 (rename): Use standard definition to avoid conflicts with system 39 headers. 40 * strsignal.c: Rely on ANSI_PROTOTYPES. 41 * strstr.c: Check GNUC >= 2, not GNUC == 2. 42 * vfprintf.c: Include "ansidecl.h", rely on ANSI_PROTOTYPES. 43 * vprintf.c: Include "ansidecl.h" earlier, rely on 44 ANSI_PROTOTYPES. 45 * vsprintf.c: Include "ansidecl.h" earlier, rely on 46 ANSI_PROTOTYPES and possibly include <stdarg.h>. 47 48 * Makefile.in: Regenerate dependencies. 49 50 2003-04-15 DJ Delorie <dj@redhat.com> 51 52 * maint-tool (deps): Scan for headers in $srcdir also. 53 54 2003-04-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 55 56 PR target/10338 57 PR bootstrap/10198 58 PR bootstrap/10140 59 * getopt.c (exchange, _getopt_initialize): Use mempcpy not 60 __mempcpy. 61 * regex.c (regerror): Likewise. 62 63 2003-04-14 Roger Sayle <roger@eyesopen.com> 64 65 * argv.c: Use ANSI_PROTOTYPES instead of __STDC__. 66 * memchr.c: Likewise. 67 * strcasecmp.c: Likewise. 68 * strncasecmp.c: Likewise. 69 * strncmp.c: Likewise. 70 * xatexit.c: Likewise. 71 * xmalloc.c: Likewise. 72 73 * copysign.c: Use traditional function declaration instead of DEFUN. 74 * sigsetmask.c: Likewise. 75 76 * memcmp.c: Both of the above, ANSI_PROTOTYPES and DEFUN. 77 * memset.c: Likewise. 78 79 * memcpy.c: ANSI_PROTOTYPES, DEFUN and prototype bcopy. 80 * memmove.c: Likewise. 81 82 2003-04-14 Roger Sayle <roger@eyesopen.com> 83 84 * strdup.c (strdup): Tweak implementation to use memcpy. 85 86 2003-04-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 87 88 * configure.in (HAVE_UINTPTR_T): Always define. 89 * configure: Regenerated. 90 91 2003-03-23 Alexandre Oliva <aoliva@redhat.com> 92 93 * Makefile.in (MULTIOSDIR): New macro. Use $(CC) $(LIBCFLAGS) 94 instead of $$CC alone. 95 (install_to_tooldir): Use it. 96 97 2003-17-03 Jan Hubicka <jh@suse.cz> 98 99 * hashtab.c (htab_traverse_noresize): Break out from ... 100 * hashtab.c (htab_traverse): ... here. 101 102 2003-12-03 Jan Hubicka <jh@suse.cz> 103 104 * hashtab.c (htab_expand): Fix warning. 105 106 * hashtab.c (htab_expand): Compute the size of hashtable based 107 on the number of elements actually used. 108 (htab_traverse): Call htab_expand when table is too empty. 109 110 2003-03-11 Carlo Wood <carlo@gnu.org> 111 112 * cplus-dem.c (demangle_integral_value): Correction to reflect 113 patch of 2002-01-10 in order to also make negative multi-digits 114 without leading underscore work. 115 116 2003-03-03 Mark Mitchell <mark@codesourcery.com> 117 118 * cplus-dem.c: Add license exception to copyright notice. 119 120 2003-02-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 121 122 * physmem.c: Formatting changes from upstream. 123 124 2003-02-24 Danny Smith <dannysmith@users.source.forge.net> 125 126 * physmem.c (physmem_total): Add _WIN32 support. 127 (physmem_available): Likewise. 128 129 2003-02-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 130 131 * physmem.c (physmem_total) [HAVE_GETSYSINFO]: Test for 132 GSI_PHYSMEM. 133 (physmem_available) [HAVE_TABLE]: Test for TBL_VMSTATS. 134 135 2003-02-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 136 137 * configure.in: Check for sys/systemcfg.h and 138 _system_configuration. 139 * physmem.c: Add support for AIX. Tweek formatting as per 140 upstream coreutils beta. 141 142 2003-02-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 143 Richard Earnshaw <rearnsha@arm.com> 144 Geoffrey Keating <geoffk@apple.com> 145 146 * configure.in: Check for sys/sysctl.h and sysctl. 147 * physmem.c: Add support for *bsd and darwin. 148 * Makefile.in: Generate depedency for physmem.o. 149 150 2003-02-21 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 151 152 * physmem.c (physmem_total) [HAVE_GETSYSINFO]: Use getsysinfo on 153 Tru64 UNIX. 154 (physmem_available) [HAVE_TABLE && HAVE_SYS_TABLE_H]: Use table on 155 Tru64 UNIX. 156 157 * configure.in (AC_CHECK_HEADERS): Check for sys/sysinfo.h, 158 machine/hal_sysinfo.h, sys/table.h. 159 (checkfuncs, AC_CHECKFUNCS): Check for getsysinfo, table. 160 * configure, config.in: Regenerate. 161 162 2003-02-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 163 164 * configure.in: Check for sys/sysmp.h and sysmp. 165 * physmem.c: Pull upstream copy, add support for irix6. 166 167 * config.in, configure: Regenerated. 168 169 2003-02-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 170 171 * physmem.c (physmem_total, physmem_available): De-ANSI-fy. 172 * configure.in (AC_CHECK_FUNCS): Add pstat_getstatic and 173 pstat_getdynamic. 174 175 2003-02-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 176 177 * Makefile.in (CFILES): Add physmem.c. 178 (REQUIRED_OFILES): Add physmem.o. 179 * configure.in: Check for sys/pstat.h. 180 (checkfuncs): Add pstat_getstatic and pstat_getdynamic. 181 * physmem.c: New file, copied from textutils. 182 183 * config.in, configure: Regenerated. 184 185 2003-02-20 Daniel Jacobowitz <drow@mvista.com> 186 187 * Makefile.in (CFILES): Add lrealpath.c. 188 (REQUIRED_OFILES): Add lrealpath.o. 189 (lrealpath.o): Add rule. 190 * aclocal.m4 (libiberty_NEED_DECLARATION): Add. 191 * configure.in: Add realpath and canonicalize_file_name to 192 checkfuncs and AC_CHECK_FUNCS. Use libiberty_NEED_DECLARATION 193 for canonicalize_file_name. 194 * lrealpath.c: New file. 195 * make-relative-prefix.c: Update documentation. 196 (make_relative_prefix): Simplify. Use lbasename and lrealpath. 197 * config.in: Regenerated. 198 * configure: Regenerated. 199 * functions.texi: Regenerated. 200 201 2003-02-20 jmc <jmc@prioris.mini.pw.edu.pl> 202 203 * cplus_dem.c: Fix typo: intializes -> initializes. 204 205 2003-02-20 Alexandre Oliva <aoliva@redhat.com> 206 207 * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to 208 config.status. 209 * configure: Rebuilt. 210 211 2003-02-13 Daniel Jacobowitz <drow@mvista.com> 212 213 Fix PR c++/7612. 214 * cplus-dem.c (demangle_signature): Call string_delete. 215 Remove extra string_init. 216 (demangle_arm_hp_template): Call string_delete instead of 217 string_clear. Add missing string_delete call. 218 (demangle_qualified): Add missing string_delete call. 219 (do_type): Remove unused variable btype. Add missing string_delete 220 call. Call string_delete instead of string_clear. 221 (demangle_fund_type): Move variable btype inside of the switch 222 statement. Add missing string_delete call. 223 (do_arg): Call string_delete instead of string_clear. Remove extra 224 string_init. 225 (demangle_nested_args): Free work->previous_argument. 226 227 2003-02-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 228 229 * acconfig.h: New file. Add uintptr_t. 230 * config.in: Regenerated. 231 232 2003-02-04 Joseph S. Myers <jsm@polyomino.org.uk> 233 234 * libiberty.texi: Update to GFDL 1.2. 235 236 2003-01-30 Christian Cornelssen <ccorn@cs.tu-berlin.de> 237 238 * Makefile.in (libiberty_topdir): New subst. 239 (mkinstalldirs): Redefine in terms of the above. 240 * configure.in: AC_SUBST it. 241 * configure: Regenerate. 242 243 2003-01-28 Christian Cornelssen <ccorn@cs.tu-berlin.de> 244 245 * Makefile.in (all-subdir, check-subdir, installcheck-subdir) 246 (info-subdir, install-info-subdir, clean-info-subdir) 247 (dvi-subdir, install-subdir, etags-subdir, mostlyclean-subdir) 248 (clean-subdir, distclean-subdir, maintainer-clean-subdir): 249 Pass $(FLAGS_TO_PASS). 250 251 2003-01-27 Alexandre Oliva <aoliva@redhat.com> 252 253 * Makefile.in (install_to_tooldir): Instead of $(MULTISUBDIR), use 254 /`$$CC -print-multi-os-directory`. 255 256 2003-01-26 Daniel Jacobowitz <drow@mvista.com> 257 258 * hashtab.c (htab_create_alloc_ex): New function. 259 (hatab_set_functions_ex): New function. 260 (htab_delete, htab_expand): Support alternate allocation functions. 261 262 2003-01-24 Christopher Faylor <cgf@redhat.com> 263 264 * configure.in: Remove special pex-cygwin consideration. 265 * configure: Regenerate. 266 * pex-cygwin.c: Remove. 267 * Makefile.in: Remove pex-cygwin.[co] lines. 268 269 2003-01-24 Zack Weinberg <zack@codesourcery.com> 270 271 * Makefile.in (CFILES): Add pex-*.c. 272 (REQUIRED_OFILES): Change pexecute.o to @pexecute@ 273 (CONFIGURED_OFILES): Add pex-*.o. 274 (TEXIFILES): Add pexecute.txh. 275 (pexecute.o): Delete rule. 276 (pex-cygwin.o, pex-djgpp.o, pex-mpw.o, pex-msdos.o, pex-os2.o, 277 pex-unix.o, pex-win32.o): New rules. 278 * configure.in: Change AC_INIT argument to xmalloc.c. 279 Compute appropriate pexecute implementation and substitute it 280 as @pexecute@. 281 282 * pexecute.c: Split up into... 283 * pex-cygwin.c, pex-djgpp.c, pex-mpw.c, pex-msdos.c, pex-os2.c, 284 pex-unix.c, pex-win32.c, pex-common.h, pexecute.txh: ... these 285 new files. 286 287 * functions.texi: Regenerate. 288 * configure: Regenerate. 289 290 2003-01-20 Josef Zlomek <zlomekj@suse.cz> 291 292 * hashtab.c (htab_expand): Fix allocation of new entries. 293 294 2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de> 295 296 * Makefile.in (FLAGS_TO_PASS): Also pass DESTDIR. 297 298 * Makefile.in (install_to_libdir, install_to_tooldir): Add a 299 mkinstalldirs command. 300 301 2002-12-04 Danny Smith <dannysmith@users.sourceforge.net> 302 303 * make-relative-prefix.c (HAVE_HOST_EXECUTABLE_SUFFIX): 304 Define for hosts with HOST_EXECUTABLE_SUFFIX. 305 306 2002-11-24 Nick Clifton <nickc@redhat.com> 307 308 * make-relative-prefix.c (make_relative_prefix): Ensure return 309 string is empty before using strcat to construct it. 310 311 2002-11-22 Daniel Jacobowitz <drow@mvista.com> 312 313 * Makefile.in: Add make-relative-prefix.c. 314 * make-relative-prefix.c: New file. 315 * functions.texi: Rebuilt. 316 317 2002-11-16 Jakub Jelinek <jakub@redhat.com> 318 319 * md5.c (md5_process_block): Avoid `function-like macro "F{G,H,I}" must be 320 used with arguments in traditional C' warnings. 321 322 2002-10-16 Jakub Jelinek <jakub@redhat.com> 323 324 * config.table: Use mh-s390pic for s390x too. 325 326 2002-10-06 Andreas Jaeger <aj@suse.de> 327 328 * libiberty/cplus-dem.c (ada_demangle): Get rid of unneeded 329 variable and of strict-aliasing warning. 330 (grow_vect): Use char as first parameter. 331 332 2002-09-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 333 334 * Makefile.in (all): Fix multilib parallel build. 335 336 2002-09-19 John David Anglin <dave@hiuly1.hia.nrc.ca> 337 338 * cp-demangle.c (demangling_new): Cast 0 to enum. 339 (demangle_char): Cast return of strdup to char *. 340 (is_gnu_v3_mangled_ctor): Cast 0 to enum. 341 (is_gnu_v3_mangled_dtor): Likewise. 342 * cplus-dem.c (grow_vect): Cast return of xrealloc to void *. 343 (work_stuff_copy_to_from): Cast return of xmalloc to char **. 344 * fibheap.c (fibnode_new): Cast return of xcalloc to fibnode_t. 345 * md5.c (md5_process_bytes): Cast results back to const void *. 346 (md5_process_block): Add cast to const md5_uint32 *. 347 * regex.c (re_compile_fastmap): Cast enum to UCHAR_T. 348 * safe-ctype.c (L, XL, U, XU, D, P, _, C, Z, M, V, T, S): Add cast to 349 unsigned short. 350 * splay-tree.c (splay_tree_xmalloc_allocate): Cast return of xmalloc 351 to void *. 352 * vasprintf.c (int_vasprintf): Cast return of malloc to char *. 353 354 2002-09-19 Nick Clifton <nickc@redhat.com> 355 356 * README: Update email addresses for bugs and patches. 357 358 2002-09-10 Mike Stump <mrs@apple.com> 359 360 * splay-tree.c (splay_tree_successor): Fix comments. 361 362 2002-09-11 Zack Weinberg <zack@codesourcery.com> 363 364 * cplus-dem.c: Code under #ifdef MAIN moved to gcc/cp/cxxfilt.c. 365 * testsuite/Makefile.in: Adjust for test-demangle. 366 * testsuite/regress-demangle: Deleted. 367 * testsuite/test-demangle.c: New file. 368 * testsuite/demangle-expected: Change \$ to $ throughout, now that 369 this file is not being read by a shell script. 370 371 2002-09-05 Roger Sayle <roger@eyesopen.com> 372 373 * regex.c: Only use "#pragma alloca" on AIX when not using gcc. 374 375 2002-08-07 DJ Delorie <dj@redhat.com> 376 377 * regex.c (re_error_msgid): Just use a simple array of strings. 378 (re_compile_pattern): Compensate. 379 (re_comp): Likewise. 380 (re_comp): Likewise. 381 (regerror): Likewise. 382 383 2002-07-29 Neil Booth <neil@daikokuya.co.uk> 384 385 * cplus-dem.c (PREPEND_BLANK): Remove. 386 387 2002-07-10 Jason Merrill <jason@redhat.com> 388 389 * cp-demangle.c (demangle_identifier): Support extended Unicode 390 characters. 391 392 2002-07-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 393 394 * cp-demangle.c (demangle_v3_with_details): Wrap in 395 !defined IN_GLIBCPP_V3. 396 397 2002-07-01 Mark Mitchell <mark@codesourcery.com> 398 399 * cp-demangle.c (demangle_operator_name): Add type_arg parameter. 400 Set it for the "st" operator. 401 (demangle_expression): Handle expressions with types as arguments. 402 403 2002-06-30 Douglas Rupp <rupp@gnat.com> 404 405 * configure.in (OUTPUT_OPTION,NO_MINUS_C_MINUS_O): Configure. 406 * Makefile.in (OUTPUT_OPTION): Use. 407 408 2002-06-22 Peter Breitenlohner <peb@mppmu.mpg.de> 409 410 * Makefile.in (install_to_libdir): Add $(DESTDIR). 411 (install_to_tooldir): Likewise. 412 413 2002-06-17 Douglas Rupp <rupp@gnat.com> 414 415 * lbasename.c: Add 2002 to copyright. 416 (IS_DIR_SEPARATOR): Remove VMS junk. 417 418 2002-06-05 Geoffrey Keating <geoffk@redhat.com> 419 420 * hashtab.c (htab_create): New stub function for backward 421 compatibility. 422 (htab_try_create): Likewise. 423 424 2002-06-03 Geoffrey Keating <geoffk@redhat.com> 425 426 * hashtab.c (htab_create): Delete. 427 (htab_try_create): Delete. 428 (htab_create_alloc): New. 429 (htab_delete): Support user-specified memory allocation. 430 (htab_expand): Likewise. 431 432 2002-05-22 Roman Lechtchinsky <rl@cs.tu-berlin.de> 433 434 * configure.in: Fix typo in the code checking for sys_errlist. 435 * configure: Regenerated. 436 437 2002-05-13 Andreas Schwab <schwab@suse.de> 438 439 * config.table: Use mh-x86pic also for x86-64. 440 441 2002-05-08 Alexandre Oliva <aoliva@redhat.com> 442 443 * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at 444 script entry, and set LD to it when configuring multilibs. 445 * configure: Rebuilt. 446 447 2002-05-07 Mark Mitchell <mark@codesourcery.com> 448 449 * configure.in (AC_TYPE_PID_T): Use it. 450 * configure: Regenerated. 451 * getruntime.c: Include <sys/types.h>. 452 * waitpid.c: Likewise. Use pid_t, not int, as the type of "pid". 453 454 2002-04-09 Richard Henderson <rth@redhat.com> 455 456 * hashtab.c (higher_prime_number): Use 7 as minimum. 457 (find_empty_slot_for_expand): Don't compute hash2 unless needed. 458 (htab_find_slot_with_hash): Likewise. 459 460 2002-04-01 Phil Edwards <pme@gcc.gnu.org> 461 462 * cp-demangle.c (__cxa_demangle): Also protect with IN_GLIBCPP_V3. 463 (is_gnu_v3_mangled_ctor, is_gnu_v3_mangled_ctor): Conditionally 464 not compile if IN_GLIBCPP_V3 defined. 465 * dyn-string.c: Also allow IN_GLIBCPP_V3 to change allocation scheme. 466 467 2002-03-30 Bryce McKinlay <bryce@waitaki.otago.ac.nz> 468 469 * cp-demangle.c (java_demangle_v3): Don't try to release "demangled" 470 if it is NULL. 471 472 2002-03-27 DJ Delorie <dj@redhat.com> 473 474 * hex.c: Add documentation. 475 (_hex_value): Provide non-ASCII empty table. 476 (hex_init): Initialize the non-ASCII table. 477 * functions.texi: Regenerate. 478 479 2002-03-27 Mark Mitchell <mark@codesourcery.com> 480 481 * dyn-string.c: Add libgcc exception to copyright notice. 482 483 2002-03-26 H.J. Lu (hjl@gnu.org) 484 485 * config.table: Support --with-build-subdir. 486 * configure.in: Likewise. 487 * configure: Rebuild. 488 489 2002-03-18 Stuart Griffith <Stuart_Griffith@credence.com> 490 491 * strtod.c (strtod): Increment 8 chars, not 7, when `infinity' 492 seen. 493 494 2002-03-12 Mark Mitchell <mark@codesourcery.com> 495 496 * cp-demangle.c: Add libgcc exception to cp-demangle.c copyright 497 notice. 498 499 2002-03-11 Douglas B Rupp <rupp@gnat.com> 500 501 * xatexit.c [VMS]: Include stdlib.h and unixlib.h. 502 503 2002-03-06 Jim Blandy <jimb@redhat.com> 504 505 * splay-tree.c (splay_tree_xmalloc_allocate, 506 splay_tree_xmalloc_deallocate): Use K&R-style definitions, not 507 prototyped definitions. Mark `data' arguments as unused. 508 509 2002-03-06 Andrew Cagney <ac131313@redhat.com> 510 511 * floatformat.c (floatformat_arm_ext_big): Delete definition. 512 513 2002-03-04 Phil Edwards <pme@gcc.gnu.org> 514 515 * configure.in: Add --enable-install-libiberty option. 516 * Makefile.in (INSTALLED_HEADERS): New variable. 517 (install_to_libdir): Possibly also copy headers. 518 * configure: Regenerated. 519 520 2002-03-04 Neil Booth <neil@daikokuya.demon.co.uk> 521 522 * xmalloc.c (xmalloc_fail): Clarify error message further. 523 524 2002-03-03 Neil Booth <neil@daikokuya.demon.co.uk> 525 526 * xmalloc.c (xmalloc_fail): Clarify error message. 527 528 2002-02-22 Jim Blandy <jimb@redhat.com> 529 530 * splay-tree.c (splay_tree_xmalloc_allocate, 531 splay_tree_xmalloc_deallocate): New functions. 532 (splay_tree_new): Call splay_tree_new_with_allocator, passing the 533 above functions and a dummy data pointer. 534 (splay_tree_new_with_allocator): New function. 535 (splay_tree_delete_helper, splay_tree_delete, splay_tree_insert, 536 splay_tree_remove): Use the splay tree's allocation and 537 deallocation functions. 538 539 2002-02-19 Scott Snyder <snyder@fnal.gov> 540 541 * testsuite/demangle-expected: Add test case for infinite loop in 542 demangler. 543 * cplus-dem.c (demangle_arm_hp_template): Stop trying to demangle 544 if do_type() doesn't make any progress --- prevents an infinite 545 loop. 546 547 2002-02-18 Carlo Wood <carlo@gnu.org> 548 549 PR c++/5390 550 * cplus-dem.c (demangle_integral_value): Accept multi-digit 551 numbers that do not start with an underscore; This is needed 552 for integer template parameters. This doesn't break anything 553 because multi-digit numbers are never followed by a digit. 554 * testsuite/demangle-expected: Corrected all mangled test 555 cases with multi-digit template parameters: g++ 2.95.x does 556 not generate underscores around these parameters. 557 558 2002-02-05 Jason Merrill <jason@redhat.com> 559 560 * cplus-dem.c (flags): Add DMGL_VERBOSE 561 (cplus_demangle_v3_p): Remove. 562 (demangle_it): Add DMGL_TYPES to passed flags. 563 * cp-demangle.c (cplus_demangle_v3_all): Remove. 564 (cplus_demangle_v3_type): Remove. 565 (cplus_demangle_v3): Add options parm. 566 567 2002-02-02 H.J. Lu (hjl@gnu.org) 568 569 * cp-demangle.c (cp_demangle_type): Do not protect with 570 IN_LIBGCC2. 571 (cplus_demangle_v3_all): New. 572 (cplus_demangle_v3): Call cplus_demangle_v3_all. 573 (cplus_demangle_v3_type): Call cplus_demangle_v3_all. 574 575 * cplus-dem.c (cplus_demangle_v3_p): New function pointer. 576 Initialized to cplus_demangle_v3. 577 (cplus_demangle_with_style): Call cplus_demangle_v3_p instead 578 of cplus_demangle_v3. 579 (main): Set cplus_demangle_v3_p to cplus_demangle_v3_type for 580 command line symbol. 581 582 * testsuite/regress-demangle: Pass the mangled name at the 583 command line. 584 585 2002-02-01 H.J. Lu <hjl@gnu.org> 586 587 * cp-demangle.c (cp_demangle_type): Call demangling_new with 588 DMGL_GNU_V3. 589 590 2002-01-31 Phil Edwards <pme@gcc.gnu.org> 591 592 * cp-demangle.c: Revert yesterday's change. 593 594 2002-01-31 Adam Megacz <adam@xwt.org> 595 596 * gcc/libiberty/configure.in: Treat mingw the same as cywin 597 wrt HAVE_SYS_ERRLIST. 598 599 2002-01-30 Phil Edwards <pme@gcc.gnu.org> 600 601 * cp-demangle.c (cp_demangle_type): Do not protect with IN_LIBGCC2. 602 (cplus_demangle_v3): Mimic __cxa_demangle and fall back on 603 cp_demangle_type. 604 * testsuite/demangle-expected: New gnu-v3 test. 605 606 2002-01-22 Momchil Velikov <velco@fadata.bg> 607 608 * configure.in (variable detection): Use arrays of unspecified 609 size instead of plain integers. 610 611 2002-01-18 DJ Delorie <dj@redhat.com> 612 613 * Makefile.in (TESTLIB): New. This library is for future 614 testsuites. 615 (CFILES, REQUIRED_OFILES, CONFIGURED_OFILES): Re-alphabetize, 616 break down by letter. 617 (REQUIRED_OFILES): List long-to-compile files first. 618 (maint-deps): New, target for updating dependencies. 619 (dependencies): Update. 620 * maint-tool: Add dependency-generating option. 621 * configure.in: Check for _doprnt even if we're not providing it. 622 * configure: Regenerate. 623 624 * _doprnt.c: Modifications to allow compiling on any platform. 625 * copysign.c: Likewise. 626 * putenv.c: Likewise. 627 * setenv.c: Likewise. 628 * vsprintf.c: Likewise. 629 630 2002-01-15 Douglas B Rupp <rupp@gnat.com> 631 632 * mkstemps.c (mkstemps): On VMS, open temp file with option 633 that causes it to be deleted when closed. 634 635 2002-01-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 636 637 * cp-demangle.c (long_options): Const-ify. 638 * cplus-dem.c (long_options): Likewise. 639 640 * cplus-dem.c (mystrstr): Delete. All callers changed to use 641 strstr instead. 642 643 2001-12-31 Ira Ruben <ira@apple.com> 644 645 * aclocal.m4 (libiberty_AC_FUNC_STRNCMP): Use anon mmap as 2nd try. 646 * configure: Regenerated. 647 648 2001-12-24 Douglas B. Rupp <rupp@gnat.com> 649 650 * configure.in (uintptr_t): Use AC_CHECK_TYPE. 651 * configure: Regenerated. 652 653 2001-12-12 Craig Rodrigues <rodrigc@gcc.gnu.org> 654 655 PR other/2719 656 * cplus-dem.c (consume_count): Treat negative count as an error. 657 * testsuite/demangle-expected: Added testcase. 658 659 Tue Dec 11 07:08:57 2001 Douglas B. Rupp <rupp@gnat.com> 660 661 * configure.in: Hardcode that vfork works on VMS host. 662 * configure: Regenerated. 663 664 2001-12-06 Richard Henderson <rth@redhat.com> 665 666 * cplus-dem.c (libiberty_demanglers): Add no_demangling case. 667 (cplus_demangle): Support no_demangling. 668 669 2001-11-27 Zack Weinberg <zack@codesourcery.com> 670 671 * _doprnt.c: Moved here from gcc/doprint.c. Adjust to build 672 in libiberty context. Fix typo in leading comment. 673 * configure.in: Fix various AC_DEFINEs so autoheader works. 674 If any of vprintf, vsprintf, vfprintf is missing from libc, 675 then AC_REPLACE_FUNCS(_doprnt). 676 677 2001-11-26 DJ Delorie <dj@redhat.com> 678 Daniel Jacobowitz <drow@mvista.com> 679 680 * Makefile.in (stamp-h): Depend on Makefile for proper 681 serialization. 682 (*-subdir): Depend on config.h for proper serialization. 683 684 2001-11-26 DJ Delorie <dj@redhat.com> 685 686 * configure.in: Check for alloca.h (for regex.c and putenv.c). 687 * configure: Regenerate. 688 * config.h: Add HAVE_ALLOCA_H. 689 690 2001-11-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 691 692 * regex.c: Check defined(__STDC__) || defined(ALMOST_STDC) || 693 defined(HAVE_STRINGIZE) to determine whether ISO CPP token pasting 694 is available. 695 696 Thu Nov 15 11:06:25 2001 Jeffrey A Law (law@cygnus.com) 697 698 * config.in (HAVE_UINTPTR_T): Provide autoconf stub. 699 * configure.in (HAVE_UINTPTR_T): Test for system defining 700 uintptr_t and define HAVE_UINTPTR_T appropriately. 701 * regex.c (uintptr_t): Do not provide a definition if the 702 system provided one. 703 704 * regex.c (PREFIX): Provide an alternate definition for 705 non-ANSI/ISO compilers. 706 (ARG_PREFIX): Likewise. 707 708 2001-11-12 Jim Meyering <meyering@lucent.com> 709 710 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise, 711 this code would end up calling gettext even in packages built 712 with --disable-nls. 713 * getopt.c (_): Likewise. 714 * regex.c (_): Likewise. 715 716 2001-11-03 Alan Modra <amodra@bigpond.net.au> 717 718 * configure.in: Cope with missing makeinfo. 719 * configure: Regenerate. 720 721 2001-10-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 722 723 * hex.c (hex_init): Provide empty stub. 724 725 * hex.c (hex_init): Delete. 726 (_hex_value): Const-ify and initialize at compile-time. 727 728 2001-10-19 H.J. Lu <hjl@gnu.org> 729 730 * Makefile.in ($(TARGETLIB)): Also generate pic/$(TARGETLIB) if 731 necessary. 732 733 2001-10-17 DJ Delorie <dj@redhat.com> 734 735 * argv.c, asprintf.c, choose-temp.c, concat.c, cplus-dem.c, 736 ffs.c, fnmatch.txh, getruntime.c, make-temp-file.c, 737 mkstemps.c, pexecute.c, random.c, strsignal.c, vasprintf.c: 738 Improve manual formatting. 739 * functions.texi: Regenerate. 740 741 2001-10-15 DJ Delorie <dj@redhat.com> 742 743 * Makefile.in (TEXIFILES): Add fnmatch.txh. 744 (maint-undoc): New. 745 maint-tool: Add "undoc" tool. 746 * alloca.c, argv.c, asprintf.c, choose-temp.c, concat.c, 747 fdmatch.c, ffs.c, getruntime.c, insque.c, lbasename.c, 748 make-temp-file.c, mkstemps.c, pexecute.c, random.c, spaces.c, 749 strerror.s, strsignal.c, strtol.c, vasprintf.c: Add or update 750 documentation. 751 * fnmatch.txh: New. 752 * functions.texi: Regenerate. 753 754 2001-10-10 Joseph S. Myers <jsm28@cam.ac.uk> 755 756 * bcmp.c, setenv.c: Use "nonzero" instead of "non-zero". 757 * strtod.c: Use "ISO C" instead of "ANSI C". 758 * functions.texi: Regenerate. 759 760 2001-10-07 Joseph S. Myers <jsm28@cam.ac.uk> 761 762 * alloca.c, clock.c, getcwd.c, getpagesize.c, getpwd.c, index.c, 763 libiberty.texi, memchr.c, putenv.c, rindex.c, strchr.c, strdup.c, 764 strerror.c, strrchr.c, strstr.c, strtod.c, tmpnam.c, vfork.c, 765 xatexit.c, xmalloc.c, xstrerror.c: Improve manual formatting. Fix 766 spelling. Give names to function arguments in documentation. Use 767 (void) prototypes in documentation. 768 * functions.texi: Regenerate. 769 770 2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 771 772 * argv.c (buildargv, tests, main): Const-ify. 773 * cp-demangle.c (operator_code): Likewise. 774 * cplus-dem.c (optable, libiberty_demanglers, 775 cplus_demangle_set_style, cplus_demangle_name_to_style, 776 print_demangler_list): Likewise. 777 * hashtab.c (higher_prime_number): Likewise. 778 * strcasecmp.c (charmap): Likewise. 779 * strerror.c (error_info, strerror, main): Likewise. 780 * strncasecmp.c (charmap): Likewise. 781 * strsignal.c (signal_info): Likewise. 782 783 2001-09-29 DJ Delorie <dj@redhat.com> 784 785 * configure: Regenerate. 786 787 2001-09-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 788 789 * concat.c: Include stdlib.h. 790 791 2001-09-27 Eli Zaretskii <eliz@is.elta.co.il> 792 793 * libiberty.texi: (Top level): Add syncodeindex pg. Add 794 @dircategory and @direntry directives. Add @finalout. 795 (many nodes): Lose the next,prev,up pointers on the @nide line. 796 (Using, Supplemental Functions, Replacement Functions): Fix 797 markup. 798 (Functions): Move around, to allow makeinfo to build the manual 799 without next,prev,up pointers in thye node lines. 800 (Licenses): Fix typos. 801 802 * index.c, rindex.c, strchr.c, strerror.c, strrchr.c, strstr.c, 803 strtol.c, xatexit.c, xexit.c, xmalloc.c: Fix spelling and markup. 804 * functions.texi: Regenerate. 805 806 * copying-lib.texi: Lose the next,prev,up pointers on the @node 807 line. 808 809 2001-09-27 DJ Delorie <dj@redhat.com> 810 811 * configure.in: Don't use in-tree texinfo, because libiberty must 812 be built before it. Check for makeinfo version 4 or higher. 813 * functions.texi: Regenerate. 814 815 2001-09-20 DJ Delorie <dj@redhat.com> 816 Phil Edwards <pedwards@disaster.jaj.com> 817 818 * configure.in (MAKEINFO, PERL): Detect these. 819 (--enable-maintainer-mode): Add. 820 * configure: Regenerate. 821 * Makefile.in (MAKEINFO, PERL): Define. 822 (libiberty.info, libiberty.dvi, libiberty.html): New. 823 (CFILES): Add bsearch.c. 824 (CONFIGURED_OFILES): New, list of objects configure might add. 825 (maint-missing, maint-buildall): New, for maintainers only. 826 (clean, mostlyclean): Add info/dvi/html files. 827 * libiberty.texi, copying-lib.texi, obstacks.texi, functions.texi: New. 828 * gather-docs: New, for maintainers. 829 * maint-tool: New, for maintainers. 830 * alloca.c, atexit.c, basename.c, bcmp.c, bcopy.c, bsearch.c, 831 bzero.c, calloc.c, clock.c, configure.in, configure, getcwd.c, 832 getpagesize.c, getpwd.c, index.c, memchr.c, memcmp.c, memcpy.c, 833 memmove.c, memset.c, putenv.c, rename.c, rindex.c, setenv.c, 834 sigsetmask.c, strcasecmp.c, strchr.c, strdup.c, strerror.c, 835 strncasecmp.c, strncmp.c, strrchr.c, strstr.c, strtod.c, strtol.c, 836 tmpnam.c, vfork.c, vprintf.c, waitpid.c, xatexit.c, xexit.c, 837 xmalloc.c, xmemdup.c, xstrdup.c, xstrerror.c: Add or update 838 documentation. 839 840 2001-09-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 841 842 * concat.c (reconcat): Fix for traditional C. 843 844 2001-09-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 845 846 * concat.c (reconcat): New function. 847 848 2001-09-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 849 850 * concat.c (vconcat_length, vconcat_copy, concat_length, 851 concat_copy, concat_copy2): New functions. 852 (concat): Use vconcat_length/vconcat_copy. 853 854 * alloca.c (libiberty_optr, libiberty_nptr, libiberty_len): 855 Define. 856 857 2001-09-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 858 859 * asprintf.c: Don't define USE_STDARG. Use VPARAMS, VA_OPEN, 860 VA_FIXEDARG & VA_CLOSE. 861 862 * vasprintf.c: Check HAVE_STRING_H when including string.h. 863 (checkit): Delete redundant prototype. Add ATTRIBUTE_PRINTF_1. 864 Use VA_OPEN, VA_FIXEDARG & VA_CLOSE. Free allocated string. 865 866 2001-08-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 867 868 * concat.c (concat): Use VPARAMS, VA_OPEN, VA_FIXEDARG & VA_CLOSE. 869 870 2001-08-23 Ulrich Drepper <drepper@redhat.com> 871 872 * regex.c (truncate_wchar): Use wcrtomb not wctomb. 873 874 2001-08-23 Ulrich Drepper <drepper@redhat.com> 875 876 * posix/regex.c [_LIBC] (convert_mbs_to_wcs): Use __mbrtowc 877 instead of mbrtowc. 878 [_LIBC]: Use __iswctype instead of iswctype, __wcslen instead of 879 wcslen, and __wcscoll instead of wcscoll. 880 881 2001-08-22 Matt Kraai <kraai@alumni.carnegiemellon.edu> 882 883 * fibheap.c (fibheap_init, fibnode_init): Remove. 884 (fibheap_new, fibnode_new): Use xcalloc to allocate and 885 initialize memory. 886 (fibheap_insert): Remove check for node allocation failure. 887 888 2001-08-21 Richard Henderson <rth@redhat.com> 889 890 * Makefile.in (fibheap.o): Depend on config.h. 891 * fibheap.c: Tidy formatting. Use config.h.` Rearrange some 892 functions for inlining. 893 894 Tue Aug 21 12:35:04 2001 Christopher Faylor <cgf@cygnus.com> 895 896 * configure.in: Need to set HAVE_SYS_ERRLIST and HAVE_SYS_NERR whenever 897 hosting on cygwin. 898 * configure: Regenerate. 899 900 2001-08-20 Andrew Cagney <ac131313@redhat.com> 901 902 * floatformat.c (floatformat_m88110_ext): Remove #ifdef 903 HARRIS_FLOAT_FORMAT. 904 (floatformat_ia64_spill_little, floatformat_ia64_quad_little) 905 (floatformat_ia64_spill_big, floatformat_ia64_quad_big) 906 (floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword) 907 (floatformat_m88110_harris_ext): New float formats. 908 909 2001-08-20 Daniel Berlin <dan@cgsoftware.com> 910 911 * fibheap.c: New file. Fibonacci heap. 912 913 * Makefile.in (CFILES): Add fibheap.c. 914 (REQUIRED_OFILES): Add fibheap.o. 915 (fibheap.o): Add dependencies for fibheap.o. 916 917 2001-08-17 Christopher Faylor <cgf@cygnus.com> 918 919 * configure.in: Always set HAVE_SYS_ERRLIST when targetting cygwin. 920 * configure: Regenerate. 921 922 2001-08-16 Richard Henderson <rth@redhat.com> 923 924 * hashtab.c (htab_hash_string): New. 925 926 2001-08-13 Andrew Cagney <ac131313@redhat.com> 927 928 * floatformat.c (floatformat_ieee_double_littlebyte_bigword): Fix 929 name. 930 931 2001-08-12 Isamu Hasegawa <isamu@yamato.ibm.com> 932 933 * regex.c (wcs_regex_compile): Use appropriate string 934 to compare with collating element. 935 Fix the padding for the alignment. 936 937 2001-08-10 Andrew Cagney <ac131313@redhat.com> 938 939 * lbasename.c (lbasename): Change function definition to return a 940 const char pointer. 941 942 2001-08-07 Jason Merrill <jason_merrill@redhat.com> 943 944 * cp-demangle.c (demangle_special_name): "GR" -> "reference temporary 945 for". 946 947 2001-08-03 Richard Henderson <rth@redhat.com> 948 949 * Makefile.in (concat.o): Depend on config.h. 950 951 2001-07-30 Andreas Jaeger <aj@suse.de> 952 953 * concat.c: Include "config.h". 954 955 2001-07-30 Andreas Jaeger <aj@suse.de> 956 957 * regex.c: Declare wcs functions only if compiling with 958 MBS_SUPPORT. 959 Don't use #elif for traditional C. 960 961 2001-07-23 Ulrich Drepper <drepper@redhat.com> 962 963 * regex.c: Revamp memory allocation for WCHAR functions to 964 not use too much stack. 965 966 2001-07-30 Andreas Jaeger <aj@suse.de> 967 968 * regex.c: Declare wcs functions only if compiling with 969 MBS_SUPPORT. 970 Don't use #elif for traditional C. 971 972 2001-07-25 Daniel Jacobowitz <drow@mvista.com> 973 974 * Makefile.in (regex.o): Add dependency on config.h. 975 976 2001-07-18 Andreas Schwab <schwab@suse.de> 977 978 * regex.c (WORDCHAR_P) [WCHAR]: Also return true for the 979 underscore character. 980 981 2001-07-18 Ulrich Drepper <drepper@redhat.com> 982 983 * regex.c: Limit string length printed in debug messages to 100 984 chars. 985 986 2001-07-18 Andreas Jaeger <aj@suse.de> 987 988 * regex.c: Place under LGPL version 2.1. 989 990 2001-07-10 Jeff Johnston <jjohnstn@redhat.com> 991 992 * Makefile.in: Add support for regex code. 993 * regex.c: New file. 994 995 2001-07-05 Mark Klein <mklein@dis.com> 996 997 * Makefile.in: Add ffs.c dependency. 998 * configure.in: Add ffs.c. 999 * ffs.c: New file. 1000 1001 2001-06-18 Richard Henderson <rth@redhat.com> 1002 1003 * concat.c: Include <sys/types.h>. 1004 1005 2001-06-11 Loren J. Rittle <ljrittle@acm.org> 1006 1007 bootstrap/3106 1008 * strerror.c (sys_nerr): Hide the OS header version. 1009 * strsignal.c (sys_nsig): Likewise. 1010 1011 2001-06-10 Richard Henderson <rth@redhat.com> 1012 1013 * concat.c: Include string.h. Fix int vs size_t usage. 1014 Simplify the iteration loops. Use memcpy. 1015 1016 2001-05-16 Matt Kraai <kraai@alumni.carnegiemellon.edu> 1017 1018 * partition.c: Fix misspelling of `implementation'. 1019 1020 2001-05-09 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> 1021 1022 * md5.c (md5_init_ctx): Declare constants as unsigned. 1023 (md5_process_block): Likewise. 1024 1025 2001-05-07 Zack Weinberg <zackw@stanford.edu> 1026 1027 * cp-demangle.c (demangle_v3_with_details, 1028 is_gnu_v3_mangled_ctor, is_gnu_v3_mangled_dtor): Use K+R style 1029 function definition. 1030 * ternary.c: Use K+R style function definitions. Use PTR, not 1031 void *. Make arguments constant where possible. 1032 1033 2001-05-07 Mark Mitchell <mark@codesourcery.com> 1034 1035 * splay-tree.h (splay_tree_max): New function. 1036 (splay_tree_min): Likewise. 1037 1038 2001-04-15 Daniel Berlin <dan@cgsoftware.com> 1039 1040 * ternary.c: New file - Ternary search tree implementation. 1041 1042 * Makefile.in: Add ternary.o, and ternary.c dependencies. 1043 1044 2001-04-03 Zack Weinberg <zackw@stanford.edu> 1045 1046 * make-temp-file.c (try): Inline. 1047 1048 2001-02-28 Richard Henderson <rth@redhat.com> 1049 1050 * Makefile.in (make-temp-file.o): Depend on config.h. 1051 1052 2001-03-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 1053 1054 * memchr.c (memchr): Adjust condition to avoid infinite loop. 1055 1056 2001-03-23 Jakub Jelinek <jakub@redhat.com> 1057 1058 * cp-demangle.c (demangle_discriminator): `_0' is discriminator #1, 1059 `_' not followed by a digit is invalid. 1060 1061 2001-03-22 Jim Blandy <jimb@redhat.com> 1062 1063 * cp-demangle.c (string_list_delete): Use dyn_string_delete 1064 instead of free, to free the contents as well as the string 1065 structure. 1066 1067 2001-03-21 Zack Weinberg <zackw@stanford.edu> 1068 1069 * make-temp-file.c: Always default DIR_SEPARATOR to '/'. 1070 Don't default P_tmpdir to anything. Try /var/tmp before 1071 /usr/tmp. 1072 1073 2001-03-20 Zack Weinberg <zackw@stanford.edu> 1074 1075 * choose-temp.c: Split off make_temp_file, and the code 1076 duplicated between it and choose_temp_base, into... 1077 * make-temp-file.c: ... here; new file. 1078 1079 * Makefile.in (CFILES): Add make-temp-file.c. 1080 (REQUIRED_OFILES): Add make-temp-file.o. 1081 1082 2001-03-20 Jim Blandy <jimb@redhat.com> 1083 1084 * cp-demangle.c (struct demangling_def): New fields: 1085 is_constructor and is_destructor. 1086 (demangling_new): Initialize them. 1087 (demangle_ctor_dtor_name): Set them, if we detect a constructor 1088 or destructor. 1089 (demangle_v3_with_details, is_gnu_v3_mangled_ctor, 1090 is_gnu_v3_mangled_dtor): New functions. 1091 1092 2001-03-20 Jason Merrill <jason@redhat.com> 1093 1094 * cplus-dem.c (main): Skip initial $. 1095 1096 2001-03-15 Michael Meissner <meissner@redhat.com> 1097 1098 * hashtab.c (higher_prime_number): Silence warning that 4294967291 1099 might be a signed integer under pre-ISO C systems. 1100 1101 2001-03-10 Neil Booth <neil@daikokuya.demon.co.uk> 1102 John David Anglin <dave@hiauly1.hia.nrc.ca> 1103 1104 * libiberty/lbasename.c: New file. 1105 * libiberty/Makefile.in: Update for lbasename. 1106 1107 2001-03-06 Zack Weinberg <zackw@stanford.edu> 1108 1109 * aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New. 1110 * configure.in: Replace all alloca logic with a simple use of 1111 the above new macro. 1112 * config.table: Kill *-*-beos* entry. 1113 * config/mh-beos: Delete. 1114 * configure, config.in: Regenerate. 1115 1116 * Makefile.in (ALLOCA, HFILES): Kill. 1117 (REQUIRED_OFILES): Add alloca.o. 1118 (alloca.o): Depend on libiberty.h. 1119 (argv.o): Don't depend on alloca-conf.h. 1120 * alloca-conf.h: Delete. 1121 * alloca.c: Include libiberty.h. Kill all #ifdef emacs 1122 blocks. Provide the C alloca unconditionally. Use PTR where 1123 appropriate. Make i00afunc static. 1124 * argv.c: Don't include alloca-conf.h. 1125 1126 2001-03-04 John David Anglin <dave@hiauly1.hia.nrc.ca> 1127 1128 * cplus-dem.c (main): Cast enum style to int. 1129 1130 2001-02-16 Loren J. Rittle <ljrittle@acm.org> 1131 1132 * cplus-dem.c (main): Initialize style. 1133 1134 2001-02-02 Phil Edwards <pme@sources.redhat.com> 1135 1136 * COPYING.LIB: Update to LGPL 2.1 from the FSF. 1137 1138 2001-01-31 Bryce McKinlay <bryce@albatross.co.nz> 1139 1140 Add support for Java demangling under the v3 ABI: 1141 * cp-demangle.c (NAMESPACE_SEPARATOR): New define. 1142 (struct demangling_def): Add `style' field. 1143 (demangling_new): New parameter `style'. Set it in demangling_t. 1144 (demangle_prefix): Use NAMESPACE_SEPARATOR. 1145 (demangle_type_ptr): Don't emit pointer symbol if doing Java output. 1146 (cp_demangle): New parameter `style'. Pass it to demangling_new(). 1147 (main): Call cp_demangle with extra parameter. 1148 (java_demangle_v3): New function. 1149 (java_builtin_type_names): New. Table of primitive type names used 1150 for Java demangling. 1151 (demangle_builtin_type): Look up in java_builtin_type_names if doing 1152 Java output. 1153 * cplus-dem.c (cplus_demangle): Use java_demangle_v3 to do Java 1154 demangling. 1155 (long_options): Remove obsolete `java' option. 1156 (main): Remove explicit handling of `java' option. Instead, pass style 1157 parameter in cplus_demangle flags as gdb does. 1158 * testsuite/demangle.expected: Add some Java test cases. 1159 1 1160 2000-12-29 DJ Delorie <dj@redhat.com> 2 1161 … … 7 1166 * md5.c: Ditto. 8 1167 * obstack.c: Ditto. 9 1168 10 1169 2000-12-26 Michael Sokolov <msokolov@ivan.Harhan.ORG> 11 1170 … … 112 1271 113 1272 * hashtab.c (htab_expand): Change to return int. Use calloc or 114 115 1273 xcalloc depending on htab->return_allocation_failure. Return zero 1274 if calloc fails. 116 1275 (htab_create): Update comment to cover memory allocation. 117 1276 (htab_try_create): New. 118 1277 (htab_find_slot_with_hash): Return NULL if htab_expand fails. 119 1278 Update comment to cover this. 120 1279 121 1280 2000-11-03 Hans-Peter Nilsson <hp@bitrange.com> … … 620 1779 621 1780 * Makefile.in (xmalloc.o): Add dependency for config.h, fixes make 622 1781 -j3. 623 1782 624 1783 2000-05-18 J. David Anglin <dave@hiauly1.hia.nrc.ca> … … 1253 2412 1254 2413 * cplus-dem.c (demangle_arm_pt): Remove unused prototype. 1255 1256 1257 2414 (snarf_numeric_literal): Constify first parameter. 2415 (code_for_qualifier): Avoid a gcc extension, make the parameter an 2416 int, not a char. 1258 2417 (demangle_qualifier): Likewise. 1259 2418 (demangle_signature): Cast the argument of a ctype function to … … 1268 2427 1269 2428 * floatformat.c (floatformat_to_double): Add explicit braces to 1270 2429 avoid ambiguous `else'. 1271 2430 1272 2431 * fnmatch.c (fnmatch): Change type of variables `c', `c1', 1273 1274 2432 `cstart' and `cend' to unsigned char. Cast the argument of macro 2433 `FOLD', which uses ctype functions, to unsigned char. 1275 2434 1276 2435 * objalloc.c (free): Add prototype. … … 1283 2442 1284 2443 * cplus-dem.c (demangle_arm_pt): remove declaration -- function 1285 2444 doesn't exist. 1286 2445 (do_hpacc_template_literal): remove unused variable `i'. 1287 2446 … … 1327 2486 * cplus-dem.c 1328 2487 (main): Remove default to HP style demangling, set to EDG 1329 1330 1331 1332 1333 1334 2488 demangling correctly when -edg specified; set the demangling style 2489 when user specifies 'edg'. Set strip_underscore to 2490 prepends_underscore, if not HPUXHPPA. Set 2491 current_demangling_style to hp_demangling if HPUXHPPA. Set 2492 current demangling style correctly if the switch is hp. Read 2493 label correctly also in the HP style case. 1335 2494 (work_stuff): add temp_start field; add field for volatile member 1336 2495 function. 1337 2496 (arm_pt): handle ARM_DEMANGLING and EDG_DEMANGLING styles; HP 1338 2497 style for this case is the same as ARM. 1339 2498 (demangle_args): handle EDG_DEMANGLING style; support HP style. 1340 2499 (demangle_arm_hp_template): new function. (It was 1341 1342 1343 2500 demangle_arm_pt.); check and set value of temp_start field in 2501 multiple places. Also, when ceching for end of template args, 2502 check to see if at end of static member of template class. 1344 2503 (demangle_class): new local variable : save_class_name_end Don't 1345 2504 include template args in string defining class. 1346 2505 (demangle_class_name): use demangel_arm_hp_template. 1347 2506 (demangle_function_name): handle case where demangling style is 1348 1349 1350 2507 HP_DEMANGLING and currently point at an 'X' in the mangled name. 2508 Handle EDG_DEMANGLING style. Handle constructor and destructor 2509 ops for HP style. 1351 2510 (demangle_prefix): handle EDG_DEMANGLING and ARM_DEMANGLING 1352 1353 2511 styles. global destructor and constructor for HP style are same 2512 as for ARM style. Same for local variables. 1354 2513 (demangle_qualified): handle EDG_DEMANGLING style. 1355 2514 (demangle_signature): add case for volatile member function. For 1356 1357 1358 1359 1360 1361 1362 2515 cases '1' - '9' : initialize the temp_start field to -1 and handle 2516 the EDG_DEMANGLING style. for case 'F' : handle EDG_DEMANGLING 2517 and AUTO_DEMANGLING styles. If expecting a function and managed 2518 to demangle the funct args, then handle the LUCID_DEMANGLING, 2519 ARM_DEMANGLING, and EDG_DEMANGLING styles. Add case for local 2520 class name after "Lnnn_ in HP style case. HP style too needs to 2521 forget types. _nnn is OK for HP style, so don't report failure. 1363 2522 (do_hpacc_template_const_value): new function. Handle template's 1364 2523 value param for HP/aCC. 1365 2524 (do_hpacc_template_literal): new function. Handle a template's 1366 2525 literal parameter for HP aCC. 1367 2526 (recursively_demangle): new function 1368 2527 (snarf_numeric_literal): new function. 1369 2528 (usage): add 'edg' to the list of demangling styles; add hp switch 1370 2529 to message. 1371 2530 1372 2531 Sat Nov 28 17:25:22 1998 Christopher Faylor <cgf@cygnus.com> … … 1450 2609 1451 2610 * pexecute.c: Check HAVE_CONFIG_H, not IN_GCC, when determining 1452 1453 1454 1455 1456 1457 1458 2611 whether to include config.h. Possibly include unistd.h in the 2612 !IN_GCC case. Define VFORK_STRING as a printable function call 2613 for error messages (either "vfork" or "fork".) If HAVE_VFORK_H is 2614 defined, include vfork.h. If VMS is defined, define vfork() 2615 appropriately. Remove vfork check on USG, we're using autoconf. 2616 (pexecute): Set `errmsg_fmt' to VFORK_STRING instead of checking 2617 locally what string to use. 1459 2618 1460 2619 1998-10-26 Mark Mitchell <mark@markmitchell.com> … … 1562 2721 1563 2722 * mkstemp.c: Include config.h even when not IN_GCC. Wrap header 1564 1565 2723 inclusions inside HAVE_*_H macros. Include ansidecl.h when not 2724 IN_GCC. 1566 2725 1567 2726 * vasprintf.c: Include stdarg.h/varargs.h first. … … 1877 3036 * config.table: Change config_shell to CONFIG_SHELL, and use 1878 3037 libiberty_topdir to find move-if-change. 1879 3038 (m68k-apollo-bsd*, m68k-apollo-sysv*): Remove. 1880 3039 (i[3456]86-ncr-sysv4*, *-*-dgux*, hppa*-hp-bsd*): Remove. 1881 3040 (*-*-irix*, *-*-m88kbcs*, *-*-sysv*): Remove. … … 2094 3253 * asprintf.c: stdarg.h when ALMOST_STDC 2095 3254 * config/mh-windows (EXTRA_OFILES): add asprintf.o and 2096 3255 strncasecmp.o. 2097 3256 2098 3257 Thu Aug 28 14:27:15 1997 Andrew Cagney <cagney@b1.cygnus.com> … … 4136 5295 Mon Jan 20 18:53:23 1992 Stu Grossman (grossman at cygnus.com) 4137 5296 4138 5297 * getopt.c, getopt1.c, ../include/getopt.h: Get latest versions. 4139 5298 4140 5299 Sat Jan 18 16:53:01 1992 Fred Fish (fnf at cygnus.com) -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/Makefile.in
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 # 2 2 # Makefile 3 # Copyright (C) 1990, 91-99, 2000 3 # Copyright (C) 1990, 91-99, 2000, 2001, 2002, 2003 4 4 # Free Software Foundation 5 5 # … … 27 27 # 28 28 29 libiberty_topdir = @libiberty_topdir@ 29 30 srcdir = @srcdir@ 30 31 VPATH = @srcdir@ … … 35 36 bindir = @bindir@ 36 37 libdir = @libdir@ 38 includedir = @includedir@ 39 target_header_dir = @target_header_dir@ 37 40 38 41 SHELL = @SHELL@ … … 49 52 INSTALL_PROGRAM = @INSTALL_PROGRAM@ 50 53 INSTALL_DATA = @INSTALL_DATA@ 54 mkinstalldirs = $(SHELL) $(libiberty_topdir)/mkinstalldirs 55 56 # Some compilers can't handle cc -c blah.c -o foo/blah.o. 57 OUTPUT_OPTION = @OUTPUT_OPTION@ 51 58 52 59 AR = @AR@ … … 57 64 LIBCFLAGS = $(CFLAGS) 58 65 RANLIB = @RANLIB@ 66 MAKEINFO = @MAKEINFO@ 67 PERL = @PERL@ 59 68 60 69 PICFLAG = … … 63 72 64 73 TARGETLIB = libiberty.a 74 TESTLIB = testlib.a 65 75 66 76 LIBOBJS = @LIBOBJS@ 67 ALLOCA = @ALLOCA@68 77 69 78 # A configuration can specify extra .o files that should be included, … … 77 86 "CC=$(CC)" \ 78 87 "CFLAGS=$(CFLAGS)" \ 88 "DESTDIR=$(DESTDIR)" \ 79 89 "LIBCFLAGS=$(LIBCFLAGS)" \ 80 90 "EXTRA_OFILES=$(EXTRA_OFILES)" \ … … 96 106 SUBDIRS = testsuite 97 107 108 # FIXME: add @BUILD_INFO@ once we're sure it works for everyone. 98 109 all: stamp-picdir $(TARGETLIB) needed-list required-list all-subdir 99 @ $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all110 @: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all 100 111 101 112 .PHONY: check installcheck … … 112 123 $(COMPILE.c) $(PICFLAG) $< -o pic/$@; \ 113 124 else true; fi 114 $(COMPILE.c) $< 115 116 info: info-subdir 125 $(COMPILE.c) $< $(OUTPUT_OPTION) 126 127 # NOTE: If you add new files to the library, add them to this list 128 # (alphabetical), and add them to REQUIRED_OFILES, or 129 # CONFIGURED_OFILES and funcs in configure.in. 130 CFILES = alloca.c argv.c asprintf.c atexit.c \ 131 basename.c bcmp.c bcopy.c bsearch.c bzero.c \ 132 calloc.c choose-temp.c clock.c concat.c cp-demangle.c \ 133 cplus-dem.c \ 134 dyn-string.c \ 135 fdmatch.c ffs.c fibheap.c floatformat.c fnmatch.c \ 136 getcwd.c getopt.c getopt1.c getpagesize.c getpwd.c getruntime.c \ 137 hashtab.c hex.c \ 138 index.c insque.c \ 139 lbasename.c \ 140 lrealpath.c \ 141 make-relative-prefix.c \ 142 make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmove.c \ 143 mempcpy.c memset.c mkstemps.c \ 144 objalloc.c obstack.c \ 145 partition.c \ 146 pex-djgpp.c pex-mpw.c pex-msdos.c pex-os2.c \ 147 pex-unix.c pex-win32.c \ 148 physmem.c putenv.c \ 149 random.c regex.c rename.c rindex.c \ 150 safe-ctype.c setenv.c sigsetmask.c snprintf.c sort.c spaces.c \ 151 splay-tree.c stpcpy.c stpncpy.c strcasecmp.c strchr.c strdup.c \ 152 strerror.c strncasecmp.c strncmp.c strrchr.c strsignal.c \ 153 strstr.c strtod.c strtol.c strtoul.c \ 154 ternary.c tmpnam.c \ 155 vasprintf.c vfork.c vfprintf.c vprintf.c vsnprintf.c vsprintf.c \ 156 waitpid.c \ 157 xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c 158 159 # These are always included in the library. The first four are listed 160 # first and by compile time to optimize parallel builds. 161 REQUIRED_OFILES = regex.o cplus-dem.o cp-demangle.o md5.o \ 162 alloca.o argv.o \ 163 choose-temp.o concat.o \ 164 dyn-string.o \ 165 fdmatch.o fibheap.o floatformat.o fnmatch.o \ 166 getopt.o getopt1.o getpwd.o getruntime.o \ 167 hashtab.o hex.o \ 168 lbasename.o \ 169 lrealpath.o \ 170 make-relative-prefix.o \ 171 make-temp-file.o \ 172 objalloc.o obstack.o \ 173 partition.o physmem.o @pexecute@ \ 174 safe-ctype.o sort.o spaces.o splay-tree.o strerror.o \ 175 strsignal.o \ 176 ternary.o \ 177 xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o 178 179 # These are all the objects that configure may add to the library via 180 # $funcs or EXTRA_OFILES. This list exists here only for "make 181 # maint-missing" and "make check". 182 CONFIGURED_OFILES = asprintf.o atexit.o \ 183 basename.o bcmp.o bcopy.o bsearch.o bzero.o \ 184 calloc.o clock.o copysign.o \ 185 _doprnt.o \ 186 ffs.o \ 187 getcwd.o getpagesize.o \ 188 index.o insque.o \ 189 memchr.o memcmp.o memcpy.o memmove.o mempcpy.o memset.o mkstemps.o \ 190 pex-djgpp.o pex-mpw.o pex-msdos.o pex-os2.o \ 191 pex-unix.o pex-win32.o \ 192 putenv.o \ 193 random.o rename.o rindex.o \ 194 setenv.o sigsetmask.o snprintf.o stpcpy.o stpncpy.o strcasecmp.o \ 195 strchr.o strdup.o strncasecmp.o strncmp.o strrchr.o strstr.o \ 196 strtod.o strtol.o strtoul.o \ 197 tmpnam.o \ 198 vasprintf.o vfork.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o \ 199 waitpid.o 200 201 # These files are installed if the library has been configured to do so. 202 INSTALLED_HEADERS = \ 203 $(INCDIR)/ansidecl.h \ 204 $(INCDIR)/demangle.h \ 205 $(INCDIR)/dyn-string.h \ 206 $(INCDIR)/fibheap.h \ 207 $(INCDIR)/floatformat.h \ 208 $(INCDIR)/hashtab.h \ 209 $(INCDIR)/libiberty.h \ 210 $(INCDIR)/objalloc.h \ 211 $(INCDIR)/partition.h \ 212 $(INCDIR)/safe-ctype.h \ 213 $(INCDIR)/sort.h \ 214 $(INCDIR)/splay-tree.h \ 215 $(INCDIR)/ternary.h 216 217 $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) 218 -rm -f $(TARGETLIB) pic/$(TARGETLIB) 219 $(AR) $(AR_FLAGS) $(TARGETLIB) \ 220 $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) 221 $(RANLIB) $(TARGETLIB) 222 if [ x"$(PICFLAG)" != x ]; then \ 223 cd pic; \ 224 $(AR) $(AR_FLAGS) $(TARGETLIB) \ 225 $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ 226 $(RANLIB) $(TARGETLIB); \ 227 cd ..; \ 228 else true; fi 229 230 $(TESTLIB): $(REQUIRED_OFILES) $(CONFIGURED_OFILES) 231 -rm -f $(TESTLIB) 232 $(AR) $(AR_FLAGS) $(TESTLIB) \ 233 $(REQUIRED_OFILES) $(CONFIGURED_OFILES) 234 $(RANLIB) $(TESTLIB) 235 236 info: libiberty.info info-subdir 117 237 install-info: install-info-subdir 118 238 clean-info: clean-info-subdir 119 dvi: dvi-subdir 120 121 # Include files that are in this directory. 122 HFILES = alloca-conf.h 123 124 # NOTE: If you add new files to the library, add them to this list 125 # (alphabetical), and add them to REQUIRED_OFILES or funcs in 126 # configure.in. 127 CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \ 128 bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c \ 129 cp-demangle.c dyn-string.c fdmatch.c fnmatch.c getcwd.c \ 130 getpwd.c getopt.c getopt1.c getpagesize.c getruntime.c \ 131 floatformat.c hashtab.c hex.c index.c insque.c md5.c memchr.c \ 132 memcmp.c memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \ 133 partition.c pexecute.c putenv.c random.c rename.c rindex.c setenv.c \ 134 sigsetmask.c safe-ctype.c sort.c spaces.c splay-tree.c strcasecmp.c \ 135 strncasecmp.c strchr.c strdup.c strerror.c strncmp.c strrchr.c \ 136 strsignal.c strstr.c strtod.c strtol.c strtoul.c tmpnam.c vasprintf.c \ 137 vfork.c vfprintf.c vprintf.c vsprintf.c waitpid.c xatexit.c xexit.c \ 138 xmalloc.c xmemdup.c xstrdup.c xstrerror.c 139 140 # These are always included in the library. 141 REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o cp-demangle.o \ 142 dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o \ 143 getruntime.o hashtab.o hex.o floatformat.o md5.o objalloc.o obstack.o \ 144 partition.o pexecute.o safe-ctype.o sort.o spaces.o splay-tree.o \ 145 strerror.o strsignal.o xatexit.o xexit.o xmalloc.o xmemdup.o \ 146 xstrdup.o xstrerror.o 147 148 $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA) 149 -rm -f $(TARGETLIB) 150 $(AR) $(AR_FLAGS) $(TARGETLIB) \ 151 $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA) 152 $(RANLIB) $(TARGETLIB) 239 dvi: libiberty.dvi dvi-subdir 240 html: libiberty.html 241 242 TEXISRC = \ 243 $(srcdir)/libiberty.texi \ 244 $(srcdir)/copying-lib.texi \ 245 $(srcdir)/obstacks.texi \ 246 $(srcdir)/functions.texi 247 248 # Additional files that have texi snippets that need to be collected 249 # and sorted. Some are here because the sources are imported from 250 # elsewhere. Others represent headers in ../include. 251 TEXIFILES = fnmatch.txh pexecute.txh 252 253 libiberty.info : $(srcdir)/libiberty.texi $(TEXISRC) 254 $(MAKEINFO) -I$(srcdir) $(srcdir)/libiberty.texi 255 256 libiberty.dvi : $(srcdir)/libiberty.texi $(TEXISRC) 257 texi2dvi $(srcdir)/libiberty.texi 258 259 libiberty.html : $(srcdir)/libiberty.texi $(TEXISRC) 260 $(MAKEINFO) --html -I$(srcdir) $(srcdir)/libiberty.texi 261 262 @MAINT@$(srcdir)/functions.texi : stamp-functions 263 @MAINT@ @true 264 265 @MAINT@stamp-functions : $(CFILES) $(TEXIFILES) $(srcdir)/gather-docs Makefile 266 @MAINT@@HAVE_PERL@ $(PERL) $(srcdir)/gather-docs $(srcdir) $(srcdir)/functions.texi $(CFILES) $(TEXIFILES) 267 @MAINT@ echo stamp > stamp-functions 153 268 154 269 INSTALL_DEST = @INSTALL_DEST@ … … 156 271 157 272 install_to_libdir: all 158 $(INSTALL_DATA) $(TARGETLIB) $(libdir)$(MULTISUBDIR)/$(TARGETLIB)n 159 ( cd $(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) 160 mv -f $(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(libdir)$(MULTISUBDIR)/$(TARGETLIB) 273 ${mkinstalldirs} $(DESTDIR)$(libdir)$(MULTISUBDIR) 274 $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n 275 ( cd $(DESTDIR)$(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) 276 mv -f $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB) 277 if test -n "${target_header_dir}"; then \ 278 case "${target_header_dir}" in \ 279 /*) thd=${target_header_dir};; \ 280 *) thd=${includedir}${MULTISUBDIR}/${target_header_dir};; \ 281 esac; \ 282 ${mkinstalldirs} $(DESTDIR)$${thd}; \ 283 for h in ${INSTALLED_HEADERS}; do \ 284 ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \ 285 done; \ 286 fi 161 287 @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install 162 288 289 # This is tricky. Even though CC in the Makefile contains 290 # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the 291 # default multilib, so we have to take LIBCFLAGS into account as well, 292 # since it will be passed the multilib flags. 293 MULTIOSDIR = `$(CC) $(LIBCFLAGS) -print-multi-os-directory` 163 294 install_to_tooldir: all 164 $(INSTALL_DATA) $(TARGETLIB) $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n 165 ( cd $(tooldir)/lib$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) 166 mv -f $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB) 295 ${mkinstalldirs} $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR) 296 $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB)n 297 ( cd $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR) ; $(RANLIB) $(TARGETLIB)n ) 298 mv -f $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB) 167 299 @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install 168 300 … … 198 330 etags tags: TAGS etags-subdir 199 331 200 TAGS: $(CFILES) $(HFILES)201 etags `for i in $( HFILES) $(CFILES); do echo $(srcdir)/$$i ; done`332 TAGS: $(CFILES) 333 etags `for i in $(CFILES); do echo $(srcdir)/$$i ; done` 202 334 203 335 # The standalone demangler (c++filt) has been moved to binutils. … … 208 340 209 341 ls: 210 @echo Makefile $(HFILES) $(CFILES) 342 @echo Makefile $(CFILES) 343 344 # Various targets for maintainers. 345 346 maint-missing : 347 @$(PERL) $(srcdir)/maint-tool -s $(srcdir) missing $(CFILES) $(REQUIRED_OFILES) $(CONFIGURED_OFILES) 348 349 maint-buildall : $(REQUIRED_OFILES) $(CONFIGURED_OFILES) 350 @true 351 352 maint-undoc : $(srcdir)/functions.texi 353 @$(PERL) $(srcdir)/maint-tool -s $(srcdir) undoc 354 355 maint-deps : 356 @$(PERL) $(srcdir)/maint-tool -s $(srcdir) deps $(INCDIR) 211 357 212 358 # Need to deal with profiled libraries, too. … … 218 364 -rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-* 219 365 -rm -f $(CONFIG_H) $(NEEDED_LIST) stamp-picdir 366 -rm -f libiberty.aux libiberty.cp libiberty.cps libiberty.fn libiberty.ky 367 -rm -f libiberty.log libiberty.tmp libiberty.tps libiberty.pg 368 -rm -f libiberty.pgs libiberty.toc libiberty.tp libiberty.tpl libiberty.vr 369 -rm -f libtexi.stamp 220 370 @$(MULTICLEAN) multi-clean DO=mostlyclean 221 371 clean: clean-subdir 222 372 $(MAKE) SUBDIRS="" mostlyclean 223 373 -rm -f *.a required-list tmpmulti.out 374 -rm -f libiberty.dvi libiberty.info* libiberty.html 224 375 @$(MULTICLEAN) multi-clean DO=clean 225 376 distclean: distclean-subdir … … 237 388 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status 238 389 390 # Depending on Makefile makes sure that config.status has been re-run 391 # if needed. This prevents problems with parallel builds. 239 392 config.h: stamp-h ; @true 240 stamp-h: config.in config.status 393 stamp-h: config.in config.status Makefile 241 394 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status 242 395 … … 244 397 $(SHELL) ./config.status --recheck 245 398 246 399 # Depending on config.h makes sure that config.status has been re-run 400 # if needed. This prevents problems with parallel builds, in case 401 # subdirectories need to run config.status also. 247 402 all-subdir check-subdir installcheck-subdir info-subdir \ 248 403 install-info-subdir clean-info-subdir dvi-subdir install-subdir \ 249 404 etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \ 250 maintainer-clean-subdir: 405 maintainer-clean-subdir: config.h 251 406 @subdirs='$(SUBDIRS)'; \ 252 407 target=`echo $@ | sed -e 's/-subdir//'`; \ 253 408 for dir in $$subdirs ; do \ 254 cd $$dir && $(MAKE) $ $target; \409 cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $$target; \ 255 410 done 256 411 257 $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA): stamp-picdir 258 259 alloca.o: config.h 412 $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS): stamp-picdir 413 $(CONFIGURED_OFILES): stamp-picdir 414 415 # The dependencies in the remainder of this file are automatically 416 # generated by "make maint-deps". Manual edits will be lost. 417 418 _doprnt.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h 419 alloca.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 420 argv.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 421 asprintf.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 260 422 atexit.o: config.h 261 argv.o: config.h alloca-conf.h $(INCDIR)/libiberty.h 262 basename.o: $(INCDIR)/libiberty.h 263 choose-temp.o: config.h 423 basename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 424 $(INCDIR)/safe-ctype.h 425 bsearch.o: config.h $(INCDIR)/ansidecl.h 426 calloc.o: $(INCDIR)/ansidecl.h 427 choose-temp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 264 428 clock.o: config.h 265 concat.o: $(INCDIR)/libiberty.h 266 cplus-dem.o: config.h $(INCDIR)/demangle.h 267 cp-demangle.o: config.h $(INCDIR)/dyn-string.h $(INCDIR)/demangle.h 268 dyn-string.o: config.h $(INCDIR)/dyn-string.h 269 fdmatch.o: $(INCDIR)/libiberty.h 270 fnmatch.o: config.h $(INCDIR)/fnmatch.h 429 concat.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 430 copysign.o: $(INCDIR)/ansidecl.h 431 cp-demangle.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \ 432 $(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h 433 cplus-dem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \ 434 $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h 435 dyn-string.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h \ 436 $(INCDIR)/libiberty.h 437 fdmatch.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 438 fibheap.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/fibheap.h \ 439 $(INCDIR)/libiberty.h 440 floatformat.o: $(INCDIR)/ansidecl.h $(INCDIR)/floatformat.h 441 fnmatch.o: config.h $(INCDIR)/fnmatch.h $(INCDIR)/safe-ctype.h 271 442 getcwd.o: config.h 272 443 getopt.o: config.h $(INCDIR)/getopt.h 273 444 getopt1.o: config.h $(INCDIR)/getopt.h 274 445 getpagesize.o: config.h 275 getpwd.o: config.h $(INCDIR)/libiberty.h 276 getruntime.o: config.h $(INCDIR)/libiberty.h 277 hex.o: $(INCDIR)/libiberty.h 278 floatformat.o: $(INCDIR)/floatformat.h 279 mkstemps.o: config.h 280 md5.o: config.h 281 objalloc.o: config.h $(INCDIR)/objalloc.h 446 getpwd.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 447 getruntime.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 448 hashtab.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \ 449 $(INCDIR)/libiberty.h 450 hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 451 lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 452 $(INCDIR)/safe-ctype.h 453 lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 454 make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h \ 455 $(INCDIR)/libiberty.h 456 make-temp-file.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 457 md5.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h 458 memchr.o: $(INCDIR)/ansidecl.h 459 memcmp.o: $(INCDIR)/ansidecl.h 460 memcpy.o: $(INCDIR)/ansidecl.h 461 memmove.o: $(INCDIR)/ansidecl.h 462 mempcpy.o: $(INCDIR)/ansidecl.h 463 memset.o: $(INCDIR)/ansidecl.h 464 mkstemps.o: config.h $(INCDIR)/ansidecl.h 465 objalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/objalloc.h 282 466 obstack.o: config.h $(INCDIR)/obstack.h 283 partition.o: config.h $(INCDIR)/partition.h 284 pexecute.o: config.h $(INCDIR)/libiberty.h 285 rename.o: config.h 286 setenv.o: config.h 287 sort.o: config.h $(INCDIR)/sort.h $(INCDIR)/ansidecl.h 288 spaces.o: $(INCDIR)/libiberty.h 289 splay-tree.o: config.h $(INCDIR)/libiberty.h $(INCDIR)/splay-tree.h $(INCDIR)/ansidecl.h 290 strerror.o: config.h $(INCDIR)/libiberty.h 291 strsignal.o: config.h $(INCDIR)/libiberty.h 292 strtol.o: config.h 293 strtoul.o: config.h 294 vasprintf.o: config.h 295 xatexit.o: $(INCDIR)/libiberty.h 296 xexit.o: config.h $(INCDIR)/libiberty.h 297 xmalloc.o: config.h $(INCDIR)/libiberty.h 298 xmemdup.o: config.h $(INCDIR)/libiberty.h 299 xstrdup.o: config.h $(INCDIR)/libiberty.h 300 xstrerror.o: config.h $(INCDIR)/libiberty.h 467 partition.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 468 $(INCDIR)/partition.h 469 pex-djgpp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 470 $(srcdir)/pex-common.h 471 pex-mpw.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 472 $(srcdir)/pex-common.h 473 pex-msdos.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 474 $(srcdir)/pex-common.h $(INCDIR)/safe-ctype.h 475 pex-os2.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 476 $(srcdir)/pex-common.h 477 pex-unix.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 478 $(srcdir)/pex-common.h 479 pex-win32.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 480 $(srcdir)/pex-common.h 481 physmem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 482 putenv.o: config.h $(INCDIR)/ansidecl.h 483 random.o: $(INCDIR)/ansidecl.h 484 regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h 485 rename.o: config.h $(INCDIR)/ansidecl.h 486 safe-ctype.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h 487 setenv.o: config.h $(INCDIR)/ansidecl.h 488 sigsetmask.o: $(INCDIR)/ansidecl.h 489 snprintf.o: $(INCDIR)/ansidecl.h 490 sort.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 491 $(INCDIR)/sort.h 492 spaces.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 493 splay-tree.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 494 $(INCDIR)/splay-tree.h 495 stpcpy.o: $(INCDIR)/ansidecl.h 496 stpncpy.o: $(INCDIR)/ansidecl.h 497 strcasecmp.o: $(INCDIR)/ansidecl.h 498 strchr.o: $(INCDIR)/ansidecl.h 499 strdup.o: $(INCDIR)/ansidecl.h 500 strerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 501 strncasecmp.o: $(INCDIR)/ansidecl.h 502 strncmp.o: $(INCDIR)/ansidecl.h 503 strrchr.o: $(INCDIR)/ansidecl.h 504 strsignal.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 505 strtod.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h 506 strtol.o: config.h $(INCDIR)/safe-ctype.h 507 strtoul.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h 508 ternary.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ 509 $(INCDIR)/ternary.h 510 vasprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 511 vfork.o: $(INCDIR)/ansidecl.h 512 vfprintf.o: $(INCDIR)/ansidecl.h 513 vprintf.o: $(INCDIR)/ansidecl.h 514 vsnprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 515 vsprintf.o: $(INCDIR)/ansidecl.h 301 516 waitpid.o: config.h 302 hashtab.o: config.h $(INCDIR)/libiberty.h $(INCDIR)/hashtab.h $(INCDIR)/ansidecl.h 517 xatexit.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 518 xexit.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 519 xmalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 520 xmemdup.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 521 xstrdup.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h 522 xstrerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/README
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 16 16 instructions in ../README. 17 17 18 Please report bugs and fixes to "bug-gnu-utils@prep.ai.mit.edu". Thank you. 18 Please report bugs to "gcc-bugs@gcc.gnu.org" and send fixes to 19 "gcc-patches@gcc.gnu.org". Thank you. 19 20 20 21 ADDING A NEW FILE -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/aclocal.m4
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 48 48 p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE, 49 49 MAP_ANON|MAP_PRIVATE, dev_zero, 0); 50 if (p == (char *)-1) 51 p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE, 52 MAP_ANON|MAP_PRIVATE, -1, 0); 50 53 if (p == (char *)-1) 51 54 exit (2); … … 84 87 fi 85 88 ]) 89 90 dnl See whether we need a declaration for a function. 91 AC_DEFUN(libiberty_NEED_DECLARATION, 92 [AC_MSG_CHECKING([whether $1 must be declared]) 93 AC_CACHE_VAL(libiberty_cv_decl_needed_$1, 94 [AC_TRY_COMPILE([ 95 #include "confdefs.h" 96 #include <stdio.h> 97 #ifdef HAVE_STRING_H 98 #include <string.h> 99 #else 100 #ifdef HAVE_STRINGS_H 101 #include <strings.h> 102 #endif 103 #endif 104 #ifdef HAVE_STDLIB_H 105 #include <stdlib.h> 106 #endif 107 #ifdef HAVE_UNISTD_H 108 #include <unistd.h> 109 #endif], 110 [char *(*pfn) = (char *(*)) $1], 111 libiberty_cv_decl_needed_$1=no, libiberty_cv_decl_needed_$1=yes)]) 112 AC_MSG_RESULT($libiberty_cv_decl_needed_$1) 113 if test $libiberty_cv_decl_needed_$1 = yes; then 114 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1, 115 [Define if $1 is not declared in system header files.]) 116 fi 117 ])dnl 86 118 87 119 # FIXME: We temporarily define our own version of AC_PROG_CC. This is … … 135 167 EOF 136 168 ]) 169 170 # We always want a C version of alloca() compiled into libiberty, 171 # because native-compiler support for the real alloca is so !@#$% 172 # unreliable that GCC has decided to use it only when being compiled 173 # by GCC. This is the part of AC_FUNC_ALLOCA that calculates the 174 # information alloca.c needs. 175 AC_DEFUN(libiberty_AC_FUNC_C_ALLOCA, 176 [AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray, 177 [AC_EGREP_CPP(webecray, 178 [#if defined(CRAY) && ! defined(CRAY2) 179 webecray 180 #else 181 wenotbecray 182 #endif 183 ], ac_cv_os_cray=yes, ac_cv_os_cray=no)]) 184 if test $ac_cv_os_cray = yes; then 185 for ac_func in _getb67 GETB67 getb67; do 186 AC_CHECK_FUNC($ac_func, 187 [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func, 188 [Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP 189 systems. This function is required for alloca.c support on those 190 systems.]) break]) 191 done 192 fi 193 194 AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, 195 [AC_TRY_RUN([find_stack_direction () 196 { 197 static char *addr = 0; 198 auto char dummy; 199 if (addr == 0) 200 { 201 addr = &dummy; 202 return find_stack_direction (); 203 } 204 else 205 return (&dummy > addr) ? 1 : -1; 206 } 207 main () 208 { 209 exit (find_stack_direction() < 0); 210 }], 211 ac_cv_c_stack_direction=1, 212 ac_cv_c_stack_direction=-1, 213 ac_cv_c_stack_direction=0)]) 214 AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction, 215 [Define if you know the direction of stack growth for your system; 216 otherwise it will be automatically deduced at run-time. 217 STACK_DIRECTION > 0 => grows toward higher addresses 218 STACK_DIRECTION < 0 => grows toward lower addresses 219 STACK_DIRECTION = 0 => direction of growth unknown]) 220 ]) -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/alloca.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 22 22 your main control loop, etc. to force garbage collection. */ 23 23 24 /* 25 26 @deftypefn Replacement void* alloca (size_t @var{size}) 27 28 This function allocates memory which will be automatically reclaimed 29 after the procedure exits. The @libib{} implementation does not free 30 the memory immediately but will do so eventually during subsequent 31 calls to this function. Memory is allocated using @code{xmalloc} under 32 normal circumstances. 33 34 The header file @file{alloca-conf.h} can be used in conjunction with the 35 GNU Autoconf test @code{AC_FUNC_ALLOCA} to test for and properly make 36 available this function. The @code{AC_FUNC_ALLOCA} test requires that 37 client code use a block of preprocessor code to be safe (see the Autoconf 38 manual for more); this header incorporates that logic and more, including 39 the possibility of a GCC built-in function. 40 41 @end deftypefn 42 43 */ 44 24 45 #ifdef HAVE_CONFIG_H 25 46 #include <config.h> 26 47 #endif 27 48 49 #include <libiberty.h> 50 28 51 #ifdef HAVE_STRING_H 29 52 #include <string.h> … … 33 56 #endif 34 57 35 #ifdef emacs 36 #include "blockinput.h" 37 #endif 38 39 /* If compiling with GCC 2, this file's not needed. Except of course if 40 the C alloca is explicitly requested. */ 41 #if defined (USE_C_ALLOCA) || !defined (__GNUC__) || __GNUC__ < 2 42 43 /* If someone has defined alloca as a macro, 44 there must be some other way alloca is supposed to work. */ 45 #ifndef alloca 46 47 #ifdef emacs 48 #ifdef static 49 /* actually, only want this if static is defined as "" 50 -- this is for usg, in which emacs must undefine static 51 in order to make unexec workable 52 */ 53 #ifndef STACK_DIRECTION 54 you 55 lose 56 -- must know STACK_DIRECTION at compile-time 57 #endif /* STACK_DIRECTION undefined */ 58 #endif /* static */ 59 #endif /* emacs */ 58 /* These variables are used by the ASTRDUP implementation that relies 59 on C_alloca. */ 60 const char *libiberty_optr; 61 char *libiberty_nptr; 62 unsigned long libiberty_len; 60 63 61 64 /* If your stack is a linked list of frames, you have to … … 63 66 64 67 #if defined (CRAY) && defined (CRAY_STACKSEG_END) 65 long i00afunc ();68 static long i00afunc (); 66 69 #define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) 67 70 #else … … 69 72 #endif 70 73 71 #if __STDC__72 typedef void *pointer;73 #else74 typedef char *pointer;75 #endif76 77 74 #ifndef NULL 78 75 #define NULL 0 79 76 #endif 80 81 /* Different portions of Emacs need to call different versions of82 malloc. The Emacs executable needs alloca to call xmalloc, because83 ordinary malloc isn't protected from input signals. On the other84 hand, the utilities in lib-src need alloca to call malloc; some of85 them are very simple, and don't have an xmalloc routine.86 87 Non-Emacs programs expect this to call use xmalloc.88 89 Callers below should use malloc. */90 91 #ifndef emacs92 #define malloc xmalloc93 #endif94 extern pointer malloc ();95 77 96 78 /* Define STACK_DIRECTION if you know the direction of stack … … 169 151 implementations of C, for example under Gould's UTX/32. */ 170 152 171 pointer 172 alloca (size) 173 unsigned size; 153 /* @undocumented C_alloca */ 154 155 PTR 156 C_alloca (size) 157 size_t size; 174 158 { 175 159 auto char probe; /* Probes stack depth: */ … … 186 170 { 187 171 register header *hp; /* Traverses linked list. */ 188 189 #ifdef emacs190 BLOCK_INPUT;191 #endif192 172 193 173 for (hp = last_alloca_header; hp != NULL;) … … 197 177 register header *np = hp->h.next; 198 178 199 free (( pointer) hp); /* Collect garbage. */179 free ((PTR) hp); /* Collect garbage. */ 200 180 201 181 hp = np; /* -> next header. */ … … 205 185 206 186 last_alloca_header = hp; /* -> last valid storage. */ 207 208 #ifdef emacs209 UNBLOCK_INPUT;210 #endif211 187 } 212 188 … … 217 193 218 194 { 219 register pointer new =malloc (sizeof (header) + size);195 register PTR new = xmalloc (sizeof (header) + size); 220 196 /* Address of header. */ 221 197 … … 230 206 /* User storage begins just after header. */ 231 207 232 return ( pointer) ((char *) new + sizeof (header));208 return (PTR) ((char *) new + sizeof (header)); 233 209 } 234 210 } … … 501 477 #endif /* not CRAY2 */ 502 478 #endif /* CRAY */ 503 504 #endif /* no alloca */505 #endif /* not GCC version 2 */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/argv.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Create and destroy argument vectors (argv's) 2 Copyright (C) 1992 Free Software Foundation, Inc.2 Copyright (C) 1992, 2001 Free Software Foundation, Inc. 3 3 Written by Fred Fish @ Cygnus Support 4 4 … … 30 30 /* Routines imported from standard C runtime libraries. */ 31 31 32 #ifdef __STDC__32 #ifdef ANSI_PROTOTYPES 33 33 34 34 #include <stddef.h> … … 36 36 #include <stdlib.h> 37 37 38 #else /* ! __STDC__*/38 #else /* !ANSI_PROTOTYPES */ 39 39 40 40 #if !defined _WIN32 || defined __GNUC__ … … 47 47 #endif 48 48 49 #endif /* __STDC__ */ 50 51 #include "alloca-conf.h" 49 #endif /* ANSI_PROTOTYPES */ 50 52 51 53 52 #ifndef NULL … … 64 63 /* 65 64 66 NAME 67 68 dupargv -- duplicate an argument vector 69 70 SYNOPSIS 71 72 char **dupargv (vector) 73 char **vector; 74 75 DESCRIPTION 76 77 Duplicate an argument vector. Simply scans through the 78 vector, duplicating each argument until the 79 terminating NULL is found. 80 81 RETURNS 82 83 Returns a pointer to the argument vector if 84 successful. Returns NULL if there is insufficient memory to 85 complete building the argument vector. 65 @deftypefn Extension char** dupargv (char **@var{vector}) 66 67 Duplicate an argument vector. Simply scans through @var{vector}, 68 duplicating each argument until the terminating @code{NULL} is found. 69 Returns a pointer to the argument vector if successful. Returns 70 @code{NULL} if there is insufficient memory to complete building the 71 argument vector. 72 73 @end deftypefn 86 74 87 75 */ … … 121 109 /* 122 110 123 NAME 124 125 freeargv -- free an argument vector 126 127 SYNOPSIS 128 129 void freeargv (vector) 130 char **vector; 131 132 DESCRIPTION 133 134 Free an argument vector that was built using buildargv. Simply scans 135 through the vector, freeing the memory for each argument until the 136 terminating NULL is found, and then frees the vector itself. 137 138 RETURNS 139 140 No value. 111 @deftypefn Extension void freeargv (char **@var{vector}) 112 113 Free an argument vector that was built using @code{buildargv}. Simply 114 scans through @var{vector}, freeing the memory for each argument until 115 the terminating @code{NULL} is found, and then frees @var{vector} 116 itself. 117 118 @end deftypefn 141 119 142 120 */ … … 159 137 /* 160 138 161 NAME 162 163 buildargv -- build an argument vector from a string 164 165 SYNOPSIS 166 167 char **buildargv (sp) 168 char *sp; 169 170 DESCRIPTION 171 172 Given a pointer to a string, parse the string extracting fields 173 separated by whitespace and optionally enclosed within either single 174 or double quotes (which are stripped off), and build a vector of 175 pointers to copies of the string for each field. The input string 176 remains unchanged. 177 178 All of the memory for the pointer array and copies of the string 179 is obtained from malloc. All of the memory can be returned to the 180 system with the single function call freeargv, which takes the 181 returned result of buildargv, as it's argument. 182 183 The memory for the argv array is dynamically expanded as necessary. 184 185 RETURNS 186 187 Returns a pointer to the argument vector if successful. Returns NULL 188 if the input string pointer is NULL or if there is insufficient 189 memory to complete building the argument vector. 190 191 NOTES 192 193 In order to provide a working buffer for extracting arguments into, 194 with appropriate stripping of quotes and translation of backslash 195 sequences, we allocate a working buffer at least as long as the input 196 string. This ensures that we always have enough space in which to 197 work, since the extracted arg is never larger than the input string. 198 199 If the input is a null string (as opposed to a NULL pointer), then 200 buildarg returns an argv that has one arg, a null string. 201 202 Argv is always kept terminated with a NULL arg pointer, so it can 203 be passed to freeargv at any time, or returned, as appropriate. 139 @deftypefn Extension char** buildargv (char *@var{sp}) 140 141 Given a pointer to a string, parse the string extracting fields 142 separated by whitespace and optionally enclosed within either single 143 or double quotes (which are stripped off), and build a vector of 144 pointers to copies of the string for each field. The input string 145 remains unchanged. The last element of the vector is followed by a 146 @code{NULL} element. 147 148 All of the memory for the pointer array and copies of the string 149 is obtained from @code{malloc}. All of the memory can be returned to the 150 system with the single function call @code{freeargv}, which takes the 151 returned result of @code{buildargv}, as it's argument. 152 153 Returns a pointer to the argument vector if successful. Returns 154 @code{NULL} if @var{sp} is @code{NULL} or if there is insufficient 155 memory to complete building the argument vector. 156 157 If the input is a null string (as opposed to a @code{NULL} pointer), 158 then buildarg returns an argument vector that has one arg, a null 159 string. 160 161 @end deftypefn 162 163 The memory for the argv array is dynamically expanded as necessary. 164 165 In order to provide a working buffer for extracting arguments into, 166 with appropriate stripping of quotes and translation of backslash 167 sequences, we allocate a working buffer at least as long as the input 168 string. This ensures that we always have enough space in which to 169 work, since the extracted arg is never larger than the input string. 170 171 The argument vector is always kept terminated with a @code{NULL} arg 172 pointer, so it can be passed to @code{freeargv} at any time, or 173 returned, as appropriate. 174 204 175 */ 205 176 206 177 char **buildargv (input) 207 char *input;178 const char *input; 208 179 { 209 180 char *arg; … … 338 309 /* Simple little test driver. */ 339 310 340 static c har *tests[] =311 static const char *const tests[] = 341 312 { 342 313 "a simple command line", … … 355 326 }; 356 327 357 main ()328 int main () 358 329 { 359 330 char **argv; 360 c har **test;331 const char *const *test; 361 332 char **targs; 362 333 … … 379 350 } 380 351 352 return 0; 381 353 } 382 354 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/asprintf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 23 23 #include "libiberty.h" 24 24 25 #if defined (ANSI_PROTOTYPES) || defined (ALMOST_STDC) 26 #define USE_STDARG 27 #endif 28 29 #ifdef USE_STDARG 25 #ifdef ANSI_PROTOTYPES 30 26 #include <stdarg.h> 31 27 #else … … 33 29 #endif 34 30 35 /* VARARGS */ 36 #ifdef USE_STDARG 31 /* 32 33 @deftypefn Extension int asprintf (char **@var{resptr}, const char *@var{format}, ...) 34 35 Like @code{sprintf}, but instead of passing a pointer to a buffer, you 36 pass a pointer to a pointer. This function will compute the size of 37 the buffer needed, allocate memory with @code{malloc}, and store a 38 pointer to the allocated memory in @code{*@var{resptr}}. The value 39 returned is the same as @code{sprintf} would return. If memory could 40 not be allocated, zero is returned and @code{NULL} is stored in 41 @code{*@var{resptr}}. 42 43 @end deftypefn 44 45 */ 46 37 47 int 38 asprintf (char **buf, const char *fmt, ...) 39 #else 40 int 41 asprintf (buf, fmt, va_alist) 42 char **buf; 43 const char *fmt; 44 va_dcl 45 #endif 48 asprintf VPARAMS ((char **buf, const char *fmt, ...)) 46 49 { 47 50 int status; 48 va_list ap; 49 #ifdef USE_STDARG 50 va_start (ap, fmt); 51 #else 52 va_start (ap); 53 #endif 51 VA_OPEN (ap, fmt); 52 VA_FIXEDARG (ap, char **, buf); 53 VA_FIXEDARG (ap, const char *, fmt); 54 54 status = vasprintf (buf, fmt, ap); 55 va_end(ap);55 VA_CLOSE (ap); 56 56 return status; 57 57 } -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/atexit.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */ 2 2 /* This function is in the public domain. --Mike Stump. */ 3 4 /* 5 6 @deftypefn Supplemental int atexit (void (*@var{f})()) 7 8 Causes function @var{f} to be called at exit. Returns 0. 9 10 @end deftypefn 11 12 */ 3 13 4 14 #include "config.h" -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/basename.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 3 3 4 4 /* 5 NAME6 basename -- return pointer to last component of a pathname7 5 8 SYNOPSIS 9 char *basename (const char *name) 6 @deftypefn Supplemental char* basename (const char *@var{name}) 10 7 11 DESCRIPTION 12 Given a pointer to a string containing a typical pathname 13 (/usr/src/cmd/ls/ls.c for example), returns a pointer to the 14 last component of the pathname ("ls.c" in this case). 8 Returns a pointer to the last component of pathname @var{name}. 9 Behavior is undefined if the pathname ends in a directory separator. 15 10 16 BUGS 17 Presumes a UNIX or DOS/Windows style path with UNIX or DOS/Windows 18 style separators. 11 @end deftypefn 12 19 13 */ 20 14 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/bcmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 4 4 /* 5 5 6 NAME 6 @deftypefn Supplemental int bcmp (char *@var{x}, char *@var{y}, int @var{count}) 7 7 8 bcmp -- compare two memory regions 8 Compares the first @var{count} bytes of two areas of memory. Returns 9 zero if they are the same, nonzero otherwise. Returns zero if 10 @var{count} is zero. A nonzero result only indicates a difference, 11 it does not indicate any sorting order (say, by having a positive 12 result mean @var{x} sorts before @var{y}). 9 13 10 SYNOPSIS 11 12 int bcmp (char *from, char *to, int count) 13 14 DESCRIPTION 15 16 Compare two memory regions and return zero if they are identical, 17 non-zero otherwise. If count is zero, return zero. 18 19 NOTES 20 21 No guarantee is made about the non-zero returned value. In 22 particular, the results may be signficantly different than 23 strcmp(), where the return value is guaranteed to be less than, 24 equal to, or greater than zero, according to lexicographical 25 sorting of the compared regions. 26 27 BUGS 14 @end deftypefn 28 15 29 16 */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/bcopy.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* bcopy -- copy memory regions of arbitary length 2 2 3 NAME 4 bcopy -- copy memory regions of arbitrary length 3 @deftypefn Supplemental void bcopy (char *@var{in}, char *@var{out}, int @var{length}) 5 4 6 SYNOPSIS 7 void bcopy (char *in, char *out, int length) 5 Copies @var{length} bytes from memory region @var{in} to region 6 @var{out}. The use of @code{bcopy} is deprecated in new programs. 8 7 9 DESCRIPTION 10 Copy LENGTH bytes from memory region pointed to by IN to memory 11 region pointed to by OUT. 12 13 BUGS 14 Significant speed improvements can be made in some cases by 15 implementing copies of multiple bytes simultaneously, or unrolling 16 the copy loop. 8 @end deftypefn 17 9 18 10 */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/bsearch.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 28 28 * SUCH DAMAGE. 29 29 */ 30 31 /* 32 33 @deftypefn Supplemental void* bsearch (const void *@var{key}, const void *@var{base}, size_t @var{nmemb}, size_t @var{size}, int (*@var{compar})(const void *, const void *)) 34 35 Performs a search over an array of @var{nmemb} elements pointed to by 36 @var{base} for a member that matches the object pointed to by @var{key}. 37 The size of each member is specified by @var{size}. The array contents 38 should be sorted in ascending order according to the @var{compar} 39 comparison function. This routine should take two arguments pointing to 40 the @var{key} and to an array member, in that order, and should return an 41 integer less than, equal to, or greater than zero if the @var{key} object 42 is respectively less than, matching, or greater than the array member. 43 44 @end deftypefn 45 46 */ 30 47 31 48 #include "config.h" -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/bzero.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 3 3 4 4 /* 5 NAME6 bzero -- zero the contents of a specified memory region7 5 8 SYNOPSIS 9 void bzero (char *to, int count) 6 @deftypefn Supplemental void bzero (char *@var{mem}, int @var{count}) 10 7 11 DESCRIPTION 12 Zero COUNT bytes of memory pointed to by TO.8 Zeros @var{count} bytes starting at @var{mem}. Use of this function 9 is deprecated in favor of @code{memset}. 13 10 14 BUGS 15 Significant speed enhancements may be made in some environments 16 by zeroing more than a single byte at a time, or by unrolling the 17 loop. 11 @end deftypefn 18 12 19 13 */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/calloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* calloc -- allocate memory which has been initialized to zero. 2 2 This function is in the public domain. */ 3 4 /* 5 6 @deftypefn Supplemental void* calloc (size_t @var{nelem}, size_t @var{elsize}) 7 8 Uses @code{malloc} to allocate storage for @var{nelem} objects of 9 @var{elsize} bytes each, then zeros the memory. 10 11 @end deftypefn 12 13 */ 3 14 4 15 #include "ansidecl.h" 5 #include "libiberty.h"6 7 16 #ifdef ANSI_PROTOTYPES 8 17 #include <stddef.h> … … 13 22 /* For systems with larger pointers than ints, this must be declared. */ 14 23 PTR malloc PARAMS ((size_t)); 24 void bzero PARAMS ((PTR, size_t)); 15 25 16 26 PTR -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/choose-temp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 18 18 Boston, MA 02111-1307, USA. */ 19 19 20 /* This file exports two functions: choose_temp_base and make_temp_file. */21 22 20 #ifdef HAVE_CONFIG_H 23 21 #include "config.h" … … 25 23 26 24 #include <stdio.h> /* May get P_tmpdir. */ 27 #include <sys/types.h>28 #ifdef HAVE_UNISTD_H29 #include <unistd.h>30 #endif31 25 #ifdef HAVE_STDLIB_H 32 26 #include <stdlib.h> … … 35 29 #include <string.h> 36 30 #endif 37 #ifdef HAVE_SYS_FILE_H38 #include <sys/file.h> /* May get R_OK, etc. on some systems. */39 #endif40 41 #ifndef R_OK42 #define R_OK 443 #define W_OK 244 #define X_OK 145 #endif46 31 47 32 #include "libiberty.h" 48 extern int mkstemps (); 49 50 #ifndef IN_GCC 51 #if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN)) 52 #define DIR_SEPARATOR '\\' 53 #endif 54 #endif 55 56 #ifndef DIR_SEPARATOR 57 #define DIR_SEPARATOR '/' 58 #endif 59 60 /* On MSDOS, write temp files in current dir 61 because there's no place else we can expect to use. */ 62 /* ??? Although the current directory is tried as a last resort, 63 this is left in so that on MSDOS it is preferred to /tmp on the 64 off chance that someone requires this, since that was the previous 65 behaviour. */ 66 #ifdef __MSDOS__ 67 #ifndef P_tmpdir 68 #define P_tmpdir "." 69 #endif 70 #endif 33 extern char *choose_tmpdir PARAMS ((void)); 71 34 72 35 /* Name of temporary file. 73 36 mktemp requires 6 trailing X's. */ 74 37 #define TEMP_FILE "ccXXXXXX" 38 #define TEMP_FILE_LEN (sizeof(TEMP_FILE) - 1) 75 39 76 /* Subroutine of choose_temp_base. 77 If BASE is non-NULL, return it. 78 Otherwise it checks if DIR is a usable directory. 79 If success, DIR is returned. 80 Otherwise NULL is returned. */ 40 /* 81 41 82 static const char *try PARAMS ((const char *, const char *)); 42 @deftypefn Extension char* choose_temp_base (void) 83 43 84 static const char * 85 try (dir, base) 86 const char *dir, *base; 87 { 88 if (base != 0) 89 return base; 90 if (dir != 0 91 && access (dir, R_OK | W_OK | X_OK) == 0) 92 return dir; 93 return 0; 94 } 44 Return a prefix for temporary file names or @code{NULL} if unable to 45 find one. The current directory is chosen if all else fails so the 46 program is exited if a temporary directory can't be found (@code{mktemp} 47 fails). The buffer for the result is obtained with @code{xmalloc}. 95 48 96 /* Return a prefix for temporary file names or NULL if unable to find one. 97 The current directory is chosen if all else fails so the program is 98 exited if a temporary directory can't be found (mktemp fails). 99 The buffer for the result is obtained with xmalloc. 49 This function is provided for backwards compatability only. Its use is 50 not recommended. 100 51 101 This function is provided for backwards compatability only. It use 102 is not recommended. */ 52 @end deftypefn 53 54 */ 103 55 104 56 char * 105 57 choose_temp_base () 106 58 { 107 const char *base = 0;59 const char *base = choose_tmpdir (); 108 60 char *temp_filename; 109 61 int len; 110 static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 };111 static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };112 113 base = try (getenv ("TMPDIR"), base);114 base = try (getenv ("TMP"), base);115 base = try (getenv ("TEMP"), base);116 117 #ifdef P_tmpdir118 base = try (P_tmpdir, base);119 #endif120 121 /* Try /usr/tmp, then /tmp. */122 base = try (usrtmp, base);123 base = try (tmp, base);124 125 /* If all else fails, use the current directory! */126 if (base == 0)127 base = ".";128 62 129 63 len = strlen (base); 130 temp_filename = xmalloc (len + 1 /*DIR_SEPARATOR*/ 131 + strlen (TEMP_FILE) + 1); 64 temp_filename = xmalloc (len + TEMP_FILE_LEN + 1); 132 65 strcpy (temp_filename, base); 133 134 if (len != 0135 && temp_filename[len-1] != '/'136 && temp_filename[len-1] != DIR_SEPARATOR)137 temp_filename[len++] = DIR_SEPARATOR;138 66 strcpy (temp_filename + len, TEMP_FILE); 139 67 … … 143 71 return temp_filename; 144 72 } 145 /* Return a temporary file name (as a string) or NULL if unable to create146 one. */147 148 char *149 make_temp_file (suffix)150 const char *suffix;151 {152 const char *base = 0;153 char *temp_filename;154 int base_len, suffix_len;155 int fd;156 static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 };157 static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };158 159 base = try (getenv ("TMPDIR"), base);160 base = try (getenv ("TMP"), base);161 base = try (getenv ("TEMP"), base);162 163 #ifdef P_tmpdir164 base = try (P_tmpdir, base);165 #endif166 167 /* Try /usr/tmp, then /tmp. */168 base = try (usrtmp, base);169 base = try (tmp, base);170 171 /* If all else fails, use the current directory! */172 if (base == 0)173 base = ".";174 175 base_len = strlen (base);176 177 if (suffix)178 suffix_len = strlen (suffix);179 else180 suffix_len = 0;181 182 temp_filename = xmalloc (base_len + 1 /*DIR_SEPARATOR*/183 + strlen (TEMP_FILE)184 + suffix_len + 1);185 strcpy (temp_filename, base);186 187 if (base_len != 0188 && temp_filename[base_len-1] != '/'189 && temp_filename[base_len-1] != DIR_SEPARATOR)190 temp_filename[base_len++] = DIR_SEPARATOR;191 strcpy (temp_filename + base_len, TEMP_FILE);192 193 if (suffix)194 strcat (temp_filename, suffix);195 196 fd = mkstemps (temp_filename, suffix_len);197 /* If mkstemps failed, then something bad is happening. Maybe we should198 issue a message about a possible security attack in progress? */199 if (fd == -1)200 abort ();201 /* Similarly if we can not close the file. */202 if (close (fd))203 abort ();204 return temp_filename;205 } -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/clock.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 22 22 This exception does not however invalidate any other reasons why 23 23 the executable file might be covered by the GNU General Public License. */ 24 25 /* 26 27 @deftypefn Supplemental long clock (void) 28 29 Returns an approximation of the CPU time used by the process as a 30 @code{clock_t}; divide this number by @samp{CLOCKS_PER_SEC} to get the 31 number of seconds used. 32 33 @end deftypefn 34 35 */ 24 36 25 37 #include "config.h" -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/concat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Concatenate variable number of strings. 2 Copyright (C) 1991, 1994 Free Software Foundation, Inc.2 Copyright (C) 1991, 1994, 2001 Free Software Foundation, Inc. 3 3 Written by Fred Fish @ Cygnus Support 4 4 … … 22 22 /* 23 23 24 NAME 25 26 concat -- concatenate a variable number of strings 27 28 SYNOPSIS 29 30 #include <varargs.h> 31 32 char *concat (s1, s2, s3, ..., NULL) 33 34 DESCRIPTION 35 36 Concatenate a variable number of strings and return the result 37 in freshly malloc'd memory. 38 39 Returns NULL if insufficient memory is available. The argument 40 list is terminated by the first NULL pointer encountered. Pointers 41 to empty strings are ignored. 24 @deftypefn Extension char* concat (const char *@var{s1}, const char *@var{s2}, @dots{}, @code{NULL}) 25 26 Concatenate zero or more of strings and return the result in freshly 27 @code{xmalloc}ed memory. Returns @code{NULL} if insufficient memory is 28 available. The argument list is terminated by the first @code{NULL} 29 pointer encountered. Pointers to empty strings are ignored. 30 31 @end deftypefn 42 32 43 33 NOTES … … 51 41 that just directly invokes malloc and blindly returns whatever 52 42 malloc returns. 43 53 44 */ 54 45 55 46 47 #ifdef HAVE_CONFIG_H 48 #include "config.h" 49 #endif 56 50 #include "ansidecl.h" 57 51 #include "libiberty.h" 52 #include <sys/types.h> /* size_t */ 58 53 59 54 #ifdef ANSI_PROTOTYPES … … 63 58 #endif 64 59 65 #ifdef __STDC__ 66 #include <stddef.h> 67 extern size_t strlen (const char *s); 68 #else 69 extern int strlen (); 70 #endif 71 60 # if HAVE_STRING_H 61 # include <string.h> 62 # else 63 # if HAVE_STRINGS_H 64 # include <strings.h> 65 # endif 66 # endif 67 68 #if HAVE_STDLIB_H 69 #include <stdlib.h> 70 #endif 71 72 static inline unsigned long vconcat_length PARAMS ((const char *, va_list)); 73 static inline unsigned long 74 vconcat_length (first, args) 75 const char *first; 76 va_list args; 77 { 78 unsigned long length = 0; 79 const char *arg; 80 81 for (arg = first; arg ; arg = va_arg (args, const char *)) 82 length += strlen (arg); 83 84 return length; 85 } 86 87 static inline char *vconcat_copy PARAMS ((char *, const char *, va_list)); 88 static inline char * 89 vconcat_copy (dst, first, args) 90 char *dst; 91 const char *first; 92 va_list args; 93 { 94 char *end = dst; 95 const char *arg; 96 97 for (arg = first; arg ; arg = va_arg (args, const char *)) 98 { 99 unsigned long length = strlen (arg); 100 memcpy (end, arg, length); 101 end += length; 102 } 103 *end = '\000'; 104 105 return dst; 106 } 107 108 /* @undocumented concat_length */ 109 110 unsigned long 111 concat_length VPARAMS ((const char *first, ...)) 112 { 113 unsigned long length; 114 115 VA_OPEN (args, first); 116 VA_FIXEDARG (args, const char *, first); 117 length = vconcat_length (first, args); 118 VA_CLOSE (args); 119 120 return length; 121 } 122 123 /* @undocumented concat_copy */ 124 125 char * 126 concat_copy VPARAMS ((char *dst, const char *first, ...)) 127 { 128 char *save_dst; 129 130 VA_OPEN (args, first); 131 VA_FIXEDARG (args, char *, dst); 132 VA_FIXEDARG (args, const char *, first); 133 vconcat_copy (dst, first, args); 134 save_dst = dst; /* With K&R C, dst goes out of scope here. */ 135 VA_CLOSE (args); 136 137 return save_dst; 138 } 139 140 char *libiberty_concat_ptr; 141 142 /* @undocumented concat_copy2 */ 143 144 char * 145 concat_copy2 VPARAMS ((const char *first, ...)) 146 { 147 VA_OPEN (args, first); 148 VA_FIXEDARG (args, const char *, first); 149 vconcat_copy (libiberty_concat_ptr, first, args); 150 VA_CLOSE (args); 151 152 return libiberty_concat_ptr; 153 } 154 155 char * 156 concat VPARAMS ((const char *first, ...)) 157 { 158 char *newstr; 159 160 /* First compute the size of the result and get sufficient memory. */ 161 VA_OPEN (args, first); 162 VA_FIXEDARG (args, const char *, first); 163 newstr = (char *) xmalloc (vconcat_length (first, args) + 1); 164 VA_CLOSE (args); 165 166 /* Now copy the individual pieces to the result string. */ 167 VA_OPEN (args, first); 168 VA_FIXEDARG (args, const char *, first); 169 vconcat_copy (newstr, first, args); 170 VA_CLOSE (args); 171 172 return newstr; 173 } 174 175 /* 176 177 @deftypefn Extension char* reconcat (char *@var{optr}, const char *@var{s1}, @dots{}, @code{NULL}) 178 179 Same as @code{concat}, except that if @var{optr} is not @code{NULL} it 180 is freed after the string is created. This is intended to be useful 181 when you're extending an existing string or building up a string in a 182 loop: 183 184 @example 185 str = reconcat (str, "pre-", str, NULL); 186 @end example 187 188 @end deftypefn 189 190 */ 191 192 char * 193 reconcat VPARAMS ((char *optr, const char *first, ...)) 194 { 195 char *newstr; 196 197 /* First compute the size of the result and get sufficient memory. */ 198 VA_OPEN (args, first); 199 VA_FIXEDARG (args, char *, optr); 200 VA_FIXEDARG (args, const char *, first); 201 newstr = (char *) xmalloc (vconcat_length (first, args) + 1); 202 VA_CLOSE (args); 203 204 /* Now copy the individual pieces to the result string. */ 205 VA_OPEN (args, first); 206 VA_FIXEDARG (args, char *, optr); 207 VA_FIXEDARG (args, const char *, first); 208 vconcat_copy (newstr, first, args); 209 if (optr) /* Done before VA_CLOSE so optr stays in scope for K&R C. */ 210 free (optr); 211 VA_CLOSE (args); 212 213 return newstr; 214 } 215 216 #ifdef MAIN 72 217 #define NULLP (char *)0 73 74 /* VARARGS */75 #ifdef ANSI_PROTOTYPES76 char *77 concat (const char *first, ...)78 #else79 char *80 concat (va_alist)81 va_dcl82 #endif83 {84 register int length;85 register char *newstr;86 register char *end;87 register const char *arg;88 va_list args;89 #ifndef ANSI_PROTOTYPES90 const char *first;91 #endif92 93 /* First compute the size of the result and get sufficient memory. */94 95 #ifdef ANSI_PROTOTYPES96 va_start (args, first);97 #else98 va_start (args);99 first = va_arg (args, const char *);100 #endif101 102 if (first == NULLP)103 length = 0;104 else105 {106 length = strlen (first);107 while ((arg = va_arg (args, const char *)) != NULLP)108 {109 length += strlen (arg);110 }111 }112 newstr = (char *) xmalloc (length + 1);113 va_end (args);114 115 /* Now copy the individual pieces to the result string. */116 117 if (newstr != NULLP)118 {119 #ifdef ANSI_PROTOTYPES120 va_start (args, first);121 #else122 va_start (args);123 first = va_arg (args, const char *);124 #endif125 end = newstr;126 if (first != NULLP)127 {128 arg = first;129 while (*arg)130 {131 *end++ = *arg++;132 }133 while ((arg = va_arg (args, const char *)) != NULLP)134 {135 while (*arg)136 {137 *end++ = *arg++;138 }139 }140 }141 *end = '\000';142 va_end (args);143 }144 145 return (newstr);146 }147 148 #ifdef MAIN149 218 150 219 /* Simple little test driver. */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/config.in
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* config.in. Generated automatically from configure.in by autoheader. */ 2 3 /* Define if using alloca.c. */4 #undef C_ALLOCA5 2 6 3 /* Define to empty if the keyword does not work. */ 7 4 #undef const 8 5 9 /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.10 This function is required for alloca.c support on those systems. */11 #undef CRAY_STACKSEG_END12 13 /* Define if you have alloca, as a function or macro. */14 #undef HAVE_ALLOCA15 16 /* Define if you have <alloca.h> and it should be used (not on Ultrix). */17 #undef HAVE_ALLOCA_H18 19 6 /* Define if you have a working `mmap' system call. */ 20 7 #undef HAVE_MMAP … … 29 16 #undef inline 30 17 18 /* Define if your C compiler doesn't accept -c and -o together. */ 19 #undef NO_MINUS_C_MINUS_O 20 31 21 /* Define to `int' if <sys/types.h> doesn't define. */ 32 22 #undef pid_t … … 35 25 #undef _POSIX_SOURCE 36 26 37 /* If using the C implementation of alloca, define if you know the38 direction of stack growth for your system; otherwise it will be39 automatically deduced at run-time.40 STACK_DIRECTION > 0 => grows toward higher addresses41 STACK_DIRECTION < 0 => grows toward lower addresses42 STACK_DIRECTION = 0 => direction of growth unknown43 */44 #undef STACK_DIRECTION45 46 27 /* Define if you have the ANSI C header files. */ 47 28 #undef STDC_HEADERS … … 53 34 #undef vfork 54 35 36 /* Define to `unsigned long' if <sys/types.h> doesn't define. */ 37 #undef uintptr_t 38 39 /* Define if you have the _doprnt function. */ 40 #undef HAVE__DOPRNT 41 55 42 /* Define if you have the asprintf function. */ 56 43 #undef HAVE_ASPRINTF … … 77 64 #undef HAVE_CALLOC 78 65 66 /* Define if you have the canonicalize_file_name function. */ 67 #undef HAVE_CANONICALIZE_FILE_NAME 68 79 69 /* Define if you have the clock function. */ 80 70 #undef HAVE_CLOCK 81 71 72 /* Define if you have the ffs function. */ 73 #undef HAVE_FFS 74 82 75 /* Define if you have the getcwd function. */ 83 76 #undef HAVE_GETCWD … … 89 82 #undef HAVE_GETRUSAGE 90 83 84 /* Define if you have the getsysinfo function. */ 85 #undef HAVE_GETSYSINFO 86 91 87 /* Define if you have the gettimeofday function. */ 92 88 #undef HAVE_GETTIMEOFDAY … … 110 106 #undef HAVE_MEMMOVE 111 107 108 /* Define if you have the mempcpy function. */ 109 #undef HAVE_MEMPCPY 110 112 111 /* Define if you have the memset function. */ 113 112 #undef HAVE_MEMSET … … 122 121 #undef HAVE_PSIGNAL 123 122 123 /* Define if you have the pstat_getdynamic function. */ 124 #undef HAVE_PSTAT_GETDYNAMIC 125 126 /* Define if you have the pstat_getstatic function. */ 127 #undef HAVE_PSTAT_GETSTATIC 128 124 129 /* Define if you have the putenv function. */ 125 130 #undef HAVE_PUTENV … … 128 133 #undef HAVE_RANDOM 129 134 135 /* Define if you have the realpath function. */ 136 #undef HAVE_REALPATH 137 130 138 /* Define if you have the rename function. */ 131 139 #undef HAVE_RENAME … … 143 151 #undef HAVE_SIGSETMASK 144 152 153 /* Define if you have the snprintf function. */ 154 #undef HAVE_SNPRINTF 155 156 /* Define if you have the stpcpy function. */ 157 #undef HAVE_STPCPY 158 159 /* Define if you have the stpncpy function. */ 160 #undef HAVE_STPNCPY 161 145 162 /* Define if you have the strcasecmp function. */ 146 163 #undef HAVE_STRCASECMP … … 179 196 #undef HAVE_SYSCONF 180 197 198 /* Define if you have the sysctl function. */ 199 #undef HAVE_SYSCTL 200 201 /* Define if you have the sysmp function. */ 202 #undef HAVE_SYSMP 203 204 /* Define if you have the table function. */ 205 #undef HAVE_TABLE 206 181 207 /* Define if you have the times function. */ 182 208 #undef HAVE_TIMES … … 194 220 #undef HAVE_VPRINTF 195 221 222 /* Define if you have the vsnprintf function. */ 223 #undef HAVE_VSNPRINTF 224 196 225 /* Define if you have the vsprintf function. */ 197 226 #undef HAVE_VSPRINTF … … 200 229 #undef HAVE_WAITPID 201 230 231 /* Define if you have the <alloca.h> header file. */ 232 #undef HAVE_ALLOCA_H 233 202 234 /* Define if you have the <fcntl.h> header file. */ 203 235 #undef HAVE_FCNTL_H … … 206 238 #undef HAVE_LIMITS_H 207 239 240 /* Define if you have the <machine/hal_sysinfo.h> header file. */ 241 #undef HAVE_MACHINE_HAL_SYSINFO_H 242 208 243 /* Define if you have the <stdlib.h> header file. */ 209 244 #undef HAVE_STDLIB_H … … 224 259 #undef HAVE_SYS_PARAM_H 225 260 261 /* Define if you have the <sys/pstat.h> header file. */ 262 #undef HAVE_SYS_PSTAT_H 263 226 264 /* Define if you have the <sys/resource.h> header file. */ 227 265 #undef HAVE_SYS_RESOURCE_H … … 230 268 #undef HAVE_SYS_STAT_H 231 269 270 /* Define if you have the <sys/sysctl.h> header file. */ 271 #undef HAVE_SYS_SYSCTL_H 272 273 /* Define if you have the <sys/sysinfo.h> header file. */ 274 #undef HAVE_SYS_SYSINFO_H 275 276 /* Define if you have the <sys/sysmp.h> header file. */ 277 #undef HAVE_SYS_SYSMP_H 278 279 /* Define if you have the <sys/systemcfg.h> header file. */ 280 #undef HAVE_SYS_SYSTEMCFG_H 281 282 /* Define if you have the <sys/table.h> header file. */ 283 #undef HAVE_SYS_TABLE_H 284 232 285 /* Define if you have the <sys/time.h> header file. */ 233 286 #undef HAVE_SYS_TIME_H … … 242 295 #undef NEED_DECLARATION_ERRNO 243 296 297 /* Define if you have the `uintptr_t' type. */ 298 #undef HAVE_UINTPTR_T 299 244 300 /* Define if you have the sys_errlist variable. */ 245 301 #undef HAVE_SYS_ERRLIST … … 251 307 #undef HAVE_SYS_SIGLIST 252 308 309 /* Define if you have the _system_configuration variable. */ 310 #undef HAVE__SYSTEM_CONFIGURATION 311 312 /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP 313 systems. This function is required for alloca.c support on those 314 systems. */ 315 #undef CRAY_STACKSEG_END 316 317 /* Define if you know the direction of stack growth for your system; 318 otherwise it will be automatically deduced at run-time. 319 STACK_DIRECTION > 0 => grows toward higher addresses 320 STACK_DIRECTION < 0 => grows toward lower addresses 321 STACK_DIRECTION = 0 => direction of growth unknown */ 322 #undef STACK_DIRECTION 323 324 /* Define if canonicalize_file_name is not declared in system header files. */ 325 #undef NEED_DECLARATION_CANONICALIZE_FILE_NAME 326 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/config.table
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 # Don't build the shared library for build. 2 if [ -n "${with_build_subdir}" ]; then 3 enable_shared=no 4 fi 5 6 frag= 1 7 case "${host}" in 2 8 rs6000-ibm-aix3.1 | rs6000-ibm-aix) … … 7 13 i370-*-opened*) frag=mh-openedition ;; 8 14 i[345]86-*-windows*) frag=mh-windows ;; 9 *-*-beos*) frag=mh-beos ;;10 15 esac 11 16 12 frags=$frag 17 if [ -n "${frag}" ]; then 18 frags=${libiberty_topdir}/libiberty/config/$frag 19 else 20 frags= 21 fi 13 22 14 23 # If they didn't specify --enable-shared, don't generate shared libs. … … 20 29 esac 21 30 if [ "${shared}" = "yes" ]; then 31 frag= 22 32 case "${host}" in 23 33 *-*-cygwin*) ;; 24 alpha*-*-linux*) frags="${frags} ../../config/mh-elfalphapic" ;; 25 arm*-*-*) frags="${frags} ../../config/mh-armpic" ;; 26 hppa*-*-*) frags="${frags} ../../config/mh-papic" ;; 27 i[3456]86-*-*) frags="${frags} ../../config/mh-x86pic" ;; 34 alpha*-*-linux*) frag=mh-elfalphapic ;; 35 arm*-*-*) frag=mh-armpic ;; 36 hppa*-*-*) frag=mh-papic ;; 37 i[3456]86-*-* | x86_64-*-*) 38 frag=mh-x86pic ;; 28 39 powerpc*-*-aix*) ;; 29 powerpc*-*-*) frags="${frags} ../../config/mh-ppcpic" ;; 30 sparc*-*-*) frags="${frags} ../../config/mh-sparcpic" ;; 31 *-*-*) frags="${frags} ../../config/mh-${host_cpu}pic" ;; 40 powerpc*-*-*) frag=mh-ppcpic ;; 41 sparc*-*-*) frag=mh-sparcpic ;; 42 s390*-*-*) frag=mh-s390pic ;; 43 *) frag=mh-${host_cpu}pic ;; 32 44 esac 45 if [ -n "${frag}" ]; then 46 frags="${frags} ${libiberty_topdir}/config/${frag}" 47 fi 33 48 fi 34 49 … … 36 51 37 52 for frag in ${frags}; do 38 case ${frag} in39 ../* )40 if [ ${srcdir} = . ]; then41 [ -n "${with_target_subdir}" ] && frag=../${frag}42 [ -n "${with_multisrctop}" ] && frag=${with_multisrctop}${frag}43 fi44 ;;45 esac46 frag=${srcdir}/${xsrcdir}config/$frag47 53 if [ -f ${frag} ]; then 48 54 echo "Appending ${frag} to xhost-mkfrag" -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/configure
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 13 13 # Any additions from configure.in: 14 14 ac_help="$ac_help 15 --with-target-subdir=SUBDIR Configuring in a subdirectory" 15 --with-target-subdir=SUBDIR Configuring in a subdirectory for target" 16 ac_help="$ac_help 17 --with-build-subdir=SUBDIR Configuring in a subdirectory for build" 16 18 ac_help="$ac_help 17 19 --with-cross-host=HOST Configuring with a cross compiler" 18 20 ac_help="$ac_help 19 21 --with-newlib Configuring with newlib" 22 ac_help="$ac_help 23 --enable-maintainer-mode 24 enable make rules and dependencies not useful 25 (and sometimes confusing) to the casual installer" 26 ac_help="$ac_help 27 --enable-install-libiberty Install headers for end users" 20 28 21 29 # Initialize some variables set by options. … … 458 466 # A filename unique to this package, relative to the directory that 459 467 # configure is in, which we can look for to find out if srcdir is correct. 460 ac_unique_file= pexecute.c468 ac_unique_file=xmalloc.c 461 469 462 470 # Find the source files, if location was not specified. … … 529 537 530 538 539 # This works around the fact that libtool configuration may change LD 540 # for this particular configuration, but some shells, instead of 541 # keeping the changes in LD private, export them just because LD is 542 # exported. We don't use libtool yet, but some day we might, so... 543 ORIGINAL_LD_FOR_MULTILIBS=$LD 544 531 545 # Check whether --with-target-subdir or --without-target-subdir was given. 532 546 if test "${with_target_subdir+set}" = set; then … … 535 549 fi 536 550 551 # Check whether --with-build-subdir or --without-build-subdir was given. 552 if test "${with_build_subdir+set}" = set; then 553 withval="$with_build_subdir" 554 : 555 fi 556 537 557 # Check whether --with-cross-host or --without-cross-host was given. 538 558 if test "${with_cross_host+set}" = set; then … … 549 569 550 570 if test "${srcdir}" = "."; then 551 if test -z "${with_target_subdir}"; then 571 if test -n "${with_build_subdir}"; then 572 libiberty_topdir="${srcdir}/../.." 573 with_target_subdir= 574 elif test -z "${with_target_subdir}"; then 552 575 libiberty_topdir="${srcdir}/.." 553 576 else … … 561 584 libiberty_topdir="${srcdir}/.." 562 585 fi 586 563 587 ac_aux_dir= 564 588 for ac_dir in $libiberty_topdir $srcdir/$libiberty_topdir; do … … 582 606 583 607 608 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 609 echo "configure:610: checking whether to enable maintainer-specific portions of Makefiles" >&5 610 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. 611 if test "${enable_maintainer_mode+set}" = set; then 612 enableval="$enable_maintainer_mode" 613 maintainer_mode=$enableval 614 else 615 maintainer_mode=no 616 fi 617 618 619 echo "$ac_t""$maintainer_mode" 1>&6 620 621 if test "$maintainer_mode" = "yes"; then 622 MAINT='' 623 NOTMAINT='#' 624 else 625 MAINT='#' 626 NOTMAINT='' 627 fi 628 629 # Do we have a single-tree copy of texinfo? Even if we do, we can't 630 # rely on it - libiberty is built before texinfo. 631 # Extract the first word of "makeinfo", so it can be a program name with args. 632 set dummy makeinfo; ac_word=$2 633 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 634 echo "configure:635: checking for $ac_word" >&5 635 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then 636 echo $ac_n "(cached) $ac_c" 1>&6 637 else 638 if test -n "$MAKEINFO"; then 639 ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test. 640 else 641 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" 642 ac_dummy="$PATH" 643 for ac_dir in $ac_dummy; do 644 test -z "$ac_dir" && ac_dir=. 645 if test -f $ac_dir/$ac_word; then 646 ac_cv_prog_MAKEINFO="makeinfo" 647 break 648 fi 649 done 650 IFS="$ac_save_ifs" 651 fi 652 fi 653 MAKEINFO="$ac_cv_prog_MAKEINFO" 654 if test -n "$MAKEINFO"; then 655 echo "$ac_t""$MAKEINFO" 1>&6 656 else 657 echo "$ac_t""no" 1>&6 658 fi 659 660 if test "x$MAKEINFO" = "x"; then 661 MAKEINFO="@echo makeinfo missing; true" 662 BUILD_INFO= 663 else 664 BUILD_INFO=info 665 case x"`$MAKEINFO --version | grep 'GNU texinfo'`" in 666 x*\ [1-3].* ) 667 MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true" 668 BUILD_INFO= 669 echo "configure: warning: 670 *** Makeinfo is too old. Info documentation will not be built." 1>&2 671 ;; 672 esac 673 fi 674 675 676 677 # Extract the first word of "perl", so it can be a program name with args. 678 set dummy perl; ac_word=$2 679 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 680 echo "configure:681: checking for $ac_word" >&5 681 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then 682 echo $ac_n "(cached) $ac_c" 1>&6 683 else 684 if test -n "$PERL"; then 685 ac_cv_prog_PERL="$PERL" # Let the user override the test. 686 else 687 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" 688 ac_dummy="$PATH" 689 for ac_dir in $ac_dummy; do 690 test -z "$ac_dir" && ac_dir=. 691 if test -f $ac_dir/$ac_word; then 692 ac_cv_prog_PERL="perl" 693 break 694 fi 695 done 696 IFS="$ac_save_ifs" 697 fi 698 fi 699 PERL="$ac_cv_prog_PERL" 700 if test -n "$PERL"; then 701 echo "$ac_t""$PERL" 1>&6 702 else 703 echo "$ac_t""no" 1>&6 704 fi 705 706 if test x"$PERL" = x""; then 707 HAVE_PERL='#' 708 else 709 HAVE_PERL='' 710 fi 711 712 713 584 714 # Make sure we can run config.sub. 585 715 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : … … 588 718 589 719 echo $ac_n "checking host system type""... $ac_c" 1>&6 590 echo "configure: 591: checking host system type" >&5720 echo "configure:721: checking host system type" >&5 591 721 592 722 host_alias=$host … … 611 741 612 742 echo $ac_n "checking build system type""... $ac_c" 1>&6 613 echo "configure: 614: checking build system type" >&5743 echo "configure:744: checking build system type" >&5 614 744 615 745 build_alias=$build … … 637 767 set dummy ${ac_tool_prefix}ar; ac_word=$2 638 768 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 639 echo "configure: 640: checking for $ac_word" >&5769 echo "configure:770: checking for $ac_word" >&5 640 770 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then 641 771 echo $ac_n "(cached) $ac_c" 1>&6 … … 669 799 set dummy ${ac_tool_prefix}ranlib; ac_word=$2 670 800 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 671 echo "configure: 672: checking for $ac_word" >&5801 echo "configure:802: checking for $ac_word" >&5 672 802 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then 673 803 echo $ac_n "(cached) $ac_c" 1>&6 … … 701 831 set dummy ranlib; ac_word=$2 702 832 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 703 echo "configure: 704: checking for $ac_word" >&5833 echo "configure:834: checking for $ac_word" >&5 704 834 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then 705 835 echo $ac_n "(cached) $ac_c" 1>&6 … … 738 868 set dummy gcc; ac_word=$2 739 869 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 740 echo "configure: 741: checking for $ac_word" >&5870 echo "configure:871: checking for $ac_word" >&5 741 871 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then 742 872 echo $ac_n "(cached) $ac_c" 1>&6 … … 768 898 set dummy cc; ac_word=$2 769 899 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 770 echo "configure: 771: checking for $ac_word" >&5900 echo "configure:901: checking for $ac_word" >&5 771 901 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then 772 902 echo $ac_n "(cached) $ac_c" 1>&6 … … 817 947 818 948 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 819 echo "configure: 820: checking whether we are using GNU C" >&5949 echo "configure:950: checking whether we are using GNU C" >&5 820 950 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then 821 951 echo $ac_n "(cached) $ac_c" 1>&6 … … 826 956 #endif 827 957 EOF 828 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure: 829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then958 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then 829 959 ac_cv_prog_gcc=yes 830 960 else … … 842 972 CFLAGS= 843 973 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 844 echo "configure: 845: checking whether ${CC-cc} accepts -g" >&5974 echo "configure:975: checking whether ${CC-cc} accepts -g" >&5 845 975 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then 846 976 echo $ac_n "(cached) $ac_c" 1>&6 … … 872 1002 873 1003 1004 if test "x$CC" != xcc; then 1005 echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 1006 echo "configure:1007: checking whether $CC and cc understand -c and -o together" >&5 1007 else 1008 echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 1009 echo "configure:1010: checking whether cc understands -c and -o together" >&5 1010 fi 1011 set dummy $CC; ac_cc="`echo $2 | 1012 sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" 1013 if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then 1014 echo $ac_n "(cached) $ac_c" 1>&6 1015 else 1016 echo 'foo(){}' > conftest.c 1017 # Make sure it works both with $CC and with simple cc. 1018 # We do the test twice because some compilers refuse to overwrite an 1019 # existing .o file with -o, though they will create one. 1020 ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' 1021 if { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && 1022 test -f conftest.o && { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; 1023 then 1024 eval ac_cv_prog_cc_${ac_cc}_c_o=yes 1025 if test "x$CC" != xcc; then 1026 # Test first that cc exists at all. 1027 if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then 1028 ac_try='cc -c conftest.c -o conftest.o 1>&5' 1029 if { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && 1030 test -f conftest.o && { (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; 1031 then 1032 # cc works too. 1033 : 1034 else 1035 # cc exists but doesn't like -o. 1036 eval ac_cv_prog_cc_${ac_cc}_c_o=no 1037 fi 1038 fi 1039 fi 1040 else 1041 eval ac_cv_prog_cc_${ac_cc}_c_o=no 1042 fi 1043 rm -f conftest* 1044 1045 fi 1046 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then 1047 echo "$ac_t""yes" 1>&6 1048 else 1049 echo "$ac_t""no" 1>&6 1050 cat >> confdefs.h <<\EOF 1051 #define NO_MINUS_C_MINUS_O 1 1052 EOF 1053 1054 fi 1055 1056 # autoconf is lame and doesn't give us any substitution variable for this. 1057 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then 1058 NO_MINUS_C_MINUS_O=yes 1059 else 1060 OUTPUT_OPTION='-o $@' 1061 fi 1062 1063 1064 874 1065 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 875 echo "configure: 876: checking for POSIXized ISC" >&51066 echo "configure:1067: checking for POSIXized ISC" >&5 876 1067 if test -d /etc/conf/kconfig.d && 877 1068 grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 … … 894 1085 895 1086 echo $ac_n "checking for working const""... $ac_c" 1>&6 896 echo "configure: 897: checking for working const" >&51087 echo "configure:1088: checking for working const" >&5 897 1088 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then 898 1089 echo $ac_n "(cached) $ac_c" 1>&6 899 1090 else 900 1091 cat > conftest.$ac_ext <<EOF 901 #line 902"configure"1092 #line 1093 "configure" 902 1093 #include "confdefs.h" 903 1094 … … 948 1139 ; return 0; } 949 1140 EOF 950 if { (eval echo configure: 951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then1141 if { (eval echo configure:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 951 1142 rm -rf conftest* 952 1143 ac_cv_c_const=yes … … 969 1160 970 1161 echo $ac_n "checking for inline""... $ac_c" 1>&6 971 echo "configure: 972: checking for inline" >&51162 echo "configure:1163: checking for inline" >&5 972 1163 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then 973 1164 echo $ac_n "(cached) $ac_c" 1>&6 … … 976 1167 for ac_kw in inline __inline__ __inline; do 977 1168 cat > conftest.$ac_ext <<EOF 978 #line 979"configure"1169 #line 1170 "configure" 979 1170 #include "confdefs.h" 980 1171 … … 983 1174 ; return 0; } 984 1175 EOF 985 if { (eval echo configure: 986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then1176 if { (eval echo configure:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 986 1177 rm -rf conftest* 987 1178 ac_cv_c_inline=$ac_kw; break … … 1026 1217 # ./install, which can be erroneously created by make from ./install.sh. 1027 1218 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 1028 echo "configure:1 029: checking for a BSD compatible install" >&51219 echo "configure:1220: checking for a BSD compatible install" >&5 1029 1220 if test -z "$INSTALL"; then 1030 1221 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then … … 1087 1278 # something. 1088 1279 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 1089 echo "configure:1 090: checking how to run the C preprocessor" >&51280 echo "configure:1281: checking how to run the C preprocessor" >&5 1090 1281 # On Suns, sometimes $CPP names a directory. 1091 1282 if test -n "$CPP" && test -d "$CPP"; then … … 1102 1293 # not just through cpp. 1103 1294 cat > conftest.$ac_ext <<EOF 1104 #line 1 105"configure"1295 #line 1296 "configure" 1105 1296 #include "confdefs.h" 1106 1297 #include <assert.h> … … 1108 1299 EOF 1109 1300 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1110 { (eval echo configure:1 111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1301 { (eval echo configure:1302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1111 1302 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1112 1303 if test -z "$ac_err"; then … … 1119 1310 CPP="${CC-cc} -E -traditional-cpp" 1120 1311 cat > conftest.$ac_ext <<EOF 1121 #line 1 122"configure"1312 #line 1313 "configure" 1122 1313 #include "confdefs.h" 1123 1314 #include <assert.h> … … 1125 1316 EOF 1126 1317 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1127 { (eval echo configure:1 128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1318 { (eval echo configure:1319: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1128 1319 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1129 1320 if test -z "$ac_err"; then … … 1136 1327 CPP="${CC-cc} -nologo -E" 1137 1328 cat > conftest.$ac_ext <<EOF 1138 #line 1 139"configure"1329 #line 1330 "configure" 1139 1330 #include "confdefs.h" 1140 1331 #include <assert.h> … … 1142 1333 EOF 1143 1334 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1144 { (eval echo configure:1 145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1335 { (eval echo configure:1336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1145 1336 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1146 1337 if test -z "$ac_err"; then … … 1166 1357 echo "$ac_t""$CPP" 1>&6 1167 1358 1168 for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h 1359 for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h 1169 1360 do 1170 1361 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 1171 1362 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 1172 echo "configure:1 173: checking for $ac_hdr" >&51363 echo "configure:1364: checking for $ac_hdr" >&5 1173 1364 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 1174 1365 echo $ac_n "(cached) $ac_c" 1>&6 1175 1366 else 1176 1367 cat > conftest.$ac_ext <<EOF 1177 #line 1 178"configure"1368 #line 1369 "configure" 1178 1369 #include "confdefs.h" 1179 1370 #include <$ac_hdr> 1180 1371 EOF 1181 1372 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1182 { (eval echo configure:1 183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1373 { (eval echo configure:1374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1183 1374 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1184 1375 if test -z "$ac_err"; then … … 1207 1398 1208 1399 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 1209 echo "configure:1 210: checking for sys/wait.h that is POSIX.1 compatible" >&51400 echo "configure:1401: checking for sys/wait.h that is POSIX.1 compatible" >&5 1210 1401 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then 1211 1402 echo $ac_n "(cached) $ac_c" 1>&6 1212 1403 else 1213 1404 cat > conftest.$ac_ext <<EOF 1214 #line 1 215"configure"1405 #line 1406 "configure" 1215 1406 #include "confdefs.h" 1216 1407 #include <sys/types.h> … … 1228 1419 ; return 0; } 1229 1420 EOF 1230 if { (eval echo configure:1 231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then1421 if { (eval echo configure:1422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 1231 1422 rm -rf conftest* 1232 1423 ac_cv_header_sys_wait_h=yes … … 1249 1440 1250 1441 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 1251 echo "configure:1 252: checking whether time.h and sys/time.h may both be included" >&51442 echo "configure:1443: checking whether time.h and sys/time.h may both be included" >&5 1252 1443 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then 1253 1444 echo $ac_n "(cached) $ac_c" 1>&6 1254 1445 else 1255 1446 cat > conftest.$ac_ext <<EOF 1256 #line 1 257"configure"1447 #line 1448 "configure" 1257 1448 #include "confdefs.h" 1258 1449 #include <sys/types.h> … … 1263 1454 ; return 0; } 1264 1455 EOF 1265 if { (eval echo configure:1 266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then1456 if { (eval echo configure:1457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 1266 1457 rm -rf conftest* 1267 1458 ac_cv_header_time=yes … … 1285 1476 1286 1477 echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6 1287 echo "configure:1 288: checking whether errno must be declared" >&51478 echo "configure:1479: checking whether errno must be declared" >&5 1288 1479 if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then 1289 1480 echo $ac_n "(cached) $ac_c" 1>&6 1290 1481 else 1291 1482 cat > conftest.$ac_ext <<EOF 1292 #line 1 293"configure"1483 #line 1484 "configure" 1293 1484 #include "confdefs.h" 1294 1485 #include <errno.h> … … 1297 1488 ; return 0; } 1298 1489 EOF 1299 if { (eval echo configure:1 300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then1490 if { (eval echo configure:1491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 1300 1491 rm -rf conftest* 1301 1492 libiberty_cv_declare_errno=no … … 1313 1504 then cat >> confdefs.h <<\EOF 1314 1505 #define NEED_DECLARATION_ERRNO 1 1506 EOF 1507 1508 fi 1509 1510 1511 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 1512 echo "configure:1513: checking for ANSI C header files" >&5 1513 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then 1514 echo $ac_n "(cached) $ac_c" 1>&6 1515 else 1516 cat > conftest.$ac_ext <<EOF 1517 #line 1518 "configure" 1518 #include "confdefs.h" 1519 #include <stdlib.h> 1520 #include <stdarg.h> 1521 #include <string.h> 1522 #include <float.h> 1523 EOF 1524 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1525 { (eval echo configure:1526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1526 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1527 if test -z "$ac_err"; then 1528 rm -rf conftest* 1529 ac_cv_header_stdc=yes 1530 else 1531 echo "$ac_err" >&5 1532 echo "configure: failed program was:" >&5 1533 cat conftest.$ac_ext >&5 1534 rm -rf conftest* 1535 ac_cv_header_stdc=no 1536 fi 1537 rm -f conftest* 1538 1539 if test $ac_cv_header_stdc = yes; then 1540 # SunOS 4.x string.h does not declare mem*, contrary to ANSI. 1541 cat > conftest.$ac_ext <<EOF 1542 #line 1543 "configure" 1543 #include "confdefs.h" 1544 #include <string.h> 1545 EOF 1546 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 1547 egrep "memchr" >/dev/null 2>&1; then 1548 : 1549 else 1550 rm -rf conftest* 1551 ac_cv_header_stdc=no 1552 fi 1553 rm -f conftest* 1554 1555 fi 1556 1557 if test $ac_cv_header_stdc = yes; then 1558 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. 1559 cat > conftest.$ac_ext <<EOF 1560 #line 1561 "configure" 1561 #include "confdefs.h" 1562 #include <stdlib.h> 1563 EOF 1564 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 1565 egrep "free" >/dev/null 2>&1; then 1566 : 1567 else 1568 rm -rf conftest* 1569 ac_cv_header_stdc=no 1570 fi 1571 rm -f conftest* 1572 1573 fi 1574 1575 if test $ac_cv_header_stdc = yes; then 1576 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. 1577 if test "$cross_compiling" = yes; then 1578 : 1579 else 1580 cat > conftest.$ac_ext <<EOF 1581 #line 1582 "configure" 1582 #include "confdefs.h" 1583 #include <ctype.h> 1584 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') 1585 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) 1586 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) 1587 int main () { int i; for (i = 0; i < 256; i++) 1588 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); 1589 exit (0); } 1590 1591 EOF 1592 if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 1593 then 1594 : 1595 else 1596 echo "configure: failed program was:" >&5 1597 cat conftest.$ac_ext >&5 1598 rm -fr conftest* 1599 ac_cv_header_stdc=no 1600 fi 1601 rm -fr conftest* 1602 fi 1603 1604 fi 1605 fi 1606 1607 echo "$ac_t""$ac_cv_header_stdc" 1>&6 1608 if test $ac_cv_header_stdc = yes; then 1609 cat >> confdefs.h <<\EOF 1610 #define STDC_HEADERS 1 1611 EOF 1612 1613 fi 1614 1615 echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6 1616 echo "configure:1617: checking for uintptr_t" >&5 1617 if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then 1618 echo $ac_n "(cached) $ac_c" 1>&6 1619 else 1620 cat > conftest.$ac_ext <<EOF 1621 #line 1622 "configure" 1622 #include "confdefs.h" 1623 #include <sys/types.h> 1624 #if STDC_HEADERS 1625 #include <stdlib.h> 1626 #include <stddef.h> 1627 #endif 1628 EOF 1629 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 1630 egrep "(^|[^a-zA-Z_0-9])uintptr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then 1631 rm -rf conftest* 1632 ac_cv_type_uintptr_t=yes 1633 else 1634 rm -rf conftest* 1635 ac_cv_type_uintptr_t=no 1636 fi 1637 rm -f conftest* 1638 1639 fi 1640 echo "$ac_t""$ac_cv_type_uintptr_t" 1>&6 1641 if test $ac_cv_type_uintptr_t = no; then 1642 cat >> confdefs.h <<\EOF 1643 #define uintptr_t unsigned long 1644 EOF 1645 1646 fi 1647 1648 # Given the above check, we always have uintptr_t or a fallback 1649 # definition. So define HAVE_UINTPTR_T in case any imported code 1650 # relies on it. 1651 cat >> confdefs.h <<\EOF 1652 #define HAVE_UINTPTR_T 1 1653 EOF 1654 1655 1656 echo $ac_n "checking for pid_t""... $ac_c" 1>&6 1657 echo "configure:1658: checking for pid_t" >&5 1658 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then 1659 echo $ac_n "(cached) $ac_c" 1>&6 1660 else 1661 cat > conftest.$ac_ext <<EOF 1662 #line 1663 "configure" 1663 #include "confdefs.h" 1664 #include <sys/types.h> 1665 #if STDC_HEADERS 1666 #include <stdlib.h> 1667 #include <stddef.h> 1668 #endif 1669 EOF 1670 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 1671 egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then 1672 rm -rf conftest* 1673 ac_cv_type_pid_t=yes 1674 else 1675 rm -rf conftest* 1676 ac_cv_type_pid_t=no 1677 fi 1678 rm -f conftest* 1679 1680 fi 1681 echo "$ac_t""$ac_cv_type_pid_t" 1>&6 1682 if test $ac_cv_type_pid_t = no; then 1683 cat >> confdefs.h <<\EOF 1684 #define pid_t int 1315 1685 EOF 1316 1686 … … 1330 1700 funcs="$funcs calloc" 1331 1701 funcs="$funcs clock" 1702 funcs="$funcs ffs" 1332 1703 funcs="$funcs getcwd" 1333 1704 funcs="$funcs getpagesize" … … 1338 1709 funcs="$funcs memcpy" 1339 1710 funcs="$funcs memmove" 1711 funcs="$funcs mempcpy" 1340 1712 funcs="$funcs memset" 1341 1713 funcs="$funcs mkstemps" … … 1345 1717 funcs="$funcs rindex" 1346 1718 funcs="$funcs setenv" 1719 funcs="$funcs snprintf" 1347 1720 funcs="$funcs sigsetmask" 1721 funcs="$funcs stpcpy" 1722 funcs="$funcs stpncpy" 1348 1723 funcs="$funcs strcasecmp" 1349 1724 funcs="$funcs strchr" … … 1359 1734 funcs="$funcs vfprintf" 1360 1735 funcs="$funcs vprintf" 1736 funcs="$funcs vsnprintf" 1361 1737 funcs="$funcs vsprintf" 1362 1738 funcs="$funcs waitpid" … … 1364 1740 # Also in the old function.def file: alloca, vfork, getopt. 1365 1741 1366 vars="sys_errlist sys_nerr sys_siglist "1742 vars="sys_errlist sys_nerr sys_siglist _system_configuration" 1367 1743 1368 1744 checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" 1745 checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp" 1746 checkfuncs="$checkfuncs getsysinfo table sysctl" 1369 1747 1370 1748 # These are neither executed nor required, but they help keep … … 1374 1752 do 1375 1753 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 1376 echo "configure:1 377: checking for $ac_func" >&51754 echo "configure:1755: checking for $ac_func" >&5 1377 1755 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 1378 1756 echo $ac_n "(cached) $ac_c" 1>&6 1379 1757 else 1380 1758 cat > conftest.$ac_ext <<EOF 1381 #line 1 382"configure"1759 #line 1760 "configure" 1382 1760 #include "confdefs.h" 1383 1761 /* System header to define __stub macros and hopefully few prototypes, … … 1402 1780 ; return 0; } 1403 1781 EOF 1404 if { (eval echo configure:1 405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then1782 if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1405 1783 rm -rf conftest* 1406 1784 eval "ac_cv_func_$ac_func=yes" … … 1429 1807 do 1430 1808 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 1431 echo "configure:1 432: checking for $ac_func" >&51809 echo "configure:1810: checking for $ac_func" >&5 1432 1810 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 1433 1811 echo $ac_n "(cached) $ac_c" 1>&6 1434 1812 else 1435 1813 cat > conftest.$ac_ext <<EOF 1436 #line 1 437"configure"1814 #line 1815 "configure" 1437 1815 #include "confdefs.h" 1438 1816 /* System header to define __stub macros and hopefully few prototypes, … … 1457 1835 ; return 0; } 1458 1836 EOF 1459 if { (eval echo configure:1 460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then1837 if { (eval echo configure:1838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1460 1838 rm -rf conftest* 1461 1839 eval "ac_cv_func_$ac_func=yes" … … 1481 1859 done 1482 1860 1483 for ac_func in memmove mem set putenv random rename rindex sigsetmask1861 for ac_func in memmove mempcpy memset putenv random rename rindex sigsetmask 1484 1862 do 1485 1863 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 1486 echo "configure:1 487: checking for $ac_func" >&51864 echo "configure:1865: checking for $ac_func" >&5 1487 1865 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 1488 1866 echo $ac_n "(cached) $ac_c" 1>&6 1489 1867 else 1490 1868 cat > conftest.$ac_ext <<EOF 1491 #line 1 492"configure"1869 #line 1870 "configure" 1492 1870 #include "confdefs.h" 1493 1871 /* System header to define __stub macros and hopefully few prototypes, … … 1512 1890 ; return 0; } 1513 1891 EOF 1514 if { (eval echo configure:1 515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then1892 if { (eval echo configure:1893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1515 1893 rm -rf conftest* 1516 1894 eval "ac_cv_func_$ac_func=yes" … … 1536 1914 done 1537 1915 1538 for ac_func in strcasecmp setenv st rchr strdup strncasecmp strrchr strstr1916 for ac_func in strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr 1539 1917 do 1540 1918 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 1541 echo "configure:1 542: checking for $ac_func" >&51919 echo "configure:1920: checking for $ac_func" >&5 1542 1920 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 1543 1921 echo $ac_n "(cached) $ac_c" 1>&6 1544 1922 else 1545 1923 cat > conftest.$ac_ext <<EOF 1546 #line 1 547"configure"1924 #line 1925 "configure" 1547 1925 #include "confdefs.h" 1548 1926 /* System header to define __stub macros and hopefully few prototypes, … … 1567 1945 ; return 0; } 1568 1946 EOF 1569 if { (eval echo configure:1 570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then1947 if { (eval echo configure:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1570 1948 rm -rf conftest* 1571 1949 eval "ac_cv_func_$ac_func=yes" … … 1594 1972 do 1595 1973 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 1596 echo "configure:1 597: checking for $ac_func" >&51974 echo "configure:1975: checking for $ac_func" >&5 1597 1975 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 1598 1976 echo $ac_n "(cached) $ac_c" 1>&6 1599 1977 else 1600 1978 cat > conftest.$ac_ext <<EOF 1601 #line 1 602"configure"1979 #line 1980 "configure" 1602 1980 #include "confdefs.h" 1603 1981 /* System header to define __stub macros and hopefully few prototypes, … … 1622 2000 ; return 0; } 1623 2001 EOF 1624 if { (eval echo configure: 1625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2002 if { (eval echo configure:2003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1625 2003 rm -rf conftest* 1626 2004 eval "ac_cv_func_$ac_func=yes" … … 1649 2027 do 1650 2028 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 1651 echo "configure: 1652: checking for $ac_func" >&52029 echo "configure:2030: checking for $ac_func" >&5 1652 2030 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 1653 2031 echo $ac_n "(cached) $ac_c" 1>&6 1654 2032 else 1655 2033 cat > conftest.$ac_ext <<EOF 1656 #line 1657"configure"2034 #line 2035 "configure" 1657 2035 #include "confdefs.h" 1658 2036 /* System header to define __stub macros and hopefully few prototypes, … … 1677 2055 ; return 0; } 1678 2056 EOF 1679 if { (eval echo configure: 1680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2057 if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1680 2058 rm -rf conftest* 1681 2059 eval "ac_cv_func_$ac_func=yes" … … 1701 2079 done 1702 2080 1703 for ac_func in sysconf times sbrk gettimeofday 2081 for ac_func in sysconf times sbrk gettimeofday ffs snprintf vsnprintf 1704 2082 do 1705 2083 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 1706 echo "configure: 1707: checking for $ac_func" >&52084 echo "configure:2085: checking for $ac_func" >&5 1707 2085 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 1708 2086 echo $ac_n "(cached) $ac_c" 1>&6 1709 2087 else 1710 2088 cat > conftest.$ac_ext <<EOF 1711 #line 1712"configure"2089 #line 2090 "configure" 1712 2090 #include "confdefs.h" 1713 2091 /* System header to define __stub macros and hopefully few prototypes, … … 1732 2110 ; return 0; } 1733 2111 EOF 1734 if { (eval echo configure: 1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2112 if { (eval echo configure:2113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1735 2113 rm -rf conftest* 1736 2114 eval "ac_cv_func_$ac_func=yes" … … 1756 2134 done 1757 2135 2136 for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl 2137 do 2138 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 2139 echo "configure:2140: checking for $ac_func" >&5 2140 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 2141 echo $ac_n "(cached) $ac_c" 1>&6 2142 else 2143 cat > conftest.$ac_ext <<EOF 2144 #line 2145 "configure" 2145 #include "confdefs.h" 2146 /* System header to define __stub macros and hopefully few prototypes, 2147 which can conflict with char $ac_func(); below. */ 2148 #include <assert.h> 2149 /* Override any gcc2 internal prototype to avoid an error. */ 2150 /* We use char because int might match the return type of a gcc2 2151 builtin and then its argument prototype would still apply. */ 2152 char $ac_func(); 2153 2154 int main() { 2155 2156 /* The GNU C library defines this for functions which it implements 2157 to always fail with ENOSYS. Some functions are actually named 2158 something starting with __ and the normal name is an alias. */ 2159 #if defined (__stub_$ac_func) || defined (__stub___$ac_func) 2160 choke me 2161 #else 2162 $ac_func(); 2163 #endif 2164 2165 ; return 0; } 2166 EOF 2167 if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2168 rm -rf conftest* 2169 eval "ac_cv_func_$ac_func=yes" 2170 else 2171 echo "configure: failed program was:" >&5 2172 cat conftest.$ac_ext >&5 2173 rm -rf conftest* 2174 eval "ac_cv_func_$ac_func=no" 2175 fi 2176 rm -f conftest* 2177 fi 2178 2179 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then 2180 echo "$ac_t""yes" 1>&6 2181 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` 2182 cat >> confdefs.h <<EOF 2183 #define $ac_tr_func 1 2184 EOF 2185 2186 else 2187 echo "$ac_t""no" 1>&6 2188 fi 2189 done 2190 2191 for ac_func in realpath canonicalize_file_name 2192 do 2193 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 2194 echo "configure:2195: checking for $ac_func" >&5 2195 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 2196 echo $ac_n "(cached) $ac_c" 1>&6 2197 else 2198 cat > conftest.$ac_ext <<EOF 2199 #line 2200 "configure" 2200 #include "confdefs.h" 2201 /* System header to define __stub macros and hopefully few prototypes, 2202 which can conflict with char $ac_func(); below. */ 2203 #include <assert.h> 2204 /* Override any gcc2 internal prototype to avoid an error. */ 2205 /* We use char because int might match the return type of a gcc2 2206 builtin and then its argument prototype would still apply. */ 2207 char $ac_func(); 2208 2209 int main() { 2210 2211 /* The GNU C library defines this for functions which it implements 2212 to always fail with ENOSYS. Some functions are actually named 2213 something starting with __ and the normal name is an alias. */ 2214 #if defined (__stub_$ac_func) || defined (__stub___$ac_func) 2215 choke me 2216 #else 2217 $ac_func(); 2218 #endif 2219 2220 ; return 0; } 2221 EOF 2222 if { (eval echo configure:2223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2223 rm -rf conftest* 2224 eval "ac_cv_func_$ac_func=yes" 2225 else 2226 echo "configure: failed program was:" >&5 2227 cat conftest.$ac_ext >&5 2228 rm -rf conftest* 2229 eval "ac_cv_func_$ac_func=no" 2230 fi 2231 rm -f conftest* 2232 fi 2233 2234 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then 2235 echo "$ac_t""yes" 1>&6 2236 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` 2237 cat >> confdefs.h <<EOF 2238 #define $ac_tr_func 1 2239 EOF 2240 2241 else 2242 echo "$ac_t""no" 1>&6 2243 fi 2244 done 2245 1758 2246 cat >> confdefs.h <<\EOF 1759 2247 #define HAVE_SYS_ERRLIST 1 … … 1768 2256 EOF 1769 2257 2258 cat >> confdefs.h <<\EOF 2259 #define HAVE__SYSTEM_CONFIGURATION 1 2260 EOF 2261 1770 2262 fi 1771 2263 1772 2264 # For each of these functions, if the host does not provide the 1773 2265 # function we want to put FN.o in LIBOBJS, and if the host does 1774 # provide the function, we want to define HAVE_FN in config.h. Also, 1775 # if the host does not provide alloca, we set ALLOCA to alloca.o 2266 # provide the function, we want to define HAVE_FN in config.h. 1776 2267 1777 2268 setobjs= 1778 2269 CHECK= 2270 target_header_dir= 1779 2271 if test -n "${with_target_subdir}"; then 1780 2272 … … 1788 2280 1789 2281 if test "x${with_newlib}" = "xyes"; then 1790 ALLOCA="alloca.o"1791 2282 LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o" 1792 2283 … … 1818 2309 fi 1819 2310 2311 # We may wish to install the target headers somewhere. 2312 # Check whether --enable-install-libiberty or --disable-install-libiberty was given. 2313 if test "${enable_install_libiberty+set}" = set; then 2314 enableval="$enable_install_libiberty" 2315 enable_install_libiberty=$enableval 2316 else 2317 enable_install_libiberty=no 2318 fi 2319 2320 # Option parsed, now set things appropriately. 2321 case x"$enable_install_libiberty" in 2322 xyes|x) 2323 target_header_dir=libiberty 2324 ;; 2325 xno) 2326 target_header_dir= 2327 ;; 2328 *) 2329 # This could be sanity-checked in various ways... 2330 target_header_dir="${enable_install_libiberty}" 2331 ;; 2332 esac 2333 2334 1820 2335 else 1821 2336 … … 1826 2341 1827 2342 2343 2344 2345 case "${host}" in 2346 *-*-cygwin* | *-*-mingw*) 2347 cat >> confdefs.h <<\EOF 2348 #define HAVE_SYS_ERRLIST 1 2349 EOF 2350 2351 cat >> confdefs.h <<\EOF 2352 #define HAVE_SYS_NERR 1 2353 EOF 2354 2355 ;; 2356 esac 1828 2357 1829 2358 if test -z "${setobjs}"; then … … 1913 2442 ;; 1914 2443 2444 *-*-*vms*) 2445 # Under VMS, vfork works very different than on Unix. The standard test 2446 # won't work, and it isn't easily adaptable. It makes more sense to 2447 # just force it. 2448 ac_cv_func_vfork_works=yes 2449 ;; 2450 1915 2451 esac 1916 2452 … … 1918 2454 # tests. This will only work if the compiler works. 1919 2455 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 1920 echo "configure: 1921: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&52456 echo "configure:2457: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 1921 2457 1922 2458 ac_ext=c … … 1929 2465 cat > conftest.$ac_ext << EOF 1930 2466 1931 #line 1932"configure"2467 #line 2468 "configure" 1932 2468 #include "confdefs.h" 1933 2469 1934 2470 main(){return(0);} 1935 2471 EOF 1936 if { (eval echo configure: 1937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2472 if { (eval echo configure:2473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1937 2473 ac_cv_prog_cc_works=yes 1938 2474 # If we can't run a trivial program, we are probably using a cross compiler. … … 1960 2496 fi 1961 2497 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 1962 echo "configure: 1963: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&52498 echo "configure:2499: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 1963 2499 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 1964 2500 cross_compiling=$ac_cv_prog_cc_cross … … 1967 2503 do 1968 2504 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 1969 echo "configure: 1970: checking for $ac_func" >&52505 echo "configure:2506: checking for $ac_func" >&5 1970 2506 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 1971 2507 echo $ac_n "(cached) $ac_c" 1>&6 1972 2508 else 1973 2509 cat > conftest.$ac_ext <<EOF 1974 #line 1975"configure"2510 #line 2511 "configure" 1975 2511 #include "confdefs.h" 1976 2512 /* System header to define __stub macros and hopefully few prototypes, … … 1995 2531 ; return 0; } 1996 2532 EOF 1997 if { (eval echo configure: 1998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2533 if { (eval echo configure:2534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1998 2534 rm -rf conftest* 1999 2535 eval "ac_cv_func_$ac_func=yes" … … 2021 2557 2022 2558 2023 2024 case "${host}" in 2025 *-*-interix) 2026 # On Interix, it wrongly concludes that the MSVC compiler supports alloca. 2027 # (MSVC does on Win32, not on Interix.) 2028 # This should be temporary. 2029 2030 ac_cv_header_alloca_h=no 2031 ac_cv_func_alloca_works=no 2032 ALLOCA=alloca.o 2033 cat >> confdefs.h <<\EOF 2034 #define C_ALLOCA 1 2035 EOF 2036 cat >> confdefs.h <<EOF 2037 #define STACK_DIRECTION -1 2038 EOF 2039 ;; 2040 *) 2041 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works 2042 # for constant arguments. Useless! 2043 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 2044 echo "configure:2045: checking for working alloca.h" >&5 2045 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then 2559 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 2560 echo "configure:2561: checking whether alloca needs Cray hooks" >&5 2561 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then 2046 2562 echo $ac_n "(cached) $ac_c" 1>&6 2047 2563 else 2048 2564 cat > conftest.$ac_ext <<EOF 2049 #line 2050 "configure" 2050 #include "confdefs.h" 2051 #include <alloca.h> 2052 int main() { 2053 char *p = alloca(2 * sizeof(int)); 2054 ; return 0; } 2055 EOF 2056 if { (eval echo configure:2057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2057 rm -rf conftest* 2058 ac_cv_header_alloca_h=yes 2059 else 2060 echo "configure: failed program was:" >&5 2061 cat conftest.$ac_ext >&5 2062 rm -rf conftest* 2063 ac_cv_header_alloca_h=no 2064 fi 2065 rm -f conftest* 2066 fi 2067 2068 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 2069 if test $ac_cv_header_alloca_h = yes; then 2070 cat >> confdefs.h <<\EOF 2071 #define HAVE_ALLOCA_H 1 2072 EOF 2073 2074 fi 2075 2076 echo $ac_n "checking for alloca""... $ac_c" 1>&6 2077 echo "configure:2078: checking for alloca" >&5 2078 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then 2079 echo $ac_n "(cached) $ac_c" 1>&6 2080 else 2081 cat > conftest.$ac_ext <<EOF 2082 #line 2083 "configure" 2083 #include "confdefs.h" 2084 2085 #ifdef __GNUC__ 2086 # define alloca __builtin_alloca 2087 #else 2088 # ifdef _MSC_VER 2089 # include <malloc.h> 2090 # define alloca _alloca 2091 # else 2092 # if HAVE_ALLOCA_H 2093 # include <alloca.h> 2094 # else 2095 # ifdef _AIX 2096 #pragma alloca 2097 # else 2098 # ifndef alloca /* predefined by HP cc +Olibcalls */ 2099 char *alloca (); 2100 # endif 2101 # endif 2102 # endif 2103 # endif 2104 #endif 2105 2106 int main() { 2107 char *p = (char *) alloca(1); 2108 ; return 0; } 2109 EOF 2110 if { (eval echo configure:2111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2111 rm -rf conftest* 2112 ac_cv_func_alloca_works=yes 2113 else 2114 echo "configure: failed program was:" >&5 2115 cat conftest.$ac_ext >&5 2116 rm -rf conftest* 2117 ac_cv_func_alloca_works=no 2118 fi 2119 rm -f conftest* 2120 fi 2121 2122 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 2123 if test $ac_cv_func_alloca_works = yes; then 2124 cat >> confdefs.h <<\EOF 2125 #define HAVE_ALLOCA 1 2126 EOF 2127 2128 fi 2129 2130 if test $ac_cv_func_alloca_works = no; then 2131 # The SVR3 libPW and SVR4 libucb both contain incompatible functions 2132 # that cause trouble. Some versions do not even contain alloca or 2133 # contain a buggy version. If you still want to use their alloca, 2134 # use ar to extract alloca.o from them instead of compiling alloca.c. 2135 ALLOCA=alloca.${ac_objext} 2136 cat >> confdefs.h <<\EOF 2137 #define C_ALLOCA 1 2138 EOF 2139 2140 2141 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 2142 echo "configure:2143: checking whether alloca needs Cray hooks" >&5 2143 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then 2144 echo $ac_n "(cached) $ac_c" 1>&6 2145 else 2146 cat > conftest.$ac_ext <<EOF 2147 #line 2148 "configure" 2565 #line 2566 "configure" 2148 2566 #include "confdefs.h" 2149 2567 #if defined(CRAY) && ! defined(CRAY2) … … 2168 2586 echo "$ac_t""$ac_cv_os_cray" 1>&6 2169 2587 if test $ac_cv_os_cray = yes; then 2170 for ac_func in _getb67 GETB67 getb67; do2171 echo $ac_n "checking for $ac_func""... $ac_c" 1>&62172 echo "configure:2 173: checking for $ac_func" >&52588 for ac_func in _getb67 GETB67 getb67; do 2589 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 2590 echo "configure:2591: checking for $ac_func" >&5 2173 2591 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 2174 2592 echo $ac_n "(cached) $ac_c" 1>&6 2175 2593 else 2176 2594 cat > conftest.$ac_ext <<EOF 2177 #line 2 178"configure"2595 #line 2596 "configure" 2178 2596 #include "confdefs.h" 2179 2597 /* System header to define __stub macros and hopefully few prototypes, … … 2198 2616 ; return 0; } 2199 2617 EOF 2200 if { (eval echo configure:2 201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2618 if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2201 2619 rm -rf conftest* 2202 2620 eval "ac_cv_func_$ac_func=yes" … … 2215 2633 #define CRAY_STACKSEG_END $ac_func 2216 2634 EOF 2217 2218 2635 break 2219 2636 else … … 2221 2638 fi 2222 2639 2223 done2640 done 2224 2641 fi 2225 2642 2226 2643 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 2227 echo "configure:2 228: checking stack direction for C alloca" >&52644 echo "configure:2645: checking stack direction for C alloca" >&5 2228 2645 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then 2229 2646 echo $ac_n "(cached) $ac_c" 1>&6 … … 2233 2650 else 2234 2651 cat > conftest.$ac_ext <<EOF 2235 #line 2 236"configure"2652 #line 2653 "configure" 2236 2653 #include "confdefs.h" 2237 2654 find_stack_direction () … … 2252 2669 } 2253 2670 EOF 2254 if { (eval echo configure:2 255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null2671 if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 2255 2672 then 2256 2673 ac_cv_c_stack_direction=1 … … 2271 2688 EOF 2272 2689 2273 fi 2274 2275 ;; 2276 esac 2277 2278 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 2279 echo "configure:2280: checking for ANSI C header files" >&5 2280 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then 2690 2691 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` 2692 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 2693 echo "configure:2694: checking for vfork.h" >&5 2694 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 2281 2695 echo $ac_n "(cached) $ac_c" 1>&6 2282 2696 else 2283 2697 cat > conftest.$ac_ext <<EOF 2284 #line 2285 "configure" 2285 #include "confdefs.h" 2286 #include <stdlib.h> 2287 #include <stdarg.h> 2288 #include <string.h> 2289 #include <float.h> 2698 #line 2699 "configure" 2699 #include "confdefs.h" 2700 #include <vfork.h> 2290 2701 EOF 2291 2702 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 2292 { (eval echo configure:2293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 2293 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 2294 if test -z "$ac_err"; then 2295 rm -rf conftest* 2296 ac_cv_header_stdc=yes 2297 else 2298 echo "$ac_err" >&5 2299 echo "configure: failed program was:" >&5 2300 cat conftest.$ac_ext >&5 2301 rm -rf conftest* 2302 ac_cv_header_stdc=no 2303 fi 2304 rm -f conftest* 2305 2306 if test $ac_cv_header_stdc = yes; then 2307 # SunOS 4.x string.h does not declare mem*, contrary to ANSI. 2308 cat > conftest.$ac_ext <<EOF 2309 #line 2310 "configure" 2310 #include "confdefs.h" 2311 #include <string.h> 2312 EOF 2313 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 2314 egrep "memchr" >/dev/null 2>&1; then 2315 : 2316 else 2317 rm -rf conftest* 2318 ac_cv_header_stdc=no 2319 fi 2320 rm -f conftest* 2321 2322 fi 2323 2324 if test $ac_cv_header_stdc = yes; then 2325 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. 2326 cat > conftest.$ac_ext <<EOF 2327 #line 2328 "configure" 2328 #include "confdefs.h" 2329 #include <stdlib.h> 2330 EOF 2331 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 2332 egrep "free" >/dev/null 2>&1; then 2333 : 2334 else 2335 rm -rf conftest* 2336 ac_cv_header_stdc=no 2337 fi 2338 rm -f conftest* 2339 2340 fi 2341 2342 if test $ac_cv_header_stdc = yes; then 2343 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. 2344 if test "$cross_compiling" = yes; then 2345 : 2346 else 2347 cat > conftest.$ac_ext <<EOF 2348 #line 2349 "configure" 2349 #include "confdefs.h" 2350 #include <ctype.h> 2351 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') 2352 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) 2353 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) 2354 int main () { int i; for (i = 0; i < 256; i++) 2355 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); 2356 exit (0); } 2357 2358 EOF 2359 if { (eval echo configure:2360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 2360 then 2361 : 2362 else 2363 echo "configure: failed program was:" >&5 2364 cat conftest.$ac_ext >&5 2365 rm -fr conftest* 2366 ac_cv_header_stdc=no 2367 fi 2368 rm -fr conftest* 2369 fi 2370 2371 fi 2372 fi 2373 2374 echo "$ac_t""$ac_cv_header_stdc" 1>&6 2375 if test $ac_cv_header_stdc = yes; then 2376 cat >> confdefs.h <<\EOF 2377 #define STDC_HEADERS 1 2378 EOF 2379 2380 fi 2381 2382 echo $ac_n "checking for pid_t""... $ac_c" 1>&6 2383 echo "configure:2384: checking for pid_t" >&5 2384 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then 2385 echo $ac_n "(cached) $ac_c" 1>&6 2386 else 2387 cat > conftest.$ac_ext <<EOF 2388 #line 2389 "configure" 2389 #include "confdefs.h" 2390 #include <sys/types.h> 2391 #if STDC_HEADERS 2392 #include <stdlib.h> 2393 #include <stddef.h> 2394 #endif 2395 EOF 2396 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 2397 egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then 2398 rm -rf conftest* 2399 ac_cv_type_pid_t=yes 2400 else 2401 rm -rf conftest* 2402 ac_cv_type_pid_t=no 2403 fi 2404 rm -f conftest* 2405 2406 fi 2407 echo "$ac_t""$ac_cv_type_pid_t" 1>&6 2408 if test $ac_cv_type_pid_t = no; then 2409 cat >> confdefs.h <<\EOF 2410 #define pid_t int 2411 EOF 2412 2413 fi 2414 2415 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` 2416 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 2417 echo "configure:2418: checking for vfork.h" >&5 2418 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 2419 echo $ac_n "(cached) $ac_c" 1>&6 2420 else 2421 cat > conftest.$ac_ext <<EOF 2422 #line 2423 "configure" 2423 #include "confdefs.h" 2424 #include <vfork.h> 2425 EOF 2426 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 2427 { (eval echo configure:2428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 2703 { (eval echo configure:2704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 2428 2704 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 2429 2705 if test -z "$ac_err"; then … … 2450 2726 2451 2727 echo $ac_n "checking for working vfork""... $ac_c" 1>&6 2452 echo "configure:2 453: checking for working vfork" >&52728 echo "configure:2729: checking for working vfork" >&5 2453 2729 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then 2454 2730 echo $ac_n "(cached) $ac_c" 1>&6 … … 2456 2732 if test "$cross_compiling" = yes; then 2457 2733 echo $ac_n "checking for vfork""... $ac_c" 1>&6 2458 echo "configure:2 459: checking for vfork" >&52734 echo "configure:2735: checking for vfork" >&5 2459 2735 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then 2460 2736 echo $ac_n "(cached) $ac_c" 1>&6 2461 2737 else 2462 2738 cat > conftest.$ac_ext <<EOF 2463 #line 2 464"configure"2739 #line 2740 "configure" 2464 2740 #include "confdefs.h" 2465 2741 /* System header to define __stub macros and hopefully few prototypes, … … 2484 2760 ; return 0; } 2485 2761 EOF 2486 if { (eval echo configure:2 487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2762 if { (eval echo configure:2763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2487 2763 rm -rf conftest* 2488 2764 eval "ac_cv_func_vfork=yes" … … 2506 2782 else 2507 2783 cat > conftest.$ac_ext <<EOF 2508 #line 2 509"configure"2784 #line 2785 "configure" 2509 2785 #include "confdefs.h" 2510 2786 /* Thanks to Paul Eggert for this test. */ … … 2601 2877 } 2602 2878 EOF 2603 if { (eval echo configure:2 604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null2879 if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 2604 2880 then 2605 2881 ac_cv_func_vfork_works=yes … … 2626 2902 LIBOBJS="$LIBOBJS vfork.o" 2627 2903 fi 2628 for v in $vars; do 2629 echo $ac_n "checking for $v""... $ac_c" 1>&6 2630 echo "configure:2631: checking for $v" >&5 2631 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then 2632 echo $ac_n "(cached) $ac_c" 1>&6 2633 else 2634 cat > conftest.$ac_ext <<EOF 2635 #line 2636 "configure" 2636 #include "confdefs.h" 2637 int *p; 2638 int main() { 2639 extern int $v; p = &$v; 2640 ; return 0; } 2641 EOF 2642 if { (eval echo configure:2643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2643 rm -rf conftest* 2644 eval "libiberty_cv_var_$v=yes" 2645 else 2646 echo "configure: failed program was:" >&5 2647 cat conftest.$ac_ext >&5 2648 rm -rf conftest* 2649 eval "libiberty_cv_var_$v=no" 2650 fi 2651 rm -f conftest* 2652 fi 2653 2654 if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then 2655 echo "$ac_t""yes" 1>&6 2656 n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` 2657 cat >> confdefs.h <<EOF 2658 #define $n 1 2659 EOF 2660 2661 else 2662 echo "$ac_t""no" 1>&6 2663 fi 2664 done 2665 for ac_func in $checkfuncs 2904 # We only need _doprnt if we might use it to implement v*printf. 2905 if test $ac_cv_func_vprintf != yes \ 2906 || test $ac_cv_func_vfprintf != yes \ 2907 || test $ac_cv_func_vsprintf != yes; then 2908 for ac_func in _doprnt 2666 2909 do 2667 2910 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 2668 echo "configure:2 669: checking for $ac_func" >&52911 echo "configure:2912: checking for $ac_func" >&5 2669 2912 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 2670 2913 echo $ac_n "(cached) $ac_c" 1>&6 2671 2914 else 2672 2915 cat > conftest.$ac_ext <<EOF 2673 #line 2 674"configure"2916 #line 2917 "configure" 2674 2917 #include "confdefs.h" 2675 2918 /* System header to define __stub macros and hopefully few prototypes, … … 2694 2937 ; return 0; } 2695 2938 EOF 2696 if { (eval echo configure:2 697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2939 if { (eval echo configure:2940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2697 2940 rm -rf conftest* 2698 2941 eval "ac_cv_func_$ac_func=yes" … … 2715 2958 else 2716 2959 echo "$ac_t""no" 1>&6 2960 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" 2717 2961 fi 2718 2962 done 2719 2963 2720 fi 2721 2722 for ac_hdr in unistd.h 2723 do 2724 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 2725 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 2726 echo "configure:2727: checking for $ac_hdr" >&5 2727 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 2728 echo $ac_n "(cached) $ac_c" 1>&6 2729 else 2730 cat > conftest.$ac_ext <<EOF 2731 #line 2732 "configure" 2732 #include "confdefs.h" 2733 #include <$ac_hdr> 2734 EOF 2735 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 2736 { (eval echo configure:2737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 2737 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 2738 if test -z "$ac_err"; then 2739 rm -rf conftest* 2740 eval "ac_cv_header_$ac_safe=yes" 2741 else 2742 echo "$ac_err" >&5 2743 echo "configure: failed program was:" >&5 2744 cat conftest.$ac_ext >&5 2745 rm -rf conftest* 2746 eval "ac_cv_header_$ac_safe=no" 2747 fi 2748 rm -f conftest* 2749 fi 2750 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 2751 echo "$ac_t""yes" 1>&6 2752 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` 2753 cat >> confdefs.h <<EOF 2754 #define $ac_tr_hdr 1 2755 EOF 2756 2757 else 2758 echo "$ac_t""no" 1>&6 2759 fi 2760 done 2761 2762 for ac_func in getpagesize 2964 2965 else 2966 for ac_func in _doprnt 2763 2967 do 2764 2968 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 2765 echo "configure:2 766: checking for $ac_func" >&52969 echo "configure:2970: checking for $ac_func" >&5 2766 2970 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 2767 2971 echo $ac_n "(cached) $ac_c" 1>&6 2768 2972 else 2769 2973 cat > conftest.$ac_ext <<EOF 2770 #line 2 771"configure"2974 #line 2975 "configure" 2771 2975 #include "confdefs.h" 2772 2976 /* System header to define __stub macros and hopefully few prototypes, … … 2791 2995 ; return 0; } 2792 2996 EOF 2793 if { (eval echo configure:2 794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then2997 if { (eval echo configure:2998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2794 2998 rm -rf conftest* 2795 2999 eval "ac_cv_func_$ac_func=yes" … … 2815 3019 done 2816 3020 3021 fi 3022 3023 for v in $vars; do 3024 echo $ac_n "checking for $v""... $ac_c" 1>&6 3025 echo "configure:3026: checking for $v" >&5 3026 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then 3027 echo $ac_n "(cached) $ac_c" 1>&6 3028 else 3029 cat > conftest.$ac_ext <<EOF 3030 #line 3031 "configure" 3031 #include "confdefs.h" 3032 int *p; 3033 int main() { 3034 extern int $v []; p = $v; 3035 ; return 0; } 3036 EOF 3037 if { (eval echo configure:3038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 3038 rm -rf conftest* 3039 eval "libiberty_cv_var_$v=yes" 3040 else 3041 echo "configure: failed program was:" >&5 3042 cat conftest.$ac_ext >&5 3043 rm -rf conftest* 3044 eval "libiberty_cv_var_$v=no" 3045 fi 3046 rm -f conftest* 3047 fi 3048 3049 if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then 3050 echo "$ac_t""yes" 1>&6 3051 n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` 3052 cat >> confdefs.h <<EOF 3053 #define $n 1 3054 EOF 3055 3056 else 3057 echo "$ac_t""no" 1>&6 3058 fi 3059 done 3060 for ac_func in $checkfuncs 3061 do 3062 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 3063 echo "configure:3064: checking for $ac_func" >&5 3064 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 3065 echo $ac_n "(cached) $ac_c" 1>&6 3066 else 3067 cat > conftest.$ac_ext <<EOF 3068 #line 3069 "configure" 3069 #include "confdefs.h" 3070 /* System header to define __stub macros and hopefully few prototypes, 3071 which can conflict with char $ac_func(); below. */ 3072 #include <assert.h> 3073 /* Override any gcc2 internal prototype to avoid an error. */ 3074 /* We use char because int might match the return type of a gcc2 3075 builtin and then its argument prototype would still apply. */ 3076 char $ac_func(); 3077 3078 int main() { 3079 3080 /* The GNU C library defines this for functions which it implements 3081 to always fail with ENOSYS. Some functions are actually named 3082 something starting with __ and the normal name is an alias. */ 3083 #if defined (__stub_$ac_func) || defined (__stub___$ac_func) 3084 choke me 3085 #else 3086 $ac_func(); 3087 #endif 3088 3089 ; return 0; } 3090 EOF 3091 if { (eval echo configure:3092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 3092 rm -rf conftest* 3093 eval "ac_cv_func_$ac_func=yes" 3094 else 3095 echo "configure: failed program was:" >&5 3096 cat conftest.$ac_ext >&5 3097 rm -rf conftest* 3098 eval "ac_cv_func_$ac_func=no" 3099 fi 3100 rm -f conftest* 3101 fi 3102 3103 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then 3104 echo "$ac_t""yes" 1>&6 3105 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` 3106 cat >> confdefs.h <<EOF 3107 #define $ac_tr_func 1 3108 EOF 3109 3110 else 3111 echo "$ac_t""no" 1>&6 3112 fi 3113 done 3114 3115 echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 3116 echo "configure:3117: checking whether canonicalize_file_name must be declared" >&5 3117 if eval "test \"`echo '$''{'libiberty_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then 3118 echo $ac_n "(cached) $ac_c" 1>&6 3119 else 3120 cat > conftest.$ac_ext <<EOF 3121 #line 3122 "configure" 3122 #include "confdefs.h" 3123 3124 #include "confdefs.h" 3125 #include <stdio.h> 3126 #ifdef HAVE_STRING_H 3127 #include <string.h> 3128 #else 3129 #ifdef HAVE_STRINGS_H 3130 #include <strings.h> 3131 #endif 3132 #endif 3133 #ifdef HAVE_STDLIB_H 3134 #include <stdlib.h> 3135 #endif 3136 #ifdef HAVE_UNISTD_H 3137 #include <unistd.h> 3138 #endif 3139 int main() { 3140 char *(*pfn) = (char *(*)) canonicalize_file_name 3141 ; return 0; } 3142 EOF 3143 if { (eval echo configure:3144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 3144 rm -rf conftest* 3145 libiberty_cv_decl_needed_canonicalize_file_name=no 3146 else 3147 echo "configure: failed program was:" >&5 3148 cat conftest.$ac_ext >&5 3149 rm -rf conftest* 3150 libiberty_cv_decl_needed_canonicalize_file_name=yes 3151 fi 3152 rm -f conftest* 3153 fi 3154 3155 echo "$ac_t""$libiberty_cv_decl_needed_canonicalize_file_name" 1>&6 3156 if test $libiberty_cv_decl_needed_canonicalize_file_name = yes; then 3157 cat >> confdefs.h <<\EOF 3158 #define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1 3159 EOF 3160 3161 fi 3162 3163 fi 3164 3165 # Figure out which version of pexecute to use. 3166 case "${host}" in 3167 *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;; 3168 *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;; 3169 *-*-msdos*) pexecute=pex-msdos.o ;; 3170 *-*-os2-emx*) pexecute=pex-os2.o ;; 3171 *) pexecute=pex-unix.o ;; 3172 esac 3173 3174 3175 for ac_hdr in unistd.h 3176 do 3177 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 3178 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 3179 echo "configure:3180: checking for $ac_hdr" >&5 3180 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 3181 echo $ac_n "(cached) $ac_c" 1>&6 3182 else 3183 cat > conftest.$ac_ext <<EOF 3184 #line 3185 "configure" 3185 #include "confdefs.h" 3186 #include <$ac_hdr> 3187 EOF 3188 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 3189 { (eval echo configure:3190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 3190 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 3191 if test -z "$ac_err"; then 3192 rm -rf conftest* 3193 eval "ac_cv_header_$ac_safe=yes" 3194 else 3195 echo "$ac_err" >&5 3196 echo "configure: failed program was:" >&5 3197 cat conftest.$ac_ext >&5 3198 rm -rf conftest* 3199 eval "ac_cv_header_$ac_safe=no" 3200 fi 3201 rm -f conftest* 3202 fi 3203 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 3204 echo "$ac_t""yes" 1>&6 3205 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` 3206 cat >> confdefs.h <<EOF 3207 #define $ac_tr_hdr 1 3208 EOF 3209 3210 else 3211 echo "$ac_t""no" 1>&6 3212 fi 3213 done 3214 3215 for ac_func in getpagesize 3216 do 3217 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 3218 echo "configure:3219: checking for $ac_func" >&5 3219 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 3220 echo $ac_n "(cached) $ac_c" 1>&6 3221 else 3222 cat > conftest.$ac_ext <<EOF 3223 #line 3224 "configure" 3224 #include "confdefs.h" 3225 /* System header to define __stub macros and hopefully few prototypes, 3226 which can conflict with char $ac_func(); below. */ 3227 #include <assert.h> 3228 /* Override any gcc2 internal prototype to avoid an error. */ 3229 /* We use char because int might match the return type of a gcc2 3230 builtin and then its argument prototype would still apply. */ 3231 char $ac_func(); 3232 3233 int main() { 3234 3235 /* The GNU C library defines this for functions which it implements 3236 to always fail with ENOSYS. Some functions are actually named 3237 something starting with __ and the normal name is an alias. */ 3238 #if defined (__stub_$ac_func) || defined (__stub___$ac_func) 3239 choke me 3240 #else 3241 $ac_func(); 3242 #endif 3243 3244 ; return 0; } 3245 EOF 3246 if { (eval echo configure:3247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 3247 rm -rf conftest* 3248 eval "ac_cv_func_$ac_func=yes" 3249 else 3250 echo "configure: failed program was:" >&5 3251 cat conftest.$ac_ext >&5 3252 rm -rf conftest* 3253 eval "ac_cv_func_$ac_func=no" 3254 fi 3255 rm -f conftest* 3256 fi 3257 3258 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then 3259 echo "$ac_t""yes" 1>&6 3260 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` 3261 cat >> confdefs.h <<EOF 3262 #define $ac_tr_func 1 3263 EOF 3264 3265 else 3266 echo "$ac_t""no" 1>&6 3267 fi 3268 done 3269 2817 3270 echo $ac_n "checking for working mmap""... $ac_c" 1>&6 2818 echo "configure: 2819: checking for working mmap" >&53271 echo "configure:3272: checking for working mmap" >&5 2819 3272 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then 2820 3273 echo $ac_n "(cached) $ac_c" 1>&6 … … 2824 3277 else 2825 3278 cat > conftest.$ac_ext <<EOF 2826 #line 2827"configure"3279 #line 3280 "configure" 2827 3280 #include "confdefs.h" 2828 3281 … … 2964 3417 2965 3418 EOF 2966 if { (eval echo configure: 2967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3419 if { (eval echo configure:3420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 2967 3420 then 2968 3421 ac_cv_func_mmap_fixed_mapped=yes … … 2988 3441 2989 3442 echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 2990 echo "configure: 2991: checking for working strncmp" >&53443 echo "configure:3444: checking for working strncmp" >&5 2991 3444 if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then 2992 3445 echo $ac_n "(cached) $ac_c" 1>&6 … … 2996 3449 else 2997 3450 cat > conftest.$ac_ext <<EOF 2998 #line 2999"configure"3451 #line 3452 "configure" 2999 3452 #include "confdefs.h" 3000 3453 … … 3041 3494 MAP_ANON|MAP_PRIVATE, dev_zero, 0); 3042 3495 if (p == (char *)-1) 3496 p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE, 3497 MAP_ANON|MAP_PRIVATE, -1, 0); 3498 if (p == (char *)-1) 3043 3499 exit (2); 3044 3500 else … … 3057 3513 3058 3514 EOF 3059 if { (eval echo configure:3 060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null3515 if { (eval echo configure:3516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 3060 3516 then 3061 3517 ac_cv_func_strncmp_works=yes … … 3221 3677 s%@infodir@%$infodir%g 3222 3678 s%@mandir@%$mandir%g 3679 s%@libiberty_topdir@%$libiberty_topdir%g 3680 s%@MAINT@%$MAINT%g 3681 s%@NOTMAINT@%$NOTMAINT%g 3682 s%@MAKEINFO@%$MAKEINFO%g 3683 s%@BUILD_INFO@%$BUILD_INFO%g 3684 s%@PERL@%$PERL%g 3685 s%@HAVE_PERL@%$HAVE_PERL%g 3223 3686 s%@host@%$host%g 3224 3687 s%@host_alias@%$host_alias%g … … 3235 3698 s%@CC@%$CC%g 3236 3699 s%@ac_libiberty_warn_cflags@%$ac_libiberty_warn_cflags%g 3700 s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g 3701 s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g 3237 3702 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g 3238 3703 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g … … 3242 3707 s%@CPP@%$CPP%g 3243 3708 s%@CHECK@%$CHECK%g 3709 s%@target_header_dir@%$target_header_dir%g 3244 3710 s%@LIBOBJS@%$LIBOBJS%g 3245 s%@ ALLOCA@%$ALLOCA%g3711 s%@pexecute@%$pexecute%g 3246 3712 s%@INSTALL_DEST@%$INSTALL_DEST%g 3247 3713 … … 3458 3924 target=${target} 3459 3925 with_target_subdir=${with_target_subdir} 3926 with_build_subdir=${with_build_subdir} 3460 3927 with_multisubdir=${with_multisubdir} 3461 3928 ac_configure_args="--enable-multilib ${ac_configure_args}" 3462 3929 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} 3930 ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" 3463 3931 libiberty_topdir=${libiberty_topdir} 3464 3932 … … 3467 3935 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h 3468 3936 if test -n "$CONFIG_FILES"; then 3469 if test -n "${with_ target_subdir}"; then3937 if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then 3470 3938 # FIXME: We shouldn't need to set ac_file 3471 3939 ac_file=Makefile 3940 LD="${ORIGINAL_LD_FOR_MULTILIBS}" 3472 3941 . ${libiberty_topdir}/config-ml.in 3473 3942 fi -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/configure.in
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 2 2 3 3 AC_PREREQ(2.13) 4 AC_INIT(pexecute.c) 4 AC_INIT(xmalloc.c) 5 6 # This works around the fact that libtool configuration may change LD 7 # for this particular configuration, but some shells, instead of 8 # keeping the changes in LD private, export them just because LD is 9 # exported. We don't use libtool yet, but some day we might, so... 10 ORIGINAL_LD_FOR_MULTILIBS=$LD 5 11 6 12 dnl We use these options to decide which functions to include. 7 13 AC_ARG_WITH(target-subdir, 8 [ --with-target-subdir=SUBDIR Configuring in a subdirectory]) 14 [ --with-target-subdir=SUBDIR Configuring in a subdirectory for target]) 15 AC_ARG_WITH(build-subdir, 16 [ --with-build-subdir=SUBDIR Configuring in a subdirectory for build]) 9 17 AC_ARG_WITH(cross-host, 10 18 [ --with-cross-host=HOST Configuring with a cross compiler]) … … 13 21 14 22 if test "${srcdir}" = "."; then 15 if test -z "${with_target_subdir}"; then 23 if test -n "${with_build_subdir}"; then 24 libiberty_topdir="${srcdir}/../.." 25 with_target_subdir= 26 elif test -z "${with_target_subdir}"; then 16 27 libiberty_topdir="${srcdir}/.." 17 28 else … … 25 36 libiberty_topdir="${srcdir}/.." 26 37 fi 38 AC_SUBST(libiberty_topdir) 27 39 AC_CONFIG_AUX_DIR($libiberty_topdir) 40 41 dnl Very limited version of automake's enable-maintainer-mode 42 43 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) 44 dnl maintainer-mode is disabled by default 45 AC_ARG_ENABLE(maintainer-mode, 46 [ --enable-maintainer-mode 47 enable make rules and dependencies not useful 48 (and sometimes confusing) to the casual installer], 49 maintainer_mode=$enableval, 50 maintainer_mode=no) 51 52 AC_MSG_RESULT($maintainer_mode) 53 54 if test "$maintainer_mode" = "yes"; then 55 MAINT='' 56 NOTMAINT='#' 57 else 58 MAINT='#' 59 NOTMAINT='' 60 fi 61 AC_SUBST(MAINT)dnl 62 AC_SUBST(NOTMAINT)dnl 63 64 # Do we have a single-tree copy of texinfo? Even if we do, we can't 65 # rely on it - libiberty is built before texinfo. 66 AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ) 67 if test "x$MAKEINFO" = "x"; then 68 MAKEINFO="@echo makeinfo missing; true" 69 BUILD_INFO= 70 else 71 BUILD_INFO=info 72 case x"`$MAKEINFO --version | grep 'GNU texinfo'`" in 73 x*\ [[1-3]].* ) 74 MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true" 75 BUILD_INFO= 76 AC_MSG_WARN([ 77 *** Makeinfo is too old. Info documentation will not be built.]) 78 ;; 79 esac 80 fi 81 AC_SUBST(MAKEINFO) 82 AC_SUBST(BUILD_INFO) 83 84 AC_CHECK_PROG(PERL, perl, perl, ) 85 if test x"$PERL" = x""; then 86 HAVE_PERL='#' 87 else 88 HAVE_PERL='' 89 fi 90 AC_SUBST(HAVE_PERL) 28 91 29 92 AC_CANONICAL_HOST … … 39 102 LIB_AC_PROG_CC 40 103 104 AC_PROG_CC_C_O 105 # autoconf is lame and doesn't give us any substitution variable for this. 106 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then 107 NO_MINUS_C_MINUS_O=yes 108 else 109 OUTPUT_OPTION='-o $@' 110 fi 111 AC_SUBST(NO_MINUS_C_MINUS_O) 112 AC_SUBST(OUTPUT_OPTION) 113 41 114 AC_ISC_POSIX 42 115 AC_C_CONST … … 70 143 # able to link anything, it had better be able to at least compile 71 144 # something. 72 AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h )145 AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h) 73 146 AC_HEADER_SYS_WAIT 74 147 AC_HEADER_TIME 75 148 76 149 libiberty_AC_DECLARE_ERRNO 150 151 AC_CHECK_TYPE(uintptr_t, unsigned long) 152 # Given the above check, we always have uintptr_t or a fallback 153 # definition. So define HAVE_UINTPTR_T in case any imported code 154 # relies on it. 155 AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if you have the \`uintptr_t' type.]) 156 157 AC_TYPE_PID_T 77 158 78 159 # This is the list of functions which libiberty will provide if they … … 88 169 funcs="$funcs calloc" 89 170 funcs="$funcs clock" 171 funcs="$funcs ffs" 90 172 funcs="$funcs getcwd" 91 173 funcs="$funcs getpagesize" … … 96 178 funcs="$funcs memcpy" 97 179 funcs="$funcs memmove" 180 funcs="$funcs mempcpy" 98 181 funcs="$funcs memset" 99 182 funcs="$funcs mkstemps" … … 103 186 funcs="$funcs rindex" 104 187 funcs="$funcs setenv" 188 funcs="$funcs snprintf" 105 189 funcs="$funcs sigsetmask" 190 funcs="$funcs stpcpy" 191 funcs="$funcs stpncpy" 106 192 funcs="$funcs strcasecmp" 107 193 funcs="$funcs strchr" … … 117 203 funcs="$funcs vfprintf" 118 204 funcs="$funcs vprintf" 205 funcs="$funcs vsnprintf" 119 206 funcs="$funcs vsprintf" 120 207 funcs="$funcs waitpid" … … 122 209 # Also in the old function.def file: alloca, vfork, getopt. 123 210 124 vars="sys_errlist sys_nerr sys_siglist "211 vars="sys_errlist sys_nerr sys_siglist _system_configuration" 125 212 126 213 checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" 214 checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp" 215 checkfuncs="$checkfuncs getsysinfo table sysctl" 127 216 128 217 # These are neither executed nor required, but they help keep … … 131 220 AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock) 132 221 AC_CHECK_FUNCS(getcwd getpagesize index insque mkstemps memchr memcmp memcpy) 133 AC_CHECK_FUNCS(memmove mem set putenv random rename rindex sigsetmask)134 AC_CHECK_FUNCS(strcasecmp setenv st rchr strdup strncasecmp strrchr strstr)222 AC_CHECK_FUNCS(memmove mempcpy memset putenv random rename rindex sigsetmask) 223 AC_CHECK_FUNCS(strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr) 135 224 AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf) 136 225 AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal) 137 AC_CHECK_FUNCS(sysconf times sbrk gettimeofday) 226 AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs snprintf vsnprintf) 227 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl) 228 AC_CHECK_FUNCS(realpath canonicalize_file_name) 138 229 AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.]) 139 230 AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.]) 140 231 AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.]) 232 AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, [Define if you have the _system_configuration variable.]) 141 233 fi 142 234 143 235 # For each of these functions, if the host does not provide the 144 236 # function we want to put FN.o in LIBOBJS, and if the host does 145 # provide the function, we want to define HAVE_FN in config.h. Also, 146 # if the host does not provide alloca, we set ALLOCA to alloca.o 237 # provide the function, we want to define HAVE_FN in config.h. 147 238 148 239 setobjs= 149 240 CHECK= 241 target_header_dir= 150 242 if test -n "${with_target_subdir}"; then 151 243 … … 159 251 160 252 if test "x${with_newlib}" = "xyes"; then 161 ALLOCA="alloca.o"162 253 LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o" 163 254 … … 183 274 fi 184 275 276 # We may wish to install the target headers somewhere. 277 AC_ARG_ENABLE(install-libiberty, 278 [ --enable-install-libiberty Install headers for end users], 279 enable_install_libiberty=$enableval, 280 enable_install_libiberty=no)dnl 281 282 # Option parsed, now set things appropriately. 283 case x"$enable_install_libiberty" in 284 xyes|x) 285 target_header_dir=libiberty 286 ;; 287 xno) 288 target_header_dir= 289 ;; 290 *) 291 # This could be sanity-checked in various ways... 292 target_header_dir="${enable_install_libiberty}" 293 ;; 294 esac 295 296 185 297 else 186 298 … … 191 303 192 304 AC_SUBST(CHECK) 305 AC_SUBST(target_header_dir) 306 307 case "${host}" in 308 *-*-cygwin* | *-*-mingw*) 309 AC_DEFINE_NOAUTOHEADER(HAVE_SYS_ERRLIST) 310 AC_DEFINE_NOAUTOHEADER(HAVE_SYS_NERR) 311 ;; 312 esac 193 313 194 314 if test -z "${setobjs}"; then … … 272 392 ;; 273 393 394 *-*-*vms*) 395 # Under VMS, vfork works very different than on Unix. The standard test 396 # won't work, and it isn't easily adaptable. It makes more sense to 397 # just force it. 398 ac_cv_func_vfork_works=yes 399 ;; 400 274 401 esac 275 402 … … 278 405 AC_PROG_CC_WORKS 279 406 AC_REPLACE_FUNCS($funcs) 280 281 case "${host}" in 282 *-*-interix) 283 # On Interix, it wrongly concludes that the MSVC compiler supports alloca. 284 # (MSVC does on Win32, not on Interix.) 285 # This should be temporary. 286 287 ac_cv_header_alloca_h=no 288 ac_cv_func_alloca_works=no 289 ALLOCA=alloca.o 290 cat >> confdefs.h <<\EOF 291 #define C_ALLOCA 1 292 EOF 293 cat >> confdefs.h <<EOF 294 #define STACK_DIRECTION -1 295 EOF 296 ;; 297 *) 298 AC_FUNC_ALLOCA 299 ;; 300 esac 301 407 libiberty_AC_FUNC_C_ALLOCA 302 408 AC_FUNC_VFORK 303 409 if test $ac_cv_func_vfork_works = no; then 304 410 LIBOBJS="$LIBOBJS vfork.o" 305 411 fi 412 # We only need _doprnt if we might use it to implement v*printf. 413 if test $ac_cv_func_vprintf != yes \ 414 || test $ac_cv_func_vfprintf != yes \ 415 || test $ac_cv_func_vsprintf != yes; then 416 AC_REPLACE_FUNCS(_doprnt) 417 else 418 AC_CHECK_FUNCS(_doprnt) 419 fi 420 306 421 for v in $vars; do 307 422 AC_MSG_CHECKING([for $v]) 308 423 AC_CACHE_VAL(libiberty_cv_var_$v, 309 [AC_TRY_LINK([int *p;], [extern int $v ; p = &$v;],424 [AC_TRY_LINK([int *p;], [extern int $v []; p = $v;], 310 425 [eval "libiberty_cv_var_$v=yes"], 311 426 [eval "libiberty_cv_var_$v=no"])]) … … 319 434 done 320 435 AC_CHECK_FUNCS($checkfuncs) 321 fi 436 libiberty_NEED_DECLARATION(canonicalize_file_name) 437 fi 438 439 # Figure out which version of pexecute to use. 440 case "${host}" in 441 *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;; 442 *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;; 443 *-*-msdos*) pexecute=pex-msdos.o ;; 444 *-*-os2-emx*) pexecute=pex-os2.o ;; 445 *) pexecute=pex-unix.o ;; 446 esac 447 AC_SUBST(pexecute) 322 448 323 449 libiberty_AC_FUNC_STRNCMP … … 336 462 [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h 337 463 if test -n "$CONFIG_FILES"; then 338 if test -n "${with_ target_subdir}"; then464 if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then 339 465 # FIXME: We shouldn't need to set ac_file 340 466 ac_file=Makefile 467 LD="${ORIGINAL_LD_FOR_MULTILIBS}" 341 468 . ${libiberty_topdir}/config-ml.in 342 469 fi … … 346 473 target=${target} 347 474 with_target_subdir=${with_target_subdir} 475 with_build_subdir=${with_build_subdir} 348 476 with_multisubdir=${with_multisubdir} 349 477 ac_configure_args="--enable-multilib ${ac_configure_args}" 350 478 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} 479 ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" 351 480 libiberty_topdir=${libiberty_topdir} 352 481 ) -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/copysign.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 130 130 #endif 131 131 132 #if defined(__IEEE_BIG_ENDIAN) || defined(__IEEE_LITTLE_ENDIAN) 132 133 133 double DEFUN(copysign, (x, y), double x AND double y) 134 double 135 copysign (x, y) 136 double x, y; 134 137 { 135 138 __ieee_double_shape_type a,b; … … 139 142 return a.value; 140 143 } 144 145 #else 146 147 double 148 copysign (x, y) 149 double x, y; 150 { 151 if ((x < 0 && y > 0) || (x > 0 && y < 0)) 152 return -x; 153 return x; 154 } 155 156 #endif -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/cp-demangle.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Demangler for IA64 / g++ V3 ABI. 2 Copyright (C) 2000 Free Software Foundation, Inc.2 Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. 3 3 Written by Alex Samuel <samuel@codesourcery.com>. 4 4 … … 9 9 the Free Software Foundation; either version 2 of the License, or 10 10 (at your option) any later version. 11 12 In addition to the permissions in the GNU General Public License, the 13 Free Software Foundation gives you unlimited permission to link the 14 compiled version of this file into combinations with other programs, 15 and to distribute those combinations without any restriction coming 16 from the use of this file. (The General Public License restrictions 17 do apply in other respects; for example, they cover modification of 18 the file, and distribution when not linked into a combined 19 executable.) 11 20 12 21 This program is distributed in the hope that it will be useful, … … 42 51 #include <string.h> 43 52 #endif 53 54 #include <ctype.h> 44 55 45 56 #include "ansidecl.h" … … 69 80 #define ANONYMOUS_NAMESPACE_PREFIX "_GLOBAL_" 70 81 82 /* Character(s) to use for namespace separation in demangled output */ 83 #define NAMESPACE_SEPARATOR (dm->style == DMGL_JAVA ? "." : "::") 84 71 85 /* If flag_verbose is zero, some simplifications will be made to the 72 86 output to make it easier to read and supress details that are … … 167 181 /* The most recently demangled source-name. */ 168 182 dyn_string_t last_source_name; 183 184 /* Language style to use for demangled output. */ 185 int style; 186 187 /* Set to non-zero iff this name is a constructor. The actual value 188 indicates what sort of constructor this is; see demangle.h. */ 189 enum gnu_v3_ctor_kinds is_constructor; 190 191 /* Set to non-zero iff this name is a destructor. The actual value 192 indicates what sort of destructor this is; see demangle.h. */ 193 enum gnu_v3_dtor_kinds is_destructor; 194 169 195 }; 170 196 … … 241 267 PARAMS ((demangling_t)); 242 268 static demangling_t demangling_new 243 PARAMS ((const char * ));269 PARAMS ((const char *, int)); 244 270 static void demangling_delete 245 271 PARAMS ((demangling_t)); … … 410 436 { 411 437 string_list_t next = node->next; 412 free (node);438 dyn_string_delete ((dyn_string_t) node); 413 439 node = next; 414 440 } … … 784 810 785 811 static demangling_t 786 demangling_new (name )812 demangling_new (name, style) 787 813 const char *name; 814 int style; 788 815 { 789 816 demangling_t dm; … … 808 835 return NULL; 809 836 } 837 dm->style = style; 838 dm->is_constructor = (enum gnu_v3_ctor_kinds) 0; 839 dm->is_destructor = (enum gnu_v3_dtor_kinds) 0; 810 840 811 841 return dm; … … 871 901 PARAMS ((demangling_t, int, dyn_string_t)); 872 902 static status_t demangle_operator_name 873 PARAMS ((demangling_t, int, int * ));903 PARAMS ((demangling_t, int, int *, int *)); 874 904 static status_t demangle_nv_offset 875 905 PARAMS ((demangling_t)); … … 919 949 PARAMS ((demangling_t, int)); 920 950 static status_t cp_demangle 921 PARAMS ((const char *, dyn_string_t)); 922 #ifdef IN_LIBGCC2 951 PARAMS ((const char *, dyn_string_t, int)); 923 952 static status_t cp_demangle_type 924 953 PARAMS ((const char*, dyn_string_t)); 925 #endif926 954 927 955 /* When passed to demangle_bare_function_type, indicates that the … … 947 975 { 948 976 if (error_message == NULL) 949 error_message = strdup ("Expected ?");977 error_message = (char *) strdup ("Expected ?"); 950 978 error_message[9] = c; 951 979 return error_message; … … 1223 1251 /* We have another level of scope qualification. */ 1224 1252 if (nested) 1225 RETURN_IF_ERROR (result_add (dm, "::"));1253 RETURN_IF_ERROR (result_add (dm, NAMESPACE_SEPARATOR)); 1226 1254 else 1227 1255 nested = 1; … … 1300 1328 *suppress_return_type = 1; 1301 1329 1302 RETURN_IF_ERROR (demangle_operator_name (dm, 0, &num_args ));1330 RETURN_IF_ERROR (demangle_operator_name (dm, 0, &num_args, NULL)); 1303 1331 } 1304 1332 else if (peek == 'C' || peek == 'D') … … 1441 1469 while (length-- > 0) 1442 1470 { 1471 int ch; 1443 1472 if (end_of_name_p (dm)) 1444 1473 return "Unexpected end of name in <identifier>."; 1445 if (!dyn_string_append_char (identifier, next_char (dm))) 1474 ch = next_char (dm); 1475 1476 /* Handle extended Unicode characters. We encode them as __U{hex}_, 1477 where {hex} omits leading 0's. For instance, '$' is encoded as 1478 "__U24_". */ 1479 if (ch == '_' 1480 && peek_char (dm) == '_' 1481 && peek_char_next (dm) == 'U') 1482 { 1483 char buf[10]; 1484 int pos = 0; 1485 advance_char (dm); advance_char (dm); length -= 2; 1486 while (length-- > 0) 1487 { 1488 ch = next_char (dm); 1489 if (!isxdigit (ch)) 1490 break; 1491 buf[pos++] = ch; 1492 } 1493 if (ch != '_' || length < 0) 1494 return STATUS_ERROR; 1495 if (pos == 0) 1496 { 1497 /* __U_ just means __U. */ 1498 if (!dyn_string_append_cstr (identifier, "__U")) 1499 return STATUS_ALLOCATION_FAILED; 1500 continue; 1501 } 1502 else 1503 { 1504 buf[pos] = '\0'; 1505 ch = strtol (buf, 0, 16); 1506 } 1507 } 1508 1509 if (!dyn_string_append_char (identifier, ch)) 1446 1510 return STATUS_ALLOCATION_FAILED; 1447 1511 } … … 1476 1540 the short form is emitted; otherwise the full source form 1477 1541 (`operator +' etc.) is emitted. *NUM_ARGS is set to the number of 1478 operands that the operator takes. 1542 operands that the operator takes. If TYPE_ARG is non-NULL, 1543 *TYPE_ARG is set to 1 if the first argument is a type and 0 1544 otherwise. 1479 1545 1480 1546 <operator-name> … … 1526 1592 ::= ix # [] 1527 1593 ::= qu # ? 1528 ::= sz # sizeof 1594 ::= st # sizeof (a type) 1595 ::= sz # sizeof (an expression) 1529 1596 ::= cv <type> # cast 1530 1597 ::= v [0-9] <source-name> # vendor extended operator */ 1531 1598 1532 1599 static status_t 1533 demangle_operator_name (dm, short_name, num_args )1600 demangle_operator_name (dm, short_name, num_args, type_arg) 1534 1601 demangling_t dm; 1535 1602 int short_name; 1536 1603 int *num_args; 1604 int *type_arg; 1537 1605 { 1538 1606 struct operator_code 1539 1607 { 1540 1608 /* The mangled code for this operator. */ 1541 const char *co de;1609 const char *const code; 1542 1610 /* The source name of this operator. */ 1543 const char * name;1611 const char *const name; 1544 1612 /* The number of arguments this operator takes. */ 1545 int num_args;1613 const int num_args; 1546 1614 }; 1547 1615 … … 1608 1676 DEMANGLE_TRACE ("operator-name", dm); 1609 1677 1678 /* Assume the first argument is not a type. */ 1679 if (type_arg) 1680 *type_arg = 0; 1681 1610 1682 /* Is this a vendor-extended operator? */ 1611 1683 if (c0 == 'v' && IS_DIGIT (c1)) … … 1624 1696 RETURN_IF_ERROR (demangle_type (dm)); 1625 1697 *num_args = 0; 1698 return STATUS_OK; 1699 } 1700 1701 /* Is it the sizeof variant that takes a type? */ 1702 if (c0 == 's' && c1 == 't') 1703 { 1704 RETURN_IF_ERROR (result_add (dm, " sizeof")); 1705 *num_args = 1; 1706 if (type_arg) 1707 *type_arg = 1; 1626 1708 return STATUS_OK; 1627 1709 } … … 1824 1906 if (peek == 'G') 1825 1907 { 1826 /* A guard variable name.Consume the G. */1908 /* Consume the G. */ 1827 1909 advance_char (dm); 1828 RETURN_IF_ERROR (demangle_char (dm, 'V')); 1829 RETURN_IF_ERROR (result_add (dm, "guard variable for ")); 1830 RETURN_IF_ERROR (demangle_name (dm, &unused)); 1910 switch (peek_char (dm)) 1911 { 1912 case 'V': 1913 /* A guard variable name. */ 1914 advance_char (dm); 1915 RETURN_IF_ERROR (result_add (dm, "guard variable for ")); 1916 RETURN_IF_ERROR (demangle_name (dm, &unused)); 1917 break; 1918 1919 case 'R': 1920 /* A reference temporary. */ 1921 advance_char (dm); 1922 RETURN_IF_ERROR (result_add (dm, "reference temporary for ")); 1923 RETURN_IF_ERROR (demangle_name (dm, &unused)); 1924 break; 1925 1926 default: 1927 return "Unrecognized <special-name>."; 1928 } 1831 1929 } 1832 1930 else if (peek == 'T') … … 2011 2109 /* A constructor name. Consume the C. */ 2012 2110 advance_char (dm); 2013 if (peek_char (dm) < '1' || peek_char (dm) > '3') 2111 flavor = next_char (dm); 2112 if (flavor < '1' || flavor > '3') 2014 2113 return "Unrecognized constructor."; 2015 2114 RETURN_IF_ERROR (result_add_string (dm, dm->last_source_name)); 2115 switch (flavor) 2116 { 2117 case '1': dm->is_constructor = gnu_v3_complete_object_ctor; 2118 break; 2119 case '2': dm->is_constructor = gnu_v3_base_object_ctor; 2120 break; 2121 case '3': dm->is_constructor = gnu_v3_complete_object_allocating_ctor; 2122 break; 2123 } 2016 2124 /* Print the flavor of the constructor if in verbose mode. */ 2017 flavor = next_char (dm) - '1';2018 2125 if (flag_verbose) 2019 2126 { 2020 2127 RETURN_IF_ERROR (result_add (dm, "[")); 2021 RETURN_IF_ERROR (result_add (dm, ctor_flavors[flavor ]));2128 RETURN_IF_ERROR (result_add (dm, ctor_flavors[flavor - '1'])); 2022 2129 RETURN_IF_ERROR (result_add_char (dm, ']')); 2023 2130 } … … 2027 2134 /* A destructor name. Consume the D. */ 2028 2135 advance_char (dm); 2029 if (peek_char (dm) < '0' || peek_char (dm) > '2') 2136 flavor = next_char (dm); 2137 if (flavor < '0' || flavor > '2') 2030 2138 return "Unrecognized destructor."; 2031 2139 RETURN_IF_ERROR (result_add_char (dm, '~')); 2032 2140 RETURN_IF_ERROR (result_add_string (dm, dm->last_source_name)); 2141 switch (flavor) 2142 { 2143 case '0': dm->is_destructor = gnu_v3_deleting_dtor; 2144 break; 2145 case '1': dm->is_destructor = gnu_v3_complete_object_dtor; 2146 break; 2147 case '2': dm->is_destructor = gnu_v3_base_object_dtor; 2148 break; 2149 } 2033 2150 /* Print the flavor of the destructor if in verbose mode. */ 2034 flavor = next_char (dm) - '0';2035 2151 if (flag_verbose) 2036 2152 { 2037 2153 RETURN_IF_ERROR (result_add (dm, " [")); 2038 RETURN_IF_ERROR (result_add (dm, dtor_flavors[flavor ]));2154 RETURN_IF_ERROR (result_add (dm, dtor_flavors[flavor - '0'])); 2039 2155 RETURN_IF_ERROR (result_add_char (dm, ']')); 2040 2156 } … … 2094 2210 substitution_start)); 2095 2211 /* Insert an asterisk where we're told to; it doesn't 2096 necessarily go at the end. */ 2097 RETURN_IF_ERROR (result_insert_char (dm, *insert_pos, '*')); 2212 necessarily go at the end. If we're doing Java style output, 2213 there is no pointer symbol. */ 2214 if (dm->style != DMGL_JAVA) 2215 RETURN_IF_ERROR (result_insert_char (dm, *insert_pos, '*')); 2098 2216 /* The next (outermost) pointer or reference character should go 2099 2217 after this one. */ … … 2470 2588 }; 2471 2589 2590 /* Java source names of builtin types. Types that arn't valid in Java 2591 are also included here - we don't fail if someone attempts to demangle a 2592 C++ symbol in Java style. */ 2593 static const char *const java_builtin_type_names[26] = 2594 { 2595 "signed char", /* a */ 2596 "boolean", /* C++ "bool" */ /* b */ 2597 "byte", /* C++ "char" */ /* c */ 2598 "double", /* d */ 2599 "long double", /* e */ 2600 "float", /* f */ 2601 "__float128", /* g */ 2602 "unsigned char", /* h */ 2603 "int", /* i */ 2604 "unsigned", /* j */ 2605 NULL, /* k */ 2606 "long", /* l */ 2607 "unsigned long", /* m */ 2608 "__int128", /* n */ 2609 "unsigned __int128", /* o */ 2610 NULL, /* p */ 2611 NULL, /* q */ 2612 NULL, /* r */ 2613 "short", /* s */ 2614 "unsigned short", /* t */ 2615 NULL, /* u */ 2616 "void", /* v */ 2617 "char", /* C++ "wchar_t" */ /* w */ 2618 "long", /* C++ "long long" */ /* x */ 2619 "unsigned long long", /* y */ 2620 "..." /* z */ 2621 }; 2622 2472 2623 /* Demangles and emits a <builtin-type>. 2473 2624 … … 2512 2663 else if (code >= 'a' && code <= 'z') 2513 2664 { 2514 const char *type_name = builtin_type_names[code - 'a']; 2665 const char *type_name; 2666 /* Java uses different names for some built-in types. */ 2667 if (dm->style == DMGL_JAVA) 2668 type_name = java_builtin_type_names[code - 'a']; 2669 else 2670 type_name = builtin_type_names[code - 'a']; 2515 2671 if (type_name == NULL) 2516 2672 return "Unrecognized <builtin-type> code."; … … 3055 3211 { 3056 3212 int num_args; 3213 int type_arg; 3057 3214 status_t status = STATUS_OK; 3058 3215 dyn_string_t operator_name; … … 3062 3219 first. */ 3063 3220 RETURN_IF_ERROR (result_push (dm)); 3064 RETURN_IF_ERROR (demangle_operator_name (dm, 1, &num_args)); 3221 RETURN_IF_ERROR (demangle_operator_name (dm, 1, &num_args, 3222 &type_arg)); 3065 3223 operator_name = (dyn_string_t) result_pop (dm); 3066 3224 … … 3083 3241 /* Emit its second (if binary) or only (if unary) operand. */ 3084 3242 RETURN_IF_ERROR (result_add_char (dm, '(')); 3085 RETURN_IF_ERROR (demangle_expression (dm)); 3243 if (type_arg) 3244 RETURN_IF_ERROR (demangle_type (dm)); 3245 else 3246 RETURN_IF_ERROR (demangle_expression (dm)); 3086 3247 RETURN_IF_ERROR (result_add_char (dm, ')')); 3087 3248 … … 3370 3531 less than the discriminator ordinal, counting from 3371 3532 zero. */ 3372 RETURN_IF_ERROR (int_to_dyn_string (discriminator + 2,3533 RETURN_IF_ERROR (int_to_dyn_string (discriminator + 1, 3373 3534 (dyn_string_t) dm->result)); 3374 3535 } 3375 3536 else 3376 { 3377 if (flag_verbose) 3378 /* A missing digit correspond to one. */ 3379 RETURN_IF_ERROR (result_add_char (dm, '1')); 3380 } 3537 return STATUS_ERROR; 3381 3538 if (flag_verbose) 3382 3539 RETURN_IF_ERROR (result_add_char (dm, ']')); … … 3396 3553 3397 3554 static status_t 3398 cp_demangle (name, result )3555 cp_demangle (name, result, style) 3399 3556 const char *name; 3400 3557 dyn_string_t result; 3558 int style; 3401 3559 { 3402 3560 status_t status; … … 3405 3563 if (length > 2 && name[0] == '_' && name[1] == 'Z') 3406 3564 { 3407 demangling_t dm = demangling_new (name );3565 demangling_t dm = demangling_new (name, style); 3408 3566 if (dm == NULL) 3409 3567 return STATUS_ALLOCATION_FAILED; … … 3444 3602 an error message, and the contents of RESULT are unchanged. */ 3445 3603 3446 #ifdef IN_LIBGCC23447 3604 static status_t 3448 3605 cp_demangle_type (type_name, result) … … 3451 3608 { 3452 3609 status_t status; 3453 demangling_t dm = demangling_new (type_name );3610 demangling_t dm = demangling_new (type_name, DMGL_GNU_V3); 3454 3611 3455 3612 if (dm == NULL) … … 3482 3639 } 3483 3640 3641 #if defined(IN_LIBGCC2) || defined(IN_GLIBCPP_V3) 3484 3642 extern char *__cxa_demangle PARAMS ((const char *, char *, size_t *, int *)); 3485 3643 … … 3552 3710 /* MANGLED_NAME apprears to be a function or variable name. 3553 3711 Demangle it accordingly. */ 3554 result = cp_demangle (mangled_name, &demangled_name );3712 result = cp_demangle (mangled_name, &demangled_name, 0); 3555 3713 else 3556 3714 /* Try to demangled MANGLED_NAME as the name of a type. */ … … 3589 3747 } 3590 3748 3591 #else /* ! IN_LIBGCC2*/3749 #else /* ! (IN_LIBGCC2 || IN_GLIBCPP_V3) */ 3592 3750 3593 3751 /* Variant entry point for integration with the existing cplus-dem … … 3598 3756 3599 3757 char * 3600 cplus_demangle_v3 (mangled )3758 cplus_demangle_v3 (mangled, options) 3601 3759 const char* mangled; 3760 int options; 3602 3761 { 3603 3762 dyn_string_t demangled; 3604 3763 status_t status; 3605 3606 /* If this isn't a mangled name, don't pretend to demangle it. */ 3607 if (strncmp (mangled, "_Z", 2) != 0) 3608 return NULL; 3764 int type = !!(options & DMGL_TYPES); 3765 3766 if (mangled[0] == '_' && mangled[1] == 'Z') 3767 /* It is not a type. */ 3768 type = 0; 3769 else 3770 { 3771 /* It is a type. Stop if we don't want to demangle types. */ 3772 if (!type) 3773 return NULL; 3774 } 3775 3776 flag_verbose = !!(options & DMGL_VERBOSE); 3609 3777 3610 3778 /* Create a dyn_string to hold the demangled name. */ 3611 3779 demangled = dyn_string_new (0); 3612 3780 /* Attempt the demangling. */ 3613 status = cp_demangle ((char *) mangled, demangled); 3781 if (!type) 3782 /* Appears to be a function or variable name. */ 3783 status = cp_demangle (mangled, demangled, 0); 3784 else 3785 /* Try to demangle it as the name of a type. */ 3786 status = cp_demangle_type (mangled, demangled); 3614 3787 3615 3788 if (STATUS_NO_ERROR (status)) … … 3635 3808 } 3636 3809 3637 #endif /* IN_LIBGCC2 */ 3810 /* Demangle a Java symbol. Java uses a subset of the V3 ABI C++ mangling 3811 conventions, but the output formatting is a little different. 3812 This instructs the C++ demangler not to emit pointer characters ("*"), and 3813 to use Java's namespace separator symbol ("." instead of "::"). It then 3814 does an additional pass over the demangled output to replace instances 3815 of JArray<TYPE> with TYPE[]. */ 3816 3817 char * 3818 java_demangle_v3 (mangled) 3819 const char* mangled; 3820 { 3821 dyn_string_t demangled; 3822 char *next; 3823 char *end; 3824 int len; 3825 status_t status; 3826 int nesting = 0; 3827 char *cplus_demangled; 3828 char *return_value; 3829 3830 /* Create a dyn_string to hold the demangled name. */ 3831 demangled = dyn_string_new (0); 3832 3833 /* Attempt the demangling. */ 3834 status = cp_demangle ((char *) mangled, demangled, DMGL_JAVA); 3835 3836 if (STATUS_NO_ERROR (status)) 3837 /* Demangling succeeded. */ 3838 { 3839 /* Grab the demangled result from the dyn_string. */ 3840 cplus_demangled = dyn_string_release (demangled); 3841 } 3842 else if (status == STATUS_ALLOCATION_FAILED) 3843 { 3844 fprintf (stderr, "Memory allocation failed.\n"); 3845 abort (); 3846 } 3847 else 3848 /* Demangling failed. */ 3849 { 3850 dyn_string_delete (demangled); 3851 return NULL; 3852 } 3853 3854 len = strlen (cplus_demangled); 3855 next = cplus_demangled; 3856 end = next + len; 3857 demangled = NULL; 3858 3859 /* Replace occurances of JArray<TYPE> with TYPE[]. */ 3860 while (next < end) 3861 { 3862 char *open_str = strstr (next, "JArray<"); 3863 char *close_str = NULL; 3864 if (nesting > 0) 3865 close_str = strchr (next, '>'); 3866 3867 if (open_str != NULL && (close_str == NULL || close_str > open_str)) 3868 { 3869 ++nesting; 3870 3871 if (!demangled) 3872 demangled = dyn_string_new(len); 3873 3874 /* Copy prepending symbols, if any. */ 3875 if (open_str > next) 3876 { 3877 open_str[0] = 0; 3878 dyn_string_append_cstr (demangled, next); 3879 } 3880 next = open_str + 7; 3881 } 3882 else if (close_str != NULL) 3883 { 3884 --nesting; 3885 3886 /* Copy prepending type symbol, if any. Squash any spurious 3887 whitespace. */ 3888 if (close_str > next && next[0] != ' ') 3889 { 3890 close_str[0] = 0; 3891 dyn_string_append_cstr (demangled, next); 3892 } 3893 dyn_string_append_cstr (demangled, "[]"); 3894 next = close_str + 1; 3895 } 3896 else 3897 { 3898 /* There are no more arrays. Copy the rest of the symbol, or 3899 simply return the original symbol if no changes were made. */ 3900 if (next == cplus_demangled) 3901 return cplus_demangled; 3902 3903 dyn_string_append_cstr (demangled, next); 3904 next = end; 3905 } 3906 } 3907 3908 free (cplus_demangled); 3909 3910 if (demangled) 3911 return_value = dyn_string_release (demangled); 3912 else 3913 return_value = NULL; 3914 3915 return return_value; 3916 } 3917 3918 #endif /* IN_LIBGCC2 || IN_GLIBCPP_V3 */ 3919 3920 3921 #ifndef IN_GLIBCPP_V3 3922 /* Demangle NAME in the G++ V3 ABI demangling style, and return either 3923 zero, indicating that some error occurred, or a demangling_t 3924 holding the results. */ 3925 static demangling_t 3926 demangle_v3_with_details (name) 3927 const char *name; 3928 { 3929 demangling_t dm; 3930 status_t status; 3931 3932 if (strncmp (name, "_Z", 2)) 3933 return 0; 3934 3935 dm = demangling_new (name, DMGL_GNU_V3); 3936 if (dm == NULL) 3937 { 3938 fprintf (stderr, "Memory allocation failed.\n"); 3939 abort (); 3940 } 3941 3942 status = result_push (dm); 3943 if (! STATUS_NO_ERROR (status)) 3944 { 3945 demangling_delete (dm); 3946 fprintf (stderr, "%s\n", status); 3947 abort (); 3948 } 3949 3950 status = demangle_mangled_name (dm); 3951 if (STATUS_NO_ERROR (status)) 3952 return dm; 3953 3954 demangling_delete (dm); 3955 return 0; 3956 } 3957 3958 3959 /* Return non-zero iff NAME is the mangled form of a constructor name 3960 in the G++ V3 ABI demangling style. Specifically, return: 3961 - '1' if NAME is a complete object constructor, 3962 - '2' if NAME is a base object constructor, or 3963 - '3' if NAME is a complete object allocating constructor. */ 3964 enum gnu_v3_ctor_kinds 3965 is_gnu_v3_mangled_ctor (name) 3966 const char *name; 3967 { 3968 demangling_t dm = demangle_v3_with_details (name); 3969 3970 if (dm) 3971 { 3972 enum gnu_v3_ctor_kinds result = dm->is_constructor; 3973 demangling_delete (dm); 3974 return result; 3975 } 3976 else 3977 return (enum gnu_v3_ctor_kinds) 0; 3978 } 3979 3980 3981 /* Return non-zero iff NAME is the mangled form of a destructor name 3982 in the G++ V3 ABI demangling style. Specifically, return: 3983 - '0' if NAME is a deleting destructor, 3984 - '1' if NAME is a complete object destructor, or 3985 - '2' if NAME is a base object destructor. */ 3986 enum gnu_v3_dtor_kinds 3987 is_gnu_v3_mangled_dtor (name) 3988 const char *name; 3989 { 3990 demangling_t dm = demangle_v3_with_details (name); 3991 3992 if (dm) 3993 { 3994 enum gnu_v3_dtor_kinds result = dm->is_destructor; 3995 demangling_delete (dm); 3996 return result; 3997 } 3998 else 3999 return (enum gnu_v3_dtor_kinds) 0; 4000 } 4001 #endif /* IN_GLIBCPP_V3 */ 4002 3638 4003 3639 4004 #ifdef STANDALONE_DEMANGLER … … 3670 4035 3671 4036 /* Option specification for getopt_long. */ 3672 static struct option long_options[] =4037 static const struct option long_options[] = 3673 4038 { 3674 4039 { "help", no_argument, NULL, 'h' }, … … 3772 4137 3773 4138 /* Attempt to demangle the name. */ 3774 status = cp_demangle (dyn_string_buf (mangled), demangled );4139 status = cp_demangle (dyn_string_buf (mangled), demangled, 0); 3775 4140 3776 4141 /* If the demangling succeeded, great! Print out the … … 3811 4176 { 3812 4177 /* Attempt to demangle. */ 3813 status = cp_demangle (argv[i], result );4178 status = cp_demangle (argv[i], result, 0); 3814 4179 3815 4180 /* If it worked, print the demangled name. */ … … 3819 4184 else if (status == STATUS_ALLOCATION_FAILED) 3820 4185 { 3821 fprintf (stderr, "Memory alloca iton failed.\n");4186 fprintf (stderr, "Memory allocation failed.\n"); 3822 4187 abort (); 3823 4188 } -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/cplus-dem.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Demangler for GNU C++ 2 2 Copyright 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999, 3 2000 Free Software Foundation, Inc.3 2000, 2001 Free Software Foundation, Inc. 4 4 Written by James Clark (jjc@jclark.uucp) 5 5 Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling … … 11 11 License as published by the Free Software Foundation; either 12 12 version 2 of the License, or (at your option) any later version. 13 14 In addition to the permissions in the GNU Library General Public 15 License, the Free Software Foundation gives you unlimited permission 16 to link the compiled version of this file into combinations with other 17 programs, and to distribute those combinations without any restriction 18 coming from the use of this file. (The Library Public License 19 restrictions do apply in other respects; for example, they cover 20 modification of the file, and distribution when not linked into a 21 combined executable.) 13 22 14 23 Libiberty is distributed in the hope that it will be useful, … … 63 72 64 73 extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN; 65 66 static const char *mystrstr PARAMS ((const char *, const char *));67 68 static const char *69 mystrstr (s1, s2)70 const char *s1, *s2;71 {72 register const char *p = s1;73 register int len = strlen (s2);74 75 for (; (p = strchr (p, *s2)) != 0; p++)76 {77 if (strncmp (p, s2, len) == 0)78 {79 return (p);80 }81 }82 return (0);83 }84 74 85 75 /* In order to allow a single demangler executable to demangle strings … … 158 148 static const struct optable 159 149 { 160 const char * in;161 const char * out;162 int flags;150 const char *const in; 151 const char *const out; 152 const int flags; 163 153 } optable[] = { 164 154 {"nw", " new", DMGL_ANSI}, /* new (1.92, ansi) */ … … 257 247 } type_kind_t; 258 248 259 struct demangler_engine libiberty_demanglers[] = 260 { 249 const struct demangler_engine libiberty_demanglers[] = 250 { 251 { 252 NO_DEMANGLING_STYLE_STRING, 253 no_demangling, 254 "Demangling disabled" 255 } 256 , 261 257 { 262 258 AUTO_DEMANGLING_STYLE_STRING, … … 319 315 320 316 #define STRING_EMPTY(str) ((str) -> b == (str) -> p) 321 #define PREPEND_BLANK(str) {if (!STRING_EMPTY(str)) \322 string_prepend(str, " ");}323 317 #define APPEND_BLANK(str) {if (!STRING_EMPTY(str)) \ 324 318 string_append(str, " ");} … … 530 524 531 525 static void 532 grow_vect PARAMS (( void**, size_t *, size_t, int));526 grow_vect PARAMS ((char **, size_t *, size_t, int)); 533 527 534 528 /* Translate count to integer, consuming tokens in the process. … … 568 562 (*type)++; 569 563 } 564 565 if (count < 0) 566 count = -1; 570 567 571 568 return (count); … … 848 845 enum demangling_styles style; 849 846 { 850 struct demangler_engine *demangler = libiberty_demanglers;847 const struct demangler_engine *demangler = libiberty_demanglers; 851 848 852 849 for (; demangler->demangling_style != unknown_demangling; ++demangler) … … 866 863 const char *name; 867 864 { 868 struct demangler_engine *demangler = libiberty_demanglers;865 const struct demangler_engine *demangler = libiberty_demanglers; 869 866 870 867 for (; demangler->demangling_style != unknown_demangling; ++demangler) … … 878 875 879 876 If MANGLED is a mangled function name produced by GNU C++, then 880 a pointer to a malloced string giving a C++ representation877 a pointer to a @code{malloc}ed string giving a C++ representation 881 878 of the name will be returned; otherwise NULL will be returned. 882 879 It is the caller's responsibility to free the string which … … 910 907 char *ret; 911 908 struct work_stuff work[1]; 909 910 if (current_demangling_style == no_demangling) 911 return xstrdup (mangled); 912 912 913 memset ((char *) work, 0, sizeof (work)); 913 914 work->options = options; … … 918 919 if (GNU_V3_DEMANGLING || AUTO_DEMANGLING) 919 920 { 920 ret = cplus_demangle_v3 (mangled );921 ret = cplus_demangle_v3 (mangled, work->options); 921 922 if (ret || GNU_V3_DEMANGLING) 922 923 return ret; 924 } 925 926 if (JAVA_DEMANGLING) 927 { 928 ret = java_demangle_v3 (mangled); 929 if (ret) 930 return ret; 923 931 } 924 932 … … 938 946 static void 939 947 grow_vect (old_vect, size, min_size, element_size) 940 void**old_vect;948 char **old_vect; 941 949 size_t *size; 942 950 size_t min_size; … … 948 956 if (*size < min_size) 949 957 *size = min_size; 950 *old_vect = xrealloc (*old_vect, *size * element_size);958 *old_vect = (void *) xrealloc (*old_vect, *size * element_size); 951 959 } 952 960 } … … 971 979 int at_start_name; 972 980 int changed; 973 char *demangling_buffer = NULL; 974 size_t demangling_buffer_size = 0; 981 size_t demangled_size = 0; 975 982 976 983 changed = 0; … … 1000 1007 1001 1008 /* Make demangled big enough for possible expansion by operator name. */ 1002 grow_vect ( (void **) &(demangling_buffer),1003 &demangl ing_buffer_size, 2 * len0 + 1,1009 grow_vect (&demangled, 1010 &demangled_size, 2 * len0 + 1, 1004 1011 sizeof (char)); 1005 demangled = demangling_buffer;1006 1012 1007 1013 if (ISDIGIT ((unsigned char) mangled[len0 - 1])) { … … 1053 1059 1054 1060 Suppress: 1055 grow_vect ( (void **) &(demangling_buffer),1056 &demangl ing_buffer_size, strlen (mangled) + 3,1061 grow_vect (&demangled, 1062 &demangled_size, strlen (mangled) + 3, 1057 1063 sizeof (char)); 1058 demangled = demangling_buffer; 1064 1059 1065 if (mangled[0] == '<') 1060 1066 strcpy (demangled, mangled); … … 1068 1074 to be able to demangle a name with a B, K or n code, we need to 1069 1075 have a longer term memory of what types have been seen. The original 1070 now in tializes and cleans up the squangle code info, while internal1076 now initializes and cleans up the squangle code info, while internal 1071 1077 calls go directly to this routine to avoid resetting that info. */ 1072 1078 … … 1208 1214 if (from->ntmpl_args) 1209 1215 to->tmpl_argvec 1210 = xmalloc (from->ntmpl_args * sizeof (to->tmpl_argvec[0]));1216 = (char **) xmalloc (from->ntmpl_args * sizeof (to->tmpl_argvec[0])); 1211 1217 1212 1218 for (i = 0; i < from->ntmpl_args; i++) … … 1433 1439 string_append (&s, SCOPE_STRING (work)); 1434 1440 string_prepends (declp, &s); 1441 string_delete (&s); 1435 1442 } 1436 1443 oldmangled = NULL; … … 1512 1519 /* Read the return type. */ 1513 1520 string return_type; 1514 string_init (&return_type);1515 1521 1516 1522 (*mangled)++; … … 1787 1793 /* By default, we let the number decide whether we shall consume an 1788 1794 underscore. */ 1789 int consume_following_underscore = 0;1795 int multidigit_without_leading_underscore = 0; 1790 1796 int leave_following_underscore = 0; 1791 1797 1792 1798 success = 0; 1793 1799 1794 /* Negative numbers are indicated with a leading `m'. */ 1795 if (**mangled == 'm') 1796 { 1797 string_appendn (s, "-", 1); 1798 (*mangled)++; 1799 } 1800 else if (mangled[0][0] == '_' && mangled[0][1] == 'm') 1801 { 1802 /* Since consume_count_with_underscores does not handle the 1803 `m'-prefix we must do it here, using consume_count and 1804 adjusting underscores: we have to consume the underscore 1805 matching the prepended one. */ 1806 consume_following_underscore = 1; 1807 string_appendn (s, "-", 1); 1808 (*mangled) += 2; 1809 } 1810 else if (**mangled == '_') 1811 { 1812 /* Do not consume a following underscore; 1813 consume_following_underscore will consume what should be 1814 consumed. */ 1800 if (**mangled == '_') 1801 { 1802 if (mangled[0][1] == 'm') 1803 { 1804 /* Since consume_count_with_underscores does not handle the 1805 `m'-prefix we must do it here, using consume_count and 1806 adjusting underscores: we have to consume the underscore 1807 matching the prepended one. */ 1808 multidigit_without_leading_underscore = 1; 1809 string_appendn (s, "-", 1); 1810 (*mangled) += 2; 1811 } 1812 else 1813 { 1814 /* Do not consume a following underscore; 1815 consume_count_with_underscores will consume what 1816 should be consumed. */ 1817 leave_following_underscore = 1; 1818 } 1819 } 1820 else 1821 { 1822 /* Negative numbers are indicated with a leading `m'. */ 1823 if (**mangled == 'm') 1824 { 1825 string_appendn (s, "-", 1); 1826 (*mangled)++; 1827 } 1828 /* Since consume_count_with_underscores does not handle 1829 multi-digit numbers that do not start with an underscore, 1830 and this number can be an integer template parameter, 1831 we have to call consume_count. */ 1832 multidigit_without_leading_underscore = 1; 1833 /* These multi-digit numbers never end on an underscore, 1834 so if there is one then don't eat it. */ 1815 1835 leave_following_underscore = 1; 1816 1836 } … … 1820 1840 the leading underscore (that we consumed) if it is to handle 1821 1841 multi-digit numbers. */ 1822 if ( consume_following_underscore)1842 if (multidigit_without_leading_underscore) 1823 1843 value = consume_count (mangled); 1824 1844 else … … 1838 1858 underscore, we need to do something more radical. */ 1839 1859 1840 if ((value > 9 || consume_following_underscore)1860 if ((value > 9 || multidigit_without_leading_underscore) 1841 1861 && ! leave_following_underscore 1842 1862 && **mangled == '_') … … 1846 1866 success = 1; 1847 1867 } 1848 }1868 } 1849 1869 1850 1870 return success; … … 2234 2254 /* Check if ARM template with "__pt__" in it ("parameterized type") */ 2235 2255 /* Allow HP also here, because HP's cfront compiler follows ARM to some extent */ 2236 if ((ARM_DEMANGLING || HP_DEMANGLING) && (*anchor = mystrstr (mangled, "__pt__")))2256 if ((ARM_DEMANGLING || HP_DEMANGLING) && (*anchor = strstr (mangled, "__pt__"))) 2237 2257 { 2238 2258 int len; … … 2249 2269 if (AUTO_DEMANGLING || EDG_DEMANGLING) 2250 2270 { 2251 if ((*anchor = mystrstr (mangled, "__tm__"))2252 || (*anchor = mystrstr (mangled, "__ps__"))2253 || (*anchor = mystrstr (mangled, "__pt__")))2271 if ((*anchor = strstr (mangled, "__tm__")) 2272 || (*anchor = strstr (mangled, "__ps__")) 2273 || (*anchor = strstr (mangled, "__pt__"))) 2254 2274 { 2255 2275 int len; … … 2264 2284 } 2265 2285 } 2266 else if ((*anchor = mystrstr (mangled, "__S")))2286 else if ((*anchor = strstr (mangled, "__S"))) 2267 2287 { 2268 2288 int len; … … 2314 2334 while (1) 2315 2335 { 2316 string_ clear(&arg);2336 string_delete (&arg); 2317 2337 switch (**mangled) 2318 2338 { … … 2371 2391 /* should do error checking here */ 2372 2392 while (args < e) { 2373 string_ clear(&arg);2393 string_delete (&arg); 2374 2394 2375 2395 /* Check for type or literal here */ … … 2386 2406 string_append (&arg, "("); 2387 2407 string_appends (&arg, &type_str); 2408 string_delete (&type_str); 2388 2409 string_append (&arg, ")"); 2389 2410 if (*args != 'L') … … 2403 2424 default: 2404 2425 /* Not handling other HP cfront stuff */ 2405 if (!do_type (work, &args, &arg)) 2406 goto cfront_template_args_done; 2426 { 2427 const char* old_args = args; 2428 if (!do_type (work, &args, &arg)) 2429 goto cfront_template_args_done; 2430 2431 /* Fail if we didn't make any progress: prevent infinite loop. */ 2432 if (args == old_args) 2433 return; 2434 } 2407 2435 } 2408 2436 string_appends (declp, &arg); … … 2565 2593 "__"-sequence. This is the normal case. */ 2566 2594 if (ARM_DEMANGLING || LUCID_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING 2567 || mystrstr (scan + 2, "__") == NULL)2595 || strstr (scan + 2, "__") == NULL) 2568 2596 { 2569 2597 demangle_function_name (work, mangled, declp, scan); … … 2708 2736 /* This block of code is a reduction in strength time optimization 2709 2737 of: 2710 scan = mystrstr (*mangled, "__"); */2738 scan = strstr (*mangled, "__"); */ 2711 2739 2712 2740 { … … 2800 2828 scan++; 2801 2829 } 2802 if ((scan = mystrstr (scan, "__")) == NULL || (*(scan + 2) == '\0'))2830 if ((scan = strstr (scan, "__")) == NULL || (*(scan + 2) == '\0')) 2803 2831 { 2804 2832 /* No separator (I.E. "__not_mangled"), or empty signature … … 3336 3364 else 3337 3365 { 3366 string_delete (&last_name); 3338 3367 success = do_type (work, mangled, &last_name); 3339 3368 if (!success) … … 3478 3507 const char *remembered_type; 3479 3508 int type_quals; 3480 string btype;3481 3509 type_kind_t tk = tk_none; 3482 3510 3483 string_init (&btype);3484 3511 string_init (&decl); 3485 3512 string_init (result); … … 3599 3626 do_type (work, mangled, &temp); 3600 3627 string_prepends (&decl, &temp); 3628 string_delete (&temp); 3601 3629 } 3602 3630 else if (**mangled == 't') … … 3609 3637 { 3610 3638 string_prependn (&decl, temp.b, temp.p - temp.b); 3611 string_ clear(&temp);3639 string_delete (&temp); 3612 3640 } 3613 3641 else … … 3789 3817 char buf[10]; 3790 3818 unsigned int dec = 0; 3791 string btype;3792 3819 type_kind_t tk = tk_integral; 3793 3794 string_init (&btype);3795 3820 3796 3821 /* First pick off any type qualifiers. There can be more than one. */ … … 3965 3990 case 't': 3966 3991 { 3992 string btype; 3993 string_init (&btype); 3967 3994 success = demangle_template (work, mangled, &btype, 0, 1, 1); 3968 3995 string_appends (result, &btype); 3996 string_delete (&btype); 3969 3997 break; 3970 3998 } … … 4168 4196 type vector when processing a repeated type. */ 4169 4197 if (work->previous_argument) 4170 string_ clear(work->previous_argument);4198 string_delete (work->previous_argument); 4171 4199 else 4172 { 4173 work->previous_argument = (string*) xmalloc (sizeof (string)); 4174 string_init (work->previous_argument); 4175 } 4200 work->previous_argument = (string*) xmalloc (sizeof (string)); 4176 4201 4177 4202 if (!do_type (work, mangled, work->previous_argument)) … … 4537 4562 /* Restore the previous_argument field. */ 4538 4563 if (work->previous_argument) 4539 string_delete (work->previous_argument); 4564 { 4565 string_delete (work->previous_argument); 4566 free ((char *) work->previous_argument); 4567 } 4540 4568 work->previous_argument = saved_previous_argument; 4541 4569 --work->forgetting_types; … … 4862 4890 string_append (s, buf); 4863 4891 } 4864 4865 /* To generate a standalone demangler program for testing purposes,4866 just compile and link this file with -DMAIN and libiberty.a. When4867 run, it demangles each command line arg, or each stdin string, and4868 prints the result on stdout. */4869 4870 #ifdef MAIN4871 4872 #include "getopt.h"4873 4874 static const char *program_name;4875 static const char *program_version = VERSION;4876 static int flags = DMGL_PARAMS | DMGL_ANSI;4877 4878 static void demangle_it PARAMS ((char *));4879 static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN;4880 static void fatal PARAMS ((const char *)) ATTRIBUTE_NORETURN;4881 static void print_demangler_list PARAMS ((FILE *));4882 4883 static void4884 demangle_it (mangled_name)4885 char *mangled_name;4886 {4887 char *result;4888 4889 result = cplus_demangle (mangled_name, flags);4890 if (result == NULL)4891 {4892 printf ("%s\n", mangled_name);4893 }4894 else4895 {4896 printf ("%s\n", result);4897 free (result);4898 }4899 }4900 4901 static void4902 print_demangler_list (stream)4903 FILE *stream;4904 {4905 struct demangler_engine *demangler;4906 4907 fprintf (stream, "{%s", libiberty_demanglers->demangling_style_name);4908 4909 for (demangler = libiberty_demanglers + 1;4910 demangler->demangling_style != unknown_demangling;4911 ++demangler)4912 fprintf (stream, ",%s", demangler->demangling_style_name);4913 4914 fprintf (stream, "}");4915 }4916 4917 static void4918 usage (stream, status)4919 FILE *stream;4920 int status;4921 {4922 fprintf (stream, "\4923 Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n",4924 program_name);4925 4926 fprintf (stream, "\4927 [-s ");4928 print_demangler_list (stream);4929 fprintf (stream, "]\n");4930 4931 fprintf (stream, "\4932 [--format ");4933 print_demangler_list (stream);4934 fprintf (stream, "]\n");4935 4936 fprintf (stream, "\4937 [--help] [--version] [arg...]\n");4938 exit (status);4939 }4940 4941 #define MBUF_SIZE 327674942 char mbuffer[MBUF_SIZE];4943 4944 /* Defined in the automatically-generated underscore.c. */4945 extern int prepends_underscore;4946 4947 int strip_underscore = 0;4948 4949 static struct option long_options[] = {4950 {"strip-underscores", no_argument, 0, '_'},4951 {"format", required_argument, 0, 's'},4952 {"help", no_argument, 0, 'h'},4953 {"java", no_argument, 0, 'j'},4954 {"no-strip-underscores", no_argument, 0, 'n'},4955 {"version", no_argument, 0, 'v'},4956 {0, no_argument, 0, 0}4957 };4958 4959 /* More 'friendly' abort that prints the line and file.4960 config.h can #define abort fancy_abort if you like that sort of thing. */4961 4962 void4963 fancy_abort ()4964 {4965 fatal ("Internal gcc abort.");4966 }4967 4968 4969 static const char *4970 standard_symbol_characters PARAMS ((void));4971 4972 static const char *4973 hp_symbol_characters PARAMS ((void));4974 4975 static const char *4976 gnu_v3_symbol_characters PARAMS ((void));4977 4978 /* Return the string of non-alnum characters that may occur4979 as a valid symbol component, in the standard assembler symbol4980 syntax. */4981 4982 static const char *4983 standard_symbol_characters ()4984 {4985 return "_$.";4986 }4987 4988 4989 /* Return the string of non-alnum characters that may occur4990 as a valid symbol name component in an HP object file.4991 4992 Note that, since HP's compiler generates object code straight from4993 C++ source, without going through an assembler, its mangled4994 identifiers can use all sorts of characters that no assembler would4995 tolerate, so the alphabet this function creates is a little odd.4996 Here are some sample mangled identifiers offered by HP:4997 4998 typeid*__XT24AddressIndExpClassMember_4999 [Vftptr]key:__dt__32OrdinaryCompareIndExpClassMemberFv5000 __ct__Q2_9Elf64_Dyn18{unnamed.union.#1}Fv5001 5002 This still seems really weird to me, since nowhere else in this5003 file is there anything to recognize curly brackets, parens, etc.5004 I've talked with Srikanth <srikanth@cup.hp.com>, and he assures me5005 this is right, but I still strongly suspect that there's a5006 misunderstanding here.5007 5008 If we decide it's better for c++filt to use HP's assembler syntax5009 to scrape identifiers out of its input, here's the definition of5010 the symbol name syntax from the HP assembler manual:5011 5012 Symbols are composed of uppercase and lowercase letters, decimal5013 digits, dollar symbol, period (.), ampersand (&), pound sign(#) and5014 underscore (_). A symbol can begin with a letter, digit underscore or5015 dollar sign. If a symbol begins with a digit, it must contain a5016 non-digit character.5017 5018 So have fun. */5019 static const char *5020 hp_symbol_characters ()5021 {5022 return "_$.<>#,*&[]:(){}";5023 }5024 5025 5026 /* Return the string of non-alnum characters that may occur5027 as a valid symbol component in the GNU C++ V3 ABI mangling5028 scheme. */5029 5030 static const char *5031 gnu_v3_symbol_characters ()5032 {5033 return "_$.";5034 }5035 5036 5037 extern int main PARAMS ((int, char **));5038 5039 int5040 main (argc, argv)5041 int argc;5042 char **argv;5043 {5044 char *result;5045 int c;5046 const char *valid_symbols;5047 5048 program_name = argv[0];5049 5050 strip_underscore = prepends_underscore;5051 5052 while ((c = getopt_long (argc, argv, "_ns:j", long_options, (int *) 0)) != EOF)5053 {5054 switch (c)5055 {5056 case '?':5057 usage (stderr, 1);5058 break;5059 case 'h':5060 usage (stdout, 0);5061 case 'n':5062 strip_underscore = 0;5063 break;5064 case 'v':5065 printf ("GNU %s (C++ demangler), version %s\n", program_name, program_version);5066 return (0);5067 case '_':5068 strip_underscore = 1;5069 break;5070 case 'j':5071 flags |= DMGL_JAVA;5072 break;5073 case 's':5074 {5075 enum demangling_styles style;5076 5077 style = cplus_demangle_name_to_style (optarg);5078 if (style == unknown_demangling)5079 {5080 fprintf (stderr, "%s: unknown demangling style `%s'\n",5081 program_name, optarg);5082 return (1);5083 }5084 else5085 cplus_demangle_set_style (style);5086 }5087 break;5088 }5089 }5090 5091 if (optind < argc)5092 {5093 for ( ; optind < argc; optind++)5094 {5095 demangle_it (argv[optind]);5096 }5097 }5098 else5099 {5100 switch (current_demangling_style)5101 {5102 case gnu_demangling:5103 case lucid_demangling:5104 case arm_demangling:5105 case java_demangling:5106 case edg_demangling:5107 case gnat_demangling:5108 case auto_demangling:5109 valid_symbols = standard_symbol_characters ();5110 break;5111 case hp_demangling:5112 valid_symbols = hp_symbol_characters ();5113 break;5114 case gnu_v3_demangling:5115 valid_symbols = gnu_v3_symbol_characters ();5116 break;5117 default:5118 /* Folks should explicitly indicate the appropriate alphabet for5119 each demangling. Providing a default would allow the5120 question to go unconsidered. */5121 abort ();5122 }5123 5124 for (;;)5125 {5126 int i = 0;5127 c = getchar ();5128 /* Try to read a label. */5129 while (c != EOF && (ISALNUM (c) || strchr (valid_symbols, c)))5130 {5131 if (i >= MBUF_SIZE-1)5132 break;5133 mbuffer[i++] = c;5134 c = getchar ();5135 }5136 if (i > 0)5137 {5138 int skip_first = 0;5139 5140 if (mbuffer[0] == '.')5141 ++skip_first;5142 if (strip_underscore && mbuffer[skip_first] == '_')5143 ++skip_first;5144 5145 if (skip_first > i)5146 skip_first = i;5147 5148 mbuffer[i] = 0;5149 5150 result = cplus_demangle (mbuffer + skip_first, flags);5151 if (result)5152 {5153 if (mbuffer[0] == '.')5154 putc ('.', stdout);5155 fputs (result, stdout);5156 free (result);5157 }5158 else5159 fputs (mbuffer, stdout);5160 5161 fflush (stdout);5162 }5163 if (c == EOF)5164 break;5165 putchar (c);5166 fflush (stdout);5167 }5168 }5169 5170 return (0);5171 }5172 5173 static void5174 fatal (str)5175 const char *str;5176 {5177 fprintf (stderr, "%s: %s\n", program_name, str);5178 exit (1);5179 }5180 5181 PTR5182 xmalloc (size)5183 size_t size;5184 {5185 register PTR value = (PTR) malloc (size);5186 if (value == 0)5187 fatal ("virtual memory exhausted");5188 return value;5189 }5190 5191 PTR5192 xrealloc (ptr, size)5193 PTR ptr;5194 size_t size;5195 {5196 register PTR value = (PTR) realloc (ptr, size);5197 if (value == 0)5198 fatal ("virtual memory exhausted");5199 return value;5200 }5201 #endif /* main */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/dyn-string.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* An abstract string datatype. 2 Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.2 Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. 3 3 Contributed by Mark Mitchell (mark@markmitchell.com). 4 4 … … 10 10 any later version. 11 11 12 In addition to the permissions in the GNU General Public License, the 13 Free Software Foundation gives you unlimited permission to link the 14 compiled version of this file into combinations with other programs, 15 and to distribute those combinations without any restriction coming 16 from the use of this file. (The General Public License restrictions 17 do apply in other respects; for example, they cover modification of 18 the file, and distribution when not linked into a combined 19 executable.) 20 12 21 GNU CC is distributed in the hope that it will be useful, 13 22 but WITHOUT ANY WARRANTY; without even the implied warranty of … … 42 51 through the call chain. */ 43 52 44 #if def IN_LIBGCC253 #if defined(IN_LIBGCC2) || defined(IN_GLIBCPP_V3) 45 54 #define RETURN_ON_ALLOCATION_FAILURE 46 55 #endif -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/fdmatch.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 21 21 /* 22 22 23 NAME 23 @deftypefn Extension int fdmatch (int @var{fd1}, int @var{fd2}) 24 24 25 fdmatch -- see if two file descriptors refer to same file 25 Check to see if two open file descriptors refer to the same file. 26 This is useful, for example, when we have an open file descriptor for 27 an unnamed file, and the name of a file that we believe to correspond 28 to that fd. This can happen when we are exec'd with an already open 29 file (@code{stdout} for example) or from the SVR4 @file{/proc} calls 30 that return open file descriptors for mapped address spaces. All we 31 have to do is open the file by name and check the two file descriptors 32 for a match, which is done by comparing major and minor device numbers 33 and inode numbers. 26 34 27 SYNOPSIS 28 29 int fdmatch (int fd1, int fd2) 30 31 DESCRIPTION 32 33 Check to see if two open file descriptors refer to the same file. 34 This is useful, for example, when we have an open file descriptor 35 for an unnamed file, and the name of a file that we believe to 36 correspond to that fd. This can happen when we are exec'd with 37 an already open file (stdout for example) or from the SVR4 /proc 38 calls that return open file descriptors for mapped address spaces. 39 All we have to do is open the file by name and check the two file 40 descriptors for a match, which is done by comparing major&minor 41 device numbers and inode numbers. 35 @end deftypefn 42 36 43 37 BUGS -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/floatformat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 18 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 19 19 20 #include "ansidecl.h" 20 21 #include "floatformat.h" 21 22 #include <math.h> /* ldexp */ 22 #ifdef __STDC__23 #ifdef ANSI_PROTOTYPES 23 24 #include <stddef.h> 24 25 extern void *memcpy (void *s1, const void *s2, size_t n); … … 67 68 floatformat_littlebyte_bigword, 64, 0, 1, 11, 1023, 2047, 12, 52, 68 69 floatformat_intbit_no, 69 "floatformat_ieee_double_little "70 "floatformat_ieee_double_littlebyte_bigword" 70 71 }; 71 72 … … 92 93 const struct floatformat floatformat_m88110_ext = 93 94 { 94 #ifdef HARRIS_FLOAT_FORMAT 95 floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64, 96 floatformat_intbit_yes, 97 "floatformat_m88110_ext" 98 }; 99 const struct floatformat floatformat_m88110_harris_ext = 100 { 95 101 /* Harris uses raw format 128 bytes long, but the number is just an ieee 96 102 double, and the last 64 bits are wasted. */ 97 103 floatformat_big,128, 0, 1, 11, 0x3ff, 0x7ff, 12, 52, 98 104 floatformat_intbit_no, 99 "floatformat_m88110_ext(harris)" 100 #else 101 floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64, 102 floatformat_intbit_yes, 103 "floatformat_m88110_ext" 104 #endif /* HARRIS_FLOAT_FORMAT */ 105 }; 106 const struct floatformat floatformat_arm_ext = 105 "floatformat_m88110_ext_harris" 106 }; 107 const struct floatformat floatformat_arm_ext_big = 107 108 { 108 109 /* Bits 1 to 16 are unused. */ 109 110 floatformat_big, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64, 110 111 floatformat_intbit_yes, 111 "floatformat_arm_ext" 112 "floatformat_arm_ext_big" 113 }; 114 const struct floatformat floatformat_arm_ext_littlebyte_bigword = 115 { 116 /* Bits 1 to 16 are unused. */ 117 floatformat_littlebyte_bigword, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64, 118 floatformat_intbit_yes, 119 "floatformat_arm_ext_littlebyte_bigword" 120 }; 121 const struct floatformat floatformat_ia64_spill_big = 122 { 123 floatformat_big, 128, 0, 1, 17, 65535, 0x1ffff, 18, 64, 124 floatformat_intbit_yes, 125 "floatformat_ia64_spill_big" 126 }; 127 const struct floatformat floatformat_ia64_spill_little = 128 { 129 floatformat_little, 128, 0, 1, 17, 65535, 0x1ffff, 18, 64, 130 floatformat_intbit_yes, 131 "floatformat_ia64_spill_little" 132 }; 133 const struct floatformat floatformat_ia64_quad_big = 134 { 135 floatformat_big, 128, 0, 1, 15, 16383, 0x7fff, 16, 112, 136 floatformat_intbit_no, 137 "floatformat_ia64_quad_big" 138 }; 139 const struct floatformat floatformat_ia64_quad_little = 140 { 141 floatformat_little, 128, 0, 1, 15, 16383, 0x7fff, 16, 112, 142 floatformat_intbit_no, 143 "floatformat_ia64_quad_little" 112 144 }; 113 145 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/getcwd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 3 3 4 4 /* 5 NAME6 getcwd -- get absolute pathname for current working directory7 5 8 SYNOPSIS 9 char *getcwd (char pathname[len], len) 6 @deftypefn Supplemental char* getcwd (char *@var{pathname}, int @var{len}) 10 7 11 DESCRIPTION 12 Copy the absolute pathname for the current working directory into 13 the supplied buffer and return a pointer to the buffer. If the 14 current directory's path doesn't fit in LEN characters, the result 15 is NULL and errno is set. 8 Copy the absolute pathname for the current working directory into 9 @var{pathname}, which is assumed to point to a buffer of at least 10 @var{len} bytes, and return a pointer to the buffer. If the current 11 directory's path doesn't fit in @var{len} characters, the result is 12 @code{NULL} and @code{errno} is set. If @var{pathname} is a null pointer, 13 @code{getcwd} will obtain @var{len} bytes of space using 14 @code{malloc}. 16 15 17 If pathname is a null pointer, getcwd() will obtain size bytes of 18 space using malloc. 19 20 BUGS 21 Emulated via the getwd() call, which is reasonable for most 22 systems that do not have getcwd(). 16 @end deftypefn 23 17 24 18 */ … … 47 41 getcwd (buf, len) 48 42 char *buf; 49 int len;43 size_t len; 50 44 { 51 45 char ourbuf[MAXPATHLEN]; -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/getopt.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 84 84 /* This is for other GNU distributions with internationalized messages. 85 85 When compiling libc, the _ macro is predefined. */ 86 # if def HAVE_LIBINTL_H86 # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC 87 87 # include <libintl.h> 88 88 # define _(msgid) gettext (msgid) … … 337 337 else 338 338 { 339 memset ( __mempcpy (new_str, __getopt_nonoption_flags,340 339 memset (mempcpy (new_str, __getopt_nonoption_flags, 340 nonoption_flags_max_len), 341 341 '\0', top + 1 - nonoption_flags_max_len); 342 342 nonoption_flags_max_len = top + 1; … … 448 448 nonoption_flags_max_len = -1; 449 449 else 450 memset ( __mempcpy (__getopt_nonoption_flags, orig_str, len),450 memset (mempcpy (__getopt_nonoption_flags, orig_str, len), 451 451 '\0', nonoption_flags_max_len - len); 452 452 } -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/getpagesize.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 3 3 /* 4 4 5 NAME 5 @deftypefn Supplemental int getpagesize (void) 6 6 7 getpagesize -- return the number of bytes in page of memory 7 Returns the number of bytes in a page of memory. This is the 8 granularity of many of the system memory management routines. No 9 guarantee is made as to whether or not it is the same as the basic 10 memory management hardware page size. 8 11 9 SYNOPSIS 10 11 int getpagesize (void) 12 13 DESCRIPTION 14 15 Returns the number of bytes in a page of memory. This is the 16 granularity of many of the system memory management routines. 17 No guarantee is made as to whether or not it is the same as the 18 basic memory management hardware page size. 12 @end deftypefn 19 13 20 14 BUGS -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/getpwd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* getpwd.c - get the working directory */ 2 3 /* 4 5 @deftypefn Supplemental char* getpwd (void) 6 7 Returns the current working directory. This implementation caches the 8 result on the assumption that the process will not call @code{chdir} 9 between calls to @code{getpwd}. 10 11 @end deftypefn 12 13 */ 2 14 3 15 #ifdef HAVE_CONFIG_H -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/getruntime.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Return time used so far, in microseconds. 2 Copyright (C) 1994, 1999 Free Software Foundation, Inc.2 Copyright (C) 1994, 1999, 2002 Free Software Foundation, Inc. 3 3 4 4 This file is part of the libiberty library. … … 22 22 #include "ansidecl.h" 23 23 #include "libiberty.h" 24 25 /* On some systems (such as WindISS), you must include <sys/types.h> 26 to get the definition of "time_t" before you include <time.h>. */ 27 #include <sys/types.h> 24 28 25 29 /* There are several ways to get elapsed execution time; unfortunately no … … 74 78 #endif 75 79 80 /* 81 82 @deftypefn Replacement long get_run_time (void) 83 84 Returns the time used so far, in microseconds. If possible, this is 85 the time used by this process, else it is the elapsed time since the 86 process started. 87 88 @end deftypefn 89 90 */ 91 76 92 long 77 93 get_run_time () -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/hashtab.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* An expandable hash tables datatype. 2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.2 Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 3 3 Contributed by Vladimir Makarov (vmakarov@cygnus.com). 4 4 … … 81 81 /* These are primes that are near, but slightly smaller than, a 82 82 power of two. */ 83 static unsigned long primes[] = {84 2,85 7,86 13,87 31,88 61,89 127,90 251,91 509,92 1021,93 2039,94 4093,95 8191,96 16381,97 32749,98 65521,99 131071,100 262139,101 524287,102 1048573,103 2097143,104 4194301,105 8388593,106 16777213,107 33554393,108 67108859,109 134217689,110 268435399,111 536870909,112 1073741789,113 2147483647, 114 429496729183 static const unsigned long primes[] = { 84 (unsigned long) 7, 85 (unsigned long) 13, 86 (unsigned long) 31, 87 (unsigned long) 61, 88 (unsigned long) 127, 89 (unsigned long) 251, 90 (unsigned long) 509, 91 (unsigned long) 1021, 92 (unsigned long) 2039, 93 (unsigned long) 4093, 94 (unsigned long) 8191, 95 (unsigned long) 16381, 96 (unsigned long) 32749, 97 (unsigned long) 65521, 98 (unsigned long) 131071, 99 (unsigned long) 262139, 100 (unsigned long) 524287, 101 (unsigned long) 1048573, 102 (unsigned long) 2097143, 103 (unsigned long) 4194301, 104 (unsigned long) 8388593, 105 (unsigned long) 16777213, 106 (unsigned long) 33554393, 107 (unsigned long) 67108859, 108 (unsigned long) 134217689, 109 (unsigned long) 268435399, 110 (unsigned long) 536870909, 111 (unsigned long) 1073741789, 112 (unsigned long) 2147483647, 113 /* 4294967291L */ 114 ((unsigned long) 2147483647) + ((unsigned long) 2147483644), 115 115 }; 116 116 117 unsigned long*low = &primes[0];118 unsigned long*high = &primes[sizeof(primes) / sizeof(primes[0])];117 const unsigned long *low = &primes[0]; 118 const unsigned long *high = &primes[sizeof(primes) / sizeof(primes[0])]; 119 119 120 120 while (low != high) 121 121 { 122 unsigned long*mid = low + (high - low) / 2;122 const unsigned long *mid = low + (high - low) / 2; 123 123 if (n > *mid) 124 124 low = mid + 1; … … 159 159 source length. Created hash table is initiated as empty (all the 160 160 hash table entries are EMPTY_ENTRY). The function returns the 161 created hash table. Memory allocation must not fail. */ 162 161 created hash table, or NULL if memory allocation fails. */ 162 163 htab_t 164 htab_create_alloc (size, hash_f, eq_f, del_f, alloc_f, free_f) 165 size_t size; 166 htab_hash hash_f; 167 htab_eq eq_f; 168 htab_del del_f; 169 htab_alloc alloc_f; 170 htab_free free_f; 171 { 172 htab_t result; 173 174 size = higher_prime_number (size); 175 result = (htab_t) (*alloc_f) (1, sizeof (struct htab)); 176 if (result == NULL) 177 return NULL; 178 result->entries = (PTR *) (*alloc_f) (size, sizeof (PTR)); 179 if (result->entries == NULL) 180 { 181 if (free_f != NULL) 182 (*free_f) (result); 183 return NULL; 184 } 185 result->size = size; 186 result->hash_f = hash_f; 187 result->eq_f = eq_f; 188 result->del_f = del_f; 189 result->alloc_f = alloc_f; 190 result->free_f = free_f; 191 return result; 192 } 193 194 /* As above, but use the variants of alloc_f and free_f which accept 195 an extra argument. */ 196 197 htab_t 198 htab_create_alloc_ex (size, hash_f, eq_f, del_f, alloc_arg, alloc_f, 199 free_f) 200 size_t size; 201 htab_hash hash_f; 202 htab_eq eq_f; 203 htab_del del_f; 204 PTR alloc_arg; 205 htab_alloc_with_arg alloc_f; 206 htab_free_with_arg free_f; 207 { 208 htab_t result; 209 210 size = higher_prime_number (size); 211 result = (htab_t) (*alloc_f) (alloc_arg, 1, sizeof (struct htab)); 212 if (result == NULL) 213 return NULL; 214 result->entries = (PTR *) (*alloc_f) (alloc_arg, size, sizeof (PTR)); 215 if (result->entries == NULL) 216 { 217 if (free_f != NULL) 218 (*free_f) (alloc_arg, result); 219 return NULL; 220 } 221 result->size = size; 222 result->hash_f = hash_f; 223 result->eq_f = eq_f; 224 result->del_f = del_f; 225 result->alloc_arg = alloc_arg; 226 result->alloc_with_arg_f = alloc_f; 227 result->free_with_arg_f = free_f; 228 return result; 229 } 230 231 /* Update the function pointers and allocation parameter in the htab_t. */ 232 233 void 234 htab_set_functions_ex (htab, hash_f, eq_f, del_f, alloc_arg, alloc_f, free_f) 235 htab_t htab; 236 htab_hash hash_f; 237 htab_eq eq_f; 238 htab_del del_f; 239 PTR alloc_arg; 240 htab_alloc_with_arg alloc_f; 241 htab_free_with_arg free_f; 242 { 243 htab->hash_f = hash_f; 244 htab->eq_f = eq_f; 245 htab->del_f = del_f; 246 htab->alloc_arg = alloc_arg; 247 htab->alloc_with_arg_f = alloc_f; 248 htab->free_with_arg_f = free_f; 249 } 250 251 /* These functions exist solely for backward compatibility. */ 252 253 #undef htab_create 163 254 htab_t 164 255 htab_create (size, hash_f, eq_f, del_f) … … 168 259 htab_del del_f; 169 260 { 170 htab_t result; 171 172 size = higher_prime_number (size); 173 result = (htab_t) xcalloc (1, sizeof (struct htab)); 174 result->entries = (PTR *) xcalloc (size, sizeof (PTR)); 175 result->size = size; 176 result->hash_f = hash_f; 177 result->eq_f = eq_f; 178 result->del_f = del_f; 179 result->return_allocation_failure = 0; 180 return result; 181 } 182 183 /* This function creates table with length slightly longer than given 184 source length. The created hash table is initiated as empty (all the 185 hash table entries are EMPTY_ENTRY). The function returns the created 186 hash table. Memory allocation may fail; it may return NULL. */ 261 return htab_create_alloc (size, hash_f, eq_f, del_f, xcalloc, free); 262 } 187 263 188 264 htab_t … … 193 269 htab_del del_f; 194 270 { 195 htab_t result; 196 197 size = higher_prime_number (size); 198 result = (htab_t) calloc (1, sizeof (struct htab)); 199 if (result == NULL) 200 return NULL; 201 202 result->entries = (PTR *) calloc (size, sizeof (PTR)); 203 if (result->entries == NULL) 204 { 205 free (result); 206 return NULL; 207 } 208 209 result->size = size; 210 result->hash_f = hash_f; 211 result->eq_f = eq_f; 212 result->del_f = del_f; 213 result->return_allocation_failure = 1; 214 return result; 271 return htab_create_alloc (size, hash_f, eq_f, del_f, calloc, free); 215 272 } 216 273 … … 230 287 (*htab->del_f) (htab->entries[i]); 231 288 232 free (htab->entries); 233 free (htab); 289 if (htab->free_f != NULL) 290 { 291 (*htab->free_f) (htab->entries); 292 (*htab->free_f) (htab); 293 } 294 else if (htab->free_with_arg_f != NULL) 295 { 296 (*htab->free_with_arg_f) (htab->alloc_arg, htab->entries); 297 (*htab->free_with_arg_f) (htab->alloc_arg, htab); 298 } 234 299 } 235 300 … … 264 329 { 265 330 size_t size = htab->size; 266 hashval_t hash2 = 1 + hash % (size - 2);267 331 unsigned int index = hash % size; 268 332 PTR *slot = htab->entries + index; 333 hashval_t hash2; 334 335 if (*slot == EMPTY_ENTRY) 336 return slot; 337 else if (*slot == DELETED_ENTRY) 338 abort (); 339 340 hash2 = 1 + hash % (size - 2); 269 341 for (;;) 270 342 { 271 PTR *slot = htab->entries + index; 272 343 index += hash2; 344 if (index >= size) 345 index -= size; 346 347 slot = htab->entries + index; 273 348 if (*slot == EMPTY_ENTRY) 274 349 return slot; 275 350 else if (*slot == DELETED_ENTRY) 276 351 abort (); 277 278 index += hash2;279 if (index >= size)280 index -= size;281 352 } 282 353 } … … 297 368 PTR *olimit; 298 369 PTR *p; 370 PTR *nentries; 371 size_t nsize; 299 372 300 373 oentries = htab->entries; 301 374 olimit = oentries + htab->size; 302 375 303 htab->size = higher_prime_number (htab->size * 2); 304 305 if (htab->return_allocation_failure) 306 { 307 PTR *nentries = (PTR *) calloc (htab->size, sizeof (PTR *)); 308 if (nentries == NULL) 309 return 0; 310 htab->entries = nentries; 311 } 376 /* Resize only when table after removal of unused elements is either 377 too full or too empty. */ 378 if ((htab->n_elements - htab->n_deleted) * 2 > htab->size 379 || ((htab->n_elements - htab->n_deleted) * 8 < htab->size 380 && htab->size > 32)) 381 nsize = higher_prime_number ((htab->n_elements - htab->n_deleted) * 2); 312 382 else 313 htab->entries = (PTR *) xcalloc (htab->size, sizeof (PTR *)); 383 nsize = htab->size; 384 385 if (htab->alloc_with_arg_f != NULL) 386 nentries = (PTR *) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize, 387 sizeof (PTR *)); 388 else 389 nentries = (PTR *) (*htab->alloc_f) (nsize, sizeof (PTR *)); 390 if (nentries == NULL) 391 return 0; 392 htab->entries = nentries; 393 htab->size = nsize; 314 394 315 395 htab->n_elements -= htab->n_deleted; … … 332 412 while (p < olimit); 333 413 334 free (oentries); 414 if (htab->free_f != NULL) 415 (*htab->free_f) (oentries); 416 else if (htab->free_with_arg_f != NULL) 417 (*htab->free_with_arg_f) (htab->alloc_arg, oentries); 335 418 return 1; 336 419 } … … 405 488 hashval_t hash2; 406 489 size_t size; 490 PTR entry; 407 491 408 492 if (insert == INSERT && htab->size * 3 <= htab->n_elements * 4 … … 411 495 412 496 size = htab->size; 413 hash2 = 1 + hash % (size - 2);414 497 index = hash % size; 415 498 … … 417 500 first_deleted_slot = NULL; 418 501 502 entry = htab->entries[index]; 503 if (entry == EMPTY_ENTRY) 504 goto empty_entry; 505 else if (entry == DELETED_ENTRY) 506 first_deleted_slot = &htab->entries[index]; 507 else if ((*htab->eq_f) (entry, element)) 508 return &htab->entries[index]; 509 510 hash2 = 1 + hash % (size - 2); 419 511 for (;;) 420 512 { 421 PTR entry = htab->entries[index]; 513 htab->collisions++; 514 index += hash2; 515 if (index >= size) 516 index -= size; 517 518 entry = htab->entries[index]; 422 519 if (entry == EMPTY_ENTRY) 423 { 424 if (insert == NO_INSERT) 425 return NULL; 426 427 htab->n_elements++; 428 429 if (first_deleted_slot) 430 { 431 *first_deleted_slot = EMPTY_ENTRY; 432 return first_deleted_slot; 433 } 434 435 return &htab->entries[index]; 436 } 437 438 if (entry == DELETED_ENTRY) 520 goto empty_entry; 521 else if (entry == DELETED_ENTRY) 439 522 { 440 523 if (!first_deleted_slot) 441 524 first_deleted_slot = &htab->entries[index]; 442 525 } 443 else 526 else if ((*htab->eq_f) (entry, element)) 444 527 return &htab->entries[index]; 445 446 htab->collisions++; 447 index += hash2; 448 if (index >= size) 449 index -= size; 450 } 528 } 529 530 empty_entry: 531 if (insert == NO_INSERT) 532 return NULL; 533 534 htab->n_elements++; 535 536 if (first_deleted_slot) 537 { 538 *first_deleted_slot = EMPTY_ENTRY; 539 return first_deleted_slot; 540 } 541 542 return &htab->entries[index]; 451 543 } 452 544 … … 512 604 513 605 void 514 htab_traverse (htab, callback, info)606 htab_traverse_noresize (htab, callback, info) 515 607 htab_t htab; 516 608 htab_trav callback; 517 609 PTR info; 518 610 { 519 PTR *slot = htab->entries; 520 PTR *limit = slot + htab->size; 611 PTR *slot; 612 PTR *limit; 613 614 slot = htab->entries; 615 limit = slot + htab->size; 521 616 522 617 do … … 531 626 } 532 627 628 /* Like htab_traverse_noresize, but does resize the table when it is 629 too empty to improve effectivity of subsequent calls. */ 630 631 void 632 htab_traverse (htab, callback, info) 633 htab_t htab; 634 htab_trav callback; 635 PTR info; 636 { 637 if ((htab->n_elements - htab->n_deleted) * 8 < htab->size) 638 htab_expand (htab); 639 640 htab_traverse_noresize (htab, callback, info); 641 } 642 533 643 /* Return the current size of given hash table. */ 534 644 … … 561 671 return (double) htab->collisions / (double) htab->searches; 562 672 } 673 674 /* Hash P as a null-terminated string. 675 676 Copied from gcc/hashtable.c. Zack had the following to say with respect 677 to applicability, though note that unlike hashtable.c, this hash table 678 implementation re-hashes rather than chain buckets. 679 680 http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01021.html 681 From: Zack Weinberg <zackw@panix.com> 682 Date: Fri, 17 Aug 2001 02:15:56 -0400 683 684 I got it by extracting all the identifiers from all the source code 685 I had lying around in mid-1999, and testing many recurrences of 686 the form "H_n = H_{n-1} * K + c_n * L + M" where K, L, M were either 687 prime numbers or the appropriate identity. This was the best one. 688 I don't remember exactly what constituted "best", except I was 689 looking at bucket-length distributions mostly. 690 691 So it should be very good at hashing identifiers, but might not be 692 as good at arbitrary strings. 693 694 I'll add that it thoroughly trounces the hash functions recommended 695 for this use at http://burtleburtle.net/bob/hash/index.html, both 696 on speed and bucket distribution. I haven't tried it against the 697 function they just started using for Perl's hashes. */ 698 699 hashval_t 700 htab_hash_string (p) 701 const PTR p; 702 { 703 const unsigned char *str = (const unsigned char *) p; 704 hashval_t r = 0; 705 unsigned char c; 706 707 while ((c = *str++) != 0) 708 r = r * 67 + c - 113; 709 710 return r; 711 } -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/hex.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Hex character manipulation support. 2 Copyright (C) 1995 Free Software Foundation, Inc.2 Copyright (C) 1995, 2001 Free Software Foundation, Inc. 3 3 4 4 This file is part of the libiberty library. … … 18 18 Boston, MA 02111-1307, USA. */ 19 19 20 #include <stdio.h> /* for EOF */ 20 21 #include "libiberty.h" 22 23 /* 24 25 @deftypefn Extension void hex_init (void) 26 27 Initializes the array mapping the current character set to 28 corresponding hex values. This function must be called before any 29 call to @code{hex_p} or @code{hex_value}. If you fail to call it, a 30 default ASCII-based table will normally be used on ASCII systems. 31 32 @end deftypefn 33 34 @deftypefn Extension int hex_p (int @var{c}) 35 36 Evaluates to non-zero if the given character is a valid hex character, 37 or zero if it is not. Note that the value you pass will be cast to 38 @code{unsigned char} within the macro. 39 40 @end deftypefn 41 42 @deftypefn Extension int hex_value (int @var{c}) 43 44 Returns the numeric equivalent of the given character when interpreted 45 as a hexidecimal digit. The result is undefined if you pass an 46 invalid hex digit. Note that the value you pass will be cast to 47 @code{unsigned char} within the macro. 48 49 @end deftypefn 50 51 @undocumented _hex_array_size 52 @undocumented _hex_bad 53 @undocumented _hex_value 54 55 */ 56 57 58 /* Are we ASCII? */ 59 #if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \ 60 && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \ 61 && EOF == -1 62 63 const char _hex_value[_hex_array_size] = 64 { 65 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* NUL SOH STX ETX */ 66 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* EOT ENQ ACK BEL */ 67 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* BS HT LF VT */ 68 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* FF CR SO SI */ 69 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* DLE DC1 DC2 DC3 */ 70 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* DC4 NAK SYN ETB */ 71 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* CAN EM SUB ESC */ 72 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* FS GS RS US */ 73 74 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SP ! " # */ 75 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* $ % & ' */ 76 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* ( ) * + */ 77 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* , - . / */ 78 0, 1, 2, 3, /* 0 1 2 3 */ 79 4, 5, 6, 7, /* 4 5 6 7 */ 80 8, 9, _hex_bad, _hex_bad, /* 8 9 : ; */ 81 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* < = > ? */ 82 83 _hex_bad, 10, 11, 12, /* @ A B C */ 84 13, 14, 15, _hex_bad, /* D E F G */ 85 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* H I J K */ 86 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* L M N O */ 87 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* P Q R S */ 88 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* T U V W */ 89 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* X Y Z [ */ 90 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* \ ] ^ _ */ 91 92 _hex_bad, 10, 11, 12, /* ` a b c */ 93 13, 14, 15, _hex_bad, /* d e f g */ 94 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* h i j k */ 95 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* l m n o */ 96 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* p q r s */ 97 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* t u v w */ 98 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* x y z { */ 99 _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* | } ~ DEL */ 100 101 /* The high half of unsigned char, all values are _hex_bad. */ 102 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 103 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 104 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 105 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 106 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 107 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 108 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 109 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 110 111 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 112 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 113 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 114 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 115 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 116 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 117 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 118 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 119 120 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 121 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 122 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 123 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 124 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 125 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 126 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 127 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 128 129 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 130 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 131 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 132 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 133 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 134 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 135 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 136 _hex_bad, _hex_bad, _hex_bad, _hex_bad, 137 }; 138 #define HEX_TABLE_INITIALIZED 139 140 #else 21 141 22 142 char _hex_value[_hex_array_size]; 23 143 24 void hex_init () 144 #endif /* not ASCII */ 145 146 void 147 hex_init () 25 148 { 149 #ifndef HEX_TABLE_INITIALIZED 26 150 int i; 27 for (i = 0; i < _hex_array_size; i++) 28 _hex_value[i] = _hex_bad; 29 for (i = 0; i < 10; i++) 30 _hex_value['0' + i] = i; 31 for (i = 0; i < 6; i++) 32 _hex_value['a' + i] = _hex_value['A' + i] = 10 + i; 151 152 for (i=0; i<_hex_array_size; i++) 153 { 154 switch (i) 155 { 156 case '0': _hex_value[i] = 0; break; 157 case '1': _hex_value[i] = 1; break; 158 case '2': _hex_value[i] = 2; break; 159 case '3': _hex_value[i] = 3; break; 160 case '4': _hex_value[i] = 4; break; 161 case '5': _hex_value[i] = 5; break; 162 case '6': _hex_value[i] = 6; break; 163 case '7': _hex_value[i] = 7; break; 164 case '8': _hex_value[i] = 8; break; 165 case '9': _hex_value[i] = 9; break; 166 167 case 'a': case 'A': _hex_value[i] = 10; break; 168 case 'b': case 'B': _hex_value[i] = 11; break; 169 case 'c': case 'C': _hex_value[i] = 12; break; 170 case 'd': case 'D': _hex_value[i] = 13; break; 171 case 'e': case 'E': _hex_value[i] = 14; break; 172 case 'f': case 'F': _hex_value[i] = 15; break; 173 174 default: 175 _hex_value[i] = _hex_bad; 176 break; 177 } 178 } 179 #endif 33 180 } -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/index.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Stub implementation of (obsolete) index(). */ 2 3 /* 4 5 @deftypefn Supplemental char* index (char *@var{s}, int @var{c}) 6 7 Returns a pointer to the first occurrence of the character @var{c} in 8 the string @var{s}, or @code{NULL} if not found. The use of @code{index} is 9 deprecated in new programs in favor of @code{strchr}. 10 11 @end deftypefn 12 13 */ 2 14 3 15 extern char * strchr(); -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/insque.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 3 3 4 4 /* 5 NAME6 insque, remque -- insert, remove an element from a queue7 5 8 SYNOPSIS 9 struct qelem { 10 struct qelem *q_forw; 11 struct qelem *q_back; 12 char q_data[]; 13 }; 6 @deftypefn Supplemental void insque (struct qelem *@var{elem}, struct qelem *@var{pred}) 7 @deftypefnx Supplemental void remque (struct qelem *@var{elem}) 14 8 15 void insque (struct qelem *elem, struct qelem *pred) 9 Routines to manipulate queues built from doubly linked lists. The 10 @code{insque} routine inserts @var{elem} in the queue immediately 11 after @var{pred}. The @code{remque} routine removes @var{elem} from 12 its containing queue. These routines expect to be passed pointers to 13 structures which have as their first members a forward pointer and a 14 back pointer, like this prototype (although no prototype is provided): 16 15 17 void remque (struct qelem *elem) 16 @example 17 struct qelem @{ 18 struct qelem *q_forw; 19 struct qelem *q_back; 20 char q_data[]; 21 @}; 22 @end example 18 23 19 DESCRIPTION 20 Routines to manipulate queues built from doubly linked lists. 21 The insque routine inserts ELEM in the queue immediately after 22 PRED. The remque routine removes ELEM from its containing queue. 24 @end deftypefn 25 23 26 */ 24 27 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/md5.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 66 66 struct md5_ctx *ctx; 67 67 { 68 ctx->A = 0x67452301;69 ctx->B = 0xefcdab89;70 ctx->C = 0x98badcfe;71 ctx->D = 0x10325476;68 ctx->A = (md5_uint32) 0x67452301; 69 ctx->B = (md5_uint32) 0xefcdab89; 70 ctx->C = (md5_uint32) 0x98badcfe; 71 ctx->D = (md5_uint32) 0x10325476; 72 72 73 73 ctx->total[0] = ctx->total[1] = 0; … … 230 230 } 231 231 232 buffer = (const char *) buffer + add;232 buffer = (const void *) ((const char *) buffer + add); 233 233 len -= add; 234 234 } … … 238 238 { 239 239 md5_process_block (buffer, len & ~63, ctx); 240 buffer = (const char *) buffer + (len & ~63);240 buffer = (const void *) ((const char *) buffer + (len & ~63)); 241 241 len &= 63; 242 242 } … … 270 270 { 271 271 md5_uint32 correct_words[16]; 272 const md5_uint32 *words = buffer;272 const md5_uint32 *words = (const md5_uint32 *) buffer; 273 273 size_t nwords = len / sizeof (md5_uint32); 274 274 const md5_uint32 *endp = words + nwords; … … 323 323 324 324 /* Round 1. */ 325 OP (A, B, C, D, 7, 0xd76aa478);326 OP (D, A, B, C, 12, 0xe8c7b756);327 OP (C, D, A, B, 17, 0x242070db);328 OP (B, C, D, A, 22, 0xc1bdceee);329 OP (A, B, C, D, 7, 0xf57c0faf);330 OP (D, A, B, C, 12, 0x4787c62a);331 OP (C, D, A, B, 17, 0xa8304613);332 OP (B, C, D, A, 22, 0xfd469501);333 OP (A, B, C, D, 7, 0x698098d8);334 OP (D, A, B, C, 12, 0x8b44f7af);335 OP (C, D, A, B, 17, 0xffff5bb1);336 OP (B, C, D, A, 22, 0x895cd7be);337 OP (A, B, C, D, 7, 0x6b901122);338 OP (D, A, B, C, 12, 0xfd987193);339 OP (C, D, A, B, 17, 0xa679438e);340 OP (B, C, D, A, 22, 0x49b40821);325 OP (A, B, C, D, 7, (md5_uint32) 0xd76aa478); 326 OP (D, A, B, C, 12, (md5_uint32) 0xe8c7b756); 327 OP (C, D, A, B, 17, (md5_uint32) 0x242070db); 328 OP (B, C, D, A, 22, (md5_uint32) 0xc1bdceee); 329 OP (A, B, C, D, 7, (md5_uint32) 0xf57c0faf); 330 OP (D, A, B, C, 12, (md5_uint32) 0x4787c62a); 331 OP (C, D, A, B, 17, (md5_uint32) 0xa8304613); 332 OP (B, C, D, A, 22, (md5_uint32) 0xfd469501); 333 OP (A, B, C, D, 7, (md5_uint32) 0x698098d8); 334 OP (D, A, B, C, 12, (md5_uint32) 0x8b44f7af); 335 OP (C, D, A, B, 17, (md5_uint32) 0xffff5bb1); 336 OP (B, C, D, A, 22, (md5_uint32) 0x895cd7be); 337 OP (A, B, C, D, 7, (md5_uint32) 0x6b901122); 338 OP (D, A, B, C, 12, (md5_uint32) 0xfd987193); 339 OP (C, D, A, B, 17, (md5_uint32) 0xa679438e); 340 OP (B, C, D, A, 22, (md5_uint32) 0x49b40821); 341 341 342 342 /* For the second to fourth round we have the possibly swapped words … … 344 344 argument specifying the function to use. */ 345 345 #undef OP 346 #define OP( f, a, b, c, d, k, s, T)\346 #define OP(a, b, c, d, k, s, T) \ 347 347 do \ 348 348 { \ 349 a += f(b, c, d) + correct_words[k] + T; \349 a += FX (b, c, d) + correct_words[k] + T; \ 350 350 CYCLIC (a, s); \ 351 351 a += b; \ … … 353 353 while (0) 354 354 355 #define FX(b, c, d) FG (b, c, d) 356 355 357 /* Round 2. */ 356 OP (FG, A, B, C, D, 1, 5, 0xf61e2562); 357 OP (FG, D, A, B, C, 6, 9, 0xc040b340); 358 OP (FG, C, D, A, B, 11, 14, 0x265e5a51); 359 OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); 360 OP (FG, A, B, C, D, 5, 5, 0xd62f105d); 361 OP (FG, D, A, B, C, 10, 9, 0x02441453); 362 OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); 363 OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); 364 OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); 365 OP (FG, D, A, B, C, 14, 9, 0xc33707d6); 366 OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); 367 OP (FG, B, C, D, A, 8, 20, 0x455a14ed); 368 OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); 369 OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); 370 OP (FG, C, D, A, B, 7, 14, 0x676f02d9); 371 OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); 358 OP (A, B, C, D, 1, 5, (md5_uint32) 0xf61e2562); 359 OP (D, A, B, C, 6, 9, (md5_uint32) 0xc040b340); 360 OP (C, D, A, B, 11, 14, (md5_uint32) 0x265e5a51); 361 OP (B, C, D, A, 0, 20, (md5_uint32) 0xe9b6c7aa); 362 OP (A, B, C, D, 5, 5, (md5_uint32) 0xd62f105d); 363 OP (D, A, B, C, 10, 9, (md5_uint32) 0x02441453); 364 OP (C, D, A, B, 15, 14, (md5_uint32) 0xd8a1e681); 365 OP (B, C, D, A, 4, 20, (md5_uint32) 0xe7d3fbc8); 366 OP (A, B, C, D, 9, 5, (md5_uint32) 0x21e1cde6); 367 OP (D, A, B, C, 14, 9, (md5_uint32) 0xc33707d6); 368 OP (C, D, A, B, 3, 14, (md5_uint32) 0xf4d50d87); 369 OP (B, C, D, A, 8, 20, (md5_uint32) 0x455a14ed); 370 OP (A, B, C, D, 13, 5, (md5_uint32) 0xa9e3e905); 371 OP (D, A, B, C, 2, 9, (md5_uint32) 0xfcefa3f8); 372 OP (C, D, A, B, 7, 14, (md5_uint32) 0x676f02d9); 373 OP (B, C, D, A, 12, 20, (md5_uint32) 0x8d2a4c8a); 374 375 #undef FX 376 #define FX(b, c, d) FH (b, c, d) 372 377 373 378 /* Round 3. */ 374 OP (FH, A, B, C, D, 5, 4, 0xfffa3942); 375 OP (FH, D, A, B, C, 8, 11, 0x8771f681); 376 OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); 377 OP (FH, B, C, D, A, 14, 23, 0xfde5380c); 378 OP (FH, A, B, C, D, 1, 4, 0xa4beea44); 379 OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); 380 OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); 381 OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); 382 OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); 383 OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); 384 OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); 385 OP (FH, B, C, D, A, 6, 23, 0x04881d05); 386 OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); 387 OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); 388 OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); 389 OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); 379 OP (A, B, C, D, 5, 4, (md5_uint32) 0xfffa3942); 380 OP (D, A, B, C, 8, 11, (md5_uint32) 0x8771f681); 381 OP (C, D, A, B, 11, 16, (md5_uint32) 0x6d9d6122); 382 OP (B, C, D, A, 14, 23, (md5_uint32) 0xfde5380c); 383 OP (A, B, C, D, 1, 4, (md5_uint32) 0xa4beea44); 384 OP (D, A, B, C, 4, 11, (md5_uint32) 0x4bdecfa9); 385 OP (C, D, A, B, 7, 16, (md5_uint32) 0xf6bb4b60); 386 OP (B, C, D, A, 10, 23, (md5_uint32) 0xbebfbc70); 387 OP (A, B, C, D, 13, 4, (md5_uint32) 0x289b7ec6); 388 OP (D, A, B, C, 0, 11, (md5_uint32) 0xeaa127fa); 389 OP (C, D, A, B, 3, 16, (md5_uint32) 0xd4ef3085); 390 OP (B, C, D, A, 6, 23, (md5_uint32) 0x04881d05); 391 OP (A, B, C, D, 9, 4, (md5_uint32) 0xd9d4d039); 392 OP (D, A, B, C, 12, 11, (md5_uint32) 0xe6db99e5); 393 OP (C, D, A, B, 15, 16, (md5_uint32) 0x1fa27cf8); 394 OP (B, C, D, A, 2, 23, (md5_uint32) 0xc4ac5665); 395 396 #undef FX 397 #define FX(b, c, d) FI (b, c, d) 390 398 391 399 /* Round 4. */ 392 OP ( FI, A, B, C, D, 0, 6,0xf4292244);393 OP ( FI, D, A, B, C, 7, 10,0x432aff97);394 OP ( FI, C, D, A, B, 14, 15,0xab9423a7);395 OP ( FI, B, C, D, A, 5, 21,0xfc93a039);396 OP ( FI, A, B, C, D, 12, 6,0x655b59c3);397 OP ( FI, D, A, B, C, 3, 10,0x8f0ccc92);398 OP ( FI, C, D, A, B, 10, 15,0xffeff47d);399 OP ( FI, B, C, D, A, 1, 21,0x85845dd1);400 OP ( FI, A, B, C, D, 8, 6,0x6fa87e4f);401 OP ( FI, D, A, B, C, 15, 10,0xfe2ce6e0);402 OP ( FI, C, D, A, B, 6, 15,0xa3014314);403 OP ( FI, B, C, D, A, 13, 21,0x4e0811a1);404 OP ( FI, A, B, C, D, 4, 6,0xf7537e82);405 OP ( FI, D, A, B, C, 11, 10,0xbd3af235);406 OP ( FI, C, D, A, B, 2, 15,0x2ad7d2bb);407 OP ( FI, B, C, D, A, 9, 21,0xeb86d391);400 OP (A, B, C, D, 0, 6, (md5_uint32) 0xf4292244); 401 OP (D, A, B, C, 7, 10, (md5_uint32) 0x432aff97); 402 OP (C, D, A, B, 14, 15, (md5_uint32) 0xab9423a7); 403 OP (B, C, D, A, 5, 21, (md5_uint32) 0xfc93a039); 404 OP (A, B, C, D, 12, 6, (md5_uint32) 0x655b59c3); 405 OP (D, A, B, C, 3, 10, (md5_uint32) 0x8f0ccc92); 406 OP (C, D, A, B, 10, 15, (md5_uint32) 0xffeff47d); 407 OP (B, C, D, A, 1, 21, (md5_uint32) 0x85845dd1); 408 OP (A, B, C, D, 8, 6, (md5_uint32) 0x6fa87e4f); 409 OP (D, A, B, C, 15, 10, (md5_uint32) 0xfe2ce6e0); 410 OP (C, D, A, B, 6, 15, (md5_uint32) 0xa3014314); 411 OP (B, C, D, A, 13, 21, (md5_uint32) 0x4e0811a1); 412 OP (A, B, C, D, 4, 6, (md5_uint32) 0xf7537e82); 413 OP (D, A, B, C, 11, 10, (md5_uint32) 0xbd3af235); 414 OP (C, D, A, B, 2, 15, (md5_uint32) 0x2ad7d2bb); 415 OP (B, C, D, A, 9, 21, (md5_uint32) 0xeb86d391); 408 416 409 417 /* Add the starting values of the context. */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/memchr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* 2 FUNCTION3 <<memchr>>---find character in memory4 2 5 INDEX 6 memchr 3 @deftypefn Supplemental void* memchr (const void *@var{s}, int @var{c}, size_t @var{n}) 7 4 8 ANSI_SYNOPSIS 9 #include <string.h> 10 void *memchr(const void *<[src]>, int <[c]>, size_t <[length]>); 5 This function searches memory starting at @code{*@var{s}} for the 6 character @var{c}. The search only ends with the first occurrence of 7 @var{c}, or after @var{length} characters; in particular, a null 8 character does not terminate the search. If the character @var{c} is 9 found within @var{length} characters of @code{*@var{s}}, a pointer 10 to the character is returned. If @var{c} is not found, then @code{NULL} is 11 returned. 11 12 12 TRAD_SYNOPSIS 13 #include <string.h> 14 void *memchr(<[src]>, <[c]>, <[length]>) 15 void *<[src]>; 16 void *<[c]>; 17 size_t <[length]>; 18 19 DESCRIPTION 20 This function searches memory starting at <<*<[src]>>> for the 21 character <[c]>. The search only ends with the first 22 occurrence of <[c]>, or after <[length]> characters; in 23 particular, <<NULL>> does not terminate the search. 24 25 RETURNS 26 If the character <[c]> is found within <[length]> characters 27 of <<*<[src]>>>, a pointer to the character is returned. If 28 <[c]> is not found, then <<NULL>> is returned. 29 30 PORTABILITY 31 <<memchr>> requires no supporting OS subroutines. 32 33 QUICKREF 34 memchr ansi pure 13 @end deftypefn 35 14 36 15 */ 37 16 38 17 #include <ansidecl.h> 39 #ifdef __STDC__18 #ifdef ANSI_PROTOTYPES 40 19 #include <stddef.h> 41 20 #else … … 51 30 const unsigned char *src = (const unsigned char *)src_void; 52 31 53 while ( --length >=0)32 while (length-- > 0) 54 33 { 55 34 if (*src == c) -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/memcmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 3 3 4 4 /* 5 NAME6 memcmp -- compare two memory regions7 5 8 SYNOPSIS 9 int memcmp (const void *from, const void *to, size_t count) 6 @deftypefn Supplemental int memcmp (const void *@var{x}, const void *@var{y}, size_t @var{count}) 10 7 11 DESCRIPTION 12 Compare two memory regions and return less than, 13 equal to, or greater than zero, according to lexicographical 14 ordering of the compared regions. 8 Compares the first @var{count} bytes of two areas of memory. Returns 9 zero if they are the same, a value less than zero if @var{x} is 10 lexically less than @var{y}, or a value greater than zero if @var{x} 11 is lexically greater than @var{y}. Note that lexical order is determined 12 as if comparing unsigned char arrays. 13 14 @end deftypefn 15 15 16 */ 16 17 17 18 #include <ansidecl.h> 18 #ifdef __STDC__19 #ifdef ANSI_PROTOTYPES 19 20 #include <stddef.h> 20 21 #else … … 23 24 24 25 int 25 DEFUN(memcmp, (str1, str2, count), 26 const PTR str1 AND const PTR str2 AND size_t count) 26 memcmp (str1, str2, count) 27 const PTR str1; 28 const PTR str2; 29 size_t count; 27 30 { 28 31 register const unsigned char *s1 = (const unsigned char*)str1; -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/memcpy.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 3 3 4 4 /* 5 NAME6 memcpy -- copy memory regions of arbitary length7 5 8 SYNOPSIS 9 void* memcpy (void *out, const void *in, size_t n); 6 @deftypefn Supplemental void* memcpy (void *@var{out}, const void *@var{in}, size_t @var{length}) 10 7 11 DESCRIPTION 12 Copy LENGTH bytes from memory region pointed to by IN to memory 13 region pointed to by OUT. 8 Copies @var{length} bytes from memory region @var{in} to region 9 @var{out}. Returns a pointer to @var{out}. 10 11 @end deftypefn 12 14 13 */ 15 14 16 15 #include <ansidecl.h> 17 #ifdef __STDC__16 #ifdef ANSI_PROTOTYPES 18 17 #include <stddef.h> 19 18 #else … … 21 20 #endif 22 21 22 void bcopy PARAMS((const void*, void*, size_t)); 23 23 24 PTR 24 DEFUN(memcpy, (out, in, length), PTR out AND const PTR in AND size_t length) 25 memcpy (out, in, length) 26 PTR out; 27 const PTR in; 28 size_t length; 25 29 { 26 30 bcopy(in, out, length); -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/memmove.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Wrapper to implement ANSI C's memmove using BSD's bcopy. */ 2 2 /* This function is in the public domain. --Per Bothner. */ 3 4 /* 5 6 @deftypefn Supplemental void* memmove (void *@var{from}, const void *@var{to}, size_t @var{count}) 7 8 Copies @var{count} bytes from memory area @var{from} to memory area 9 @var{to}, returning a pointer to @var{to}. 10 11 @end deftypefn 12 13 */ 14 3 15 #include <ansidecl.h> 4 #ifdef __STDC__16 #ifdef ANSI_PROTOTYPES 5 17 #include <stddef.h> 6 18 #else 7 19 #define size_t unsigned long 8 20 #endif 21 22 void bcopy PARAMS ((const void*, void*, size_t)); 9 23 10 24 PTR -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/memset.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 2 2 This implementation is in the public domain. */ 3 3 4 /* 5 6 @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count}) 7 8 Sets the first @var{count} bytes of @var{s} to the constant byte 9 @var{c}, returning a pointer to @var{s}. 10 11 @end deftypefn 12 13 */ 14 4 15 #include <ansidecl.h> 5 #ifdef __STDC__16 #ifdef ANSI_PROTOTYPES 6 17 #include <stddef.h> 7 18 #else … … 10 21 11 22 PTR 12 DEFUN(memset, (dest, val, len), 13 PTR dest AND register int val AND register size_t len) 23 memset (dest, val, len) 24 PTR dest; 25 register int val; 26 register size_t len; 14 27 { 15 28 register unsigned char *ptr = (unsigned char*)dest; -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/mkstemps.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 50 50 #endif 51 51 52 /* Generate a unique temporary file name from TEMPLATE.52 /* 53 53 54 TEMPLATE has the form: 54 @deftypefn Replacement int mkstemps (char *@var{template}, int @var{suffix_len}) 55 55 56 <path>/ccXXXXXX<suffix> 56 Generate a unique temporary file name from @var{template}. 57 @var{template} has the form: 57 58 58 SUFFIX_LEN tells us how long <suffix> is (it can be zero length). 59 @example 60 @var{path}/ccXXXXXX@var{suffix} 61 @end example 59 62 60 The last six characters of TEMPLATE before <suffix> must be "XXXXXX"; 61 they are replaced with a string that makes the filename unique. 63 @var{suffix_len} tells us how long @var{suffix} is (it can be zero 64 length). The last six characters of @var{template} before @var{suffix} 65 must be @samp{XXXXXX}; they are replaced with a string that makes the 66 filename unique. Returns a file descriptor open on the file for 67 reading and writing. 62 68 63 Returns a file descriptor open on the file for reading and writing. */ 69 @end deftypefn 70 71 */ 72 64 73 int 65 74 mkstemps (template, suffix_len) … … 113 122 XXXXXX[5] = letters[v % 62]; 114 123 124 #ifdef VMS 125 fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600, "fop=tmd"); 126 #else 115 127 fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600); 128 #endif 116 129 if (fd >= 0) 117 130 /* The file does not exist. */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/obstack.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 456 456 /* Define the error handler. */ 457 457 #ifndef _ 458 # if def HAVE_LIBINTL_H458 # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC 459 459 # include <libintl.h> 460 460 # ifndef _ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/partition.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* List imple ntation of a partition of consecutive integers.2 Copyright (C) 2000 Free Software Foundation, Inc.1 /* List implementation of a partition of consecutive integers. 2 Copyright (C) 2000, 2001 Free Software Foundation, Inc. 3 3 Contributed by CodeSourcery, LLC. 4 4 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/putenv.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.1 /* Copyright (C) 1991, 1994, 1995, 1996, 2002 Free Software Foundation, Inc. 2 2 This file based on putenv.c in the GNU C Library. 3 3 … … 17 17 Boston, MA 02111-1307, USA. */ 18 18 19 /* 20 21 @deftypefn Supplemental int putenv (const char *@var{string}) 22 23 Uses @code{setenv} or @code{unsetenv} to put @var{string} into 24 the environment or remove it. If @var{string} is of the form 25 @samp{name=value} the string is added; if no @samp{=} is present the 26 name is unset/removed. 27 28 @end deftypefn 29 30 */ 31 19 32 #if defined (_AIX) && !defined (__GNUC__) 20 33 #pragma alloca … … 26 39 27 40 #include "ansidecl.h" 41 42 #define putenv libiberty_putenv 28 43 29 44 #if HAVE_STDLIB_H … … 45 60 # endif /* alloca */ 46 61 #endif /* HAVE_ALLOCA_H */ 62 63 #undef putenv 47 64 48 65 /* Below this point, it's verbatim code from the glibc-2.0 implementation */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/random.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 34 34 * It was reworked for the GNU C Library by Roland McGrath. 35 35 */ 36 37 /* 38 39 @deftypefn Supplement {long int} random (void) 40 @deftypefnx Supplement void srandom (unsigned int @var{seed}) 41 @deftypefnx Supplement void* initstate (unsigned int @var{seed}, void *@var{arg_state}, unsigned long @var{n}) 42 @deftypefnx Supplement void* setstate (void *@var{arg_state}) 43 44 Random number functions. @code{random} returns a random number in the 45 range 0 to @code{LONG_MAX}. @code{srandom} initializes the random 46 number generator to some starting point determined by @var{seed} 47 (else, the values returned by @code{random} are always the same for each 48 run of the program). @code{initstate} and @code{setstate} allow fine-grained 49 control over the state of the random number generator. 50 51 @end deftypefn 52 53 */ 36 54 37 55 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/rename.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 2 2 This function is in the public domain. */ 3 3 4 /* Rename a file. */4 /* 5 5 6 @deftypefn Supplemental int rename (const char *@var{old}, const char *@var{new}) 7 8 Renames a file from @var{old} to @var{new}. If @var{new} already 9 exists, it is removed. 10 11 @end deftypefn 12 13 */ 14 15 #include "ansidecl.h" 6 16 #ifdef HAVE_CONFIG_H 7 17 #include "config.h" … … 14 24 int 15 25 rename (zfrom, zto) 16 c har *zfrom;17 c har *zto;26 const char *zfrom; 27 const char *zto; 18 28 { 19 29 if (link (zfrom, zto) < 0) -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/rindex.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Stub implementation of (obsolete) rindex(). */ 2 3 /* 4 5 @deftypefn Supplemental char* rindex (const char *@var{s}, int @var{c}) 6 7 Returns a pointer to the last occurrence of the character @var{c} in 8 the string @var{s}, or @code{NULL} if not found. The use of @code{rindex} is 9 deprecated in new programs in favor of @code{strrchr}. 10 11 @end deftypefn 12 13 */ 2 14 3 15 extern char *strrchr (); -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/safe-ctype.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 49 49 50 50 /* Masks. */ 51 #define L lo|is |pr/* lower case letter */52 #define XL lo|is|xd|pr/* lowercase hex digit */53 #define U up|is |pr/* upper case letter */54 #define XU up|is|xd|pr/* uppercase hex digit */55 #define D di |xd|pr/* decimal digit */56 #define P pn |pr/* punctuation */57 #define _ pn|is |pr/* underscore */51 #define L (const unsigned short) (lo|is |pr) /* lower case letter */ 52 #define XL (const unsigned short) (lo|is|xd|pr) /* lowercase hex digit */ 53 #define U (const unsigned short) (up|is |pr) /* upper case letter */ 54 #define XU (const unsigned short) (up|is|xd|pr) /* uppercase hex digit */ 55 #define D (const unsigned short) (di |xd|pr) /* decimal digit */ 56 #define P (const unsigned short) (pn |pr) /* punctuation */ 57 #define _ (const unsigned short) (pn|is |pr) /* underscore */ 58 58 59 #define C cn/* control character */60 #define Z nv |cn/* NUL */61 #define M nv|sp |cn/* cursor movement: \f \v */62 #define V vs|sp |cn/* vertical space: \r \n */63 #define T nv|sp|bl|cn/* tab */64 #define S nv|sp|bl|pr/* space */59 #define C (const unsigned short) ( cn) /* control character */ 60 #define Z (const unsigned short) (nv |cn) /* NUL */ 61 #define M (const unsigned short) (nv|sp |cn) /* cursor movement: \f \v */ 62 #define V (const unsigned short) (vs|sp |cn) /* vertical space: \r \n */ 63 #define T (const unsigned short) (nv|sp|bl|cn) /* tab */ 64 #define S (const unsigned short) (nv|sp|bl|pr) /* space */ 65 65 66 66 /* Are we ASCII? */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/setenv.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc.1 /* Copyright (C) 1992, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. 2 2 This file based on setenv.c in the GNU C Library. 3 3 … … 17 17 Boston, MA 02111-1307, USA. */ 18 18 19 20 /* 21 22 @deftypefn Supplemental int setenv (const char *@var{name}, const char *@var{value}, int @var{overwrite}) 23 @deftypefnx Supplemental void unsetenv (const char *@var{name}) 24 25 @code{setenv} adds @var{name} to the environment with value 26 @var{value}. If the name was already present in the environment, 27 the new value will be stored only if @var{overwrite} is nonzero. 28 The companion @code{unsetenv} function removes @var{name} from the 29 environment. This implementation is not safe for multithreaded code. 30 31 @end deftypefn 32 33 */ 34 19 35 #if HAVE_CONFIG_H 20 36 # include <config.h> 21 37 #endif 38 39 #define setenv libiberty_setenv 40 #define unsetenv libiberty_unsetenv 22 41 23 42 #include "ansidecl.h" … … 45 64 extern char **environ; 46 65 #endif 66 67 #undef setenv 68 #undef unsetenv 47 69 48 70 /* LOCK and UNLOCK are defined as no-ops. This makes the libiberty -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/sigsetmask.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 4 4 This file is in the public doamin. */ 5 5 6 /* Set the current signal mask to the set provided, and return the 7 previous value */ 6 /* 7 8 @deftypefn Supplemental int sigsetmask (int @var{set}) 9 10 Sets the signal mask to the one provided in @var{set} and returns 11 the old mask (which, for libiberty's implementation, will always 12 be the value @code{1}). 13 14 @end deftypefn 15 16 */ 8 17 9 18 #define _POSIX_SOURCE … … 17 26 #ifdef SIG_SETMASK 18 27 int 19 DEFUN(sigsetmask,(set), 20 int set )28 sigsetmask (set) 29 int set; 21 30 { 22 31 sigset_t new; -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/spaces.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 20 20 /* 21 21 22 NAME 22 @deftypefn Extension char* spaces (int @var{count}) 23 23 24 spaces -- return a pointer to a buffer full of spaces 24 Returns a pointer to a memory region filled with the specified 25 number of spaces and null terminated. The returned pointer is 26 valid until at least the next call. 25 27 26 SYNOPSIS 27 28 char *spaces (int count) 29 30 DESCRIPTION 31 32 Returns a pointer to a memory region filled with the specified 33 number of spaces and null terminated. The returned pointer is 34 valid until at least the next call. 35 36 BUGS 28 @end deftypefn 37 29 38 30 */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/splay-tree.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* A splay-tree datatype. 2 Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.2 Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. 3 3 Contributed by Mark Mitchell (mark@markmitchell.com). 4 4 … … 71 71 (*sp->delete_value)(node->value); 72 72 73 free ((char*) node);73 (*sp->deallocate) ((char*) node, sp->allocate_data); 74 74 } 75 75 … … 228 228 } 229 229 230 231 /* An allocator and deallocator based on xmalloc. */ 232 static void * 233 splay_tree_xmalloc_allocate (size, data) 234 int size; 235 void *data ATTRIBUTE_UNUSED; 236 { 237 return (void *) xmalloc (size); 238 } 239 240 static void 241 splay_tree_xmalloc_deallocate (object, data) 242 void *object; 243 void *data ATTRIBUTE_UNUSED; 244 { 245 free (object); 246 } 247 248 230 249 /* Allocate a new splay tree, using COMPARE_FN to compare nodes, 231 250 DELETE_KEY_FN to deallocate keys, and DELETE_VALUE_FN to deallocate 232 values. */ 251 values. Use xmalloc to allocate the splay tree structure, and any 252 nodes added. */ 233 253 234 254 splay_tree … … 238 258 splay_tree_delete_value_fn delete_value_fn; 239 259 { 240 splay_tree sp = (splay_tree) xmalloc (sizeof (struct splay_tree_s)); 260 return (splay_tree_new_with_allocator 261 (compare_fn, delete_key_fn, delete_value_fn, 262 splay_tree_xmalloc_allocate, splay_tree_xmalloc_deallocate, 0)); 263 } 264 265 266 /* Allocate a new splay tree, using COMPARE_FN to compare nodes, 267 DELETE_KEY_FN to deallocate keys, and DELETE_VALUE_FN to deallocate 268 values. */ 269 270 splay_tree 271 splay_tree_new_with_allocator (compare_fn, delete_key_fn, delete_value_fn, 272 allocate_fn, deallocate_fn, allocate_data) 273 splay_tree_compare_fn compare_fn; 274 splay_tree_delete_key_fn delete_key_fn; 275 splay_tree_delete_value_fn delete_value_fn; 276 splay_tree_allocate_fn allocate_fn; 277 splay_tree_deallocate_fn deallocate_fn; 278 void *allocate_data; 279 { 280 splay_tree sp = (splay_tree) (*allocate_fn) (sizeof (struct splay_tree_s), 281 allocate_data); 241 282 sp->root = 0; 242 283 sp->comp = compare_fn; 243 284 sp->delete_key = delete_key_fn; 244 285 sp->delete_value = delete_value_fn; 286 sp->allocate = allocate_fn; 287 sp->deallocate = deallocate_fn; 288 sp->allocate_data = allocate_data; 245 289 246 290 return sp; … … 254 298 { 255 299 splay_tree_delete_helper (sp, sp->root); 256 free ((char*) sp);300 (*sp->deallocate) ((char*) sp, sp->allocate_data); 257 301 } 258 302 … … 287 331 splay_tree_node node; 288 332 289 node = (splay_tree_node) xmalloc (sizeof (struct splay_tree_node_s)); 333 node = ((splay_tree_node) 334 (*sp->allocate) (sizeof (struct splay_tree_node_s), 335 sp->allocate_data)); 290 336 node->key = key; 291 337 node->value = value; … … 331 377 if (sp->delete_value) 332 378 (*sp->delete_value) (sp->root->value); 333 free (sp->root);379 (*sp->deallocate) (sp->root, sp->allocate_data); 334 380 335 381 /* One of the children is now the root. Doesn't matter much … … 369 415 } 370 416 417 /* Return the node in SP with the greatest key. */ 418 419 splay_tree_node 420 splay_tree_max (sp) 421 splay_tree sp; 422 { 423 splay_tree_node n = sp->root; 424 425 if (!n) 426 return NULL; 427 428 while (n->right) 429 n = n->right; 430 431 return n; 432 } 433 434 /* Return the node in SP with the smallest key. */ 435 436 splay_tree_node 437 splay_tree_min (sp) 438 splay_tree sp; 439 { 440 splay_tree_node n = sp->root; 441 442 if (!n) 443 return NULL; 444 445 while (n->left) 446 n = n->left; 447 448 return n; 449 } 450 371 451 /* Return the immediate predecessor KEY, or NULL if there is no 372 452 predecessor. KEY need not be present in the tree. */ … … 403 483 404 484 /* Return the immediate successor KEY, or NULL if there is no 405 predecessor. KEY need not be present in the tree. */485 successor. KEY need not be present in the tree. */ 406 486 407 487 splay_tree_node … … 413 493 splay_tree_node node; 414 494 415 /* If the tree is empty, there is certainly no predecessor. */495 /* If the tree is empty, there is certainly no successor. */ 416 496 if (!sp->root) 417 497 return NULL; -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strcasecmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 11 11 */ 12 12 13 /* 14 15 @deftypefn Supplemental int strcasecmp (const char *@var{s1}, const char *@var{s2}) 16 17 A case-insensitive @code{strcmp}. 18 19 @end deftypefn 20 21 */ 22 13 23 #if defined(LIBC_SCCS) && !defined(lint) 14 24 static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; … … 16 26 17 27 #include <ansidecl.h> 18 #ifdef __STDC__28 #ifdef ANSI_PROTOTYPES 19 29 #include <stddef.h> 20 30 #else … … 28 38 */ 29 39 typedef unsigned char uc; 30 static unsigned char charmap[] = {40 static const unsigned char charmap[] = { 31 41 (uc)'\000',(uc)'\001',(uc)'\002',(uc)'\003',(uc)'\004',(uc)'\005',(uc)'\006',(uc)'\007', 32 42 (uc)'\010',(uc)'\011',(uc)'\012',(uc)'\013',(uc)'\014',(uc)'\015',(uc)'\016',(uc)'\017', -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strchr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 3 3 4 4 /* 5 NAME6 strchr -- return pointer to first occurance of a character7 5 8 SYNOPSIS 9 char *strchr (const char *s, int c) 6 @deftypefn Supplemental char* strchr (const char *@var{s}, int @var{c}) 10 7 11 DESCRIPTION 12 Returns a pointer to the first occurance of character C in 13 string S, or a NULL pointer if no occurance is found. 14 15 BUGS 16 Behavior when character is the null character is implementation 17 dependent. 8 Returns a pointer to the first occurrence of the character @var{c} in 9 the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the 10 null character, the results are undefined. 11 12 @end deftypefn 13 18 14 */ 19 15 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strdup.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* 2 3 @deftypefn Supplemental char* strdup (const char *@var{s}) 4 5 Returns a pointer to a copy of @var{s} in memory obtained from 6 @code{malloc}, or @code{NULL} if insufficient memory was available. 7 8 @end deftypefn 9 10 */ 11 12 #include <ansidecl.h> 13 #ifdef ANSI_PROTOTYPES 14 #include <stddef.h> 15 #else 16 #define size_t unsigned long 17 #endif 18 19 extern size_t strlen PARAMS ((const char*)); 20 extern PTR malloc PARAMS ((size_t)); 21 extern PTR memcpy PARAMS ((PTR, const PTR, size_t)); 22 1 23 char * 2 24 strdup(s) 3 25 char *s; 4 26 { 5 char *result = (char*)malloc(strlen(s) + 1);6 if (result == (char*)0)7 return (char*)0; 8 strcpy(result, s);9 return result;27 size_t len = strlen (s) + 1; 28 char *result = (char*) malloc (len); 29 if (result == (char*) 0) 30 return (char*) 0; 31 return (char*) memcpy (result, s, len); 10 32 } -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strerror.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 14 14 attributes. So we hide the declaration in errno.h (if any) using a 15 15 macro. */ 16 #define sys_nerr sys_nerr__ 16 17 #define sys_errlist sys_errlist__ 17 18 #endif … … 21 22 22 23 #ifdef HAVE_SYS_ERRLIST 24 #undef sys_nerr 23 25 #undef sys_errlist 24 26 #endif … … 57 59 struct error_info 58 60 { 59 int value; /* The numeric value from <errno.h> */60 const char * name; /* The equivalent symbolic value */61 const int value; /* The numeric value from <errno.h> */ 62 const char *const name; /* The equivalent symbolic value */ 61 63 #ifndef HAVE_SYS_ERRLIST 62 const char * msg; /* Short message about this value */64 const char *const msg; /* Short message about this value */ 63 65 #endif 64 66 }; … … 561 563 /* 562 564 563 NAME 564 565 errno_max -- return the max errno value 566 567 SYNOPSIS 568 569 int errno_max (); 570 571 DESCRIPTION 572 573 Returns the maximum errno value for which a corresponding symbolic 574 name or message is available. Note that in the case where 575 we use the sys_errlist supplied by the system, it is possible for 576 there to be more symbolic names than messages, or vice versa. 577 In fact, the manual page for perror(3C) explicitly warns that one 578 should check the size of the table (sys_nerr) before indexing it, 579 since new error codes may be added to the system before they are 580 added to the table. Thus sys_nerr might be smaller than value 581 implied by the largest errno value defined in <errno.h>. 582 583 We return the maximum value that can be used to obtain a meaningful 584 symbolic name or message. 565 566 @deftypefn Extension int errno_max (void) 567 568 Returns the maximum @code{errno} value for which a corresponding 569 symbolic name or message is available. Note that in the case where we 570 use the @code{sys_errlist} supplied by the system, it is possible for 571 there to be more symbolic names than messages, or vice versa. In 572 fact, the manual page for @code{perror(3C)} explicitly warns that one 573 should check the size of the table (@code{sys_nerr}) before indexing 574 it, since new error codes may be added to the system before they are 575 added to the table. Thus @code{sys_nerr} might be smaller than value 576 implied by the largest @code{errno} value defined in @code{<errno.h>}. 577 578 We return the maximum value that can be used to obtain a meaningful 579 symbolic name or message. 580 581 @end deftypefn 585 582 586 583 */ … … 603 600 /* 604 601 605 NAME 606 607 strerror -- map an error number to an error message string 608 609 SYNOPSIS 610 611 char *strerror (int errnoval) 612 613 DESCRIPTION 614 615 Maps an errno number to an error message string, the contents of 616 which are implementation defined. On systems which have the external 617 variables sys_nerr and sys_errlist, these strings will be the same 618 as the ones used by perror(). 619 620 If the supplied error number is within the valid range of indices 621 for the sys_errlist, but no message is available for the particular 622 error number, then returns the string "Error NUM", where NUM is the 623 error number. 624 625 If the supplied error number is not a valid index into sys_errlist, 626 returns NULL. 627 628 The returned string is only guaranteed to be valid only until the 629 next call to strerror. 602 @deftypefn Supplemental char* strerror (int @var{errnoval}) 603 604 Maps an @code{errno} number to an error message string, the contents 605 of which are implementation defined. On systems which have the 606 external variables @code{sys_nerr} and @code{sys_errlist}, these 607 strings will be the same as the ones used by @code{perror}. 608 609 If the supplied error number is within the valid range of indices for 610 the @code{sys_errlist}, but no message is available for the particular 611 error number, then returns the string @samp{Error @var{num}}, where 612 @var{num} is the error number. 613 614 If the supplied error number is not a valid index into 615 @code{sys_errlist}, returns @code{NULL}. 616 617 The returned string is only guaranteed to be valid only until the 618 next call to @code{strerror}. 619 620 @end deftypefn 630 621 631 622 */ … … 635 626 int errnoval; 636 627 { 637 c har *msg;628 const char *msg; 638 629 static char buf[32]; 639 630 … … 677 668 /* 678 669 679 NAME 680 681 strerrno -- map an error number to a symbolic name string 682 683 SYNOPSIS 684 685 const char *strerrno (int errnoval) 686 687 DESCRIPTION 688 689 Given an error number returned from a system call (typically 690 returned in errno), returns a pointer to a string containing the 691 symbolic name of that error number, as found in <errno.h>. 692 693 If the supplied error number is within the valid range of indices 694 for symbolic names, but no name is available for the particular 695 error number, then returns the string "Error NUM", where NUM is 696 the error number. 697 698 If the supplied error number is not within the range of valid 699 indices, then returns NULL. 700 701 BUGS 702 703 The contents of the location pointed to are only guaranteed to be 704 valid until the next call to strerrno. 670 @deftypefn Replacement {const char*} strerrno (int @var{errnum}) 671 672 Given an error number returned from a system call (typically returned 673 in @code{errno}), returns a pointer to a string containing the 674 symbolic name of that error number, as found in @code{<errno.h>}. 675 676 If the supplied error number is within the valid range of indices for 677 symbolic names, but no name is available for the particular error 678 number, then returns the string @samp{Error @var{num}}, where @var{num} 679 is the error number. 680 681 If the supplied error number is not within the range of valid 682 indices, then returns @code{NULL}. 683 684 The contents of the location pointed to are only guaranteed to be 685 valid until the next call to @code{strerrno}. 686 687 @end deftypefn 705 688 706 689 */ … … 745 728 /* 746 729 747 NAME 748 749 strtoerrno -- map a symbolic errno name to a numeric value 750 751 SYNOPSIS 752 753 int strtoerrno (char *name) 754 755 DESCRIPTION 756 757 Given the symbolic name of a error number, map it to an errno value. 758 If no translation is found, returns 0. 730 @deftypefn Extension int strtoerrno (const char *@var{name}) 731 732 Given the symbolic name of a error number (e.g., @code{EACCES}), map it 733 to an errno value. If no translation is found, returns 0. 734 735 @end deftypefn 759 736 760 737 */ … … 807 784 int errnmax; 808 785 const char *name; 809 c har *msg;786 const char *msg; 810 787 char *strerror (); 811 788 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strncasecmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 11 11 */ 12 12 13 /* 14 15 @deftypefn Supplemental int strncasecmp (const char *@var{s1}, const char *@var{s2}) 16 17 A case-insensitive @code{strncmp}. 18 19 @end deftypefn 20 21 */ 22 13 23 #if defined(LIBC_SCCS) && !defined(lint) 14 24 static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; … … 16 26 17 27 #include <ansidecl.h> 18 #ifdef __STDC__28 #ifdef ANSI_PROTOTYPES 19 29 #include <stddef.h> 20 30 #else … … 27 37 * based upon ascii character sequences. 28 38 */ 29 static unsigned char charmap[] = {39 static const unsigned char charmap[] = { 30 40 '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', 31 41 '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strncmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 2 2 This function is in the public domain. */ 3 3 4 /* 5 6 @deftypefn Supplemental int strncmp (const char *@var{s1}, const char *@var{s2}, size_t @var{n}) 7 8 Compares the first @var{n} bytes of two strings, returning a value as 9 @code{strcmp}. 10 11 @end deftypefn 12 13 */ 14 4 15 #include <ansidecl.h> 5 #ifdef __STDC__16 #ifdef ANSI_PROTOTYPES 6 17 #include <stddef.h> 7 18 #else -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strrchr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 3 3 4 4 /* 5 NAME6 strrchr -- return pointer to last occurance of a character7 5 8 SYNOPSIS 9 char *strrchr (const char *s, int c) 6 @deftypefn Supplemental char* strrchr (const char *@var{s}, int @var{c}) 10 7 11 DESCRIPTION 12 Returns a pointer to the last occurance of character C in 13 string S, or a NULL pointer if no occurance is found. 14 15 BUGS 16 Behavior when character is the null character is implementation 17 dependent. 8 Returns a pointer to the last occurrence of the character @var{c} in 9 the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the 10 null character, the results are undefined. 11 12 @end deftypefn 13 18 14 */ 19 15 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strsignal.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 18 18 declare it ourselves. With luck, this will always work. */ 19 19 #define sys_siglist no_such_symbol 20 #define sys_nsig sys_nsig__no_such_symbol 20 21 21 22 #include <stdio.h> … … 39 40 found in the system header files. */ 40 41 #undef sys_siglist 42 #undef sys_nsig 41 43 42 44 #ifndef NULL 43 # ifdef __STDC__45 # ifdef ANSI_PROTOTYPES 44 46 # define NULL (void *) 0 45 47 # else … … 66 68 struct signal_info 67 69 { 68 int value; /* The numeric value from <signal.h> */69 const char * name; /* The equivalent symbolic value */70 const int value; /* The numeric value from <signal.h> */ 71 const char *const name; /* The equivalent symbolic value */ 70 72 #ifndef HAVE_SYS_SIGLIST 71 const char * msg; /* Short message about this value */73 const char *const msg; /* Short message about this value */ 72 74 #endif 73 75 }; … … 349 351 /* 350 352 351 NAME 352 353 signo_max -- return the max signo value 354 355 SYNOPSIS 356 357 int signo_max (); 358 359 DESCRIPTION 360 361 Returns the maximum signo value for which a corresponding symbolic 362 name or message is available. Note that in the case where 363 we use the sys_siglist supplied by the system, it is possible for 364 there to be more symbolic names than messages, or vice versa. 365 In fact, the manual page for psignal(3b) explicitly warns that one 366 should check the size of the table (NSIG) before indexing it, 367 since new signal codes may be added to the system before they are 368 added to the table. Thus NSIG might be smaller than value 369 implied by the largest signo value defined in <signal.h>. 370 371 We return the maximum value that can be used to obtain a meaningful 372 symbolic name or message. 353 @deftypefn Extension int signo_max (void) 354 355 Returns the maximum signal value for which a corresponding symbolic 356 name or message is available. Note that in the case where we use the 357 @code{sys_siglist} supplied by the system, it is possible for there to 358 be more symbolic names than messages, or vice versa. In fact, the 359 manual page for @code{psignal(3b)} explicitly warns that one should 360 check the size of the table (@code{NSIG}) before indexing it, since 361 new signal codes may be added to the system before they are added to 362 the table. Thus @code{NSIG} might be smaller than value implied by 363 the largest signo value defined in @code{<signal.h>}. 364 365 We return the maximum value that can be used to obtain a meaningful 366 symbolic name or message. 367 368 @end deftypefn 373 369 374 370 */ … … 390 386 /* 391 387 392 NAME 393 394 strsignal -- map a signal number to a signal message string 395 396 SYNOPSIS 397 398 const char *strsignal (int signo) 399 400 DESCRIPTION 401 402 Maps an signal number to an signal message string, the contents of 403 which are implementation defined. On systems which have the external 404 variable sys_siglist, these strings will be the same as the ones used 405 by psignal(). 406 407 If the supplied signal number is within the valid range of indices 408 for the sys_siglist, but no message is available for the particular 409 signal number, then returns the string "Signal NUM", where NUM is the 410 signal number. 411 412 If the supplied signal number is not a valid index into sys_siglist, 413 returns NULL. 414 415 The returned string is only guaranteed to be valid only until the 416 next call to strsignal. 388 @deftypefn Supplemental {const char *} strsignal (int @var{signo}) 389 390 Maps an signal number to an signal message string, the contents of 391 which are implementation defined. On systems which have the external 392 variable @code{sys_siglist}, these strings will be the same as the 393 ones used by @code{psignal()}. 394 395 If the supplied signal number is within the valid range of indices for 396 the @code{sys_siglist}, but no message is available for the particular 397 signal number, then returns the string @samp{Signal @var{num}}, where 398 @var{num} is the signal number. 399 400 If the supplied signal number is not a valid index into 401 @code{sys_siglist}, returns @code{NULL}. 402 403 The returned string is only guaranteed to be valid only until the next 404 call to @code{strsignal}. 405 406 @end deftypefn 417 407 418 408 */ … … 460 450 /* 461 451 462 NAME 463 464 strsigno -- map an signal number to a symbolic name string 465 466 SYNOPSIS 467 468 const char *strsigno (int signo) 469 470 DESCRIPTION 471 472 Given an signal number, returns a pointer to a string containing 473 the symbolic name of that signal number, as found in <signal.h>. 474 475 If the supplied signal number is within the valid range of indices 476 for symbolic names, but no name is available for the particular 477 signal number, then returns the string "Signal NUM", where NUM is 478 the signal number. 479 480 If the supplied signal number is not within the range of valid 481 indices, then returns NULL. 482 483 BUGS 484 485 The contents of the location pointed to are only guaranteed to be 486 valid until the next call to strsigno. 452 @deftypefn Extension {const char*} strsigno (int @var{signo}) 453 454 Given an signal number, returns a pointer to a string containing the 455 symbolic name of that signal number, as found in @code{<signal.h>}. 456 457 If the supplied signal number is within the valid range of indices for 458 symbolic names, but no name is available for the particular signal 459 number, then returns the string @samp{Signal @var{num}}, where 460 @var{num} is the signal number. 461 462 If the supplied signal number is not within the range of valid 463 indices, then returns @code{NULL}. 464 465 The contents of the location pointed to are only guaranteed to be 466 valid until the next call to @code{strsigno}. 467 468 @end deftypefn 487 469 488 470 */ … … 523 505 /* 524 506 525 NAME 526 527 strtosigno -- map a symbolic signal name to a numeric value 528 529 SYNOPSIS 530 531 int strtosigno (char *name) 532 533 DESCRIPTION 534 535 Given the symbolic name of a signal, map it to a signal number. 536 If no translation is found, returns 0. 507 @deftypefn Extension int strtosigno (const char *@var{name}) 508 509 Given the symbolic name of a signal, map it to a signal number. If no 510 translation is found, returns 0. 511 512 @end deftypefn 537 513 538 514 */ … … 569 545 /* 570 546 571 NAME 572 573 psignal -- print message about signal to stderr 574 575 SYNOPSIS 576 577 void psignal (unsigned signo, char *message); 578 579 DESCRIPTION 580 581 Print to the standard error the message, followed by a colon, 582 followed by the description of the signal specified by signo, 583 followed by a newline. 547 @deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message}) 548 549 Print @var{message} to the standard error, followed by a colon, 550 followed by the description of the signal specified by @var{signo}, 551 followed by a newline. 552 553 @end deftypefn 554 584 555 */ 585 556 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strstr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 4 4 /* 5 5 6 NAME 6 @deftypefn Supplemental char* strstr (const char *@var{string}, const char *@var{sub}) 7 7 8 strstr -- locate first occurance of a substring 8 This function searches for the substring @var{sub} in the string 9 @var{string}, not including the terminating null characters. A pointer 10 to the first occurrence of @var{sub} is returned, or @code{NULL} if the 11 substring is absent. If @var{sub} points to a string with zero 12 length, the function returns @var{string}. 9 13 10 SYNOPSIS 14 @end deftypefn 11 15 12 #include <string.h>13 14 char *strstr (char *s1, char *s2)15 16 DESCRIPTION17 18 Locates the first occurance in the string pointed to by S1 of19 the string pointed to by S2. Returns a pointer to the substring20 found, or a NULL pointer if not found. If S2 points to a string21 with zero length, the function returns S1.22 23 BUGS24 16 25 17 */ … … 36 28 extern char *strchr (); 37 29 extern int strncmp (); 38 #if __GNUC__ ==239 extern __SIZE_TYPE__ strlen ( );30 #if __GNUC__ >= 2 31 extern __SIZE_TYPE__ strlen (const char *); 40 32 #endif 41 33 register int len = strlen (s2); -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strtod.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Implementation of strtod for systems with atof. 2 Copyright (C) 1991, 1995 Free Software Foundation, Inc.2 Copyright (C) 1991, 1995, 2002 Free Software Foundation, Inc. 3 3 4 4 This file is part of the libiberty library. This library is free … … 22 22 This exception does not however invalidate any other reasons why 23 23 the executable file might be covered by the GNU General Public License. */ 24 25 /* 26 27 @deftypefn Supplemental double strtod (const char *@var{string}, char **@var{endptr}) 28 29 This ISO C function converts the initial portion of @var{string} to a 30 @code{double}. If @var{endptr} is not @code{NULL}, a pointer to the 31 character after the last character used in the conversion is stored in 32 the location referenced by @var{endptr}. If no conversion is 33 performed, zero is returned and the value of @var{string} is stored in 34 the location referenced by @var{endptr}. 35 36 @end deftypefn 37 38 */ 24 39 25 40 #include "ansidecl.h" … … 61 76 && (p[7] == 'y' || p[7] == 'Y')) 62 77 { 63 *ptr = p + 7;78 *ptr = p + 8; 64 79 return atof (str); 65 80 } -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/strtol.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 28 28 * SUCH DAMAGE. 29 29 */ 30 31 /* 32 33 @deftypefn Supplemental {long int} strtol (const char *@var{string}, char **@var{endptr}, int @var{base}) 34 @deftypefnx Supplemental {unsigned long int} strtoul (const char *@var{string}, char **@var{endptr}, int @var{base}) 35 36 The @code{strtol} function converts the string in @var{string} to a 37 long integer value according to the given @var{base}, which must be 38 between 2 and 36 inclusive, or be the special value 0. If @var{base} 39 is 0, @code{strtol} will look for the prefixes @code{0} and @code{0x} 40 to indicate bases 8 and 16, respectively, else default to base 10. 41 When the base is 16 (either explicitly or implicitly), a prefix of 42 @code{0x} is allowed. The handling of @var{endptr} is as that of 43 @code{strtod} above. The @code{strtoul} function is the same, except 44 that the converted value is unsigned. 45 46 @end deftypefn 47 48 */ 30 49 31 50 #ifdef HAVE_CONFIG_H -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/testsuite/Makefile.in
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 # 2 2 # Makefile 3 # Copyright (C) 1999 3 # Copyright (C) 1999, 2002 4 4 # Free Software Foundation 5 5 # … … 46 46 47 47 # Run some tests of the demangler. 48 check-cplus-dem: test- filter$(srcdir)/demangle-expected49 $(SHELL) $(srcdir)/regress-demangle$(srcdir)/demangle-expected48 check-cplus-dem: test-demangle $(srcdir)/demangle-expected 49 ./test-demangle < $(srcdir)/demangle-expected 50 50 51 # Note that we just hard-code prepends_underscore to 0. This doesn't52 # matter since any particular test can override the default if need53 # be.54 51 TEST_COMPILE = $(CC) @DEFS@ $(LIBCFLAGS) -I.. -I$(INCDIR) $(HDEFINES) 55 test-filter: $(srcdir)/../cplus-dem.c 56 echo 'int prepends_underscore = 0;' > test-us.c 57 $(TEST_COMPILE) -o test-filter -DMAIN -DVERSION='"none"' @DEFS@ \ 58 $(srcdir)/../cplus-dem.c test-us.c -L.. -liberty 59 52 test-demangle: $(srcdir)/test-demangle.c 53 $(TEST_COMPILE) -o test-demangle \ 54 $(srcdir)/test-demangle.c ../libiberty.a 60 55 61 56 # Standard (either GNU or Cygnus) rules we don't use. … … 64 59 # The standard clean rules. 65 60 mostlyclean: 66 rm -f test- us.c test-filter61 rm -f test-demangle 67 62 clean: mostlyclean 68 63 distclean: clean … … 70 65 maintainer-clean realclean: distclean 71 66 72 73 67 Makefile: $(srcdir)/Makefile.in ../config.status 74 68 CONFIG_FILES=testsuite/Makefile CONFIG_HEADERS= \ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/testsuite/demangle-expected
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 128 128 # 129 129 --format=gnu 130 _10PageButton \$__both130 _10PageButton$__both 131 131 PageButton::__both 132 132 # 133 133 --format=gnu 134 _3RNG \$singleMantissa134 _3RNG$singleMantissa 135 135 RNG::singleMantissa 136 136 # 137 137 --format=gnu 138 _5IComp \$_release138 _5IComp$_release 139 139 IComp::_release 140 140 # 141 141 --format=gnu 142 _ \$_10BitmapComp142 _$_10BitmapComp 143 143 BitmapComp::~BitmapComp(void) 144 144 # 145 145 --format=gnu 146 _ \$_9__io_defs146 _$_9__io_defs 147 147 __io_defs::~__io_defs(void) 148 148 # 149 149 --format=gnu 150 _ \$_Q23foo3bar150 _$_Q23foo3bar 151 151 foo::bar::~bar(void) 152 152 # 153 153 --format=gnu 154 _ \$_Q33foo3bar4bell154 _$_Q33foo3bar4bell 155 155 foo::bar::bell::~bell(void) 156 156 # … … 436 436 # 437 437 --format=gnu 438 _vt \$foo438 _vt$foo 439 439 foo virtual table 440 440 # 441 441 --format=gnu 442 _vt \$foo\$bar442 _vt$foo$bar 443 443 foo::bar virtual table 444 444 # … … 648 648 # 649 649 --format=gnu 650 _2T4 \$N650 _2T4$N 651 651 T4::N 652 652 # 653 653 --format=gnu 654 _Q22T42t1 \$N654 _Q22T42t1$N 655 655 T4::t1::N 656 656 # … … 728 728 # 729 729 --format=gnu 730 _ \$_t6vector1Zdi730 _$_t6vector1Zdi 731 731 vector<double>::~vector(int) 732 732 # 733 733 --format=gnu 734 _ \$_t6vector1Zii734 _$_t6vector1Zii 735 735 vector<int>::~vector(int) 736 736 # … … 828 828 # 829 829 --format=gnu 830 _GLOBAL_ \$D\$set830 _GLOBAL_$D$set 831 831 global destructors keyed to set 832 832 # 833 833 --format=gnu 834 _GLOBAL_ \$I\$set834 _GLOBAL_$I$set 835 835 global constructors keyed to set 836 836 # … … 876 876 # 877 877 --format=gnu 878 _vt \$t8BDDHookV1ZPc878 _vt$t8BDDHookV1ZPc 879 879 BDDHookV<char *> virtual table 880 880 # … … 2477 2477 # 2478 2478 --format=gnu 2479 f__FGt3Bar1i2G1i 2480 f(Bar<2>, i) 2481 # 2482 --format=gnu 2479 2483 f__FGt3Bar1i21i 2480 f(Bar<2>, i)2481 #2482 --format=gnu2483 f__FGt3Bar1i_21_i2484 2484 f(Bar<21>, int) 2485 2485 # 2486 2486 --format=gnu 2487 f__FGt3Bar1i2 4XY_t2487 f__FGt3Bar1i2G4XY_t 2488 2488 f(Bar<2>, XY_t) 2489 2489 # … … 2493 2493 # 2494 2494 --format=gnu 2495 foo__H1Zt2TA2ZcZt2NA1Ui _20__X01_i2495 foo__H1Zt2TA2ZcZt2NA1Ui20_X01_i 2496 2496 int foo<TA<char, NA<20> > >(TA<char, NA<20> >) 2497 2497 # 2498 2498 --format=gnu 2499 foo__H1Zt2TA2ZiZt8N___A___1Ui _99__X01_i2499 foo__H1Zt2TA2ZiZt8N___A___1Ui99_X01_i 2500 2500 int foo<TA<int, N___A___<99> > >(TA<int, N___A___<99> >) 2501 2501 # … … 2533 2533 # 2534 2534 --format=gnu 2535 foo___bar__baz_____H1Zt2TA2ZiZt8N___A___1i _99__X01_i2535 foo___bar__baz_____H1Zt2TA2ZiZt8N___A___1i99_X01_i 2536 2536 int foo___bar__baz___<TA<int, N___A___<99> > >(TA<int, N___A___<99> >) 2537 2537 # … … 2565 2565 # 2566 2566 --format=gnu 2567 _26_GLOBAL_ \$N\$_tmp_n.iilg4Gya\$app_instance2567 _26_GLOBAL_$N$_tmp_n.iilg4Gya$app_instance 2568 2568 {anonymous}::app_instance 2569 # 2570 --format=java 2571 _ZN4java3awt10ScrollPane7addImplEPNS0_9ComponentEPNS_4lang6ObjectEi 2572 java.awt.ScrollPane.addImpl(java.awt.Component, java.lang.Object, int) 2573 # 2574 --format=java 2575 _ZN4java3awt4geom15AffineTransform9getMatrixEP6JArrayIdE 2576 java.awt.geom.AffineTransform.getMatrix(double[]) 2577 # 2578 --format=java 2579 _ZN23Mangle$Inner$InnerInner3fooEP6JArrayIPS0_IiEEdPS0_IPS0_IPS0_IPS0_IPN4java4lang6StringEEEEEPS0_IPS0_IPN6MangleEEE 2580 Mangle$Inner$InnerInner.foo(int[][], double, java.lang.String[][][][], Mangle[][]) 2581 # 2582 --format=java 2583 _ZN6JArray1tEP6JArrayIPS_E 2584 JArray.t(JArray[]) 2585 # 2586 --format=java 2587 _ZN4Prim1iEibcdfwPN4java4lang6StringEsx 2588 Prim.i(int, boolean, byte, double, float, char, java.lang.String, short, long) 2589 # 2590 --format=java 2591 _ZN4java4util14Map__U24_Entry11class__U24_E 2592 java.util.Map$Entry.class$ 2593 # 2594 --format=hp 2595 _Utf58_0_1__1_2147483647__2147483648 2596 _Utf58_0_1__1_2147483647__2147483648 2597 # 2598 --format=gnu-v3 2599 St9bad_alloc 2600 std::bad_alloc 2601 # 2602 # This caused an infinite loop. 2603 # We still don't demangle this correctly, but at least we don't hang. 2604 --format=auto 2605 __CPR212____ct__Q3_3std141list__tm__128_Q2_3edm41THandle__tm__26_Q2_4emid15EMparticleChunkQ2_3std68allocator__tm__51_Q2_3edmJ37J14const_iteratorFRCQ3_3std18list__tm__7_Z1ZZ2Z8iterator 2606 _Z1ZZ2Z::__CPR212____ct__Q3_3std141list__tm__128_Q2_3edm41THandle__tm__26_Q2_4emid15EMparticleChunkQ2_3std68allocator__tm__51_Q2_3edmJ37J14const_iteratorFRCQ3_3std18list__tm(iterator) -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/tmpnam.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* 2 3 @deftypefn Supplemental char* tmpnam (char *@var{s}) 4 5 This function attempts to create a name for a temporary file, which 6 will be a valid file name yet not exist when @code{tmpnam} checks for 7 it. @var{s} must point to a buffer of at least @code{L_tmpnam} bytes, 8 or be @code{NULL}. Use of this function creates a security risk, and it must 9 not be used in new projects. Use @code{mkstemp} instead. 10 11 @end deftypefn 12 13 */ 14 1 15 #include <stdio.h> 2 16 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/vasprintf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 29 29 #endif 30 30 #include <stdio.h> 31 #ifdef HAVE_STRING_H 31 32 #include <string.h> 33 #endif 32 34 #ifdef HAVE_STDLIB_H 33 35 #include <stdlib.h> … … 42 44 #endif 43 45 46 /* 47 48 @deftypefn Extension int vasprintf (char **@var{resptr}, const char *@var{format}, va_list @var{args}) 49 50 Like @code{vsprintf}, but instead of passing a pointer to a buffer, 51 you pass a pointer to a pointer. This function will compute the size 52 of the buffer needed, allocate memory with @code{malloc}, and store a 53 pointer to the allocated memory in @code{*@var{resptr}}. The value 54 returned is the same as @code{vsprintf} would return. If memory could 55 not be allocated, zero is returned and @code{NULL} is stored in 56 @code{*@var{resptr}}. 57 58 @end deftypefn 59 60 */ 44 61 45 62 static int int_vasprintf PARAMS ((char **, const char *, va_list *)); … … 122 139 global_total_width = total_width; 123 140 #endif 124 *result = malloc (total_width);141 *result = (char *) malloc (total_width); 125 142 if (*result != NULL) 126 143 return vsprintf (*result, format, *args); … … 143 160 144 161 #ifdef TEST 145 static void checkit PARAMS ((const char *, ...)); 162 static void ATTRIBUTE_PRINTF_1 163 checkit VPARAMS ((const char *format, ...)) 164 { 165 char *result; 166 VA_OPEN (args, format); 167 VA_FIXEDARG (args, const char *, format); 168 vasprintf (&result, format, args); 169 VA_CLOSE (args); 146 170 147 static void148 checkit VPARAMS ((const char* format, ...))149 {150 va_list args;151 char *result;152 #ifndef ANSI_PROTOTYPES153 const char *format;154 #endif155 156 VA_START (args, format);157 158 #ifndef ANSI_PROTOTYPES159 format = va_arg (args, const char *);160 #endif161 162 vasprintf (&result, format, args);163 171 if (strlen (result) < (size_t) global_total_width) 164 172 printf ("PASS: "); … … 166 174 printf ("FAIL: "); 167 175 printf ("%d %s\n", global_total_width, result); 176 177 free (result); 168 178 } 169 179 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/vfork.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Emulate vfork using just plain fork, for systems without a real vfork. 2 2 This function is in the public domain. */ 3 4 /* 5 6 @deftypefn Supplemental int vfork (void) 7 8 Emulates @code{vfork} by calling @code{fork} and returning its value. 9 10 @end deftypefn 11 12 */ 3 13 4 14 #include "ansidecl.h" -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/vfprintf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 4 4 */ 5 5 6 #ifdef __STDC__ 6 #include "ansidecl.h" 7 #ifdef ANSI_PROTOTYPES 7 8 #include <stdarg.h> 8 9 #else -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/vprintf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 #ifdef __STDC__ 1 /* 2 3 @deftypefn Supplemental int vprintf (const char *@var{format}, va_list @var{ap}) 4 @deftypefnx Supplemental int vfprintf (FILE *@var{stream}, const char *@var{format}, va_list @var{ap}) 5 @deftypefnx Supplemental int vsprintf (char *@var{str}, const char *@var{format}, va_list @var{ap}) 6 7 These functions are the same as @code{printf}, @code{fprintf}, and 8 @code{sprintf}, respectively, except that they are called with a 9 @code{va_list} instead of a variable number of arguments. Note that 10 they do not call @code{va_end}; this is the application's 11 responsibility. In @libib{} they are implemented in terms of the 12 nonstandard but common function @code{_doprnt}. 13 14 @end deftypefn 15 16 */ 17 18 #include <ansidecl.h> 19 #ifdef ANSI_PROTOTYPES 2 20 #include <stdarg.h> 3 21 #else … … 5 23 #endif 6 24 #include <stdio.h> 7 #include <ansidecl.h>8 25 #undef vprintf 9 26 int -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/vsprintf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 4 4 Written by Per Bothner of Cygnus Support. 5 5 Based on libg++'s "form" (written by Doug Lea; dl@rocky.oswego.edu). 6 Copyright (C) 1991, 1995 Free Software Foundation, Inc.6 Copyright (C) 1991, 1995, 2002 Free Software Foundation, Inc. 7 7 8 8 This file is part of the libiberty library. This library is free … … 27 27 the executable file might be covered by the GNU General Public License. */ 28 28 29 #include <ansidecl.h> 30 #ifdef ANSI_PROTOTYPES 31 #include <stdarg.h> 32 #else 29 33 #include <varargs.h> 34 #endif 30 35 #include <stdio.h> 31 #include <ansidecl.h>32 36 #undef vsprintf 37 38 #if defined _IOSTRG && defined _IOWRT 33 39 34 40 int … … 54 60 55 61 } 62 63 #endif -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/waitpid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* 2 3 @deftypefn Supplemental int waitpid (int @var{pid}, int *@var{status}, int) 4 5 This is a wrapper around the @code{wait} function. Any ``special'' 6 values of @var{pid} depend on your implementation of @code{wait}, as 7 does the return value. The third argument is unused in @libib{}. 8 9 @end deftypefn 10 11 */ 12 1 13 #ifdef HAVE_CONFIG_H 2 14 #include "config.h" 3 15 #endif 16 17 /* On some systems (such as WindISS), you must include <sys/types.h> 18 to get the definition of "pid_t" before you include <sys/wait.h>. */ 19 #include <sys/types.h> 20 4 21 #ifdef HAVE_SYS_WAIT_H 5 22 #include <sys/wait.h> 6 23 #endif 7 24 8 int25 pid_t 9 26 waitpid (pid, stat_loc, options) 10 int pid, *stat_loc, options; 27 pid_t pid; 28 int *stat_loc, options; 11 29 { 12 30 for (;;) -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/xatexit.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 5 5 * %sccs.include.redist.c% 6 6 */ 7 8 9 /* 10 11 @deftypefun int xatexit (void (*@var{fn}) (void)) 12 13 Behaves as the standard @code{atexit} function, but with no limit on 14 the number of registered functions. Returns 0 on success, or @minus{}1 on 15 failure. If you use @code{xatexit} to register functions, you must use 16 @code{xexit} to terminate your program. 17 18 @end deftypefun 19 20 */ 7 21 8 22 /* Adapted from newlib/libc/stdlib/{,at}exit.[ch]. … … 14 28 #include <stdio.h> 15 29 16 #ifdef __STDC__30 #ifdef ANSI_PROTOTYPES 17 31 #include <stddef.h> 18 32 #else … … 20 34 #endif 21 35 36 #if VMS 37 #include <stdlib.h> 38 #include <unixlib.h> 39 #else 22 40 /* For systems with larger pointers than ints, this must be declared. */ 23 41 PTR malloc PARAMS ((size_t)); 42 #endif 24 43 25 44 static void xatexit_cleanup PARAMS ((void)); -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/xexit.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 17 17 to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 18 Boston, MA 02111-1307, USA. */ 19 20 /* 21 22 @deftypefn Replacement void xexit (int @var{code}) 23 24 Terminates the program. If any functions have been registered with 25 the @code{xatexit} replacement function, they will be called first. 26 Termination is handled via the system's normal @code{exit} call. 27 28 @end deftypefn 29 30 */ 19 31 20 32 #ifdef HAVE_CONFIG_H -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/xmalloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 18 18 Boston, MA 02111-1307, USA. */ 19 19 20 /* 21 22 @deftypefn Replacement void* xmalloc (size_t) 23 24 Allocate memory without fail. If @code{malloc} fails, this will print 25 a message to @code{stderr} (using the name set by 26 @code{xmalloc_set_program_name}, 27 if any) and then call @code{xexit}. Note that it is therefore safe for 28 a program to contain @code{#define malloc xmalloc} in its source. 29 30 @end deftypefn 31 32 @deftypefn Replacement void* xrealloc (void *@var{ptr}, size_t @var{size}) 33 Reallocate memory without fail. This routine functions like @code{realloc}, 34 but will behave the same as @code{xmalloc} if memory cannot be found. 35 36 @end deftypefn 37 38 @deftypefn Replacement void* xcalloc (size_t @var{nelem}, size_t @var{elsize}) 39 40 Allocate memory without fail, and set it to zero. This routine functions 41 like @code{calloc}, but will behave the same as @code{xmalloc} if memory 42 cannot be found. 43 44 @end deftypefn 45 46 @deftypefn Replacement void xmalloc_set_program_name (const char *@var{name}) 47 48 You can use this to set the name of the program used by 49 @code{xmalloc_failed} when printing a failure message. 50 51 @end deftypefn 52 53 @deftypefn Replacement void xmalloc_failed (size_t) 54 55 This function is not meant to be called by client code, and is listed 56 here for completeness only. If any of the allocation routines fail, this 57 function will be called to print an error message and terminate execution. 58 59 @end deftypefn 60 61 */ 62 20 63 #ifdef HAVE_CONFIG_H 21 64 #include "config.h" … … 26 69 #include <stdio.h> 27 70 28 #ifdef __STDC__71 #ifdef ANSI_PROTOTYPES 29 72 #include <stddef.h> 30 73 #else … … 78 121 allocated = (char *) sbrk (0) - (char *) &environ; 79 122 fprintf (stderr, 80 "\n%s%s Cannot allocate %lu bytes after allocating%lu bytes\n",123 "\n%s%sout of memory allocating %lu bytes after a total of %lu bytes\n", 81 124 name, *name ? ": " : "", 82 125 (unsigned long) size, (unsigned long) allocated); 83 126 #else /* HAVE_SBRK */ 84 127 fprintf (stderr, 85 "\n%s%s Cannot allocate%lu bytes\n",128 "\n%s%sout of memory allocating %lu bytes\n", 86 129 name, *name ? ": " : "", 87 130 (unsigned long) size); -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/xmemdup.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 2 2 This trivial function is in the public domain. 3 3 Jeff Garzik, September 1999. */ 4 5 /* 6 7 @deftypefn Replacement void* xmemdup (void *@var{input}, size_t @var{copy_size}, size_t @var{alloc_size}) 8 9 Duplicates a region of memory without fail. First, @var{alloc_size} bytes 10 are allocated, then @var{copy_size} bytes from @var{input} are copied into 11 it, and the new memory is returned. If fewer bytes are copied than were 12 allocated, the remaining memory is zeroed. 13 14 @end deftypefn 15 16 */ 4 17 5 18 #ifdef HAVE_CONFIG_H -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/xstrdup.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 2 2 This trivial function is in the public domain. 3 3 Ian Lance Taylor, Cygnus Support, December 1995. */ 4 5 /* 6 7 @deftypefn Replacement char* xstrdup (const char *@var{s}) 8 9 Duplicates a character string without fail, using @code{xmalloc} to 10 obtain memory. 11 12 @end deftypefn 13 14 */ 4 15 5 16 #include <sys/types.h> -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/libiberty/xstrerror.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 2 2 Fri Jun 16 18:30:00 1995 Pat Rankin <rankin@eql.caltech.edu> 3 3 This code is in the public domain. */ 4 5 /* 6 7 @deftypefn Replacement char* xstrerror (int @var{errnum}) 8 9 Behaves exactly like the standard @code{strerror} function, but 10 will never return a @code{NULL} pointer. 11 12 @end deftypefn 13 14 */ 4 15 5 16 #include <stdio.h> -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.