diff options
author | cvs2svn <> | 2012-08-10 13:37:40 +0400 |
---|---|---|
committer | cvs2svn <> | 2012-08-10 13:37:40 +0400 |
commit | 4b180996100bf96c9c4bdc53c75f1593c93f96a8 (patch) | |
tree | be34249cf6536ee82500baaa37c77f62c63958d4 | |
parent | c0956742a74d194b9c18c7a91aa6d6010beb4cd3 (diff) |
This commit was manufactured by cvs2svn to create tag 'cygwin-cygwin-1_7_16-release
1_7_16-release'.
Sprout from cygwin-64bit-branch 2012-08-10 09:37:33 UTC cvs2svn 'This commit was manufactured by cvs2svn to create branch 'cygwin-64bit-'
Cherrypick from master 2012-07-20 09:45:34 UTC Corinna Vinschen <corinna@vinschen.de> 'Forced checkin to fix date':
compile
include/ChangeLog
include/dis-asm.h
include/elf/m68hc11.h
include/mach-o/ChangeLog
include/mach-o/codesign.h
include/mach-o/external.h
include/mach-o/loader.h
include/mach-o/reloc.h
include/mach-o/x86-64.h
include/opcode/ChangeLog
include/opcode/mips.h
ltoptions.m4
ltversion.m4
lt~obsolete.m4
newlib/ChangeLog
newlib/libc/include/stdio.h
newlib/libc/include/sys/signal.h
newlib/libc/include/sys/stat.h
newlib/libc/include/sys/time.h
newlib/libc/include/sys/times.h
newlib/libc/include/sys/wait.h
newlib/libc/locale/lmessages.c
newlib/libc/locale/lmonetary.c
newlib/libc/locale/nl_langinfo.c
newlib/libc/machine/rl78/Makefile.am
newlib/libc/machine/rl78/Makefile.in
newlib/libc/machine/rl78/aclocal.m4
newlib/libc/machine/rl78/configure
newlib/libc/machine/rl78/configure.in
newlib/libc/machine/rl78/setjmp.S
newlib/libc/posix/collate.c
newlib/libc/posix/engine.c
newlib/libc/posix/glob.c
newlib/libc/posix/popen.c
newlib/libc/posix/readdir.c
newlib/libc/posix/regcomp.c
newlib/libc/posix/wordexp.c
newlib/libc/reent/mkdirr.c
newlib/libc/reent/renamer.c
newlib/libc/search/hash.c
newlib/libc/search/hash_bigkey.c
newlib/libc/search/hash_page.c
newlib/libc/stdio/asiprintf.c
newlib/libc/stdio/asprintf.c
newlib/libc/stdio/freopen.c
newlib/libc/stdio/mktemp.c
newlib/libc/stdio/vasiprintf.c
newlib/libc/stdio/vasprintf.c
newlib/libc/stdio/vfprintf.c
newlib/libc/stdio/vfscanf.c
newlib/libc/stdio/vfwprintf.c
newlib/libc/stdlib/mbtowc_r.c
newlib/libc/stdlib/mprec.h
newlib/libc/stdlib/wctomb_r.c
newlib/libc/string/strcasestr.c
newlib/libc/sys/sysnecv850/crt0.S
newlib/libc/time/strptime.c
newlib/libm/common/sf_round.c
newlib/libm/math/e_atan2.c
newlib/libm/math/e_exp.c
newlib/libm/math/e_pow.c
newlib/libm/math/e_rem_pio2.c
newlib/libm/math/ef_exp.c
newlib/libm/math/ef_pow.c
newlib/libm/math/er_lgamma.c
newlib/libm/math/erf_lgamma.c
newlib/testsuite/newlib.stdio/stdio.exp
newlib/testsuite/newlib.stdio/swprintf.c
winsup/ChangeLog
winsup/Makefile.common
winsup/cygwin/ChangeLog
winsup/cygwin/DevNotes
winsup/cygwin/Makefile.in
winsup/cygwin/cygheap.cc
winsup/cygwin/cygheap.h
winsup/cygwin/cygserver_ipc.h
winsup/cygwin/cygthread.cc
winsup/cygwin/cygtls.cc
winsup/cygwin/cygtls.h
winsup/cygwin/cygwait.cc
winsup/cygwin/cygwait.h
winsup/cygwin/dcrt0.cc
winsup/cygwin/exceptions.cc
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_console.cc
winsup/cygwin/fhandler_socket.cc
winsup/cygwin/fhandler_tape.cc
winsup/cygwin/fhandler_termios.cc
winsup/cygwin/fhandler_tty.cc
winsup/cygwin/fhandler_windows.cc
winsup/cygwin/flock.cc
winsup/cygwin/gendef
winsup/cygwin/gentls_offsets
winsup/cygwin/include/cygwin/socket.h
winsup/cygwin/include/cygwin/version.h
winsup/cygwin/include/inttypes.h
winsup/cygwin/include/stdint.h
winsup/cygwin/include/sys/wait.h
winsup/cygwin/lib/crt0.h
winsup/cygwin/ntdll.h
winsup/cygwin/path.cc
winsup/cygwin/path.h
winsup/cygwin/poll.cc
winsup/cygwin/posix_ipc.cc
winsup/cygwin/release/1.7.10
winsup/cygwin/release/1.7.11
winsup/cygwin/release/1.7.12
winsup/cygwin/release/1.7.13
winsup/cygwin/release/1.7.14
winsup/cygwin/release/1.7.15
winsup/cygwin/release/1.7.16
winsup/cygwin/security.h
winsup/cygwin/select.cc
winsup/cygwin/shared.cc
winsup/cygwin/signal.cc
winsup/cygwin/sigproc.cc
winsup/cygwin/sigproc.h
winsup/cygwin/smallprint.cc
winsup/cygwin/spawn.cc
winsup/cygwin/syscalls.cc
winsup/cygwin/thread.cc
winsup/cygwin/thread.h
winsup/cygwin/tlsoffsets.h
winsup/cygwin/wait.cc
winsup/cygwin/wincap.cc
winsup/cygwin/winlean.h
winsup/cygwin/winsup.h
winsup/doc/ChangeLog
winsup/doc/faq-using.xml
winsup/mingw/ChangeLog
winsup/mingw/configure
winsup/mingw/configure.in
winsup/mingw/include/_mingw.h
winsup/mingw/include/excpt.h
winsup/mingw/include/inttypes.h
winsup/mingw/include/limits.h
winsup/mingw/include/process.h
winsup/mingw/include/stdint.h
winsup/mingw/include/stdio.h
winsup/mingw/include/stdlib.h
winsup/mingw/include/sys/param.h
winsup/mingw/include/wchar.h
winsup/mingw/mingwex/Makefile.in
winsup/mingw/mingwex/gdtoa/gd_qnan.h
winsup/mingw/mingwex/tsearch.c
winsup/w32api/ChangeLog
winsup/w32api/include/setupapi.h
winsup/w32api/include/winbase.h
winsup/w32api/include/windows.h
winsup/w32api/include/winnt.h
winsup/w32api/include/winuser.h
winsup/w32api/include/winver.h
winsup/w32api/include/wtsapi32.h
winsup/w32api/lib/Makefile.in
winsup/w32api/lib/kernel32.def
winsup/w32api/lib/wtsapi32.def
Delete:
winsup/mingw/mingwex/membarrier.c
winsup/w32api/include/sdkddkver.h
159 files changed, 9109 insertions, 1968 deletions
diff --git a/compile b/compile new file mode 100755 index 000000000..ec64c6220 --- /dev/null +++ b/compile @@ -0,0 +1,143 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. +# Written by Tom Tromey <tromey@cygnus.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/include/ChangeLog b/include/ChangeLog index 4ad0de858..38e30cf89 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,14 +1,3 @@ -2012-08-02 Sean Keys <skeys@ipdatasys.com> - - * elf/m68hc11.h: #define E_M68HC11_NO_BANK_WARNING - 0x000000200 - -2012-07-24 Stephan McCamant <smcc@cs.berkeley.edu> - Dr David Alan Gilbert <dave@treblig.org> - - PR binutils/13135 - * dis-asm.h (fprintf_ftype): Add ATTRIBUTE_FPTR_PRINTF_2. - 2012-07-13 Doug Evans <dje@google.com> * filenames.h: #include "hashtab.h". @@ -18,11 +7,6 @@ * elf/s390.h (START_RELOC_NUMBERS): Define R_390_IRELATIVE reloc. -2012-07-05 Sean Keys <skeys@ipdatasys.com> - - * opcode/xgate.h: Changed the format string for mode - XGATE_OP_DYA_MON. - 2012-06-18 Doug Evans <dje@google.com> * dwarf2.def (DW_OP): Add DW_OP_GNU_const_index. diff --git a/include/dis-asm.h b/include/dis-asm.h index 661e7cf58..f9c8ae9d3 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -35,7 +35,7 @@ extern "C" { #include <stdio.h> #include "bfd.h" - typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2; + typedef int (*fprintf_ftype) (void *, const char*, ...) /*ATTRIBUTE_FPTR_PRINTF_2*/; enum dis_insn_type { diff --git a/include/elf/m68hc11.h b/include/elf/m68hc11.h index 58d882088..9a37a4442 100644 --- a/include/elf/m68hc11.h +++ b/include/elf/m68hc11.h @@ -73,9 +73,6 @@ END_RELOC_NUMBERS (R_M68HC11_max) /* XGATE ram offsetting. */ #define E_M68HC11_XGATE_RAMOFFSET 0x000000100 -/* Suppress warnings */ -#define E_M68HC11_NO_BANK_WARNING 0x000000200 - #define EF_M68HC11_MACH_MASK 0xF0 #define EF_M68HC11_GENERIC 0x00 /* Generic 68HC12/backward compatibility. */ #define EF_M68HC12_MACH 0x10 /* 68HC12 microcontroller. */ diff --git a/include/mach-o/ChangeLog b/include/mach-o/ChangeLog new file mode 100644 index 000000000..19eacd0c5 --- /dev/null +++ b/include/mach-o/ChangeLog @@ -0,0 +1,51 @@ +2012-02-23 Iain Sandoe <idsandoe@googlemail.com> + + * external.h: Add comments about relocations fields. Add macros + for non-scattered relocations. Move scattered relocation macros to + here. + * reloc.h: Remove macros related to external representation of reloc + fields. + +2012-01-12 Iain Sandoe <idsandoe@googlemail.com> + + * loader.h (BFD_MACH_O_INDIRECT_SYM_LOCAL): New. + (BFD_MACH_O_INDIRECT_SYM_ABS): New + +2012-01-04 Tristan Gingold <gingold@adacore.com> + + * external.h (mach_o_fvmlib_command_external): New structure. + +2012-01-04 Tristan Gingold <gingold@adacore.com> + + * loader.h: Update copyright year. + (bfd_mach_o_cpu_subtype): Add ARM subtypes. + +2012-01-04 Tristan Gingold <gingold@adacore.com> + + * external.h: Update copyright year. + (mach_o_symtab_command_external): Add comments. + (mach_o_encryption_info_command_external): New structure. + +2011-12-16 Tristan Gingold <gingold@adacore.com> + + * codesign.h: New file. + +2011-08-08 Tristan Gingold <gingold@adacore.com> + + * loader.h (bfd_mach_o_load_command_type): Add + BFD_MACH_O_LC_LOAD_UPWARD_DYLIB, BFD_MACH_O_LC_VERSION_MIN_MACOSX, + BFD_MACH_O_LC_VERSION_MIN_IPHONEOS, BFD_MACH_O_LC_FUNCTION_STARTS, + and BFD_MACH_O_LC_DYLD_ENVIRONMENT. + * external.h (mach_o_version_min_command_external): New structure. + +2011-08-08 Tristan Gingold <gingold@adacore.com> + + * loader.h: Reorder declarations. + * x86-64.h: New file. + * external.h: New file. + * reloc.h: New file. + +2011-07-06 Tristan Gingold <gingold@adacore.com> + + * loader.h: New file. + diff --git a/include/mach-o/codesign.h b/include/mach-o/codesign.h new file mode 100644 index 000000000..ee2f792ac --- /dev/null +++ b/include/mach-o/codesign.h @@ -0,0 +1,85 @@ +/* Mach-O support for BFD. + Copyright 2011 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _MACH_O_CODESIGN_H +#define _MACH_O_CODESIGN_H + +/* Codesign blob magics. */ + +/* Superblob containing all the components. */ +#define BFD_MACH_O_CS_MAGIC_EMBEDDED_SIGNATURE 0xfade0cc0 + +/* Individual code requirement. */ +#define BFD_MACH_O_CS_MAGIC_REQUIREMENT 0xfade0c00 + +/* Collection of code requirements, indexed by type. */ +#define BFD_MACH_O_CS_MAGIC_REQUIREMENTS 0xfade0c01 + +/* Directory. */ +#define BFD_MACH_O_CS_MAGIC_CODEDIRECTORY 0xfade0c02 + +/* Entitlements blob. */ +#define BFD_MACH_O_CS_MAGIC_EMBEDDED_ENTITLEMENTS 0xfade7171 + +/* Blob container. */ +#define BFD_MACH_O_CS_MAGIC_BLOB_WRAPPER 0xfade0b01 + +struct mach_o_codesign_codedirectory_external_v1 +{ + /* All the fields are in network byte order (big endian). */ + unsigned char version[4]; + unsigned char flags[4]; + unsigned char hash_offset[4]; + unsigned char ident_offset[4]; + unsigned char nbr_special_slots[4]; + unsigned char nbr_code_slots[4]; + unsigned char code_limit[4]; + unsigned char hash_size[1]; + unsigned char hash_type[1]; + unsigned char spare1[1]; + unsigned char page_size[1]; + unsigned char spare2[4]; +}; + +struct mach_o_codesign_codedirectory_v1 +{ + unsigned int version; + unsigned int flags; + unsigned int hash_offset; + unsigned int ident_offset; + unsigned int nbr_special_slots; + unsigned int nbr_code_slots; + unsigned int code_limit; + unsigned char hash_size; + unsigned char hash_type; + unsigned char spare1; + unsigned char page_size; + unsigned int spare2; +}; + +/* Value for hash_type. */ +#define BFD_MACH_O_CS_NO_HASH 0 +#define BFD_MACH_O_CS_HASH_SHA1 1 +#define BFD_MACH_O_CS_HASH_SHA256 2 +#define BFD_MACH_O_CS_HASH_PRESTANDARD_SKEIN_160x256 32 /* Skein, 160 bits */ +#define BFD_MACH_O_CS_HASH_PRESTANDARD_SKEIN_256x512 33 /* Skein, 256 bits */ + +#endif /* _MACH_O_CODESIGN_H */ diff --git a/include/mach-o/external.h b/include/mach-o/external.h new file mode 100644 index 000000000..41a293250 --- /dev/null +++ b/include/mach-o/external.h @@ -0,0 +1,326 @@ +/* Mach-O support for BFD. + Copyright 2011, 2012 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _MACH_O_EXTERNAL_H +#define _MACH_O_EXTERNAL_H + +struct mach_o_header_external +{ + unsigned char magic[4]; /* Magic number. */ + unsigned char cputype[4]; /* CPU that this object is for. */ + unsigned char cpusubtype[4]; /* CPU subtype. */ + unsigned char filetype[4]; /* Type of file. */ + unsigned char ncmds[4]; /* Number of load commands. */ + unsigned char sizeofcmds[4]; /* Total size of load commands. */ + unsigned char flags[4]; /* Flags. */ + unsigned char reserved[4]; /* Reserved (on 64-bit version only). */ +}; + +#define BFD_MACH_O_HEADER_SIZE 28 +#define BFD_MACH_O_HEADER_64_SIZE 32 + +/* 32-bit section header. */ + +struct mach_o_section_32_external +{ + unsigned char sectname[16]; /* Section name. */ + unsigned char segname[16]; /* Segment that the section belongs to. */ + unsigned char addr[4]; /* Address of this section in memory. */ + unsigned char size[4]; /* Size in bytes of this section. */ + unsigned char offset[4]; /* File offset of this section. */ + unsigned char align[4]; /* log2 of this section's alignment. */ + unsigned char reloff[4]; /* File offset of this section's relocs. */ + unsigned char nreloc[4]; /* Number of relocs for this section. */ + unsigned char flags[4]; /* Section flags/attributes. */ + unsigned char reserved1[4]; + unsigned char reserved2[4]; +}; +#define BFD_MACH_O_SECTION_SIZE 68 + +/* 64-bit section header. */ + +struct mach_o_section_64_external +{ + unsigned char sectname[16]; /* Section name. */ + unsigned char segname[16]; /* Segment that the section belongs to. */ + unsigned char addr[8]; /* Address of this section in memory. */ + unsigned char size[8]; /* Size in bytes of this section. */ + unsigned char offset[4]; /* File offset of this section. */ + unsigned char align[4]; /* log2 of this section's alignment. */ + unsigned char reloff[4]; /* File offset of this section's relocs. */ + unsigned char nreloc[4]; /* Number of relocs for this section. */ + unsigned char flags[4]; /* Section flags/attributes. */ + unsigned char reserved1[4]; + unsigned char reserved2[4]; + unsigned char reserved3[4]; +}; +#define BFD_MACH_O_SECTION_64_SIZE 80 + +struct mach_o_load_command_external +{ + unsigned char cmd[4]; /* The type of load command. */ + unsigned char cmdsize[4]; /* Size in bytes of entire command. */ +}; +#define BFD_MACH_O_LC_SIZE 8 + +struct mach_o_segment_command_32_external +{ + unsigned char segname[16]; /* Name of this segment. */ + unsigned char vmaddr[4]; /* Virtual memory address of this segment. */ + unsigned char vmsize[4]; /* Size there, in bytes. */ + unsigned char fileoff[4]; /* Offset in bytes of the data to be mapped. */ + unsigned char filesize[4]; /* Size in bytes on disk. */ + unsigned char maxprot[4]; /* Maximum permitted vm protection. */ + unsigned char initprot[4]; /* Initial vm protection. */ + unsigned char nsects[4]; /* Number of sections in this segment. */ + unsigned char flags[4]; /* Flags that affect the loading. */ +}; +#define BFD_MACH_O_LC_SEGMENT_SIZE 56 /* Include the header. */ + +struct mach_o_segment_command_64_external +{ + unsigned char segname[16]; /* Name of this segment. */ + unsigned char vmaddr[8]; /* Virtual memory address of this segment. */ + unsigned char vmsize[8]; /* Size there, in bytes. */ + unsigned char fileoff[8]; /* Offset in bytes of the data to be mapped. */ + unsigned char filesize[8]; /* Size in bytes on disk. */ + unsigned char maxprot[4]; /* Maximum permitted vm protection. */ + unsigned char initprot[4]; /* Initial vm protection. */ + unsigned char nsects[4]; /* Number of sections in this segment. */ + unsigned char flags[4]; /* Flags that affect the loading. */ +}; +#define BFD_MACH_O_LC_SEGMENT_64_SIZE 72 /* Include the header. */ + +struct mach_o_reloc_info_external +{ + unsigned char r_address[4]; + unsigned char r_symbolnum[4]; +}; +#define BFD_MACH_O_RELENT_SIZE 8 + +/* Relocations are based on 'address' being a section offset and an assumption + that sections are never more than 2^24-1 bytes in size. Relocation data + also carry information on type/size/PC-relative/extern and whether scattered + or not [stored in the MSB of the r_address]. */ + +#define BFD_MACH_O_SR_SCATTERED 0x80000000 + +/* For a non-scattered reloc, the relocation info is found in r_symbolnum. + Bytes 1 to 3 contain the symbol number (0xffffff, in a non-scattered PAIR). + Byte 4 contains the relocation info - but with differing bit-positions + dependent on target endian-ness - as below. */ + +#define BFD_MACH_O_LE_PCREL 0x01 +#define BFD_MACH_O_LE_LENGTH_SHIFT 1 +#define BFD_MACH_O_LE_EXTERN 0x08 +#define BFD_MACH_O_LE_TYPE_SHIFT 4 + +#define BFD_MACH_O_BE_PCREL 0x80 +#define BFD_MACH_O_BE_LENGTH_SHIFT 5 +#define BFD_MACH_O_BE_EXTERN 0x10 +#define BFD_MACH_O_BE_TYPE_SHIFT 0 + +/* The field sizes are the same for both BE and LE. */ +#define BFD_MACH_O_LENGTH_MASK 0x03 +#define BFD_MACH_O_TYPE_MASK 0x0f + +/* For a scattered reloc entry the info is contained in r_address. There + is no need to discriminate on target endian-ness, since the design was + arranged to produce the same layout on both. Scattered relocations are + only used for local items, therefore there is no 'extern' field. */ + +#define BFD_MACH_O_SR_PCREL 0x40000000 +#define BFD_MACH_O_GET_SR_LENGTH(s) (((s) >> 28) & 0x3) +#define BFD_MACH_O_GET_SR_TYPE(s) (((s) >> 24) & 0x0f) +#define BFD_MACH_O_GET_SR_ADDRESS(s) ((s) & 0x00ffffff) +#define BFD_MACH_O_SET_SR_LENGTH(l) (((l) & 0x3) << 28) +#define BFD_MACH_O_SET_SR_TYPE(t) (((t) & 0xf) << 24) +#define BFD_MACH_O_SET_SR_ADDRESS(s) ((s) & 0x00ffffff) + +struct mach_o_symtab_command_external +{ + unsigned char symoff[4]; /* File offset of the symbol table. */ + unsigned char nsyms[4]; /* Number of symbols. */ + unsigned char stroff[4]; /* File offset of the string table. */ + unsigned char strsize[4]; /* String table size. */ +}; + +struct mach_o_nlist_external +{ + unsigned char n_strx[4]; + unsigned char n_type[1]; + unsigned char n_sect[1]; + unsigned char n_desc[2]; + unsigned char n_value[4]; +}; +#define BFD_MACH_O_NLIST_SIZE 12 + +struct mach_o_nlist_64_external +{ + unsigned char n_strx[4]; + unsigned char n_type[1]; + unsigned char n_sect[1]; + unsigned char n_desc[2]; + unsigned char n_value[8]; +}; +#define BFD_MACH_O_NLIST_64_SIZE 16 + +struct mach_o_thread_command_external +{ + unsigned char flavour[4]; + unsigned char count[4]; +}; + +/* For commands that just have a string or a path. */ +struct mach_o_str_command_external +{ + unsigned char str[4]; +}; + +struct mach_o_dylib_command_external +{ + unsigned char name[4]; + unsigned char timestamp[4]; + unsigned char current_version[4]; + unsigned char compatibility_version[4]; +}; + +struct mach_o_dysymtab_command_external +{ + unsigned char ilocalsym[4]; /* Index of. */ + unsigned char nlocalsym[4]; /* Number of. */ + unsigned char iextdefsym[4]; + unsigned char nextdefsym[4]; + unsigned char iundefsym[4]; + unsigned char nundefsym[4]; + unsigned char tocoff[4]; + unsigned char ntoc[4]; + unsigned char modtaboff[4]; + unsigned char nmodtab[4]; + unsigned char extrefsymoff[4]; + unsigned char nextrefsyms[4]; + unsigned char indirectsymoff[4]; + unsigned char nindirectsyms[4]; + unsigned char extreloff[4]; + unsigned char nextrel[4]; + unsigned char locreloff[4]; + unsigned char nlocrel[4]; +}; + +struct mach_o_dylib_module_external +{ + unsigned char module_name[4]; + unsigned char iextdefsym[4]; + unsigned char nextdefsym[4]; + unsigned char irefsym[4]; + unsigned char nrefsym[4]; + unsigned char ilocalsym[4]; + unsigned char nlocalsym[4]; + unsigned char iextrel[4]; + unsigned char nextrel[4]; + unsigned char iinit_iterm[4]; + unsigned char ninit_nterm[4]; + unsigned char objc_module_info_addr[4]; + unsigned char objc_module_info_size[4]; +}; +#define BFD_MACH_O_DYLIB_MODULE_SIZE 52 + +struct mach_o_dylib_module_64_external +{ + unsigned char module_name[4]; + unsigned char iextdefsym[4]; + unsigned char nextdefsym[4]; + unsigned char irefsym[4]; + unsigned char nrefsym[4]; + unsigned char ilocalsym[4]; + unsigned char nlocalsym[4]; + unsigned char iextrel[4]; + unsigned char nextrel[4]; + unsigned char iinit_iterm[4]; + unsigned char ninit_nterm[4]; + unsigned char objc_module_info_size[4]; + unsigned char objc_module_info_addr[8]; +}; +#define BFD_MACH_O_DYLIB_MODULE_64_SIZE 56 + +struct mach_o_dylib_table_of_contents_external +{ + unsigned char symbol_index[4]; + unsigned char module_index[4]; +}; +#define BFD_MACH_O_TABLE_OF_CONTENT_SIZE 8 + +struct mach_o_linkedit_data_command_external +{ + unsigned char dataoff[4]; + unsigned char datasize[4]; +}; + +struct mach_o_dyld_info_command_external +{ + unsigned char rebase_off[4]; + unsigned char rebase_size[4]; + unsigned char bind_off[4]; + unsigned char bind_size[4]; + unsigned char weak_bind_off[4]; + unsigned char weak_bind_size[4]; + unsigned char lazy_bind_off[4]; + unsigned char lazy_bind_size[4]; + unsigned char export_off[4]; + unsigned char export_size[4]; +}; + +struct mach_o_version_min_command_external +{ + unsigned char version[4]; + unsigned char reserved[4]; +}; + +struct mach_o_encryption_info_command_external +{ + unsigned char cryptoff[4]; /* File offset of the encrypted area. */ + unsigned char cryptsize[4]; /* Size of the encrypted area. */ + unsigned char cryptid[4]; /* Encryption method. */ +}; + +struct mach_o_fvmlib_command_external +{ + unsigned char name[4]; /* Offset of the name. */ + unsigned char minor_version[4]; + unsigned char header_addr[4]; +}; + +struct mach_o_fat_header_external +{ + unsigned char magic[4]; + unsigned char nfat_arch[4]; /* Number of components. */ +}; + +struct mach_o_fat_arch_external +{ + unsigned char cputype[4]; + unsigned char cpusubtype[4]; + unsigned char offset[4]; /* File offset of the member. */ + unsigned char size[4]; /* Size of the member. */ + unsigned char align[4]; /* Power of 2. */ +}; + +#endif /* _MACH_O_EXTERNAL_H */ diff --git a/include/mach-o/loader.h b/include/mach-o/loader.h new file mode 100644 index 000000000..1b9b15efe --- /dev/null +++ b/include/mach-o/loader.h @@ -0,0 +1,360 @@ +/* Mach-O support for BFD. + Copyright 2011, 2012 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _MACH_O_LOADER_H +#define _MACH_O_LOADER_H + +/* Constants for header. */ + +typedef enum bfd_mach_o_mach_header_magic +{ + BFD_MACH_O_MH_MAGIC = 0xfeedface, + BFD_MACH_O_MH_CIGAM = 0xcefaedfe, + BFD_MACH_O_MH_MAGIC_64 = 0xfeedfacf, + BFD_MACH_O_MH_CIGAM_64 = 0xcffaedfe +} +bfd_mach_o_mach_header_magic; + +#define BFD_MACH_O_CPU_IS64BIT 0x1000000 + +typedef enum bfd_mach_o_cpu_type +{ + BFD_MACH_O_CPU_TYPE_VAX = 1, + BFD_MACH_O_CPU_TYPE_MC680x0 = 6, + BFD_MACH_O_CPU_TYPE_I386 = 7, + BFD_MACH_O_CPU_TYPE_MIPS = 8, + BFD_MACH_O_CPU_TYPE_MC98000 = 10, + BFD_MACH_O_CPU_TYPE_HPPA = 11, + BFD_MACH_O_CPU_TYPE_ARM = 12, + BFD_MACH_O_CPU_TYPE_MC88000 = 13, + BFD_MACH_O_CPU_TYPE_SPARC = 14, + BFD_MACH_O_CPU_TYPE_I860 = 15, + BFD_MACH_O_CPU_TYPE_ALPHA = 16, + BFD_MACH_O_CPU_TYPE_POWERPC = 18, + BFD_MACH_O_CPU_TYPE_POWERPC_64 = (BFD_MACH_O_CPU_TYPE_POWERPC | BFD_MACH_O_CPU_IS64BIT), + BFD_MACH_O_CPU_TYPE_X86_64 = (BFD_MACH_O_CPU_TYPE_I386 | BFD_MACH_O_CPU_IS64BIT) +} +bfd_mach_o_cpu_type; + +typedef enum bfd_mach_o_cpu_subtype +{ + /* i386. */ + BFD_MACH_O_CPU_SUBTYPE_X86_ALL = 3, + + /* arm. */ + BFD_MACH_O_CPU_SUBTYPE_ARM_ALL = 0, + BFD_MACH_O_CPU_SUBTYPE_ARM_V4T = 5, + BFD_MACH_O_CPU_SUBTYPE_ARM_V6 = 6, + BFD_MACH_O_CPU_SUBTYPE_ARM_V5TEJ = 7, + BFD_MACH_O_CPU_SUBTYPE_ARM_XSCALE = 8, + BFD_MACH_O_CPU_SUBTYPE_ARM_V7 = 9 +} +bfd_mach_o_cpu_subtype; + +typedef enum bfd_mach_o_filetype +{ + BFD_MACH_O_MH_OBJECT = 0x01, + BFD_MACH_O_MH_EXECUTE = 0x02, + BFD_MACH_O_MH_FVMLIB = 0x03, + BFD_MACH_O_MH_CORE = 0x04, + BFD_MACH_O_MH_PRELOAD = 0x05, + BFD_MACH_O_MH_DYLIB = 0x06, + BFD_MACH_O_MH_DYLINKER = 0x07, + BFD_MACH_O_MH_BUNDLE = 0x08, + BFD_MACH_O_MH_DYLIB_STUB = 0x09, + BFD_MACH_O_MH_DSYM = 0x0a, + BFD_MACH_O_MH_KEXT_BUNDLE = 0x0b +} +bfd_mach_o_filetype; + +typedef enum bfd_mach_o_header_flags +{ + BFD_MACH_O_MH_NOUNDEFS = 0x0000001, + BFD_MACH_O_MH_INCRLINK = 0x0000002, + BFD_MACH_O_MH_DYLDLINK = 0x0000004, + BFD_MACH_O_MH_BINDATLOAD = 0x0000008, + BFD_MACH_O_MH_PREBOUND = 0x0000010, + BFD_MACH_O_MH_SPLIT_SEGS = 0x0000020, + BFD_MACH_O_MH_LAZY_INIT = 0x0000040, + BFD_MACH_O_MH_TWOLEVEL = 0x0000080, + BFD_MACH_O_MH_FORCE_FLAT = 0x0000100, + BFD_MACH_O_MH_NOMULTIDEFS = 0x0000200, + BFD_MACH_O_MH_NOFIXPREBINDING = 0x0000400, + BFD_MACH_O_MH_PREBINDABLE = 0x0000800, + BFD_MACH_O_MH_ALLMODSBOUND = 0x0001000, + BFD_MACH_O_MH_SUBSECTIONS_VIA_SYMBOLS = 0x0002000, + BFD_MACH_O_MH_CANONICAL = 0x0004000, + BFD_MACH_O_MH_WEAK_DEFINES = 0x0008000, + BFD_MACH_O_MH_BINDS_TO_WEAK = 0x0010000, + BFD_MACH_O_MH_ALLOW_STACK_EXECUTION = 0x0020000, + BFD_MACH_O_MH_ROOT_SAFE = 0x0040000, + BFD_MACH_O_MH_SETUID_SAFE = 0x0080000, + BFD_MACH_O_MH_NO_REEXPORTED_DYLIBS = 0x0100000, + BFD_MACH_O_MH_PIE = 0x0200000, + BFD_MACH_O_MH_DEAD_STRIPPABLE_DYLIB = 0x0400000, + BFD_MACH_O_MH_HAS_TLV_DESCRIPTORS = 0x0800000, + BFD_MACH_O_MH_NO_HEAP_EXECUTION = 0x1000000 +} +bfd_mach_o_header_flags; + +/* Load command constants. */ +#define BFD_MACH_O_LC_REQ_DYLD 0x80000000 + +typedef enum bfd_mach_o_load_command_type +{ + BFD_MACH_O_LC_SEGMENT = 0x1, /* File segment to be mapped. */ + BFD_MACH_O_LC_SYMTAB = 0x2, /* Link-edit stab symbol table info (obsolete). */ + BFD_MACH_O_LC_SYMSEG = 0x3, /* Link-edit gdb symbol table info. */ + BFD_MACH_O_LC_THREAD = 0x4, /* Thread. */ + BFD_MACH_O_LC_UNIXTHREAD = 0x5, /* UNIX thread (includes a stack). */ + BFD_MACH_O_LC_LOADFVMLIB = 0x6, /* Load a fixed VM shared library. */ + BFD_MACH_O_LC_IDFVMLIB = 0x7, /* Fixed VM shared library id. */ + BFD_MACH_O_LC_IDENT = 0x8, /* Object identification information (obsolete). */ + BFD_MACH_O_LC_FVMFILE = 0x9, /* Fixed VM file inclusion. */ + BFD_MACH_O_LC_PREPAGE = 0xa, /* Prepage command (internal use). */ + BFD_MACH_O_LC_DYSYMTAB = 0xb, /* Dynamic link-edit symbol table info. */ + BFD_MACH_O_LC_LOAD_DYLIB = 0xc, /* Load a dynamically linked shared library. */ + BFD_MACH_O_LC_ID_DYLIB = 0xd, /* Dynamically linked shared lib identification. */ + BFD_MACH_O_LC_LOAD_DYLINKER = 0xe, /* Load a dynamic linker. */ + BFD_MACH_O_LC_ID_DYLINKER = 0xf, /* Dynamic linker identification. */ + BFD_MACH_O_LC_PREBOUND_DYLIB = 0x10, /* Modules prebound for a dynamically. */ + BFD_MACH_O_LC_ROUTINES = 0x11, /* Image routines. */ + BFD_MACH_O_LC_SUB_FRAMEWORK = 0x12, /* Sub framework. */ + BFD_MACH_O_LC_SUB_UMBRELLA = 0x13, /* Sub umbrella. */ + BFD_MACH_O_LC_SUB_CLIENT = 0x14, /* Sub client. */ + BFD_MACH_O_LC_SUB_LIBRARY = 0x15, /* Sub library. */ + BFD_MACH_O_LC_TWOLEVEL_HINTS = 0x16, /* Two-level namespace lookup hints. */ + BFD_MACH_O_LC_PREBIND_CKSUM = 0x17, /* Prebind checksum. */ + /* Load a dynamically linked shared library that is allowed to be + missing (weak). */ + BFD_MACH_O_LC_LOAD_WEAK_DYLIB = 0x18, + BFD_MACH_O_LC_SEGMENT_64 = 0x19, /* 64-bit segment of this file to be + mapped. */ + BFD_MACH_O_LC_ROUTINES_64 = 0x1a, /* Address of the dyld init routine + in a dylib. */ + BFD_MACH_O_LC_UUID = 0x1b, /* 128-bit UUID of the executable. */ + BFD_MACH_O_LC_RPATH = 0x1c, /* Run path addiions. */ + BFD_MACH_O_LC_CODE_SIGNATURE = 0x1d, /* Local of code signature. */ + BFD_MACH_O_LC_SEGMENT_SPLIT_INFO = 0x1e, /* Local of info to split seg. */ + BFD_MACH_O_LC_REEXPORT_DYLIB = 0x1f, /* Load and re-export lib. */ + BFD_MACH_O_LC_LAZY_LOAD_DYLIB = 0x20, /* Delay load of lib until use. */ + BFD_MACH_O_LC_ENCRYPTION_INFO = 0x21, /* Encrypted segment info. */ + BFD_MACH_O_LC_DYLD_INFO = 0x22, /* Compressed dyld information. */ + BFD_MACH_O_LC_LOAD_UPWARD_DYLIB = 0x23, /* Load upward dylib. */ + BFD_MACH_O_LC_VERSION_MIN_MACOSX = 0x24, /* Minimal MacOSX version. */ + BFD_MACH_O_LC_VERSION_MIN_IPHONEOS = 0x25, /* Minimal IOS version. */ + BFD_MACH_O_LC_FUNCTION_STARTS = 0x26, /* Compressed table of func start. */ + BFD_MACH_O_LC_DYLD_ENVIRONMENT = 0x27 /* Env variable string for dyld. */ +} +bfd_mach_o_load_command_type; + +/* Section constants. */ +/* Constants for the type of a section. */ + +typedef enum bfd_mach_o_section_type +{ + /* Regular section. */ + BFD_MACH_O_S_REGULAR = 0x0, + + /* Zero fill on demand section. */ + BFD_MACH_O_S_ZEROFILL = 0x1, + + /* Section with only literal C strings. */ + BFD_MACH_O_S_CSTRING_LITERALS = 0x2, + + /* Section with only 4 byte literals. */ + BFD_MACH_O_S_4BYTE_LITERALS = 0x3, + + /* Section with only 8 byte literals. */ + BFD_MACH_O_S_8BYTE_LITERALS = 0x4, + + /* Section with only pointers to literals. */ + BFD_MACH_O_S_LITERAL_POINTERS = 0x5, + + /* For the two types of symbol pointers sections and the symbol stubs + section they have indirect symbol table entries. For each of the + entries in the section the indirect symbol table entries, in + corresponding order in the indirect symbol table, start at the index + stored in the reserved1 field of the section structure. Since the + indirect symbol table entries correspond to the entries in the + section the number of indirect symbol table entries is inferred from + the size of the section divided by the size of the entries in the + section. For symbol pointers sections the size of the entries in + the section is 4 bytes and for symbol stubs sections the byte size + of the stubs is stored in the reserved2 field of the section + structure. */ + + /* Section with only non-lazy symbol pointers. */ + BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS = 0x6, + + /* Section with only lazy symbol pointers. */ + BFD_MACH_O_S_LAZY_SYMBOL_POINTERS = 0x7, + + /* Section with only symbol stubs, byte size of stub in the reserved2 + field. */ + BFD_MACH_O_S_SYMBOL_STUBS = 0x8, + + /* Section with only function pointers for initialization. */ + BFD_MACH_O_S_MOD_INIT_FUNC_POINTERS = 0x9, + + /* Section with only function pointers for termination. */ + BFD_MACH_O_S_MOD_FINI_FUNC_POINTERS = 0xa, + + /* Section contains symbols that are coalesced by the linkers. */ + BFD_MACH_O_S_COALESCED = 0xb, + + /* Zero fill on demand section (possibly larger than 4 GB). */ + BFD_MACH_O_S_GB_ZEROFILL = 0xc, + + /* Section with only pairs of function pointers for interposing. */ + BFD_MACH_O_S_INTERPOSING = 0xd, + + /* Section with only 16 byte literals. */ + BFD_MACH_O_S_16BYTE_LITERALS = 0xe, + + /* Section contains DTrace Object Format. */ + BFD_MACH_O_S_DTRACE_DOF = 0xf, + + /* Section with only lazy symbol pointers to lazy loaded dylibs. */ + BFD_MACH_O_S_LAZY_DYLIB_SYMBOL_POINTERS = 0x10 +} +bfd_mach_o_section_type; + +/* The flags field of a section structure is separated into two parts a section + type and section attributes. The section types are mutually exclusive (it + can only have one type) but the section attributes are not (it may have more + than one attribute). */ + +#define BFD_MACH_O_SECTION_TYPE_MASK 0x000000ff + +/* Constants for the section attributes part of the flags field of a section + structure. */ +#define BFD_MACH_O_SECTION_ATTRIBUTES_MASK 0xffffff00 +/* System setable attributes. */ +#define BFD_MACH_O_SECTION_ATTRIBUTES_SYS 0x00ffff00 +/* User attributes. */ +#define BFD_MACH_O_SECTION_ATTRIBUTES_USR 0xff000000 + +typedef enum bfd_mach_o_section_attribute +{ + /* Section has no specified attibutes. */ + BFD_MACH_O_S_ATTR_NONE = 0, + + /* Section has local relocation entries. */ + BFD_MACH_O_S_ATTR_LOC_RELOC = 0x00000100, + + /* Section has external relocation entries. */ + BFD_MACH_O_S_ATTR_EXT_RELOC = 0x00000200, + + /* Section contains some machine instructions. */ + BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS = 0x00000400, + + /* A debug section. */ + BFD_MACH_O_S_ATTR_DEBUG = 0x02000000, + + /* Used with i386 stubs. */ + BFD_MACH_O_S_SELF_MODIFYING_CODE = 0x04000000, + + /* Blocks are live if they reference live blocks. */ + BFD_MACH_O_S_ATTR_LIVE_SUPPORT = 0x08000000, + + /* No dead stripping. */ + BFD_MACH_O_S_ATTR_NO_DEAD_STRIP = 0x10000000, + + /* Section symbols can be stripped in files with MH_DYLDLINK flag. */ + BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS = 0x20000000, + + /* Section contains coalesced symbols that are not to be in the TOC of an + archive. */ + BFD_MACH_O_S_ATTR_NO_TOC = 0x40000000, + + /* Section contains only true machine instructions. */ + BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS = 0x80000000 +} +bfd_mach_o_section_attribute; + +/* Symbol constants. */ + +/* Symbol n_type values. */ +#define BFD_MACH_O_N_STAB 0xe0 /* If any of these bits set, a symbolic debugging entry. */ +#define BFD_MACH_O_N_PEXT 0x10 /* Private external symbol bit. */ +#define BFD_MACH_O_N_TYPE 0x0e /* Mask for the type bits. */ +#define BFD_MACH_O_N_EXT 0x01 /* External symbol bit, set for external symbols. */ +#define BFD_MACH_O_N_UNDF 0x00 /* Undefined, n_sect == NO_SECT. */ +#define BFD_MACH_O_N_ABS 0x02 /* Absolute, n_sect == NO_SECT. */ +#define BFD_MACH_O_N_INDR 0x0a /* Indirect. */ +#define BFD_MACH_O_N_PBUD 0x0c /* Prebound undefined (defined in a dylib). */ +#define BFD_MACH_O_N_SECT 0x0e /* Defined in section number n_sect. */ + +#define BFD_MACH_O_NO_SECT 0 /* Symbol not in any section of the image. */ + +/* Symbol n_desc reference flags. */ +#define BFD_MACH_O_REFERENCE_MASK 0x0f +#define BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_NON_LAZY 0x00 +#define BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_LAZY 0x01 +#define BFD_MACH_O_REFERENCE_FLAG_DEFINED 0x02 +#define BFD_MACH_O_REFERENCE_FLAG_PRIVATE_DEFINED 0x03 +#define BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY 0x04 +#define BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY 0x05 + +#define BFD_MACH_O_REFERENCED_DYNAMICALLY 0x10 +#define BFD_MACH_O_N_DESC_DISCARDED 0x20 +#define BFD_MACH_O_N_NO_DEAD_STRIP 0x20 +#define BFD_MACH_O_N_WEAK_REF 0x40 +#define BFD_MACH_O_N_WEAK_DEF 0x80 + +#define BFD_MACH_O_INDIRECT_SYM_LOCAL 0x80000000 +#define BFD_MACH_O_INDIRECT_SYM_ABS 0x40000000 + +/* Thread constants. */ + +typedef enum bfd_mach_o_ppc_thread_flavour +{ + BFD_MACH_O_PPC_THREAD_STATE = 1, + BFD_MACH_O_PPC_FLOAT_STATE = 2, + BFD_MACH_O_PPC_EXCEPTION_STATE = 3, + BFD_MACH_O_PPC_VECTOR_STATE = 4, + BFD_MACH_O_PPC_THREAD_STATE64 = 5, + BFD_MACH_O_PPC_EXCEPTION_STATE64 = 6, + BFD_MACH_O_PPC_THREAD_STATE_NONE = 7 +} +bfd_mach_o_ppc_thread_flavour; + +/* Defined in <mach/i386/thread_status.h> */ +typedef enum bfd_mach_o_i386_thread_flavour +{ + BFD_MACH_O_x86_THREAD_STATE32 = 1, + BFD_MACH_O_x86_FLOAT_STATE32 = 2, + BFD_MACH_O_x86_EXCEPTION_STATE32 = 3, + BFD_MACH_O_x86_THREAD_STATE64 = 4, + BFD_MACH_O_x86_FLOAT_STATE64 = 5, + BFD_MACH_O_x86_EXCEPTION_STATE64 = 6, + BFD_MACH_O_x86_THREAD_STATE = 7, + BFD_MACH_O_x86_FLOAT_STATE = 8, + BFD_MACH_O_x86_EXCEPTION_STATE = 9, + BFD_MACH_O_x86_DEBUG_STATE32 = 10, + BFD_MACH_O_x86_DEBUG_STATE64 = 11, + BFD_MACH_O_x86_DEBUG_STATE = 12, + BFD_MACH_O_x86_THREAD_STATE_NONE = 13 +} +bfd_mach_o_i386_thread_flavour; + +#endif /* _MACH_O_LOADER_H */ diff --git a/include/mach-o/reloc.h b/include/mach-o/reloc.h new file mode 100644 index 000000000..bab31efeb --- /dev/null +++ b/include/mach-o/reloc.h @@ -0,0 +1,33 @@ +/* Mach-O support for BFD. + Copyright 2011, 2012 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _MACH_O_RELOC_H +#define _MACH_O_RELOC_H + +/* Generic relocation types (used by i386). */ +#define BFD_MACH_O_GENERIC_RELOC_VANILLA 0 +#define BFD_MACH_O_GENERIC_RELOC_PAIR 1 +#define BFD_MACH_O_GENERIC_RELOC_SECTDIFF 2 +#define BFD_MACH_O_GENERIC_RELOC_PB_LA_PTR 3 +#define BFD_MACH_O_GENERIC_RELOC_LOCAL_SECTDIFF 4 +#define BFD_MACH_O_GENERIC_RELOC_TLV 5 + +#endif /* _MACH_O_RELOC_H */ diff --git a/include/mach-o/x86-64.h b/include/mach-o/x86-64.h new file mode 100644 index 000000000..d06bc26a7 --- /dev/null +++ b/include/mach-o/x86-64.h @@ -0,0 +1,37 @@ +/* Mach-O support for BFD. + Copyright 2011 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _MACH_O_X86_64_H +#define _MACH_O_X86_64_H + +/* X86-64 relocations. */ +#define BFD_MACH_O_X86_64_RELOC_UNSIGNED 0 /* Absolute addresses. */ +#define BFD_MACH_O_X86_64_RELOC_SIGNED 1 /* 32-bit disp. */ +#define BFD_MACH_O_X86_64_RELOC_BRANCH 2 /* 32-bit pcrel disp. */ +#define BFD_MACH_O_X86_64_RELOC_GOT_LOAD 3 /* Movq load of a GOT entry. */ +#define BFD_MACH_O_X86_64_RELOC_GOT 4 /* GOT reference. */ +#define BFD_MACH_O_X86_64_RELOC_SUBTRACTOR 5 /* Symbol difference. */ +#define BFD_MACH_O_X86_64_RELOC_SIGNED_1 6 /* 32-bit signed disp -1. */ +#define BFD_MACH_O_X86_64_RELOC_SIGNED_2 7 /* 32-bit signed disp -2. */ +#define BFD_MACH_O_X86_64_RELOC_SIGNED_4 8 /* 32-bit signed disp -4. */ +#define BFD_MACH_O_X86_64_RELOC_TLV 9 /* Thread local variables. */ + +#endif /* _MACH_O_X86_64_H */ diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index 1091973b2..4b8d3002c 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,18 +1,3 @@ -2012-07-31 Chao-Ying Fu <fu@mips.com> - Catherine Moore <clm@codesourcery.com> - Maciej W. Rozycki <macro@codesourcery.com> - - * mips.h: Document microMIPS DSP ASE usage. - (MICROMIPSOP_MASK_DSPACC, MICROMIPSOP_SH_DSPACC): Update for - microMIPS DSP ASE support. - (MICROMIPSOP_MASK_DSPSFT, MICROMIPSOP_SH_DSPSFT): Likewise. - (MICROMIPSOP_MASK_SA3, MICROMIPSOP_SH_SA3): Likewise. - (MICROMIPSOP_MASK_SA4, MICROMIPSOP_SH_SA4): Likewise. - (MICROMIPSOP_MASK_IMM8, MICROMIPSOP_SH_IMM8): Likewise. - (MICROMIPSOP_MASK_IMM10, MICROMIPSOP_SH_IMM10): Likewise. - (MICROMIPSOP_MASK_WRDSP, MICROMIPSOP_SH_WRDSP): Likewise. - (MICROMIPSOP_MASK_BP, MICROMIPSOP_SH_BP): Likewise. - 2012-07-06 Maciej W. Rozycki <macro@codesourcery.com> * mips.h: Fix a typo in description. diff --git a/include/opcode/mips.h b/include/opcode/mips.h index 857fc7173..92325080b 100644 --- a/include/opcode/mips.h +++ b/include/opcode/mips.h @@ -1494,24 +1494,6 @@ extern const int bfd_mips16_num_opcodes; #define MICROMIPSOP_MASK_IMMY 0x1ff #define MICROMIPSOP_SH_IMMY 1 -/* MIPS DSP ASE */ -#define MICROMIPSOP_MASK_DSPACC 0x3 -#define MICROMIPSOP_SH_DSPACC 14 -#define MICROMIPSOP_MASK_DSPSFT 0x3f -#define MICROMIPSOP_SH_DSPSFT 16 -#define MICROMIPSOP_MASK_SA3 0x7 -#define MICROMIPSOP_SH_SA3 13 -#define MICROMIPSOP_MASK_SA4 0xf -#define MICROMIPSOP_SH_SA4 12 -#define MICROMIPSOP_MASK_IMM8 0xff -#define MICROMIPSOP_SH_IMM8 13 -#define MICROMIPSOP_MASK_IMM10 0x3ff -#define MICROMIPSOP_SH_IMM10 16 -#define MICROMIPSOP_MASK_WRDSP 0x3f -#define MICROMIPSOP_SH_WRDSP 14 -#define MICROMIPSOP_MASK_BP 0x3 -#define MICROMIPSOP_SH_BP 14 - /* Placeholders for fields that only exist in the traditional 32-bit instruction encoding; see the comment above for details. */ #define MICROMIPSOP_MASK_CODE20 0 @@ -1526,12 +1508,28 @@ extern const int bfd_mips16_num_opcodes; #define MICROMIPSOP_SH_VECBYTE 0 #define MICROMIPSOP_MASK_VECALIGN 0 #define MICROMIPSOP_SH_VECALIGN 0 +#define MICROMIPSOP_MASK_DSPACC 0 +#define MICROMIPSOP_SH_DSPACC 0 #define MICROMIPSOP_MASK_DSPACC_S 0 #define MICROMIPSOP_SH_DSPACC_S 0 +#define MICROMIPSOP_MASK_DSPSFT 0 +#define MICROMIPSOP_SH_DSPSFT 0 #define MICROMIPSOP_MASK_DSPSFT_7 0 #define MICROMIPSOP_SH_DSPSFT_7 0 +#define MICROMIPSOP_MASK_SA3 0 +#define MICROMIPSOP_SH_SA3 0 +#define MICROMIPSOP_MASK_SA4 0 +#define MICROMIPSOP_SH_SA4 0 +#define MICROMIPSOP_MASK_IMM8 0 +#define MICROMIPSOP_SH_IMM8 0 +#define MICROMIPSOP_MASK_IMM10 0 +#define MICROMIPSOP_SH_IMM10 0 +#define MICROMIPSOP_MASK_WRDSP 0 +#define MICROMIPSOP_SH_WRDSP 0 #define MICROMIPSOP_MASK_RDDSP 0 #define MICROMIPSOP_SH_RDDSP 0 +#define MICROMIPSOP_MASK_BP 0 +#define MICROMIPSOP_SH_BP 0 #define MICROMIPSOP_MASK_MT_U 0 #define MICROMIPSOP_SH_MT_U 0 #define MICROMIPSOP_MASK_MT_H 0 @@ -1704,18 +1702,6 @@ extern const int bfd_mips16_num_opcodes; "f" 32-bit floating point constant "l" 32-bit floating point constant in .lit4 - DSP ASE usage: - "2" 2-bit unsigned immediate for byte align (MICROMIPSOP_*_BP) - "3" 3-bit unsigned immediate (MICROMIPSOP_*_SA3) - "4" 4-bit unsigned immediate (MICROMIPSOP_*_SA4) - "5" 8-bit unsigned immediate (MICROMIPSOP_*_IMM8) - "6" 5-bit unsigned immediate (MICROMIPSOP_*_RS) - "7" 2-bit DSP accumulator register (MICROMIPSOP_*_DSPACC) - "8" 6-bit unsigned immediate (MICROMIPSOP_*_WRDSP) - "0" 6-bit signed immediate (MICROMIPSOP_*_DSPSFT) - "@" 10-bit signed immediate (MICROMIPSOP_*_IMM10) - "^" 5-bit unsigned immediate (MICROMIPSOP_*_RD) - Other: "()" parens surrounding optional value "," separates operands @@ -1723,8 +1709,8 @@ extern const int bfd_mips16_num_opcodes; "m" start of microMIPS extension sequence Characters used so far, for quick reference when adding more: - "12345678 0" - "<>(),+.@\^|~" + "1234567890" + "<>(),+.\|~" "ABCDEFGHI KLMN RST V " "abcd f hijklmnopqrstuvw yz" diff --git a/ltoptions.m4 b/ltoptions.m4 new file mode 100644 index 000000000..5ef12ced2 --- /dev/null +++ b/ltoptions.m4 @@ -0,0 +1,369 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/ltversion.m4 b/ltversion.m4 new file mode 100644 index 000000000..bf87f7713 --- /dev/null +++ b/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# Generated from ltversion.in. + +# serial 3134 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.7a]) +m4_define([LT_PACKAGE_REVISION], [1.3134]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.7a' +macro_revision='1.3134' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/lt~obsolete.m4 b/lt~obsolete.m4 new file mode 100644 index 000000000..bf92b5e07 --- /dev/null +++ b/lt~obsolete.m4 @@ -0,0 +1,98 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 4 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index cc8e7dccc..3ce8fd9a3 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,104 +1,3 @@ -2012-08-09 Corinna Vinschen <vinschen@redhat.com> - - * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Fix guard around state to - allow usage in !FLOATING_POINT && _WANT_IO_C99_FORMATS case. - -2012-08-08 Eric Blake <eblake@redhat.com> - - * libc/posix/engine.c(dissect): Guard diagnostic pragma for right - versions of GCC only. - * libc/string/strcasestr.c: Ditto. - -2012-08-08 Corinna Vinschen <vinschen@redhat.com> - - Throughout, run newlib with -Wall -Werror option and fix bugs and - compiler warnings found this way. - - * libc/stdio/freopen.c (_freopen_r): Fix bug setting _flags. - - * libc/include/stdio.h (_rename): Define when building newlib. - * libc/include/sys/signal.h (_kill): Ditto. - * libc/include/sys/stat.h (_mkdir): Ditto. - * libc/include/sys/time.h (_gettimeofday): Ditto. - * libc/include/sys/times.h (_times): Ditto. - * libc/include/sys/wait.h (_wait): Ditto. - * libc/locale/lmessages.c (empty): Don't define for Cygwin. - * libc/locale/lmonetary.c (cnv): Ditto. - * libc/locale/nl_langinfo.c (nl_langinfo): Ditto for variable s. - * libc/posix/collate.c: Throughout cast to avoid compiler warning. - * libc/posix/engine.c (matcher): Initialize dp to avoid compiler - warning. - (dissect): Deliberately silence gcc compiler warning. Add comment to - explain why. - * libc/posix/glob.c: Disable on Cygwin. Explain why. - * libc/posix/regcomp.c: Fix "uninitialized" compiler warnings. - * libc/posix/wordexp.c (wordexp): Remove num_bytes variable since result - is never used. - * libc/posix/popen.c (popen): Ditto for variable last. - * libc/reent/mkdirr.c: Include sys/stat.h. - * libc/reent/renamer.c: Include stdio.h. - * libc/search/hash.c: Throughout use underscored variants of the stat - function family. - (init_hash): Add missing definition for the __USE_INTERNAL_STAT64 case. - * libc/search/hash_bigkey.c (__big_insert): Add parenthesis to avoid - compiler warning. - * libc/search/hash_page.c (overflow_page): Initalize freep to NULL to - avoid compiler warning. - * libc/stdio/asiprintf.c (_asiprintf_r): Cast unsigned char * to char * - to avoid compiler warning. - (asiprintf): Ditto. - * libc/stdio/asprintf.c (_asprintf_r): Ditto. - (asprintf): Ditto. - * libc/stdio/vasiprintf.c (_vasiprintf_r): Ditto. - * libc/stdio/vasprintf.c (_vasprintf_r): Ditto. - * libc/stdio/mktemp.c (_gettemp): Cast to unsigned char in call to - isdigit to avoid compiler warning. - * libc/stdio/vfprintf.c (_VFPRINTF_R): Initialize variables used for - grouping to avoid compiler warning. Only define and set nseps and - nrepeats if they are really used. - * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Ditto. Only define state if - it is really used. - * libc/stdio/vfscanf.c (u_char): Revert to be defined as unsigned char. - (__SVFSCANF_R): Cast fmt in call to __mbtowc. - * libc/stdlib/mbtowc_r.c (JIS_state_table): Disable when building - Cygwin. - (JIS_action_table): Ditto. - * libc/stdlib/wctomb_r.c (__utf8_wctomb): Add parenthesis to avoid - compiler warning. - * libc/string/strcasestr.c: Deliberately silence gcc compiler warning. - Add comment to explain why. - * libc/time/strptime.c (strptime): Cast to unsigned char in calls to - isspace to avoid compiler warning. - * libm/math/e_atan2.c (__ieee754_atan2): Add parenthesis to avoid - compiler warning. - * libm/math/e_exp.c (__ieee754_exp): Initialize k to 0 to avoid - compiler warning. Drop setting it to 0 later. - * libm/math/ef_exp.c (__ieee754_expf): Ditto. - * libm/math/e_pow.c (__ieee754_pow): Add braces to avoid compiler - warning. - * libm/math/ef_pow.c (__ieee754_powf): Ditto. - * libm/math/er_lgamma.c (__ieee754_lgamma_r): Initialize nadj to 0 to - avoid compiler warning. - * libm/math/erf_lgamma.c (__ieee754_lgammaf_r): Ditto. - * libm/math/e_rem_pio2.c (__ieee754_rem_pio2): Ditto for variable z. - * libm/common/sf_round.c (roundf): Remove signbit variable since result - is never used. - -2012-08-07 Corinna Vinschen <vinschen@redhat.com> - - * libc/stdlib/mprec.h (Storeinc): Add parenthesis to avoid compiler - warning. - -2012-07-30 Kevin Buettner <kevinb@redhat.com> - - * libc/sys/sysnecv850/crt0.S (_start): Use v850e-specific - start up code for v850e2 and v850e2v3 too. - -2012-07-20 Eric Blake <eblake@redhat.com> - - * libc/posix/readdir.c (readdir): Drop bogus attempt to catch - bogus pointers. - 2012-07-18 Ralf Corsépius <ralf.corsepius@rtems.org> * libc/sys/rtems/machine/_types.h (_ssize_t): Use signed int for diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 305e409b8..2912eafa9 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -227,9 +227,6 @@ int _EXFUN(sprintf, (char *, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); int _EXFUN(remove, (const char *)); int _EXFUN(rename, (const char *, const char *)); -#ifdef _COMPILING_NEWLIB -int _EXFUN(_rename, (const char *, const char *)); -#endif #endif #if !defined(__STRICT_ANSI__) || defined(__USE_XOPEN2K) #ifdef _COMPILING_NEWLIB diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h index 4e3be1ccf..881df8334 100644 --- a/newlib/libc/include/sys/signal.h +++ b/newlib/libc/include/sys/signal.h @@ -143,9 +143,6 @@ int _EXFUN(pthread_sigmask, (int how, const sigset_t *set, sigset_t *oset)); #undef sigfillset #undef sigismember -#ifdef _COMPILING_NEWLIB -int _EXFUN(_kill, (pid_t, int)); -#endif int _EXFUN(kill, (pid_t, int)); int _EXFUN(killpg, (pid_t, int)); int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *)); diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h index fa2036dd3..f00caa661 100644 --- a/newlib/libc/include/sys/stat.h +++ b/newlib/libc/include/sys/stat.h @@ -170,10 +170,8 @@ int _EXFUN(futimens, (int, const struct timespec *)); #ifdef _COMPILING_NEWLIB int _EXFUN(_fstat,( int __fd, struct stat *__sbuf )); int _EXFUN(_stat,( const char *__path, struct stat *__sbuf )); -int _EXFUN(_mkdir,( const char *_path, mode_t __mode )); #ifdef __LARGE64_FILES struct stat64; -int _EXFUN(_stat64,( const char *__path, struct stat64 *__sbuf )); int _EXFUN(_fstat64,( int __fd, struct stat64 *__sbuf )); #endif #endif diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index b388b2c5f..3c9bf771b 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -71,10 +71,6 @@ struct itimerval { } while (0) #endif /* defined (__rtems__) || defined (__CYGWIN__) */ -#ifdef _COMPILING_NEWLIB -int _EXFUN(_gettimeofday, (struct timeval *__p, void *__tz)); -#endif - int _EXFUN(gettimeofday, (struct timeval *__p, void *__tz)); int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *)); int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp)); diff --git a/newlib/libc/include/sys/times.h b/newlib/libc/include/sys/times.h index 927812cb8..9375cb19d 100644 --- a/newlib/libc/include/sys/times.h +++ b/newlib/libc/include/sys/times.h @@ -21,9 +21,6 @@ struct tms { }; clock_t _EXFUN(times,(struct tms *)); -#ifdef _COMPILING_NEWLIB -clock_t _EXFUN(_times,(struct tms *)); -#endif #ifdef __cplusplus } diff --git a/newlib/libc/include/sys/wait.h b/newlib/libc/include/sys/wait.h index 73fe37202..0e4a33945 100644 --- a/newlib/libc/include/sys/wait.h +++ b/newlib/libc/include/sys/wait.h @@ -29,10 +29,6 @@ extern "C" { pid_t wait (int *); pid_t waitpid (pid_t, int *, int); -#ifdef _COMPILING_NEWLIB -pid_t _wait (int *); -#endif - /* Provide prototypes for most of the _<systemcall> names that are provided in newlib for some compilers. */ pid_t _wait (int *); diff --git a/newlib/libc/locale/lmessages.c b/newlib/libc/locale/lmessages.c index 9fb1df4a9..33a4a5a21 100644 --- a/newlib/libc/locale/lmessages.c +++ b/newlib/libc/locale/lmessages.c @@ -35,9 +35,7 @@ #define LCMESSAGES_SIZE_MIN \ (offsetof(struct lc_messages_T, yesstr) / sizeof(char *)) -#ifndef __CYGWIN__ static char empty[] = ""; -#endif static const struct lc_messages_T _C_messages_locale = { "^[yY]" , /* yesexpr */ diff --git a/newlib/libc/locale/lmonetary.c b/newlib/libc/locale/lmonetary.c index 80c2d0442..f1101a902 100644 --- a/newlib/libc/locale/lmonetary.c +++ b/newlib/libc/locale/lmonetary.c @@ -79,7 +79,6 @@ static struct lc_monetary_T _monetary_locale; static int _monetary_using_locale; static char *_monetary_locale_buf; -#ifndef __CYGWIN__ static char cnv(const char *str) { int i = strtol(str, NULL, 10); @@ -87,7 +86,6 @@ cnv(const char *str) { i = CHAR_MAX; return (char)i; } -#endif int __monetary_load_locale(const char *name , void *f_wctomb, const char *charset) diff --git a/newlib/libc/locale/nl_langinfo.c b/newlib/libc/locale/nl_langinfo.c index 4b7e983f0..392a7cbbb 100644 --- a/newlib/libc/locale/nl_langinfo.c +++ b/newlib/libc/locale/nl_langinfo.c @@ -182,10 +182,7 @@ char * _DEFUN(nl_langinfo, (item), nl_item item) { - char *ret, *cs; -#ifndef __CYGWIN__ - char *s; -#endif + char *ret, *s, *cs; static char *csym = NULL; #ifdef TRANSITION_PERIOD_HACK static char *cset = NULL; diff --git a/newlib/libc/machine/rl78/Makefile.am b/newlib/libc/machine/rl78/Makefile.am new file mode 100644 index 000000000..5b78bc171 --- /dev/null +++ b/newlib/libc/machine/rl78/Makefile.am @@ -0,0 +1,16 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +AM_CCASFLAGS = $(INCLUDES) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S +lib_a_CCASFLAGS=$(AM_CCASFLAGS) +lib_a_CFLAGS=$(AM_CFLAGS) + +ACLOCAL_AMFLAGS = -I ../../.. -I ../../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/rl78/Makefile.in b/newlib/libc/machine/rl78/Makefile.in new file mode 100644 index 000000000..a5c1f558f --- /dev/null +++ b/newlib/libc/machine/rl78/Makefile.in @@ -0,0 +1,413 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/../../../../mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +lib_a_AR = $(AR) $(ARFLAGS) +lib_a_LIBADD = +am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) +lib_a_OBJECTS = $(am_lib_a_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = +am__depfiles_maybe = +CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(lib_a_SOURCES) +ETAGS = etags +CTAGS = ctags +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +NO_INCLUDE_LIST = @NO_INCLUDE_LIST@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +READELF = @READELF@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +aext = @aext@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libm_machine_dir = @libm_machine_dir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lpfx = @lpfx@ +machine_dir = @machine_dir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +newlib_basedir = @newlib_basedir@ +oext = @oext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sys_dir = @sys_dir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = cygnus +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) +AM_CCASFLAGS = $(INCLUDES) +noinst_LIBRARIES = lib.a +lib_a_SOURCES = setjmp.S +lib_a_CCASFLAGS = $(AM_CCASFLAGS) +lib_a_CFLAGS = $(AM_CFLAGS) +ACLOCAL_AMFLAGS = -I ../../.. -I ../../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +all: all-am + +.SUFFIXES: +.SUFFIXES: .S .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --cygnus \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --cygnus Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +.S.o: + $(CPPASCOMPILE) -c -o $@ $< + +.S.obj: + $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +lib_a-setjmp.o: setjmp.S + $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.o `test -f 'setjmp.S' || echo '$(srcdir)/'`setjmp.S + +lib_a-setjmp.obj: setjmp.S + $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-am: +check: check-am +all-am: Makefile $(LIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-generic clean-noinstLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-tags dvi dvi-am \ + html html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/rl78/aclocal.m4 b/newlib/libc/machine/rl78/aclocal.m4 new file mode 100644 index 000000000..f4337cf8d --- /dev/null +++ b/newlib/libc/machine/rl78/aclocal.m4 @@ -0,0 +1,992 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar <conftest.tar]) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([../../../acinclude.m4]) diff --git a/newlib/libc/machine/rl78/configure b/newlib/libc/machine/rl78/configure new file mode 100755 index 000000000..e7fe20753 --- /dev/null +++ b/newlib/libc/machine/rl78/configure @@ -0,0 +1,4745 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.68 for newlib 1.20.0. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='newlib' +PACKAGE_TARNAME='newlib' +PACKAGE_VERSION='1.20.0' +PACKAGE_STRING='newlib 1.20.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="setjmp.S" +ac_subst_vars='LTLIBOBJS +LIBOBJS +sys_dir +machine_dir +libm_machine_dir +lpfx +aext +oext +OBJEXT +USE_LIBTOOL_FALSE +USE_LIBTOOL_TRUE +ELIX_LEVEL_4_FALSE +ELIX_LEVEL_4_TRUE +ELIX_LEVEL_3_FALSE +ELIX_LEVEL_3_TRUE +ELIX_LEVEL_2_FALSE +ELIX_LEVEL_2_TRUE +ELIX_LEVEL_1_FALSE +ELIX_LEVEL_1_TRUE +ELIX_LEVEL_0_FALSE +ELIX_LEVEL_0_TRUE +LDFLAGS +NO_INCLUDE_LIST +NEWLIB_CFLAGS +CCASFLAGS +CCAS +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +READELF +RANLIB +AR +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +newlib_basedir +MAY_SUPPLY_SYSCALLS_FALSE +MAY_SUPPLY_SYSCALLS_TRUE +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_multilib +enable_target_optspace +enable_malloc_debugging +enable_newlib_multithread +enable_newlib_iconv +enable_newlib_elix_level +enable_newlib_io_float +enable_newlib_supplied_syscalls +enable_dependency_tracking +enable_maintainer_mode +' + ac_precious_vars='build_alias +host_alias +target_alias +CCAS +CCASFLAGS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures newlib 1.20.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/newlib] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of newlib 1.20.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-multilib build many library versions (default) + --enable-target-optspace optimize for space + --enable-malloc-debugging indicate malloc debugging requested + --enable-newlib-multithread enable support for multiple threads + --enable-newlib-iconv enable iconv library support + --enable-newlib-elix-level supply desired elix library level (1-4) + --disable-newlib-io-float disable printf/scanf family float support + --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + +Some influential environment variables: + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +newlib configure 1.20.0 +generated by GNU Autoconf 2.68 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by newlib $as_me 1.20.0, which was +generated by GNU Autoconf 2.68. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_aux_dir= +for ac_dir in ../../../.. "$srcdir"/../../../..; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../../.. \"$srcdir\"/../../../.." "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +am__api_version='1.11' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +# Check whether --enable-multilib was given. +if test "${enable_multilib+set}" = set; then : + enableval=$enable_multilib; case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) as_fn_error $? "bad value ${enableval} for multilib option" "$LINENO" 5 ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then : + enableval=$enable_target_optspace; case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) as_fn_error $? "bad value ${enableval} for target-optspace option" "$LINENO" 5 ;; + esac +else + target_optspace= +fi + +# Check whether --enable-malloc-debugging was given. +if test "${enable_malloc_debugging+set}" = set; then : + enableval=$enable_malloc_debugging; case "${enableval}" in + yes) malloc_debugging=yes ;; + no) malloc_debugging=no ;; + *) as_fn_error $? "bad value ${enableval} for malloc-debugging option" "$LINENO" 5 ;; + esac +else + malloc_debugging= +fi + +# Check whether --enable-newlib-multithread was given. +if test "${enable_newlib_multithread+set}" = set; then : + enableval=$enable_newlib_multithread; case "${enableval}" in + yes) newlib_multithread=yes ;; + no) newlib_multithread=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-multithread option" "$LINENO" 5 ;; + esac +else + newlib_multithread=yes +fi + +# Check whether --enable-newlib-iconv was given. +if test "${enable_newlib_iconv+set}" = set; then : + enableval=$enable_newlib_iconv; if test "${newlib_iconv+set}" != set; then + case "${enableval}" in + yes) newlib_iconv=yes ;; + no) newlib_iconv=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-iconv option" "$LINENO" 5 ;; + esac + fi +else + newlib_iconv=${newlib_iconv} +fi + +# Check whether --enable-newlib-elix-level was given. +if test "${enable_newlib_elix_level+set}" = set; then : + enableval=$enable_newlib_elix_level; case "${enableval}" in + 0) newlib_elix_level=0 ;; + 1) newlib_elix_level=1 ;; + 2) newlib_elix_level=2 ;; + 3) newlib_elix_level=3 ;; + 4) newlib_elix_level=4 ;; + *) as_fn_error $? "bad value ${enableval} for newlib-elix-level option" "$LINENO" 5 ;; + esac +else + newlib_elix_level=0 +fi + +# Check whether --enable-newlib-io-float was given. +if test "${enable_newlib_io_float+set}" = set; then : + enableval=$enable_newlib_io_float; case "${enableval}" in + yes) newlib_io_float=yes ;; + no) newlib_io_float=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-io-float option" "$LINENO" 5 ;; + esac +else + newlib_io_float=yes +fi + +# Check whether --enable-newlib-supplied-syscalls was given. +if test "${enable_newlib_supplied_syscalls+set}" = set; then : + enableval=$enable_newlib_supplied_syscalls; case "${enableval}" in + yes) newlib_may_supply_syscalls=yes ;; + no) newlib_may_supply_syscalls=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-supplied-syscalls option" "$LINENO" 5 ;; + esac +else + newlib_may_supply_syscalls=yes +fi + + if test x${newlib_may_supply_syscalls} = xyes; then + MAY_SUPPLY_SYSCALLS_TRUE= + MAY_SUPPLY_SYSCALLS_FALSE='#' +else + MAY_SUPPLY_SYSCALLS_TRUE='#' + MAY_SUPPLY_SYSCALLS_FALSE= +fi + + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='newlib' + VERSION='1.20.0' + + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + + + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -z "$CC" && as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using GNU C" >&5 +$as_echo_n "checking whether we are using GNU C... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_c_compiler_gnu=yes +else + ac_cv_c_compiler_gnu=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } + +if test $ac_cv_c_compiler_gnu = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args. +set dummy ${ac_tool_prefix}readelf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_READELF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$READELF"; then + ac_cv_prog_READELF="$READELF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_READELF="${ac_tool_prefix}readelf" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +READELF=$ac_cv_prog_READELF +if test -n "$READELF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 +$as_echo "$READELF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_READELF"; then + ac_ct_READELF=$READELF + # Extract the first word of "readelf", so it can be a program name with args. +set dummy readelf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_READELF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_READELF"; then + ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_READELF="readelf" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_READELF=$ac_cv_prog_ac_ct_READELF +if test -n "$ac_ct_READELF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 +$as_echo "$ac_ct_READELF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_READELF" = x; then + READELF=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + READELF=$ac_ct_READELF + fi +else + READELF="$ac_cv_prog_READELF" +fi + + + + +# Hack to ensure that INSTALL won't be set to "../" with autoconf 2.13. */ +ac_given_INSTALL=$INSTALL + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + +# By default we simply use the C compiler to build assembly code. + +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + dummy_var=1 +fi + +. ${newlib_basedir}/configure.host + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + +NO_INCLUDE_LIST=${noinclude} + + +LDFLAGS=${ldflags} + + + if test x${newlib_elix_level} = x0; then + ELIX_LEVEL_0_TRUE= + ELIX_LEVEL_0_FALSE='#' +else + ELIX_LEVEL_0_TRUE='#' + ELIX_LEVEL_0_FALSE= +fi + + if test x${newlib_elix_level} = x1; then + ELIX_LEVEL_1_TRUE= + ELIX_LEVEL_1_FALSE='#' +else + ELIX_LEVEL_1_TRUE='#' + ELIX_LEVEL_1_FALSE= +fi + + if test x${newlib_elix_level} = x2; then + ELIX_LEVEL_2_TRUE= + ELIX_LEVEL_2_FALSE='#' +else + ELIX_LEVEL_2_TRUE='#' + ELIX_LEVEL_2_FALSE= +fi + + if test x${newlib_elix_level} = x3; then + ELIX_LEVEL_3_TRUE= + ELIX_LEVEL_3_FALSE='#' +else + ELIX_LEVEL_3_TRUE='#' + ELIX_LEVEL_3_FALSE= +fi + + if test x${newlib_elix_level} = x4; then + ELIX_LEVEL_4_TRUE= + ELIX_LEVEL_4_FALSE='#' +else + ELIX_LEVEL_4_TRUE='#' + ELIX_LEVEL_4_FALSE= +fi + + + if test x${use_libtool} = xyes; then + USE_LIBTOOL_TRUE= + USE_LIBTOOL_FALSE='#' +else + USE_LIBTOOL_TRUE='#' + USE_LIBTOOL_FALSE= +fi + + +# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we +# use oext, which is set in configure.host based on the target platform. +OBJEXT=${oext} + + + + + + + + + + + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS_FALSE}"; then + as_fn_error $? "conditional \"MAY_SUPPLY_SYSCALLS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ELIX_LEVEL_0_TRUE}" && test -z "${ELIX_LEVEL_0_FALSE}"; then + as_fn_error $? "conditional \"ELIX_LEVEL_0\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ELIX_LEVEL_1_TRUE}" && test -z "${ELIX_LEVEL_1_FALSE}"; then + as_fn_error $? "conditional \"ELIX_LEVEL_1\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ELIX_LEVEL_2_TRUE}" && test -z "${ELIX_LEVEL_2_FALSE}"; then + as_fn_error $? "conditional \"ELIX_LEVEL_2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ELIX_LEVEL_3_TRUE}" && test -z "${ELIX_LEVEL_3_FALSE}"; then + as_fn_error $? "conditional \"ELIX_LEVEL_3\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ELIX_LEVEL_4_TRUE}" && test -z "${ELIX_LEVEL_4_FALSE}"; then + as_fn_error $? "conditional \"ELIX_LEVEL_4\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_LIBTOOL_TRUE}" && test -z "${USE_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"USE_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by newlib $as_me 1.20.0, which was +generated by GNU Autoconf 2.68. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +newlib config.status 1.20.0 +configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/newlib/libc/machine/rl78/configure.in b/newlib/libc/machine/rl78/configure.in new file mode 100644 index 000000000..338a728f8 --- /dev/null +++ b/newlib/libc/machine/rl78/configure.in @@ -0,0 +1,14 @@ +dnl This is the newlib/libc/machine/rl78 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT([newlib],[NEWLIB_VERSION]) +AC_CONFIG_SRCDIR([setjmp.S]) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/newlib/libc/machine/rl78/setjmp.S b/newlib/libc/machine/rl78/setjmp.S new file mode 100644 index 000000000..951b4ee7b --- /dev/null +++ b/newlib/libc/machine/rl78/setjmp.S @@ -0,0 +1,150 @@ +/* + +Copyright (c) 2011 Red Hat Incorporated. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + The name of Red Hat Incorporated may not be used to endorse + or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +; clobberable +r8 = 0xffef0 +r9 = 0xffef1 +r10 = 0xffef2 +r11 = 0xffef3 +r12 = 0xffef4 +r13 = 0xffef5 +r14 = 0xffef6 +r15 = 0xffef7 +; preserved +r16 = 0xffee8 +r17 = 0xffee9 +r18 = 0xffeea +r19 = 0xffeeb +r20 = 0xffeec +r21 = 0xffeed +r22 = 0xffeee +r23 = 0xffeef + +/* The jump buffer has the following structure: + R0 .. R23 3*8 bytes + SP 2 bytes + ES 1 byte + CS 1 byte + PC 4 bytes +*/ + +#define SAVEB(ofs,reg) mov a,reg | mov [hl+ofs],a +#define SAVE(ofs,reg) movw ax,reg | movw [hl+ofs],ax + + .global _setjmp + .type _setjmp, @function +_setjmp: + ;; R8 = setjmp (jmp_buf *[sp+4].w) + ;; must return zero !! + push ax + push hl + push ax + movw ax, [sp+10] + movw hl, ax + pop ax + movw [hl], ax + SAVE (2, bc) + SAVE (4, de) + pop ax + movw [hl+6], ax + SAVE (8, r8) + SAVE (10, r10) + SAVE (12, r12) + SAVE (14, r14) + SAVE (16, r16) + SAVE (18, r18) + SAVE (20, r20) + SAVE (22, r22) + + ;; The sp we have now includes one more pushed reg, plus $PC + movw ax, sp + addw ax, #6 + movw [hl+24], ax + + SAVEB (26, es) + SAVEB (27, cs) + SAVE (28, [sp+2]) + SAVE (30, [sp+4]) + + clrw ax + movw r8, ax + pop ax + ret + + .size _setjmp, . - _setjmp + +#define LOADB(ofs,reg) mov a,[hl+ofs] | mov reg,a +#define LOAD(ofs,reg) movw ax,[hl+ofs] | movw reg,ax +#define PUSH(ofs) movw ax,[hl+ofs] | push ax + + .global _longjmp + .type _longjmp, @function +_longjmp: + ;; noreturn longjmp (jmp_buf *[sp+4].w, int [sp+6].w) + movw ax, [sp+6] + cmpw ax,#0 + sknz + onew ax + movw r8, ax + + movw ax, [sp+4] + movw hl, ax + movw ax, [hl+24] + movw sp, ax ; this is the *new* stack + + PUSH (30) ; high half of PC + PUSH (28) ; low half of PC + PUSH (6) ; HL + PUSH (0) ; AX + + LOAD (2, bc) + LOAD (4, de) + + LOAD (10, r10) + LOAD (12, r12) + LOAD (14, r14) + LOAD (16, r16) + LOAD (18, r18) + LOAD (20, r20) + LOAD (22, r22) + + LOADB (26, es) + LOADB (27, cs) + + pop ax + pop hl + + + ret ; pops PC (4 bytes) + + .size _longjmp, . - _longjmp + diff --git a/newlib/libc/posix/collate.c b/newlib/libc/posix/collate.c index 8bb04ef0d..6ee455001 100644 --- a/newlib/libc/posix/collate.c +++ b/newlib/libc/posix/collate.c @@ -117,26 +117,24 @@ __collate_substitute(s) const u_char *s; { int dest_len, len, nlen; - int delta = strlen((const char *) s); + int delta = strlen(s); u_char *dest_str = NULL; if(s == NULL || *s == '\0') - return __collate_strdup((u_char *) ""); + return __collate_strdup(""); delta += delta / 8; - dest_str = (u_char *) malloc(dest_len = delta); + dest_str = malloc(dest_len = delta); if(dest_str == NULL) __collate_err(EX_OSERR, __FUNCTION__); len = 0; while(*s) { - nlen = len + strlen((const char *) - __collate_substitute_table[*s]); + nlen = len + strlen(__collate_substitute_table[*s]); if (dest_len <= nlen) { dest_str = reallocf(dest_str, dest_len = nlen + delta); if(dest_str == NULL) __collate_err(EX_OSERR, __FUNCTION__); } - strcpy((char *) dest_str + len, - (const char *) __collate_substitute_table[*s++]); + strcpy(dest_str + len, __collate_substitute_table[*s++]); len = nlen; } return dest_str; @@ -152,9 +150,8 @@ __collate_lookup(t, len, prim, sec) *len = 1; *prim = *sec = 0; for(p2 = __collate_chain_pri_table; p2->str[0]; p2++) { - if(strncmp((const char *) t, (const char *) p2->str, - strlen((const char *) p2->str)) == 0) { - *len = strlen((const char *) p2->str); + if(strncmp(t, p2->str, strlen(p2->str)) == 0) { + *len = strlen(p2->str); *prim = p2->prim; *sec = p2->sec; return; @@ -168,7 +165,7 @@ u_char * __collate_strdup(s) u_char *s; { - u_char *t = (u_char *) strdup((const char *) s); + u_char *t = strdup(s); if (t == NULL) __collate_err(EX_OSERR, __FUNCTION__); diff --git a/newlib/libc/posix/engine.c b/newlib/libc/posix/engine.c index 73ce45c11..8494b90a9 100644 --- a/newlib/libc/posix/engine.c +++ b/newlib/libc/posix/engine.c @@ -145,7 +145,7 @@ int eflags; int i; struct match mv; struct match *m = &mv; - char *dp = NULL; + char *dp; const sopno gf = g->firststate+1; /* +1 for OEND */ const sopno gl = g->laststate; char *start; @@ -181,8 +181,8 @@ int eflags; pp = mustlast; for (dp = start+g->mlen-1; dp < stop;) { /* Fast skip non-matches */ - while (dp < stop && charjump[(unsigned char) *dp]) - dp += charjump[(unsigned char) *dp]; + while (dp < stop && charjump[*dp]) + dp += charjump[*dp]; if (dp >= stop) break; @@ -198,7 +198,7 @@ int eflags; /* Jump to next possible match */ mj = matchjump[pp - mustfirst]; - cj = charjump[(unsigned char) *dp]; + cj = charjump[*dp]; dp += (cj < mj ? mj : cj); pp = mustlast; } @@ -364,12 +364,6 @@ sopno stopst; char *ssp; /* start of string matched by subsubRE */ char *sep; /* end of string matched by subsubRE */ char *oldssp; /* previous ssp */ -#if defined (__GNUC__) && \ - ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) -/* dp is only used for assertion testing which, for some reason, is not - recognized as usage. */ -#pragma GCC diagnostic ignored "-Wunused-but-set-variable" -#endif char *dp; AT("diss", start, stop, startst, stopst); diff --git a/newlib/libc/posix/glob.c b/newlib/libc/posix/glob.c index 977a5a4f8..4dafe71aa 100644 --- a/newlib/libc/posix/glob.c +++ b/newlib/libc/posix/glob.c @@ -30,10 +30,6 @@ * SUCH DAMAGE. */ -#ifdef __CYGWIN__ -#define _NO_GLOB /* Cygwin provides its own glob. */ -#endif - #ifndef _NO_GLOB #if defined(LIBC_SCCS) && !defined(lint) diff --git a/newlib/libc/posix/popen.c b/newlib/libc/posix/popen.c index faf72b6e3..38978c7aa 100644 --- a/newlib/libc/posix/popen.c +++ b/newlib/libc/posix/popen.c @@ -113,7 +113,7 @@ _DEFUN(popen, (program, type), const char *program _AND const char *type) { - struct pid *cur; + struct pid *cur, *last; FILE *iop; int pdes[2], pid; @@ -159,7 +159,8 @@ _DEFUN(popen, (program, type), (void)close(pdes[1]); } /* Close all fd's created by prior popen. */ - for (cur = pidlist; cur; cur = cur->next) + for (last = NULL, cur = pidlist; cur; + last = cur, cur = cur->next) (void)close (fileno (cur->fp)); execl(_PATH_BSHELL, "sh", "-c", program, NULL); _exit(127); diff --git a/newlib/libc/posix/readdir.c b/newlib/libc/posix/readdir.c index d3187e603..da07d5c00 100644 --- a/newlib/libc/posix/readdir.c +++ b/newlib/libc/posix/readdir.c @@ -75,6 +75,12 @@ _DEFUN(readdir, (dirp), continue; } dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); + if ((int)dp & 03) { /* bogus pointer check */ +#ifdef HAVE_DD_LOCK + __lock_release_recursive(dirp->dd_lock); +#endif + return NULL; + } if (dp->d_reclen <= 0 || dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc) { #ifdef HAVE_DD_LOCK diff --git a/newlib/libc/posix/regcomp.c b/newlib/libc/posix/regcomp.c index bd90d2cdf..7f9e188a7 100644 --- a/newlib/libc/posix/regcomp.c +++ b/newlib/libc/posix/regcomp.c @@ -103,8 +103,8 @@ static void freeset(struct parse *p, cset *cs); static int freezeset(struct parse *p, cset *cs); static int firstch(struct parse *p, cset *cs); static int nch(struct parse *p, cset *cs); -#if used static void mcadd(struct parse *p, cset *cs, char *cp); +#if used static void mcsub(cset *cs, char *cp); static int mcin(cset *cs, char *cp); static char *mcfind(cset *cs, char *cp); @@ -308,8 +308,8 @@ struct parse *p; int stop; /* character this ERE should end at */ { char c; - sopno prevback = 0; - sopno prevfwd = 0; + sopno prevback; + sopno prevfwd; sopno conc; int first = 1; /* is this the first alternative? */ @@ -1333,7 +1333,6 @@ cset *cs; return(n); } -#if used /* - mcadd - add a collating element to a cset == static void mcadd(struct parse *p, cset *cs, \ @@ -1361,6 +1360,7 @@ char *cp; cs->multis[cs->smultis - 1] = '\0'; } +#if used /* - mcsub - subtract a collating element from a cset == static void mcsub(cset *cs, char *cp); @@ -1688,8 +1688,8 @@ struct parse *p; struct re_guts *g; { sop *scan; - sop *start = NULL; - sop *newstart = NULL; + sop *start; + sop *newstart; sopno newlen; sop s; char *cp; @@ -1961,7 +1961,7 @@ struct re_guts *g; * is the first one that would be matched). */ for (mindex = 0; mindex < g->mlen; mindex++) - g->charjump[(unsigned char) g->must[mindex]] = g->mlen - mindex - 1; + g->charjump[g->must[mindex]] = g->mlen - mindex - 1; } /* diff --git a/newlib/libc/posix/wordexp.c b/newlib/libc/posix/wordexp.c index bfdb63fd0..b6c4a6d1f 100644 --- a/newlib/libc/posix/wordexp.c +++ b/newlib/libc/posix/wordexp.c @@ -37,6 +37,7 @@ wordexp(const char *words, wordexp_t *pwordexp, int flags) char *iter; pid_t pid; int num_words = 0; + int num_bytes = 0; int fd[2]; int fd_err[2]; int err = 0; @@ -128,6 +129,8 @@ wordexp(const char *words, wordexp_t *pwordexp, int flags) if((iter = strchr(tmp, '\n'))) *iter = '\0'; + num_bytes = atoi(tmp) + pwordexp->we_wordc; + /* Get each expansion from the shell output, and store each in pwordexp's we_wordv vector. */ for(i = 0; i < num_words; i++) diff --git a/newlib/libc/reent/mkdirr.c b/newlib/libc/reent/mkdirr.c index fe36de11a..29d808de8 100644 --- a/newlib/libc/reent/mkdirr.c +++ b/newlib/libc/reent/mkdirr.c @@ -44,8 +44,6 @@ DESCRIPTION <<errno>>. */ -#include <sys/stat.h> - int _DEFUN (_mkdir_r, (ptr, path, mode), struct _reent *ptr _AND diff --git a/newlib/libc/reent/renamer.c b/newlib/libc/reent/renamer.c index d3951a28d..4d2d25635 100644 --- a/newlib/libc/reent/renamer.c +++ b/newlib/libc/reent/renamer.c @@ -1,7 +1,6 @@ /* Reentrant version of rename system call. */ #include <reent.h> -#include <stdio.h> #include <unistd.h> #include <sys/stat.h> #include <_syslist.h> diff --git a/newlib/libc/search/hash.c b/newlib/libc/search/hash.c index 997acb3f6..0301fc03f 100644 --- a/newlib/libc/search/hash.c +++ b/newlib/libc/search/hash.c @@ -141,9 +141,9 @@ _DEFUN(__hash_open, (file, flags, mode, info, dflags), new_table = 0; if (!file || (flags & O_TRUNC) || #ifdef __USE_INTERNAL_STAT64 - (_stat64(file, &statbuf) && (errno == ENOENT))) { + (stat64(file, &statbuf) && (errno == ENOENT))) { #else - (_stat(file, &statbuf) && (errno == ENOENT))) { + (stat(file, &statbuf) && (errno == ENOENT))) { #endif if (errno == ENOENT) errno = 0; /* Just in case someone looks at errno */ @@ -157,9 +157,9 @@ _DEFUN(__hash_open, (file, flags, mode, info, dflags), a new .db file, then reinitialize the database */ if ((flags & O_CREAT) && #ifdef __USE_INTERNAL_STAT64 - _fstat64(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0) + fstat64(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0) #else - _fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0) + fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0) #endif new_table = 1; @@ -316,11 +316,7 @@ init_hash(hashp, file, info) const char *file; const HASHINFO *info; { -#ifdef __USE_INTERNAL_STAT64 - struct stat64 statbuf; -#else struct stat statbuf; -#endif int nelem; nelem = 1; @@ -339,9 +335,9 @@ init_hash(hashp, file, info) /* Fix bucket size to be optimal for file system */ if (file != NULL) { #ifdef __USE_INTERNAL_STAT64 - if (_stat64(file, &statbuf)) + if (stat64(file, &statbuf)) #else - if (_stat(file, &statbuf)) + if (stat(file, &statbuf)) #endif return (NULL); hashp->BSIZE = statbuf.st_blksize; diff --git a/newlib/libc/search/hash_bigkey.c b/newlib/libc/search/hash_bigkey.c index 8ff52b383..449b6bed6 100644 --- a/newlib/libc/search/hash_bigkey.c +++ b/newlib/libc/search/hash_bigkey.c @@ -123,7 +123,7 @@ __big_insert(hashp, bufp, key, val) if (!bufp) return (-1); n = p[0]; - if (!key_size) { + if (!key_size) if (FREESPACE(p)) { move_bytes = MIN(FREESPACE(p), val_size); off = OFFSET(p) - move_bytes; @@ -136,7 +136,6 @@ __big_insert(hashp, bufp, key, val) OFFSET(p) = off; } else p[n - 2] = FULL_KEY; - } p = (__uint16_t *)bufp->page; cp = bufp->page; bufp->flags |= BUF_MOD; diff --git a/newlib/libc/search/hash_page.c b/newlib/libc/search/hash_page.c index 7ca304d38..68ab9db17 100644 --- a/newlib/libc/search/hash_page.c +++ b/newlib/libc/search/hash_page.c @@ -667,7 +667,7 @@ static __uint16_t overflow_page(hashp) HTAB *hashp; { - __uint32_t *freep = NULL; + __uint32_t *freep; int max_free, offset, splitnum; __uint16_t addr; int bit, first_page, free_bit, free_page, i, in_use_bits, j; diff --git a/newlib/libc/stdio/asiprintf.c b/newlib/libc/stdio/asiprintf.c index 0c363d5ea..97474fd1a 100644 --- a/newlib/libc/stdio/asiprintf.c +++ b/newlib/libc/stdio/asiprintf.c @@ -45,7 +45,7 @@ _DEFUN(_asiprintf_r, (ptr, strp, fmt), if (ret >= 0) { *f._p = 0; - *strp = (char *) f._bf._base; + *strp = f._bf._base; } return (ret); } @@ -72,7 +72,7 @@ _DEFUN(asiprintf, (strp, fmt), if (ret >= 0) { *f._p = 0; - *strp = (char *) f._bf._base; + *strp = f._bf._base; } return (ret); } diff --git a/newlib/libc/stdio/asprintf.c b/newlib/libc/stdio/asprintf.c index 7b26d9f29..59a08c808 100644 --- a/newlib/libc/stdio/asprintf.c +++ b/newlib/libc/stdio/asprintf.c @@ -45,7 +45,7 @@ _DEFUN(_asprintf_r, (ptr, strp, fmt), if (ret >= 0) { *f._p = 0; - *strp = (char *) f._bf._base; + *strp = f._bf._base; } return (ret); } @@ -72,7 +72,7 @@ _DEFUN(asprintf, (strp, fmt), if (ret >= 0) { *f._p = 0; - *strp = (char *) f._bf._base; + *strp = f._bf._base; } return (ret); } diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c index b33eb1e22..6483655bf 100644 --- a/newlib/libc/stdio/freopen.c +++ b/newlib/libc/stdio/freopen.c @@ -208,7 +208,7 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), if (HASLB (fp)) FREELB (ptr, fp); fp->_lb._size = 0; - fp->_flags &= ~__SORD; + fp->_flags & ~__SORD; fp->_flags2 = 0; memset (&fp->_mbstate, 0, sizeof (_mbstate_t)); diff --git a/newlib/libc/stdio/mktemp.c b/newlib/libc/stdio/mktemp.c index ecbc7afea..1c5d76db4 100644 --- a/newlib/libc/stdio/mktemp.c +++ b/newlib/libc/stdio/mktemp.c @@ -247,7 +247,7 @@ _DEFUN(_gettemp, (ptr, path, doopen, domkdir, suffixlen, flags), else { /* Safe, since it only encounters 7-bit characters. */ - if (isdigit ((unsigned char) *trv)) + if (isdigit (*trv)) *trv = 'a'; else ++ * trv; diff --git a/newlib/libc/stdio/vasiprintf.c b/newlib/libc/stdio/vasiprintf.c index f96de0d79..15310cce9 100644 --- a/newlib/libc/stdio/vasiprintf.c +++ b/newlib/libc/stdio/vasiprintf.c @@ -59,7 +59,7 @@ _DEFUN(_vasiprintf_r, (ptr, strp, fmt, ap), if (ret >= 0) { *f._p = 0; - *strp = (char *) f._bf._base; + *strp = f._bf._base; } return ret; } diff --git a/newlib/libc/stdio/vasprintf.c b/newlib/libc/stdio/vasprintf.c index fbb54cbe8..b89f4dbd7 100644 --- a/newlib/libc/stdio/vasprintf.c +++ b/newlib/libc/stdio/vasprintf.c @@ -59,7 +59,7 @@ _DEFUN(_vasprintf_r, (ptr, strp, fmt, ap), if (ret >= 0) { *f._p = 0; - *strp = (char *) f._bf._base; + *strp = f._bf._base; } return ret; } diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 4b165e021..559899107 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -567,9 +567,9 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), char sign; /* sign prefix (' ', '+', '-', or \0) */ #ifdef _WANT_IO_C99_FORMATS /* locale specific numeric grouping */ - char *thousands_sep = NULL; - size_t thsnd_len = 0; - const char *grouping = NULL; + char *thousands_sep; + size_t thsnd_len; + const char *grouping; #endif #ifdef FLOATING_POINT char *decimal_point = _localeconv_r (data)->decimal_point; @@ -585,7 +585,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), #if defined (FLOATING_POINT) || defined (_WANT_IO_C99_FORMATS) int ndig = 0; /* actual number of digits returned by cvt */ #endif -#if defined (FLOATING_POINT) && defined (_WANT_IO_C99_FORMATS) +#ifdef _WANT_IO_C99_FORMATS int nseps; /* number of group separators with ' */ int nrepeats; /* number of repeats of the last group */ #endif @@ -793,10 +793,10 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), sign = '\0'; #ifdef FLOATING_POINT lead = 0; +#endif #ifdef _WANT_IO_C99_FORMATS nseps = nrepeats = 0; #endif -#endif #ifndef _NO_POS_ARGS N = arg_index; is_pos_arg = 0; diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c index e967719b7..e05082db7 100644 --- a/newlib/libc/stdio/vfscanf.c +++ b/newlib/libc/stdio/vfscanf.c @@ -243,7 +243,10 @@ static void * get_arg (int, va_list *, int *, void **); #define CT_INT 3 /* integer, i.e., strtol or strtoul */ #define CT_FLOAT 4 /* floating, i.e., strtod */ +#if 0 #define u_char unsigned char +#endif +#define u_char char #define u_long unsigned long #ifndef _NO_LONGLONG @@ -510,8 +513,8 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), #ifndef _MB_CAPABLE wc = *fmt; #else - nbytes = __mbtowc (rptr, &wc, (char *) fmt, MB_CUR_MAX, - __locale_charset (), &state); + nbytes = __mbtowc (rptr, &wc, fmt, MB_CUR_MAX, __locale_charset (), + &state); if (nbytes < 0) { wc = 0xFFFD; /* Unicode replacement character */ nbytes = 1; diff --git a/newlib/libc/stdio/vfwprintf.c b/newlib/libc/stdio/vfwprintf.c index 968c218b5..029f1d08c 100644 --- a/newlib/libc/stdio/vfwprintf.c +++ b/newlib/libc/stdio/vfwprintf.c @@ -396,11 +396,10 @@ _DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap), wchar_t sign; /* sign prefix (' ', '+', '-', or \0) */ #ifdef _WANT_IO_C99_FORMATS /* locale specific numeric grouping */ - wchar_t thousands_sep = L'\0'; - const char *grouping = NULL; + wchar_t thousands_sep; + const char *grouping; #endif -#if defined (_MB_CAPABLE) && !defined (__HAVE_LOCALE_INFO_EXTENDED__) \ - && (defined (FLOATING_POINT) || defined (_WANT_IO_C99_FORMATS)) +#ifdef _MB_CAPABLE mbstate_t state; /* mbtowc calls from library must not change state */ #endif #ifdef FLOATING_POINT @@ -416,7 +415,7 @@ _DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap), #if defined (FLOATING_POINT) || defined (_WANT_IO_C99_FORMATS) int ndig = 0; /* actual number of digits returned by cvt */ #endif -#if defined (FLOATING_POINT) && defined (_WANT_IO_C99_FORMATS) +#ifdef _WANT_IO_C99_FORMATS int nseps; /* number of group separators with ' */ int nrepeats; /* number of repeats of the last group */ #endif @@ -620,10 +619,10 @@ _DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap), sign = L'\0'; #ifdef FLOATING_POINT lead = 0; +#endif #ifdef _WANT_IO_C99_FORMATS nseps = nrepeats = 0; #endif -#endif #ifndef _NO_POS_ARGS N = arg_index; is_pos_arg = 0; diff --git a/newlib/libc/stdlib/mbtowc_r.c b/newlib/libc/stdlib/mbtowc_r.c index d84fef5a2..7c6be69ea 100644 --- a/newlib/libc/stdlib/mbtowc_r.c +++ b/newlib/libc/stdlib/mbtowc_r.c @@ -78,7 +78,6 @@ typedef enum { COPY_A, COPY_J1, COPY_J2, MAKE_A, NOOP, EMPTY, ERROR } JIS_ACTION * is 2 (switch to JIS) + 2 (JIS characters) + 2 (switch back to ASCII) = 6. *************************************************************************************/ -#ifndef __CYGWIN__ static JIS_STATE JIS_state_table[JIS_S_NUM][JIS_C_NUM] = { /* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTHER */ /* ASCII */ { A_ESC, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII }, @@ -100,7 +99,6 @@ static JIS_ACTION JIS_action_table[JIS_S_NUM][JIS_C_NUM] = { /* J_ESC */ { ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR }, /* J_ESC_BR */{ ERROR, ERROR, ERROR, ERROR, MAKE_A, MAKE_A, ERROR, ERROR, ERROR }, }; -#endif /* !__CYGWIN__ */ /* we override the mbstate_t __count field for more complex encodings and use it store a state value */ #define __state __count diff --git a/newlib/libc/stdlib/mprec.h b/newlib/libc/stdlib/mprec.h index 5a71576be..dea89bf11 100644 --- a/newlib/libc/stdlib/mprec.h +++ b/newlib/libc/stdlib/mprec.h @@ -98,7 +98,7 @@ typedef union { double d; __ULong i[2]; } U; #define SI 0 #endif -#define Storeinc(a,b,c) (*(a)++ = ((b) << 16) | ((c) & 0xffff)) +#define Storeinc(a,b,c) (*(a)++ = (b) << 16 | (c) & 0xffff) /* #define P DBL_MANT_DIG */ /* Ten_pmax = floor(P*log(2)/log(5)) */ diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c index 13e1e4c36..98a0b74c0 100644 --- a/newlib/libc/stdlib/wctomb_r.c +++ b/newlib/libc/stdlib/wctomb_r.c @@ -81,7 +81,7 @@ _DEFUN (__utf8_wctomb, (r, s, wchar, charset, state), to return extra 3 bytes. */ wchar_t tmp; tmp = (state->__value.__wchb[0] << 16 | state->__value.__wchb[1] << 8) - - (0x10000 >> 10 | 0xd80d); + - 0x10000 >> 10 | 0xd80d; *s++ = 0xe0 | ((tmp & 0xf000) >> 12); *s++ = 0x80 | ((tmp & 0xfc0) >> 6); *s++ = 0x80 | (tmp & 0x3f); diff --git a/newlib/libc/string/strcasestr.c b/newlib/libc/string/strcasestr.c index 91783164c..0122d7ab8 100644 --- a/newlib/libc/string/strcasestr.c +++ b/newlib/libc/string/strcasestr.c @@ -84,11 +84,6 @@ QUICKREF (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \ && ((h_l) = (j) + (n_l))) # define CANON_ELEMENT(c) tolower (c) -#if defined (__GNUC__) && \ - ((__GNUC__ == 4 && __GNUC_MINOR__ >= 2) || __GNUC__ > 4) -/* strncasecmp uses signed char, CMP_FUNC is expected to use unsigned char. */ -#pragma GCC diagnostic ignored "-Wpointer-sign" -#endif # define CMP_FUNC strncasecmp # include "str-two-way.h" #endif diff --git a/newlib/libc/sys/sysnecv850/crt0.S b/newlib/libc/sys/sysnecv850/crt0.S index 43b5e21cd..b319d30b7 100644 --- a/newlib/libc/sys/sysnecv850/crt0.S +++ b/newlib/libc/sys/sysnecv850/crt0.S @@ -5,7 +5,7 @@ _start: -#if defined(__v850e__) || defined(__v850e2__) || defined(__v850e2v3__) +#if defined __v850e__ movea 255, r0, r20 mov 65535, r21 diff --git a/newlib/libc/time/strptime.c b/newlib/libc/time/strptime.c index 601f93e8a..0fc5f4e13 100644 --- a/newlib/libc/time/strptime.c +++ b/newlib/libc/time/strptime.c @@ -165,8 +165,8 @@ _DEFUN (strptime, (buf, format, timeptr), char *s; int ret; - if (isspace ((unsigned char) c)) { - while (isspace ((unsigned char) *buf)) + if (isspace (c)) { + while (isspace (*buf)) ++buf; } else if (c == '%' && format[1] != '\0') { c = *++format; diff --git a/newlib/libm/common/sf_round.c b/newlib/libm/common/sf_round.c index c8f1d7733..1bf60890c 100644 --- a/newlib/libm/common/sf_round.c +++ b/newlib/libm/common/sf_round.c @@ -18,12 +18,16 @@ float x; #endif { + int signbit; __uint32_t w; /* Most significant word, least significant word. */ int exponent_less_127; GET_FLOAT_WORD(w, x); + /* Extract sign bit. */ + signbit = w & 0x80000000; + /* Extract exponent field. */ exponent_less_127 = (int)((w & 0x7f800000) >> 23) - 127; diff --git a/newlib/libm/math/e_atan2.c b/newlib/libm/math/e_atan2.c index 8e9650f29..268be64a9 100644 --- a/newlib/libm/math/e_atan2.c +++ b/newlib/libm/math/e_atan2.c @@ -73,7 +73,7 @@ pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */ if(((ix|((lx|-lx)>>31))>0x7ff00000)|| ((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */ return x+y; - if(((hx-0x3ff00000)|lx)==0) return atan(y); /* x=1.0 */ + if((hx-0x3ff00000|lx)==0) return atan(y); /* x=1.0 */ m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ /* when y = 0 */ diff --git a/newlib/libm/math/e_exp.c b/newlib/libm/math/e_exp.c index e7455eef6..ce093c610 100644 --- a/newlib/libm/math/e_exp.c +++ b/newlib/libm/math/e_exp.c @@ -109,7 +109,7 @@ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ #endif { double y,hi,lo,c,t; - __int32_t k = 0,xsb; + __int32_t k,xsb; __uint32_t hx; GET_HIGH_WORD(hx,x); @@ -144,6 +144,7 @@ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ else if(hx < 0x3e300000) { /* when |x|<2**-28 */ if(huge+x>one) return one+x;/* trigger inexact */ } + else k = 0; /* x is now in primary range */ t = x*x; diff --git a/newlib/libm/math/e_pow.c b/newlib/libm/math/e_pow.c index cad6737a1..aac0b4211 100644 --- a/newlib/libm/math/e_pow.c +++ b/newlib/libm/math/e_pow.c @@ -120,10 +120,9 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ /* x|y==NaN return NaN unless x==1 then return 1 */ if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) || - iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0))) { + iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0))) if(((ix-0x3ff00000)|lx)==0) return one; else return nan(""); - } /* determine if y is an odd int when x < 0 * yisint = 0 ... y is not an integer diff --git a/newlib/libm/math/e_rem_pio2.c b/newlib/libm/math/e_rem_pio2.c index ddfecba2d..3e5d0f7a2 100644 --- a/newlib/libm/math/e_rem_pio2.c +++ b/newlib/libm/math/e_rem_pio2.c @@ -89,7 +89,7 @@ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ double x,y[]; #endif { - double z = 0.0,w,t,r,fn; + double z,w,t,r,fn; double tx[3]; __int32_t i,j,n,ix,hx; int e0,nx; diff --git a/newlib/libm/math/ef_exp.c b/newlib/libm/math/ef_exp.c index 6824f991a..19c570cfd 100644 --- a/newlib/libm/math/ef_exp.c +++ b/newlib/libm/math/ef_exp.c @@ -47,7 +47,7 @@ P5 = 4.1381369442e-08; /* 0x3331bb4c */ #endif { float y,hi,lo,c,t; - __int32_t k = 0,xsb,sx; + __int32_t k,xsb,sx; __uint32_t hx; GET_FLOAT_WORD(sx,x); @@ -79,6 +79,7 @@ P5 = 4.1381369442e-08; /* 0x3331bb4c */ else if(hx < 0x31800000) { /* when |x|<2**-28 */ if(huge+x>one) return one+x;/* trigger inexact */ } + else k = 0; /* x is now in primary range */ t = x*x; diff --git a/newlib/libm/math/ef_pow.c b/newlib/libm/math/ef_pow.c index b3041dbdc..6804ce45a 100644 --- a/newlib/libm/math/ef_pow.c +++ b/newlib/libm/math/ef_pow.c @@ -77,10 +77,9 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ /* x|y==NaN return NaN unless x==1 then return 1 */ if(FLT_UWORD_IS_NAN(ix) || - FLT_UWORD_IS_NAN(iy)) { + FLT_UWORD_IS_NAN(iy)) if(ix==0x3f800000) return one; else return nanf(""); - } /* determine if y is an odd int when x < 0 * yisint = 0 ... y is not an integer diff --git a/newlib/libm/math/er_lgamma.c b/newlib/libm/math/er_lgamma.c index 386a8a73b..7c9a153ed 100644 --- a/newlib/libm/math/er_lgamma.c +++ b/newlib/libm/math/er_lgamma.c @@ -216,7 +216,7 @@ static double zero= 0.00000000000000000000e+00; double x; int *signgamp; #endif { - double t,y,z,nadj = 0.0,p,p1,p2,p3,q,r,w; + double t,y,z,nadj,p,p1,p2,p3,q,r,w; __int32_t i,hx,lx,ix; EXTRACT_WORDS(hx,lx,x); diff --git a/newlib/libm/math/erf_lgamma.c b/newlib/libm/math/erf_lgamma.c index 3c6ba02af..90cc5425d 100644 --- a/newlib/libm/math/erf_lgamma.c +++ b/newlib/libm/math/erf_lgamma.c @@ -151,7 +151,7 @@ static float zero= 0.0000000000e+00; float x; int *signgamp; #endif { - float t,y,z,nadj = 0.0,p,p1,p2,p3,q,r,w; + float t,y,z,nadj,p,p1,p2,p3,q,r,w; __int32_t i,hx,ix; GET_FLOAT_WORD(hx,x); diff --git a/newlib/testsuite/newlib.stdio/stdio.exp b/newlib/testsuite/newlib.stdio/stdio.exp new file mode 100644 index 000000000..164cbf353 --- /dev/null +++ b/newlib/testsuite/newlib.stdio/stdio.exp @@ -0,0 +1,12 @@ +# Copyright (C) 2011 by ARM Ltd. All rights reserved. +# +# Permission to use, copy, modify, and distribute this software +# is freely granted, provided that this notice is preserved. +# + +load_lib passfail.exp + +set exclude_list { +} + +newlib_pass_fail_all -x $exclude_list diff --git a/newlib/testsuite/newlib.stdio/swprintf.c b/newlib/testsuite/newlib.stdio/swprintf.c new file mode 100644 index 000000000..b925da487 --- /dev/null +++ b/newlib/testsuite/newlib.stdio/swprintf.c @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2011 by ARM Ltd. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <stdio.h> +#include <newlib.h> +#include <stdlib.h> +#include <wchar.h> +#include "check.h" + +int main() +{ +#if defined(INTEGER_ONLY) || defined(NO_FLOATING_POINT) + +#else + char cbuf[512]; + wchar_t wcbuf[512], wcbuf2[512]; + double val = 1E+308; + snprintf(cbuf, 512, "%.*f", 3, val); + swprintf(wcbuf, 512, L"%.*f", 3, val); + mbstowcs(wcbuf2, cbuf, 512); + + CHECK (wcscmp(wcbuf, wcbuf2) == 0); +#endif + + exit (0); +} diff --git a/winsup/ChangeLog b/winsup/ChangeLog index 440d75414..9bebbe46c 100644 --- a/winsup/ChangeLog +++ b/winsup/ChangeLog @@ -1,8 +1,3 @@ -2012-07-30 Christopher Faylor <me.cygwin2012@cgf.cx> - - * Makefile.common (CFLAGS_COMMON): Add temporary define to work around - w32api problem. - 2012-07-06 Corinna Vinschen <corinna@vinschen.de> * Makefile.common (ALL_CFLAGS): Change := to = to allow overriding in diff --git a/winsup/Makefile.common b/winsup/Makefile.common index 1917e3d21..569b2a3fc 100644 --- a/winsup/Makefile.common +++ b/winsup/Makefile.common @@ -1,6 +1,6 @@ # Makefile.common - common definitions for the winsup directory # -# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2012 Red Hat, Inc. +# Copyright 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. # # This file is part of Cygwin. # @@ -10,7 +10,7 @@ # This makefile requires GNU make. -CFLAGS_COMMON:=-Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0 -D_SDKDDKVER_H +CFLAGS_COMMON:=-Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0# -finline-functions MALLOC_DEBUG:=#-DMALLOC_DEBUG -I/cygnus/src/uberbaum/winsup/cygwin/dlmalloc MALLOC_OBJ:=#/cygnus/src/uberbaum/winsup/cygwin/dlmalloc/malloc.o diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e6b69ccd2..70232fa60 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,284 +1,3 @@ -2012-08-09 Christopher Faylor <me.cygwin2012@cgf.cx> - - * DevNotes: Add entry cgf-000014. - * cygheap.cc (tls_sentry): Move here, rename from 'sentry' in cygtls.cc - (tls_sentry::lock): Ditto. - (nthreads): Move from cygtls.cc - (THREADLIST_CHUNK): Ditto. - (cygheap_init): Call init_tls_list(). - (init_cygheap::init_tls_list): Define new function. - (init_cygheap::add_tls): Ditto. - (init_cygheap::remove_tls): Ditto. - (init_cygheap::find_tls): Ditto. Semi-resurrect from - _cygtls::find_tls. - * cygheap.h (init_cygheap::init_tls_list): Declare new function. - (init_cygheap::add_tls): Ditto. - (init_cygheap::remove_tls): Ditto. - (init_cygheap::find_tls): Ditto. - * cygtls.cc (sentry): Delete. - (sentry::lock): Ditto. - (nthreads): Ditto. - (THREADLIST_CHUNK): Ditto. - (_cygtls::init): Delete definition. - (_cygtls::init_thread): Call cygheap->add_tls() to add thread to global - list. - (_cygtls::remove): cygheap->remove_tls() to remove thread from global - list. - * cygtls.h (_cygtls::init): Delete declaration. - * dcrt0.cc (dll_crt0_0): Delete call to _cygtls::init(). - * exceptions.cc (sigpacket::process): When no thread is specified, try - to find one via cygheap->find_tls. - -2012-08-08 Corinna Vinschen <corinna@vinschen.de> - - * include/sys/wait.h (_wait): Define when building newlib. - -2012-08-07 Christopher Faylor <me.cygwin2012@cgf.cx> - - * signal.cc (sigwaitinfo): Change cw_sig to the correct cw_sig_eintr. - -2012-08-03 Christopher Faylor <me.cygwin2012@cgf.cx> - - * exceptions.cc (sigdelayed): Simplify declaration. - (_cygtls::call_signal_handler): Fix test for when to pop signal stack. - Only do it exactly when what is on the stack is a no-op. - -2012-08-03 Christopher Faylor <me.cygwin2012@cgf.cx> - - * spawn.cc (child_info_spawn::worker): Put back a minor variation of - Corinna's test for detecting a background process when starting a - non-cygwin process. - -2012-08-01 Corinna Vinschen <corinna@vinschen.de> - - * include/cygwin/socket.h (MSG_BCAST): Define. - (MSG_MCAST): Define. - -2012-08-01 Corinna Vinschen <corinna@vinschen.de> - - * fhandler.h (fhandler_socket::recv_internal): Add bool parameter. - Add regparm attribute. - * fhandler_socket.cc (fhandler_socket::read): Call recv_internal with - second parameter set to false. - (fhandler_socket::readv): Ditto. - (fhandler_socket::recvfrom): Ditto. - (fhandler_socket::recv_internal): Convert use_recvmsg from local - variable to parameter. Use as request for using WSARecvMsg. Only - fail if WSARecvMsg can't be loaded and wsamsg->Control.len > 0, - otherwise use WSARecv{From}. Restrict dwFlags to MSG_PEEK when using - WSARecvMsg. - (fhandler_socket::recvmsg): Prefer using WSARecvMsg. Change priority - of tests for not using WSARecvMsg. Call recv_internal with second - parameter set accordingly. - -2012-08-01 Corinna Vinschen <corinna@vinschen.de> - - * Makefile.in: Semi-revert patch from 2012-07-01, assuming the previous - patch to etc::dir_changed fixes the underlying issue. - -2012-07-31 Corinna Vinschen <corinna@vinschen.de> - - * path.cc (etc::dir_changed): Revert muto changes since function is - called under lock condition anyway. - -2012-07-31 Corinna Vinschen <corinna@vinschen.de> - - * path.cc (etc::dir_changed): Change `io' to a static NO_COPY - variable. Explain why. Add a muto to guard overwriting the changed_h - handle by multiple concurrent threads. - * path.h (class etc): Drop unused changed_h member. - -2012-07-30 Christopher Faylor <me.cygwin2012@cgf.cx> - - * winlean.h: Define constant which will be needed eventually. Remove - hack in favor of another hack. - * lib/crt0.h: Use "winlean.h". - -2012-07-30 Christopher Faylor <me.cygwin2012@cgf.cx> - - * winlean.h: Add temporary define. - * winsup.h: Remove ancient debugging defines. - -2012-07-29 Christopher Faylor <me.cygwin2012@cgf.cx> - - * cygwait.cc (cancelable_wait): Add some debugging-only output. - * exceptions.cc (sig_handle_tty_stop): Make sure that incyg is cleared - when exiting if we have no parent process. Only wait for signal_arrived. - (sigpacket::process): Make continue_now a bool. Delay sending - signal_arrived until the end. Make code more defensive to avoid - calling signal handler when stopped. Only set signal_arrived when - stopped. - * sigproc.cc (sig_hold): Rename from sigCONT. Make static. - (sig_send): Accommodate sigCONT -> sig_hold rename. - (wait_sig): Ditto. - * sigproc.h (sigCONT): Delete declaration. - - * fhandler_console.cc (fhandler_console::write): Use new '%0c' facility - to print characters. Change to paranoid to avoid excessive strace - output. - * fhandler_tty.cc (fhandler_pty_master::accept_input): Make frequent - strace printf "paranoid" to help cut down on strace output size. - - * signal.cc (sigsuspend): Add standard syscall strace output. - (sigpause): Ditto. - (pause): Ditto. - -2012-07-29 Christopher Faylor <me.cygwin2012@cgf.cx> - - * cygtls.h (_cygtls::reset_signal_arrived): New function. - (set_signal_arrived::~set_signal_arrived): Use reset_signal_arrived to - reset state. - * exceptions.cc (sig_handle_tty_stop): Use WAIT_SIGNALED rather than - assume we know the return from cancelable_wait. - (_cygtls::interrupt_setup): Modify to allow calling when executing in - non-cygwin code via sigdelayed. Always reset signal_arrived. - * gendef: Throughout use start_offset rather than the completely wrong - sizeof__cygtls. - (_sigdelayed): Rewrite to avoid duplication when calling the signal - handler. - (sigreturn): Delete. - * gentls_offsets: Define start_offset rather than sizeof__cygtls. - * tlsoffsets.h: Regenerate. - -2012-07-29 Christopher Faylor <me.cygwin2012@cgf.cx> - - * fhandler_termios.cc (fhandler_termios::line_edit): Use special case - '%0c' handling to print non-printable characters using hex notation. - * smallprint.cc (__small_vsprintf): Semi-reimplement printing of - non-printable characters in hex but only when padding is specified. - - * dcrt0.cc (dll_crt0_0): Remove tty_list initialization. - * shared.cc (memory_init): Initialize tty_list here. - - * path.cc (path_conv::check): Remove unneeded parentheses from if - check. - -2012-07-28 Corinna Vinschen <corinna@vinschen.de> - - * include/inttypes.h: Add x86_64 target considerations throughout. - Define macros in C++ according to C99 requirements. - * include/stdint.h: Ditto. - -2012-07-25 Christopher Faylor <me.cygwin2012@cgf.cx> - - * signal.cc (clock_nanosleep): Force return on signal rather than - letting cancelable_wait loop on signal. - -2012-07-25 Corinna Vinschen <corinna@vinschen.de> - - * syscalls.cc (enum bin_status): Add dir_not_empty. - (try_to_bin): Call NtQueryInformationFile(FileInternalInformation) - with exact buffer size. Explain why. - Ditto for NtSetInformationFile(FileRenameInformation). - Handle race-condition which might lead to renaming a non-empty - directory. - (unlink_nt): Rearrange and partially rephrase comments related to the - STATUS_SHARING_VIOLATION case. Fix condition under which a dir is - tested for being non-empty. Handle dir_not_empty return code from - try_to_bin. Gracefully handle disappearing directory in rm -r - workaround. Fix typo in comment. - -2012-07-24 Corinna Vinschen <corinna@vinschen.de> - - * wincap.cc (wincapc::init): Drop memset call since it can result in - a race condition. Drop all considerations for pre-Windows 2000 systems - since Cygwin won't start on them anyway. - -2012-07-23 Christopher Faylor <me.cygwin2012@cgf.cx> - - Change "set_thread_waiting" to "set_signal_arrived" throughout. - -2012-07-21 Christopher Faylor <me.cygwin2012@cgf.cx> - - * DevNotes: Add entry cgf-000013. - * cygserver_ipc.h (ipc_set_proc_info): Use _cygtls::ipc_set_proc_info - to set per-thread signal arrived value. - * cygthread.cc (cygthread::detach): Use per-thread signal_arrived via - set_thread_waiting. - * fork.cc (_cygtls::fixup_after_fork): Clear signal_arrived. - (_cygtls::remove): Close any signal_arrived handle when thread exists. - (_cygtls::find_tls): Remove unneeded function. - * cygtls.h: Update copyright. - (class _cygtls): Reorganize to help avoid rebuilding newlib when - structure changes. - (_cygtls::event): Delete. - (_cygtls::threadkill): Ditto. - (_cygtls::signal_waiting): Declare new bool. - (_cygtls::find_tls): Delete declaration. - (_cygtls::set_threadkill): Ditto. - (_cygtls::reset_threadkill): Ditto. - (_cygtls::set_signal_arrived): Declare new function. - (class set_thread_waiting): Declare new class. - * cygwait.cc (cw_nowait_storage): Define. - (cygwait): Set per-thread signal_arrived via set_thread_waiting. Don't - special-case _main_tls. - * cygwait.h (cw_nowait): Define. - (cw_infinite): Ditto. - (cygwait): Redefine pathological wait-only case. - * dcrt0.cc (dll_crt0_0): Remove call to now-defunct events_init(). - (dll_crt0_1): Remove call to now-defunct create_signal_arrived(). - * exceptions.cc: Reflect set_signal_mask() argument reordering - throughout. Remove signal mask synchronization throughout. - (events_init): Delete definition. - (mask_sync): Delete now-unneeded mask synchronization. - (set_signal_mask): Reverse order of arguments to "standard" to, from - layout. Rename "newmask" argument to "setmask". Remove debugging. - (sig_handle_tty_stop): Use cancelable_wait rather than WFMO. - (_cygtls::interrupt_setup): Don't treat "threadkill" events specially. - Conditionally set signal_arrived depending on whether the thread has - created it or not. - (sigpacket::process): Reorganize to reflect thread-specific sending of - signals which is more in line with the way it was actually supposed to - work. - * fhandler_socket.cc (get_inet_addr): Use cancelable_wait rather than - IsEventSignalled to avoid potential race. - (fhandler_socket::wait_for_events): Set signal_arrived event using - set_thread_waiting(). - (fhandler_socket::close): Use cygwait for the case of just - waiting 10 ms for a signal. - * fhandler_tape.cc (fhandler_dev_tape::_lock): Use cancelable_wait - rather than WFMO. Redo switch/case tests accordingly. - * fhandler_termios.cc (fhandler_termios::bg_check): Use cygwait for - case of just waiting 0 ms for a potential signal. - * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Use - cancelable_wait rather than WFSO. - * fhandler_windows.cc (fhandler_windows::read): Set per-thread - signal_arrived via set_thread_waiting(). - * flock.cc (lf_setlock): Ditto. - * select.cc (pselect): Ditto. Set per-thread signal_arrived using - set_thread_waiting(). - * gendef: Don't special case handling of _cygtls::sig for threads. - * gentls_offsets: Use #pragma once in tlsoffsets.h. - * ntdll.h: Use #pragma once. - * poll.cc: Reflect set_signal_mask() argument reordering. - * posix_ipc.cc (ipc_mutex_lock): Use cancelable_wait rather than WFMO. - (ipc_cond_timedwait): Set perl-thread signal arrived using - set_thread_waiting(). - * security.h: Use #pragma once. - * signal.cc (abort): Reflect set_signal_mask() argument reordering. - (clock_nanosleep): Ditto. Change call to cancelable_wait to properly - specify handling of cancel and interrupt. - (sigwaitinfo): Remove handling of per-thread event in favor of - per-thread signal_arrived. Use cancelable_wait rather than WFSO. - * sigproc.cc (signal_arrived): Delete definition. - (create_signal_arrived): Ditto. - * sigproc.h (signal_arrived): Delete declaration. - (set_signal_mask): Avoid defining as a "C" function. Don't - conditionally declare. - (create_signal_arrived): Delete declaration. - * syscalls.cc (rename): Use cygwait() rather than WFSO. - * thread.h (fast_mutex::lock): Use cw_infinite rather than LARGE_NULL. - * wait.cc (wait4): Ditto. - * thread.cc (pthread_mutex::lock): Ditto. - (pthread::join): Ditto. - (semaphore::_wait): Ditto. - (pthread_kill): Remove set_threadkill() accommodation. - * tlsoffsets.h: Regenerate. - -2012-07-21 Christopher Faylor <me.cygwin2012@cgf.cx> - - * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 17. - 2012-07-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> * mount.cc (getmntent_r): Remove unused but set variable. diff --git a/winsup/cygwin/DevNotes b/winsup/cygwin/DevNotes index 68d8320cd..8e517bf84 100644 --- a/winsup/cygwin/DevNotes +++ b/winsup/cygwin/DevNotes @@ -1,37 +1,3 @@ -2012-08-09 cgf-000014 - -So, apparently I got it somewhat right before wrt signal handling. -Checking on linux, it appears that signals will be sent to a thread -which can accept the signal. So resurrecting and extending the -"find_tls" function is in order. This function will return the tls -of any thread which 1) is waiting for a signal with sigwait*() or -2) has the signal unmasked. - -In redoing this it became obvious that I had the class designation wrong -for the threadlist handling so I moved the manipulation of the global -threadlist into the cygheap where it logically belongs. - -2012-07-21 cgf-000013 - -These changes reflect a revamp of the "wait for signal" functionality -which has existed in Cygwin through several signal massages. - -We now create a signal event only when a thread is waiting for a signal -and arm it only for that thread. The "set_signal_arrived" function is -used to establish the event and set it in a location referencable by -the caller. - -I still do not handle all of the race conditions. What happens when -a signal comes in just after a WF?O succeeds for some other purpose? I -suspect that it will arm the next WF?O call and the subsequent call to -call_signal_handler could cause a function to get an EINTR when possibly -it shouldn't have. - -I haven't yet checked all of the test cases for the URL listed in the -previous entry. - -Baby steps. - 2012-06-12 cgf-000012 These changes are the preliminary for redoing the way threads wait for diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index 6e4282843..494314be8 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -275,8 +275,15 @@ malloc_CFLAGS:=-fomit-frame-pointer -O3 malloc_wrapper_CFLAGS:=-fomit-frame-pointer miscfuncs_CFLAGS:=-fomit-frame-pointer net_CFLAGS:=-fomit-frame-pointer -passwd_CFLAGS:=-fomit-frame-pointer -path_CFLAGS=-fomit-frame-pointer +# +# FIXME: Setting either of the below to -fomit-frame-pointer causes an +# optimized version of Cygwin to sometimes "jump to zero" in long-running +# shell processes when compiled with gcc 4.5.3. +# +# passwd_CFLAGS:=-fomit-frame-pointer +# path_CFLAGS=-fomit-frame-pointer +# +path_CFLAGS=-fgcse-lm -fgcse-sm -fgcse-las -fgcse-after-reload regcomp_CFLAGS=-fomit-frame-pointer regerror_CFLAGS=-fomit-frame-pointer regexec_CFLAGS=-fomit-frame-pointer diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc index 639f4e662..c7f1f6ab4 100644 --- a/winsup/cygwin/cygheap.cc +++ b/winsup/cygwin/cygheap.cc @@ -47,23 +47,6 @@ struct cygheap_entry char data[0]; }; -class tls_sentry -{ -public: - static muto lock; - int destroy; - void init (); - bool acquired () {return lock.acquired ();} - tls_sentry () {destroy = 0;} - tls_sentry (DWORD wait) {destroy = lock.acquire (wait);} - ~tls_sentry () {if (destroy) lock.release ();} -}; - -muto NO_COPY tls_sentry::lock; -static NO_COPY size_t nthreads; - -#define THREADLIST_CHUNK 256 - #define NBUCKETS (sizeof (cygheap->buckets) / sizeof (cygheap->buckets[0])) #define N0 ((_cmalloc_entry *) NULL) #define to_cmalloc(s) ((_cmalloc_entry *) (((char *) (s)) - (unsigned) (N0->data))) @@ -273,7 +256,6 @@ cygheap_init () cygheap->fdtab.init (); if (!cygheap->sigs) sigalloc (); - cygheap->init_tls_list (); } /* Copyright (C) 1997, 2000 DJ Delorie */ @@ -563,84 +545,3 @@ cygheap_user::set_name (const char *new_name) cfree_and_set (pdomain); cfree_and_set (pwinname); } - -void -init_cygheap::init_tls_list () -{ - if (threadlist) - memset (cygheap->threadlist, 0, cygheap->sthreads * sizeof (cygheap->threadlist[0])); - else - { - sthreads = THREADLIST_CHUNK; - threadlist = (_cygtls **) ccalloc_abort (HEAP_TLS, cygheap->sthreads, - sizeof (cygheap->threadlist[0])); - } - tls_sentry::lock.init ("thread_tls_sentry"); -} - -void -init_cygheap::add_tls (_cygtls *t) -{ - cygheap->user.reimpersonate (); - tls_sentry here (INFINITE); - if (nthreads >= cygheap->sthreads) - { - threadlist = (_cygtls **) - crealloc_abort (threadlist, (sthreads += THREADLIST_CHUNK) - * sizeof (threadlist[0])); - // memset (threadlist + nthreads, 0, THREADLIST_CHUNK * sizeof (threadlist[0])); - } - - threadlist[nthreads++] = t; -} - -void -init_cygheap::remove_tls (_cygtls *t, DWORD wait) -{ - tls_sentry here (wait); - if (here.acquired ()) - { - for (size_t i = 0; i < nthreads; i++) - if (t == threadlist[i]) - { - if (i < --nthreads) - threadlist[i] = threadlist[nthreads]; - debug_only_printf ("removed %p element %d", this, i); - break; - } - } -} - -_cygtls * -init_cygheap::find_tls (int sig) -{ - debug_printf ("sig %d\n", sig); - tls_sentry here (INFINITE); - - static int NO_COPY threadlist_ix; - - _cygtls *t = _main_tls; - - myfault efault; - if (efault.faulted ()) - threadlist[threadlist_ix]->remove (INFINITE); - else - { - threadlist_ix = -1; - while (++threadlist_ix < (int) nthreads) - if (sigismember (&(threadlist[threadlist_ix]->sigwait_mask), sig)) - { - t = cygheap->threadlist[threadlist_ix]; - goto out; - } - threadlist_ix = -1; - while (++threadlist_ix < (int) nthreads) - if (!sigismember (&(threadlist[threadlist_ix]->sigmask), sig)) - { - t = cygheap->threadlist[threadlist_ix]; - break; - } - } -out: - return t; -} diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index e03774ffd..f2b0cd9ec 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -396,10 +396,6 @@ struct init_cygheap: public mini_cygheap hook_chain hooks; void close_ctty (); void init_installation_root (); - void init_tls_list () __attribute__ ((regparm (1)));; - void add_tls (_cygtls *) __attribute__ ((regparm (2))); - void remove_tls (_cygtls *, DWORD) __attribute__ ((regparm (3))); - _cygtls *find_tls (int) __attribute__ ((regparm (2))); }; diff --git a/winsup/cygwin/cygserver_ipc.h b/winsup/cygwin/cygserver_ipc.h index 4dbc8212f..2f7c3531f 100644 --- a/winsup/cygwin/cygserver_ipc.h +++ b/winsup/cygwin/cygserver_ipc.h @@ -43,7 +43,7 @@ ipc_set_proc_info (proc &blk) blk.gidcnt = 0; blk.gidlist = NULL; blk.is_admin = false; - _my_tls.set_signal_arrived (true, blk.signal_arrived); + blk.signal_arrived = signal_arrived; } #endif /* __INSIDE_CYGWIN__ */ diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc index 5afc42954..4cbd3b064 100644 --- a/winsup/cygwin/cygthread.cc +++ b/winsup/cygwin/cygthread.cc @@ -377,7 +377,7 @@ cygthread::detach (HANDLE sigwait) unsigned n = 2; DWORD howlong = INFINITE; w4[0] = sigwait; - set_signal_arrived here (w4[1]); + w4[1] = signal_arrived; /* For a description of the below loop see the end of this file */ for (int i = 0; i < 2; i++) switch (res = WaitForMultipleObjects (n, w4, FALSE, howlong)) diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index abda77c5f..1c8ec3348 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -19,6 +19,39 @@ details. */ #include "sigproc.h" #include "exception.h" +class sentry +{ + static muto lock; + int destroy; +public: + void init (); + bool acquired () {return lock.acquired ();} + sentry () {destroy = 0;} + sentry (DWORD wait) {destroy = lock.acquire (wait);} + ~sentry () {if (destroy) lock.release ();} + friend void _cygtls::init (); +}; + +muto NO_COPY sentry::lock; + +static size_t NO_COPY nthreads; + +#define THREADLIST_CHUNK 256 + +void +_cygtls::init () +{ + if (cygheap->threadlist) + memset (cygheap->threadlist, 0, cygheap->sthreads * sizeof (cygheap->threadlist[0])); + else + { + cygheap->sthreads = THREADLIST_CHUNK; + cygheap->threadlist = (_cygtls **) ccalloc_abort (HEAP_TLS, cygheap->sthreads, + sizeof (cygheap->threadlist[0])); + } + sentry::lock.init ("sentry_lock"); +} + /* Two calls to get the stack right... */ void _cygtls::call (DWORD (*func) (void *, void *), void *arg) @@ -134,7 +167,18 @@ _cygtls::init_thread (void *x, DWORD (*func) (void *, void *)) || (void *) func == (void *) cygthread::simplestub) return; - cygheap->add_tls (this); + cygheap->user.reimpersonate (); + + sentry here (INFINITE); + if (nthreads >= cygheap->sthreads) + { + cygheap->threadlist = (_cygtls **) + crealloc_abort (cygheap->threadlist, (cygheap->sthreads += THREADLIST_CHUNK) + * sizeof (cygheap->threadlist[0])); + memset (cygheap->threadlist + nthreads, 0, THREADLIST_CHUNK * sizeof (cygheap->threadlist[0])); + } + + cygheap->threadlist[nthreads++] = this; } void @@ -146,7 +190,6 @@ _cygtls::fixup_after_fork () sig = 0; } stacklock = spinning = 0; - signal_arrived = NULL; locals.select.sockevt = NULL; locals.cw_timer = NULL; wq.thread_ev = NULL; @@ -171,13 +214,6 @@ _cygtls::remove (DWORD wait) /* FIXME: Need some sort of atthreadexit function to allow things like select to control this themselves. */ - if (signal_arrived) - { - HANDLE h = signal_arrived; - signal_arrived = NULL; - CloseHandle (h); - } - /* Close handle and free memory used by select. */ if (locals.select.sockevt) { @@ -193,7 +229,22 @@ _cygtls::remove (DWORD wait) free_local (hostent_buf); /* Free temporary TLS path buffers. */ locals.pathbufs.destroy (); - cygheap->remove_tls (this, wait); + + do + { + sentry here (wait); + if (here.acquired ()) + { + for (size_t i = 0; i < nthreads; i++) + if (this == cygheap->threadlist[i]) + { + if (i < --nthreads) + cygheap->threadlist[i] = cygheap->threadlist[nthreads]; + debug_printf ("removed %p element %d", this, i); + break; + } + } + } while (0); remove_wq (wait); } @@ -203,6 +254,31 @@ _cygtls::push (__stack_t addr) *stackptr++ = (__stack_t) addr; } + +_cygtls * +_cygtls::find_tls (int sig) +{ + static int NO_COPY threadlist_ix; + + debug_printf ("signal %d\n", sig); + sentry here (INFINITE); + + _cygtls *res = NULL; + threadlist_ix = -1; + + myfault efault; + if (efault.faulted ()) + cygheap->threadlist[threadlist_ix]->remove (INFINITE); + + while (++threadlist_ix < (int) nthreads) + if (sigismember (&(cygheap->threadlist[threadlist_ix]->sigwait_mask), sig)) + { + res = cygheap->threadlist[threadlist_ix]; + break; + } + return res; +} + void _cygtls::set_siginfo (sigpacket *pack) { diff --git a/winsup/cygwin/cygtls.h b/winsup/cygwin/cygtls.h index d683cf837..40c6151c2 100644 --- a/winsup/cygwin/cygtls.h +++ b/winsup/cygwin/cygtls.h @@ -1,12 +1,13 @@ /* cygtls.h - Copyright 2003, 2004, 2005, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. + Copyright 2003, 2004, 2005, 2008, 2009, 2010, 2011 Red Hat, Inc. This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#pragma once +#ifndef _CYGTLS_H +#define _CYGTLS_H #include <signal.h> #include <pwd.h> @@ -157,7 +158,6 @@ typedef struct struct_waitq /*gentls_offsets*/ #include "cygerrno.h" -#include "security.h" extern "C" int __sjfault (jmp_buf); extern "C" int __ljfault (jmp_buf, int); @@ -169,29 +169,27 @@ typedef __uint32_t __stack_t; class _cygtls { public: - /* Please keep these two declarations first */ - struct _local_storage locals; - union - { - struct _reent local_clib; - char __dontuse[8 * ((sizeof(struct _reent) + 4) / 8)]; - }; - /**/ void (*func) /*gentls_offsets*/(int)/*gentls_offsets*/; int saved_errno; int sa_flags; sigset_t oldmask; sigset_t deltamask; + HANDLE event; int *errno_addr; sigset_t sigmask; sigset_t sigwait_mask; siginfo_t *sigwait_info; - HANDLE signal_arrived; - bool signal_waiting; struct ucontext thread_context; DWORD thread_id; + unsigned threadkill; siginfo_t infodata; struct pthread *tid; + union + { + struct _reent local_clib; + char __dontuse[8 * ((sizeof(struct _reent) + 4) / 8)]; + }; + struct _local_storage locals; class cygthread *_ctinfo; class san *andreas; waitq wq; @@ -204,8 +202,10 @@ public: unsigned initialized; /*gentls_offsets*/ + static void init (); void init_thread (void *, DWORD (*) (void *, void *)); static void call (DWORD (*) (void *, void *), void *); + static struct _cygtls *find_tls (int sig); void remove (DWORD); void push (__stack_t) __attribute__ ((regparm (2))); __stack_t pop () __attribute__ ((regparm (1))); @@ -229,30 +229,14 @@ public: operator HANDLE () const {return tid->win32_obj_id;} #endif void set_siginfo (struct sigpacket *) __attribute__ ((regparm (3))); + void set_threadkill () {threadkill = true;} + void reset_threadkill () {threadkill = false;} int call_signal_handler () __attribute__ ((regparm (1))); void remove_wq (DWORD) __attribute__ ((regparm (1))); void fixup_after_fork () __attribute__ ((regparm (1))); void lock () __attribute__ ((regparm (1))); void unlock () __attribute__ ((regparm (1))); bool locked () __attribute__ ((regparm (1))); - void set_signal_arrived (bool setit, HANDLE& h) - { - if (!setit) - signal_waiting = false; - else - { - if (!signal_arrived) - signal_arrived = CreateEvent (&sec_none_nih, false, false, NULL); - h = signal_arrived; - signal_waiting = true; - } - } - void reset_signal_arrived () - { - if (signal_arrived) - ResetEvent (signal_arrived); - signal_waiting = false; - } private: void call2 (DWORD (*) (void *, void *), void *, void *) __attribute__ ((regparm (3))); /*gentls_offsets*/ @@ -320,15 +304,6 @@ public: } }; -class set_signal_arrived -{ -public: - set_signal_arrived (bool setit, HANDLE& h) { _my_tls.set_signal_arrived (setit, h); } - set_signal_arrived (HANDLE& h) { _my_tls.set_signal_arrived (true, h); } - - operator int () const {return _my_tls.signal_waiting;} - ~set_signal_arrived () { _my_tls.reset_signal_arrived (); } -}; - #define __getreent() (&_my_tls.local_clib) -/*gentls_offsets*/ + +#endif /*_CYGTLS_H*/ /*gentls_offsets*/ diff --git a/winsup/cygwin/cygwait.cc b/winsup/cygwin/cygwait.cc index ee7a705ef..f6eb0a3a7 100644 --- a/winsup/cygwin/cygwait.cc +++ b/winsup/cygwin/cygwait.cc @@ -21,8 +21,6 @@ #define is_cw_sig_handle (mask & (is_cw_sig | is_cw_sig_eintr)) -LARGE_INTEGER cw_nowait_storage; - DWORD cancelable_wait (HANDLE object, PLARGE_INTEGER timeout, unsigned mask) { @@ -38,13 +36,14 @@ cancelable_wait (HANDLE object, PLARGE_INTEGER timeout, unsigned mask) if (object) wait_objects[num++] = object; - set_signal_arrived thread_waiting (is_cw_sig_handle, wait_objects[num]); - debug_only_printf ("object %p, thread waiting %d, signal_arrived %p", object, (int) thread_waiting, _my_tls.signal_arrived); DWORD sig_n; - if (!thread_waiting) + if (!is_cw_sig_handle) sig_n = WAIT_TIMEOUT + 1; else - sig_n = WAIT_OBJECT_0 + num++; + { + sig_n = WAIT_OBJECT_0 + num++; + wait_objects[sig_n] = signal_arrived; + } DWORD cancel_n; if (!is_cw_cancel || !pthread::is_good_object (&thread) || @@ -72,7 +71,6 @@ cancelable_wait (HANDLE object, PLARGE_INTEGER timeout, unsigned mask) while (1) { res = WaitForMultipleObjects (num, wait_objects, FALSE, INFINITE); - debug_only_printf ("res %d", res); if (res == cancel_n) res = WAIT_CANCELED; else if (res == timeout_n) @@ -81,7 +79,7 @@ cancelable_wait (HANDLE object, PLARGE_INTEGER timeout, unsigned mask) /* all set */; else if (is_cw_sig_eintr) res = WAIT_SIGNALED; /* caller will deal with signals */ - else if (_my_tls.call_signal_handler ()) + else if (_my_tls.call_signal_handler () || &_my_tls != _main_tls) continue; break; } diff --git a/winsup/cygwin/cygwait.h b/winsup/cygwin/cygwait.h index d52a145ae..0303ec3b6 100644 --- a/winsup/cygwin/cygwait.h +++ b/winsup/cygwin/cygwait.h @@ -22,10 +22,7 @@ enum cw_wait_mask cw_sig_eintr = 0x0008 }; -extern LARGE_INTEGER cw_nowait_storage; -#define cw_nowait (&cw_nowait_storage) -#define cw_infinite ((PLARGE_INTEGER) NULL) - +#define LARGE_NULL ((PLARGE_INTEGER) NULL) const unsigned cw_std_mask = cw_cancel | cw_cancel_self | cw_sig; DWORD cancelable_wait (HANDLE, PLARGE_INTEGER timeout = NULL, @@ -56,5 +53,5 @@ cygwait (HANDLE h, DWORD howlong = INFINITE) static inline DWORD __attribute__ ((always_inline)) cygwait (DWORD howlong) { - return cygwait (NULL, howlong); + return cancelable_wait (NULL, howlong, cw_cancel | cw_sig_eintr); } diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 0cda2e5d5..70b962889 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -773,6 +773,12 @@ dll_crt0_0 () user_data->threadinterface->Init (); + _cygtls::init (); + + /* Initialize events */ + events_init (); + tty_list::init_session (); + _main_tls = &_my_tls; /* Initialize signal processing here, early, in the hopes that the creation @@ -837,6 +843,8 @@ dll_crt0_1 (void *) strace.microseconds (); #endif + create_signal_arrived (); /* FIXME: move into wait_sig? */ + /* Initialize debug muto, if DLL is built with --enable-debugging. Need to do this before any helper threads start. */ debug_init (); diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 649574fc2..5ace52b5b 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -19,8 +19,8 @@ details. */ #include <syslog.h> #include <wchar.h> -#include "cygtls.h" #include "pinfo.h" +#include "cygtls.h" #include "sigproc.h" #include "shared_info.h" #include "perprocess.h" @@ -31,19 +31,23 @@ details. */ #include "child_info.h" #include "ntdll.h" #include "exception.h" +#include "cygwait.h" #define CALL_HANDLER_RETRY_OUTER 10 #define CALL_HANDLER_RETRY_INNER 10 char debugger_command[2 * NT_MAX_PATH + 20]; -extern "C" void sigdelayed (); +extern "C" { +extern void sigdelayed (); +}; static BOOL WINAPI ctrl_c_handler (DWORD); /* This is set to indicate that we have already exited. */ static NO_COPY int exit_already = 0; +static muto NO_COPY mask_sync; NO_COPY static struct { @@ -706,11 +710,11 @@ handle_sigsuspend (sigset_t tempmask) { sigset_t oldmask = _my_tls.sigmask; // Remember for restoration - set_signal_mask (_my_tls.sigmask, tempmask); + set_signal_mask (tempmask, _my_tls.sigmask); sigproc_printf ("oldmask %p, newmask %p", oldmask, tempmask); pthread_testcancel (); - cancelable_wait (NULL, cw_infinite, cw_cancel | cw_cancel_self | cw_sig_eintr); + cancelable_wait (signal_arrived, LARGE_NULL, cw_cancel | cw_cancel_self); set_sig_errno (EINTR); // Per POSIX @@ -733,29 +737,31 @@ sig_handle_tty_stop (int sig) /* Silently ignore attempts to suspend if there is no accommodating cygwin parent to deal with this behavior. */ if (!myself->cygstarted) - myself->process_state &= ~PID_STOPPED; - else { - myself->stopsig = sig; - myself->alert_parent (sig); - sigproc_printf ("process %d stopped by signal %d", myself->pid, sig); - /* FIXME! This does nothing to suspend anything other than the main - thread. */ - DWORD res = cancelable_wait (NULL, cw_infinite, cw_sig_eintr); - switch (res) - { - case WAIT_SIGNALED: - myself->stopsig = SIGCONT; - myself->alert_parent (SIGCONT); - break; - default: - api_fatal ("WaitSingleObject returned %d", res); - break; - } + myself->process_state &= ~PID_STOPPED; + return; + } + + myself->stopsig = sig; + myself->alert_parent (sig); + sigproc_printf ("process %d stopped by signal %d", myself->pid, sig); + HANDLE w4[2]; + w4[0] = sigCONT; + w4[1] = signal_arrived; + switch (WaitForMultipleObjects (2, w4, TRUE, INFINITE)) + { + case WAIT_OBJECT_0: + case WAIT_OBJECT_0 + 1: + myself->stopsig = SIGCONT; + myself->alert_parent (SIGCONT); + break; + default: + api_fatal ("WaitSingleObject failed, %E"); + break; } _my_tls.incyg = 0; } -} /* end extern "C" */ +} bool _cygtls::interrupt_now (CONTEXT *cx, int sig, void *handler, @@ -798,11 +804,20 @@ _cygtls::interrupt_setup (int sig, void *handler, struct sigaction& siga) this->sig = sig; // Should always be last thing set to avoid a race - if (incyg && signal_arrived) - SetEvent (signal_arrived); + if (!event) + threadkill = false; + else + { + HANDLE h = event; + event = NULL; + SetEvent (h); + } + /* Clear any waiting threads prior to dispatching to handler function */ + int res = SetEvent (signal_arrived); // For an EINTR case proc_subproc (PROC_CLEARWAIT, 1); - sigproc_printf ("armed signal_arrived %p, signal %d", signal_arrived, sig); + sigproc_printf ("armed signal_arrived %p, signal %d, res %d", signal_arrived, + sig, res); } extern "C" void __stdcall @@ -1006,7 +1021,7 @@ ctrl_c_handler (DWORD type) extern "C" void __stdcall set_process_mask (sigset_t newmask) { - set_signal_mask (_my_tls.sigmask, newmask); + set_signal_mask (newmask, _my_tls.sigmask); } extern "C" int @@ -1019,9 +1034,11 @@ sighold (int sig) syscall_printf ("signal %d out of range", sig); return -1; } + mask_sync.acquire (INFINITE); sigset_t mask = _my_tls.sigmask; sigaddset (&mask, sig); - set_signal_mask (_my_tls.sigmask, mask); + set_signal_mask (mask, _my_tls.sigmask); + mask_sync.release (); return 0; } @@ -1035,9 +1052,11 @@ sigrelse (int sig) syscall_printf ("signal %d out of range", sig); return -1; } + mask_sync.acquire (INFINITE); sigset_t mask = _my_tls.sigmask; sigdelset (&mask, sig); - set_signal_mask (_my_tls.sigmask, mask); + set_signal_mask (mask, _my_tls.sigmask); + mask_sync.release (); return 0; } @@ -1055,6 +1074,7 @@ sigset (int sig, _sig_func_ptr func) return (_sig_func_ptr) SIG_ERR; } + mask_sync.acquire (INFINITE); sigset_t mask = _my_tls.sigmask; /* If sig was in the signal mask return SIG_HOLD, otherwise return the previous disposition. */ @@ -1073,7 +1093,8 @@ sigset (int sig, _sig_func_ptr func) signal (sig, func); sigdelset (&mask, sig); } - set_signal_mask (_my_tls.sigmask, mask); + set_signal_mask (mask, _my_tls.sigmask); + mask_sync.release (); return prev; } @@ -1084,10 +1105,11 @@ sigignore (int sig) } /* Update the signal mask for this process and return the old mask. - Called from call_signal_handler */ + Called from sigdelayed */ extern "C" sigset_t set_process_mask_delta () { + mask_sync.acquire (INFINITE); sigset_t newmask, oldmask; if (_my_tls.deltamask & SIG_NONMASKABLE) @@ -1098,35 +1120,41 @@ set_process_mask_delta () sigproc_printf ("oldmask %p, newmask %p, deltamask %p", oldmask, newmask, _my_tls.deltamask); _my_tls.sigmask = newmask; + mask_sync.release (); return oldmask; } /* Set the signal mask for this process. Note that some signals are unmaskable, as in UNIX. */ - -void -set_signal_mask (sigset_t& setmask, sigset_t newmask) +extern "C" void __stdcall +set_signal_mask (sigset_t newmask, sigset_t& oldmask) { +#ifdef CGF + if (&_my_tls == _sig_tls) + small_printf ("********* waiting in signal thread\n"); +#endif + mask_sync.acquire (INFINITE); newmask &= ~SIG_NONMASKABLE; - sigset_t mask_bits = setmask & ~newmask; - sigproc_printf ("setmask %p, newmask %p, mask_bits %p", setmask, newmask, + sigset_t mask_bits = oldmask & ~newmask; + sigproc_printf ("oldmask %p, newmask %p, mask_bits %p", oldmask, newmask, mask_bits); - setmask = newmask; + oldmask = newmask; if (mask_bits) sig_dispatch_pending (true); + mask_sync.release (); } int __stdcall sigpacket::process () { - bool continue_now; + DWORD continue_now; struct sigaction dummy = global_sigs[SIGSTOP]; if (si.si_signo != SIGCONT) continue_now = false; else { - continue_now = ISSTATE (myself, PID_STOPPED); + continue_now = myself->process_state & PID_STOPPED; myself->stopsig = 0; myself->process_state &= ~PID_STOPPED; /* Clear pending stop signals */ @@ -1156,23 +1184,17 @@ sigpacket::process () myself->rusage_self.ru_nsignals++; - void *handler = (void *) thissig.sa_handler; - if (handler == SIG_IGN) - { - sigproc_printf ("signal %d ignored", si.si_signo); - goto done; - } - - if (have_execed) + bool masked; + void *handler; + if (!have_execed || (void *) thissig.sa_handler == (void *) SIG_IGN) + handler = (void *) thissig.sa_handler; + else if (tls) + return 1; + else handler = NULL; - if (tls) - sigproc_printf ("using tls %p", tls); - else - { - tls = cygheap->find_tls (si.si_signo); - sigproc_printf ("using tls %p", tls); - } + _cygtls *use_tls = tls ?: _main_tls; + sigproc_printf ("tls %p, use_tls %p", tls, use_tls); if (si.si_signo == SIGKILL) goto exit_sig; @@ -1182,12 +1204,30 @@ sigpacket::process () goto stop; } - if (sigismember (&tls->sigwait_mask, si.si_signo)) + bool insigwait_mask; + if ((masked = ISSTATE (myself, PID_STOPPED))) + insigwait_mask = false; + else if (tls) + insigwait_mask = sigismember (&tls->sigwait_mask, si.si_signo); + else if (!(tls = _cygtls::find_tls (si.si_signo))) + insigwait_mask = false; + else { - tls->sigwait_mask = 0; - goto dosig; + use_tls = tls; + insigwait_mask = true; } - if (sigismember (&tls->sigmask, si.si_signo) || ISSTATE (myself, PID_STOPPED)) + + if (insigwait_mask) + goto thread_specific; + + if (masked) + /* nothing to do */; + else if (sigismember (mask, si.si_signo)) + masked = true; + else if (tls) + masked = sigismember (&tls->sigmask, si.si_signo); + + if (masked) { sigproc_printf ("signal %d blocked", si.si_signo); rc = -1; @@ -1200,10 +1240,14 @@ sigpacket::process () if (handler == (void *) SIG_DFL) { + if (insigwait_mask) + goto thread_specific; if (si.si_signo == SIGCHLD || si.si_signo == SIGIO || si.si_signo == SIGCONT || si.si_signo == SIGWINCH || si.si_signo == SIGURG) { - sigproc_printf ("signal %d default is currently ignore", si.si_signo); + sigproc_printf ("default signal %d ignored", si.si_signo); + if (continue_now) + SetEvent (signal_arrived); goto done; } @@ -1213,35 +1257,53 @@ sigpacket::process () goto exit_sig; } + if (handler == (void *) SIG_IGN) + { + sigproc_printf ("signal %d ignored", si.si_signo); + goto done; + } + if (handler == (void *) SIG_ERR) goto exit_sig; + use_tls->set_siginfo (this); goto dosig; stop: + /* Eat multiple attempts to STOP */ + if (ISSTATE (myself, PID_STOPPED)) + goto done; handler = (void *) sig_handle_tty_stop; thissig = dummy; dosig: - if (ISSTATE (myself, PID_STOPPED) && !continue_now) - rc = -1; /* No signals delivered if stopped */ - else - { - tls->set_siginfo (this); - /* Dispatch to the appropriate function. */ - sigproc_printf ("signal %d, signal handler %p", si.si_signo, handler); - rc = setup_handler (si.si_signo, handler, thissig, tls); - continue_now = false; - } + /* Dispatch to the appropriate function. */ + sigproc_printf ("signal %d, about to call %p", si.si_signo, handler); + rc = setup_handler (si.si_signo, handler, thissig, use_tls); done: + tls = use_tls; if (continue_now) - SetEvent (tls->signal_arrived); + SetEvent (sigCONT); sigproc_printf ("returning %d", rc); return rc; +thread_specific: + use_tls->sig = si.si_signo; + use_tls->set_siginfo (this); + use_tls->func = NULL; + sigproc_printf ("releasing sigwait for thread"); + SetEvent (use_tls->event); + goto done; + exit_sig: - tls->signal_exit (si.si_signo); /* never returns */ + use_tls->signal_exit (si.si_signo); /* never returns */ +} + +void +events_init () +{ + mask_sync.init ("mask_sync"); } void @@ -1257,16 +1319,26 @@ _cygtls::call_signal_handler () while (1) { lock (); - if (!sig) + if (sig) + pop (); + else if (this != _main_tls) { - unlock (); - break; - } + _main_tls->lock (); + if (_main_tls->sig && _main_tls->incyg) + { + paranoid_printf ("Redirecting to main_tls signal %d", _main_tls->sig); + sig = _main_tls->sig; + sa_flags = _main_tls->sa_flags; + func = _main_tls->func; + infodata = _main_tls->infodata; + _main_tls->pop (); + _main_tls->sig = 0; - /* Pop the stack if the next "return address" is sigdelayed, since - this function is doing what sigdelayed would have done anyway. */ - if (retaddr () == (__stack_t) sigdelayed) - pop (); + } + _main_tls->unlock (); + } + if (!sig) + break; debug_only_printf ("dealing with signal %d", sig); this_sa_flags = sa_flags; @@ -1276,12 +1348,12 @@ _cygtls::call_signal_handler () sigset_t this_oldmask = set_process_mask_delta (); int this_errno = saved_errno; sig = 0; - reset_signal_arrived (); unlock (); // make sure synchronized if (!(this_sa_flags & SA_SIGINFO)) { + void (*sigfunc) (int) = thisfunc; incyg = false; - thisfunc (thissig); + sigfunc (thissig); } else { @@ -1292,11 +1364,12 @@ _cygtls::call_signal_handler () sigact (thissig, &thissi, NULL); } incyg = true; - set_signal_mask (_my_tls.sigmask, this_oldmask); + set_signal_mask (this_oldmask, _my_tls.sigmask); if (this_errno >= 0) set_errno (this_errno); } + unlock (); return this_sa_flags & SA_RESTART || (this != _main_tls); } diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 39e1e7573..9f30f5cc0 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -558,7 +558,7 @@ class fhandler_socket: public fhandler_base int open (int flags, mode_t mode = 0); void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3))); ssize_t __stdcall readv (const struct iovec *, int iovcnt, ssize_t tot = -1); - inline ssize_t recv_internal (struct _WSAMSG *wsamsg, bool use_recvmsg) __attribute__ ((regparm (3))); + inline ssize_t recv_internal (struct _WSAMSG *wsamsg); ssize_t recvfrom (void *ptr, size_t len, int flags, struct sockaddr *from, int *fromlen); ssize_t recvmsg (struct msghdr *msg, int flags); diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 0dcd1262b..0208a4863 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -2012,7 +2012,8 @@ fhandler_console::write (const void *vsrc, size_t len) while (src < end) { - paranoid_printf ("char %0c state is %d", *src, dev_state.state_); + debug_printf ("at %d(%c) state is %d", *src, isprint (*src) ? *src : ' ', + dev_state.state_); switch (dev_state.state_) { case normal: diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index a11c7efbe..cb6d376fd 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -125,7 +125,9 @@ get_inet_addr (const struct sockaddr *in, int inlen, some greedy Win32 application. Therefore we should never wait endlessly without checking for signals and thread cancel event. */ pthread_testcancel (); - if (cancelable_wait (NULL, cw_nowait, cw_sig_eintr) == WAIT_SIGNALED + /* Using IsEventSignalled like this is racy since another thread could + be waiting for signal_arrived. */ + if (IsEventSignalled (signal_arrived) && !_my_tls.call_signal_handler ()) { set_errno (EINTR); @@ -657,8 +659,7 @@ fhandler_socket::wait_for_events (const long event_mask, const DWORD flags) return SOCKET_ERROR; } - WSAEVENT ev[2] = { wsock_evt }; - set_signal_arrived here (ev[1]); + WSAEVENT ev[2] = { wsock_evt, signal_arrived }; switch (WSAWaitForMultipleEvents (2, ev, FALSE, 50, FALSE)) { case WSA_WAIT_TIMEOUT: @@ -1330,7 +1331,7 @@ fhandler_socket::read (void *in_ptr, size_t& len) { WSABUF wsabuf = { len, (char *) in_ptr }; WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 }; - len = recv_internal (&wsamsg, false); + len = recv_internal (&wsamsg); } int @@ -1346,7 +1347,7 @@ fhandler_socket::readv (const struct iovec *const iov, const int iovcnt, wsaptr->buf = (char *) iovptr->iov_base; } WSAMSG wsamsg = { NULL, 0, wsabuf, iovcnt, { 0, NULL}, 0 }; - return recv_internal (&wsamsg, false); + return recv_internal (&wsamsg); } extern "C" { @@ -1375,32 +1376,28 @@ get_ext_funcptr (SOCKET sock, void *funcptr) } inline ssize_t -fhandler_socket::recv_internal (LPWSAMSG wsamsg, bool use_recvmsg) +fhandler_socket::recv_internal (LPWSAMSG wsamsg) { ssize_t res = 0; DWORD ret = 0, wret; int evt_mask = FD_READ | ((wsamsg->dwFlags & MSG_OOB) ? FD_OOB : 0); LPWSABUF &wsabuf = wsamsg->lpBuffers; ULONG &wsacnt = wsamsg->dwBufferCount; + bool use_recvmsg = false; static NO_COPY LPFN_WSARECVMSG WSARecvMsg; DWORD wait_flags = wsamsg->dwFlags; bool waitall = !!(wait_flags & MSG_WAITALL); wsamsg->dwFlags &= (MSG_OOB | MSG_PEEK | MSG_DONTROUTE); - if (use_recvmsg) + if (wsamsg->Control.len > 0) { if (!WSARecvMsg && get_ext_funcptr (get_socket (), &WSARecvMsg) == SOCKET_ERROR) { - if (wsamsg->Control.len > 0) - { - set_winsock_errno (); - return SOCKET_ERROR; - } - use_recvmsg = false; + set_winsock_errno (); + return SOCKET_ERROR; } - else /* Only MSG_PEEK is supported by WSARecvMsg. */ - wsamsg->dwFlags &= MSG_PEEK; + use_recvmsg = true; } if (waitall) { @@ -1507,7 +1504,7 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags, &wsabuf, 1, { 0, NULL}, flags }; - ssize_t ret = recv_internal (&wsamsg, false); + ssize_t ret = recv_internal (&wsamsg); if (fromlen) *fromlen = wsamsg.namelen; return ret; @@ -1522,12 +1519,12 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags) /* Disappointing but true: Even if WSARecvMsg is supported, it's only supported for datagram and raw sockets. */ - bool use_recvmsg = true; - if (get_socket_type () == SOCK_STREAM || get_addr_family () == AF_LOCAL - || !wincap.has_recvmsg ()) + if (!wincap.has_recvmsg () || get_socket_type () == SOCK_STREAM + || get_addr_family () == AF_LOCAL) { - use_recvmsg = false; msg->msg_controllen = 0; + if (!CYGWIN_VERSION_CHECK_FOR_USING_ANCIENT_MSGHDR) + msg->msg_flags = 0; } WSABUF wsabuf[msg->msg_iovlen]; @@ -1542,7 +1539,7 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags) wsabuf, msg->msg_iovlen, { msg->msg_controllen, (char *) msg->msg_control }, flags }; - ssize_t ret = recv_internal (&wsamsg, use_recvmsg); + ssize_t ret = recv_internal (&wsamsg); if (ret >= 0) { msg->msg_namelen = wsamsg.namelen; @@ -1781,7 +1778,7 @@ fhandler_socket::close () res = -1; break; } - if (cygwait (10) == WAIT_SIGNALED) + if (WaitForSingleObject (signal_arrived, 10) == WAIT_OBJECT_0) { set_errno (EINTR); res = -1; diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc index 855fd5dfd..da2458217 100644 --- a/winsup/cygwin/fhandler_tape.cc +++ b/winsup/cygwin/fhandler_tape.cc @@ -1147,13 +1147,26 @@ mtinfo::initialize () inline bool fhandler_dev_tape::_lock (bool cancelable) { + HANDLE w4[3] = { mt_mtx, signal_arrived, NULL }; + DWORD cnt = 2; + if (cancelable && (w4[2] = pthread::get_cancel_event ()) != NULL) + cnt = 3; /* O_NONBLOCK is only valid in a read or write call. Only those are cancelable. */ DWORD timeout = cancelable && is_nonblocking () ? 0 : INFINITE; - switch (cancelable_wait (mt_mtx, timeout, cw_sig | cw_cancel | cw_cancel_self)) +restart: + switch (WaitForMultipleObjects (cnt, w4, FALSE, timeout)) { case WAIT_OBJECT_0: return true; + case WAIT_OBJECT_0 + 1: + if (_my_tls.call_signal_handler ()) + goto restart; + set_errno (EINTR); + return false; + case WAIT_OBJECT_0 + 2: + pthread::static_cancel_self (); + /*NOTREACHED*/ case WAIT_TIMEOUT: set_errno (EAGAIN); return false; diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc index 18afacf1d..7fddba5b3 100644 --- a/winsup/cygwin/fhandler_termios.cc +++ b/winsup/cygwin/fhandler_termios.cc @@ -204,7 +204,7 @@ fhandler_termios::bg_check (int sig) { /* Don't raise a SIGTT* signal if we have already been interrupted by another signal. */ - if (cygwait ((DWORD) 0) != WAIT_SIGNALED) + if (WaitForSingleObject (signal_arrived, 0) != WAIT_OBJECT_0) { siginfo_t si = {0}; si.si_signo = sig; @@ -237,7 +237,7 @@ fhandler_termios::line_edit (const char *rptr, int nread, termios& ti) { c = *rptr++; - paranoid_printf ("char %0c", c); + termios_printf ("char %c", c); /* Check for special chars */ diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index c5b65c5b8..519558a3d 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -176,7 +176,7 @@ fhandler_pty_master::accept_input () DWORD rc; DWORD written = 0; - paranoid_printf ("about to write %d chars to slave", bytes_left); + termios_printf ("about to write %d chars to slave", bytes_left); rc = WriteFile (get_output_handle (), p, bytes_left, &written, NULL); if (!rc) { @@ -281,7 +281,7 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on goto out; } pthread_testcancel (); - if (cancelable_wait (NULL, 10, cw_sig_eintr) == WAIT_SIGNALED + if (WaitForSingleObject (signal_arrived, 10) == WAIT_OBJECT_0 && !_my_tls.call_signal_handler ()) { set_errno (EINTR); diff --git a/winsup/cygwin/fhandler_windows.cc b/winsup/cygwin/fhandler_windows.cc index cb22416df..c89d98e16 100644 --- a/winsup/cygwin/fhandler_windows.cc +++ b/winsup/cygwin/fhandler_windows.cc @@ -96,47 +96,43 @@ fhandler_windows::read (void *buf, size_t& len) return; } - HANDLE w4[3] = { get_handle (), }; - set_signal_arrived here (w4[1]); + HANDLE w4[3] = { get_handle (), signal_arrived, NULL }; DWORD cnt = 2; if ((w4[cnt] = pthread::get_cancel_event ()) != NULL) ++cnt; - for (;;) +restart: + switch (MsgWaitForMultipleObjectsEx (cnt, w4, + is_nonblocking () ? 0 : INFINITE, + QS_ALLINPUT | QS_ALLPOSTMESSAGE, + MWMO_INPUTAVAILABLE)) { - switch (MsgWaitForMultipleObjectsEx (cnt, w4, - is_nonblocking () ? 0 : INFINITE, - QS_ALLINPUT | QS_ALLPOSTMESSAGE, - MWMO_INPUTAVAILABLE)) + case WAIT_OBJECT_0: + if (!PeekMessageW (ptr, hWnd_, 0, 0, PM_REMOVE)) { - case WAIT_OBJECT_0: - if (!PeekMessageW (ptr, hWnd_, 0, 0, PM_REMOVE)) - { - len = (size_t) -1; - __seterrno (); - } - else if (ptr->message == WM_QUIT) - len = 0; - else - len = sizeof (MSG); - break; - case WAIT_OBJECT_0 + 1: - if (_my_tls.call_signal_handler ()) - continue; - len = (size_t) -1; - set_errno (EINTR); - break; - case WAIT_OBJECT_0 + 2: - pthread::static_cancel_self (); - break; - case WAIT_TIMEOUT: - len = (size_t) -1; - set_errno (EAGAIN); - break; - default: len = (size_t) -1; __seterrno (); - break; } + else if (ptr->message == WM_QUIT) + len = 0; + else + len = sizeof (MSG); + break; + case WAIT_OBJECT_0 + 1: + if (_my_tls.call_signal_handler ()) + goto restart; + len = (size_t) -1; + set_errno (EINTR); + break; + case WAIT_OBJECT_0 + 2: + pthread::static_cancel_self (); + break; + case WAIT_TIMEOUT: + len = (size_t) -1; + set_errno (EAGAIN); + break; + default: + len = (size_t) -1; + __seterrno (); break; } } diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc index 4d683cfd4..0a4bdf0d1 100644 --- a/winsup/cygwin/flock.cc +++ b/winsup/cygwin/flock.cc @@ -1247,7 +1247,7 @@ lf_setlock (lockf_t *lock, inode_t *node, lockf_t **clean, HANDLE fhdl) timeout = 100L; DWORD WAIT_SIGNAL_ARRIVED = WAIT_OBJECT_0 + wait_count; - set_signal_arrived here (w4[wait_count++]); + w4[wait_count++] = signal_arrived; DWORD WAIT_THREAD_CANCELED = WAIT_TIMEOUT + 1; HANDLE cancel_event = pthread::get_cancel_event (); diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef index 5cc06f76c..a76711279 100755 --- a/winsup/cygwin/gendef +++ b/winsup/cygwin/gendef @@ -162,23 +162,62 @@ __sigbe: # return here after cygwin syscall .global _sigdelayed _sigdelayed: - pushl %ebp - movl %esp,%ebp + pushl %ebp + movl %esp,%ebp pushf - pushl %esi - pushl %edi - pushl %edx - pushl %ecx - pushl %ebx - pushl %eax - movl %fs:4,%ebx # get tls - pushl $tls::saved_errno(%ebx) # saved errno - - movl \$$tls::start_offset,%eax # point to beginning - addl %ebx,%eax # of tls block - call __ZN7_cygtls19call_signal_handlerEv # call handler + pushl %esi + pushl %edi + pushl %edx + pushl %ecx + pushl %ebx + pushl %eax + movl %fs:4,%ebx +1: movl \$1,%eax + xchgl %eax,$tls::stacklock(%ebx) + movl %eax,$tls::spinning(%ebx) # flag if we are waiting for lock + # If %eax is 1 then someone else has + # the lock but we want to flag that + # we're waiting for it. If %eax is 0 + # then we're not spinning and 0 will + # reflect that. + testl %eax,%eax + jz 2f + call _yield + jmp 1b +2: incl $tls::incyg(%ebx) + movl $tls::sig(%ebx),%eax + testl %eax,%eax + jz leave # call_signal_handler may have beat us + # to it + pushl $tls::saved_errno(%ebx) # saved errno + call _set_process_mask_delta + pushl %eax + + # fill out handler arguments + xorl %eax,%eax # ucontext_t (currently not set) + pushl %eax + leal $tls::infodata(%ebx),%eax + pushl %eax # siginfo + pushl $tls::sig(%ebx) # signal number + + pushl \$_sigreturn # where to return + pushl $tls::func(%ebx) # user-supplied signal func + cmpl \$0,$tls::threadkill(%ebx)#pthread_kill signal? + jnz 4f # yes. callee clears signal number + movl \$0,$tls::sig(%ebx) # zero the signal number as a + # flag to the signal handler thread + # that it is ok to set up sigsave +4: decl $tls::incyg(%ebx) + decl $tls::stacklock(%ebx) + ret # return via signal handler + + .global _sigreturn +_sigreturn: + movl %fs:4,%ebx + incl $tls::incyg(%ebx) + addl \$12,%esp # remove arguments + call _set_process_mask\@4 - movl %fs:4,%ebx # reget tls 1: movl \$1,%eax # potential lock value xchgl %eax,$tls::stacklock(%ebx) # see if we can grab it movl %eax,$tls::spinning(%ebx) # flag if we are waiting for lock @@ -255,7 +294,7 @@ stabilize_sig_stack: cmpl \$0,$tls::sig(%ebx) jz 3f decl $tls::stacklock(%ebx) # unlock - movl \$$tls::start_offset,%eax # point to beginning + movl \$-$tls::sizeof__cygtls,%eax # point to beginning addl %ebx,%eax # of tls block call __ZN7_cygtls19call_signal_handlerEv jmp 1b diff --git a/winsup/cygwin/gentls_offsets b/winsup/cygwin/gentls_offsets index de9f1b993..2c96487d4 100755 --- a/winsup/cygwin/gentls_offsets +++ b/winsup/cygwin/gentls_offsets @@ -14,10 +14,10 @@ my $struct = ''; my @fields = (); my $def = ''; $tls = join('', <TLS>); -$tls =~ s/\A.*\n#pragma once\n//os; $tls =~ s/\n[^\n]*gentls_offsets[^\n]*\n(.+)\Z/$1/os; my $pre = $`; substr($tls, 0, length($pre)) = ''; +$pre =~ s/\n#ifndef _[^\n]+\n/\n/os; $pre .= "\n//*/"; $tls =~ s%/\*\s*gentls_offsets.*?/\*\s*gentls_offsets\s*\*/%%ogs; foreach ($tls =~ /^.*\n/mg) { @@ -60,7 +60,7 @@ main(int argc, char **argv) # define poffset(f) (((char *) &(foo->f)) - ((char *) foo)) EOF print TMP 'puts ("//;# autogenerated: Do not edit.\n");', "\n\n"; - print TMP "printf (\"//; \$tls::start_offset = -%d;\\n\", CYGTLS_PADSIZE);\n"; + print TMP "printf (\"//; \$tls::sizeof_$struct = %d;\\n\", sizeof($struct\));\n"; for my $f (@fields) { print TMP ' printf ("//; $tls::', $f, ' = %d;\n", ', "offset($f));\n"; print TMP ' printf ("//; $tls::p', $f, ' = %d;\n", ', "poffset($f));\n"; diff --git a/winsup/cygwin/include/cygwin/socket.h b/winsup/cygwin/include/cygwin/socket.h index 678b1031a..921172ecf 100644 --- a/winsup/cygwin/include/cygwin/socket.h +++ b/winsup/cygwin/include/cygwin/socket.h @@ -205,9 +205,6 @@ struct OLD_msghdr #define MSG_NOSIGNAL 0x20 /* Don't raise SIGPIPE */ #define MSG_TRUNC 0x0100 /* Normal data truncated */ #define MSG_CTRUNC 0x0200 /* Control data truncated */ -/* Windows-specific flag values returned by recvmsg. */ -#define MSG_BCAST 0x0400 /* Broadcast datagram */ -#define MSG_MCAST 0x0800 /* Multicast datagram */ /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */ #define SOL_IP 0 diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 34f501f13..7b85d881b 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -43,7 +43,7 @@ details. */ changes to the DLL and is mainly informative in nature. */ #define CYGWIN_VERSION_DLL_MAJOR 1007 -#define CYGWIN_VERSION_DLL_MINOR 17 +#define CYGWIN_VERSION_DLL_MINOR 16 /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are incompatible. */ diff --git a/winsup/cygwin/include/inttypes.h b/winsup/cygwin/include/inttypes.h index cc1d8970a..b24037eb4 100644 --- a/winsup/cygwin/include/inttypes.h +++ b/winsup/cygwin/include/inttypes.h @@ -1,6 +1,6 @@ /* inttypes.h - fixed size integer types - Copyright 2003, 2005, 2009, 2010, 2012 Red Hat, Inc. + Copyright 2003, 2009, 2010 Red Hat, Inc. This file is part of Cygwin. @@ -15,238 +15,211 @@ details. */ #define __need_wchar_t #include <stddef.h> -/* C99 requires that in C++ the following macros should be defined only - if requested. */ -#if !defined (__cplusplus) || defined (__STDC_FORMAT_MACROS) \ - || defined (__INSIDE_CYGWIN__) - -#ifdef __x86_64__ -#define __PRI64 "l" -#define __PRIFAST "l" -#define __PRIPTR "l" -#else -#define __PRI64 "ll" -#define __PRIFAST -#define __PRIPTR -#endif - /* fprintf() macros for signed integers */ #define PRId8 "d" #define PRId16 "d" #define PRId32 "d" -#define PRId64 __PRI64 "d" +#define PRId64 "lld" #define PRIdLEAST8 "d" #define PRIdLEAST16 "d" #define PRIdLEAST32 "d" -#define PRIdLEAST64 __PRI64 "d" +#define PRIdLEAST64 "lld" #define PRIdFAST8 "d" -#define PRIdFAST16 __PRIFAST "d" -#define PRIdFAST32 __PRIFAST "d" -#define PRIdFAST64 __PRI64 "d" +#define PRIdFAST16 "d" +#define PRIdFAST32 "d" +#define PRIdFAST64 "lld" -#define PRIdMAX __PRI64 "d" -#define PRIdPTR __PRIPTR "d" +#define PRIdMAX "lld" +#define PRIdPTR "d" #define PRIi8 "i" #define PRIi16 "i" #define PRIi32 "i" -#define PRIi64 __PRI64 "i" +#define PRIi64 "lli" #define PRIiLEAST8 "i" #define PRIiLEAST16 "i" #define PRIiLEAST32 "i" -#define PRIiLEAST64 __PRI64 "i" +#define PRIiLEAST64 "lli" #define PRIiFAST8 "i" -#define PRIiFAST16 __PRIFAST "i" -#define PRIiFAST32 __PRIFAST "i" -#define PRIiFAST64 __PRI64 "i" +#define PRIiFAST16 "i" +#define PRIiFAST32 "i" +#define PRIiFAST64 "lli" -#define PRIiMAX __PRI64 "i" -#define PRIiPTR __PRIPTR "i" +#define PRIiMAX "lli" +#define PRIiPTR "i" /* fprintf() macros for unsigned integers */ #define PRIo8 "o" #define PRIo16 "o" #define PRIo32 "o" -#define PRIo64 __PRI64 "o" +#define PRIo64 "llo" #define PRIoLEAST8 "o" #define PRIoLEAST16 "o" #define PRIoLEAST32 "o" -#define PRIoLEAST64 __PRI64 "o" +#define PRIoLEAST64 "llo" #define PRIoFAST8 "o" -#define PRIoFAST16 __PRIFAST "o" -#define PRIoFAST32 __PRIFAST "o" -#define PRIoFAST64 __PRI64 "o" +#define PRIoFAST16 "o" +#define PRIoFAST32 "o" +#define PRIoFAST64 "llo" -#define PRIoMAX __PRI64 "o" -#define PRIoPTR __PRIPTR "o" +#define PRIoMAX "llo" +#define PRIoPTR "o" #define PRIu8 "u" #define PRIu16 "u" #define PRIu32 "u" -#define PRIu64 __PRI64 "u" +#define PRIu64 "llu" #define PRIuLEAST8 "u" #define PRIuLEAST16 "u" #define PRIuLEAST32 "u" -#define PRIuLEAST64 __PRI64 "u" +#define PRIuLEAST64 "llu" #define PRIuFAST8 "u" -#define PRIuFAST16 __PRIFAST "u" -#define PRIuFAST32 __PRIFAST "u" -#define PRIuFAST64 __PRI64 "u" +#define PRIuFAST16 "u" +#define PRIuFAST32 "u" +#define PRIuFAST64 "llu" -#define PRIuMAX __PRI64 "u" -#define PRIuPTR __PRIPTR "u" +#define PRIuMAX "llu" +#define PRIuPTR "u" #define PRIx8 "x" #define PRIx16 "x" #define PRIx32 "x" -#define PRIx64 __PRI64 "x" +#define PRIx64 "llx" #define PRIxLEAST8 "x" #define PRIxLEAST16 "x" #define PRIxLEAST32 "x" -#define PRIxLEAST64 __PRI64 "x" +#define PRIxLEAST64 "llx" #define PRIxFAST8 "x" -#define PRIxFAST16 __PRIFAST "x" -#define PRIxFAST32 __PRIFAST "x" -#define PRIxFAST64 __PRI64 "x" +#define PRIxFAST16 "x" +#define PRIxFAST32 "x" +#define PRIxFAST64 "llx" -#define PRIxMAX __PRI64 "x" -#define PRIxPTR __PRIPTR "x" +#define PRIxMAX "llx" +#define PRIxPTR "x" #define PRIX8 "X" #define PRIX16 "X" #define PRIX32 "X" -#define PRIX64 __PRI64 "X" +#define PRIX64 "llX" #define PRIXLEAST8 "X" #define PRIXLEAST16 "X" #define PRIXLEAST32 "X" -#define PRIXLEAST64 __PRI64 "X" +#define PRIXLEAST64 "llX" #define PRIXFAST8 "X" -#define PRIXFAST16 __PRIFAST "X" -#define PRIXFAST32 __PRIFAST "X" -#define PRIXFAST64 __PRI64 "X" +#define PRIXFAST16 "X" +#define PRIXFAST32 "X" +#define PRIXFAST64 "llX" -#define PRIXMAX __PRI64 "X" -#define PRIXPTR __PRIPTR "X" +#define PRIXMAX "llX" +#define PRIXPTR "X" /* fscanf() macros for signed integers */ -#ifdef __x86_64__ -#define __SCN64 "l" -#define __SCNFAST "l" -#define __SCNPTR "l" -#else -#define __SCN64 "ll" -#define __SCNFAST -#define __SCNPTR -#endif - #define SCNd8 "hhd" #define SCNd16 "hd" #define SCNd32 "d" -#define SCNd64 __SCN64 "d" +#define SCNd64 "lld" #define SCNdLEAST8 "hhd" #define SCNdLEAST16 "hd" #define SCNdLEAST32 "d" -#define SCNdLEAST64 __SCN64 "d" +#define SCNdLEAST64 "lld" #define SCNdFAST8 "hhd" -#define SCNdFAST16 __SCNFAST "d" -#define SCNdFAST32 __SCNFAST "d" -#define SCNdFAST64 __SCN64 "d" +#define SCNdFAST16 "d" +#define SCNdFAST32 "d" +#define SCNdFAST64 "lld" -#define SCNdMAX __SCN64 "d" -#define SCNdPTR __SCNPTR "d" +#define SCNdMAX "lld" +#define SCNdPTR "d" #define SCNi8 "hhi" #define SCNi16 "hi" #define SCNi32 "i" -#define SCNi64 __SCN64 "i" +#define SCNi64 "lli" #define SCNiLEAST8 "hhi" #define SCNiLEAST16 "hi" #define SCNiLEAST32 "i" -#define SCNiLEAST64 __SCN64 "i" +#define SCNiLEAST64 "lli" #define SCNiFAST8 "hhi" -#define SCNiFAST16 __SCNFAST "i" -#define SCNiFAST32 __SCNFAST "i" -#define SCNiFAST64 __SCN64 "i" +#define SCNiFAST16 "i" +#define SCNiFAST32 "i" +#define SCNiFAST64 "lli" -#define SCNiMAX __SCN64 "i" -#define SCNiPTR __SCNPTR "i" +#define SCNiMAX "lli" +#define SCNiPTR "i" /* fscanf() macros for unsigned integers */ #define SCNo8 "hho" #define SCNo16 "ho" #define SCNo32 "o" -#define SCNo64 __SCN64 "o" +#define SCNo64 "llo" #define SCNoLEAST8 "hho" #define SCNoLEAST16 "ho" #define SCNoLEAST32 "o" -#define SCNoLEAST64 __SCN64 "o" +#define SCNoLEAST64 "llo" #define SCNoFAST8 "hho" -#define SCNoFAST16 __SCNFAST "o" -#define SCNoFAST32 __SCNFAST "o" -#define SCNoFAST64 __SCN64 "o" +#define SCNoFAST16 "o" +#define SCNoFAST32 "o" +#define SCNoFAST64 "llo" -#define SCNoMAX __SCN64 "o" -#define SCNoPTR __SCNPTR "o" +#define SCNoMAX "llo" +#define SCNoPTR "o" #define SCNu8 "hhu" #define SCNu16 "hu" #define SCNu32 "u" -#define SCNu64 __SCN64 "u" +#define SCNu64 "llu" #define SCNuLEAST8 "hhu" #define SCNuLEAST16 "hu" #define SCNuLEAST32 "u" -#define SCNuLEAST64 __SCN64 "u" +#define SCNuLEAST64 "llu" #define SCNuFAST8 "hhu" -#define SCNuFAST16 __SCNFAST "u" -#define SCNuFAST32 __SCNFAST "u" -#define SCNuFAST64 __SCN64 "u" +#define SCNuFAST16 "u" +#define SCNuFAST32 "u" +#define SCNuFAST64 "llu" -#define SCNuMAX __SCN64 "u" -#define SCNuPTR __SCNPTR "u" +#define SCNuMAX "llu" +#define SCNuPTR "u" #define SCNx8 "hhx" #define SCNx16 "hx" #define SCNx32 "x" -#define SCNx64 __SCN64 "x" +#define SCNx64 "llx" #define SCNxLEAST8 "hhx" #define SCNxLEAST16 "hx" #define SCNxLEAST32 "x" -#define SCNxLEAST64 __SCN64 "x" +#define SCNxLEAST64 "llx" #define SCNxFAST8 "hhx" -#define SCNxFAST16 __SCNFAST "x" -#define SCNxFAST32 __SCNFAST "x" -#define SCNxFAST64 __SCN64 "x" - -#define SCNxMAX __SCN64 "x" -#define SCNxPTR __SCNPTR "x" +#define SCNxFAST16 "x" +#define SCNxFAST32 "x" +#define SCNxFAST64 "llx" -#endif /* !__cplusplus || __STDC_FORMAT_MACROS || __INSIDE_CYGWIN__ */ +#define SCNxMAX "llx" +#define SCNxPTR "x" #ifdef __cplusplus extern "C" { diff --git a/winsup/cygwin/include/stdint.h b/winsup/cygwin/include/stdint.h index 070f7f306..12f16e220 100644 --- a/winsup/cygwin/include/stdint.h +++ b/winsup/cygwin/include/stdint.h @@ -1,6 +1,6 @@ /* stdint.h - integer types - Copyright 2003, 2006, 2007, 2008, 2009, 2010, 2012 Red Hat, Inc. + Copyright 2003, 2006, 2007 Red Hat, Inc. This file is part of Cygwin. @@ -18,12 +18,8 @@ details. */ typedef signed char int8_t; typedef short int16_t; typedef int int32_t; -#ifdef __x86_64__ -typedef long int64_t; -#else typedef long long int64_t; #endif -#endif typedef unsigned char uint8_t; typedef unsigned short uint16_t; @@ -31,190 +27,114 @@ typedef unsigned short uint16_t; #define __uint32_t_defined typedef unsigned int uint32_t; #endif -#ifdef __x86_64__ -typedef unsigned long uint64_t; -#else typedef unsigned long long uint64_t; -#endif /* Minimum-width integer types */ typedef signed char int_least8_t; typedef short int_least16_t; typedef int int_least32_t; -#ifdef __x86_64__ -typedef long int_least64_t; -#else typedef long long int_least64_t; -#endif typedef unsigned char uint_least8_t; typedef unsigned short uint_least16_t; typedef unsigned int uint_least32_t; -#ifdef __x86_64__ -typedef unsigned long uint_least64_t; -#else typedef unsigned long long uint_least64_t; -#endif /* Fastest minimum-width integer types */ typedef signed char int_fast8_t; -#ifdef __x86_64__ -typedef long int_fast16_t; -typedef long int_fast32_t; -typedef long int_fast64_t; -#else typedef int int_fast16_t; typedef int int_fast32_t; typedef long long int_fast64_t; -#endif typedef unsigned char uint_fast8_t; -#ifdef __x86_64__ -typedef unsigned long uint_fast16_t; -typedef unsigned long uint_fast32_t; -typedef unsigned long uint_fast64_t; -#else typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; typedef unsigned long long uint_fast64_t; -#endif /* Integer types capable of holding object pointers */ #ifndef __intptr_t_defined #define __intptr_t_defined -#ifdef __x86_64__ -typedef long intptr_t; -#else typedef int intptr_t; #endif -#endif -#ifdef __x86_64__ -typedef unsigned long uintptr_t; -#else typedef unsigned int uintptr_t; -#endif /* Greatest-width integer types */ -#ifdef __x86_64__ -typedef long intmax_t; -typedef unsigned long uintmax_t; -#else typedef long long intmax_t; typedef unsigned long long uintmax_t; -#endif - -/* C99 requires that in C++ the following macros should be defined only - if requested. */ -#if !defined (__cplusplus) || defined (__STDC_LIMIT_MACROS) \ - || defined (__INSIDE_CYGWIN__) - -#if __x86_64__ -# define __I64(n) n ## L -# define __U64(n) n ## UL -#else -# define __I64(n) n ## LL -# define __U64(n) n ## ULL -#endif /* Limits of exact-width integer types */ #define INT8_MIN (-128) #define INT16_MIN (-32768) #define INT32_MIN (-2147483647 - 1) -#define INT64_MIN (-__I64(9223372036854775807) - 1) +#define INT64_MIN (-9223372036854775807LL - 1LL) #define INT8_MAX (127) #define INT16_MAX (32767) #define INT32_MAX (2147483647) -#define INT64_MAX (__I64(9223372036854775807)) +#define INT64_MAX (9223372036854775807LL) #define UINT8_MAX (255) #define UINT16_MAX (65535) #define UINT32_MAX (4294967295U) -#define UINT64_MAX (__U64(18446744073709551615)) +#define UINT64_MAX (18446744073709551615ULL) /* Limits of minimum-width integer types */ #define INT_LEAST8_MIN (-128) #define INT_LEAST16_MIN (-32768) #define INT_LEAST32_MIN (-2147483647 - 1) -#define INT_LEAST64_MIN (-__I64(9223372036854775807) - 1) +#define INT_LEAST64_MIN (-9223372036854775807LL - 1LL) #define INT_LEAST8_MAX (127) #define INT_LEAST16_MAX (32767) #define INT_LEAST32_MAX (2147483647) -#define INT_LEAST64_MAX (__I64(9223372036854775807)) +#define INT_LEAST64_MAX (9223372036854775807LL) #define UINT_LEAST8_MAX (255) #define UINT_LEAST16_MAX (65535) #define UINT_LEAST32_MAX (4294967295U) -#define UINT_LEAST64_MAX (__U64(18446744073709551615)) +#define UINT_LEAST64_MAX (18446744073709551615ULL) /* Limits of fastest minimum-width integer types */ #define INT_FAST8_MIN (-128) -#ifdef __x86_64__ -#define INT_FAST16_MIN (-__I64(9223372036854775807) - 1) -#define INT_FAST32_MIN (-__I64(9223372036854775807) - 1) -#else #define INT_FAST16_MIN (-2147483647 - 1) #define INT_FAST32_MIN (-2147483647 - 1) -#endif -#define INT_FAST64_MIN (-__I64(9223372036854775807) - 1) +#define INT_FAST64_MIN (-9223372036854775807LL - 1LL) #define INT_FAST8_MAX (127) -#ifdef __x86_64__ -#define INT_FAST16_MAX (__I64(9223372036854775807)) -#define INT_FAST32_MAX (__I64(9223372036854775807)) -#else #define INT_FAST16_MAX (2147483647) #define INT_FAST32_MAX (2147483647) -#endif -#define INT_FAST64_MAX (__I64(9223372036854775807)) +#define INT_FAST64_MAX (9223372036854775807LL) #define UINT_FAST8_MAX (255) -#ifdef __x86_64__ -#define UINT_FAST16_MAX (__U64(18446744073709551615)) -#define UINT_FAST32_MAX (__U64(18446744073709551615)) -#else #define UINT_FAST16_MAX (4294967295U) #define UINT_FAST32_MAX (4294967295U) -#endif -#define UINT_FAST64_MAX (__U64(18446744073709551615)) +#define UINT_FAST64_MAX (18446744073709551615ULL) /* Limits of integer types capable of holding object pointers */ -#ifdef __x86_64__ -#define INTPTR_MIN (-__I64(9223372036854775807) - 1) -#define INTPTR_MAX (__I64(9223372036854775807) -#define UINTPTR_MAX (__U64(18446744073709551615)) -#else #define INTPTR_MIN (-2147483647 - 1) #define INTPTR_MAX (2147483647) #define UINTPTR_MAX (4294967295U) -#endif /* Limits of greatest-width integer types */ -#define INTMAX_MIN (-__I64(9223372036854775807) - 1) -#define INTMAX_MAX (__I64(9223372036854775807)) -#define UINTMAX_MAX (__U64(18446744073709551615)) +#define INTMAX_MIN (-9223372036854775807LL - 1LL) +#define INTMAX_MAX (9223372036854775807LL) +#define UINTMAX_MAX (18446744073709551615ULL) /* Limits of other integer types */ #ifndef PTRDIFF_MIN -#ifdef __x86_64__ -#define PTRDIFF_MIN (-9223372036854775807L - 1) -#define PTRDIFF_MAX (9223372036854775807L) -#else #define PTRDIFF_MIN (-2147483647 - 1) #define PTRDIFF_MAX (2147483647) #endif -#endif #ifndef SIG_ATOMIC_MIN #define SIG_ATOMIC_MIN (-2147483647 - 1) @@ -224,12 +144,8 @@ typedef unsigned long long uintmax_t; #endif #ifndef SIZE_MAX -#ifdef __x86_64__ -#define SIZE_MAX (18446744073709551615UL) -#else #define SIZE_MAX (4294967295U) #endif -#endif #ifndef WCHAR_MIN #ifdef __WCHAR_MIN__ @@ -246,43 +162,21 @@ typedef unsigned long long uintmax_t; #define WINT_MAX (4294967295U) #endif -#endif /* !__cplusplus || __STDC_LIMIT_MACROS || __INSIDE_CYGWIN__ */ - -/* C99 requires that in C++ the following macros should be defined only - if requested. */ -#if !defined (__cplusplus) || defined (__STDC_CONSTANT_MACROS) \ - || defined (__INSIDE_CYGWIN__) - /* Macros for minimum-width integer constant expressions */ #define INT8_C(x) x #define INT16_C(x) x #define INT32_C(x) x -#ifdef __x86_64__ -#define INT64_C(x) x ## L -#else #define INT64_C(x) x ## LL -#endif #define UINT8_C(x) x #define UINT16_C(x) x #define UINT32_C(x) x ## U -#ifdef __x86_64__ -#define UINT64_C(x) x ## UL -#else #define UINT64_C(x) x ## ULL -#endif /* Macros for greatest-width integer constant expressions */ -#ifdef __x86_64__ -#define INTMAX_C(x) x ## L -#define UINTMAX_C(x) x ## UL -#else #define INTMAX_C(x) x ## LL #define UINTMAX_C(x) x ## ULL -#endif - -#endif /* !__cplusplus || __STDC_CONSTANT_MACROS || __INSIDE_CYGWIN__ */ #endif /* _STDINT_H */ diff --git a/winsup/cygwin/include/sys/wait.h b/winsup/cygwin/include/sys/wait.h index be3e56fd2..5dea7283a 100644 --- a/winsup/cygwin/include/sys/wait.h +++ b/winsup/cygwin/include/sys/wait.h @@ -1,6 +1,6 @@ /* sys/wait.h - Copyright 1997, 1998, 2001, 2002, 2003, 2004, 2006, 2011, 2012 Red Hat, Inc. + Copyright 1997, 1998, 2001, 2002, 2003, 2004, 2006, 2011 Red Hat, Inc. This file is part of Cygwin. @@ -44,10 +44,6 @@ pid_t waitpid (pid_t __pid, __wait_status_ptr_t __status, int __options); pid_t wait3 (__wait_status_ptr_t __status, int __options, struct rusage *__rusage); pid_t wait4 (pid_t __pid, __wait_status_ptr_t __status, int __options, struct rusage *__rusage); -#ifdef _COMPILING_NEWLIB -pid_t _wait (__wait_status_ptr_t __status); -#endif - union wait { int w_status; diff --git a/winsup/cygwin/lib/crt0.h b/winsup/cygwin/lib/crt0.h index 878db05ed..461ea9b2e 100644 --- a/winsup/cygwin/lib/crt0.h +++ b/winsup/cygwin/lib/crt0.h @@ -12,7 +12,7 @@ details. */ extern "C" { #endif -#include "winlean.h" +#include <windows.h> struct per_process; typedef int (*MainFunc) (int argc, char *argv[], char **env); int __stdcall _cygwin_crt0_common (MainFunc, struct per_process *); diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h index 2ca6a5ab3..dda3c2d20 100644 --- a/winsup/cygwin/ntdll.h +++ b/winsup/cygwin/ntdll.h @@ -9,7 +9,8 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#pragma once +#ifndef _NTDLL_H +#define _NTDLL_H 1 #ifndef __MINGW64_VERSION_MAJOR # include <ddk/ntstatus.h> @@ -1424,3 +1425,4 @@ extern "C" } } #endif +#endif /*_NTDLL_H*/ diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index d1a881c39..0a6cad76c 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1153,7 +1153,7 @@ out: if (opt & PC_CTTY) path_flags |= PATH_CTTY; - if (opt & PC_POSIX) + if ((opt & PC_POSIX)) { if (tail < path_end && tail > path_copy + 1) *tail = '/'; @@ -4311,15 +4311,11 @@ etc::test_file_change (int n) bool etc::dir_changed (int n) { - /* io MUST be static because NtNotifyChangeDirectoryFile works asynchronously. - It may write into io after the function has left, which may result in all - sorts of stack corruption. */ - static IO_STATUS_BLOCK io NO_COPY; - static HANDLE changed_h NO_COPY; - if (!change_possible[n]) { + static HANDLE changed_h NO_COPY; NTSTATUS status; + IO_STATUS_BLOCK io; if (!changed_h) { diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index cb7480a58..ba229fe4b 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -438,6 +438,7 @@ class etc { friend class dtable; static int curr_ix; + static HANDLE changed_h; static bool change_possible[MAX_ETC_FILES + 1]; static OBJECT_ATTRIBUTES fn[MAX_ETC_FILES + 1]; static LARGE_INTEGER last_modified[MAX_ETC_FILES + 1]; diff --git a/winsup/cygwin/poll.cc b/winsup/cygwin/poll.cc index cbb68bf04..ea86ab5aa 100644 --- a/winsup/cygwin/poll.cc +++ b/winsup/cygwin/poll.cc @@ -152,9 +152,9 @@ ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts, ? -1 : (timeout_ts->tv_sec * 1000 + timeout_ts->tv_nsec / 1000000); if (sigmask) - set_signal_mask (_my_tls.sigmask, *sigmask); + set_signal_mask (*sigmask, _my_tls.sigmask); int ret = poll (fds, nfds, timeout); if (sigmask) - set_signal_mask (_my_tls.sigmask, oldset); + set_signal_mask (oldset, _my_tls.sigmask); return ret; } diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc index d09abf190..b9d224e43 100644 --- a/winsup/cygwin/posix_ipc.cc +++ b/winsup/cygwin/posix_ipc.cc @@ -119,12 +119,14 @@ ipc_mutex_init (HANDLE *pmtx, const char *name) static int ipc_mutex_lock (HANDLE mtx) { - switch (cancelable_wait (mtx, cw_infinite, cw_sig_eintr | cw_cancel | cw_cancel_self)) + HANDLE h[2] = { mtx, signal_arrived }; + + switch (WaitForMultipleObjects (2, h, FALSE, INFINITE)) { case WAIT_OBJECT_0: case WAIT_ABANDONED_0: return 0; - case WAIT_SIGNALED: + case WAIT_OBJECT_0 + 1: set_errno (EINTR); return 1; default: @@ -172,12 +174,11 @@ ipc_cond_init (HANDLE *pevt, const char *name, char sr) static int ipc_cond_timedwait (HANDLE evt, HANDLE mtx, const struct timespec *abstime) { - HANDLE w4[4] = { evt, }; + HANDLE w4[4] = { evt, signal_arrived, NULL, NULL }; DWORD cnt = 2; DWORD timer_idx = 0; int ret = 0; - set_signal_arrived here (w4[1]); if ((w4[cnt] = pthread::get_cancel_event ()) != NULL) ++cnt; if (abstime) diff --git a/winsup/cygwin/release/1.7.10 b/winsup/cygwin/release/1.7.10 new file mode 100644 index 000000000..33a2f20dd --- /dev/null +++ b/winsup/cygwin/release/1.7.10 @@ -0,0 +1,126 @@ +What's new: +----------- + +- New getconf tool for querying confstr(3), pathconf(3), sysconf(3), and + limits.h configuration. + +- New tzset utility to generate a POSIX-compatible TZ environment + variable from the Windows timezone settings. + +- The passwd tool now allows an administrator to use the -R command for + other user accounts: passwd -R username. + +- Experimental: Change the way sockets are created so that Cygwin always + circumvents so-called "layered service providers" (LSPs) starting with + Windows Vista. + +- signal handler functions are now dispatched in threads other than the + main thread. + +- Support NcFsd filesystem. + +- clock_gettime(3) and clock_getres(3) accept per-process and per-thread + CPU-time clocks, including CLOCK_PROCESS_CPUTIME_ID and + CLOCK_THREAD_CPUTIME_ID. + +- New pthread functions: + + - Spin Locks: pthread_spin_destroy, pthread_spin_init, pthread_spin_lock, + pthread_spin_trylock, pthread_spin_unlock. + + - Stack management: pthread_attr_getstack, pthread_attr_getstackaddr, + pthread_attr_getguardsize, pthread_attr_setstack, pthread_attr_setstackaddr, + pthread_attr_setguardsize, pthread_getattr_np. + + - Clock Selection: pthread_getcpuclockid, pthread_condattr_getclock, + pthread_condattr_setclock. + + - Scheduling: pthread_setschedprio. + + - Signalling: pthread_sigqueue. + +- Add /proc/devices, /proc/misc, /proc/sysvipc, /proc/swaps. + +- Make various system functions thread cancelation points per POSIX. + +- Add ioctl FIONREAD handling for non-sockets. + +- dlopen now supports the Glibc-specific RTLD_NODELETE and RTLD_NOOPEN flags. + +- The printf and wprintf families of functions now support the %m conversion + flag. + +- Execed processes now inherit the children of their predecessor. + +- Fifos have been rewritten and should now be more reliable. + +- GNU/glibc error.h error reporting functions: error, error_at_line, + error_message_count, error_one_per_line, error_print_progname. + +- C99 <tgmath.h> type-generic macros. + +- Other new API: clock_getcpuclockid, clock_nanosleep, clock_settime, __fpurge, + get_current_dir_name, getgrouplist, getpt, ppoll, psiginfo, psignal, + ptsname_r, sys_siglist, sysinfo. + +- cygwin_conv_path_list finally supports CCP_WIN_W_TO_POSIX and + CCP_POSIX_TO_WIN_W conversions. + + +What changed: +------------- + +- Drop support for Windows NT4. + +- The CYGWIN=tty mode using pipes to communicate with the console in a pseudo + tty-like mode has been removed. Either just use the normal Windows console + as is, or use a terminal application like mintty. + +- The CYGWIN environment variable options "envcache", "strip_title", "title", + "tty", and "upcaseenv" have been removed. + +- New heap management. Drop registry setting "heap_chunk_in_mb" in favor of + a new per-executable setting in the executable file header which can be set + using the peflags tool. Drop registry setting "heap_slop_in_mb" entirely. + +- Revamp console and pseudo tty handling. Rename /dev/ttyX to /dev/consX, + /dev/ttyX to /dev/ptyX. + +- Improve fork/exec performance on 64 bit systems. + +- Improve Ctrl-C handling in console. + +- Try harder to let fork not fail if DLLs are moved in memory which should, + in some cases, minimize the need for rebaseall. + +- Try harder to send SIGHUP to children when process group leader fails. + +- Deal with Windows problem where non-blocking pipe I/O was not flushed + properly on close. + +- Attempt to regularize most syscall-related strace output. + +- Improve behavior of Cygwin when started from a 64-bit process, especially + under Windows 2003. + +- Improve multi-thread/reentrancy safety with syscalls that deal with fds. + +- dlopen can now find "cygFOO.dll", even if the caller specified "libFOO.so". + This is supposed to support applications which are no aware of Windows DLLs. + +- Make accept(2), poll(2) and shutdown(2) behave more like on Linux. + +- Raise max number of mount points from 30 to 64. + +- Output of /proc/maps is closer to what Linux prints and much more useful to + examine process VM layout. + +- /proc/loadavg now shows the number of currently running processes and the + total number of processes. + +- /proc/version now shows the username of whomever compiled the Cygwin DLL + as well as the version of GCC used when compiling. + +- Various assorted bugfixes and improvements. + +- Preliminary, no guarantee, may be broken in subtle ways, Windows 8 support. diff --git a/winsup/cygwin/release/1.7.11 b/winsup/cygwin/release/1.7.11 new file mode 100644 index 000000000..d4e0911d2 --- /dev/null +++ b/winsup/cygwin/release/1.7.11 @@ -0,0 +1,29 @@ +What's new: +----------- + +- New pldd command for listing DLLs loaded by a process. + +- New API: scandirat. + + +What changed: +------------- + +- Fixed problem where background Cygwin processes kept the windows + console window from exiting. + +- Change the way remote shares mapped to drive letters are recognized + when creating the cygdrive directory. If Windows claims the drive + is unavailable, don't show it in the cygdrive directory listing. + +- Lower the stack pressure in some Cygwin calls by reducing the buffer + space allocated on the stack. + +- Raise default stacksize of pthreads from 512K to 1 Meg. It can still + be changed using the pthread_attr_setstacksize call. + +- process.h header has been moved back from /usr/include/cygwin to + /usr/include. + +- Make <sys/wait.h> header C++ clean. + diff --git a/winsup/cygwin/release/1.7.12 b/winsup/cygwin/release/1.7.12 new file mode 100644 index 000000000..641e73062 --- /dev/null +++ b/winsup/cygwin/release/1.7.12 @@ -0,0 +1,21 @@ +What's new: +----------- + +- Cygwin now automatically populates the /dev directory with all + existing POSIX devices. + +- Add virtual /proc/PID/mountinfo file. + +- flock now additionally supports the following scenario, which requires + to propagate locks to the parent process: + + ( + flock -n 9 || exit 1 + # ... commands executed under lock ... + } 9>/var/lock/mylockfile + + Only propagation to the direct parent process is supported so far, + not to grand parents or sibling processes. + +- Add a "detect_bloda" setting for the CYGWIN environment variable to help + finding potential BLODAs. diff --git a/winsup/cygwin/release/1.7.13 b/winsup/cygwin/release/1.7.13 new file mode 100644 index 000000000..23db7b553 --- /dev/null +++ b/winsup/cygwin/release/1.7.13 @@ -0,0 +1,8 @@ +What's new: +----------- + +- mkpasswd and mkgroup now try to print an entry for the TrustedInstaller + account existing since Windows Vista/Server 2008. + +- Terminal typeahead when switching from canonical to non-canonical mode + is now properly flushed. diff --git a/winsup/cygwin/release/1.7.14 b/winsup/cygwin/release/1.7.14 new file mode 100644 index 000000000..02042c1d2 --- /dev/null +++ b/winsup/cygwin/release/1.7.14 @@ -0,0 +1,21 @@ +What's new: +----------- + +- Add mouse reporting mode 1005, 1006 and 1015 to console. + +Bug fixes: +---------- + +- Allow access of /dev/conin, /dev/conout, and /dev/console if a console + device is detected. + +- Always allow nonexistent on-disk devices to be referenced even if they + can't be open. + +- Allow inheritance of special types like /dev/clipboard or /dev/urandom + which do not have actual handles associated with them. + +- Fix inode numbers of non-device files in virtual filesystems. + +- Fix reporting large mouse coordinates in console window mouse reporting mode. + diff --git a/winsup/cygwin/release/1.7.15 b/winsup/cygwin/release/1.7.15 new file mode 100644 index 000000000..4e9e64090 --- /dev/null +++ b/winsup/cygwin/release/1.7.15 @@ -0,0 +1,29 @@ +What's new: +----------- + +- Add CYGWIN=pipe_byte option to force opening of pipes in byte mode + rather than message mode. + +Bug fixes: +---------- + +- Fix output of mkpasswd -c option in case $HOME is set at the time. + Fixes: http://cygwin.com/ml/cygwin/2012-05/msg00094.html + +- Fix problem where too much input was attempted to be read from a + pty slave. Fixes: http://cygwin.com/ml/cygwin/2012-05/msg00049.html + +- Fix problem setting parent pid to 1 when process with children execs + itself. Fixes: http://cygwin.com/ml/cygwin/2012-05/msg00009.html + +- Fix fesetround and fesetprec to allow all valid input parameters. + Fixes: http://cygwin.com/ml/cygwin/2012-05/msg00010.html + +- Avoid "WARNING: Couldn't compute FAST_CWD pointer." message on + Windows 8 Customer Preview 32 bit. + Fixes: http://cygwin.com/ml/cygwin/2012-04/msg00616.html + +- Don't make Cygwin wait for all children of a non-cygwin child program. + Fixes: http://cygwin.com/ml/cygwin/2012-05/msg00063.html, + http://cygwin.com/ml/cygwin/2012-05/msg00075.html + diff --git a/winsup/cygwin/release/1.7.16 b/winsup/cygwin/release/1.7.16 new file mode 100644 index 000000000..c955cfe44 --- /dev/null +++ b/winsup/cygwin/release/1.7.16 @@ -0,0 +1,39 @@ +What's new: +----------- + +- New API: getmntent_r, memrchr. + +- Support ReFS. + +Bug fixes: +---------- + +- Fix pipe creation problem which manifested as a problem creating a + fifo. Fixes: http://cygwin.com/ml/cygwin/2012-05/msg00253.html + +- Fix hang when calling pthread_testcancel in a canceled thread. + Fixes some of: http://cygwin.com/ml/cygwin/2012-05/msg00186.html + +- Fix invocation of strace from a cygwin process. Fixes: + http://cygwin.com/ml/cygwin/2012-05/msg00292.html + +- Fix hang when zero bytes are written to a pty using + Windows WriteFile or equivalent. Fixes: + http://cygwin.com/ml/cygwin/2012-05/msg00323.html + +- Fix recv, recvfrom, recvmsg behaviour if a 0 bytes buffer is given + as argument. Fixes: http://cygwin.com/ml/cygwin/2012-05/msg00332.html + +- Handle inode numbers returned by Samba >= 3.5.4. + Fixes: http://cygwin.com/ml/cygwin/2012-05/msg00236.html + +- Fix emacs problem which exposed an issue with Cygwin's select() function. + If a signal arrives while select is blocking and the program longjmps + out of the signal handler then threads and memory may be left hanging. + Fixes: http://cygwin.com/ml/cygwin/2012-05/threads.html#00275 + +- Fix fileno(3) to return -1/EBADF if stream is closed. + Fixes: http://cygwin.com/ml/cygwin/2012-07/msg00083.html + +- Fix clipboard handling, at least partially: + http://cygwin.com/ml/cygwin/2012-06/msg00521.html diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index 2ac101a69..f80dcfbd7 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -9,7 +9,8 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#pragma once +#ifndef _SECURITY_H +#define _SECURITY_H #include <accctrl.h> @@ -512,3 +513,5 @@ sec_user (SECURITY_ATTRIBUTES *sa_buf, PSID sid1, PSID sid2 = NULL, { return __sec_user (sa_buf, sid1, sid2, access2, TRUE); } + +#endif /*_SECURITY_H*/ diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 3122c8203..6d1250cf4 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -100,28 +100,20 @@ cygwin_select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, select_printf ("select(%d, %p, %p, %p, %p)", maxfds, readfds, writefds, exceptfds, to); pthread_testcancel (); - int res; - if (maxfds < 0) - { - set_errno (EINVAL); - res = -1; - } - else - { - /* Convert to milliseconds or INFINITE if to == NULL */ - DWORD ms = to ? (to->tv_sec * 1000) + (to->tv_usec / 1000) : INFINITE; - if (ms == 0 && to->tv_usec) - ms = 1; /* At least 1 ms granularity */ - if (to) - select_printf ("to->tv_sec %d, to->tv_usec %d, ms %d", to->tv_sec, to->tv_usec, ms); - else - select_printf ("to NULL, ms %x", ms); + /* Convert to milliseconds or INFINITE if to == NULL */ + DWORD ms = to ? (to->tv_sec * 1000) + (to->tv_usec / 1000) : INFINITE; + if (ms == 0 && to->tv_usec) + ms = 1; /* At least 1 ms granularity */ - res = select (maxfds, readfds ?: allocfd_set (maxfds), + if (to) + select_printf ("to->tv_sec %d, to->tv_usec %d, ms %d", to->tv_sec, to->tv_usec, ms); + else + select_printf ("to NULL, ms %x", ms); + + int res = select (maxfds, readfds ?: allocfd_set (maxfds), writefds ?: allocfd_set (maxfds), exceptfds ?: allocfd_set (maxfds), ms); - } syscall_printf ("%R = select(%d, %p, %p, %p, %p)", res, maxfds, readfds, writefds, exceptfds, to); return res; @@ -187,7 +179,6 @@ select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, else res = sel.wait (r, w, e, ms); /* wait for an fd to become become active or time out */ - select_printf ("res %d", res); if (res >= 0) { copyfd_set (readfds, r, maxfds); @@ -206,10 +197,7 @@ select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, select_printf ("recalculating ms"); LONGLONG now = gtod.msecs (); if (now > (start_time + ms)) - { - select_printf ("timed out after verification"); - res = select_stuff::select_error; - } + select_printf ("timed out after verification"); else { ms -= (now - start_time); @@ -240,11 +228,11 @@ pselect(int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, tv.tv_usec = ts->tv_nsec / 1000; } if (set) - set_signal_mask (_my_tls.sigmask, *set); + set_signal_mask (*set, _my_tls.sigmask); int ret = cygwin_select (maxfds, readfds, writefds, exceptfds, ts ? &tv : NULL); if (set) - set_signal_mask (_my_tls.sigmask, oldset); + set_signal_mask (oldset, _my_tls.sigmask); return ret; } @@ -332,7 +320,7 @@ select_stuff::wait (fd_set *readfds, fd_set *writefds, fd_set *exceptfds, select_record *s = &start; DWORD m = 0; - set_signal_arrived here (w4[m++]); + w4[m++] = signal_arrived; /* Always wait for the arrival of a signal. */ if ((w4[m] = pthread::get_cancel_event ()) != NULL) m++; diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc index 83402a2c8..7a0b2510b 100644 --- a/winsup/cygwin/shared.cc +++ b/winsup/cygwin/shared.cc @@ -377,8 +377,4 @@ memory_init (bool init_cygheap) shared_info::create (); /* Initialize global shared memory */ user_info::create (false); /* Initialize per-user shared memory */ - /* Initialize tty list session stuff. Doesn't really belong here but - this needs to be initialized before any tty or console manipulation - happens and it is a common location. */ - tty_list::init_session (); } diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index f3a3a3a07..3fac7cbb0 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -120,9 +120,12 @@ clock_nanosleep (clockid_t clk_id, int flags, const struct timespec *rqtp, syscall_printf ("clock_nanosleep (%ld.%09ld)", rqtp->tv_sec, rqtp->tv_nsec); - int rc = cancelable_wait (NULL, &timeout, cw_sig_eintr | cw_cancel | cw_cancel_self); - if (rc == WAIT_SIGNALED) - res = EINTR; + int rc = cancelable_wait (signal_arrived, &timeout); + if (rc == WAIT_OBJECT_0) + { + _my_tls.call_signal_handler (); + res = EINTR; + } /* according to POSIX, rmtp is used only if !abstime */ if (rmtp && !abstime) @@ -223,7 +226,7 @@ handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& op newmask = *set; break; } - set_signal_mask (opmask, newmask); + set_signal_mask (newmask, opmask); } return 0; } @@ -376,7 +379,7 @@ abort (void) sigset_t sig_mask; sigfillset (&sig_mask); sigdelset (&sig_mask, SIGABRT); - set_signal_mask (_my_tls.sigmask, sig_mask); + set_signal_mask (sig_mask, _my_tls.sigmask); raise (SIGABRT); _my_tls.call_signal_handler (); /* Call any signal handler */ @@ -517,25 +520,19 @@ sigfillset (sigset_t *set) extern "C" int sigsuspend (const sigset_t *set) { - int res = handle_sigsuspend (*set); - syscall_printf ("%R = sigsuspend(%p)", res, set); - return res; + return handle_sigsuspend (*set); } extern "C" int sigpause (int signal_mask) { - int res = handle_sigsuspend ((sigset_t) signal_mask); - syscall_printf ("%R = sigpause(%p)", res, signal_mask); - return res; + return handle_sigsuspend ((sigset_t) signal_mask); } extern "C" int pause (void) { - int res = handle_sigsuspend (_my_tls.sigmask); - syscall_printf ("%R = pause()", res); - return res; + return handle_sigsuspend (_my_tls.sigmask); } extern "C" int @@ -571,18 +568,21 @@ extern "C" int sigwaitinfo (const sigset_t *set, siginfo_t *info) { pthread_testcancel (); + HANDLE h; + h = _my_tls.event = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL); + if (!h) + { + __seterrno (); + return -1; + } - myfault efault; - if (efault.faulted (EFAULT)) - return EFAULT; - - set_signal_mask (_my_tls.sigwait_mask, *set); + _my_tls.sigwait_mask = *set; sig_dispatch_pending (true); int res; - switch (cancelable_wait (NULL, cw_infinite, cw_sig_eintr | cw_cancel | cw_cancel_self)) + switch (WaitForSingleObject (h, INFINITE)) { - case WAIT_SIGNALED: + case WAIT_OBJECT_0: if (!sigismember (set, _my_tls.infodata.si_signo)) { set_errno (EINTR); @@ -601,6 +601,8 @@ sigwaitinfo (const sigset_t *set, siginfo_t *info) res = -1; } + _my_tls.event = NULL; + CloseHandle (h); sigproc_printf ("returning signal %d", res); return res; } diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index d893fc2d8..05d98729f 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -43,10 +43,14 @@ int __sp_ln; char NO_COPY myself_nowait_dummy[1] = {'0'};// Flag to sig_send that signal goes to // current process but no wait is required +HANDLE NO_COPY signal_arrived; // Event signaled when a signal has + // resulted in a user-specified + // function call #define Static static NO_COPY -Static HANDLE sig_hold; // Used to stop signal processing +HANDLE NO_COPY sigCONT; // Used to "STOP" a process + Static bool sigheld; // True if holding signals Static int nprocs; // Number of deceased children @@ -514,6 +518,17 @@ sig_dispatch_pending (bool fast) sig_send (myself, fast ? __SIGFLUSHFAST : __SIGFLUSH); } +void __stdcall +create_signal_arrived () +{ + if (signal_arrived) + return; + /* local event signaled when main thread has been dispatched + to a signal handler function. */ + signal_arrived = CreateEvent (&sec_none_nih, false, false, NULL); + ProtectHandle (signal_arrived); +} + /* Signal thread initialization. Called from dll_crt0_1. This routine starts the signal handling thread. */ void __stdcall @@ -567,7 +582,7 @@ sig_send (_pinfo *p, int sig) return 0; else if (sig == __SIGNOHOLD || sig == __SIGEXIT) { - SetEvent (sig_hold); + SetEvent (sigCONT); sigheld = false; } else if (&_my_tls == _main_tls) @@ -1218,7 +1233,7 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child) int might_match; waitq *w = parent_w->next; - sigproc_printf ("considering pid %d, pgid %d, w->pid %d", child->pid, child->pgid, w->pid); + sigproc_printf ("considering pid %d", child->pid); if (w->pid == -1) might_match = 1; else if (w->pid == 0) @@ -1344,7 +1359,7 @@ static void WINAPI wait_sig (VOID *) { _sig_tls = &_my_tls; - sig_hold = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL); + sigCONT = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL); sigproc_printf ("entering ReadFile loop, my_readsig %p, my_sendsig %p", my_readsig, my_sendsig); @@ -1354,7 +1369,7 @@ wait_sig (VOID *) for (;;) { if (pack.si.si_signo == __SIGHOLD) - WaitForSingleObject (sig_hold, INFINITE); + WaitForSingleObject (sigCONT, INFINITE); DWORD nb; pack.tls = NULL; if (!ReadFile (my_readsig, &pack, sizeof (pack), &nb, NULL)) diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h index 06ebd68d8..d980f1a6e 100644 --- a/winsup/cygwin/sigproc.h +++ b/winsup/cygwin/sigproc.h @@ -58,9 +58,13 @@ struct sigpacket int __stdcall process () __attribute__ ((regparm (1))); }; -void __stdcall sig_dispatch_pending (bool fast = false) - __attribute__ ((regparm (1))); -void set_signal_mask (sigset_t&, sigset_t) __attribute__ ((regparm (2))); +extern HANDLE signal_arrived; +extern HANDLE sigCONT; + +void __stdcall sig_dispatch_pending (bool fast = false); +#ifdef EXITCODE_SET +extern "C" void __stdcall set_signal_mask (sigset_t newmask, sigset_t&); +#endif int __stdcall handle_sigprocmask (int sig, const sigset_t *set, sigset_t *oldset, sigset_t& opmask) __attribute__ ((regparm (3))); @@ -82,6 +86,7 @@ int __stdcall sig_send (_pinfo *, siginfo_t&, class _cygtls *tls = NULL) __attri int __stdcall sig_send (_pinfo *, int) __attribute__ ((regparm (2))); void __stdcall signal_fixup_after_exec (); void __stdcall sigalloc (); +void __stdcall create_signal_arrived (); int kill_pgrp (pid_t, siginfo_t&); int killsys (pid_t, int); diff --git a/winsup/cygwin/smallprint.cc b/winsup/cygwin/smallprint.cc index fa7706b47..e7a9f530f 100644 --- a/winsup/cygwin/smallprint.cc +++ b/winsup/cygwin/smallprint.cc @@ -146,17 +146,7 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap) l_opt = true; continue; case 'c': - { - unsigned char c = (va_arg (ap, int) & 0xff); - if (isprint (c) || pad != '0') - *dst++ = c; - else - { - *dst++ = '0'; - *dst++ = 'x'; - dst = __rn (dst, 16, 0, c, len, pad, LMASK); - } - } + *dst++ = (char) (va_arg (ap, int) & 0xff); break; case 'C': { diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 8a82f8a11..b9ec36f67 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -588,16 +588,10 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, && (!iscygwin () || mode != _P_OVERLAY || ::cygheap->fdtab.need_fixup_before ())) c_flags |= CREATE_SUSPENDED; - /* If a native application should be spawned, we test here if the spawning - process is running in a console and, if so, if it's a foreground or - background process. If it's a background process, we start the native - process with the CREATE_NEW_PROCESS_GROUP flag set. This lets the native - process ignore Ctrl-C by default. If we don't do that, pressing Ctrl-C - in a console will break native processes running in the background, - because the Ctrl-C event is sent to all processes in the console, unless - they ignore it explicitely. CREATE_NEW_PROCESS_GROUP does that for us. */ - if (!iscygwin () && fhandler_console::exists () - && fhandler_console::tc_getpgid () != myself->pgid) + /* Give non-Cygwin processes their own process group since they will be + dealing with CTRL-C themselves. Not sure if this is correct for spawn*() + or not though. */ + if (!iscygwin () && fhandler_console::exists ()) c_flags |= CREATE_NEW_PROCESS_GROUP; refresh_cygheap (); diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 1b047aaff..2077a0a3c 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -228,8 +228,7 @@ enum bin_status { dont_move, move_to_bin, - has_been_moved, - dir_not_empty + has_been_moved }; static bin_status @@ -246,7 +245,6 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access) PFILE_NAME_INFORMATION pfni; PFILE_INTERNAL_INFORMATION pfii; PFILE_RENAME_INFORMATION pfri; - ULONG frisiz; FILE_DISPOSITION_INFORMATION disp = { TRUE }; bool fs_has_per_user_recycler = pc.fs_is_ntfs () || pc.fs_is_refs (); @@ -341,10 +339,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access) pc.fs_flags () & FILE_UNICODE_ON_DISK ? L".\xdc63\xdc79\xdc67" : L".cyg"); pfii = (PFILE_INTERNAL_INFORMATION) infobuf; - /* Note: Modern Samba versions apparently don't like buffer sizes of more - than 65535 in some NtQueryInformationFile/NtSetInformationFile calls. - Therefore we better use exact buffer sizes from now on. */ - status = NtQueryInformationFile (fh, &io, pfii, sizeof *pfii, + status = NtQueryInformationFile (fh, &io, pfii, 65536, FileInternalInformation); if (!NT_SUCCESS (status)) { @@ -361,8 +356,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access) pfri->RootDirectory = pc.isremote () ? NULL : rootdir; pfri->FileNameLength = recycler.Length; memcpy (pfri->FileName, recycler.Buffer, recycler.Length); - frisiz = sizeof *pfri + pfri->FileNameLength - sizeof (WCHAR); - status = NtSetInformationFile (fh, &io, pfri, frisiz, FileRenameInformation); + status = NtSetInformationFile (fh, &io, pfri, 65536, FileRenameInformation); if (status == STATUS_OBJECT_PATH_NOT_FOUND && !pc.isremote ()) { /* Ok, so the recycler and/or the recycler/SID directory don't exist. @@ -483,7 +477,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access) } NtClose (recyclerdir); /* Shoot again. */ - status = NtSetInformationFile (fh, &io, pfri, frisiz, + status = NtSetInformationFile (fh, &io, pfri, 65536, FileRenameInformation); } if (!NT_SUCCESS (status)) @@ -499,26 +493,6 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access) Otherwise the below code closes the handle to allow replacing the file. */ status = NtSetInformationFile (fh, &io, &disp, sizeof disp, FileDispositionInformation); - if (status == STATUS_DIRECTORY_NOT_EMPTY) - { - /* Uh oh! This was supposed to be avoided by the check_dir_not_empty - test in unlink_nt, but given that the test isn't atomic, this *can* - happen. Try to move the dir back ASAP. */ - pfri->RootDirectory = NULL; - pfri->FileNameLength = pc.get_nt_native_path ()->Length; - memcpy (pfri->FileName, pc.get_nt_native_path ()->Buffer, - pc.get_nt_native_path ()->Length); - frisiz = sizeof *pfri + pfri->FileNameLength - sizeof (WCHAR); - if (NT_SUCCESS (NtSetInformationFile (fh, &io, pfri, frisiz, - FileRenameInformation))) - { - /* Give notice to unlink_nt and leave immediately. This avoids - closing the handle, which might still be used if called from - the rm -r workaround code. */ - bin_stat = dir_not_empty; - goto out; - } - } /* In case of success, restore R/O attribute to accommodate hardlinks. That leaves potentially hardlinks around with the R/O bit suddenly off if setting the delete disposition failed, but please, keep in @@ -550,7 +524,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access) status); goto out; } - status = NtSetInformationFile (tmp_fh, &io, pfri, frisiz, + status = NtSetInformationFile (tmp_fh, &io, pfri, 65536, FileRenameInformation); NtClose (tmp_fh); if (!NT_SUCCESS (status)) @@ -717,45 +691,46 @@ unlink_nt (path_conv &pc) if a file is already open elsewhere for other purposes than reading and writing data. */ status = NtOpenFile (&fh, access, &attr, &io, FILE_SHARE_DELETE, flags); - /* STATUS_SHARING_VIOLATION is what we expect. STATUS_LOCK_NOT_GRANTED can - be generated under not quite clear circumstances when trying to open a - file on NFS with FILE_SHARE_DELETE only. This has been observed with - SFU 3.5 if the NFS share has been mounted under a drive letter. It's - not generated for all files, but only for some. If it's generated once - for a file, it will be generated all the time. It looks as if wrong file - state information is stored within the NFS client which never times out. - Opening the file with FILE_SHARE_VALID_FLAGS will work, though, and it - is then possible to delete the file quite normally. */ if (status == STATUS_SHARING_VIOLATION || status == STATUS_LOCK_NOT_GRANTED) { - debug_printf ("Sharing violation when opening %S", - pc.get_nt_native_path ()); - /* We never call try_to_bin on NFS and NetApp for the follwing reasons: - - NFS implements its own mechanism to remove in-use files, which looks - quite similar to what we do in try_to_bin for remote files. + /* STATUS_LOCK_NOT_GRANTED can be generated under not quite clear + circumstances when trying to open a file on NFS with FILE_SHARE_DELETE + only. This has been observed with SFU 3.5 if the NFS share has been + mounted under a drive letter. It's not generated for all files, but + only for some. If it's generated once for a file, it will be + generated all the time. It looks like wrong file state information + is stored within the NFS client, for no apparent reason, which never + times out. Opening the file with FILE_SHARE_VALID_FLAGS will work, + though, and it is then possible to delete the file quite normally. + + NFS implements its own mechanism to remove in-use files which + looks quite similar to what we do in try_to_bin for remote files. + That's why we don't call try_to_bin on NFS. Netapp filesystems don't understand the "move and delete" method at all and have all kinds of weird effects. Just setting the delete dispositon usually works fine, though. */ + debug_printf ("Sharing violation when opening %S", + pc.get_nt_native_path ()); if (!pc.fs_is_nfs () && !pc.fs_is_netapp ()) bin_stat = move_to_bin; - /* If the file is not a directory, of if we didn't set the move_to_bin - flag, just proceed with the FILE_SHARE_VALID_FLAGS set. */ - if (!pc.isdir () || bin_stat == dont_move) + if (!pc.isdir () || pc.isremote ()) status = NtOpenFile (&fh, access, &attr, &io, FILE_SHARE_VALID_FLAGS, flags); else { - /* Otherwise it's getting tricky. The directory is opened in some - process, so we're supposed to move it to the recycler and mark it - for deletion. But what if the directory is not empty? The move + /* It's getting tricky. The directory is opened in some process, + so we're supposed to move it to the recycler and mark it for + deletion. But what if the directory is not empty? The move will work, but the subsequent delete will fail. So we would - have to move it back. While we do that in try_to_bin, it's bad, - because the move results in a temporary inconsistent state. - So, we test first if the directory is empty. If not, we bail - out with STATUS_DIRECTORY_NOT_EMPTY. This avoids most of the - problems. */ + have to move it back. That's bad, because the directory would + be moved around which results in a temporary inconsistent state. + So, what we do here is to test if the directory is empty. If + not, we bail out with STATUS_DIRECTORY_NOT_EMPTY. The below code + tests for at least three entries in the directory, ".", "..", + and another one. Three entries means, not empty. This doesn't + work for the root directory of a drive, but the root dir can + neither be deleted, nor moved anyway. */ status = NtOpenFile (&fh, access | FILE_LIST_DIRECTORY | SYNCHRONIZE, &attr, &io, FILE_SHARE_VALID_FLAGS, flags | FILE_SYNCHRONOUS_IO_NONALERT); @@ -789,15 +764,9 @@ unlink_nt (path_conv &pc) /* Try to move to bin if a sharing violation occured. If that worked, we're done. */ if (bin_stat == move_to_bin - && (bin_stat = try_to_bin (pc, fh, access)) >= has_been_moved) + && (bin_stat = try_to_bin (pc, fh, access)) == has_been_moved) { - if (bin_stat == has_been_moved) - status = STATUS_SUCCESS; - else - { - status = STATUS_DIRECTORY_NOT_EMPTY; - NtClose (fh); - } + status = STATUS_SUCCESS; goto out; } @@ -862,7 +831,6 @@ try_again: bin_stat = try_to_bin (pc, fh, access); } } - /* Do NOT handle bin_stat == dir_not_empty here! */ if (bin_stat == has_been_moved) status = STATUS_SUCCESS; else @@ -874,15 +842,12 @@ try_again: } } } - else if (status2 != STATUS_OBJECT_PATH_NOT_FOUND - && status2 != STATUS_OBJECT_NAME_NOT_FOUND) + else { fh = NULL; debug_printf ("Opening dir %S for check_dir_not_empty failed, " "status = %p", pc.get_nt_native_path (), status2); } - else /* Directory disappeared between NtClose and NtOpenFile. */ - status = STATUS_SUCCESS; } /* Trying to delete a hardlink to a file in use by the system in some way (for instance, font files) by setting the delete disposition fails @@ -920,10 +885,8 @@ try_again: unlinking didn't work. */ if (bin_stat == dont_move) bin_stat = try_to_bin (pc, fh, access); - if (bin_stat >= has_been_moved) - status = bin_stat == has_been_moved - ? STATUS_SUCCESS - : STATUS_DIRECTORY_NOT_EMPTY; + if (bin_stat == has_been_moved) + status = STATUS_SUCCESS; } else NtClose (fh2); @@ -933,7 +896,7 @@ try_again: { if (access & FILE_WRITE_ATTRIBUTES) { - /* Restore R/O attribute if setting the delete disposition failed. */ + /* Restore R/O attribute if setting the delete dispostion failed. */ if (!NT_SUCCESS (status)) NtSetAttributesFile (fh, pc.file_attributes ()); /* If we succeeded, restore R/O attribute to accommodate hardlinks. @@ -2332,7 +2295,7 @@ retry: { debug_printf ("status %p", status); if (status == STATUS_SHARING_VIOLATION - && cygwait (10L) != WAIT_SIGNALED) + && WaitForSingleObject (signal_arrived, 10L) != WAIT_OBJECT_0) { /* Typical BLODA problem. Some virus scanners check newly generated files and while doing that disallow DELETE access. That's really diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index aefab24cd..5caf5ca73 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -1744,7 +1744,7 @@ pthread_mutex::lock () || !pthread::equal (owner, self)) { /* FIXME: no cancel? */ - cancelable_wait (win32_obj_id, cw_infinite, cw_sig); + cancelable_wait (win32_obj_id, LARGE_NULL, cw_sig); set_owner (self); } else @@ -2364,7 +2364,7 @@ pthread::join (pthread_t *thread, void **return_val) (*thread)->attr.joinable = PTHREAD_CREATE_DETACHED; (*thread)->mutex.unlock (); - switch (cancelable_wait ((*thread)->win32_obj_id, cw_infinite, cw_sig | cw_cancel)) + switch (cancelable_wait ((*thread)->win32_obj_id, LARGE_NULL, cw_sig | cw_cancel)) { case WAIT_OBJECT_0: if (return_val) @@ -3015,7 +3015,10 @@ pthread_kill (pthread_t thread, int sig) if (!thread->valid) rval = ESRCH; else if (sig) - rval = sig_send (NULL, si, thread->cygtls); + { + thread->cygtls->set_threadkill (); + rval = sig_send (NULL, si, thread->cygtls); + } else switch (WaitForSingleObject (thread->win32_obj_id, 0)) { @@ -3498,7 +3501,7 @@ semaphore::_timedwait (const struct timespec *abstime) int semaphore::_wait () { - switch (cancelable_wait (win32_obj_id, cw_infinite, cw_cancel | cw_cancel_self | cw_sig_eintr)) + switch (cancelable_wait (win32_obj_id, LARGE_NULL, cw_cancel | cw_cancel_self | cw_sig_eintr)) { case WAIT_OBJECT_0: currentvalue--; diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index 141100714..a4f5a952c 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -60,7 +60,7 @@ public: void lock () { if (InterlockedIncrement ((long *) &lock_counter) != 1) - cancelable_wait (win32_obj_id, cw_infinite, cw_sig); + cancelable_wait (win32_obj_id, LARGE_NULL, cw_sig); } void unlock () diff --git a/winsup/cygwin/tlsoffsets.h b/winsup/cygwin/tlsoffsets.h index 1ab4559b9..18057742c 100644 --- a/winsup/cygwin/tlsoffsets.h +++ b/winsup/cygwin/tlsoffsets.h @@ -1,42 +1,42 @@ //;# autogenerated: Do not edit. -//; $tls::start_offset = -12700; -//; $tls::locals = -12700; -//; $tls::plocals = 0; -//; $tls::local_clib = -11236; -//; $tls::plocal_clib = 1464; -//; $tls::__dontuse = -11236; -//; $tls::p__dontuse = 1464; -//; $tls::func = -10148; -//; $tls::pfunc = 2552; -//; $tls::saved_errno = -10144; -//; $tls::psaved_errno = 2556; -//; $tls::sa_flags = -10140; -//; $tls::psa_flags = 2560; -//; $tls::oldmask = -10136; -//; $tls::poldmask = 2564; -//; $tls::deltamask = -10132; -//; $tls::pdeltamask = 2568; -//; $tls::errno_addr = -10128; -//; $tls::perrno_addr = 2572; -//; $tls::sigmask = -10124; -//; $tls::psigmask = 2576; -//; $tls::sigwait_mask = -10120; -//; $tls::psigwait_mask = 2580; -//; $tls::sigwait_info = -10116; -//; $tls::psigwait_info = 2584; -//; $tls::signal_arrived = -10112; -//; $tls::psignal_arrived = 2588; -//; $tls::signal_waiting = -10108; -//; $tls::psignal_waiting = 2592; -//; $tls::thread_context = -10104; -//; $tls::pthread_context = 2596; -//; $tls::thread_id = -9892; -//; $tls::pthread_id = 2808; -//; $tls::infodata = -9888; -//; $tls::pinfodata = 2812; -//; $tls::tid = -9740; -//; $tls::ptid = 2960; +//; $tls::sizeof__cygtls = 4048; +//; $tls::func = -12700; +//; $tls::pfunc = 0; +//; $tls::saved_errno = -12696; +//; $tls::psaved_errno = 4; +//; $tls::sa_flags = -12692; +//; $tls::psa_flags = 8; +//; $tls::oldmask = -12688; +//; $tls::poldmask = 12; +//; $tls::deltamask = -12684; +//; $tls::pdeltamask = 16; +//; $tls::event = -12680; +//; $tls::pevent = 20; +//; $tls::errno_addr = -12676; +//; $tls::perrno_addr = 24; +//; $tls::sigmask = -12672; +//; $tls::psigmask = 28; +//; $tls::sigwait_mask = -12668; +//; $tls::psigwait_mask = 32; +//; $tls::sigwait_info = -12664; +//; $tls::psigwait_info = 36; +//; $tls::thread_context = -12660; +//; $tls::pthread_context = 40; +//; $tls::thread_id = -12448; +//; $tls::pthread_id = 252; +//; $tls::threadkill = -12444; +//; $tls::pthreadkill = 256; +//; $tls::infodata = -12440; +//; $tls::pinfodata = 260; +//; $tls::tid = -12292; +//; $tls::ptid = 408; +//; $tls::local_clib = -12288; +//; $tls::plocal_clib = 412; +//; $tls::__dontuse = -12288; +//; $tls::p__dontuse = 412; +//; $tls::locals = -11200; +//; $tls::plocals = 1500; //; $tls::_ctinfo = -9736; //; $tls::p_ctinfo = 2964; //; $tls::andreas = -9732; @@ -59,42 +59,42 @@ //; $tls::pinitialized = 4044; //; __DATA__ -#define tls_locals (-12700) -#define tls_plocals (0) -#define tls_local_clib (-11236) -#define tls_plocal_clib (1464) -#define tls___dontuse (-11236) -#define tls_p__dontuse (1464) -#define tls_func (-10148) -#define tls_pfunc (2552) -#define tls_saved_errno (-10144) -#define tls_psaved_errno (2556) -#define tls_sa_flags (-10140) -#define tls_psa_flags (2560) -#define tls_oldmask (-10136) -#define tls_poldmask (2564) -#define tls_deltamask (-10132) -#define tls_pdeltamask (2568) -#define tls_errno_addr (-10128) -#define tls_perrno_addr (2572) -#define tls_sigmask (-10124) -#define tls_psigmask (2576) -#define tls_sigwait_mask (-10120) -#define tls_psigwait_mask (2580) -#define tls_sigwait_info (-10116) -#define tls_psigwait_info (2584) -#define tls_signal_arrived (-10112) -#define tls_psignal_arrived (2588) -#define tls_signal_waiting (-10108) -#define tls_psignal_waiting (2592) -#define tls_thread_context (-10104) -#define tls_pthread_context (2596) -#define tls_thread_id (-9892) -#define tls_pthread_id (2808) -#define tls_infodata (-9888) -#define tls_pinfodata (2812) -#define tls_tid (-9740) -#define tls_ptid (2960) +#define tls_func (-12700) +#define tls_pfunc (0) +#define tls_saved_errno (-12696) +#define tls_psaved_errno (4) +#define tls_sa_flags (-12692) +#define tls_psa_flags (8) +#define tls_oldmask (-12688) +#define tls_poldmask (12) +#define tls_deltamask (-12684) +#define tls_pdeltamask (16) +#define tls_event (-12680) +#define tls_pevent (20) +#define tls_errno_addr (-12676) +#define tls_perrno_addr (24) +#define tls_sigmask (-12672) +#define tls_psigmask (28) +#define tls_sigwait_mask (-12668) +#define tls_psigwait_mask (32) +#define tls_sigwait_info (-12664) +#define tls_psigwait_info (36) +#define tls_thread_context (-12660) +#define tls_pthread_context (40) +#define tls_thread_id (-12448) +#define tls_pthread_id (252) +#define tls_threadkill (-12444) +#define tls_pthreadkill (256) +#define tls_infodata (-12440) +#define tls_pinfodata (260) +#define tls_tid (-12292) +#define tls_ptid (408) +#define tls_local_clib (-12288) +#define tls_plocal_clib (412) +#define tls___dontuse (-12288) +#define tls_p__dontuse (412) +#define tls_locals (-11200) +#define tls_plocals (1500) #define tls__ctinfo (-9736) #define tls_p_ctinfo (2964) #define tls_andreas (-9732) diff --git a/winsup/cygwin/wait.cc b/winsup/cygwin/wait.cc index ae0403194..714a9e26e 100644 --- a/winsup/cygwin/wait.cc +++ b/winsup/cygwin/wait.cc @@ -80,7 +80,7 @@ wait4 (int intpid, int *status, int options, struct rusage *r) if ((waitfor = w->ev) == NULL) goto nochildren; - res = cancelable_wait (waitfor, cw_infinite, cw_cancel | cw_cancel_self); + res = cancelable_wait (waitfor, LARGE_NULL, cw_cancel | cw_cancel_self); sigproc_printf ("%d = cancelable_wait (...)", res); diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index 48b51c275..c5cac6aa2 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -347,52 +347,72 @@ wincapc::init () return; // already initialized GetSystemInfo (&system_info); + memset (&version, 0, sizeof version); version.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX); - GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version)); + if (!GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version))) + api_fatal ("Cygwin requires at least Windows 2000."); - switch (version.dwMajorVersion) + switch (version.dwPlatformId) { - case 5: - switch (version.dwMinorVersion) + case VER_PLATFORM_WIN32_NT: + switch (version.dwMajorVersion) { - case 0: - if (version.wServicePackMajor < 4) - caps = &wincap_2000; - else - caps = &wincap_2000sp4; + case 4: + /* I'd be very surprised if this code is ever hit, but it doesn't + hurt to keep it. */ + api_fatal ("Cygwin requires at least Windows 2000."); break; - - case 1: - caps = &wincap_xp; - switch (version.wServicePackMajor) + case 5: + switch (version.dwMinorVersion) { - case 0: - caps = &wincap_xp; - case 1: - caps = &wincap_xpsp1; - default: - caps = &wincap_xpsp2; - } - break; + case 0: + if (version.wServicePackMajor < 4) + caps = &wincap_2000; + else + caps = &wincap_2000sp4; + break; - default: - caps = &wincap_2003; - } - break; - case 6: - switch (version.dwMinorVersion) - { - case 0: - caps = &wincap_vista; + case 1: + caps = &wincap_xp; + switch (version.wServicePackMajor) + { + case 0: + caps = &wincap_xp; + case 1: + caps = &wincap_xpsp1; + default: + caps = &wincap_xpsp2; + } + break; + + default: + caps = &wincap_2003; + } break; - case 1: - caps = &wincap_7; + case 6: + switch (version.dwMinorVersion) + { + case 0: + caps = &wincap_vista; + break; + case 1: + caps = &wincap_7; + break; + default: + caps = &wincap_8; + break; + } break; default: - caps = &wincap_8; + caps = &wincap_minimal; break; } break; + case VER_PLATFORM_WIN32_WINDOWS: + /* I'd be very surprised if this code is ever hit, but it doesn't + hurt to keep it. */ + api_fatal ("Windows 95/98/Me are not supported."); + break; default: caps = &wincap_minimal; break; diff --git a/winsup/cygwin/winlean.h b/winsup/cygwin/winlean.h index aa092ee53..950bd1dec 100644 --- a/winsup/cygwin/winlean.h +++ b/winsup/cygwin/winlean.h @@ -34,8 +34,6 @@ details. */ #define _WINMM_ #define WINIMPM #define WINSOCK_API_LINKAGE -#define NTDDI_VERSION 0x6020000 /* Probably should just be derived from our - _WIN32_WINNT setting in winsup.h */ /* Windows headers define a couple of annoyingly intrusive macros for the sole purpose of inline documentation. Since they are defined without diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index fd6d6906f..63495b831 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -9,6 +9,12 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ +#ifdef DEBUGIT +#define spf(a, b, c) small_printf (a, b, c) +#else +#define spf(a, b, c) do {} while (0) +#endif + #ifdef HAVE_CONFIG_H # include "config.h" #endif diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index 2480c5164..6e38ac0be 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,7 +1,3 @@ -2012-08-03 Adam Dinwoodie <Adam.Dinwoodie@metaswitch.com> - - * faq-using.xml (faq.using.man): Make relevance to whatis explicit. - 2012-07-20 Corinna Vinschen <corinna@vinschen.de> * pathnames.sgml (pathnames-intro): Remove paragraph on UNC paths. diff --git a/winsup/doc/faq-using.xml b/winsup/doc/faq-using.xml index c08efbc56..5aee7717b 100644 --- a/winsup/doc/faq-using.xml +++ b/winsup/doc/faq-using.xml @@ -238,12 +238,10 @@ related messages. </answer></qandaentry> <qandaentry id="faq.using.man"> -<question><para>Why doesn't <literal>man -k</literal>, -<literal>apropos</literal> or <literal>whatis</literal> work?</para></question> +<question><para>Why doesn't man -k (or apropos) work?</para></question> <answer> -<para>Before you can use <literal>man -k</literal>, <literal>apropos</literal> -or <literal>whatis</literal>, you +<para>Before you can use <literal>man -k</literal> or <literal>apropos</literal>, you must create the whatis database. Just run the command </para> <screen> diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 3eb8975c1..7205fb477 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,58 +1,3 @@ -2012-08-08 Kai Tietz <ktietz@redhat.com> - - * mingwex/gdtoa/gd_qnan.h: Make Nan constants positive valued. - -2012-08-06 Earnie Boyd <earnie@users.sourceforge.net> - - * mingwex/membarrier.c: New file. - * mingwex/Makefile.in (DISTFILES): Add membarrier.c. - (REPLACE_OBJS): Add membarrier.o. - -2012-08-02 Ivan Maidanski <ivmai@users.sourceforge.net> - - * include/process.h (_wexec*, _wspawn*): Declare. - -2012-08-02 Earnie Boyd <earnie@users.sourceforge.net> - - * include/stdlib.h (_strtoi64): Declare. - (_strtoi64_l): Ditto. - (_strtoui64): Ditto. - (_strtoui64_l): Ditto. - (_wcstrtoi64): Ditto. - (_wcstrtoi64_l): Ditto. - (_wcstrtoui64): Ditto. - (_wcstrtoui64_l): Ditto. - * include/wchar.h (_wcstrtoi64): Ditto. - (_wcstrtoi64_l): Ditto. - (_wcstrtoui64): Ditto. - (_wcstrtoui64_l): Ditto. - * include/stdio.h (_getws, _putws): Guard with #ifndef __STRICT_ANSI__. - (_wfdopen, _wfopen, _wfreopen, _wfsopen, _wtmpnam, _wtempnam): Ditto. - (_wrename, _wremove, _wperror, _wpopen): Ditto. - (_lock_file, _unlock_file): Declare. - * include/limits.h (PATH_MAX): Guard with #ifndef __STRICT_ANSI__. - * include/sys/param.h (MAXPATHLEN): Make sure PATH_MAX is defined. - * include/_mingw.h (threadlocalinfostruct, threadmbinfostruct, - *pthreadlocinfo, *pthreadmbcinfo, _locale_tstruct, *_locale_t): Declare. - * mingwex/tsearch.c: Correct coding to produce the proper results. - -2012-08-01 Earnie Boyd <earnie@users.sourceforge.net> - - * include/excpt.h (__try1): Define based on _WIN64 definition. - (__except1): Ditto. - -2012-07-30 Earnie Boyd <earnie@users.sourceforge.net> - - * include/stdint.h: Include _mingw.h for the definition of __int64 when - _WIN64 is defined. - * include/inttypes.h: A few items like PRNdPTR and SCNdPTR need 64 - bitness specified when _WIN64 is defined. - * include/_mingw.h: Add __MINGW_VERSION, __MINGW_MAJOR_VERSION, - __MINGW_MINOR_VERSION and __MINGW_PATCHLEVEL deprecating the __MINGW32_* - versions of the macros. - * configure.in: Use __MINGW_VERSION instead of __MINGW32_VERSION. - * configure: Ditto. - 2012-05-08 Keith Marshall <keithmarshall@users.sourceforge.net> Remove references to nonexistent files. diff --git a/winsup/mingw/configure b/winsup/mingw/configure index 598ed6d9d..1ca8b5336 100755 --- a/winsup/mingw/configure +++ b/winsup/mingw/configure @@ -1788,7 +1788,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking package version" >&5 $as_echo_n "checking package version... " >&6; } - PACKAGE_VERSION=`awk '$2 == "'"__MINGW_VERSION"'" { print $3 }' ${srcdir}/include/_mingw.h` + PACKAGE_VERSION=`awk '$2 == "'"__MINGW32_VERSION"'" { print $3 }' ${srcdir}/include/_mingw.h` { $as_echo "$as_me:$LINENO: result: $PACKAGE_VERSION" >&5 $as_echo "$PACKAGE_VERSION" >&6; } diff --git a/winsup/mingw/configure.in b/winsup/mingw/configure.in index eccf84074..92dbd3d1d 100644 --- a/winsup/mingw/configure.in +++ b/winsup/mingw/configure.in @@ -18,7 +18,7 @@ dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. AC_PREREQ([2.59]) AC_INIT([MinGW Runtime], [v3.x], [http://mingw.org/reporting_bugs], [mingwrt]) -MINGW_AC_CONFIG_SRCDIR([__MINGW_VERSION], [include/_mingw.h]) +MINGW_AC_CONFIG_SRCDIR([__MINGW32_VERSION], [include/_mingw.h]) AC_CANONICAL_SYSTEM GCC_NO_EXECUTABLES diff --git a/winsup/mingw/include/_mingw.h b/winsup/mingw/include/_mingw.h index cbfd54ced..cb0ff53a7 100644 --- a/winsup/mingw/include/_mingw.h +++ b/winsup/mingw/include/_mingw.h @@ -22,13 +22,6 @@ */ #define __MINGW_H -#define __MINGW_VERSION 4 -#define __MINGW_MAJOR_VERSION 0 -#define __MINGW_MINOR_VERSION 0 -#define __MINGW_PATCHLEVEL 0 - -// These four macros are deprecated and will be removed in the next major -// version release. #define __MINGW32_VERSION 3.20 #define __MINGW32_MAJOR_VERSION 3 #define __MINGW32_MINOR_VERSION 20 @@ -47,10 +40,10 @@ __MINGW_IMPORT The attribute definition to specify imported variables/functions. _CRTIMP As above. For MS compatibility. - __MINGW_VERSION Runtime version. - __MINGW_MAJOR_VERSION Runtime major version. - __MINGW_MINOR_VERSION Runtime minor version. - __MINGW_BUILD_DATE Runtime build date. + __MINGW32_VERSION Runtime version. + __MINGW32_MAJOR_VERSION Runtime major version. + __MINGW32_MINOR_VERSION Runtime minor version. + __MINGW32_BUILD_DATE Runtime build date. Macros to enable MinGW features which deviate from standard MSVC compatible behaviour; these may be specified directly in user code, @@ -290,14 +283,4 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */ # endif #endif -struct threadlocalinfostruct; -struct threadmbinfostruct; -typedef struct threadlocalinfostruct *pthreadlocinfo; -typedef struct threadmbcinfostruct *pthreadmbcinfo; - -typedef struct localeinfo_struct { - pthreadlocinfo locinfo; - pthreadmbcinfo mbcinfo; -} _locale_tstruct, *_locale_t; - #endif /* __MINGW_H */ diff --git a/winsup/mingw/include/excpt.h b/winsup/mingw/include/excpt.h index 3919cb791..e75ceb78f 100644 --- a/winsup/mingw/include/excpt.h +++ b/winsup/mingw/include/excpt.h @@ -75,15 +75,8 @@ typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD; * onto the stack, then put a pointer to the new registration * structure (i.e. the current stack pointer) at fs:0. */ -#ifdef _WIN64 -# define __try1(pHandler) \ - __asm__ __volatile__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : \ - "g" (pHandler)); -#else -# define __try1(pHandler) \ - __asm__ __volatile__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : \ - "g" (pHandler)); -#endif +#define __try1(pHandler) \ + __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler)); /* * A macro which (despite its name) *removes* an installed @@ -96,15 +89,9 @@ typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD; * the stack must be in the exact state at this point that it was * after we did __try1 or this will smash things. */ -#ifdef _WIN64 -# define __except1 \ - __asm__ __volatile__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq \ - $16,%%rsp;" : : : "%rax"); -#else -# define __except1 \ - __asm__ __volatile__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl \ - $8,%%esp;" : : : "%eax"); -#endif +#define __except1 \ + __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \ + : : : "%eax"); #ifdef __cplusplus } diff --git a/winsup/mingw/include/inttypes.h b/winsup/mingw/include/inttypes.h index e13040634..2d2bb8d80 100644 --- a/winsup/mingw/include/inttypes.h +++ b/winsup/mingw/include/inttypes.h @@ -44,6 +44,7 @@ typedef struct { #define PRIdFAST64 "I64d" #define PRIdMAX "I64d" +#define PRIdPTR "d" #define PRIi8 "i" #define PRIi16 "i" @@ -61,6 +62,7 @@ typedef struct { #define PRIiFAST64 "I64i" #define PRIiMAX "I64i" +#define PRIiPTR "i" #define PRIo8 "o" #define PRIo16 "o" @@ -79,6 +81,8 @@ typedef struct { #define PRIoMAX "I64o" +#define PRIoPTR "o" + /* fprintf macros for unsigned types */ #define PRIu8 "u" #define PRIu16 "u" @@ -97,6 +101,7 @@ typedef struct { #define PRIuFAST64 "I64u" #define PRIuMAX "I64u" +#define PRIuPTR "u" #define PRIx8 "x" #define PRIx16 "x" @@ -114,6 +119,7 @@ typedef struct { #define PRIxFAST64 "I64x" #define PRIxMAX "I64x" +#define PRIxPTR "x" #define PRIX8 "X" #define PRIX16 "X" @@ -131,22 +137,7 @@ typedef struct { #define PRIXFAST64 "I64X" #define PRIXMAX "I64X" - -#ifdef _WIN64 -#define PRIdPTR "I64d" -#define PRIiPTR "I64i" -#define PRIoPTR "I64o" -#define PRIuPTR "I64u" -#define PRIxPTR "I64x" -#define PRIXPTR "I64X" -#else -#define PRIdPTR "d" -#define PRIiPTR "i" -#define PRIoPTR "o" -#define PRIuPTR "u" -#define PRIxPTR "x" #define PRIXPTR "X" -#endif /* * fscanf macros for signed int types @@ -168,6 +159,7 @@ typedef struct { #define SCNdFAST64 "I64d" #define SCNdMAX "I64d" +#define SCNdPTR "d" #define SCNi16 "hi" #define SCNi32 "i" @@ -182,6 +174,7 @@ typedef struct { #define SCNiFAST64 "I64i" #define SCNiMAX "I64i" +#define SCNiPTR "i" #define SCNo16 "ho" #define SCNo32 "o" @@ -196,6 +189,7 @@ typedef struct { #define SCNoFAST64 "I64o" #define SCNoMAX "I64o" +#define SCNoPTR "o" #define SCNx16 "hx" #define SCNx32 "x" @@ -210,6 +204,8 @@ typedef struct { #define SCNxFAST64 "I64x" #define SCNxMAX "I64x" +#define SCNxPTR "x" + /* fscanf macros for unsigned int types */ @@ -226,20 +222,7 @@ typedef struct { #define SCNuFAST64 "I64u" #define SCNuMAX "I64u" - -#ifdef _WIN64 -#define SCNdPTR "I64d" -#define SCNiPTR "I64i" -#define SCNoPTR "I64o" -#define SCNxPTR "I64x" -#define SCNuPTR "I64u" -#else -#define SCNdPTR "d" -#define SCNiPTR "i" -#define SCNoPTR "o" -#define SCNxPTR "x" #define SCNuPTR "u" -#endif #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* diff --git a/winsup/mingw/include/limits.h b/winsup/mingw/include/limits.h index ca4900610..96ad26cec 100644 --- a/winsup/mingw/include/limits.h +++ b/winsup/mingw/include/limits.h @@ -29,9 +29,7 @@ * are semantically identical, with a limit of 259 characters for the * path name, plus one for a terminating NUL, for a total of 260. */ -#ifndef __STRICT_ANSI__ -# define PATH_MAX 260 -#endif +#define PATH_MAX 260 /* * Characteristics of the char data type. diff --git a/winsup/mingw/include/process.h b/winsup/mingw/include/process.h index 0a3511f4d..c0c380fbd 100644 --- a/winsup/mingw/include/process.h +++ b/winsup/mingw/include/process.h @@ -79,28 +79,6 @@ _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnve (int, const char*, const char* _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnvp (int, const char*, const char* const*); _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnvpe (int, const char*, const char* const*, const char* const*); -#ifndef _WPROCESS_DEFINED -/* Also in wchar.h - keep in sync */ -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecl (const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecle (const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexeclp (const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexeclpe (const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecv (const wchar_t*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecve (const wchar_t*, const wchar_t* const*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecvp (const wchar_t*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecvpe (const wchar_t*, const wchar_t* const*, const wchar_t* const*); - -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnl (int, const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnle (int, const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnlp (int, const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnlpe (int, const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnv (int, const wchar_t*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnve (int, const wchar_t*, const wchar_t* const*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnvp (int, const wchar_t*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnvpe (int, const wchar_t*, const wchar_t* const*, const wchar_t* const*); - -#define _WPROCESS_DEFINED -#endif /* * The functions _beginthreadex and _endthreadex are not provided by CRTDLL. diff --git a/winsup/mingw/include/stdint.h b/winsup/mingw/include/stdint.h index 942a1a8fc..c6ab3bcef 100644 --- a/winsup/mingw/include/stdint.h +++ b/winsup/mingw/include/stdint.h @@ -19,7 +19,6 @@ #ifndef _STDINT_H #define _STDINT_H -#include <_mingw.h> #define __need_wint_t #define __need_wchar_t #include <stddef.h> diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h index 60f540114..fe9f2b735 100644 --- a/winsup/mingw/include/stdio.h +++ b/winsup/mingw/include/stdio.h @@ -591,13 +591,10 @@ _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*); _CRTIMP int __cdecl __MINGW_NOTHROW fputws (const wchar_t*, FILE*); _CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*); _CRTIMP wint_t __cdecl __MINGW_NOTHROW getwchar (void); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t); -#ifndef __STRICT_ANSI__ -_CRTIMP void __cdecl __MINGW_NOTHROW _lock_file(FILE*); -_CRTIMP void __cdecl __MINGW_NOTHROW _unlock_file(FILE*); _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _getws (wchar_t*); +_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*); _CRTIMP int __cdecl __MINGW_NOTHROW _putws (const wchar_t*); +_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t); _CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfdopen(int, const wchar_t *); _CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfopen (const wchar_t*, const wchar_t*); _CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfreopen (const wchar_t*, const wchar_t*, FILE*); @@ -608,7 +605,6 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _wrename (const wchar_t*, const wchar_t*); _CRTIMP int __cdecl __MINGW_NOTHROW _wremove (const wchar_t*); _CRTIMP void __cdecl __MINGW_NOTHROW _wperror (const wchar_t*); _CRTIMP FILE* __cdecl __MINGW_NOTHROW _wpopen (const wchar_t*, const wchar_t*); -#endif /* __STRICT_ANSI__ */ #endif /* __MSVCRT__ */ #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ diff --git a/winsup/mingw/include/stdlib.h b/winsup/mingw/include/stdlib.h index ece21cb44..4df18aab3 100644 --- a/winsup/mingw/include/stdlib.h +++ b/winsup/mingw/include/stdlib.h @@ -300,11 +300,6 @@ __MINGW_IMPORT int _fmode_dll; #endif /* Not __STRICT_ANSI__ */ -_CRTIMP __int64 __cdecl _strtoi64(const char*, char **, int); -_CRTIMP __int64 __cdecl _strtoi64_l(const char *, char **, int, _locale_t); -_CRTIMP unsigned __int64 __cdecl _strtoui64(const char*, char **, int); -_CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *, char **, int, _locale_t); - _CRTIMP double __cdecl __MINGW_NOTHROW atof (const char*); _CRTIMP int __cdecl __MINGW_NOTHROW atoi (const char*); _CRTIMP long __cdecl __MINGW_NOTHROW atol (const char*); @@ -328,10 +323,6 @@ _CRTIMP unsigned long __cdecl __MINGW_NOTHROW strtoul (const char*, char**, int) #ifndef _WSTDLIB_DEFINED /* also declared in wchar.h */ -_CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *, wchar_t **, int); -_CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *, wchar_t **, int, _locale_t); -_CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *, wchar_t **, int); -_CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *, wchar_t **, int, _locale_t); _CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t*, wchar_t**, int); _CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int); _CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**); diff --git a/winsup/mingw/include/sys/param.h b/winsup/mingw/include/sys/param.h index d38b46a5c..74966bd78 100644 --- a/winsup/mingw/include/sys/param.h +++ b/winsup/mingw/include/sys/param.h @@ -17,10 +17,6 @@ #define LITTLE_ENDIAN 1234 #define BYTE_ORDER LITTLE_ENDIAN -#ifdef PATH_MAX #define MAXPATHLEN PATH_MAX -#else -#define MAXPATHLEN 260 -#endif #endif diff --git a/winsup/mingw/include/wchar.h b/winsup/mingw/include/wchar.h index dadeda6d3..60e8d9c2b 100644 --- a/winsup/mingw/include/wchar.h +++ b/winsup/mingw/include/wchar.h @@ -177,10 +177,6 @@ _CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const _CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*); _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t); #endif -_CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *, wchar_t **, int); -_CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *, wchar_t **, int, _locale_t); -_CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *, wchar_t **, int); -_CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *, wchar_t **, int, _locale_t); #define _WSTDLIB_DEFINED #endif /* _WSTDLIB_DEFINED */ diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in index afe32e5be..59ebac7e3 100644 --- a/winsup/mingw/mingwex/Makefile.in +++ b/winsup/mingw/mingwex/Makefile.in @@ -40,7 +40,7 @@ DISTFILES = \ fegetexceptflag.c fegetround.c feholdexcept.c feraiseexcept.c \ fesetenv.c fesetexceptflag.c fesetround.c fetestexcept.c \ feupdateenv.c ftruncate.c fwide.c getopt.c imaxabs.c imaxdiv.c \ - lltoa.c lltow.c mbsinit.c membarrier.c mingw-aligned-malloc.c \ + lltoa.c lltow.c mbsinit.c mingw-aligned-malloc.c \ mingw-fseek.c sitest.c strtoimax.c strtoumax.c \ testwmem.c tst-aligned-malloc.c ulltoa.c ulltow.c wcstof.c \ wcstoimax.c wcstold.c wcstoumax.c wctrans.c wctype.c \ @@ -201,7 +201,7 @@ POSIX_OBJS = \ dirent.o wdirent.o getopt.o ftruncate.o gettimeofday.o usleep.o \ basename.o dirname.o tsearch.o twalk.o tdelete.o tfind.o REPLACE_OBJS = \ - membarrier.o mingw-aligned-malloc.o mingw-fseek.o + mingw-aligned-malloc.o mingw-fseek.o COMPLEX_OBJS = \ cabs.o cabsf.o cabsl.o cacos.o cacosf.o cacosl.o cacosh.o \ cacoshf.o cacoshl.o carg.o cargf.o cargl.o casin.o casinf.o \ diff --git a/winsup/mingw/mingwex/gdtoa/gd_qnan.h b/winsup/mingw/mingwex/gdtoa/gd_qnan.h index 0b468c492..87eba8fb3 100644 --- a/winsup/mingw/mingwex/gdtoa/gd_qnan.h +++ b/winsup/mingw/mingwex/gdtoa/gd_qnan.h @@ -1,12 +1,12 @@ -#define f_QNAN 0x7fc00000 +#define f_QNAN 0xffc00000 #define d_QNAN0 0x0 -#define d_QNAN1 0x7ff80000 +#define d_QNAN1 0xfff80000 #define ld_QNAN0 0x0 #define ld_QNAN1 0xc0000000 -#define ld_QNAN2 0x7fff +#define ld_QNAN2 0xffff #define ld_QNAN3 0x0 #define ldus_QNAN0 0x0 #define ldus_QNAN1 0x0 #define ldus_QNAN2 0x0 #define ldus_QNAN3 0xc000 -#define ldus_QNAN4 0x7fff +#define ldus_QNAN4 0xffff diff --git a/winsup/mingw/mingwex/membarrier.c b/winsup/mingw/mingwex/membarrier.c deleted file mode 100644 index b8da9f7de..000000000 --- a/winsup/mingw/mingwex/membarrier.c +++ /dev/null @@ -1,19 +0,0 @@ -/** - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -void __mingworg_MemoryBarrier(void); -void __mingworg_MemoryBarrier(void) -{ - long Barrier = 0; - __asm__ __volatile__("xchgl %%eax,%0 " - :"=r" (Barrier)); -} - diff --git a/winsup/mingw/mingwex/tsearch.c b/winsup/mingw/mingwex/tsearch.c index 55f192214..a0aa0eb36 100755 --- a/winsup/mingw/mingwex/tsearch.c +++ b/winsup/mingw/mingwex/tsearch.c @@ -23,33 +23,29 @@ tsearch(const void * __restrict__ vkey, /* key to be located */ void ** __restrict__ vrootp, /* address of tree root */ int (*compar) (const void *, const void *)) { - node_t *q, **n; + node_t *q; node_t **rootp = (node_t **)vrootp; if (rootp == NULL) return NULL; - n = rootp; - while (*n != NULL) { /* Knuth's T1: */ + while (*rootp != NULL) { /* Knuth's T1: */ int r; - if ((r = (*compar)(vkey, ((*n)->key))) == 0) /* T2: */ - return *n; /* we found it! */ + if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */ + return *rootp; /* we found it! */ - n = (r < 0) ? + rootp = (r < 0) ? &(*rootp)->llink : /* T3: follow left branch */ &(*rootp)->rlink; /* T4: follow right branch */ - if (*n == NULL) - break; - rootp = n; } q = malloc(sizeof(node_t)); /* T5: key not found */ - if (!q) - return q; - *n = q; /* make new node */ - /* LINTED const castaway ok */ - q->key = (void *)vkey; /* initialize new node */ - q->llink = q->rlink = NULL; + if (q != 0) { /* make new node */ + *rootp = q; /* link new node to old */ + /* LINTED const castaway ok */ + q->key = (void *)vkey; /* initialize new node */ + q->llink = q->rlink = NULL; + } return q; } diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog index 79892af2a..d5b6772d9 100644 --- a/winsup/w32api/ChangeLog +++ b/winsup/w32api/ChangeLog @@ -1,54 +1,3 @@ -2012-08-08 Earnie Boyd <earnie@users.sourceforge.net> - - * lib/kernel32.def (InterlockedDecrement): Remove the @BYTE count since - we now declare it as __cdecl. - (InterlockedIncrement): Ditto. - (InterlockedExchange): Ditto. - -2012-08-06 Earnie Boyd <earnie@users.sourceforge.net> - - * include/winnt.h (MemoryBarrier): Define to __mingworg_MemoryBarrier() - which is in libmingwex.a. - MODIFIED FROM: Use __sync_synchronize instead of - creating a function due to multiple definition. - NOTE: Not using __sync_synchronize to allow applications to mix-n-match - C libraries from different vendors. - -2012-08-04 Earnie Boyd <earnie@users.sourceforge.net> - - * include/winver.h (VerQueryValue[AW]): Correct declaration per MSDN. - -2012-08-01 Stephan Jorek <sjorek@users.sourceforge.net> - - * include/setupapi.h: Correct typos and truncations. - -2012-08-01 Earnie Boyd <earnie@users.sourceforge.net> - - * include/winuser.h (tagMENUITEMINFOA): Correct dwItemData definition. - (tagMENUITEMINFOW): Ditto. - * include/wtsapi32.h (WTSVirtualChannelClose): Add declaration. - (WTSVirtualChannelOpen): Ditto. - (WTSVirtualchannelOpenEx): Ditto. - (WTSVirtualChannelPurgeInput): Ditto. - (WTSVirtualChannelPurgeOutput): Ditto. - (WTSVirtualChannelQuery): Ditto. - (WTSVirtualChannelRead): Ditto. - (WTSVirtualChannelWrite): Ditto. - * lib/wtsapi32.def (WTSVirtualChannelOpenEx@12): Add import. - * include/winbase.h (InterlockedDecrement): Modify declaration from - LONG WINAPI to LONG __cdecl to match Microsoft documentation. - (InterlockedIncrement): Ditto. - (InterlockedExchange): Ditto. - * include/winnt.h (MemoryBarrier): Add definition. - * lib/Makefile.in (amvideo.h): Dependencies are not met making this file - implementation incomplete. Do not deliver it. - (amaudio.h): Ditto. - -2012-07-29 Earnie Boyd <earnie@users.sourceforge.net> - - * include/sdkddkver.h: New file. - * include/windows.h: Include sdkddkver.h. - 2012-07-06 Corinna Vinschen <corinna@vinschen.de> * include/winsock.h: Keep IP_OPTIONS and SO_xxx definitions when diff --git a/winsup/w32api/include/sdkddkver.h b/winsup/w32api/include/sdkddkver.h deleted file mode 100644 index 3005cf5ab..000000000 --- a/winsup/w32api/include/sdkddkver.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - sdkddkver.h - Versioning file for Windows SDK/DDK. - - This file is part of a free library for the Windows API. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ -#ifndef _SDKDDKVER_H -#define _SDKDDKVER_H - -/** - * Define version masks - * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx - * Values and names are guessed based on comments in the documentation. - */ -#define OSVERSION_MASK 0xFFFF0000 -#define SPVERSION_MASK 0x0000FF00 -#define SUBVERSION_MASK 0x000000FF - -/** - * Macros to extract values from NTDDI version. - * Derived from comments on MSDN or social.microsoft.com - */ -#define OSVER(ver) ((ver) & OSVERSION_MASK) -#define SPVER(ver) (((ver) & SPVERSION_MASK) >> 8) -#define SUBVER(ver) ((ver) & SUBVERSION_MASK) - -/** - * Macros to create the minimal NTDDI version from _WIN32_WINNT value. - */ -#define NTDDI_VERSION_FROM_WIN32_WINNT(ver) _NTDDI_VERSION_FROM_WIN32_WINNT(ver) -#define _NTDDI_VERSION_FROM_WIN32_WINNT(ver) ver##0000 - -/** - * Version constants defining _WIN32_WINNT versions. - * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx - */ -#define _WIN32_WINNT_NT4 0x0400 -#define _WIN32_WINNT_WIN2K 0x0500 -#define _WIN32_WINNT_WINXP 0x0501 -#define _WIN32_WINNT_WS03 0x0502 -#define _WIN32_WINNT_WIN6 0x0600 -#define _WIN32_WINNT_VISTA 0x0600 -#define _WIN32_WINNT_WS08 0x0600 -#define _WIN32_WINNT_LONGORN 0x0600 -#define _WIN32_WINNT_WIN7 0x0601 - -/** - * Version constants defining _WIN32_IE versions. - * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx - */ -#define _WIN32_IE_IE50 0x0500 -#define _WIN32_IE_IE501 0x0501 -#define _WIN32_IE_IE55 0x0550 -#define _WIN32_IE_IE60 0x0600 -#define _WIN32_IE_IE60SP1 0x0601 -#define _WIN32_IE_IE60SP2 0x0603 -#define _WIN32_IE_IE70 0x0700 -#define _WIN32_IE_IE80 0x0800 - -/** - * Version constants defining NTDDI_VERSION. - * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx - */ -#define __NTDDI_WIN5 0x05000000 -#define __NTDDI_WIN51 0x05010000 -#define __NTDDI_WIN52 0x05020000 -#define __NTDDI_WIN6 0x06000000 -#define __NTDDI_WIN61 0x06010000 -#define __NTDDI_SP0 0x00000000 -#define __NTDDI_SP1 0x00000100 -#define __NTDDI_SP2 0x00000200 -#define __NTDDI_SP3 0x00000300 -#define __NTDDI_SP4 0x00000400 - -#define NTDDI_WIN2K __NTDDI_WIN5 + __NTDDI_SP0 -#define NTDDI_WIN2KSP1 __NTDDI_WIN5 + __NTDDI_SP1 -#define NTDDI_WIN2KSP2 __NTDDI_WIN5 + __NTDDI_SP2 -#define NTDDI_WIN2KSP3 __NTDDI_WIN5 + __NTDDI_SP3 -#define NTDDI_WIN2KSP4 __NTDDI_WIN5 + __NTDDI_SP4 - -#define NTDDI_WINXP __NTDDI_WIN51 + __NTDDI_SP0 -#define NTDDI_WINXPSP1 __NTDDI_WIN51 + __NTDDI_SP1 -#define NTDDI_WINXPSP2 __NTDDI_WIN51 + __NTDDI_SP2 -#define NTDDI_WINXPSP3 __NTDDI_WIN51 + __NTDDI_SP3 - -#define NTDDI_WS03 __NTDDI_WIN52 + __NTDDI_SP0 -#define NTDDI_WS03SP1 __NTDDI_WIN52 + __NTDDI_SP1 -#define NTDDI_WS03SP2 __NTDDI_WIN52 + __NTDDI_SP2 - -#define NTDDI_VISTA __NTDDI_WIN6 + __NTDDI_SP0 -#define NTDDI_VISTASP1 __NTDDI_WIN6 + __NTDDI_SP1 -#define NTDDI_VISTASP2 __NTDDI_WIN6 + __NTDDI_SP2 - -#define NTDDI_LONGHORN NTDDI_VISTA - -#define NTDDI_WIN6 NTDDI_VISTA -#define NTDDI_WIN6SP1 NTDDI_VISTASP1 -#define NTDDI_WIN6SP2 NTDDI_VISTASP2 - -#define NTDDI_WS08 __NTDDI_WIN6 + __NTDDI_SP1 - -#define NTDDI_WIN7 __NTDDI_WIN61 + __NTDDI_SP0 - -/** - * Assign defaults - */ -#ifdef NTDDI_VERSION -# ifdef _WIN32_WINNT -# if _WIN32_WINNT != OSDIR(NTDDI_VERSION) -# error The _WIN32_WINNT value does not match NTDDI_VERSION -# endif -# else -# define _WIN32_WINNT OSVER(NTDDI_VERSION) -# ifndef WINVER -# define WINVER _WIN32_WINNT -# endif -# endif -#endif - -#ifndef _WIN32_WINNT -# ifdef WINVER -# define _WIN32_WINNT WINVER -# else -# warning _WIN32_WINNT is defaulting to _WIN32_WINNT_WIN2K -# define _WIN32_WINNT _WIN32_WINNT_WIN2K -# endif -#endif - -#ifndef WINVER -# define WINVER _WIN32_WINNT -#endif - -#ifndef NTDDI_VERSION -# warning NTDDI_VERSION is defaulting to _WIN32_WINNT version SPK0 -# define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT) -#endif - -#endif diff --git a/winsup/w32api/include/setupapi.h b/winsup/w32api/include/setupapi.h index 8fc7a6c82..ef38852a2 100644 --- a/winsup/w32api/include/setupapi.h +++ b/winsup/w32api/include/setupapi.h @@ -1046,7 +1046,7 @@ WINSETUPAPI BOOL WINAPI SetupAdjustDiskSpaceListA(HDSKSPC,LPCSTR,LONGLONG,PVOID, WINSETUPAPI BOOL WINAPI SetupAdjustDiskSpaceListW(HDSKSPC,LPCWSTR,LONGLONG,PVOID,UINT); WINSETUPAPI UINT WINAPI SetupBackupErrorA(HWND,PCSTR,PCSTR,PCSTR,UINT,DWORD); WINSETUPAPI UINT WINAPI SetupBackupErrorW(HWND,PCWSTR,PCWSTR,PCWSTR,UINT,DWORD); -WINSETUPAPI BOOL WINAPI SetupCancelTemporarySourceList(VOID); +WINSETUPAPI BOOL WINAPI SetupCancelTemporary(VOID); WINSETUPAPI BOOL WINAPI SetupCloseFileQueue(HSPFILEQ); WINSETUPAPI VOID WINAPI SetupCloseInfFile(HINF); WINSETUPAPI VOID WINAPI SetupCloseLog(VOID); @@ -1157,7 +1157,7 @@ WINSETUPAPI BOOL WINAPI SetupDiGetINFClassW(PCWSTR,LPGUID,PWSTR,DWORD,PDWORD); WINSETUPAPI BOOL WINAPI SetupDiGetSelectedDevice(HDEVINFO,PSP_DEVINFO_DATA); WINSETUPAPI BOOL WINAPI SetupDiGetSelectedDriverA(HDEVINFO,PSP_DEVINFO_DATA,PSP_DRVINFO_DATA_A); WINSETUPAPI BOOL WINAPI SetupDiGetSelectedDriverW(HDEVINFO,PSP_DEVINFO_DATA,PSP_DRVINFO_DATA_W); -WINSETUPAPI HPROPSHEETPAGE WINAPI SetupDiGetWizardPage(HDEVINFO,PSP_DEVINFO_DATA,PSP_INSTALLWIZARD_DATA,DWORD,DWORD); +WINSETUPAPI HPROPSHEETPAGE WINAPI SetupDiGetWizardage(HDEVINFO,PSP_DEVINFO_DATA,PSP_INSTALLWIZARD_DATA,DWORD,DWORD); WINSETUPAPI BOOL WINAPI SetupDiInstallClassA(HWND,PCSTR,DWORD,HSPFILEQ); WINSETUPAPI BOOL WINAPI SetupDiInstallClassW(HWND,PCWSTR,DWORD,HSPFILEQ); WINSETUPAPI BOOL WINAPI SetupDiInstallClassExA(HWND,PCSTR,DWORD,HSPFILEQ,CONST GUID*,PVOID,PVOID); @@ -1204,8 +1204,8 @@ WINSETUPAPI BOOL WINAPI SetupFindFirstLineW(HINF,PCWSTR,PCWSTR,PINFCONTEXT); WINSETUPAPI BOOL WINAPI SetupFindNextLine(PINFCONTEXT,PINFCONTEXT); WINSETUPAPI BOOL WINAPI SetupFindNextMatchLineA(PINFCONTEXT,PCSTR,PINFCONTEXT); WINSETUPAPI BOOL WINAPI SetupFindNextMatchLineW(PINFCONTEXT,PCWSTR,PINFCONTEXT); -WINSETUPAPI BOOL WINAPI SetupFreeSourceListA(PCSTR**,UINT); -WINSETUPAPI BOOL WINAPI SetupFreeSourceListW(PCWSTR**,UINT); +WINSETUPAPI BOOL WINAPI SetupFreeA(PCSTR**,UINT); +WINSETUPAPI BOOL WINAPI SetupFreeW(PCWSTR**,UINT); WINSETUPAPI BOOL WINAPI SetupGetBackupInformationA(HSPFILEQ,PSP_BACKUP_QUEUE_PARAMS_A); WINSETUPAPI BOOL WINAPI SetupGetBackupInformationW(HSPFILEQ,PSP_BACKUP_QUEUE_PARAMS_W); WINSETUPAPI BOOL WINAPI SetupGetBinaryField(PINFCONTEXT,DWORD,PBYTE,DWORD,LPDWORD); @@ -1267,8 +1267,8 @@ WINSETUPAPI HINF WINAPI SetupOpenMasterInf(VOID); WINSETUPAPI UINT WINAPI SetupPromptForDiskA(HWND,PCSTR,PCSTR,PCSTR,PCSTR,PCSTR,DWORD,PSTR,DWORD,PDWORD); WINSETUPAPI UINT WINAPI SetupPromptForDiskW(HWND,PCWSTR,PCWSTR,PCWSTR,PCWSTR,PCWSTR,DWORD,PWSTR,DWORD,PDWORD); WINSETUPAPI INT WINAPI SetupPromptReboot(HSPFILEQ,HWND,BOOL); -WINSETUPAPI BOOL WINAPI SetupQuerySourceListA(DWORD,PCSTR**,PUINT); -WINSETUPAPI BOOL WINAPI SetupQuerySourceListW(DWORD,PCWSTR**,PUINT); +WINSETUPAPI BOOL WINAPI SetupQueryA(DWORD,PCSTR**,PUINT); +WINSETUPAPI BOOL WINAPI SetupQueryW(DWORD,PCWSTR**,PUINT); WINSETUPAPI BOOL WINAPI SetupQueryDrivesInDiskSpaceListA(HDSKSPC,PSTR,DWORD,PDWORD); WINSETUPAPI BOOL WINAPI SetupQueryDrivesInDiskSpaceListW(HDSKSPC,PWSTR,DWORD,PDWORD); WINSETUPAPI BOOL WINAPI SetupQueryFileLogA(HSPFILELOG,PCSTR,PCSTR,SetupFileLogInfo,PSTR,DWORD,PDWORD); diff --git a/winsup/w32api/include/winbase.h b/winsup/w32api/include/winbase.h index aa168418b..a61547051 100644 --- a/winsup/w32api/include/winbase.h +++ b/winsup/w32api/include/winbase.h @@ -1846,8 +1846,8 @@ LONG WINAPI InterlockedCompareExchange(LONG volatile *,LONG,LONG); /* PVOID WINAPI InterlockedCompareExchangePointer(PVOID*,PVOID,PVOID); */ #define InterlockedCompareExchangePointer(d,e,c) \ (PVOID)InterlockedCompareExchange((LONG volatile *)(d),(LONG)(e),(LONG)(c)) -LONG __cdecl InterlockedDecrement(LONG volatile *); -LONG __cdecl InterlockedExchange(LONG volatile *,LONG); +LONG WINAPI InterlockedDecrement(LONG volatile *); +LONG WINAPI InterlockedExchange(LONG volatile *,LONG); /* PVOID WINAPI InterlockedExchangePointer(PVOID*,PVOID); */ #define InterlockedExchangePointer(t,v) \ (PVOID)InterlockedExchange((LONG volatile *)(t),(LONG)(v)) @@ -1855,7 +1855,7 @@ LONG WINAPI InterlockedExchangeAdd(LONG volatile *,LONG); #if (_WIN32_WINNT >= 0x0501) PSLIST_ENTRY WINAPI InterlockedFlushSList(PSLIST_HEADER); #endif -LONG __cdecl InterlockedIncrement(LONG volatile *); +LONG WINAPI InterlockedIncrement(LONG volatile *); #if (_WIN32_WINNT >= 0x0501) PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER); PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY); diff --git a/winsup/w32api/include/windows.h b/winsup/w32api/include/windows.h index db18aec8d..97e037e90 100644 --- a/winsup/w32api/include/windows.h +++ b/winsup/w32api/include/windows.h @@ -16,8 +16,6 @@ #pragma GCC system_header #endif -#include <sdkddkver.h> - /* translate GCC target defines to MS equivalents. Keep this synchronized with winnt.h. */ #if defined(__i686__) && !defined(_M_IX86) diff --git a/winsup/w32api/include/winnt.h b/winsup/w32api/include/winnt.h index d650bf800..b31274bbe 100644 --- a/winsup/w32api/include/winnt.h +++ b/winsup/w32api/include/winnt.h @@ -4035,19 +4035,6 @@ struct _TEB * NtCurrentTeb(void); #endif /* __GNUC__ */ #endif /* _X86_ */ -#if _WIN32_WINNT >= _WIN32_WINNT_VISTA -# if defined(_AMD64_) || defined(__X86_64) -# define MemoryBarrier __faststorefence -# elif defined(_IA64_) -# define MemoryBarrier __mf -# else - void __mingworg_MemoryBarrier(void); -# define MemoryBarrier __mingworg_MemoryBarrier -# endif -#else -# define MemoryBarrier -#endif - #endif /* RC_INVOKED */ #ifdef __cplusplus diff --git a/winsup/w32api/include/winuser.h b/winsup/w32api/include/winuser.h index 76f493584..7fb6fe224 100644 --- a/winsup/w32api/include/winuser.h +++ b/winsup/w32api/include/winuser.h @@ -2771,7 +2771,7 @@ typedef struct tagMENUITEMINFOA { HMENU hSubMenu; HBITMAP hbmpChecked; HBITMAP hbmpUnchecked; - ULONG_PTR dwItemData; + DWORD dwItemData; LPSTR dwTypeData; UINT cch; #if (_WIN32_WINNT >= 0x0500) @@ -2788,7 +2788,7 @@ typedef struct tagMENUITEMINFOW { HMENU hSubMenu; HBITMAP hbmpChecked; HBITMAP hbmpUnchecked; - ULONG_PTR dwItemData; + DWORD dwItemData; LPWSTR dwTypeData; UINT cch; #if (_WIN32_WINNT >= 0x0500) diff --git a/winsup/w32api/include/winver.h b/winsup/w32api/include/winver.h index f5a0dab85..9f8c9b76c 100644 --- a/winsup/w32api/include/winver.h +++ b/winsup/w32api/include/winver.h @@ -107,8 +107,8 @@ BOOL WINAPI GetFileVersionInfoA(LPCSTR,DWORD,DWORD,PVOID); BOOL WINAPI GetFileVersionInfoW(LPCWSTR,DWORD,DWORD,PVOID); DWORD WINAPI VerLanguageNameA(DWORD,LPSTR,DWORD); DWORD WINAPI VerLanguageNameW(DWORD,LPWSTR,DWORD); -BOOL WINAPI VerQueryValueA(LPCVOID,LPCSTR,LPVOID*,PUINT); -BOOL WINAPI VerQueryValueW(LPCVOID,LPCWSTR,LPVOID*,PUINT); +BOOL WINAPI VerQueryValueA(const LPVOID,LPCSTR,LPVOID*,PUINT); +BOOL WINAPI VerQueryValueW(const LPVOID,LPCWSTR,LPVOID*,PUINT); #ifdef UNICODE #define VerFindFile VerFindFileW #define VerQueryValue VerQueryValueW diff --git a/winsup/w32api/include/wtsapi32.h b/winsup/w32api/include/wtsapi32.h index 298acb9b6..5bd09bbbd 100644 --- a/winsup/w32api/include/wtsapi32.h +++ b/winsup/w32api/include/wtsapi32.h @@ -74,7 +74,7 @@ BOOL WINAPI WTSQueryUserToken(ULONG SessionId, PHANDLE pToken); #endif /* _WIN32_WINNT >= 0x0501 */ -#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K) +#if (_WIN32_WINNT >= 0x0500) typedef struct _WTS_SESSION_INFOW { DWORD SessionId; @@ -168,56 +168,6 @@ BOOL WTSSendMessageW( #define WTSSendMessage WTSSendMessageA #endif -BOOL WTSVirtualChannelClose( - __in HANDLE hChannelHandle -); - -HANDLE WTSVirtualChannelOpen( - __in HANDLE hServer, - __in DWORD SessionId, - __in LPSTR pVirtualName -); - -#if _WIN32_WINNT >= _WIN32_WINNT_VISTA -HANDLE WTSVirtualChannelOpenEx( - __in DWORD SessionId, - __in LPSTR pVirtualName, - __in DWORD flags -); -#endif - -BOOL WTSVirtualChannelPurgeInput( - __in HANDLE hChannelHandle -); - -BOOL WTSVirtualChannelPurgeOutput( - __in HANDLE hChannelHandle -); - -#if _WIN32_WINNT >= _WIN32_WINNT_WINXP -BOOL WTSVirtualChannelQuery( - __in HANDLE hChannelHandle, - __in WTS_VIRTUAL_CLASS WtsVirtualClass, - __out PVOID *ppBuffer, - __out DWORD *pBytesReturned -); -#endif - -BOOL WTSVirtualChannelRead( - __in HANDLE hChannelHandle, - __in ULONG TimeOut, - __out PCHAR Buffer, - __in ULONG BufferSize, - __out PULONG pBytesRead -); - -BOOL WTSVirtualChannelWrite( - __in HANDLE hChannelHandle, - __in PCHAR Buffer, - __in ULONG Length, - __out PULONG pBytesWritten -); - #endif /* _WIN32_WINNT >= 0x0500 */ #ifdef __cplusplus diff --git a/winsup/w32api/lib/Makefile.in b/winsup/w32api/lib/Makefile.in index d918f680f..97201566a 100644 --- a/winsup/w32api/lib/Makefile.in +++ b/winsup/w32api/lib/Makefile.in @@ -131,14 +131,7 @@ install-libraries: all $(need-DESTDIR-compatibility) install-headers: $(need-DESTDIR-compatibility) $(mkinstalldirs) $(DESTDIR)${inst_includedir} for file in $(HEADERS); do \ - case $$file in \ - amvideo.h | amaudio.h) \ - echo Not installing $$file \ - ;; \ - *) \ - $(INSTALL_DATA) ${top_srcdir}/include/$$file $(DESTDIR)${inst_includedir}; \ - ;; \ - esac \ + $(INSTALL_DATA) ${top_srcdir}/include/$$file $(DESTDIR)${inst_includedir}; \ done $(mkinstalldirs) $(DESTDIR)${inst_includedir}/GL for file in $(GL_HEADERS); do \ diff --git a/winsup/w32api/lib/kernel32.def b/winsup/w32api/lib/kernel32.def index 177160f6b..fca559aac 100644 --- a/winsup/w32api/lib/kernel32.def +++ b/winsup/w32api/lib/kernel32.def @@ -749,11 +749,11 @@ InitializeSListHead@4 InitializeSRWLock@4 InterlockedCompareExchange64@20 InterlockedCompareExchange@12 -InterlockedDecrement -InterlockedExchange +InterlockedDecrement@4 +InterlockedExchange@8 InterlockedExchangeAdd@8 InterlockedFlushSList@4 -InterlockedIncrement +InterlockedIncrement@4 InterlockedPopEntrySList@4 InterlockedPushEntrySList@8 InvalidateConsoleDIBits@8 diff --git a/winsup/w32api/lib/wtsapi32.def b/winsup/w32api/lib/wtsapi32.def index 6baaa7124..e02e4705c 100755 --- a/winsup/w32api/lib/wtsapi32.def +++ b/winsup/w32api/lib/wtsapi32.def @@ -27,7 +27,6 @@ WTSTerminateProcess@12 WTSUnRegisterSessionNotification@4 WTSVirtualChannelClose@4 WTSVirtualChannelOpen@12 -WTSVirtualChannelOpenEx@12 WTSVirtualChannelPurgeInput@4 WTSVirtualChannelPurgeOutput@4 WTSVirtualChannelQuery@16 |