├── .cvsignore ├── COPYING ├── COPYING.LIB ├── COPYING.LIBGLOSS ├── COPYING.NEWLIB ├── COPYING3 ├── COPYING3.LIB ├── ChangeLog ├── MAINTAINERS ├── Makefile.def ├── Makefile.in ├── Makefile.tpl ├── README ├── README-maintainer-mode ├── cgen ├── AUTHORS ├── COPYING.CGEN ├── ChangeLog ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── aclocal.m4 ├── attr.scm ├── cgen-doc.scm ├── cgen-gas.scm ├── cgen-idp.scm ├── cgen-intrinsics.scm ├── cgen-opc.scm ├── cgen-sid.scm ├── cgen-sim.scm ├── cgen-stest.scm ├── cgen-testsuite.scm ├── co-for-gen-all ├── configure ├── configure.in ├── cos-pprint.scm ├── cos.scm ├── cpu │ ├── arm.cpu │ ├── arm.sim │ ├── arm7.cpu │ ├── i960.cpu │ ├── i960.opc │ ├── ia32.cpu │ ├── ia64.cpu │ ├── m68k.cpu │ ├── play.cpu │ ├── play.opc │ ├── powerpc.cpu │ ├── sh-sid.cpu │ ├── sh-sim.cpu │ ├── sh.cpu │ ├── sh.opc │ ├── sh64-compact.cpu │ ├── sh64-media.cpu │ ├── simplify.inc │ ├── sparc.cpu │ ├── sparc.opc │ ├── sparc32.cpu │ ├── sparc64.cpu │ ├── sparccom.cpu │ ├── sparcfpu.cpu │ └── thumb.cpu ├── decode.scm ├── desc-cpu.scm ├── desc.scm ├── dev-utils.scm ├── dev.scm ├── doc │ ├── Makefile.am │ ├── Makefile.in │ ├── app.texi │ ├── cgen.texi │ ├── cgenint.texi │ ├── credits.texi │ ├── glossary.texi │ ├── intro.texi │ ├── mdate-sh │ ├── notes.texi │ ├── opcodes.texi │ ├── pmacros.texi │ ├── porting.texi │ ├── rtl.texi │ ├── running.texi │ ├── sim.texi │ ├── stamp-vti │ └── version.texi ├── enum.scm ├── gas-test.scm ├── gen-all ├── gen-all-desc ├── gen-all-doc ├── gen-all-intrinsics ├── gen-all-opcodes ├── gen-all-sid ├── gen-all-sim ├── guile.scm ├── hardware.scm ├── html.scm ├── idp-ana.scm ├── idp-arch.scm ├── idp-emu.scm ├── idp-ins.scm ├── idp-out.scm ├── idp.scm ├── ifield.scm ├── iformat.scm ├── insn.scm ├── intrinsics.scm ├── mach.scm ├── minsn.scm ├── mode.scm ├── model.scm ├── opc-asmdis.scm ├── opc-ibld.scm ├── opc-itab.scm ├── opc-opinst.scm ├── opcodes.scm ├── operand.scm ├── pgmr-tools.scm ├── pmacros.scm ├── pprint.scm ├── profile.scm ├── read.scm ├── rtl-c.scm ├── rtl-traverse.scm ├── rtl-xform.scm ├── rtl.scm ├── rtx-funcs.scm ├── sem-frags.scm ├── semantics.scm ├── sid-cpu.scm ├── sid-decode.scm ├── sid-model.scm ├── sid.scm ├── sim-arch.scm ├── sim-cpu.scm ├── sim-decode.scm ├── sim-model.scm ├── sim-test.scm ├── sim.scm ├── slib │ ├── genwrite.scm │ ├── logical.scm │ ├── pp.scm │ ├── random.scm │ └── sort.scm ├── stamp-h.in ├── testsuite.scm ├── testsuite │ ├── Makefile.am │ ├── Makefile.in │ ├── location-1.test │ ├── names-comments-1.test │ ├── pmacros-1.test │ ├── run-tests.sh │ ├── test-utils.sh.in │ └── testsuite.cpu ├── types.scm ├── utils-cgen.scm ├── utils-gen.scm ├── utils-sim.scm └── utils.scm ├── compile ├── config-ml.in ├── config.guess ├── config.rpath ├── config.sub ├── config ├── ChangeLog ├── acinclude.m4 ├── acx.m4 ├── asmcfi.m4 ├── bootstrap-O1.mk ├── bootstrap-O3.mk ├── bootstrap-asan.mk ├── bootstrap-debug-big.mk ├── bootstrap-debug-ckovw.mk ├── bootstrap-debug-lean.mk ├── bootstrap-debug-lib.mk ├── bootstrap-debug.mk ├── bootstrap-lto.mk ├── bootstrap-time.mk ├── cloog.m4 ├── codeset.m4 ├── depstand.m4 ├── dfp.m4 ├── elf.m4 ├── enable.m4 ├── extensions.m4 ├── futex.m4 ├── gc++filt.m4 ├── gettext-sister.m4 ├── gettext.m4 ├── glibc21.m4 ├── gthr.m4 ├── gxx-include-dir.m4 ├── iconv.m4 ├── intdiv0.m4 ├── inttypes-pri.m4 ├── inttypes.m4 ├── inttypes_h.m4 ├── isl.m4 ├── largefile.m4 ├── lcmessage.m4 ├── ld-symbolic.m4 ├── lead-dot.m4 ├── lib-ld.m4 ├── lib-link.m4 ├── lib-prefix.m4 ├── libstdc++-raw-cxx.m4 ├── lthostflags.m4 ├── math.m4 ├── mh-cygwin ├── mh-darwin ├── mh-djgpp ├── mh-mingw ├── mh-pa ├── mh-pa-hpux10 ├── mh-ppc-aix ├── mmap.m4 ├── mt-alphaieee ├── mt-d30v ├── mt-gnu ├── mt-mips-elfoabi ├── mt-mips-gnu ├── mt-mips16-compat ├── mt-ospace ├── mt-sde ├── mt-spu ├── multi.m4 ├── nls.m4 ├── no-executables.m4 ├── override.m4 ├── picflag.m4 ├── plugins.m4 ├── po.m4 ├── proginstall.m4 ├── progtest.m4 ├── stdint.m4 ├── stdint_h.m4 ├── tcl.m4 ├── tls.m4 ├── uintmax_t.m4 ├── ulonglong.m4 ├── unwind_ipinfo.m4 ├── warnings.m4 ├── weakref.m4 └── zlib.m4 ├── configure ├── configure.ac ├── cpu ├── ChangeLog ├── cris.cpu ├── epiphany.cpu ├── epiphany.opc ├── fr30.cpu ├── fr30.opc ├── frv.cpu ├── frv.opc ├── ip2k.cpu ├── ip2k.opc ├── iq10.cpu ├── iq2000.cpu ├── iq2000.opc ├── iq2000m.cpu ├── lm32.cpu ├── lm32.opc ├── m32c.cpu ├── m32c.opc ├── m32r.cpu ├── m32r.opc ├── mep-avc.cpu ├── mep-avc2.cpu ├── mep-c5.cpu ├── mep-core.cpu ├── mep-default.cpu ├── mep-ext-cop.cpu ├── mep-fmax.cpu ├── mep-h1.cpu ├── mep-ivc2.cpu ├── mep-rhcop.cpu ├── mep-sample-ucidsp.cpu ├── mep.cpu ├── mep.opc ├── mt.cpu ├── mt.opc ├── openrisc.cpu ├── openrisc.opc ├── sh.cpu ├── sh.opc ├── sh64-compact.cpu ├── sh64-media.cpu ├── simplify.inc ├── xc16x.cpu ├── xc16x.opc ├── xstormy16.cpu └── xstormy16.opc ├── depcomp ├── etc ├── ChangeLog ├── Makefile.in ├── add-log.el ├── add-log.vi ├── configbuild.ein ├── configbuild.fig ├── configbuild.jin ├── configbuild.tin ├── configdev.ein ├── configdev.fig ├── configdev.jin ├── configdev.tin ├── configure ├── configure.in ├── configure.texi ├── fdl.texi ├── gnu-oids.texi ├── make-stds.texi ├── standards.texi └── texi2pod.pl ├── install-sh ├── libtool.m4 ├── ltgcc.m4 ├── ltmain.sh ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 ├── lt~obsolete.m4 ├── makefile.vms ├── missing ├── mkdep ├── mkinstalldirs ├── move-if-change ├── setup.com ├── src-release ├── symlink-tree └── ylwrap /.cvsignore: -------------------------------------------------------------------------------- 1 | *-all 2 | *-co 3 | *-dirs 4 | *-done 5 | *-install-info 6 | *-src 7 | *-stamp-* 8 | *-tagged 9 | blockit 10 | cfg-paper.info 11 | config.status 12 | configure.aux 13 | configure.cp 14 | configure.cps 15 | configure.dvi 16 | configure.fn 17 | configure.fns 18 | configure.ky 19 | configure.kys 20 | configure.log 21 | configure.pg 22 | configure.pgs 23 | configure.toc 24 | configure.tp 25 | configure.tps 26 | configure.vr 27 | configure.vrs 28 | dir.info 29 | Makefile 30 | lost+found 31 | update.out 32 | update.sourceware 33 | autom4te.cache 34 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | Please feel free to add, edit, delete this file. 2 | Please do not make ChangeLog entries. 3 | 4 | COPYING, COPYING.LIB, README 5 | http://gnu.org. 6 | 7 | Makefile.*; configure; configure.ac; src-release 8 | Any global maintainer can approve changes to these 9 | files, but they should be aware that they need to 10 | be kept in sync with their counterparts in the GCC 11 | repository. Also please notify the following of 12 | any committed patches: 13 | binutils@sourceware.org 14 | gdb-patches@sourceware.org 15 | 16 | bfd/; binutils/; elfcpp/; gas/; gold/; gprof/; ld/; opcodes/; cpu/; 17 | BFD's part of include/ 18 | 19 | binutils: http://sourceware.org/binutils/ 20 | Patches to binutils@sourceware.org. 21 | Please notify the following of any interface changes: 22 | gdb-patches@sourceware.org 23 | 24 | cgen/; cgen parts of opcodes/, sim/ & include/ 25 | cgen: http://sourceware.org/cgen/ 26 | Patches to cgen@sourceware.org 27 | May need separate opcodes/ or sim/ approval for 28 | commits of regenerated files there. 29 | 30 | config.guess; config.sub; readline/support/config.{sub,guess} 31 | config: http://savannah.gnu.org/projects/config 32 | Patches to config-patches@gnu.org. 33 | Changes need to be done in tandem with the official CONFIG 34 | sources or submitted to the master file maintainer and brought 35 | in via a merge. When updating any of these files, please be 36 | sure to update all of them. 37 | Please notify the following of any committed patches: 38 | binutils@sourceware.org 39 | gdb-patches@sourceware.org 40 | 41 | depcomp; mkinstalldirs 42 | Send bug reports and patches to bug-automake@gnu.org. 43 | 44 | gdb/; readline/; sim/; GDB's part of include/ 45 | GDB: http://www.gnu.org/software/gdb/ 46 | Patches to gdb-patches@sourceware.org. 47 | See also gdb/MAINTAINERS and sim/MAINTAINERS. 48 | 49 | include/ 50 | See binutils/, gdb/, sid/, gcc/, libiberty/ etc. 51 | 52 | intl/; config.rhost; libiberty/; libiberty's part of include/; 53 | compile; depcomp; install-sh; missing; ylwrap; config/ 54 | gcc: http://gcc.gnu.org 55 | Changes need to be done in tandem with the official GCC 56 | sources or submitted to the master file maintainer and brought 57 | in via a merge. Note: approved patches in gcc's libiberty or 58 | intl are automatically approved in this libiberty and intl also; 59 | feel free to merge them yourself if needed sooner than the next 60 | merge. Otherwise, changes are automatically merged, usually 61 | within a day. 62 | 63 | libdecnumber/ 64 | See libiberty. The master copy of this directory is in the GCC 65 | repository. 66 | 67 | ltconfig; ltmain.sh; ltcf-*.sh 68 | libtool: http://www.gnu.org/software/libtool/ 69 | Changes need to be done in tandem with the official LIBTOOL 70 | sources or submitted to the master file maintainer and brought 71 | in via a merge. 72 | 73 | move-if-change 74 | Send bug reports and patches to bug-gnulib@gnu.org. 75 | 76 | symlink-tree 77 | gcc: http://gcc.gnu.org 78 | See libiberty. 79 | 80 | newlib/; libgloss/ 81 | http://sourceware.org/newlib/ 82 | Patches to newlib@sourceware.org. 83 | 84 | sid/; SID's part of cgen/ 85 | sid: http://sourceware.org/sid/ 86 | Patches to sid@sourceware.org 87 | 88 | texinfo/texinfo.tex 89 | texinfo: http://ftp.gnu.org. 90 | Latest version can be found on ftp://ftp.gnu.org and can be 91 | imported at any (reasonable) time. 92 | Please not use GCC's texinfo. Please do not import texinfo. 93 | 94 | tcl/; tix/; itcl/; tk/; libgui/ 95 | insight: http://sourceware.org/insight/ 96 | Contact insight@sourceware.org. 97 | 98 | winsup/ 99 | cygwin: http://sourceware.org/cygwin 100 | Patches to cygwin-patches@cygwin.com. 101 | General discussion cygwin@cygwin.com. 102 | 103 | config-ml.in; makefile.vms; mkdep; setup.com; 104 | etc/; utils/; 105 | Any global maintainer can approve changes to these 106 | files and directories. 107 | 108 | modules file 109 | If you understand the file format (or can cut-and-paste existing 110 | entries), modify it. If it scares you, get someone who does 111 | understand it to help you. Be prepared to fix it if you do break it. 112 | 113 | /* Local variables: */ 114 | /* change-log-default-name: "/dev/null" */ 115 | /* End: */ 116 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | README for GNU development tools 2 | 3 | This directory contains various GNU compilers, assemblers, linkers, 4 | debuggers, etc., plus their support routines, definitions, and documentation. 5 | 6 | If you are receiving this as part of a GDB release, see the file gdb/README. 7 | If with a binutils release, see binutils/README; if with a libg++ release, 8 | see libg++/README, etc. That'll give you info about this 9 | package -- supported targets, how to use it, how to report bugs, etc. 10 | 11 | It is now possible to automatically configure and build a variety of 12 | tools with one command. To build all of the tools contained herein, 13 | run the ``configure'' script here, e.g.: 14 | 15 | ./configure 16 | make 17 | 18 | To install them (by default in /usr/local/bin, /usr/local/lib, etc), 19 | then do: 20 | make install 21 | 22 | (If the configure script can't determine your type of computer, give it 23 | the name as an argument, for instance ``./configure sun4''. You can 24 | use the script ``config.sub'' to test whether a name is recognized; if 25 | it is, config.sub translates it to a triplet specifying CPU, vendor, 26 | and OS.) 27 | 28 | If you have more than one compiler on your system, it is often best to 29 | explicitly set CC in the environment before running configure, and to 30 | also set CC when running make. For example (assuming sh/bash/ksh): 31 | 32 | CC=gcc ./configure 33 | make 34 | 35 | A similar example using csh: 36 | 37 | setenv CC gcc 38 | ./configure 39 | make 40 | 41 | Much of the code and documentation enclosed is copyright by 42 | the Free Software Foundation, Inc. See the file COPYING or 43 | COPYING.LIB in the various directories, for a description of the 44 | GNU General Public License terms under which you can copy the files. 45 | 46 | REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info 47 | on where and how to report problems. 48 | -------------------------------------------------------------------------------- /README-maintainer-mode: -------------------------------------------------------------------------------- 1 | 2 | Notes on enabling maintainer mode 3 | 4 | Note that if you configure with --enable-maintainer-mode, you will need 5 | special versions of automake, autoconf, libtool and gettext. You will 6 | find the sources for these in the respective upstream directories: 7 | 8 | ftp://ftp.gnu.org/gnu/autoconf 9 | ftp://ftp.gnu.org/gnu/automake 10 | ftp://ftp.gnu.org/gnu/libtool 11 | ftp://ftp.gnu.org/gnu/gettext 12 | 13 | The required versions of the tools for this tree are 14 | autoconf 2.64 15 | automake 1.11 16 | libtool 2.2.6 17 | gettext 0.14.5 18 | 19 | Note - "make distclean" does not work with maintainer mode enabled. 20 | The Makefiles in the some of the po/ subdirectories depend upon the 21 | Makefiles in their parent directories, and distclean will delete the 22 | Makefiles in the parent directories before running the Makefiles in 23 | the child directories. There is no easy way around this (short of 24 | changing the automake macros) as these dependencies need to exist in 25 | order to correctly build the NLS files. 26 | -------------------------------------------------------------------------------- /cgen/AUTHORS: -------------------------------------------------------------------------------- 1 | CGEN was originally written by Doug Evans 2 | while at Cygnus. 3 | 4 | Copyright (C) 2012 Free Software Foundation, Inc. 5 | 6 | Copying and distribution of this file, with or without modification, 7 | are permitted in any medium without royalty provided the copyright 8 | notice and this notice are preserved. 9 | -------------------------------------------------------------------------------- /cgen/COPYING.CGEN: -------------------------------------------------------------------------------- 1 | CGEN - a Cpu tools GENerator 2 | Copyright 2000, 2007 Red Hat, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 3, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, but 10 | WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this software; see the file COPYING. If not, write to the 16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | Boston, MA 02110-1301 USA 18 | 19 | As a special exception, Red Hat gives unlimited permission to copy, 20 | distribute and modify the code that is the output of CGEN. You need 21 | not follow the terms of the GNU General Public License when using or 22 | distributing such code, even though portions of the text of CGEN 23 | appear in them. The GNU General Public License (GPL) does govern all 24 | other use of the material that constitutes the CGEN program. 25 | 26 | Certain portions of the CGEN source text are designed to be copied (in 27 | certain cases, depending on the input) into the output of CGEN. We 28 | call these the "data" portions. CPU description files are, for the 29 | purposes of this copyright, deemed "data". The rest of the CGEN 30 | source text consists of comments plus executable code that decides 31 | which of the data portions to output in any given case. We call these 32 | comments and executable code the "non-data" portions. CGEN never 33 | copies any of the non-data portions into its output. 34 | 35 | This special exception to the GPL applies to versions of CGEN released 36 | by Red Hat. When you make and distribute a modified version of CGEN, 37 | you may extend this special exception to the GPL to apply to your 38 | modified version as well, *unless* your modified version has the 39 | potential to copy into its output some of the text that was the 40 | non-data portion of the version that you started with. (In other 41 | words, unless your change moves or copies text from the non-data 42 | portions to the data portions.) If your modification has such 43 | potential, you must delete any notice of this special exception to the 44 | GPL from your modified version. 45 | -------------------------------------------------------------------------------- /cgen/NEWS: -------------------------------------------------------------------------------- 1 | 2 | Major features in release 1.1: 3 | 4 | * New applications: 5 | 6 | * Doc file generator 7 | 8 | ISA documentation can be machine generated from the description file. 9 | The CGEN website uses this: http://sourceware.org/cgen/gen-doc/ 10 | 11 | * GCC intrinsics generator 12 | 13 | The mep port of GCC generates intrinsics from the description file. 14 | 15 | * SID simulator cpu component generator 16 | 17 | CGEN can generate the cpu component of the SID simulator. 18 | 19 | * New ports: 20 | 21 | * cris 22 | * Fujitsu FRV 23 | * Ubicom ip2k 24 | * iq2000 25 | * lm32 26 | * m32c 27 | * mep 28 | * mt 29 | * openrisc 30 | * sh/sh64 31 | * xc16x 32 | * xstormy16 33 | 34 | Support for the Ubicom IP2K processor contributed by Red Hat and Ubicom, Inc. 35 | 36 | Support for the Fujitsu FRV architecture added by Red Hat. 37 | Models for FR400 and FR500 included. 38 | 39 | Major features in release 1.0: 40 | 41 | This is the first release of CGEN. It includes the most important 42 | applications, including the assembler, disassembler and simulator 43 | generators. A handful of CPU descriptions are also included: 44 | 45 | * ARM7T 46 | * Intel i960 [incomplete] 47 | * Intel IA-32 and IA-64 [incomplete] 48 | * Fujitsu FR-30 49 | * Mitsubishi M32R/D 50 | * SPARC [incomplete] 51 | 52 | Copyright (C) 2012 Free Software Foundation, Inc. 53 | 54 | Copying and distribution of this file, with or without modification, 55 | are permitted in any medium without royalty provided the copyright 56 | notice and this notice are preserved. 57 | -------------------------------------------------------------------------------- /cgen/cgen-doc.scm: -------------------------------------------------------------------------------- 1 | ; CPU description file generator for CGEN cpu documentation 2 | ; This is invoked to build: $arch.html. 3 | ; Copyright (C) 2003, 2009 Doug Evans 4 | ; This file is part of CGEN. 5 | ; 6 | ; This is a standalone script, we don't load anything until we parse the 7 | ; -s argument (keeps reliance off of environment variables, etc.). 8 | 9 | ; Load the various support routines. 10 | 11 | (define (load-files srcdir) 12 | (load (string-append srcdir "/read.scm")) 13 | (load (string-append srcdir "/desc.scm")) 14 | (load (string-append srcdir "/desc-cpu.scm")) 15 | (load (string-append srcdir "/html.scm")) 16 | ) 17 | 18 | (define doc-arguments 19 | (list 20 | (list "-H" "file" "generate $arch.html in " 21 | #f 22 | (lambda (arg) (file-write arg cgen.html))) 23 | (list "-I" "file" "generate $arch-insn.html in " 24 | #f 25 | (lambda (arg) (file-write arg cgen-insn.html))) 26 | (list "-N" "file" "specify name of insn.html file" 27 | #f 28 | (lambda (arg) (set! *insn-html-file-name* arg))) 29 | ) 30 | ) 31 | 32 | ; Kept global so it's available to the other .scm files. 33 | (define srcdir ".") 34 | 35 | ; Scan argv for -s srcdir. 36 | ; We can't process any other args until we find the cgen source dir. 37 | ; The result is srcdir. 38 | ; We assume "-s" isn't the argument to another option. Unwise, yes. 39 | ; Alternatives are to require it to be the first argument or at least preceed 40 | ; any option with a "-s" argument, or to put knowledge of the common argument 41 | ; set and common argument parsing code in every top level file. 42 | 43 | (define (find-srcdir argv) 44 | (let loop ((argv argv)) 45 | (if (null? argv) 46 | (error "`-s srcdir' not present, can't load cgen")) 47 | (if (string=? "-s" (car argv)) 48 | (begin 49 | (if (null? (cdr argv)) 50 | (error "missing srcdir arg to `-s'")) 51 | (cadr argv)) 52 | (loop (cdr argv)))) 53 | ) 54 | 55 | ; Main routine, parses options and calls generators. 56 | 57 | (define (cgen-doc argv) 58 | (let () 59 | 60 | ; Find and set srcdir, then load all Scheme code. 61 | ; Drop the first argument, it is the script name (i.e. argv[0]). 62 | (set! srcdir (find-srcdir (cdr argv))) 63 | (set! %load-path (cons srcdir %load-path)) 64 | (load-files srcdir) 65 | 66 | (display-argv argv) 67 | 68 | (cgen #:argv argv 69 | #:app-name "doc" 70 | #:arg-spec doc-arguments 71 | #:init doc-init! 72 | #:finish doc-finish! 73 | #:analyze doc-analyze!) 74 | ) 75 | ) 76 | 77 | (cgen-doc (program-arguments)) 78 | -------------------------------------------------------------------------------- /cgen/cgen-gas.scm: -------------------------------------------------------------------------------- 1 | ; CPU description file generator for the GAS testsuite. 2 | ; Copyright (C) 2000, 2001, 2009 Red Hat, Inc. 3 | ; This file is part of CGEN. 4 | 5 | ; This is invoked to build several .s files and a "build script", 6 | ; which generates the .d files and .exp DejaGNU test case. 7 | 8 | ; Load the various support routines. 9 | 10 | (define (load-files srcdir) 11 | (load (string-append srcdir "/read.scm")) 12 | (load (string-append srcdir "/desc.scm")) 13 | (load (string-append srcdir "/desc-cpu.scm")) 14 | (load (string-append srcdir "/opcodes.scm")) 15 | (load (string-append srcdir "/opc-asmdis.scm")) 16 | (load (string-append srcdir "/opc-ibld.scm")) 17 | (load (string-append srcdir "/opc-itab.scm")) 18 | (load (string-append srcdir "/opc-opinst.scm")) 19 | (load (string-append srcdir "/gas-test.scm")) 20 | ) 21 | 22 | (define gas-arguments 23 | (list 24 | (list "-B" "file" "generate build script in " 25 | #f 26 | (lambda (arg) (file-write arg cgen-build.sh))) 27 | (list "-E" "file" "generate allinsn.exp in " 28 | #f 29 | (lambda (arg) (file-write arg cgen-allinsn.exp))) 30 | ) 31 | ) 32 | 33 | ; Kept global so it's available to the other .scm files. 34 | (define srcdir ".") 35 | 36 | ; Scan argv for -s srcdir. 37 | ; We can't process any other args until we find the cgen source dir. 38 | ; The result is srcdir. 39 | ; We assume "-s" isn't the argument to another option. Unwise, yes. 40 | ; Alternatives are to require it to be the first argument or at least preceed 41 | ; any option with a "-s" argument, or to put knowledge of the common argument 42 | ; set and common argument parsing code in every top level file. 43 | 44 | (define (find-srcdir argv) 45 | (let loop ((argv argv)) 46 | (if (null? argv) 47 | (error "`-s srcdir' not present, can't load cgen")) 48 | (if (string=? "-s" (car argv)) 49 | (begin 50 | (if (null? (cdr argv)) 51 | (error "missing srcdir arg to `-s'")) 52 | (cadr argv)) 53 | (loop (cdr argv)))) 54 | ) 55 | 56 | ; Main routine, parses options and calls generators. 57 | 58 | (define (cgen-gas argv) 59 | (let () 60 | 61 | ; Find and set srcdir, then load all Scheme code. 62 | ; Drop the first argument, it is the script name (i.e. argv[0]). 63 | (set! srcdir (find-srcdir (cdr argv))) 64 | (set! %load-path (cons srcdir %load-path)) 65 | (load-files srcdir) 66 | 67 | (display-argv argv) 68 | 69 | (cgen #:argv argv 70 | #:app-name "gas-test" 71 | #:arg-spec gas-arguments 72 | #:init gas-test-init! 73 | #:finish gas-test-finish! 74 | #:analyze gas-test-analyze!) 75 | ) 76 | ) 77 | 78 | (cgen-gas (program-arguments)) 79 | 80 | ;; FIXME: cgen-all will generate the opcodes files, not what we want 81 | -------------------------------------------------------------------------------- /cgen/cgen-idp.scm: -------------------------------------------------------------------------------- 1 | ; IDA Processor Module support 2 | ; By Yifan Lu 3 | ; Parts taken from other CGEN files 4 | ; 5 | ; This is a standalone script, we don't load anything until we parse the 6 | ; -s argument (keeps reliance off of environment variables, etc.). 7 | 8 | ; Load the various support routines. 9 | 10 | ; Ths order here is VERY IMPORTANT as some files overwrite certain functions 11 | ; and other files expect those functions to be overwritten (while other 12 | ; files expect them to NOT be overwritten) 13 | 14 | (define (load-files srcdir) 15 | (load (string-append srcdir "/read.scm")) 16 | (load (string-append srcdir "/opcodes.scm")) 17 | (load (string-append srcdir "/utils-sim.scm")) 18 | (load (string-append srcdir "/sim.scm")) 19 | (load (string-append srcdir "/sim-decode.scm")) 20 | (load (string-append srcdir "/sim-model.scm")) 21 | (load (string-append srcdir "/desc.scm")) 22 | (load (string-append srcdir "/desc-cpu.scm")) 23 | (load (string-append srcdir "/idp.scm")) 24 | (load (string-append srcdir "/idp-ana.scm")) 25 | (load (string-append srcdir "/idp-emu.scm")) 26 | (load (string-append srcdir "/idp-ins.scm")) 27 | (load (string-append srcdir "/idp-out.scm")) 28 | (load (string-append srcdir "/idp-arch.scm")) 29 | ) 30 | 31 | (define opc-arguments 32 | (list 33 | (list "-A" "file" "generate ana.cpp in " 34 | #f 35 | (lambda (arg) (file-write arg ana.cpp))) 36 | (list "-E" "file" "generate emu.cpp in " 37 | #f 38 | (lambda (arg) (file-write arg emu.cpp))) 39 | (list "-I" "file" "generate ins.cpp in " 40 | #f 41 | (lambda (arg) (file-write arg ins.cpp))) 42 | (list "-J" "file" "generate ins.hpp in " 43 | #f 44 | (lambda (arg) (file-write arg ins.hpp))) 45 | (list "-H" "file" "generate @arch@.hpp in " 46 | #f 47 | (lambda (arg) (file-write arg arch.hpp))) 48 | (list "-O" "file" "generate out.cpp in " 49 | #f 50 | (lambda (arg) (file-write arg out.cpp))) 51 | (list "-R" "file" "generate reg.cpp in " 52 | #f 53 | (lambda (arg) (file-write arg reg.cpp))) 54 | ) 55 | ) 56 | 57 | ; Kept global so it's available to the other .scm files. 58 | (define srcdir ".") 59 | 60 | ; Scan argv for -s srcdir. 61 | ; We can't process any other args until we find the cgen source dir. 62 | ; The result is srcdir. 63 | ; We assume "-s" isn't the argument to another option. Unwise, yes. 64 | ; Alternatives are to require it to be the first argument or at least preceed 65 | ; any option with a "-s" argument, or to put knowledge of the common argument 66 | ; set and common argument parsing code in every top level file. 67 | 68 | (define (find-srcdir argv) 69 | (let loop ((argv argv)) 70 | (if (null? argv) 71 | (error "`-s srcdir' not present, can't load cgen")) 72 | (if (string=? "-s" (car argv)) 73 | (begin 74 | (if (null? (cdr argv)) 75 | (error "missing srcdir arg to `-s'")) 76 | (cadr argv)) 77 | (loop (cdr argv)))) 78 | ) 79 | 80 | ; Main routine, parses options and calls generators. 81 | 82 | (define (cgen-idp argv) 83 | (let () 84 | 85 | ; Find and set srcdir, then load all Scheme code. 86 | ; Drop the first argument, it is the script name (i.e. argv[0]). 87 | (set! srcdir (find-srcdir (cdr argv))) 88 | (set! %load-path (cons srcdir %load-path)) 89 | (load-files srcdir) 90 | 91 | (display-argv argv) 92 | 93 | (cgen #:argv argv 94 | #:app-name "idp" 95 | #:arg-spec opc-arguments 96 | #:init idp-init! 97 | #:finish idp-finish! 98 | #:analyze idp-analyze!) 99 | ) 100 | ) 101 | 102 | (cgen-idp (program-arguments)) 103 | -------------------------------------------------------------------------------- /cgen/cgen-intrinsics.scm: -------------------------------------------------------------------------------- 1 | ; GCC "intrinsics" file entry point. 2 | ; 3 | ; This is invoked to build support files for registering intrinsic 4 | ; functions within gcc. this code has a fair bit of target-specific 5 | ; code in it. it's not a general-purpose module yet. 6 | ; 7 | ; Copyright (C) 2000, 2009 Red Hat, Inc. 8 | ; This file is part of CGEN. 9 | ; 10 | ; This is a standalone script, we don't load anything until we parse the 11 | ; -s argument (keeps reliance off of environment variables, etc.). 12 | 13 | ; Load the various support routines. 14 | 15 | (define (load-files srcdir) 16 | ; Fix up Scheme to be what we use (guile is always in flux). 17 | (primitive-load-path (string-append srcdir "/guile.scm")) 18 | 19 | (load (string-append srcdir "/read.scm")) 20 | (load (string-append srcdir "/intrinsics.scm")) 21 | ) 22 | 23 | (define intrinsics-isas '()) 24 | 25 | (define intrinsics-arguments 26 | (list 27 | (list "-K" "isa" "keep isa in intrinsics" #f 28 | (lambda (args) 29 | (for-each 30 | (lambda (arg) (set! intrinsics-isas (cons (string->symbol arg) intrinsics-isas))) 31 | (string-cut args #\,)))) 32 | (list "-M" "file" "generate insns.md in " #f 33 | (lambda (arg) (file-write arg insns.md))) 34 | (list "-N" "file" "generate intrinsics.h in " #f 35 | (lambda (arg) (file-write arg intrinsics.h))) 36 | (list "-P" "file" "generate intrinsic-protos.h in " #f 37 | (lambda (arg) (file-write arg intrinsic-protos.h))) 38 | (list "-T" "file" "generate intrinsic-testsuite.c in " #f 39 | (lambda (arg) (file-write arg intrinsic-testsuite.c))))) 40 | 41 | ; Kept global so it's available to the other .scm files. 42 | (define srcdir ".") 43 | 44 | ; Scan argv for -s srcdir. 45 | ; We can't process any other args until we find the cgen source dir. 46 | ; The result is srcdir. 47 | ; We assume "-s" isn't the argument to another option. Unwise, yes. 48 | ; Alternatives are to require it to be the first argument or at least preceed 49 | ; any option with a "-s" argument, or to put knowledge of the common argument 50 | ; set and common argument parsing code in every top level file. 51 | 52 | (define (find-srcdir argv) 53 | (let loop ((argv argv)) 54 | (if (null? argv) 55 | (error "`-s srcdir' not present, can't load cgen")) 56 | (if (string=? "-s" (car argv)) 57 | (begin 58 | (if (null? (cdr argv)) 59 | (error "missing srcdir arg to `-s'")) 60 | (cadr argv)) 61 | (loop (cdr argv)))) 62 | ) 63 | 64 | ; Main routine, parses options and calls generators. 65 | 66 | (define (cgen-intrinsics argv) 67 | (let () 68 | 69 | ; Find and set srcdir, then load all Scheme code. 70 | ; Drop the first argument, it is the script name (i.e. argv[0]). 71 | (set! srcdir (find-srcdir (cdr argv))) 72 | (set! %load-path (cons srcdir %load-path)) 73 | (load-files srcdir) 74 | 75 | (display-argv argv) 76 | 77 | (cgen #:argv argv 78 | #:app-name "intrinsics" 79 | #:arg-spec intrinsics-arguments 80 | #:analyze intrinsics-analyze!) 81 | ) 82 | ) 83 | 84 | (cgen-intrinsics (program-arguments)) 85 | -------------------------------------------------------------------------------- /cgen/cgen-opc.scm: -------------------------------------------------------------------------------- 1 | ; CPU description file generator for the GNU Binutils. 2 | ; This is invoked to build: $arch-desc.[ch], $arch-opinst.c, 3 | ; $arch-opc.h, $arch-opc.c, $arch-asm.in, $arch-dis.in, and $arch-ibld.[ch]. 4 | ; Copyright (C) 2000, 2009 Red Hat, Inc. 5 | ; This file is part of CGEN. 6 | ; 7 | ; This is a standalone script, we don't load anything until we parse the 8 | ; -s argument (keeps reliance off of environment variables, etc.). 9 | 10 | ; Load the various support routines. 11 | 12 | (define (load-files srcdir) 13 | (load (string-append srcdir "/read.scm")) 14 | (load (string-append srcdir "/desc.scm")) 15 | (load (string-append srcdir "/desc-cpu.scm")) 16 | (load (string-append srcdir "/opcodes.scm")) 17 | (load (string-append srcdir "/opc-asmdis.scm")) 18 | (load (string-append srcdir "/opc-ibld.scm")) 19 | (load (string-append srcdir "/opc-itab.scm")) 20 | (load (string-append srcdir "/opc-opinst.scm")) 21 | ) 22 | 23 | (define opc-arguments 24 | (list 25 | (list "-OPC" "file" "specify path to .opc file" 26 | (lambda (arg) (set-opc-file-path! arg)) 27 | #f) 28 | (list "-H" "file" "generate $arch-desc.h in " 29 | #f 30 | (lambda (arg) (file-write arg cgen-desc.h))) 31 | (list "-C" "file" "generate $arch-desc.c in " 32 | #f 33 | (lambda (arg) (file-write arg cgen-desc.c))) 34 | (list "-O" "file" "generate $arch-opc.h in " 35 | #f 36 | (lambda (arg) (file-write arg cgen-opc.h))) 37 | (list "-P" "file" "generate $arch-opc.c in " 38 | #f 39 | (lambda (arg) (file-write arg cgen-opc.c))) 40 | (list "-Q" "file" "generate $arch-opinst.c in " 41 | #f 42 | (lambda (arg) (file-write arg cgen-opinst.c))) 43 | (list "-B" "file" "generate $arch-ibld.h in " 44 | #f 45 | (lambda (arg) (file-write arg cgen-ibld.h))) 46 | (list "-L" "file" "generate $arch-ibld.in in " 47 | #f 48 | (lambda (arg) (file-write arg cgen-ibld.in))) 49 | (list "-A" "file" "generate $arch-asm.in in " 50 | #f 51 | (lambda (arg) (file-write arg cgen-asm.in))) 52 | (list "-D" "file" "generate $arch-dis.in in " 53 | #f 54 | (lambda (arg) (file-write arg cgen-dis.in))) 55 | ) 56 | ) 57 | 58 | ; (-R "file" "generate $cpu-reloc.h") ; FIXME: wip (rename to -abi.h?) 59 | ; (-S "file" "generate cpu-$cpu.c") ; FIXME: wip (bfd's cpu-$cpu.c) 60 | ; ((-R) (file-write *arg* cgen-reloc.c)) 61 | ; ((-S) (file-write *arg* cgen-bfdcpu.c)) 62 | 63 | ; Kept global so it's available to the other .scm files. 64 | (define srcdir ".") 65 | 66 | ; Scan argv for -s srcdir. 67 | ; We can't process any other args until we find the cgen source dir. 68 | ; The result is srcdir. 69 | ; We assume "-s" isn't the argument to another option. Unwise, yes. 70 | ; Alternatives are to require it to be the first argument or at least preceed 71 | ; any option with a "-s" argument, or to put knowledge of the common argument 72 | ; set and common argument parsing code in every top level file. 73 | 74 | (define (find-srcdir argv) 75 | (let loop ((argv argv)) 76 | (if (null? argv) 77 | (error "`-s srcdir' not present, can't load cgen")) 78 | (if (string=? "-s" (car argv)) 79 | (begin 80 | (if (null? (cdr argv)) 81 | (error "missing srcdir arg to `-s'")) 82 | (cadr argv)) 83 | (loop (cdr argv)))) 84 | ) 85 | 86 | ; Main routine, parses options and calls generators. 87 | 88 | (define (cgen-opc argv) 89 | (let () 90 | 91 | ; Find and set srcdir, then load all Scheme code. 92 | ; Drop the first argument, it is the script name (i.e. argv[0]). 93 | (set! srcdir (find-srcdir (cdr argv))) 94 | (set! %load-path (cons srcdir %load-path)) 95 | (load-files srcdir) 96 | 97 | (display-argv argv) 98 | 99 | (cgen #:argv argv 100 | #:app-name "opcodes" 101 | #:arg-spec opc-arguments 102 | #:init opcodes-init! 103 | #:finish opcodes-finish! 104 | #:analyze opcodes-analyze!) 105 | ) 106 | ) 107 | 108 | (cgen-opc (program-arguments)) 109 | -------------------------------------------------------------------------------- /cgen/cgen-sid.scm: -------------------------------------------------------------------------------- 1 | ; Simulator generator entry point. 2 | ; This is invoked to build: desc.h, cpu.h, defs.h, decode.h, decode.cxx, 3 | ; semantics.cxx, sem-switch.cxx, model.h, model.cxx 4 | ; Copyright (C) 2000, 2003, 2009 Red Hat, Inc. 5 | ; This file is part of CGEN. 6 | ; 7 | ; This is a standalone script, we don't load anything until we parse the 8 | ; -s argument (keeps reliance off of environment variables, etc.). 9 | 10 | ; Load the various support routines. 11 | 12 | (define (load-files srcdir) 13 | (load (string-append srcdir "/read.scm")) 14 | (load (string-append srcdir "/utils-sim.scm")) 15 | (load (string-append srcdir "/sid.scm")) 16 | (load (string-append srcdir "/sid-cpu.scm")) 17 | (load (string-append srcdir "/sid-model.scm")) 18 | (load (string-append srcdir "/sid-decode.scm")) 19 | ) 20 | 21 | (define sim-arguments 22 | (list 23 | (list "-H" "file" "generate desc.h in " 24 | #f 25 | (lambda (arg) (file-write arg cgen-desc.h))) 26 | (list "-C" "file" "generate cpu.h in " 27 | #f 28 | (lambda (arg) (file-write arg cgen-cpu.h))) 29 | (list "-E" "file" "generate defs.h in " 30 | #f 31 | (lambda (arg) (file-write arg cgen-defs.h))) 32 | (list "-T" "file" "generate decode.h in " 33 | #f 34 | (lambda (arg) (file-write arg cgen-decode.h))) 35 | (list "-D" "file" "generate decode.cxx in " 36 | #f 37 | (lambda (arg) (file-write arg cgen-decode.cxx))) 38 | (list "-W" "file" "generate write.cxx in " 39 | #f 40 | (lambda (arg) (file-write arg cgen-write.cxx))) 41 | (list "-S" "file" "generate semantics.cxx in " 42 | #f 43 | (lambda (arg) (file-write arg cgen-semantics.cxx))) 44 | (list "-X" "file" "generate sem-switch.cxx in " 45 | #f 46 | (lambda (arg) (file-write arg cgen-sem-switch.cxx))) 47 | (list "-M" "file" "generate model.cxx in " 48 | #f 49 | (lambda (arg) (file-write arg cgen-model.cxx))) 50 | (list "-N" "file" "generate model.h in " 51 | #f 52 | (lambda (arg) (file-write arg cgen-model.h))) 53 | ) 54 | ) 55 | 56 | ; Kept global so it's available to the other .scm files. 57 | (define srcdir ".") 58 | 59 | ; Scan argv for -s srcdir. 60 | ; We can't process any other args until we find the cgen source dir. 61 | ; The result is srcdir. 62 | ; We assume "-s" isn't the argument to another option. Unwise, yes. 63 | ; Alternatives are to require it to be the first argument or at least preceed 64 | ; any option with a "-s" argument, or to put knowledge of the common argument 65 | ; set and common argument parsing code in every top level file. 66 | 67 | (define (find-srcdir argv) 68 | (let loop ((argv argv)) 69 | (if (null? argv) 70 | (error "`-s srcdir' not present, can't load cgen")) 71 | (if (string=? "-s" (car argv)) 72 | (begin 73 | (if (null? (cdr argv)) 74 | (error "missing srcdir arg to `-s'")) 75 | (cadr argv)) 76 | (loop (cdr argv)))) 77 | ) 78 | 79 | ; Main routine, parses options and calls generators. 80 | 81 | (define (cgen-sim argv) 82 | (let () 83 | 84 | ; Find and set srcdir, then load all Scheme code. 85 | ; Drop the first argument, it is the script name (i.e. argv[0]). 86 | (set! srcdir (find-srcdir (cdr argv))) 87 | (set! %load-path (cons srcdir %load-path)) 88 | (load-files srcdir) 89 | 90 | (display-argv argv) 91 | 92 | (cgen #:argv argv 93 | #:app-name "sim" 94 | #:arg-spec sim-arguments 95 | #:init sim-init! 96 | #:finish sim-finish! 97 | #:analyze sim-analyze!) 98 | ) 99 | ) 100 | 101 | (cgen-sim (program-arguments)) 102 | -------------------------------------------------------------------------------- /cgen/cgen-sim.scm: -------------------------------------------------------------------------------- 1 | ; Simulator generator entry point. 2 | ; This is invoked to build: arch.h, cpu-.h, memops.h, semops.h, decode.h, 3 | ; decode.c, defs.h, extract.c, semantics.c, ops.c, model.c, mainloop.in. 4 | ; 5 | ; memops.h, semops.h, ops.c, mainloop.in are either deprecated or wip. 6 | ; 7 | ; Copyright (C) 2000, 2009 Red Hat, Inc. 8 | ; This file is part of CGEN. 9 | ; 10 | ; This is a standalone script, we don't load anything until we parse the 11 | ; -s argument (keeps reliance off of environment variables, etc.). 12 | 13 | ; Load the various support routines. 14 | 15 | (define (load-files srcdir) 16 | (load (string-append srcdir "/read.scm")) 17 | (load (string-append srcdir "/utils-sim.scm")) 18 | (load (string-append srcdir "/sim.scm")) 19 | (load (string-append srcdir "/sim-arch.scm")) 20 | (load (string-append srcdir "/sim-cpu.scm")) 21 | (load (string-append srcdir "/sim-model.scm")) 22 | (load (string-append srcdir "/sim-decode.scm")) 23 | ) 24 | 25 | (define sim-arguments 26 | (list 27 | (list "-A" "file" "generate arch.h in " 28 | #f 29 | (lambda (arg) (file-write arg cgen-arch.h))) 30 | (list "-B" "file" "generate arch.c in " 31 | #f 32 | (lambda (arg) (file-write arg cgen-arch.c))) 33 | (list "-C" "file" "generate cpu-.h in " 34 | #f 35 | (lambda (arg) (file-write arg cgen-cpu.h))) 36 | (list "-U" "file" "generate cpu-.c in " 37 | #f 38 | (lambda (arg) (file-write arg cgen-cpu.c))) 39 | (list "-N" "file" "generate cpu-all.h in " 40 | #f 41 | (lambda (arg) (file-write arg cgen-cpuall.h))) 42 | (list "-F" "file" "generate memops.h in " 43 | #f 44 | (lambda (arg) (file-write arg cgen-mem-ops.h))) 45 | (list "-G" "file" "generate defs.h in " 46 | #f 47 | (lambda (arg) (file-write arg cgen-defs.h))) 48 | (list "-P" "file" "generate semops.h in " 49 | #f 50 | (lambda (arg) (file-write arg cgen-sem-ops.h))) 51 | (list "-T" "file" "generate decode.h in " 52 | #f 53 | (lambda (arg) (file-write arg cgen-decode.h))) 54 | (list "-D" "file" "generate decode.c in " 55 | #f 56 | (lambda (arg) (file-write arg cgen-decode.c))) 57 | (list "-E" "file" "generate extract.c in " 58 | #f 59 | (lambda (arg) (file-write arg cgen-extract.c))) 60 | (list "-R" "file" "generate read.c in " 61 | #f 62 | (lambda (arg) (file-write arg cgen-read.c))) 63 | (list "-W" "file" "generate write.c in " 64 | #f 65 | (lambda (arg) (file-write arg cgen-write.c))) 66 | (list "-S" "file" "generate semantics.c in " 67 | #f 68 | (lambda (arg) (file-write arg cgen-semantics.c))) 69 | (list "-X" "file" "generate sem-switch.c in " 70 | #f 71 | (lambda (arg) (file-write arg cgen-sem-switch.c))) 72 | (list "-O" "file" "generate ops.c in " 73 | #f 74 | (lambda (arg) (file-write arg cgen-ops.c))) 75 | (list "-M" "file" "generate model.c in " 76 | #f 77 | (lambda (arg) (file-write arg cgen-model.c))) 78 | (list "-L" "file" "generate mainloop.in in " 79 | #f 80 | (lambda (arg) (file-write arg cgen-mainloop.in))) 81 | ) 82 | ) 83 | 84 | ; Kept global so it's available to the other .scm files. 85 | (define srcdir ".") 86 | 87 | ; Scan argv for -s srcdir. 88 | ; We can't process any other args until we find the cgen source dir. 89 | ; The result is srcdir. 90 | ; We assume "-s" isn't the argument to another option. Unwise, yes. 91 | ; Alternatives are to require it to be the first argument or at least preceed 92 | ; any option with a "-s" argument, or to put knowledge of the common argument 93 | ; set and common argument parsing code in every top level file. 94 | 95 | (define (find-srcdir argv) 96 | (let loop ((argv argv)) 97 | (if (null? argv) 98 | (error "`-s srcdir' not present, can't load cgen")) 99 | (if (string=? "-s" (car argv)) 100 | (begin 101 | (if (null? (cdr argv)) 102 | (error "missing srcdir arg to `-s'")) 103 | (cadr argv)) 104 | (loop (cdr argv)))) 105 | ) 106 | 107 | ; Main routine, parses options and calls generators. 108 | 109 | (define (cgen-sim argv) 110 | (let () 111 | 112 | ; Find and set srcdir, then load all Scheme code. 113 | ; Drop the first argument, it is the script name (i.e. argv[0]). 114 | (set! srcdir (find-srcdir (cdr argv))) 115 | (set! %load-path (cons srcdir %load-path)) 116 | (load-files srcdir) 117 | 118 | (display-argv argv) 119 | 120 | (cgen #:argv argv 121 | #:app-name "sim" 122 | #:arg-spec sim-arguments 123 | #:init sim-init! 124 | #:finish sim-finish! 125 | #:analyze sim-analyze!) 126 | ) 127 | ) 128 | 129 | (cgen-sim (program-arguments)) 130 | -------------------------------------------------------------------------------- /cgen/cgen-stest.scm: -------------------------------------------------------------------------------- 1 | ; CPU description file generator for the simulator testsuite. 2 | ; Copyright (C) 2000, 2009 Red Hat, Inc. 3 | ; This file is part of CGEN. 4 | 5 | ; This is invoked to build several .s files and a script to run to 6 | ; generate the .d files and .exp file. 7 | ; This is invoked to build: tmp-build.sh cpu-cpu.exp 8 | 9 | ; Load the various support routines 10 | (define (load-files srcdir) 11 | (load (string-append srcdir "/read.scm")) 12 | (load (string-append srcdir "/desc.scm")) 13 | (load (string-append srcdir "/desc-cpu.scm")) 14 | (load (string-append srcdir "/opcodes.scm")) 15 | (load (string-append srcdir "/opc-asmdis.scm")) 16 | (load (string-append srcdir "/opc-ibld.scm")) 17 | (load (string-append srcdir "/opc-itab.scm")) 18 | (load (string-append srcdir "/opc-opinst.scm")) 19 | (load (string-append srcdir "/sim-test.scm")) 20 | ) 21 | 22 | (define stest-arguments 23 | (list 24 | (list "-B" "file" "generate build.sh" 25 | #f 26 | (lambda (arg) (file-write arg cgen-build.sh))) 27 | (list "-E" "file" "generate the testsuite .exp" 28 | #f 29 | (lambda (arg) (file-write arg cgen-allinsn.exp))) 30 | ) 31 | ) 32 | 33 | ; Kept global so it's available to the other .scm files. 34 | (define srcdir ".") 35 | 36 | ; Scan argv for -s srcdir. 37 | ; We can't process any other args until we find the cgen source dir. 38 | ; The result is srcdir. 39 | ; We assume "-s" isn't the argument to another option. Unwise, yes. 40 | ; Alternatives are to require it to be the first argument or at least preceed 41 | ; any option with a "-s" argument, or to put knowledge of the common argument 42 | ; set and common argument parsing code in every top level file. 43 | 44 | (define (find-srcdir argv) 45 | (let loop ((argv argv)) 46 | (if (null? argv) 47 | (error "`-s srcdir' not present, can't load cgen")) 48 | (if (string=? "-s" (car argv)) 49 | (begin 50 | (if (null? (cdr argv)) 51 | (error "missing srcdir arg to `-s'")) 52 | (cadr argv)) 53 | (loop (cdr argv)))) 54 | ) 55 | 56 | ; Main routine, parses options and calls generators. 57 | 58 | (define (cgen-stest argv) 59 | (let () 60 | 61 | ; Find and set srcdir, then load all Scheme code. 62 | ; Drop the first argument, it is the script name (i.e. argv[0]). 63 | (set! srcdir (find-srcdir (cdr argv))) 64 | (set! %load-path (cons srcdir %load-path)) 65 | (load-files srcdir) 66 | 67 | (display-argv argv) 68 | 69 | (cgen #:argv argv 70 | #:app-name "sim-test" 71 | #:arg-spec stest-arguments 72 | #:init sim-test-init! 73 | #:finish sim-test-finish! 74 | #:analyze sim-test-analyze!) 75 | ) 76 | ) 77 | 78 | (cgen-stest (program-arguments)) 79 | 80 | ;; FIXME: cgen-all will generate the opcodes files, not what we want 81 | -------------------------------------------------------------------------------- /cgen/cgen-testsuite.scm: -------------------------------------------------------------------------------- 1 | ; CGEN testsuite driver. 2 | ; Copyright (C) 2009 Doug Evans 3 | ; This file is part of CGEN. 4 | ; 5 | ; This is a standalone script, we don't load anything until we parse the 6 | ; -s argument (keeps reliance off of environment variables, etc.). 7 | 8 | ; Load the various support routines. 9 | 10 | (define (load-files srcdir) 11 | (load (string-append srcdir "/read.scm")) 12 | (load (string-append srcdir "/desc.scm")) 13 | (load (string-append srcdir "/desc-cpu.scm")) 14 | (load (string-append srcdir "/testsuite.scm")) 15 | ) 16 | 17 | (define testsuite-arguments 18 | (list 19 | (list "-T" "file" "generate $arch-test.h in " 20 | #f 21 | (lambda (arg) (file-write arg cgen-test.h))) 22 | ) 23 | ) 24 | 25 | ; Kept global so it's available to the other .scm files. 26 | (define srcdir ".") 27 | 28 | ; Scan argv for -s srcdir. 29 | ; We can't process any other args until we find the cgen source dir. 30 | ; The result is srcdir. 31 | ; We assume "-s" isn't the argument to another option. Unwise, yes. 32 | ; Alternatives are to require it to be the first argument or at least preceed 33 | ; any option with a "-s" argument, or to put knowledge of the common argument 34 | ; set and common argument parsing code in every top level file. 35 | 36 | (define (find-srcdir argv) 37 | (let loop ((argv argv)) 38 | (if (null? argv) 39 | (error "`-s srcdir' not present, can't load cgen")) 40 | (if (string=? "-s" (car argv)) 41 | (begin 42 | (if (null? (cdr argv)) 43 | (error "missing srcdir arg to `-s'")) 44 | (cadr argv)) 45 | (loop (cdr argv)))) 46 | ) 47 | 48 | ; Main routine, parses options and calls generators. 49 | 50 | (define (cgen-testsuite argv) 51 | (let () 52 | 53 | ; Find and set srcdir, then load all Scheme code. 54 | ; Drop the first argument, it is the script name (i.e. argv[0]). 55 | (set! srcdir (find-srcdir (cdr argv))) 56 | (set! %load-path (cons srcdir %load-path)) 57 | (load-files srcdir) 58 | 59 | (display-argv argv) 60 | 61 | (cgen #:argv argv 62 | #:app-name "testsuite" 63 | #:arg-spec testsuite-arguments 64 | #:init testsuite-init! 65 | #:finish testsuite-finish! 66 | #:analyze testsuite-analyze!) 67 | ) 68 | ) 69 | 70 | (cgen-testsuite (program-arguments)) 71 | -------------------------------------------------------------------------------- /cgen/co-for-gen-all: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Script to check out a tree for use by gen-all. 3 | # 4 | # Copyright 2012 Free Software Foundation 5 | # 6 | # This file is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; see the file COPYING3. If not see 18 | # . 19 | # 20 | 21 | if [ $# != 1 ] 22 | then 23 | echo "missing sourceware id" >&2 24 | exit 1 25 | fi 26 | 27 | id=$1 28 | 29 | rm -f co-gcc.log 30 | svn co svn+ssh://${id}@gcc.gnu.org/svn/gcc/trunk gcc >& co-gcc.log 31 | 32 | rm -f co-binutils.log 33 | cvs -d :ext:${id}@sourceware.org:/cvs/src co binutils >& co-binutils.log 34 | 35 | rm -f co-cgen.log 36 | cvs -d :ext:${id}@sourceware.org:/cvs/src co naked-cgen >& co-cgen.log 37 | 38 | rm -f co-sid.log 39 | sid_modules="naked-sid naked-tcl naked-tk" 40 | cvs -d :ext:${id}@sourceware.org:/cvs/src co ${sid_modules} >& co-sid.log 41 | 42 | rm -f co-gdb.log 43 | gdb_modules="naked-gdb naked-sim naked-readline naked-libdecnumber" 44 | cvs -d :ext:${id}@sourceware.org:/cvs/src co ${gdb_modules} >& co-gdb.log 45 | 46 | rm -f co-newlib.log 47 | newlib_modules="naked-newlib naked-libgloss" 48 | cvs -d :ext:${id}@sourceware.org:/cvs/src co ${dejagnu_modules} >& co-newlib.log 49 | 50 | # dejagnu is gone from sourceware 51 | #rm -f co-dejagnu.log 52 | #dejagnu_modules="naked-dejagnu naked-expect" 53 | #cvs -d :ext:${id}@sourceware.org:/cvs/src co ${dejagnu_modules} >& co-dejagnu.log 54 | 55 | for pkg in gcc binutils cgen sid gdb newlib 56 | do 57 | echo "-------------------" 58 | echo "Updated in $pkg ..." 59 | grep "^U " co-${pkg}.log 60 | done 61 | 62 | for pkg in gcc binutils cgen sid gdb newlib 63 | do 64 | echo "-------------------" 65 | echo "New/modified in $pkg ..." 66 | grep "^[AMC] " co-${pkg}.log 67 | done 68 | -------------------------------------------------------------------------------- /cgen/configure.in: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | dnl 3 | dnl Copyright 2012 Free Software Foundation 4 | dnl 5 | dnl This file is free software; you can redistribute it and/or modify 6 | dnl it under the terms of the GNU General Public License as published by 7 | dnl the Free Software Foundation; either version 3 of the License, or 8 | dnl (at your option) any later version. 9 | dnl 10 | dnl This program is distributed in the hope that it will be useful, 11 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | dnl GNU General Public License for more details. 14 | dnl 15 | dnl You should have received a copy of the GNU General Public License 16 | dnl along with this program; see the file COPYING3. If not see 17 | dnl . 18 | dnl 19 | 20 | AC_PREREQ(2.59) 21 | AC_INIT(read.scm) 22 | AC_CANONICAL_SYSTEM 23 | dnl The "50" is a generic indicator that we're between 1.1 and 1.2. 24 | AM_INIT_AUTOMAKE(cgen, 1.1.50) 25 | 26 | AC_PROG_INSTALL 27 | AC_EXEEXT 28 | 29 | # Set target cpu. 30 | arch=${target_cpu} 31 | AC_SUBST(arch) 32 | 33 | AM_MAINTAINER_MODE 34 | 35 | # See doc/Makefile.am. 36 | AM_CONDITIONAL(GENINSRC_NEVER, false) 37 | 38 | AC_OUTPUT([Makefile doc/Makefile testsuite/Makefile testsuite/test-utils.sh]) 39 | -------------------------------------------------------------------------------- /cgen/cos-pprint.scm: -------------------------------------------------------------------------------- 1 | ;;;; cos-pprint.scm --- pretty-print definitions for COS 2 | ;;;; Copyright (C) 2005, 2009 Red Hat, Inc. 3 | ;;;; This file is part of CGEN. 4 | ;;;; See file COPYING.CGEN for details. 5 | 6 | ;;; To use this with pprint.scm: 7 | ;;; 8 | ;;; (load "pprint.scm") 9 | ;;; (load "cos-pprint.scm") 10 | ;;; 11 | ;;; You must load this file second, so it can redefine the ELIDE? and 12 | ;;; ELIDED-NAME hooks. 13 | ;;; 14 | ;;; See the documentation in pprint.scm for details. 15 | 16 | (define (elide? obj) 17 | (or (object? obj) (class? obj))) 18 | 19 | (define (elided-name obj) 20 | (cond ((class? obj) `(class ,(class-name obj))) 21 | ((object? obj) 22 | `(object ,(class-name (object-class obj)) 23 | ,@(if (method-present? obj 'get-name) 24 | (list (send obj 'get-name)) 25 | '()))) 26 | (else (error "unexpected elided object")))) 27 | -------------------------------------------------------------------------------- /cgen/cpu/arm.sim: -------------------------------------------------------------------------------- 1 | ; ARM CPU simulator support. -*- Scheme -*- 2 | ; Copyright (C) 2000 Red Hat, Inc. 3 | ; This file is part of CGEN. 4 | ; See file COPYING.CGEN for details. 5 | 6 | ; N.B. 7 | ; - The format of this file is *extremely* wip! 8 | ; - This isn't intended to be simulator independent, it is an application 9 | ; specific file and not all simulator apps are equivalent. 10 | ; - This file is loaded after all the .cpu files are loaded. 11 | 12 | ; ??? The application (e.g. simulator) may wish to do further processing when 13 | ; the tbit is set. For a C++ simulator what one would want to do is override 14 | ; the "set" method. That presumes there's a "set" method to override and 15 | ; that all affected code uses it. There are several to accomplish this. 16 | ; The first way to accomplish this is to have all code always 17 | ; access hardware elements through their get/set methods. Perhaps ok, 18 | ; but also maybe overkill. The second is to specify those that use get/set 19 | ; methods. One could do this for elements that have get/set specs, but this 20 | ; requires the .cpu file to get it right (and to change when it isn't). 21 | ; A variant of the second is to move this info to an application specific 22 | ; file (much like what .opc files are although even they have the problem of 23 | ; requiring collaboration with the .cpu file. -- to be fixed!). 24 | ; The solution taken here is the latter. 25 | 26 | ; The h-tbit and h-mbits registers need extra processing when they are set. 27 | ; This is done by specifying the FUN-SET attribute, which causes all machine 28 | ; generated references to go through the `set' access method. 29 | ; Oh no, not FUN-ACCESS again! :-) 30 | 31 | (modify-hardware 32 | (name h-tbit) 33 | (add-attrs FUN-SET) 34 | ) 35 | 36 | (modify-hardware 37 | (name h-mbits) 38 | (add-attrs FUN-SET) 39 | ) 40 | -------------------------------------------------------------------------------- /cgen/cpu/i960.opc: -------------------------------------------------------------------------------- 1 | /* Intel 80960 opcode support. -*- C -*- 2 | Copyright (C) 2000, 2005 Red Hat, Inc. 3 | This file is part of CGEN. */ 4 | 5 | /* This file is an addendum to i960.cpu. Heavy use of C code isn't 6 | appropriate in .cpu files, so it resides here. This especially applies 7 | to assembly/disassembly where parsing/printing can be quite involved. 8 | Such things aren't really part of the specification of the cpu, per se, 9 | so .cpu files provide the general framework and .opc files handle the 10 | nitty-gritty details as necessary. 11 | 12 | Each section is delimited with start and end markers. 13 | 14 | -opc.h additions use: "-- opc.h" 15 | -opc.c additions use: "-- opc.c" 16 | -asm.c additions use: "-- asm.c" 17 | -dis.c additions use: "-- dis.c" 18 | -ibd.h additions use: "-- ibd.h". */ 19 | 20 | /* -- opc.h */ 21 | 22 | #undef CGEN_DIS_HASH_SIZE 23 | #define CGEN_DIS_HASH_SIZE 256 24 | #undef CGEN_DIS_HASH 25 | #define CGEN_DIS_HASH(buffer, value) ((unsigned char *) (buffer))[3] 26 | 27 | /* ??? Until cgen disassembler complete and functioning well, redirect back 28 | to old disassembler. */ 29 | #define CGEN_PRINT_INSN(od, pc, info) print_insn_i960_orig (pc, info) 30 | 31 | /* -- */ 32 | -------------------------------------------------------------------------------- /cgen/cpu/play.opc: -------------------------------------------------------------------------------- 1 | /* Play opcode support. -*- C -*- 2 | Copyright (C) 2009 Red Hat, Inc. 3 | This file is part of CGEN. */ 4 | 5 | /* This file is an addendum to play.cpu. Heavy use of C code isn't 6 | appropriate in .cpu files, so it resides here. This especially applies 7 | to assembly/disassembly where parsing/printing can be quite involved. 8 | Such things aren't really part of the specification of the cpu, per se, 9 | so .cpu files provide the general framework and .opc files handle the 10 | nitty-gritty details as necessary. 11 | 12 | Each section is delimited with start and end markers. 13 | 14 | -opc.h additions use: "-- opc.h" 15 | -opc.c additions use: "-- opc.c" 16 | -asm.c additions use: "-- asm.c" 17 | -dis.c additions use: "-- dis.c" 18 | -ibd.h additions use: "-- ibd.h" */ 19 | -------------------------------------------------------------------------------- /cgen/cpu/sh-sid.cpu: -------------------------------------------------------------------------------- 1 | ; SuperH SHcompact instruction set description. -*- Scheme -*- 2 | ; Copyright (C) 2006 Red Hat, Inc. 3 | ; This file is part of CGEN. 4 | ; See file COPYING.CGEN for details. 5 | 6 | ; Syntax for "delay" is different for SID vs SIM. 7 | (define-pmacro (set-delay del targ src) 8 | (set (delay del targ) src) 9 | ) 10 | 11 | ; SID uses parallel insns to implement "delay", 12 | (define-pmacro (isa-parallel-insns n) 13 | (parallel-insns n) 14 | ) 15 | 16 | ; Call save_delayed_pc for SID. 17 | (define-pmacro (save-delayed-pc disp) 18 | (c-call VOID "save_delayed_pc" disp) 19 | ) 20 | 21 | ; Call save_branch_prediction for SID. 22 | (define-pmacro (save-branch-prediction tra likely) 23 | (c-call "save_branch_prediction" tra likely) 24 | ) 25 | 26 | ; Call save_branch_optimization for SID. 27 | (define-pmacro (save-branch-optimization likely) 28 | (c-call "save_branch_optimization" likely) 29 | ) 30 | 31 | ; Call sh64_save_cfg_address for SID. 32 | (define-pmacro (save-cfg-address address) 33 | (c-call "sh64_save_cfg_address" address) 34 | ) 35 | 36 | ; For making profiling calls and dynamic configuration. 37 | (define-pmacro (cg-profile caller callee) 38 | (c-call "cg_profile" caller callee) 39 | ) 40 | (define-pmacro (cg-profile-delay caller callee delay) 41 | (c-call "cg_profile" caller callee delay) 42 | ) 43 | (define-pmacro (notify-ret pr) 44 | (c-call VOID "notify_ret" pr) 45 | ) 46 | ; For dynamic configuration only. 47 | (define-pmacro (cg-profile-jump caller callee) 48 | (c-call "cg_profile_jump" caller callee) 49 | ) 50 | -------------------------------------------------------------------------------- /cgen/cpu/sh-sim.cpu: -------------------------------------------------------------------------------- 1 | ; SuperH SHcompact instruction set description. -*- Scheme -*- 2 | ; Copyright (C) 2006 Red Hat, Inc. 3 | ; This file is part of CGEN. 4 | ; See file COPYING.CGEN for details. 5 | 6 | ; Syntax for "delay" is different for SID vs SIM. 7 | (define-pmacro (set-delay del targ src) 8 | (delay del (set targ src))) 9 | 10 | ; SIM does not use parallel insns to implement "delay". 11 | (define-pmacro (isa-parallel-insns n) 12 | (parallel-insns 1) 13 | ) 14 | 15 | ; Not needed for the sim. 16 | (define-pmacro (save-delayed-pc disp) 17 | (nop) 18 | ) 19 | 20 | (define-pmacro (save-branch-prediction tra likely) 21 | (nop) 22 | ) 23 | 24 | (define-pmacro (save-branch-optimization likely) 25 | (nop) 26 | ) 27 | 28 | (define-pmacro (save-cfg-address address) 29 | (nop) 30 | ) 31 | 32 | ; For making profiling calls and dynamic configuration. 33 | (define-pmacro (cg-profile caller callee) 34 | (nop) 35 | ) 36 | (define-pmacro (cg-profile-delay caller callee delay) 37 | (nop) 38 | ) 39 | (define-pmacro (notify-ret pr) 40 | (nop) 41 | ) 42 | ; For dynamic configuration only. 43 | (define-pmacro (cg-profile-jump caller callee) 44 | (nop) 45 | ) 46 | 47 | -------------------------------------------------------------------------------- /cgen/cpu/sh.opc: -------------------------------------------------------------------------------- 1 | /* SHmedia opcode support. -*- C -*- 2 | Copyright (C) 2000, 2001, 2005 Red Hat, Inc. 3 | This file is part of CGEN. */ 4 | 5 | /* This file is an addendum to sh-media.cpu. Heavy use of C code isn't 6 | appropriate in .cpu files, so it resides here. This especially applies 7 | to assembly/disassembly where parsing/printing can be quite involved. 8 | Such things aren't really part of the specification of the cpu, per se, 9 | so .cpu files provide the general framework and .opc files handle the 10 | nitty-gritty details as necessary. 11 | 12 | Each section is delimited with start and end markers. 13 | 14 | -opc.h additions use: "-- opc.h" 15 | -opc.c additions use: "-- opc.c" 16 | -asm.c additions use: "-- asm.c" 17 | -dis.c additions use: "-- dis.c" 18 | -ibd.h additions use: "-- ibd.h" */ 19 | 20 | /* -- opc.h */ 21 | 22 | /* Allows reason codes to be output when assembler errors occur. */ 23 | #define CGEN_VERBOSE_ASSEMBLER_ERRORS 24 | 25 | /* Override disassembly hashing - there are variable bits in the top 26 | byte of these instructions. */ 27 | #define CGEN_DIS_HASH_SIZE 8 28 | #define CGEN_DIS_HASH(buf,value) (((* (unsigned char*) (buf)) >> 6) % CGEN_DIS_HASH_SIZE) 29 | 30 | /* -- asm.c */ 31 | 32 | static const char * 33 | parse_fsd (CGEN_CPU_DESC cd, 34 | const char ** strp, 35 | int opindex, 36 | long * valuep) 37 | { 38 | abort (); 39 | } 40 | 41 | /* -- dis.c */ 42 | 43 | static void 44 | print_likely (CGEN_CPU_DESC cd, 45 | void * dis_info, 46 | long value, 47 | unsigned int attrs, 48 | bfd_vma pc, 49 | int length) 50 | { 51 | disassemble_info *info = (disassemble_info *) dis_info; 52 | 53 | (*info->fprintf_func) (info->stream, (value) ? "/l" : "/u"); 54 | } 55 | 56 | /* -- */ 57 | -------------------------------------------------------------------------------- /cgen/dev-utils.scm: -------------------------------------------------------------------------------- 1 | ;; CGEN Debugging support. 2 | ;; Copyright (C) 2000, 2009 Red Hat, Inc. 3 | ;; This file is part of CGEN. 4 | ;; See file COPYING.CGEN for details. 5 | 6 | ;; This file contains a collection of utilities for use when 7 | ;; analyzing cpu files from Scheme. 8 | 9 | (define srcdir ".") 10 | (set! %load-path (cons srcdir %load-path)) 11 | 12 | (define (load-doc) 13 | (load "read") 14 | (load "desc") 15 | (load "desc-cpu") 16 | (load "html") 17 | ; ??? Necessary for the following case, dunno why. 18 | ; bash$ guile -l dev.scm 19 | ; guile> (load-doc) 20 | ; guile> (cload #:arch "./cpu/m32r.cpu") 21 | (set! APPLICATION 'DOC) 22 | ) 23 | 24 | (define (load-opc) 25 | (load "read") 26 | (load "desc") 27 | (load "desc-cpu") 28 | (load "opcodes") 29 | (load "opc-asmdis") 30 | (load "opc-ibld") 31 | (load "opc-itab") 32 | (load "opc-opinst") 33 | (set! APPLICATION 'OPCODES) 34 | ) 35 | 36 | (define (load-gtest) 37 | (load-opc) 38 | (load "gas-test") 39 | (set! APPLICATION 'GAS-TEST) 40 | ) 41 | 42 | (define (load-sid) 43 | (load "read") 44 | (load "utils-sim") 45 | (load "sid") 46 | (load "sid-cpu") 47 | (load "sid-model") 48 | (load "sid-decode") 49 | (set! APPLICATION 'SID-SIMULATOR) 50 | ) 51 | 52 | (define (load-sim) 53 | (load "read") 54 | (load "desc") 55 | (load "desc-cpu") 56 | (load "utils-sim") 57 | (load "sim") 58 | (load "sim-arch") 59 | (load "sim-cpu") 60 | (load "sim-model") 61 | (load "sim-decode") 62 | (set! APPLICATION 'SIMULATOR) 63 | ) 64 | 65 | (define (load-stest) 66 | (load-opc) 67 | (load "sim-test") 68 | (set! APPLICATION 'SIM-TEST) 69 | ) 70 | 71 | (define (load-testsuite) 72 | (load "read") 73 | (load "desc") 74 | (load "desc-cpu") 75 | (load "testsuite.scm") 76 | (set! APPLICATION 'TESTSUITE) 77 | ) 78 | -------------------------------------------------------------------------------- /cgen/doc/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in 2 | # 3 | # Copyright 2012 Free Software Foundation 4 | # 5 | # This file is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not see 17 | # . 18 | # 19 | 20 | AUTOMAKE_OPTIONS = cygnus 21 | 22 | # List of files that go into cgen.info. 23 | DOCFILES = app.texi cgen.texi credits.texi glossary.texi intro.texi \ 24 | notes.texi opcodes.texi pmacros.texi porting.texi \ 25 | rtl.texi running.texi sim.texi 26 | 27 | info_TEXINFOS = cgen.texi cgenint.texi 28 | 29 | # version.texi is handled by autoconf/automake 30 | cgen_TEXINFOS = $(DOCFILES) 31 | 32 | # versionint.texi is handled by autoconf/automake 33 | cgenint_TEXINFOS = cgenint.texi glossary.texi 34 | 35 | # These aren't ready for prime time yet. Not even a little bit. 36 | 37 | noinst_TEXINFOS = cgen.texi cgenint.texi 38 | 39 | # Maintenance 40 | 41 | MAINTAINERCLEANFILES = cgen.info cgenint.info 42 | 43 | # Automake 1.9 will only build info files in the objdir if they are 44 | # mentioned in DISTCLEANFILES. It doesn't have to be unconditional, 45 | # though, so we use a bogus condition. 46 | # NOTE: This is copied from gas. 47 | if GENINSRC_NEVER 48 | DISTCLEANFILES = cgen.info cgenint.info 49 | endif 50 | -------------------------------------------------------------------------------- /cgen/doc/cgen.texi: -------------------------------------------------------------------------------- 1 | \input texinfo @c -*- Texinfo -*- 2 | @setfilename cgen.info 3 | 4 | @include version.texi 5 | 6 | @ifinfo 7 | @format 8 | START-INFO-DIR-ENTRY 9 | * Cgen: (cgen). The Cpu tools GENerator. 10 | END-INFO-DIR-ENTRY 11 | @end format 12 | @end ifinfo 13 | 14 | @copying 15 | Copyright @copyright{} 2000, 2007, 2009 Red Hat, Inc. 16 | 17 | Permission is granted to make and distribute verbatim copies of 18 | this manual provided the copyright notice and this permission notice 19 | are preserved on all copies. 20 | 21 | Permission is granted to copy and distribute modified versions of this 22 | manual under the conditions for verbatim copying, provided also that 23 | the entire resulting derived work is distributed under the terms of a 24 | permission notice identical to this one. 25 | 26 | Permission is granted to copy and distribute translations of this manual 27 | into another language, under the above conditions for modified versions. 28 | @end copying 29 | 30 | @synindex ky cp 31 | @c 32 | @c This file documents the Cpu tools GENerator, CGEN. 33 | @c 34 | @c Copyright (C) 2000, 2009 Red Hat, Inc. 35 | @c 36 | 37 | @setchapternewpage odd 38 | @settitle CGEN 39 | @titlepage 40 | @finalout 41 | @title The Cpu tools GENerator, CGEN. 42 | @subtitle Version @value{VERSION} 43 | @sp 1 44 | @subtitle @value{UPDATED} 45 | @author Douglas J. Evans 46 | @page 47 | 48 | @tex 49 | {\parskip=0pt \hfill Red Hat\par \hfill 50 | \TeX{}info \texinfoversion\par } 51 | @end tex 52 | 53 | @vskip 0pt plus 1filll 54 | Copyright @copyright{} 2000, 2009 Red Hat, Inc. 55 | 56 | Permission is granted to make and distribute verbatim copies of 57 | this manual provided the copyright notice and this permission notice 58 | are preserved on all copies. 59 | 60 | Permission is granted to copy and distribute modified versions of this 61 | manual under the conditions for verbatim copying, provided also that 62 | the entire resulting derived work is distributed under the terms of a 63 | permission notice identical to this one. 64 | 65 | Permission is granted to copy and distribute translations of this manual 66 | into another language, under the above conditions for modified versions. 67 | @end titlepage 68 | 69 | @node Top 70 | @top Introduction 71 | 72 | @cindex version 73 | This manual documents the CGEN program, 74 | version @value{VERSION}. 75 | 76 | @menu 77 | * Introduction:: Introduction 78 | * Running CGEN:: How to run CGEN 79 | * RTL:: The Register Transfer Language CGEN uses 80 | * Preprocessor macros:: Macros to simplify description file writing 81 | * Porting:: Porting 82 | * Opcodes:: Assembler/disassembler support 83 | * Simulation:: Simulation support 84 | * Writing an application:: Writing your own CGEN application 85 | * Glossary:: Glossary 86 | * Miscellaneous notes:: Notes needing a better home 87 | * Credits:: Credits 88 | * Index:: Index 89 | @end menu 90 | 91 | @include intro.texi 92 | @include running.texi 93 | @include rtl.texi 94 | @include pmacros.texi 95 | @include porting.texi 96 | @include opcodes.texi 97 | @include sim.texi 98 | @include app.texi 99 | @include glossary.texi 100 | @include notes.texi 101 | @include credits.texi 102 | 103 | @node Index 104 | @unnumbered Index 105 | 106 | @printindex cp 107 | 108 | @contents 109 | @bye 110 | -------------------------------------------------------------------------------- /cgen/doc/credits.texi: -------------------------------------------------------------------------------- 1 | @c Copyright (C) 2000, 2010 Red Hat, Inc. 2 | @c This file is part of the CGEN manual. 3 | @c For copying conditions, see the file cgen.texi. 4 | 5 | @node Credits 6 | @chapter Credits 7 | 8 | The following people, listed in alphabetical order, have contributed to 9 | CGEN in their own way--thanks! If you feel your name has been wrongly 10 | omitted from this list, please contact one of the maintainers. 11 | 12 | @itemize @minus 13 | @item Dave Brolley 14 | @item Andrew Cagney 15 | @item Steve Chamberlain 16 | @item Nick Clifton 17 | @item Bob Cmelik 18 | @item Frank Ch. Eigler 19 | @item Ben Elliston 20 | @item Matthew Green 21 | @item Kim Knuttila 22 | @item Greg McGary 23 | @item Ken Raeburn 24 | @item Ian Lance Taylor 25 | @item Jim Wilson 26 | @end itemize 27 | -------------------------------------------------------------------------------- /cgen/doc/glossary.texi: -------------------------------------------------------------------------------- 1 | @c Copyright (C) 2000, 2009 Red Hat, Inc. 2 | @c This file is part of the CGEN manual. 3 | @c For copying conditions, see the file cgen.texi. 4 | 5 | @node Glossary 6 | @chapter Glossary 7 | 8 | @table @asis 9 | 10 | @item arch 11 | This is the overall architecture. It is the same as BFD's use of 12 | @emph{arch}. 13 | 14 | @item isa 15 | Acronym for Instruction Set Architecture. 16 | 17 | @item mach 18 | This is a variant of the architecture, short for machine. It is 19 | essentially the same as BFD's use of @emph{mach}. 20 | 21 | @item cpu family 22 | A group of related mach's. Simulator support is organized along ``cpu 23 | family'' lines to keep related machs together under one roof to 24 | simplify things. The organization is semi-arbitrary and is up to the 25 | programmer. 26 | 27 | @item model 28 | An implementation of a mach. It is essentially akin to the argument 29 | to @code{-mtune=} in SPARC GCC (and other GCC ports). 30 | 31 | @item ifield 32 | An instruction field. 33 | 34 | @item iformat 35 | An instruction format, as specified by the instruction's fields. 36 | 37 | @item sformat 38 | An instruction semantic format. 39 | This is different from @code{iformat}. 40 | For example, if an operand is referred to in one mode by 41 | one instruction and in a different mode by another instruction, then these 42 | two insns would have different sformats even if they have the same iformat. 43 | 44 | @item insn 45 | An instruction. 46 | 47 | @end table 48 | -------------------------------------------------------------------------------- /cgen/doc/sim.texi: -------------------------------------------------------------------------------- 1 | @c Copyright (C) 2000, 2009 Red Hat, Inc. 2 | @c This file is part of the CGEN manual. 3 | @c For copying conditions, see the file cgen.texi. 4 | 5 | @node Simulation 6 | @chapter Simulation support 7 | @cindex Simulation support 8 | 9 | Simulator support comes in the form of machine generated the decoder/executer 10 | as well as the structure that records CPU state information (i.e., registers). 11 | 12 | There are currently two simulators that use CGEN: 13 | 14 | @menu 15 | * GDB Simulator:: 16 | * SID Simulator:: 17 | @end menu 18 | 19 | @node GDB Simulator 20 | @section GDB Simulator 21 | 22 | Several simulators in the GDB tree use CGEN. 23 | These simulators use a combination of the CGEN-generated files, 24 | common files in the sim/common directory of GDB releases, 25 | and custom target-specific code. 26 | 27 | There are 3 architecture-wide generated files: 28 | 29 | @table @file 30 | @item arch.h 31 | Definitions and declarations common to the entire architecture. 32 | @item arch.c 33 | Tables and code common to the entire architecture, but which can't be 34 | put in the common area. 35 | @item cpuall.h 36 | Pseudo base classes of various structures. 37 | @end table 38 | 39 | Each ``CPU family'' has its own set of the following files: 40 | 41 | @table @file 42 | @item cpu.h 43 | Definitions and declarations specific to a particular CPU family. 44 | @item cpu.c 45 | Tables and code specific to a particular CPU family. 46 | @item decode.h 47 | Decoder definitions and declarations. 48 | @item decode.c 49 | Decoder tables and code. 50 | @item model.c 51 | Tables and code for each model in the CPU family. 52 | @item semantics.c 53 | Code to perform each instruction. 54 | @item sem-switch.c 55 | Same as @file{semantics.c} but as one giant @code{switch} statement. 56 | @end table 57 | 58 | Either or both of @file{semantics.c} and @file{sem-switch.c} may 59 | be provided, it's up to the port to choose. 60 | @file{semantics.c} is either to work with, one function per instruction, 61 | but @file{sem-switch.c} uses a ``computed goto'' switch and is thus 62 | provides faster simulation. 63 | 64 | @emph{NOTE:} The actual file names are up to the port. 65 | The names of the files listed here are the convention. 66 | One reason to use different names is if the port is simulating 67 | different architecture variants and generates different files 68 | for each variant. 69 | 70 | A ``CPU family'' is an artificial creation to sort architecture variants 71 | along whatever lines seem useful. Additional hand-written files must be 72 | provided. @xref{Porting}, for details. 73 | 74 | @node SID Simulator 75 | @section SID Simulator 76 | 77 | The SID simulator has its home page here: 78 | http://sourceware.org/sid/. 79 | Please refer to it for documentation on SID. 80 | 81 | The CGEN-based simulators in SID live in directory 82 | sid/component/cgen-cpu of the SID source tree. 83 | 84 | CGEN provides the instruction decoder and semantic routines. 85 | -------------------------------------------------------------------------------- /cgen/doc/stamp-vti: -------------------------------------------------------------------------------- 1 | @set UPDATED 14 June 2009 2 | @set UPDATED-MONTH June 2009 3 | @set EDITION 1.1 4 | @set VERSION 1.1 5 | -------------------------------------------------------------------------------- /cgen/doc/version.texi: -------------------------------------------------------------------------------- 1 | @set UPDATED 14 June 2009 2 | @set UPDATED-MONTH June 2009 3 | @set EDITION 1.1.50 4 | @set VERSION 1.1.50 5 | -------------------------------------------------------------------------------- /cgen/gen-all-desc: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Utility script to generate basic description files for all ports. 3 | # The main purpose of this script is to have a script that will 4 | # exercise loading of all the ports. 5 | # 6 | # Copyright 2012 Free Software Foundation 7 | # 8 | # This file is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; see the file COPYING3. If not see 20 | # . 21 | # 22 | 23 | # Run this script in the src/cgen directory. 24 | 25 | # Exit on any error. 26 | set -e 27 | 28 | # For debugging. 29 | set -x 30 | 31 | # List of top-level .cpu files of all ports. 32 | # ??? Some are missing: ia32, ia64 33 | # Need to add them after some research. 34 | # NOTE: Some of these ports are incomplete. 35 | 36 | archs=" 37 | cpu/fr30.cpu 38 | cpu/arm.cpu 39 | ../cpu/cris.cpu 40 | ../cpu/frv.cpu 41 | cpu/i960.cpu 42 | cpu/ip2k.cpu 43 | ../cpu/iq2000.cpu 44 | ../cpu/lm32.cpu 45 | ../cpu/m32c.cpu 46 | ../cpu/m32r.cpu 47 | cpu/m68k.cpu 48 | cpu/mep.cpu 49 | ../cpu/mt.cpu 50 | cpu/openrisc.cpu 51 | cpu/powerpc.cpu 52 | cpu/sh.cpu 53 | cpu/sparc.cpu 54 | ../cpu/xc16x.cpu 55 | cpu/xstormy16.cpu 56 | " 57 | 58 | if [ ! -f opcodes.scm ] 59 | then 60 | echo "Not in the src/cgen directory." >& 2 61 | exit 1 62 | fi 63 | 64 | export builddir=tmp-desc 65 | 66 | rm -rf $builddir 67 | mkdir $builddir 68 | 69 | export cgendir=`pwd` 70 | 71 | ( 72 | set -e 73 | set -x 74 | cd $builddir 75 | $cgendir/configure --prefix /tmp/junk --target m32r-elf 76 | 77 | for a in $archs 78 | do 79 | archfile=../$a 80 | arch=$(basename $archfile .cpu) 81 | 82 | # FIXME: Seems like this shouldn't be needed. Could be wrong though. 83 | ISAS="all" 84 | MACHS="all" 85 | case $arch in 86 | arm) ISAS="arm" ;; 87 | sh) ISAS="media" ;; 88 | sparc) MACHS="sparc-v9" ;; # FIXME: ugh, would rather select on isa 89 | esac 90 | 91 | if make desc ARCH=$arch ARCHFILE=$archfile ISAS="$ISAS" MACHS="$MACHS" \ 92 | CGENFLAGS='-b -v' 93 | then 94 | echo "File generation for $arch succeeded." 95 | else 96 | echo "ERROR: File generation for $arch failed." 97 | fi 98 | done 99 | ) 100 | -------------------------------------------------------------------------------- /cgen/gen-all-doc: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Utility script to generate html docs for all ports. 3 | # 4 | # Copyright 2012 Free Software Foundation 5 | # 6 | # This file is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; see the file COPYING3. If not see 18 | # . 19 | # 20 | 21 | # Run this script in the src/cgen directory. 22 | 23 | # Exit on any error. 24 | set -e 25 | 26 | # For debugging. 27 | set -x 28 | 29 | # ??? Some are missing, need to add them after some research. 30 | #../cpu/m32c.cpu 31 | #../cpu/xc16x.cpu 32 | archs=" 33 | cpu/fr30.cpu 34 | cpu/arm.cpu 35 | ../cpu/frv.cpu 36 | cpu/i960.cpu 37 | cpu/ip2k.cpu 38 | ../cpu/iq2000.cpu 39 | ../cpu/lm32.cpu 40 | ../cpu/m32r.cpu 41 | cpu/mep.cpu 42 | ../cpu/mt.cpu 43 | cpu/openrisc.cpu 44 | cpu/sh.cpu 45 | cpu/xstormy16.cpu 46 | " 47 | 48 | if [ ! -f sim.scm ] 49 | then 50 | echo "Not in the src/cgen directory." >& 2 51 | exit 1 52 | fi 53 | 54 | export builddir=tmp-doc 55 | 56 | rm -rf $builddir 57 | mkdir $builddir 58 | 59 | export cgendir=`pwd` 60 | 61 | ( 62 | set -e 63 | set -x 64 | cd $builddir 65 | $cgendir/configure --prefix /tmp/junk --target m32r-elf 66 | 67 | for a in $archs 68 | do 69 | archfile=../$a 70 | arch=$(basename $archfile .cpu) 71 | 72 | case $arch in 73 | arm) 74 | make html ARCH=$arch ARCHFILE=$archfile ISAS=arm INSN_FILE_NAME=arm-arm-insn.html 75 | mv arm.html arm-arm.html 76 | mv arm-insn.html arm-arm-insn.html 77 | make html ARCH=$arch ARCHFILE=$archfile ISAS=thumb INSN_FILE_NAME=arm-thumb-insn.html 78 | mv arm.html arm-thumb.html 79 | mv arm-insn.html arm-thumb-insn.html 80 | ;; 81 | frv) 82 | make html ARCH=$arch ARCHFILE=$archfile MACHS="frv,simple,tomcat,fr400" INSN_FILE_NAME=frv-1-insn.html 83 | mv frv.html frv-1.html 84 | mv frv-insn.html frv-1-insn.html 85 | make html ARCH=$arch ARCHFILE=$archfile MACHS="fr500" INSN_FILE_NAME=frv-2-insn.html 86 | mv frv.html frv-2.html 87 | mv frv-insn.html frv-2-insn.html 88 | make html ARCH=$arch ARCHFILE=$archfile MACHS="fr550" INSN_FILE_NAME=frv-3-insn.html 89 | mv frv.html frv-3.html 90 | mv frv-insn.html frv-3-insn.html 91 | ;; 92 | *) 93 | make html ARCH=$arch ARCHFILE=$archfile 94 | ;; 95 | esac 96 | done 97 | ) 98 | 99 | ( 100 | set -e 101 | set -x 102 | cd $builddir 103 | 104 | rm -f index.html 105 | 106 | cat > index.html < 108 | 109 | CGEN Machine Generated Documentation 110 | 111 | 112 | 113 |

Machine Generated Documentation

114 | 115 |
    116 | EOF 117 | 118 | lower="abcdefghijklmnopqrstuvwxyz" 119 | upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" 120 | 121 | for html in *.html 122 | do 123 | name="" 124 | 125 | case $html in 126 | *-insn.html) ;; 127 | index.html) ;; 128 | arm-arm.*) name="ARM" ;; 129 | arm-thumb.*) name="ARM Thumb" ;; 130 | frv-1.*) name="FRV FR400" ;; 131 | frv-2.*) name="FRV FR500" ;; 132 | openrisc.*) name="Openrisc" ;; 133 | xstormy16.*) name="Xstormy16" ;; 134 | *) name=`echo ${html/.html} | tr $lower $upper` ;; 135 | esac 136 | 137 | if [ "$name" != "" ] 138 | then 139 | echo "
  • $name" >> index.html 140 | fi 141 | done 142 | 143 | cat >> index.html < 145 | 146 | 147 | 148 | EOF 149 | ) 150 | -------------------------------------------------------------------------------- /cgen/gen-all-intrinsics: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Utility script to generate the intrinsics files. 3 | # This is useful for verifying changes to the generated files. 4 | # 5 | # Copyright 2012 Free Software Foundation 6 | # 7 | # This file is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; see the file COPYING3. If not see 19 | # . 20 | # 21 | 22 | # Usage: gen-all-intrinsics /path/to/gcc/top [extra args] 23 | # 24 | # Run this script in the src/cgen directory. 25 | # 26 | # NOTE: The various command line arguments depend on which mep cores 27 | # you're targetting. 28 | 29 | CGEN_TOP=`pwd` 30 | 31 | if [ $# -lt 1 ] 32 | then 33 | echo "Usage: gen-all-intrinsics /path/to/gcc/top [extra args]" >&2 34 | exit 1 35 | fi 36 | 37 | GCC_TOP=$1 ; shift 38 | if [ ! -d ${GCC_TOP}/gcc/config/mep ] 39 | then 40 | echo "Not a gcc top level directory: $GCC_TOP" >&2 41 | exit 1 42 | fi 43 | 44 | ( 45 | cd ${GCC_TOP}/gcc/config/mep 46 | guile -s ${CGEN_TOP}/cgen-intrinsics.scm -s ${CGEN_TOP} \ 47 | -a ${CGEN_TOP}/cpu/mep.cpu \ 48 | -m mep,c5 \ 49 | -i mep,ext_core1,ext_cop1_16,ext_cop1_32,ext_cop1_48,ext_cop1_64 \ 50 | -K mep,ext_core1,ext_cop1_16,ext_cop1_32,ext_cop1_48,ext_cop1_64 \ 51 | -M intrinsics.md -N mep-intrin.h -P intrinsics.h \ 52 | -b \ 53 | "$@" 54 | ) 55 | -------------------------------------------------------------------------------- /cgen/gen-all-opcodes: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Utility script to generate the opcodes files. 3 | # This is useful for verifying changes to the generated files. 4 | # 5 | # Copyright 2012 Free Software Foundation 6 | # 7 | # This file is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; see the file COPYING3. If not see 19 | # . 20 | # 21 | 22 | # Run this script in the src/cgen directory. 23 | 24 | # Exit on any error. 25 | set -e 26 | 27 | # For debugging. 28 | set -x 29 | 30 | if [ ! -f sim.scm ] 31 | then 32 | echo "Not in the src/cgen directory." >& 2 33 | exit 1 34 | fi 35 | 36 | builddir=tmp-opc 37 | 38 | rm -rf $builddir 39 | mkdir $builddir 40 | 41 | export cgendir=`pwd` 42 | 43 | cd $builddir 44 | $cgendir/../opcodes/configure --prefix /tmp/junk --target m32r-elf --enable-targets=all 45 | make run-cgen-all 46 | -------------------------------------------------------------------------------- /cgen/gen-all-sid: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Utility script to generate the generated sid files. 3 | # This is useful for verifying changes to the generated files. 4 | # 5 | # Copyright 2012 Free Software Foundation 6 | # 7 | # This file is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; see the file COPYING3. If not see 19 | # . 20 | # 21 | 22 | # Run this script in the src/cgen directory. 23 | # 24 | # Usage: gen-all-sid /path/to/sid/src 25 | 26 | # Exit on any error. 27 | set -e 28 | 29 | # For debugging. 30 | set -x 31 | 32 | if [ ! -f sim.scm ] 33 | then 34 | echo "Not in the src/cgen directory." >& 2 35 | exit 1 36 | fi 37 | 38 | if [ $# != 1 ] 39 | then 40 | echo "Usage: gen-all-sid /path/to/sid/src" >& 2 41 | exit 1 42 | fi 43 | 44 | siddir=$1 45 | if [ ! -f $siddir/sid/COPYING.SID ] 46 | then 47 | echo "unable to find sid sources in $siddir" >& 2 48 | exit 1 49 | fi 50 | 51 | builddir=tmp-sid 52 | 53 | rm -rf $builddir 54 | mkdir $builddir 55 | 56 | cd $builddir 57 | $siddir/configure --prefix /tmp/junk --enable-ltdl-install 58 | make configure-sid 59 | cd sid/component/cgen-cpu 60 | make cgen-all 61 | -------------------------------------------------------------------------------- /cgen/gen-all-sim: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Utility script to generate the sim files for several ports. 3 | # This is useful for verifying changes to the generated files 4 | # without having to build every tool chain. 5 | # 6 | # Copyright 2012 Free Software Foundation 7 | # 8 | # This file is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; see the file COPYING3. If not see 20 | # . 21 | # 22 | 23 | # Run this script in the src/cgen directory. 24 | 25 | # Exit on any error. 26 | set -e 27 | 28 | # For debugging. 29 | set -x 30 | 31 | # fr30 not included, sim has been marked as obsolete. 32 | # sh64 not included, not sure which configuration to use. 33 | # i960 not included, it's being deleted. 34 | cpus="m32r" 35 | 36 | if [ ! -f sim.scm ] 37 | then 38 | echo "Not in the src/cgen directory." >& 2 39 | exit 1 40 | fi 41 | 42 | builddir=tmp-sim 43 | 44 | export cgendir=`pwd` 45 | 46 | for c in $cpus 47 | do 48 | rm -rf $builddir 49 | mkdir $builddir 50 | 51 | case $c in 52 | i960) 53 | ( 54 | set -e 55 | set -x 56 | cd $builddir 57 | $cgendir/../sim/i960/configure --prefix /tmp/junk --target i960-coff 58 | make stamp-arch stamp-cpu stamp-desc 59 | ) 60 | test $? = 0 || exit 1 61 | ;; 62 | 63 | m32r) 64 | ( 65 | set -e 66 | set -x 67 | cd $builddir 68 | $cgendir/../sim/m32r/configure --prefix /tmp/junk --target m32r-elf 69 | make stamp-arch stamp-cpu stamp-xcpu 70 | ) 71 | test $? = 0 || exit 1 72 | ;; 73 | 74 | fr30) 75 | ( 76 | set -e 77 | set -x 78 | cd $builddir 79 | $cgendir/../sim/fr30/configure --prefix /tmp/junk --target fr30-elf 80 | make stamp-arch stamp-cpu 81 | ) 82 | test $? = 0 || exit 1 83 | ;; 84 | 85 | sh64) 86 | ( 87 | set -e 88 | set -x 89 | cd $builddir 90 | $cgendir/../sim/sh64/configure --prefix /tmp/junk --target ??? 91 | make stamp-all 92 | ) 93 | test $? = 0 || exit 1 94 | ;; 95 | 96 | *) 97 | echo "unsupported cpu $c" >& 2 98 | exit 1 99 | ;; 100 | esac 101 | done 102 | -------------------------------------------------------------------------------- /cgen/slib/pp.scm: -------------------------------------------------------------------------------- 1 | ;"pp.scm" Pretty-print 2 | 3 | ; (pretty-print obj port) pretty prints 'obj' on 'port'. The current 4 | ; output port is used if 'port' is not specified. 5 | 6 | (define (pp:pretty-print obj . opt) 7 | (let ((port (if (pair? opt) (car opt) (current-output-port)))) 8 | (generic-write obj #f 79 (lambda (s) (display s port) #t)))) 9 | 10 | (define pretty-print pp:pretty-print) 11 | -------------------------------------------------------------------------------- /cgen/stamp-h.in: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /cgen/testsuite.scm: -------------------------------------------------------------------------------- 1 | ; CGEN testsuite driver. 2 | ; Copyright (C) 2009 Doug Evans 3 | ; This file is part of CGEN. 4 | 5 | ; Global state variables. 6 | 7 | ; Specify which application. 8 | (set! APPLICATION 'TESTSUITE) 9 | 10 | ; Initialize the options. 11 | 12 | (define (option-init!) 13 | ;;(set! CURRENT-COPYRIGHT copyright-fsf) 14 | ;;(set! CURRENT-PACKAGE package-cgen) 15 | *UNSPECIFIED* 16 | ) 17 | 18 | ; Testsuite init,finish,analyzer support. 19 | 20 | ; Initialize any testsuite specific things before loading the .cpu file. 21 | 22 | (define (testsuite-init!) 23 | (desc-init!) 24 | (mode-set-biggest-word-bitsizes!) 25 | *UNSPECIFIED* 26 | ) 27 | 28 | ; Finish any testsuite specific things after loading the .cpu file. 29 | ; This is separate from analyze-data! as cpu-load performs some 30 | ; consistency checks in between. 31 | 32 | (define (testsuite-finish!) 33 | (desc-finish!) 34 | *UNSPECIFIED* 35 | ) 36 | 37 | ; Compute various needed globals and assign any computed fields of 38 | ; the various objects. This is the standard routine that is called after 39 | ; a .cpu file is loaded. 40 | 41 | (define (testsuite-analyze!) 42 | (desc-analyze!) 43 | 44 | ; Initialize the rtl->c translator. 45 | (rtl-c-config!) 46 | 47 | ; Only include semantic operands when computing the format tables if we're 48 | ; generating operand instance tables. 49 | ; ??? Actually, may always be able to exclude the semantic operands. 50 | ; Still need to traverse the semantics to derive machine computed attributes. 51 | ;; (arch-analyze-insns! CURRENT-ARCH 52 | ;; #t ; include aliases? 53 | ;; #f ; build operand instance table? 54 | ;; ) 55 | 56 | *UNSPECIFIED* 57 | ) 58 | 59 | ;; 60 | 61 | (define (cgen-test.h) 62 | (logit 1 "Generating testsuite.out ...\n") 63 | (string-write "CGEN Testsuite") 64 | ) 65 | -------------------------------------------------------------------------------- /cgen/testsuite/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for cgen/testsuite. 2 | ## Process this file with automake to generate Makefile.in 3 | # 4 | # Copyright 2012 Free Software Foundation 5 | # 6 | # This file is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; see the file COPYING3. If not see 18 | # . 19 | # 20 | 21 | AUTOMAKE_OPTIONS = 1.9 cygnus 22 | 23 | cgendir = $(srcdir)/.. 24 | 25 | # Default set of tests to run. 26 | TEST_LIST = all 27 | 28 | default: 29 | @echo no default 30 | 31 | .phony: check 32 | check: Makefile test-utils.sh 33 | $(SHELL) ${srcdir}/run-tests.sh $(TEST_LIST) 34 | 35 | .PHONY: clean-test-files 36 | clean: clean-test-files 37 | clean-test-files: 38 | rm -f *.test.cpu* 39 | rm -f *.out 40 | rm -f *.tmp 41 | -------------------------------------------------------------------------------- /cgen/testsuite/location-1.test: -------------------------------------------------------------------------------- 1 | # location testcase #1 -*- shell-script -*- 2 | 3 | test=location-1 4 | 5 | source ./test-utils.sh 6 | 7 | cpu_file=${test}.test.cpu 8 | rm -f ${cpu_file} 9 | 10 | cat > ${cpu_file} < ${cpu_file} <&2 7 | exit 1 8 | fi 9 | 10 | if [ "${test}" != "driver" ] 11 | then 12 | echo "Running ${test} ..." 13 | fi 14 | 15 | srcdir=@srcdir@ 16 | 17 | cgendir=${srcdir}/.. 18 | 19 | GUILE=`if test -f ../../guile/libguile/guile ; then echo ../../guile/libguile/guile; else echo guile ; fi` 20 | GUILEFLAGS="-l ${cgendir}/guile.scm -s" 21 | 22 | CGENFLAGS= 23 | 24 | cgen_output_file=${test}.cgen.out 25 | test_output_file=${test}.test.out 26 | rm -f ${cgen_output_file} ${test_output_file} 27 | 28 | tmp_match=match-${test}.tmp 29 | tmp_expr=expr-${test}.tmp 30 | rm -f ${tmp_match} ${tmp_expr} 31 | 32 | exit_code=0 33 | 34 | # Invoke this to run cgen. 35 | # Usage: run_cgen [-f] cpu-file-path 36 | # -f: cgen is expected to fail (useful for testing error handling) 37 | 38 | run_cgen() { 39 | expect_fail=false 40 | [ "$1" == "-f" ] && { expect_fail=true ; shift ; } 41 | 42 | [ $# -ne 1 ] && { echo "missing cpu_file" >&2 ; exit 1 ; } 43 | cpu_file=$1 44 | 45 | if ${GUILE} ${GUILEFLAGS} ${cgendir}/cgen-testsuite.scm \ 46 | -s ${cgendir} \ 47 | -b ${CGENFLAGS} \ 48 | -a ${cpu_file} \ 49 | -T ${cgen_output_file} >& ${test_output_file} 50 | then 51 | ${expect_fail} && { fail "${test} run of cgen expected to fail" ; } 52 | else 53 | ${expect_fail} || { fail "${test} run of cgen" ; } 54 | fi 55 | } 56 | 57 | post_process() { 58 | file=${test_output_file} 59 | 60 | if grep -q FAIL $file 61 | then 62 | fail "In test output:" 63 | grep FAIL $file 64 | fi 65 | 66 | grep "^MATCH: " $file | sed -e 's/^MATCH://' > ${tmp_match} 67 | grep "^EXPR: " $file | sed -e 's/^EXPR://' > ${tmp_expr} 68 | 69 | if ! cmp -s ${tmp_match} ${tmp_expr} 70 | then 71 | fail "Differences from expected output:" 72 | diff ${tmp_match} ${tmp_expr} 73 | fi 74 | } 75 | 76 | fail() { 77 | echo "FAIL: $*" 78 | exit_code=1 79 | } 80 | 81 | finish() { 82 | exit ${exit_code} 83 | } 84 | -------------------------------------------------------------------------------- /cgen/testsuite/testsuite.cpu: -------------------------------------------------------------------------------- 1 | ;; CPU to use for the testsuite. -*- Scheme -*- 2 | 3 | (define-arch 4 | (name testsuite) ; name of cpu 5 | (comment ".cpu file for the testsuite") 6 | (insn-lsb0? #t) 7 | (machs testb) 8 | (isas test) 9 | ) 10 | 11 | (define-isa 12 | (name test) 13 | (base-insn-bitsize 16) 14 | (decode-assist (0 1 2 3)) 15 | ) 16 | 17 | (define-cpu 18 | (name testf) 19 | (comment "experimental cpu family") 20 | (endian little) 21 | (word-bitsize 32) 22 | ) 23 | 24 | (define-mach 25 | (name testb) 26 | (comment "mach for testsuite") 27 | (cpu testf) 28 | ) 29 | 30 | (define-model 31 | (name test) (comment "test") (attrs) 32 | (mach testb) 33 | ;(pipeline all "" () ((fetch) (decode) (execute) (writeback))) 34 | (unit u-exec "Execution Unit" () 1 1 () () () ()) 35 | ) 36 | 37 | ;; Some useful pmacros for testcases. 38 | 39 | (if (rtl-version-at-least? 0 9) 40 | (begin 41 | (define-pmacro /begin %begin) 42 | (define-pmacro /print %print) 43 | (define-pmacro /dump %dump)) 44 | (begin 45 | (define-pmacro /begin .begin) 46 | (define-pmacro /print .print) 47 | (define-pmacro /dump .dump))) 48 | 49 | (define-pmacro (newline) (/print "\n")) 50 | 51 | ;; Record name of test for debugging purposes. 52 | 53 | (define-pmacro (test-name name) 54 | (/print "TEST: " name "\n") 55 | ) 56 | 57 | ;; Print TEXT as the expected output. 58 | 59 | (define-pmacro (print-match text) 60 | (/begin 61 | (/print "MATCH: ") 62 | (/print text) 63 | (newline)) 64 | ) 65 | 66 | ;; Print EXPR as the text to be verified. 67 | 68 | (define-pmacro (print-expr expr) 69 | (/begin 70 | (/print "EXPR: ") 71 | (/dump expr) 72 | (newline)) 73 | ) 74 | 75 | ;; THUNK is invoked to exercise whatever is being tested. 76 | 77 | (define-pmacro (print-thunk thunk) 78 | (/begin 79 | (/print "EXPR: ") 80 | (thunk) 81 | (newline)) 82 | ) 83 | 84 | ;; Wrapper around .internal-test to include pass/fail messages. 85 | 86 | (if (rtl-version-at-least? 0 9) 87 | (define-pmacro (internal-verify test-name expr) 88 | (%if (%internal-test expr) 89 | (%print "PASS: " test-name "\n") 90 | (%print "FAIL: " test-name "\n"))) 91 | (define-pmacro (internal-verify test-name expr) 92 | (.if (.internal-test expr) 93 | (.print "PASS: " test-name "\n") 94 | (.print "FAIL: " test-name "\n"))) 95 | ) 96 | -------------------------------------------------------------------------------- /compile: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Wrapper for compilers which do not understand `-c -o'. 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software 7 | # Foundation, Inc. 8 | # Written by Tom Tromey . 9 | # 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | # This file is maintained in Automake, please report 29 | # bugs to or send patches to 30 | # . 31 | 32 | case $1 in 33 | '') 34 | echo "$0: No command. Try \`$0 --help' for more information." 1>&2 35 | exit 1; 36 | ;; 37 | -h | --h*) 38 | cat <<\EOF 39 | Usage: compile [--help] [--version] PROGRAM [ARGS] 40 | 41 | Wrapper for compilers which do not understand `-c -o'. 42 | Remove `-o dest.o' from ARGS, run PROGRAM with the remaining 43 | arguments, and rename the output as expected. 44 | 45 | If you are trying to build a whole package this is not the 46 | right script to run: please start by reading the file `INSTALL'. 47 | 48 | Report bugs to . 49 | EOF 50 | exit $? 51 | ;; 52 | -v | --v*) 53 | echo "compile $scriptversion" 54 | exit $? 55 | ;; 56 | esac 57 | 58 | ofile= 59 | cfile= 60 | eat= 61 | 62 | for arg 63 | do 64 | if test -n "$eat"; then 65 | eat= 66 | else 67 | case $1 in 68 | -o) 69 | # configure might choose to run compile as `compile cc -o foo foo.c'. 70 | # So we strip `-o arg' only if arg is an object. 71 | eat=1 72 | case $2 in 73 | *.o | *.obj) 74 | ofile=$2 75 | ;; 76 | *) 77 | set x "$@" -o "$2" 78 | shift 79 | ;; 80 | esac 81 | ;; 82 | *.c) 83 | cfile=$1 84 | set x "$@" "$1" 85 | shift 86 | ;; 87 | *) 88 | set x "$@" "$1" 89 | shift 90 | ;; 91 | esac 92 | fi 93 | shift 94 | done 95 | 96 | if test -z "$ofile" || test -z "$cfile"; then 97 | # If no `-o' option was seen then we might have been invoked from a 98 | # pattern rule where we don't need one. That is ok -- this is a 99 | # normal compilation that the losing compiler can handle. If no 100 | # `.c' file was seen then we are probably linking. That is also 101 | # ok. 102 | exec "$@" 103 | fi 104 | 105 | # Name of file we expect compiler to create. 106 | cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` 107 | 108 | # Create the lock directory. 109 | # Note: use `[/\\:.-]' here to ensure that we don't use the same name 110 | # that we are using for the .o file. Also, base the name on the expected 111 | # object file name, since that is what matters with a parallel build. 112 | lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d 113 | while true; do 114 | if mkdir "$lockdir" >/dev/null 2>&1; then 115 | break 116 | fi 117 | sleep 1 118 | done 119 | # FIXME: race condition here if user kills between mkdir and trap. 120 | trap "rmdir '$lockdir'; exit 1" 1 2 15 121 | 122 | # Run the compile. 123 | "$@" 124 | ret=$? 125 | 126 | if test -f "$cofile"; then 127 | mv "$cofile" "$ofile" 128 | elif test -f "${cofile}bj"; then 129 | mv "${cofile}bj" "$ofile" 130 | fi 131 | 132 | rmdir "$lockdir" 133 | exit $ret 134 | 135 | # Local Variables: 136 | # mode: shell-script 137 | # sh-indentation: 2 138 | # eval: (add-hook 'write-file-hooks 'time-stamp) 139 | # time-stamp-start: "scriptversion=" 140 | # time-stamp-format: "%:y-%02m-%02d.%02H" 141 | # time-stamp-time-zone: "UTC" 142 | # time-stamp-end: "; # UTC" 143 | # End: 144 | -------------------------------------------------------------------------------- /config/asmcfi.m4: -------------------------------------------------------------------------------- 1 | ;; Cribbed from libffi 2 | 3 | AC_DEFUN([GCC_AS_CFI_PSEUDO_OP], 4 | [AC_CACHE_CHECK([assembler .cfi pseudo-op support], 5 | gcc_cv_as_cfi_pseudo_op, [ 6 | gcc_cv_as_cfi_pseudo_op=unknown 7 | AC_TRY_COMPILE([asm (".cfi_startproc\n\t.cfi_endproc");],, 8 | [gcc_cv_as_cfi_pseudo_op=yes], 9 | [gcc_cv_as_cfi_pseudo_op=no]) 10 | ]) 11 | if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then 12 | AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1, 13 | [Define if your assembler supports .cfi_* directives.]) 14 | fi 15 | ]) 16 | -------------------------------------------------------------------------------- /config/bootstrap-O1.mk: -------------------------------------------------------------------------------- 1 | BOOT_CFLAGS := -O1 $(filter-out -O%, $(BOOT_CFLAGS)) 2 | -------------------------------------------------------------------------------- /config/bootstrap-O3.mk: -------------------------------------------------------------------------------- 1 | BOOT_CFLAGS := -O3 $(filter-out -O%, $(BOOT_CFLAGS)) 2 | -------------------------------------------------------------------------------- /config/bootstrap-asan.mk: -------------------------------------------------------------------------------- 1 | # This option enables -fsanitize=address for stage2 and stage3. 2 | 3 | STAGE2_CFLAGS += -fsanitize=address 4 | STAGE3_CFLAGS += -fsanitize=address 5 | POSTSTAGE1_LDFLAGS += -fsanitize=address -static-libasan \ 6 | -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/ \ 7 | -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.libs 8 | -------------------------------------------------------------------------------- /config/bootstrap-debug-big.mk: -------------------------------------------------------------------------------- 1 | # This BUILD_CONFIG option is a bit like bootstrap-debug-lean, but it 2 | # trades space for speed: instead of recompiling programs during 3 | # stage3, it generates dumps during stage2 and stage3, saving them all 4 | # until the final compare. 5 | 6 | STAGE2_CFLAGS += -fdump-final-insns 7 | STAGE3_CFLAGS += -fdump-final-insns 8 | do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2 9 | -------------------------------------------------------------------------------- /config/bootstrap-debug-ckovw.mk: -------------------------------------------------------------------------------- 1 | # This BUILD_CONFIG option is to be used along with 2 | # bootstrap-debug-lean and bootstrap-debug-lib in a full bootstrap, to 3 | # check that all host and target files are built with -fcompare-debug. 4 | 5 | # These arrange for a simple warning to be issued if -fcompare-debug 6 | # is not given. 7 | # BOOT_CFLAGS += -fcompare-debug="-w%n-fcompare-debug not overridden" 8 | # TFLAGS += -fcompare-debug="-w%n-fcompare-debug not overridden" 9 | 10 | # GCC_COMPARE_DEBUG="-w%n-fcompare-debug not overridden"; 11 | 12 | FORCE_COMPARE_DEBUG = \ 13 | GCC_COMPARE_DEBUG=$${GCC_COMPARE_DEBUG--fcompare-debug-not-overridden}; \ 14 | export GCC_COMPARE_DEBUG; 15 | POSTSTAGE1_HOST_EXPORTS += $(FORCE_COMPARE_DEBUG) 16 | BASE_TARGET_EXPORTS += $(FORCE_COMPARE_DEBUG) 17 | -------------------------------------------------------------------------------- /config/bootstrap-debug-lean.mk: -------------------------------------------------------------------------------- 1 | # This BUILD_CONFIG option is a bit like bootstrap-debug, but rather 2 | # than comparing stripped object files, it compares compiler internal 3 | # state during stage3. Both can be used simultaneously. 4 | 5 | # This makes it slower than bootstrap-debug alone, for there's 6 | # additional dumping and recompilation during stage3. 7 | # bootstrap-debug-big can avoid the recompilation, if plenty of disk 8 | # space is available. 9 | 10 | STAGE2_CFLAGS += -fcompare-debug= 11 | STAGE3_CFLAGS += -fcompare-debug 12 | -------------------------------------------------------------------------------- /config/bootstrap-debug-lib.mk: -------------------------------------------------------------------------------- 1 | # This BUILD_CONFIG option tests that target libraries built during 2 | # stage3 would have generated the same executable code if they were 3 | # compiled with -g0. 4 | 5 | # It uses -g0 rather than -gtoggle because -g is default on target 6 | # library builds, and toggling it where it's supposed to be disabled 7 | # breaks e.g. crtstuff on ppc. 8 | 9 | STAGE1_TFLAGS += -g0 -fcompare-debug= 10 | STAGE2_TFLAGS += -fcompare-debug= 11 | STAGE3_TFLAGS += -fcompare-debug=-g0 12 | do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2 13 | -------------------------------------------------------------------------------- /config/bootstrap-debug.mk: -------------------------------------------------------------------------------- 1 | # This BUILD_CONFIG option builds checks that toggling debug 2 | # information generation doesn't affect the generated object code. 3 | 4 | # It is very lightweight: in addition to not performing any additional 5 | # compilation (unlike bootstrap-debug-lean), it actually speeds up 6 | # stage2, for no debug information is generated when compiling with 7 | # the unoptimized stage1. 8 | 9 | # For more thorough testing, see bootstrap-debug-lean.mk 10 | 11 | STAGE2_CFLAGS += -gtoggle 12 | do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2 13 | -------------------------------------------------------------------------------- /config/bootstrap-lto.mk: -------------------------------------------------------------------------------- 1 | # This option enables LTO for stage2 and stage3. 2 | 3 | STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 4 | STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1 5 | STAGEprofile_CFLAGS += -fno-lto 6 | -------------------------------------------------------------------------------- /config/bootstrap-time.mk: -------------------------------------------------------------------------------- 1 | BOOT_CFLAGS += -time=$(shell pwd)/time.log 2 | TFLAGS += -time=$(shell pwd)/time.log 3 | -------------------------------------------------------------------------------- /config/codeset.m4: -------------------------------------------------------------------------------- 1 | # codeset.m4 serial AM1 (gettext-0.10.40) 2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Bruno Haible. 10 | 11 | AC_DEFUN([AM_LANGINFO_CODESET], 12 | [ 13 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, 14 | [AC_TRY_LINK([#include ], 15 | [char* cs = nl_langinfo(CODESET);], 16 | am_cv_langinfo_codeset=yes, 17 | am_cv_langinfo_codeset=no) 18 | ]) 19 | if test $am_cv_langinfo_codeset = yes; then 20 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, 21 | [Define if you have and nl_langinfo(CODESET).]) 22 | fi 23 | ]) 24 | -------------------------------------------------------------------------------- /config/dfp.m4: -------------------------------------------------------------------------------- 1 | dnl @synopsis GCC_AC_ENABLE_DECIMAL_FLOAT([target triplet]) 2 | dnl 3 | dnl Enable C extension for decimal float if target supports it. 4 | dnl 5 | dnl @author Andreas Krebbel 6 | 7 | AC_DEFUN([GCC_AC_ENABLE_DECIMAL_FLOAT], 8 | [ 9 | AC_ARG_ENABLE(decimal-float, 10 | [ --enable-decimal-float={no,yes,bid,dpd} 11 | enable decimal float extension to C. Selecting 'bid' 12 | or 'dpd' choses which decimal floating point format 13 | to use], 14 | [ 15 | case $enable_decimal_float in 16 | yes | no | bid | dpd) default_decimal_float=$enable_decimal_float ;; 17 | *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float. 18 | Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;; 19 | esac 20 | ], 21 | [ 22 | case $1 in 23 | powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \ 24 | i?86*-*-gnu* | \ 25 | i?86*-*-mingw* | x86_64*-*-mingw* | \ 26 | i?86*-*-cygwin* | x86_64*-*-cygwin*) 27 | enable_decimal_float=yes 28 | ;; 29 | *) 30 | AC_MSG_WARN([decimal float is not supported for this target, ignored]) 31 | enable_decimal_float=no 32 | ;; 33 | esac 34 | ]) 35 | 36 | # x86's use BID format instead of DPD 37 | case x$enable_decimal_float in 38 | xyes) 39 | case $1 in 40 | i?86*-*-* | x86_64*-*-*) 41 | enable_decimal_float=bid 42 | ;; 43 | *) 44 | enable_decimal_float=dpd 45 | ;; 46 | esac 47 | default_decimal_float=$enable_decimal_float 48 | ;; 49 | xno) 50 | # ENABLE_DECIMAL_FLOAT is set to 0. But we have to have proper 51 | # dependency on libdecnumber. 52 | default_decimal_float=dpd 53 | ;; 54 | esac 55 | AC_SUBST(enable_decimal_float) 56 | 57 | ]) 58 | -------------------------------------------------------------------------------- /config/elf.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2010, 2011 Free Software Foundation, Inc. 2 | dnl This file is free software, distributed under the terms of the GNU 3 | dnl General Public License. As a special exception to the GNU General 4 | dnl Public License, this file may be distributed as part of a program 5 | dnl that contains a configuration script generated by Autoconf, under 6 | dnl the same distribution terms as the rest of that program. 7 | 8 | dnl From Paolo Bonzini. 9 | 10 | dnl usage: ACX_ELF_TARGET_IFELSE([if-elf], [if-not-elf]) 11 | AC_DEFUN([ACX_ELF_TARGET_IFELSE], [ 12 | AC_REQUIRE([AC_CANONICAL_TARGET]) 13 | 14 | target_elf=no 15 | case $target in 16 | *-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \ 17 | *-msdosdjgpp* | *-vms* | *-wince* | *-*-pe* | \ 18 | alpha*-dec-osf* | *-interix* | hppa[[12]]*-*-hpux*) 19 | target_elf=no 20 | ;; 21 | *) 22 | target_elf=yes 23 | ;; 24 | esac 25 | 26 | AS_IF([test $target_elf = yes], [$1], [$2]) 27 | ]) 28 | -------------------------------------------------------------------------------- /config/enable.m4: -------------------------------------------------------------------------------- 1 | dnl ---------------------------------------------------------------------- 2 | dnl This whole bit snagged from libstdc++-v3. 3 | 4 | dnl 5 | dnl GCC_ENABLE 6 | dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING) 7 | dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c) 8 | dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER) 9 | dnl 10 | dnl See docs/html/17_intro/configury.html#enable for documentation. 11 | dnl 12 | AC_DEFUN([GCC_ENABLE],[dnl 13 | m4_define([_g_switch],[--enable-$1])dnl 14 | m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl 15 | AC_ARG_ENABLE($1,_g_help, 16 | m4_bmatch([$5], 17 | [^permit ], 18 | [[ 19 | case "$enableval" in 20 | m4_bpatsubst([$5],[permit ])) ;; 21 | *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;; 22 | dnl Idea for future: generate a URL pointing to 23 | dnl "onlinedocs/configopts.html#whatever" 24 | esac 25 | ]], 26 | [^$], 27 | [[ 28 | case "$enableval" in 29 | yes|no) ;; 30 | *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;; 31 | esac 32 | ]], 33 | [[$5]]), 34 | [enable_]m4_bpatsubst([$1],-,_)[=][$2]) 35 | m4_undefine([_g_switch])dnl 36 | m4_undefine([_g_help])dnl 37 | ]) 38 | 39 | -------------------------------------------------------------------------------- /config/extensions.m4: -------------------------------------------------------------------------------- 1 | # serial 6 -*- Autoconf -*- 2 | # Enable extensions on systems that normally disable them. 3 | 4 | # Copyright (C) 2003, 2006, 2007, 2009 Free Software Foundation, Inc. 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS 10 | # Autoconf. Perhaps we can remove this once we can assume Autoconf 11 | # 2.62 or later everywhere, but since CVS Autoconf mutates rapidly 12 | # enough in this area it's likely we'll need to redefine 13 | # AC_USE_SYSTEM_EXTENSIONS for quite some time. 14 | 15 | m4_version_prereq([2.62],, [ 16 | 17 | # AC_USE_SYSTEM_EXTENSIONS 18 | # ------------------------ 19 | # Enable extensions on systems that normally disable them, 20 | # typically due to standards-conformance issues. 21 | # Remember that #undef in AH_VERBATIM gets replaced with #define by 22 | # AC_DEFINE. The goal here is to define all known feature-enabling 23 | # macros, then, if reports of conflicts are made, disable macros that 24 | # cause problems on some platforms (such as __EXTENSIONS__). 25 | AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], 26 | [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl 27 | AC_BEFORE([$0], [AC_RUN_IFELSE])dnl 28 | 29 | AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) 30 | if test "$MINIX" = yes; then 31 | AC_DEFINE([_POSIX_SOURCE], [1], 32 | [Define to 1 if you need to in order for `stat' and other 33 | things to work.]) 34 | AC_DEFINE([_POSIX_1_SOURCE], [2], 35 | [Define to 2 if the system does not provide POSIX.1 features 36 | except with this defined.]) 37 | AC_DEFINE([_MINIX], [1], 38 | [Define to 1 if on MINIX.]) 39 | fi 40 | 41 | AH_VERBATIM([__EXTENSIONS__], 42 | [/* Enable extensions on AIX 3, Interix. */ 43 | #ifndef _ALL_SOURCE 44 | # undef _ALL_SOURCE 45 | #endif 46 | /* Enable GNU extensions on systems that have them. */ 47 | #ifndef _GNU_SOURCE 48 | # undef _GNU_SOURCE 49 | #endif 50 | /* Enable threading extensions on Solaris. */ 51 | #ifndef _POSIX_PTHREAD_SEMANTICS 52 | # undef _POSIX_PTHREAD_SEMANTICS 53 | #endif 54 | /* Enable extensions on HP NonStop. */ 55 | #ifndef _TANDEM_SOURCE 56 | # undef _TANDEM_SOURCE 57 | #endif 58 | /* Enable general extensions on Solaris. */ 59 | #ifndef __EXTENSIONS__ 60 | # undef __EXTENSIONS__ 61 | #endif 62 | ]) 63 | AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], 64 | [ac_cv_safe_to_define___extensions__], 65 | [AC_COMPILE_IFELSE( 66 | [AC_LANG_PROGRAM([ 67 | # define __EXTENSIONS__ 1 68 | AC_INCLUDES_DEFAULT])], 69 | [ac_cv_safe_to_define___extensions__=yes], 70 | [ac_cv_safe_to_define___extensions__=no])]) 71 | test $ac_cv_safe_to_define___extensions__ = yes && 72 | AC_DEFINE([__EXTENSIONS__]) 73 | AC_DEFINE([_ALL_SOURCE]) 74 | AC_DEFINE([_GNU_SOURCE]) 75 | AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) 76 | AC_DEFINE([_TANDEM_SOURCE]) 77 | ])# AC_USE_SYSTEM_EXTENSIONS 78 | 79 | ]) 80 | -------------------------------------------------------------------------------- /config/futex.m4: -------------------------------------------------------------------------------- 1 | dnl ---------------------------------------------------------------------- 2 | dnl This whole bit snagged from libgomp. 3 | 4 | dnl 5 | dnl GCC_LINUX_FUTEX 6 | dnl (SHELL-CODE_HANDLER) 7 | dnl 8 | AC_DEFUN([GCC_LINUX_FUTEX],[dnl 9 | GCC_ENABLE(linux-futex,default, ,[use the Linux futex system call], 10 | permit yes|no|default) 11 | case "$target" in 12 | *-linux*) 13 | case "$enable_linux_futex" in 14 | default) 15 | # If headers don't have gettid/futex syscalls definition, then 16 | # default to no, otherwise there will be compile time failures. 17 | # Otherwise, default to yes. If we don't detect we are 18 | # compiled/linked against NPTL and not cross-compiling, check 19 | # if programs are run by default against NPTL and if not, issue 20 | # a warning. 21 | enable_linux_futex=no 22 | AC_LINK_IFELSE( 23 | [AC_LANG_PROGRAM( 24 | [#include 25 | int lk;], 26 | [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])], 27 | [save_LIBS="$LIBS" 28 | LIBS="-lpthread $LIBS" 29 | AC_LINK_IFELSE( 30 | [AC_LANG_PROGRAM( 31 | [#ifndef _GNU_SOURCE 32 | #define _GNU_SOURCE 1 33 | #endif 34 | #include 35 | pthread_t th; void *status;], 36 | [pthread_tryjoin_np (th, &status);])],[enable_linux_futex=yes], 37 | [if test x$cross_compiling = xno; then 38 | if getconf GNU_LIBPTHREAD_VERSION 2>/dev/null \ 39 | | LC_ALL=C grep -i NPTL > /dev/null 2>/dev/null; then :; else 40 | AC_MSG_WARN([The kernel might not support futex or gettid syscalls. 41 | If so, please configure with --disable-linux-futex]) 42 | fi 43 | fi 44 | enable_linux_futex=yes]) 45 | LIBS="$save_LIBS"]) 46 | ;; 47 | yes) 48 | AC_LINK_IFELSE( 49 | [AC_LANG_PROGRAM( 50 | [#include 51 | int lk;], 52 | [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])],[], 53 | [AC_MSG_ERROR([SYS_gettid and SYS_futex required for --enable-linux-futex])]) 54 | ;; 55 | esac 56 | ;; 57 | *) 58 | enable_linux_futex=no 59 | ;; 60 | esac 61 | if test x$enable_linux_futex = xyes; then 62 | $1 63 | fi 64 | ]) 65 | -------------------------------------------------------------------------------- /config/gc++filt.m4: -------------------------------------------------------------------------------- 1 | # gc++filt.m4 serial 1 -*- Autoconf -*- 2 | # Find an instance of GNU c++filt on PATH. 3 | 4 | dnl Copyright (C) 2010 Free Software Foundation, Inc. 5 | dnl This file is free software, distributed under the terms of the GNU 6 | dnl General Public License. As a special exception to the GNU General 7 | dnl Public License, this file may be distributed as part of a program 8 | dnl that contains a configuration script generated by Autoconf, under 9 | dnl the same distribution terms as the rest of that program. 10 | 11 | dnl From Rainer Orth. 12 | 13 | # GCC_PROG_GNU_CXXFILT 14 | # -------------------- 15 | # Check for GNU c++filt. 16 | # FIXME: Maybe need TARGET variant, though c++filt should be target 17 | # independent. 18 | AC_DEFUN([GCC_PROG_GNU_CXXFILT], 19 | [AC_ARG_VAR([CXXFILT], [Location of GNU c++filt. Defaults to the first 20 | GNU version of `c++filt', `gc++filt' on PATH.]) 21 | AC_CACHE_CHECK([for GNU c++filt], [ac_cv_path_CXXFILT], 22 | [AC_PATH_PROGS_FEATURE_CHECK([CXXFILT], [c++filt gc++filt], 23 | [_AC_PATH_PROG_FLAVOR_GNU([$ac_path_CXXFILT], 24 | [ac_cv_path_CXXFILT=$ac_path_CXXFILT && ac_path_CXXFILT_found=:])])]) 25 | CXXFILT=$ac_cv_path_CXXFILT 26 | ]) 27 | -------------------------------------------------------------------------------- /config/gettext-sister.m4: -------------------------------------------------------------------------------- 1 | # intl sister-directory configuration rules. 2 | # 3 | 4 | # The idea behind this macro is that there's no need to repeat all the 5 | # autoconf probes done by the intl directory - it's already done them 6 | # for us. In fact, there's no need even to look at the cache for the 7 | # answers. All we need to do is nab a few pieces of information. 8 | # The intl directory is set up to make this easy, by generating a 9 | # small file which can be sourced as a shell script; then we produce 10 | # the necessary substitutions and definitions for this directory. 11 | 12 | AC_DEFUN([ZW_GNU_GETTEXT_SISTER_DIR], 13 | [# If we haven't got the data from the intl directory, 14 | # assume NLS is disabled. 15 | USE_NLS=no AC_SUBST(USE_NLS) 16 | LIBINTL= AC_SUBST(LIBINTL) 17 | LIBINTL_DEP= AC_SUBST(LIBINTL_DEP) 18 | INCINTL= AC_SUBST(INCINTL) 19 | XGETTEXT= AC_SUBST(XGETTEXT) 20 | GMSGFMT= AC_SUBST(GMSGFMT) 21 | POSUB= AC_SUBST(POSUB) 22 | 23 | if test -f ifelse([$1],,[../intl],[$1])/config.intl; then 24 | . ifelse([$1],,[../intl],[$1])/config.intl 25 | fi 26 | AC_MSG_CHECKING([whether NLS is requested]) 27 | if test x"$USE_NLS" != xyes; then 28 | AC_MSG_RESULT(no) 29 | else 30 | AC_MSG_RESULT(yes) 31 | AC_DEFINE(ENABLE_NLS, 1, 32 | [Define to 1 if translation of program messages to the 33 | user's native language is requested.]) 34 | 35 | AC_MSG_CHECKING(for catalogs to be installed) 36 | # Look for .po and .gmo files in the source directory. 37 | CATALOGS= AC_SUBST(CATALOGS) 38 | XLINGUAS= 39 | for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do 40 | # If there aren't any .gmo files the shell will give us the 41 | # literal string "../path/to/srcdir/po/*.gmo" which has to be 42 | # weeded out. 43 | case "$cat" in *\**) 44 | continue;; 45 | esac 46 | # The quadruple backslash is collapsed to a double backslash 47 | # by the backticks, then collapsed again by the double quotes, 48 | # leaving us with one backslash in the sed expression (right 49 | # before the dot that mustn't act as a wildcard). 50 | cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"` 51 | lang=`echo $cat | sed -e "s!\\\\.gmo!!"` 52 | # The user is allowed to set LINGUAS to a list of languages to 53 | # install catalogs for. If it's empty that means "all of them." 54 | if test "x$LINGUAS" = x; then 55 | CATALOGS="$CATALOGS $cat" 56 | XLINGUAS="$XLINGUAS $lang" 57 | else 58 | case "$LINGUAS" in *$lang*) 59 | CATALOGS="$CATALOGS $cat" 60 | XLINGUAS="$XLINGUAS $lang" 61 | ;; 62 | esac 63 | fi 64 | done 65 | LINGUAS="$XLINGUAS" 66 | AC_MSG_RESULT($LINGUAS) 67 | 68 | dnl Set up some additional variables which our po/Make-in files 69 | dnl may need. 70 | 71 | dnl For backward compatibility. Some Makefiles may be using these. 72 | DATADIRNAME=share 73 | AC_SUBST(DATADIRNAME) 74 | INSTOBJEXT=.mo 75 | AC_SUBST(INSTOBJEXT) 76 | GENCAT=gencat 77 | AC_SUBST(GENCAT) 78 | CATOBJEXT=.gmo 79 | AC_SUBST(CATOBJEXT) 80 | fi]) 81 | -------------------------------------------------------------------------------- /config/glibc21.m4: -------------------------------------------------------------------------------- 1 | # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) 2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | # Test for the GNU C Library, version 2.1 or newer. 10 | # From Bruno Haible. 11 | 12 | AC_DEFUN([jm_GLIBC21], 13 | [ 14 | AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, 15 | ac_cv_gnu_library_2_1, 16 | [AC_EGREP_CPP([Lucky GNU user], 17 | [ 18 | #include 19 | #ifdef __GNU_LIBRARY__ 20 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) 21 | Lucky GNU user 22 | #endif 23 | #endif 24 | ], 25 | ac_cv_gnu_library_2_1=yes, 26 | ac_cv_gnu_library_2_1=no) 27 | ] 28 | ) 29 | AC_SUBST(GLIBC21) 30 | GLIBC21="$ac_cv_gnu_library_2_1" 31 | ] 32 | ) 33 | -------------------------------------------------------------------------------- /config/gthr.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2012 Free Software Foundation, Inc. 2 | dnl This file is free software, distributed under the terms of the GNU 3 | dnl General Public License. As a special exception to the GNU General 4 | dnl Public License, this file may be distributed as part of a program 5 | dnl that contains a configuration script generated by Autoconf, under 6 | dnl the same distribution terms as the rest of that program. 7 | 8 | dnl Define header location by thread model 9 | 10 | dnl usage: GCC_AC_THREAD_HEADER([thread_model]) 11 | AC_DEFUN([GCC_AC_THREAD_HEADER], 12 | [ 13 | case $1 in 14 | aix) thread_header=config/rs6000/gthr-aix.h ;; 15 | dce) thread_header=config/pa/gthr-dce.h ;; 16 | lynx) thread_header=config/gthr-lynx.h ;; 17 | mipssde) thread_header=config/mips/gthr-mipssde.h ;; 18 | posix) thread_header=gthr-posix.h ;; 19 | rtems) thread_header=config/gthr-rtems.h ;; 20 | single) thread_header=gthr-single.h ;; 21 | tpf) thread_header=config/s390/gthr-tpf.h ;; 22 | vxworks) thread_header=config/gthr-vxworks.h ;; 23 | win32) thread_header=config/i386/gthr-win32.h ;; 24 | esac 25 | AC_SUBST(thread_header) 26 | ]) 27 | 28 | -------------------------------------------------------------------------------- /config/gxx-include-dir.m4: -------------------------------------------------------------------------------- 1 | dnl Usage: TL_AC_GXX_INCLUDE_DIR 2 | dnl 3 | dnl Set $gxx_include_dir to the location of the installed C++ include 4 | dnl directory. The value depends on $gcc_version and the configuration 5 | dnl options --with-gxx-include-dir and --enable-version-specific-runtime-libs. 6 | dnl 7 | dnl If you change the default here, you'll need to change the gcc and 8 | dnl libstdc++-v3 subdirectories too. 9 | AC_DEFUN([TL_AC_GXX_INCLUDE_DIR], 10 | [ 11 | case "${with_gxx_include_dir}" in 12 | yes) 13 | AC_MSG_ERROR([--with-gxx-include-dir=[[dir]] requires a directory]) 14 | ;; 15 | no | "") 16 | case "${enable_version_specific_runtime_libs}" in 17 | yes) gxx_include_dir='$(libsubdir)/include/c++' ;; 18 | *) 19 | libstdcxx_incdir='c++/$(gcc_version)' 20 | gxx_include_dir='include/$(libstdcxx_incdir)' 21 | if test -n "$with_cross_host" && 22 | test x"$with_cross_host" != x"no"; then 23 | gxx_include_dir='${prefix}/${target_alias}/'"$gxx_include_dir" 24 | else 25 | gxx_include_dir='${prefix}/'"$gxx_include_dir" 26 | fi;; 27 | esac ;; 28 | *) gxx_include_dir=${with_gxx_include_dir} ;; 29 | esac 30 | AC_SUBST(gxx_include_dir) 31 | AC_SUBST(libstdcxx_incdir) 32 | ]) 33 | -------------------------------------------------------------------------------- /config/iconv.m4: -------------------------------------------------------------------------------- 1 | # iconv.m4 serial AM4 (gettext-0.11.3) 2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Bruno Haible. 10 | 11 | AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], 12 | [ 13 | dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. 14 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 15 | AC_REQUIRE([AC_LIB_RPATH]) 16 | 17 | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV 18 | dnl accordingly. 19 | AC_LIB_LINKFLAGS_BODY([iconv]) 20 | ]) 21 | 22 | AC_DEFUN([AM_ICONV_LINK], 23 | [ 24 | dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and 25 | dnl those with the standalone portable GNU libiconv installed). 26 | 27 | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV 28 | dnl accordingly. 29 | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) 30 | 31 | dnl Add $INCICONV to CPPFLAGS before performing the following checks, 32 | dnl because if the user has installed libiconv and not disabled its use 33 | dnl via --without-libiconv-prefix, he wants to use it. The first 34 | dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. 35 | am_save_CPPFLAGS="$CPPFLAGS" 36 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) 37 | 38 | AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ 39 | am_cv_func_iconv="no, consider installing GNU libiconv" 40 | am_cv_lib_iconv=no 41 | AC_TRY_LINK([#include 42 | #include ], 43 | [iconv_t cd = iconv_open("",""); 44 | iconv(cd,NULL,NULL,NULL,NULL); 45 | iconv_close(cd);], 46 | am_cv_func_iconv=yes) 47 | if test "$am_cv_func_iconv" != yes; then 48 | am_save_LIBS="$LIBS" 49 | LIBS="$LIBS $LIBICONV" 50 | AC_TRY_LINK([#include 51 | #include ], 52 | [iconv_t cd = iconv_open("",""); 53 | iconv(cd,NULL,NULL,NULL,NULL); 54 | iconv_close(cd);], 55 | am_cv_lib_iconv=yes 56 | am_cv_func_iconv=yes) 57 | LIBS="$am_save_LIBS" 58 | fi 59 | ]) 60 | if test "$am_cv_func_iconv" = yes; then 61 | AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) 62 | fi 63 | if test "$am_cv_lib_iconv" = yes; then 64 | AC_MSG_CHECKING([how to link with libiconv]) 65 | AC_MSG_RESULT([$LIBICONV]) 66 | else 67 | dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV 68 | dnl either. 69 | CPPFLAGS="$am_save_CPPFLAGS" 70 | LIBICONV= 71 | LTLIBICONV= 72 | fi 73 | AC_SUBST(LIBICONV) 74 | AC_SUBST(LTLIBICONV) 75 | ]) 76 | 77 | AC_DEFUN([AM_ICONV], 78 | [ 79 | AM_ICONV_LINK 80 | if test "$am_cv_func_iconv" = yes; then 81 | AC_MSG_CHECKING([for iconv declaration]) 82 | AC_CACHE_VAL(am_cv_proto_iconv, [ 83 | AC_TRY_COMPILE([ 84 | #include 85 | #include 86 | extern 87 | #ifdef __cplusplus 88 | "C" 89 | #endif 90 | #if defined(__STDC__) || defined(__cplusplus) 91 | size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); 92 | #else 93 | size_t iconv(); 94 | #endif 95 | ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") 96 | am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) 97 | am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` 98 | AC_MSG_RESULT([$]{ac_t:- 99 | }[$]am_cv_proto_iconv) 100 | AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, 101 | [Define as const if the declaration of iconv() needs const.]) 102 | fi 103 | ]) 104 | -------------------------------------------------------------------------------- /config/intdiv0.m4: -------------------------------------------------------------------------------- 1 | # intdiv0.m4 serial 1 (gettext-0.11.3) 2 | dnl Copyright (C) 2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Bruno Haible. 10 | 11 | AC_DEFUN([gt_INTDIV0], 12 | [ 13 | AC_REQUIRE([AC_PROG_CC])dnl 14 | AC_REQUIRE([AC_CANONICAL_HOST])dnl 15 | 16 | AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], 17 | gt_cv_int_divbyzero_sigfpe, 18 | [ 19 | AC_TRY_RUN([ 20 | #include 21 | #include 22 | 23 | static void 24 | #ifdef __cplusplus 25 | sigfpe_handler (int sig) 26 | #else 27 | sigfpe_handler (sig) int sig; 28 | #endif 29 | { 30 | /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ 31 | exit (sig != SIGFPE); 32 | } 33 | 34 | int x = 1; 35 | int y = 0; 36 | int z; 37 | int nan; 38 | 39 | int main () 40 | { 41 | signal (SIGFPE, sigfpe_handler); 42 | /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ 43 | #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) 44 | signal (SIGTRAP, sigfpe_handler); 45 | #endif 46 | /* Linux/SPARC yields signal SIGILL. */ 47 | #if defined (__sparc__) && defined (__linux__) 48 | signal (SIGILL, sigfpe_handler); 49 | #endif 50 | 51 | z = x / y; 52 | nan = y / y; 53 | exit (1); 54 | } 55 | ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, 56 | [ 57 | # Guess based on the CPU. 58 | case "$host_cpu" in 59 | alpha* | i[34567]86 | m68k | s390*) 60 | gt_cv_int_divbyzero_sigfpe="guessing yes";; 61 | *) 62 | gt_cv_int_divbyzero_sigfpe="guessing no";; 63 | esac 64 | ]) 65 | ]) 66 | case "$gt_cv_int_divbyzero_sigfpe" in 67 | *yes) value=1;; 68 | *) value=0;; 69 | esac 70 | AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, 71 | [Define if integer division by zero raises signal SIGFPE.]) 72 | ]) 73 | -------------------------------------------------------------------------------- /config/inttypes-pri.m4: -------------------------------------------------------------------------------- 1 | # inttypes-pri.m4 serial 1 (gettext-0.11.4) 2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Bruno Haible. 10 | 11 | # Define PRI_MACROS_BROKEN if exists and defines the PRI* 12 | # macros to non-string values. This is the case on AIX 4.3.3. 13 | 14 | AC_DEFUN([gt_INTTYPES_PRI], 15 | [ 16 | AC_REQUIRE([gt_HEADER_INTTYPES_H]) 17 | if test $gt_cv_header_inttypes_h = yes; then 18 | AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], 19 | gt_cv_inttypes_pri_broken, 20 | [ 21 | AC_TRY_COMPILE([#include 22 | #ifdef PRId32 23 | char *p = PRId32; 24 | #endif 25 | ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) 26 | ]) 27 | fi 28 | if test "$gt_cv_inttypes_pri_broken" = yes; then 29 | AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, 30 | [Define if exists and defines unusable PRI* macros.]) 31 | fi 32 | ]) 33 | -------------------------------------------------------------------------------- /config/inttypes.m4: -------------------------------------------------------------------------------- 1 | # inttypes.m4 serial 1 (gettext-0.11.4) 2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Paul Eggert. 10 | 11 | # Define HAVE_INTTYPES_H if exists and doesn't clash with 12 | # . 13 | 14 | AC_DEFUN([gt_HEADER_INTTYPES_H], 15 | [ 16 | AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, 17 | [ 18 | AC_TRY_COMPILE( 19 | [#include 20 | #include ], 21 | [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) 22 | ]) 23 | if test $gt_cv_header_inttypes_h = yes; then 24 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, 25 | [Define if exists and doesn't clash with .]) 26 | fi 27 | ]) 28 | -------------------------------------------------------------------------------- /config/inttypes_h.m4: -------------------------------------------------------------------------------- 1 | # inttypes_h.m4 serial 5 (gettext-0.12) 2 | dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Paul Eggert. 10 | 11 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, 12 | # doesn't clash with , and declares uintmax_t. 13 | 14 | AC_DEFUN([jm_AC_HEADER_INTTYPES_H], 15 | [ 16 | AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, 17 | [AC_TRY_COMPILE( 18 | [#include 19 | #include ], 20 | [uintmax_t i = (uintmax_t) -1;], 21 | jm_ac_cv_header_inttypes_h=yes, 22 | jm_ac_cv_header_inttypes_h=no)]) 23 | if test $jm_ac_cv_header_inttypes_h = yes; then 24 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, 25 | [Define if exists, doesn't clash with , 26 | and declares uintmax_t. ]) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /config/largefile.m4: -------------------------------------------------------------------------------- 1 | # This macro wraps AC_SYS_LARGEFILE with one exception for Solaris. 2 | # PR 9992/binutils: We have to replicate everywhere the behaviour of 3 | # bfd's configure script so that all the directories agree on the size 4 | # of structures used to describe files. 5 | 6 | AC_DEFUN([ACX_LARGEFILE],[dnl 7 | 8 | # The tests for host and target for $enable_largefile require 9 | # canonical names. 10 | AC_REQUIRE([AC_CANONICAL_HOST]) 11 | AC_REQUIRE([AC_CANONICAL_TARGET]) 12 | 13 | # As the $enable_largefile decision depends on --enable-plugins we must set it 14 | # even in directories otherwise not depending on the $plugins option. 15 | 16 | AC_PLUGINS 17 | 18 | case "${host}" in 19 | changequote(,)dnl 20 | sparc-*-solaris*|i[3-7]86-*-solaris*) 21 | changequote([,])dnl 22 | # On native 32bit sparc and ia32 solaris, large-file and procfs support 23 | # are mutually exclusive; and without procfs support, the bfd/ elf module 24 | # cannot provide certain routines such as elfcore_write_prpsinfo 25 | # or elfcore_write_prstatus. So unless the user explicitly requested 26 | # large-file support through the --enable-largefile switch, disable 27 | # large-file support in favor of procfs support. 28 | test "${target}" = "${host}" -a "x$plugins" = xno \ 29 | && : ${enable_largefile="no"} 30 | ;; 31 | esac 32 | 33 | AC_SYS_LARGEFILE 34 | ]) 35 | -------------------------------------------------------------------------------- /config/lcmessage.m4: -------------------------------------------------------------------------------- 1 | # lcmessage.m4 serial 3 (gettext-0.11.3) 2 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | dnl 9 | dnl This file can can be used in projects which are not available under 10 | dnl the GNU General Public License or the GNU Library General Public 11 | dnl License but which still want to provide support for the GNU gettext 12 | dnl functionality. 13 | dnl Please note that the actual code of the GNU gettext library is covered 14 | dnl by the GNU Library General Public License, and the rest of the GNU 15 | dnl gettext package package is covered by the GNU General Public License. 16 | dnl They are *not* in the public domain. 17 | 18 | dnl Authors: 19 | dnl Ulrich Drepper , 1995. 20 | 21 | # Check whether LC_MESSAGES is available in . 22 | 23 | AC_DEFUN([AM_LC_MESSAGES], 24 | [ 25 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, 26 | [AC_TRY_LINK([#include ], [return LC_MESSAGES], 27 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) 28 | if test $am_cv_val_LC_MESSAGES = yes; then 29 | AC_DEFINE(HAVE_LC_MESSAGES, 1, 30 | [Define if your file defines LC_MESSAGES.]) 31 | fi 32 | ]) 33 | -------------------------------------------------------------------------------- /config/ld-symbolic.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2007 Free Software Foundation, Inc. 2 | dnl This file is free software, distributed under the terms of the GNU 3 | dnl General Public License. As a special exception to the GNU General 4 | dnl Public License, this file may be distributed as part of a program 5 | dnl that contains a configuration script generated by Autoconf, under 6 | dnl the same distribution terms as the rest of that program. 7 | 8 | dnl Set SYMBOLIC_LDFLAGS to -Bsymbolic-functions for GNU linker if it 9 | dnl is supported. 10 | AC_DEFUN([ACX_PROG_LD_GNU_SYMBOLIC], 11 | [AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions], 12 | acl_cv_prog_gnu_ld_symbolic, [ 13 | acl_cv_prog_gnu_ld_symbolic=no 14 | AC_REQUIRE([AC_LIB_PROG_LD_GNU]) 15 | if test x"$with_gnu_ld" = x"yes"; then 16 | if $LD --help 2>&1 &5; then 17 | acl_cv_prog_gnu_ld_symbolic=yes 18 | fi 19 | fi]) 20 | if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then 21 | SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions" 22 | else 23 | SYMBOLIC_LDFLAGS='' 24 | fi 25 | ]) 26 | 27 | dnl Set DYNAMIC_LIST_CPP_NEW_LDFLAGS to --dynamic-list-cpp-new for GNU 28 | dnl linker if it is supported. 29 | AC_DEFUN([ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW], 30 | [AC_CACHE_CHECK([if the GNU linker ($LD) supports --dynamic-list-cpp-new], 31 | acl_cv_prog_gnu_ld_dynamic_list_cpp_new, [ 32 | acl_cv_prog_gnu_ld_dynamic_list_cpp_new=no 33 | AC_REQUIRE([ACX_PROG_LD_GNU_SYMBOLIC]) 34 | if test x"$with_gnu_ld" = x"yes" -a \ 35 | x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then 36 | if $LD --help 2>&1 &5; then 37 | acl_cv_prog_gnu_ld_dynamic_list_cpp_new=yes 38 | fi 39 | fi]) 40 | if test x"$acl_cv_prog_gnu_ld_dynamic_list_cpp_new" = x"yes"; then 41 | DYNAMIC_LIST_CPP_NEW_LDFLAGS="$SYMBOLIC_LDFLAGS -Wl,--dynamic-list-cpp-new" 42 | else 43 | DYNAMIC_LIST_CPP_NEW_LDFLAGS='' 44 | fi 45 | ]) 46 | -------------------------------------------------------------------------------- /config/lead-dot.m4: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Copyright (C) 2003, 2009 Free Software Foundation, Inc. 3 | 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 3, or (at your option) 7 | # any later version. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; see the file COPYING3. If not see 16 | # . 17 | 18 | # serial 1 19 | 20 | # Check whether the underlying file-system supports filenames 21 | # with a leading dot. For instance MS-DOS doesn't. 22 | AC_DEFUN([AM_SET_LEADING_DOT], 23 | [rm -rf .tst 2>/dev/null 24 | mkdir .tst 2>/dev/null 25 | if test -d .tst; then 26 | am__leading_dot=. 27 | else 28 | am__leading_dot=_ 29 | fi 30 | rmdir .tst 2>/dev/null 31 | AC_SUBST([am__leading_dot])]) 32 | -------------------------------------------------------------------------------- /config/lib-ld.m4: -------------------------------------------------------------------------------- 1 | # lib-ld.m4 serial 2 (gettext-0.12) 2 | dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl Subroutines of libtool.m4, 10 | dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision 11 | dnl with libtool.m4. 12 | 13 | dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. 14 | AC_DEFUN([AC_LIB_PROG_LD_GNU], 15 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, 16 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. 17 | if $LD -v 2>&1 &5; then 18 | acl_cv_prog_gnu_ld=yes 19 | else 20 | acl_cv_prog_gnu_ld=no 21 | fi]) 22 | with_gnu_ld=$acl_cv_prog_gnu_ld 23 | ]) 24 | 25 | dnl From libtool-1.4. Sets the variable LD. 26 | AC_DEFUN([AC_LIB_PROG_LD], 27 | [AC_ARG_WITH(gnu-ld, 28 | [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], 29 | test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) 30 | AC_REQUIRE([AC_PROG_CC])dnl 31 | AC_REQUIRE([AC_CANONICAL_HOST])dnl 32 | # Prepare PATH_SEPARATOR. 33 | # The user is always right. 34 | if test "${PATH_SEPARATOR+set}" != set; then 35 | echo "#! /bin/sh" >conf$$.sh 36 | echo "exit 0" >>conf$$.sh 37 | chmod +x conf$$.sh 38 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then 39 | PATH_SEPARATOR=';' 40 | else 41 | PATH_SEPARATOR=: 42 | fi 43 | rm -f conf$$.sh 44 | fi 45 | ac_prog=ld 46 | if test "$GCC" = yes; then 47 | # Check if gcc -print-prog-name=ld gives a path. 48 | AC_MSG_CHECKING([for ld used by GCC]) 49 | case $host in 50 | *-*-mingw*) 51 | # gcc leaves a trailing carriage return which upsets mingw 52 | ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; 53 | *) 54 | ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; 55 | esac 56 | case $ac_prog in 57 | # Accept absolute paths. 58 | [[\\/]* | [A-Za-z]:[\\/]*)] 59 | [re_direlt='/[^/][^/]*/\.\./'] 60 | # Canonicalize the path of ld 61 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` 62 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do 63 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` 64 | done 65 | test -z "$LD" && LD="$ac_prog" 66 | ;; 67 | "") 68 | # If it fails, then pretend we aren't using GCC. 69 | ac_prog=ld 70 | ;; 71 | *) 72 | # If it is relative, then search for the first ld in PATH. 73 | with_gnu_ld=unknown 74 | ;; 75 | esac 76 | elif test "$with_gnu_ld" = yes; then 77 | AC_MSG_CHECKING([for GNU ld]) 78 | else 79 | AC_MSG_CHECKING([for non-GNU ld]) 80 | fi 81 | AC_CACHE_VAL(acl_cv_path_LD, 82 | [if test -z "$LD"; then 83 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" 84 | for ac_dir in $PATH; do 85 | test -z "$ac_dir" && ac_dir=. 86 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then 87 | acl_cv_path_LD="$ac_dir/$ac_prog" 88 | # Check to see if the program is GNU ld. I'd rather use --version, 89 | # but apparently some GNU ld's only accept -v. 90 | # Break only if it was the GNU/non-GNU ld that we prefer. 91 | if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then 92 | test "$with_gnu_ld" != no && break 93 | else 94 | test "$with_gnu_ld" != yes && break 95 | fi 96 | fi 97 | done 98 | IFS="$ac_save_ifs" 99 | else 100 | acl_cv_path_LD="$LD" # Let the user override the test with a path. 101 | fi]) 102 | LD="$acl_cv_path_LD" 103 | if test -n "$LD"; then 104 | AC_MSG_RESULT($LD) 105 | else 106 | AC_MSG_RESULT(no) 107 | fi 108 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) 109 | AC_LIB_PROG_LD_GNU 110 | ]) 111 | -------------------------------------------------------------------------------- /config/libstdc++-raw-cxx.m4: -------------------------------------------------------------------------------- 1 | # This file is part of GCC. 2 | # 3 | # GCC is free software; you can redistribute it and/or modify it under 4 | # the terms of the GNU General Public License as published by the Free 5 | # Software Foundation; either version 3, or (at your option) any later 6 | # version. 7 | # 8 | # GCC is distributed in the hope that it will be useful, but WITHOUT 9 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 11 | # for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with GCC; see the file COPYING3. If not see 15 | # . 16 | 17 | # Define flags, LIBSTDCXX_RAW_CXX_CXXFLAGS and # LIBSTDCXX_RAW_CXX_LDFLAGS, 18 | # for libstdc++-v3 header files to compile and link libraries in C++ with 19 | # raw_cxx=true. 20 | AC_DEFUN([GCC_LIBSTDCXX_RAW_CXX_FLAGS], [ 21 | AC_REQUIRE([ACX_NONCANONICAL_TARGET]) 22 | LIBSTDCXX_RAW_CXX_CXXFLAGS="\ 23 | -I\$(top_builddir)/../libstdc++-v3/include \ 24 | -I\$(top_builddir)/../libstdc++-v3/include/\$(target_noncanonical) \ 25 | -I\$(top_srcdir)/../libstdc++-v3/libsupc++" 26 | LIBSTDCXX_RAW_CXX_LDFLAGS="\ 27 | \$(top_builddir)/../libstdc++-v3/src/libstdc++.la" 28 | AC_SUBST(LIBSTDCXX_RAW_CXX_CXXFLAGS) 29 | AC_SUBST(LIBSTDCXX_RAW_CXX_LDFLAGS) 30 | ]) 31 | -------------------------------------------------------------------------------- /config/lthostflags.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2010 Free Software Foundation, Inc. 2 | dnl This file is free software, distributed under the terms of the GNU 3 | dnl General Public License. As a special exception to the GNU General 4 | dnl Public License, this file may be distributed as part of a program 5 | dnl that contains a configuration script generated by Autoconf, under 6 | dnl the same distribution terms as the rest of that program. 7 | 8 | dnl usage: ACX_LT_HOST_FLAGS([default_flags]) 9 | dnl Defines and AC_SUBSTs lt_host_flags 10 | 11 | 12 | AC_DEFUN([ACX_LT_HOST_FLAGS], [ 13 | AC_REQUIRE([AC_CANONICAL_SYSTEM]) 14 | 15 | case $host in 16 | *-cygwin* | *-mingw*) 17 | # 'host' will be top-level target in the case of a target lib, 18 | # we must compare to with_cross_host to decide if this is a native 19 | # or cross-compiler and select where to install dlls appropriately. 20 | if test -n "$with_cross_host" && 21 | test x"$with_cross_host" != x"no"; then 22 | lt_host_flags='-no-undefined -bindir "$(toolexeclibdir)"'; 23 | else 24 | lt_host_flags='-no-undefined -bindir "$(bindir)"'; 25 | fi 26 | ;; 27 | *) 28 | lt_host_flags=[$1] 29 | ;; 30 | esac 31 | 32 | AC_SUBST(lt_host_flags) 33 | ]) 34 | -------------------------------------------------------------------------------- /config/math.m4: -------------------------------------------------------------------------------- 1 | dnl GCC_CHECK_LIBM 2 | dnl 3 | dnl Check whether -lm is available. This is a pre-requisite for 4 | dnl GCC_CHECK_MATH_FUNC so that it will link with -lm. 5 | AC_DEFUN([GCC_CHECK_LIBM], 6 | [AC_CHECK_LIB([m],[sin])]) 7 | 8 | dnl GCC_CHECK_MATH_HEADERS 9 | dnl 10 | dnl Check for math.h and complex.h. This is a pre-requisite for 11 | dnl GCC_CHECK_MATH_FUNC so that it includes the right headers. 12 | dnl (Some systems, such as AIX or OpenVMS may define macro for math 13 | dnl functions). 14 | AC_DEFUN([GCC_CHECK_MATH_HEADERS], 15 | [AC_CHECK_HEADERS_ONCE(math.h complex.h)]) 16 | 17 | dnl GCC_CHECK_MATH_FUNC([name]) 18 | dnl 19 | dnl Check whether math function NAME is available on the system (by compiling 20 | dnl and linking a C program) and run define HAVE_name on success. 21 | dnl 22 | dnl Note that OpenVMS system insists on including complex.h before math.h 23 | AC_DEFUN([GCC_CHECK_MATH_FUNC], 24 | [ 25 | AC_REQUIRE([GCC_CHECK_LIBM]) 26 | AC_REQUIRE([GCC_CHECK_MATH_HEADERS]) 27 | AC_CACHE_CHECK([for $1], [gcc_cv_math_func_$1], 28 | [AC_LINK_IFELSE([ 29 | #ifdef HAVE_COMPLEX_H 30 | #include 31 | #endif 32 | #ifdef HAVE_MATH_H 33 | #include 34 | #endif 35 | 36 | int (*ptr)() = (int (*)())$1; 37 | 38 | int 39 | main () 40 | { 41 | return 0; 42 | } 43 | ], 44 | [gcc_cv_math_func_$1=yes], 45 | [gcc_cv_math_func_$1=no])]) 46 | if test $gcc_cv_math_func_$1 = yes; then 47 | AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1),[1], 48 | [Define to 1 if you have the `$1' function.]) 49 | fi 50 | ]) 51 | -------------------------------------------------------------------------------- /config/mh-cygwin: -------------------------------------------------------------------------------- 1 | # Increase stack limit to a figure based on the Linux default, with 4MB added 2 | # as GCC turns out to need that much more to pass all the limits-* tests. 3 | LDFLAGS += -Wl,--stack,12582912 4 | BOOT_LDFLAGS += -Wl,--stack,12582912 5 | -------------------------------------------------------------------------------- /config/mh-darwin: -------------------------------------------------------------------------------- 1 | # The -mdynamic-no-pic ensures that the compiler executable is built without 2 | # position-independent-code -- the usual default on Darwin. This fix speeds 3 | # compiles by 3-5%. 4 | BOOT_CFLAGS += -mdynamic-no-pic 5 | 6 | # Ensure we don't try and use -pie, as it is incompatible with pch. 7 | BOOT_LDFLAGS += `case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;` 8 | -------------------------------------------------------------------------------- /config/mh-djgpp: -------------------------------------------------------------------------------- 1 | # Shorten the target alias so when it is used to set 'libsubdir' 2 | # the name will work in both short and long filename environments. 3 | ifeq ($(findstring -pc-msdosdjgpp,$(target_alias)),-pc-msdosdjgpp) 4 | target_alias=djgpp 5 | endif 6 | 7 | # The version string must be modified to contain just one dot 8 | # because DOS filenames can only have one dot when long filenames 9 | # are not available. 10 | __version:=$(gcc_version) 11 | __version:=$(subst ., ,$(__version)) 12 | ifeq ($(words $(__version)),3) 13 | gcc_version=$(word 1,$(__version)).$(word 2,$(__version))$(word 3,$(__version)) 14 | endif 15 | -------------------------------------------------------------------------------- /config/mh-mingw: -------------------------------------------------------------------------------- 1 | # Add -D__USE_MINGW_ACCESS to enable the built compiler to work on Windows 2 | # Vista (see PR33281 for details). 3 | BOOT_CFLAGS += -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format 4 | CFLAGS += -D__USE_MINGW_ACCESS 5 | # Increase stack limit to a figure based on the Linux default, with 4MB added 6 | # as GCC turns out to need that much more to pass all the limits-* tests. 7 | LDFLAGS += -Wl,--stack,12582912 8 | BOOT_LDFLAGS += -Wl,--stack,12582912 9 | -------------------------------------------------------------------------------- /config/mh-pa: -------------------------------------------------------------------------------- 1 | # The ada virtual array implementation requires that indexing be disabled on 2 | # hosts such as hpux that use a segmented memory architecture. Both the c 3 | # and ada files need to be compiled with this option for correct operation. 4 | ADA_CFLAGS = -mdisable-indexing 5 | -------------------------------------------------------------------------------- /config/mh-pa-hpux10: -------------------------------------------------------------------------------- 1 | # The ada virtual array implementation requires that indexing be disabled on 2 | # hosts such as hpux that use a segmented memory architecture. Both the c 3 | # and ada files need to be compiled with this option for correct operation. 4 | ADA_CFLAGS = -mdisable-indexing -D_X_HPUX10 5 | -------------------------------------------------------------------------------- /config/mh-ppc-aix: -------------------------------------------------------------------------------- 1 | # To prevent the Ada static runtime library from using nearly the entire 2 | # TOC, we used to compile Ada files with minimal-toc in addition to -gnatg 3 | # (mandatory to compile language defined units). This incured a performance 4 | # penalty and is not required with section anchors enabled by default so we 5 | # don't do it any more. 6 | BOOT_ADAFLAGS = -gnatapg 7 | BOOT_LDFLAGS = -Wl,-bbigtoc 8 | LDFLAGS = `case '$(CC)' in *gcc*) echo -Wl,-bbigtoc ;; esac;` 9 | -------------------------------------------------------------------------------- /config/mmap.m4: -------------------------------------------------------------------------------- 1 | dnl ---------------------------------------------------------------------- 2 | dnl This whole bit snagged from gcc 3 | 4 | dnl 5 | dnl mmap(2) blacklisting. Some platforms provide the mmap library routine 6 | dnl but don't support all of the features we need from it. 7 | dnl 8 | AC_DEFUN([GCC_AC_FUNC_MMAP_BLACKLIST], 9 | [ 10 | AC_CHECK_HEADER([sys/mman.h], 11 | [gcc_header_sys_mman_h=yes], [gcc_header_sys_mman_h=no]) 12 | AC_CHECK_FUNC([mmap], [gcc_func_mmap=yes], [gcc_func_mmap=no]) 13 | if test "$gcc_header_sys_mman_h" != yes \ 14 | || test "$gcc_func_mmap" != yes; then 15 | gcc_cv_func_mmap_file=no 16 | gcc_cv_func_mmap_dev_zero=no 17 | gcc_cv_func_mmap_anon=no 18 | else 19 | AC_CACHE_CHECK([whether read-only mmap of a plain file works], 20 | gcc_cv_func_mmap_file, 21 | [# Add a system to this blacklist if 22 | # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a 23 | # memory area containing the same data that you'd get if you applied 24 | # read() to the same fd. The only system known to have a problem here 25 | # is VMS, where text files have record structure. 26 | case "$host_os" in 27 | *vms* | ultrix*) 28 | gcc_cv_func_mmap_file=no ;; 29 | *) 30 | gcc_cv_func_mmap_file=yes;; 31 | esac]) 32 | AC_CACHE_CHECK([whether mmap from /dev/zero works], 33 | gcc_cv_func_mmap_dev_zero, 34 | [# Add a system to this blacklist if it has mmap() but /dev/zero 35 | # does not exist, or if mmapping /dev/zero does not give anonymous 36 | # zeroed pages with both the following properties: 37 | # 1. If you map N consecutive pages in with one call, and then 38 | # unmap any subset of those pages, the pages that were not 39 | # explicitly unmapped remain accessible. 40 | # 2. If you map two adjacent blocks of memory and then unmap them 41 | # both at once, they must both go away. 42 | # Systems known to be in this category are Windows (all variants), 43 | # VMS, and Darwin. 44 | case "$host_os" in 45 | *vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) 46 | gcc_cv_func_mmap_dev_zero=no ;; 47 | *) 48 | gcc_cv_func_mmap_dev_zero=yes;; 49 | esac]) 50 | 51 | # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. 52 | AC_CACHE_CHECK([for MAP_ANON(YMOUS)], gcc_cv_decl_map_anon, 53 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( 54 | [#include 55 | #include 56 | #include 57 | 58 | #ifndef MAP_ANONYMOUS 59 | #define MAP_ANONYMOUS MAP_ANON 60 | #endif 61 | ], 62 | [int n = MAP_ANONYMOUS;])], 63 | gcc_cv_decl_map_anon=yes, 64 | gcc_cv_decl_map_anon=no)]) 65 | 66 | if test $gcc_cv_decl_map_anon = no; then 67 | gcc_cv_func_mmap_anon=no 68 | else 69 | AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works], 70 | gcc_cv_func_mmap_anon, 71 | [# Add a system to this blacklist if it has mmap() and MAP_ANON or 72 | # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 73 | # doesn't give anonymous zeroed pages with the same properties listed 74 | # above for use of /dev/zero. 75 | # Systems known to be in this category are Windows, VMS, and SCO Unix. 76 | case "$host_os" in 77 | *vms* | cygwin* | pe | mingw* | sco* | udk* ) 78 | gcc_cv_func_mmap_anon=no ;; 79 | *) 80 | gcc_cv_func_mmap_anon=yes;; 81 | esac]) 82 | fi 83 | fi 84 | 85 | if test $gcc_cv_func_mmap_file = yes; then 86 | AC_DEFINE(HAVE_MMAP_FILE, 1, 87 | [Define if read-only mmap of a plain file works.]) 88 | fi 89 | if test $gcc_cv_func_mmap_dev_zero = yes; then 90 | AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1, 91 | [Define if mmap of /dev/zero works.]) 92 | fi 93 | if test $gcc_cv_func_mmap_anon = yes; then 94 | AC_DEFINE(HAVE_MMAP_ANON, 1, 95 | [Define if mmap with MAP_ANON(YMOUS) works.]) 96 | fi 97 | ]) 98 | -------------------------------------------------------------------------------- /config/mt-alphaieee: -------------------------------------------------------------------------------- 1 | CFLAGS_FOR_TARGET += -mieee 2 | CXXFLAGS_FOR_TARGET += -mieee 3 | GOCFLAGS_FOR_TARGET += -mieee 4 | -------------------------------------------------------------------------------- /config/mt-d30v: -------------------------------------------------------------------------------- 1 | # Build libraries optimizing for space, not speed. 2 | # Turn off warnings about symbols named the same as registers 3 | CFLAGS_FOR_TARGET = -g -Os -Wa,-C 4 | CXXFLAGS_FOR_TARGET = -g -Os -Wa,-C 5 | -------------------------------------------------------------------------------- /config/mt-gnu: -------------------------------------------------------------------------------- 1 | CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE 2 | -------------------------------------------------------------------------------- /config/mt-mips-elfoabi: -------------------------------------------------------------------------------- 1 | include $(srcdir)/config/mt-mips16-compat 2 | -------------------------------------------------------------------------------- /config/mt-mips-gnu: -------------------------------------------------------------------------------- 1 | include $(srcdir)/config/mt-gnu 2 | include $(srcdir)/config/mt-mips16-compat 3 | -------------------------------------------------------------------------------- /config/mt-mips16-compat: -------------------------------------------------------------------------------- 1 | # Configurations use this fragment if they support MIPS16 and non-MIPS16 code, 2 | # but if the libraries are all non-MIPS16. Add -minterlink-mips16 so 3 | # that the libraries can be used with both ISA modes. 4 | CFLAGS_FOR_TARGET += -minterlink-mips16 5 | CXXFLAGS_FOR_TARGET += -minterlink-mips16 6 | -------------------------------------------------------------------------------- /config/mt-ospace: -------------------------------------------------------------------------------- 1 | # Build libraries optimizing for space, not speed. 2 | CFLAGS_FOR_TARGET = -g -Os 3 | CXXFLAGS_FOR_TARGET = -g -Os 4 | -------------------------------------------------------------------------------- /config/mt-sde: -------------------------------------------------------------------------------- 1 | # We default to building libraries optimised for size. We use 2 | # -minterlink-mips16 so that the non-MIPS16 libraries can still be 3 | # linked against partly-MIPS16 code. The -mcode-readable=pcrel option allows 4 | # MIPS16 libraries to run on Harvard-style split I/D memories, so long 5 | # as they have the D-to-I redirect for PC-relative loads. -mno-gpopt 6 | # has two purposes: it allows libraries to be used in situations where 7 | # $gp != our _gp, and it allows them to be built with -G8 while 8 | # retaining link compatibility with -G0 and -G4. 9 | CFLAGS_FOR_TARGET += -Os -minterlink-mips16 -mcode-readable=pcrel -mno-gpopt 10 | CXXFLAGS_FOR_TARGET += -Os -minterlink-mips16 -mcode-readable=pcrel -mno-gpopt 11 | -------------------------------------------------------------------------------- /config/mt-spu: -------------------------------------------------------------------------------- 1 | # spu ld makefile invokes as-new and bin2c in maintainer mode. 2 | all-ld: $(MAINT) all-gas all-binutils 3 | -------------------------------------------------------------------------------- /config/multi.m4: -------------------------------------------------------------------------------- 1 | ## -*- Autoconf -*- 2 | # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2008 3 | # Free Software Foundation, Inc. 4 | # 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # serial 6 10 | 11 | # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR]) 12 | # --------------------------------------------------- 13 | # Add --enable-multilib to configure. 14 | AC_DEFUN([AM_ENABLE_MULTILIB], 15 | [# Default to --enable-multilib 16 | AC_ARG_ENABLE(multilib, 17 | [ --enable-multilib build many library versions (default)], 18 | [case "$enableval" in 19 | yes) multilib=yes ;; 20 | no) multilib=no ;; 21 | *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;; 22 | esac], 23 | [multilib=yes]) 24 | 25 | # We may get other options which we leave undocumented: 26 | # --with-target-subdir, --with-multisrctop, --with-multisubdir 27 | # See config-ml.in if you want the gory details. 28 | 29 | if test "$srcdir" = "."; then 30 | if test "$with_target_subdir" != "."; then 31 | multi_basedir="$srcdir/$with_multisrctop../$2" 32 | else 33 | multi_basedir="$srcdir/$with_multisrctop$2" 34 | fi 35 | else 36 | multi_basedir="$srcdir/$2" 37 | fi 38 | AC_SUBST(multi_basedir) 39 | 40 | # Even if the default multilib is not a cross compilation, 41 | # it may be that some of the other multilibs are. 42 | if test $cross_compiling = no && test $multilib = yes \ 43 | && test "x${with_multisubdir}" != x ; then 44 | cross_compiling=maybe 45 | fi 46 | 47 | AC_OUTPUT_COMMANDS([ 48 | # Only add multilib support code if we just rebuilt the top-level 49 | # Makefile. 50 | case " $CONFIG_FILES " in 51 | *" ]m4_default([$1],Makefile)[ "*) 52 | ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in 53 | ;; 54 | esac], 55 | [ 56 | srcdir="$srcdir" 57 | host="$host" 58 | target="$target" 59 | with_multisubdir="$with_multisubdir" 60 | with_multisrctop="$with_multisrctop" 61 | with_target_subdir="$with_target_subdir" 62 | ac_configure_args="${multilib_arg} ${ac_configure_args}" 63 | multi_basedir="$multi_basedir" 64 | CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} 65 | CC="$CC" 66 | CXX="$CXX" 67 | GFORTRAN="$GFORTRAN" 68 | GCJ="$GCJ"])])dnl 69 | -------------------------------------------------------------------------------- /config/nls.m4: -------------------------------------------------------------------------------- 1 | # nls.m4 serial 1 (gettext-0.12) 2 | dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | dnl 9 | dnl This file can can be used in projects which are not available under 10 | dnl the GNU General Public License or the GNU Library General Public 11 | dnl License but which still want to provide support for the GNU gettext 12 | dnl functionality. 13 | dnl Please note that the actual code of the GNU gettext library is covered 14 | dnl by the GNU Library General Public License, and the rest of the GNU 15 | dnl gettext package package is covered by the GNU General Public License. 16 | dnl They are *not* in the public domain. 17 | 18 | dnl Authors: 19 | dnl Ulrich Drepper , 1995-2000. 20 | dnl Bruno Haible , 2000-2003. 21 | 22 | AC_DEFUN([AM_NLS], 23 | [ 24 | AC_MSG_CHECKING([whether NLS is requested]) 25 | dnl Default is enabled NLS 26 | AC_ARG_ENABLE(nls, 27 | [ --disable-nls do not use Native Language Support], 28 | USE_NLS=$enableval, USE_NLS=yes) 29 | AC_MSG_RESULT($USE_NLS) 30 | AC_SUBST(USE_NLS) 31 | ]) 32 | 33 | AC_DEFUN([AM_MKINSTALLDIRS], 34 | [ 35 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly 36 | dnl find the mkinstalldirs script in another subdir but $(top_srcdir). 37 | dnl Try to locate it. 38 | MKINSTALLDIRS= 39 | if test -n "$ac_aux_dir"; then 40 | case "$ac_aux_dir" in 41 | /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; 42 | *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; 43 | esac 44 | fi 45 | if test -z "$MKINSTALLDIRS"; then 46 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" 47 | fi 48 | AC_SUBST(MKINSTALLDIRS) 49 | ]) 50 | -------------------------------------------------------------------------------- /config/no-executables.m4: -------------------------------------------------------------------------------- 1 | # GCC_NO_EXECUTABLES 2 | # ----------------- 3 | # FIXME: The GCC team has specific needs which the current Autoconf 4 | # framework cannot solve elegantly. This macro implements a dirty 5 | # hack until Autoconf is able to provide the services its users 6 | # need. 7 | # 8 | # Several of the support libraries that are often built with GCC can't 9 | # assume the tool-chain is already capable of linking a program: the 10 | # compiler often expects to be able to link with some of such 11 | # libraries. 12 | # 13 | # In several of these libraries, workarounds have been introduced to 14 | # avoid the AC_PROG_CC_WORKS test, that would just abort their 15 | # configuration. The introduction of AC_EXEEXT, enabled either by 16 | # libtool or by CVS autoconf, have just made matters worse. 17 | # 18 | # Unlike the previous AC_NO_EXECUTABLES, this test does not 19 | # disable link tests at autoconf time, but at configure time. 20 | # This allows AC_NO_EXECUTABLES to be invoked conditionally. 21 | AC_DEFUN_ONCE([GCC_NO_EXECUTABLES], 22 | [m4_divert_push([KILL]) 23 | 24 | AC_BEFORE([$0], [_AC_COMPILER_EXEEXT]) 25 | AC_BEFORE([$0], [AC_LINK_IFELSE]) 26 | 27 | m4_define([_AC_COMPILER_EXEEXT], 28 | [AC_LANG_CONFTEST([AC_LANG_PROGRAM()]) 29 | # FIXME: Cleanup? 30 | AS_IF([AC_TRY_EVAL(ac_link)], [gcc_no_link=no], [gcc_no_link=yes]) 31 | if test x$gcc_no_link = xyes; then 32 | # Setting cross_compile will disable run tests; it will 33 | # also disable AC_CHECK_FILE but that's generally 34 | # correct if we can't link. 35 | cross_compiling=yes 36 | EXEEXT= 37 | else 38 | ]m4_defn([_AC_COMPILER_EXEEXT])dnl 39 | fi 40 | ) 41 | 42 | m4_define([AC_LINK_IFELSE], 43 | if test x$gcc_no_link = xyes; then 44 | AC_MSG_ERROR([Link tests are not allowed after [[$0]].]) 45 | fi 46 | m4_defn([AC_LINK_IFELSE])) 47 | 48 | dnl This is a shame. We have to provide a default for some link tests, 49 | dnl similar to the default for run tests. 50 | m4_define([AC_FUNC_MMAP], 51 | if test x$gcc_no_link = xyes; then 52 | if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then 53 | ac_cv_func_mmap_fixed_mapped=no 54 | fi 55 | fi 56 | if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then 57 | m4_defn([AC_FUNC_MMAP]) 58 | fi) 59 | 60 | m4_divert_pop()dnl 61 | ])# GCC_NO_EXECUTABLES 62 | 63 | # Use the strongest available test out of AC_TRY_COMPILE and AC_TRY_LINK. 64 | AC_DEFUN([GCC_TRY_COMPILE_OR_LINK], 65 | [if test x$gcc_no_link = xyes; then 66 | AC_TRY_COMPILE([$1], [$2], [$3], [$4]) 67 | else 68 | AC_TRY_LINK([$1], [$2], [$3], [$4]) 69 | fi]) 70 | -------------------------------------------------------------------------------- /config/override.m4: -------------------------------------------------------------------------------- 1 | dnl Fix Autoconf bugs by overriding broken internal Autoconf 2 | dnl macros with backports of fixes from newer releases. 3 | dnl 4 | dnl The override bits of this file should be a no-op for the newest 5 | dnl Autoconf version, which means they can be removed once the complete 6 | dnl tree has moved to a new enough Autoconf version. 7 | dnl 8 | dnl The _GCC_AUTOCONF_VERSION_TEST ensures that exactly the desired 9 | dnl Autoconf version is used. It should be kept for consistency. 10 | 11 | dnl Use ifdef/ifelse over m4_ifdef/m4_ifelse to be clean for 2.13. 12 | ifdef([m4_PACKAGE_VERSION], [ 13 | 14 | dnl Provide m4_copy_force and m4_rename_force for old Autoconf versions. 15 | 16 | m4_ifndef([m4_copy_force], 17 | [m4_define([m4_copy_force], 18 | [m4_ifdef([$2], [m4_undefine([$2])])m4_copy($@)])]) 19 | 20 | m4_ifndef([m4_rename_force], 21 | [m4_define([m4_rename_force], 22 | [m4_ifdef([$2], [m4_undefine([$2])])m4_rename($@)])]) 23 | 24 | dnl AC_DEFUN a commonly used macro so this file is picked up. 25 | m4_copy([AC_PREREQ], [_AC_PREREQ]) 26 | AC_DEFUN([AC_PREREQ], [frob]) 27 | m4_copy_force([_AC_PREREQ], [AC_PREREQ]) 28 | 29 | 30 | dnl Ensure exactly this Autoconf version is used 31 | m4_ifndef([_GCC_AUTOCONF_VERSION], 32 | [m4_define([_GCC_AUTOCONF_VERSION], [2.64])]) 33 | 34 | dnl Test for the exact version when AC_INIT is expanded. 35 | dnl This allows to update the tree in steps (for testing) 36 | dnl by putting 37 | dnl m4_define([_GCC_AUTOCONF_VERSION], [X.Y]) 38 | dnl in configure.ac before AC_INIT, 39 | dnl without rewriting this file. 40 | dnl Or for updating the whole tree at once with the definition above. 41 | AC_DEFUN([_GCC_AUTOCONF_VERSION_CHECK], 42 | [m4_if(m4_defn([_GCC_AUTOCONF_VERSION]), 43 | m4_defn([m4_PACKAGE_VERSION]), [], 44 | [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])]) 45 | ]) 46 | m4_define([AC_INIT], m4_defn([AC_INIT])[ 47 | _GCC_AUTOCONF_VERSION_CHECK 48 | ]) 49 | 50 | 51 | dnl Ensure we do not use a buggy M4. 52 | m4_if(m4_index([..wi.d.], [.d.]), [-1], 53 | [m4_fatal(m4_do([m4 with buggy strstr detected. Please install 54 | GNU M4 1.4.16 or newer and set the M4 environment variable]))]) 55 | 56 | 57 | dnl Fix 2.64 cross compile detection for AVR and RTEMS 58 | dnl by not trying to compile fopen. 59 | m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.64], 60 | [m4_foreach([_GCC_LANG], [C, C++, Fortran, Fortran 77], 61 | [m4_define([_AC_LANG_IO_PROGRAM(]_GCC_LANG[)], m4_defn([AC_LANG_PROGRAM(]_GCC_LANG[)]))])]) 62 | 63 | m4_version_prereq([2.66],, [ 64 | dnl We need AC_CHECK_DECL which works for overloaded C++ functions. 65 | 66 | # _AC_CHECK_DECL_BODY 67 | # ------------------- 68 | # Shell function body for AC_CHECK_DECL. 69 | m4_define([_AC_CHECK_DECL_BODY], 70 | [ AS_LINENO_PUSH([$[]1]) 71 | [as_decl_name=`echo $][2|sed 's/ *(.*//'`] 72 | [as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`] 73 | AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3], 74 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4], 75 | [@%:@ifndef $[]as_decl_name 76 | @%:@ifdef __cplusplus 77 | (void) $[]as_decl_use; 78 | @%:@else 79 | (void) $[]as_decl_name; 80 | @%:@endif 81 | @%:@endif 82 | ])], 83 | [AS_VAR_SET([$[]3], [yes])], 84 | [AS_VAR_SET([$[]3], [no])])]) 85 | AS_LINENO_POP 86 | ])# _AC_CHECK_DECL_BODY 87 | 88 | # _AC_CHECK_DECLS(SYMBOL, ACTION-IF_FOUND, ACTION-IF-NOT-FOUND, 89 | # INCLUDES) 90 | # ------------------------------------------------------------- 91 | # Helper to AC_CHECK_DECLS, which generates the check for a single 92 | # SYMBOL with INCLUDES, performs the AC_DEFINE, then expands 93 | # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND. 94 | m4_define([_AC_CHECK_DECLS], 95 | [AC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl 96 | [AC_DEFINE_UNQUOTED(AS_TR_CPP(m4_bpatsubst(HAVE_DECL_[$1],[ *(.*])), 97 | [$ac_have_decl], 98 | [Define to 1 if you have the declaration of `$1', 99 | and to 0 if you don't.])]dnl 100 | [m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])]) 101 | 102 | ]) 103 | 104 | ]) 105 | -------------------------------------------------------------------------------- /config/picflag.m4: -------------------------------------------------------------------------------- 1 | # _GCC_PICFLAG(FLAG, DISPATCH) 2 | # ---------------------------- 3 | # Store PIC flag corresponding to DISPATCH triplet in FLAG. 4 | # Explit use of -fpic in CFLAGS corresponding to FLAG overrides default. 5 | AC_DEFUN([_GCC_PICFLAG], [ 6 | 7 | case "${$2}" in 8 | # PIC is the default on some targets or must not be used. 9 | *-*-darwin*) 10 | # PIC is the default on this platform 11 | # Common symbols not allowed in MH_DYLIB files 12 | $1=-fno-common 13 | ;; 14 | alpha*-dec-osf5*) 15 | # PIC is the default. 16 | ;; 17 | hppa*64*-*-hpux*) 18 | # PIC is the default for 64-bit PA HP-UX. 19 | ;; 20 | i[[34567]]86-*-cygwin* | x86_64-*-cygwin*) 21 | ;; 22 | i[[34567]]86-*-mingw* | x86_64-*-mingw*) 23 | ;; 24 | i[[34567]]86-*-interix[[3-9]]*) 25 | # Interix 3.x gcc -fpic/-fPIC options generate broken code. 26 | # Instead, we relocate shared libraries at runtime. 27 | ;; 28 | i[[34567]]86-*-nto-qnx*) 29 | # QNX uses GNU C++, but need to define -shared option too, otherwise 30 | # it will coredump. 31 | $1='-fPIC -shared' 32 | ;; 33 | i[[34567]]86-pc-msdosdjgpp*) 34 | # DJGPP does not support shared libraries at all. 35 | ;; 36 | ia64*-*-hpux*) 37 | # On IA64 HP-UX, PIC is the default but the pic flag 38 | # sets the default TLS model and affects inlining. 39 | $1=-fPIC 40 | ;; 41 | mips-sgi-irix6*) 42 | # PIC is the default. 43 | ;; 44 | rs6000-ibm-aix* | powerpc-ibm-aix*) 45 | # All AIX code is PIC. 46 | ;; 47 | 48 | # Some targets support both -fPIC and -fpic, but prefer the latter. 49 | # FIXME: Why? 50 | i[[34567]]86-*-* | x86_64-*-*) 51 | $1=-fpic 52 | ;; 53 | m68k-*-*) 54 | $1=-fpic 55 | ;; 56 | # FIXME: Override -fPIC default in libgcc only? 57 | sh-*-linux* | sh[[2346lbe]]*-*-linux*) 58 | $1=-fpic 59 | ;; 60 | # FIXME: Simplify to sh*-*-netbsd*? 61 | sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ 62 | sh64-*-netbsd* | sh64l*-*-netbsd*) 63 | $1=-fpic 64 | ;; 65 | # Default to -fPIC unless specified otherwise. 66 | *) 67 | $1=-fPIC 68 | ;; 69 | esac 70 | 71 | # If the user explicitly uses -fpic/-fPIC, keep that. 72 | case "${m4_bpatsubsts($1, PICFLAG, CFLAGS)}" in 73 | *-fpic*) 74 | $1=-fpic 75 | ;; 76 | *-fPIC*) 77 | $1=-fPIC 78 | ;; 79 | esac 80 | ]) 81 | 82 | # GCC_PICFLAG 83 | # ----------- 84 | # Store host PIC flag in PICFLAG. 85 | AC_DEFUN([GCC_PICFLAG], [ 86 | AC_REQUIRE([AC_CANONICAL_HOST]) 87 | _GCC_PICFLAG([PICFLAG], [host])]) 88 | 89 | # GCC_PICFLAG_FOR_TARGET 90 | # ---------------------- 91 | # Store target PIC flag in PICFLAG_FOR_TARGET. 92 | AC_DEFUN([GCC_PICFLAG_FOR_TARGET], [ 93 | AC_REQUIRE([AC_CANONICAL_TARGET]) 94 | _GCC_PICFLAG([PICFLAG_FOR_TARGET], [target])]) 95 | -------------------------------------------------------------------------------- /config/plugins.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AC_PLUGINS], 2 | [ 3 | AC_ARG_ENABLE([plugins], 4 | AS_HELP_STRING([--enable-plugins], [Enable support for plugins (defaults no)]), 5 | [case "${enableval}" in 6 | yes | "") plugins=yes ;; 7 | no) plugins=no ;; 8 | *) plugins=yes ;; 9 | esac], 10 | [plugins=no]) 11 | ]) 12 | -------------------------------------------------------------------------------- /config/proginstall.m4: -------------------------------------------------------------------------------- 1 | # AC_PROG_INSTALL 2 | # --------------- 3 | # 4 | # This macro is stolen from Autoconf 2.61a-341. 5 | # It requires `install' to be able to install multiple files at once. 6 | # This file will be obsolete when GCC moves to Autoconf 2.62. 7 | 8 | m4_version_prereq([2.62], [], 9 | [ 10 | AC_DEFUN([AC_PROG_INSTALL], 11 | [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 12 | dnl AC_REQUIRE_AUX_FILE([install-sh])dnl This line does not work with 2.59. 13 | # Find a good install program. We prefer a C program (faster), 14 | # so one script is as good as another. But avoid the broken or 15 | # incompatible versions: 16 | # SysV /etc/install, /usr/sbin/install 17 | # SunOS /usr/etc/install 18 | # IRIX /sbin/install 19 | # AIX /bin/install 20 | # AmigaOS /C/install, which installs bootblocks on floppy discs 21 | # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag 22 | # AFS /usr/afsws/bin/install, which mishandles nonexistent args 23 | # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" 24 | # OS/2's system install, which has a completely different semantic 25 | # ./install, which can be erroneously created by make from ./install.sh. 26 | # Reject install programs that cannot install multiple files. 27 | AC_MSG_CHECKING([for a BSD-compatible install]) 28 | if test -z "$INSTALL"; then 29 | AC_CACHE_VAL(ac_cv_path_install, 30 | [_AS_PATH_WALK([$PATH], 31 | [# Account for people who put trailing slashes in PATH elements. 32 | case $as_dir/ in 33 | ./ | .// | /[cC]/* | \ 34 | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ 35 | ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ 36 | /usr/ucb/* ) ;; 37 | *) 38 | # OSF1 and SCO ODT 3.0 have their own names for install. 39 | # Don't use installbsd from OSF since it installs stuff as root 40 | # by default. 41 | for ac_prog in ginstall scoinst install; do 42 | for ac_exec_ext in '' $ac_executable_extensions; do 43 | if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then 44 | if test $ac_prog = install && 45 | grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then 46 | # AIX install. It has an incompatible calling convention. 47 | : 48 | elif test $ac_prog = install && 49 | grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then 50 | # program-specific install script used by HP pwplus--don't use. 51 | : 52 | else 53 | rm -rf conftest.one conftest.two conftest.dir 54 | echo one > conftest.one 55 | echo two > conftest.two 56 | mkdir conftest.dir 57 | if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && 58 | test -s conftest.one && test -s conftest.two && 59 | test -s conftest.dir/conftest.one && 60 | test -s conftest.dir/conftest.two 61 | then 62 | ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" 63 | break 3 64 | fi 65 | fi 66 | fi 67 | done 68 | done 69 | ;; 70 | esac]) 71 | rm -rf conftest.one conftest.two conftest.dir 72 | ])dnl 73 | if test "${ac_cv_path_install+set}" = set; then 74 | INSTALL=$ac_cv_path_install 75 | else 76 | # As a last resort, use the slow shell script. Don't cache a 77 | # value for INSTALL within a source directory, because that will 78 | # break other packages using the cache if that directory is 79 | # removed, or if the value is a relative name. 80 | INSTALL=$ac_install_sh 81 | fi 82 | fi 83 | dnl Do special magic for INSTALL instead of AC_SUBST, to get 84 | dnl relative names right. 85 | AC_MSG_RESULT([$INSTALL]) 86 | 87 | # Use test -z because SunOS4 sh mishandles braces in ${var-val}. 88 | # It thinks the first close brace ends the variable substitution. 89 | test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' 90 | AC_SUBST(INSTALL_PROGRAM)dnl 91 | 92 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' 93 | AC_SUBST(INSTALL_SCRIPT)dnl 94 | 95 | test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' 96 | AC_SUBST(INSTALL_DATA)dnl 97 | ])# AC_PROG_INSTALL 98 | ]) 99 | -------------------------------------------------------------------------------- /config/progtest.m4: -------------------------------------------------------------------------------- 1 | # progtest.m4 serial 3 (gettext-0.12) 2 | dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | dnl 9 | dnl This file can can be used in projects which are not available under 10 | dnl the GNU General Public License or the GNU Library General Public 11 | dnl License but which still want to provide support for the GNU gettext 12 | dnl functionality. 13 | dnl Please note that the actual code of the GNU gettext library is covered 14 | dnl by the GNU Library General Public License, and the rest of the GNU 15 | dnl gettext package package is covered by the GNU General Public License. 16 | dnl They are *not* in the public domain. 17 | 18 | dnl Authors: 19 | dnl Ulrich Drepper , 1996. 20 | 21 | # Search path for a program which passes the given test. 22 | 23 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, 24 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) 25 | AC_DEFUN([AM_PATH_PROG_WITH_TEST], 26 | [ 27 | # Prepare PATH_SEPARATOR. 28 | # The user is always right. 29 | if test "${PATH_SEPARATOR+set}" != set; then 30 | echo "#! /bin/sh" >conf$$.sh 31 | echo "exit 0" >>conf$$.sh 32 | chmod +x conf$$.sh 33 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then 34 | PATH_SEPARATOR=';' 35 | else 36 | PATH_SEPARATOR=: 37 | fi 38 | rm -f conf$$.sh 39 | fi 40 | 41 | # Find out how to test for executable files. Don't use a zero-byte file, 42 | # as systems may use methods other than mode bits to determine executability. 43 | cat >conf$$.file <<_ASEOF 44 | #! /bin/sh 45 | exit 0 46 | _ASEOF 47 | chmod +x conf$$.file 48 | if test -x conf$$.file >/dev/null 2>&1; then 49 | ac_executable_p="test -x" 50 | else 51 | ac_executable_p="test -f" 52 | fi 53 | rm -f conf$$.file 54 | 55 | # Extract the first word of "$2", so it can be a program name with args. 56 | set dummy $2; ac_word=[$]2 57 | AC_MSG_CHECKING([for $ac_word]) 58 | AC_CACHE_VAL(ac_cv_path_$1, 59 | [case "[$]$1" in 60 | [[\\/]]* | ?:[[\\/]]*) 61 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. 62 | ;; 63 | *) 64 | ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR 65 | for ac_dir in ifelse([$5], , $PATH, [$5]); do 66 | IFS="$ac_save_IFS" 67 | test -z "$ac_dir" && ac_dir=. 68 | for ac_exec_ext in '' $ac_executable_extensions; do 69 | if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then 70 | if [$3]; then 71 | ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" 72 | break 2 73 | fi 74 | fi 75 | done 76 | done 77 | IFS="$ac_save_IFS" 78 | dnl If no 4th arg is given, leave the cache variable unset, 79 | dnl so AC_PATH_PROGS will keep looking. 80 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" 81 | ])dnl 82 | ;; 83 | esac])dnl 84 | $1="$ac_cv_path_$1" 85 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then 86 | AC_MSG_RESULT([$]$1) 87 | else 88 | AC_MSG_RESULT(no) 89 | fi 90 | AC_SUBST($1)dnl 91 | ]) 92 | -------------------------------------------------------------------------------- /config/stdint_h.m4: -------------------------------------------------------------------------------- 1 | # stdint_h.m4 serial 3 (gettext-0.12) 2 | dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Paul Eggert. 10 | 11 | # Define HAVE_STDINT_H_WITH_UINTMAX if exists, 12 | # doesn't clash with , and declares uintmax_t. 13 | 14 | AC_DEFUN([jm_AC_HEADER_STDINT_H], 15 | [ 16 | AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, 17 | [AC_TRY_COMPILE( 18 | [#include 19 | #include ], 20 | [uintmax_t i = (uintmax_t) -1;], 21 | jm_ac_cv_header_stdint_h=yes, 22 | jm_ac_cv_header_stdint_h=no)]) 23 | if test $jm_ac_cv_header_stdint_h = yes; then 24 | AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, 25 | [Define if exists, doesn't clash with , 26 | and declares uintmax_t. ]) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /config/uintmax_t.m4: -------------------------------------------------------------------------------- 1 | # uintmax_t.m4 serial 7 (gettext-0.12) 2 | dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Paul Eggert. 10 | 11 | AC_PREREQ(2.13) 12 | 13 | # Define uintmax_t to 'unsigned long' or 'unsigned long long' 14 | # if it is not already defined in or . 15 | 16 | AC_DEFUN([jm_AC_TYPE_UINTMAX_T], 17 | [ 18 | AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) 19 | AC_REQUIRE([jm_AC_HEADER_STDINT_H]) 20 | if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then 21 | AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) 22 | test $ac_cv_type_unsigned_long_long = yes \ 23 | && ac_type='unsigned long long' \ 24 | || ac_type='unsigned long' 25 | AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, 26 | [Define to unsigned long or unsigned long long 27 | if and don't define.]) 28 | else 29 | AC_DEFINE(HAVE_UINTMAX_T, 1, 30 | [Define if you have the 'uintmax_t' type in or .]) 31 | fi 32 | ]) 33 | -------------------------------------------------------------------------------- /config/ulonglong.m4: -------------------------------------------------------------------------------- 1 | # ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40) 2 | dnl Copyright (C) 1999-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Paul Eggert. 10 | 11 | AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], 12 | [ 13 | AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, 14 | [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], 15 | [unsigned long long ullmax = (unsigned long long) -1; 16 | return ull << i | ull >> i | ullmax / ull | ullmax % ull;], 17 | ac_cv_type_unsigned_long_long=yes, 18 | ac_cv_type_unsigned_long_long=no)]) 19 | if test $ac_cv_type_unsigned_long_long = yes; then 20 | AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, 21 | [Define if you have the unsigned long long type.]) 22 | fi 23 | ]) 24 | -------------------------------------------------------------------------------- /config/unwind_ipinfo.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Check whether _Unwind_GetIPInfo is available without doing a link 3 | dnl test so we can use this with libstdc++-v3 and libjava. Need to 4 | dnl use $target to set defaults because automatic checking is not possible 5 | dnl without a link test (and maybe even with a link test). 6 | dnl 7 | 8 | AC_DEFUN([GCC_CHECK_UNWIND_GETIPINFO], [ 9 | AC_ARG_WITH(system-libunwind, 10 | [ --with-system-libunwind use installed libunwind]) 11 | # If system-libunwind was not specifically set, pick a default setting. 12 | if test x$with_system_libunwind = x; then 13 | case ${target} in 14 | ia64-*-hpux*) with_system_libunwind=yes ;; 15 | *) with_system_libunwind=no ;; 16 | esac 17 | fi 18 | # Based on system-libunwind and target, do we have ipinfo? 19 | if test x$with_system_libunwind = xyes; then 20 | case ${target} in 21 | ia64-*-*) have_unwind_getipinfo=no ;; 22 | *) have_unwind_getipinfo=yes ;; 23 | esac 24 | else 25 | # Darwin before version 9 does not have _Unwind_GetIPInfo. 26 | changequote(,) 27 | case ${target} in 28 | *-*-darwin[3-8]|*-*-darwin[3-8].*) have_unwind_getipinfo=no ;; 29 | *) have_unwind_getipinfo=yes ;; 30 | esac 31 | changequote([,]) 32 | fi 33 | 34 | if test x$have_unwind_getipinfo = xyes; then 35 | AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.]) 36 | fi 37 | ]) 38 | -------------------------------------------------------------------------------- /config/weakref.m4: -------------------------------------------------------------------------------- 1 | 2 | dnl Check if the target supports weak. 3 | AC_DEFUN([GCC_CHECK_ATTRIBUTE_WEAK], [ 4 | AC_CACHE_CHECK([whether the target supports weak], 5 | ac_cv_have_attribute_weak, [ 6 | weakref_m4_saved_CFLAGS="$CFLAGS" 7 | CFLAGS="$CFLAGS -Werror" 8 | AC_TRY_COMPILE([void __attribute__((weak)) foo(void) { }], 9 | [], ac_cv_have_attribute_weak=yes, 10 | ac_cv_have_attribute_weak=no) 11 | CFLAGS="$weakref_m4_saved_CFLAGS"]) 12 | if test x"$ac_cv_have_attribute_weak" = xyes; then 13 | AC_DEFINE(HAVE_ATTRIBUTE_WEAK, 1, 14 | [Define to 1 if the target supports __attribute__((weak)).]) 15 | fi]) 16 | 17 | dnl Check whether weak refs work like the ELF ones. 18 | dnl This means that the weak reference works without having to satify 19 | dnl linkage for the item. 20 | dnl There are targets (at least Darwin) where we have fully functional 21 | dnl weakrefs at runtime, but must supply the referenced item at link time. 22 | AC_DEFUN([GCC_CHECK_ELF_STYLE_WEAKREF], [ 23 | AC_CACHE_CHECK([whether weak refs work like ELF], 24 | ac_cv_have_elf_style_weakref, [ 25 | weakref_m4_saved_CFLAGS="$CFLAGS" 26 | case "${host}" in 27 | *-apple-darwin*) CFLAGS="$CFLAGS -Wl,-undefined,dynamic_lookup" ;; 28 | *) ;; 29 | esac 30 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ 31 | extern void fNotToBeFound(void) __attribute__((weak)); 32 | int main () 33 | { 34 | if (fNotToBeFound) 35 | return 1; 36 | else 37 | return 0; 38 | } 39 | ]])], ac_cv_have_elf_style_weakref=yes, ac_cv_have_elf_style_weakref=no, [ 40 | case "${host}" in 41 | *-apple-darwin[[89]]*) ac_cv_have_elf_style_weakref=no ;; 42 | *) ac_cv_have_elf_style_weakref=yes;; 43 | esac])CFLAGS="$weakref_m4_saved_CFLAGS"]) 44 | if test x"$ac_cv_have_elf_style_weakref" = xyes; then 45 | AC_DEFINE(HAVE_ELF_STYLE_WEAKREF, 1, [Define to 1 if target has a weakref that works like the ELF one.]) 46 | fi]) 47 | 48 | -------------------------------------------------------------------------------- /config/zlib.m4: -------------------------------------------------------------------------------- 1 | dnl A function to check for zlib availability. zlib is used by default 2 | dnl unless the user configured with --disable-nls. 3 | 4 | AC_DEFUN([AM_ZLIB], 5 | [ 6 | # See if the user specified whether he wants zlib support or not. 7 | AC_ARG_WITH(zlib, 8 | [ --with-zlib include zlib support (auto/yes/no) [default=auto]], 9 | [], [with_zlib=auto]) 10 | 11 | if test "$with_zlib" != "no"; then 12 | AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)]) 13 | if test "$with_zlib" = "yes" -a "$ac_cv_header_zlib_h" != "yes"; then 14 | AC_MSG_ERROR([zlib (libz) library was explicitly requested but not found]) 15 | fi 16 | fi 17 | ]) 18 | 19 | -------------------------------------------------------------------------------- /cpu/mep-default.cpu: -------------------------------------------------------------------------------- 1 | ; Toshiba MeP Media Engine architecture description. -*- Scheme -*- 2 | ; Copyright 2011 Free Software Foundation, Inc. 3 | ; 4 | ; Contributed by Red Hat Inc; 5 | ; 6 | ; This file is part of the GNU Binutils. 7 | ; 8 | ; This program is free software; you can redistribute it and/or modify 9 | ; it under the terms of the GNU General Public License as published by 10 | ; the Free Software Foundation; either version 3 of the License, or 11 | ; (at your option) any later version. 12 | ; 13 | ; This program is distributed in the hope that it will be useful, 14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ; GNU General Public License for more details. 17 | ; 18 | ; You should have received a copy of the GNU General Public License 19 | ; along with this program; if not, write to the Free Software 20 | ; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 21 | ; MA 02110-1301, USA. 22 | 23 | ; This file serves as a wrapper to bring in the core description plus 24 | ; sample implementations of the UCI and DSP instructions. 25 | 26 | (include "mep-core.cpu") 27 | (include "mep-ext-cop.cpu") 28 | -------------------------------------------------------------------------------- /cpu/mep-ext-cop.cpu: -------------------------------------------------------------------------------- 1 | ; Toshiba MeP Media Engine architecture description. -*- Scheme -*- 2 | ; Copyright 2011 Free Software Foundation, Inc. 3 | ; 4 | ; Contributed by Red Hat Inc; 5 | ; 6 | ; This file is part of the GNU Binutils. 7 | ; 8 | ; This program is free software; you can redistribute it and/or modify 9 | ; it under the terms of the GNU General Public License as published by 10 | ; the Free Software Foundation; either version 3 of the License, or 11 | ; (at your option) any later version. 12 | ; 13 | ; This program is distributed in the hope that it will be useful, 14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ; GNU General Public License for more details. 17 | ; 18 | ; You should have received a copy of the GNU General Public License 19 | ; along with this program; if not, write to the Free Software 20 | ; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 21 | ; MA 02110-1301, USA. 22 | 23 | ;; begin-user-isa-includes 24 | (include "mep-ivc2.cpu") 25 | ;; end-user-isa-includes 26 | -------------------------------------------------------------------------------- /cpu/mep-h1.cpu: -------------------------------------------------------------------------------- 1 | ; Copyright 2011 Free Software Foundation, Inc. 2 | ; 3 | ; Contributed by Red Hat Inc; 4 | ; 5 | ; This file is part of the GNU Binutils. 6 | ; 7 | ; This program is free software; you can redistribute it and/or modify 8 | ; it under the terms of the GNU General Public License as published by 9 | ; the Free Software Foundation; either version 3 of the License, or 10 | ; (at your option) any later version. 11 | ; 12 | ; This program is distributed in the hope that it will be useful, 13 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ; GNU General Public License for more details. 16 | ; 17 | ; You should have received a copy of the GNU General Public License 18 | ; along with this program; if not, write to the Free Software 19 | ; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 20 | ; MA 02110-1301, USA. 21 | 22 | ; Insns introduced for the MeP-h1 core 23 | ; 24 | (dnci stcb_r "store in control bus space" (VOLATILE (MACH h1)) 25 | "stcb $rn,($rma)" 26 | (+ MAJ_7 rn rma (f-sub4 12)) 27 | (c-call VOID "do_stcb" rn (and rma #xffff)) 28 | ((mep (unit u-use-gpr (in usereg rn)) 29 | (unit u-use-gpr (in usereg rma)) 30 | (unit u-exec) 31 | (unit u-stcb)))) 32 | 33 | (dnci ldcb_r "load from control bus space" (VOLATILE (MACH h1) (LATENCY 3)) 34 | "ldcb $rn,($rma)" 35 | (+ MAJ_7 rn rma (f-sub4 13)) 36 | (set rn (c-call SI "do_ldcb" (and rma #xffff))) 37 | ((mep (unit u-use-gpr (in usereg rma)) 38 | (unit u-ldcb) 39 | (unit u-exec) 40 | (unit u-ldcb-gpr (out loadreg rn))))) 41 | 42 | (dnci pref "cache prefetch" ((MACH h1) VOLATILE) 43 | "pref $cimm4,($rma)" 44 | (+ MAJ_7 cimm4 rma (f-sub4 5)) 45 | (sequence () 46 | (c-call VOID "check_option_dcache" pc) 47 | (c-call VOID "do_cache_prefetch" cimm4 rma pc)) 48 | ((mep (unit u-use-gpr (in usereg rma)) 49 | (unit u-exec)))) 50 | -------------------------------------------------------------------------------- /cpu/mep.cpu: -------------------------------------------------------------------------------- 1 | ; Copyright 2011 Free Software Foundation, Inc. 2 | ; 3 | ; Contributed by Red Hat Inc; 4 | ; 5 | ; This file is part of the GNU Binutils. 6 | ; 7 | ; This program is free software; you can redistribute it and/or modify 8 | ; it under the terms of the GNU General Public License as published by 9 | ; the Free Software Foundation; either version 3 of the License, or 10 | ; (at your option) any later version. 11 | ; 12 | ; This program is distributed in the hope that it will be useful, 13 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ; GNU General Public License for more details. 16 | ; 17 | ; You should have received a copy of the GNU General Public License 18 | ; along with this program; if not, write to the Free Software 19 | ; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 20 | ; MA 02110-1301, USA. 21 | (include "mep-default.cpu") 22 | -------------------------------------------------------------------------------- /cpu/sh.opc: -------------------------------------------------------------------------------- 1 | /* SHmedia opcode support. -*- C -*- 2 | 3 | Copyright 2000, 2005, 2007, 2009 Free Software Foundation, Inc. 4 | 5 | Contributed by Red Hat Inc; developed under contract from Hitachi 6 | Semiconductor (America) Inc. 7 | 8 | This file is part of the GNU Binutils. 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation; either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program; if not, write to the Free Software 22 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 23 | MA 02110-1301, USA. */ 24 | 25 | 26 | /* This file is an addendum to sh-media.cpu. Heavy use of C code isn't 27 | appropriate in .cpu files, so it resides here. This especially applies 28 | to assembly/disassembly where parsing/printing can be quite involved. 29 | Such things aren't really part of the specification of the cpu, per se, 30 | so .cpu files provide the general framework and .opc files handle the 31 | nitty-gritty details as necessary. 32 | 33 | Each section is delimited with start and end markers. 34 | 35 | -opc.h additions use: "-- opc.h" 36 | -opc.c additions use: "-- opc.c" 37 | -asm.c additions use: "-- asm.c" 38 | -dis.c additions use: "-- dis.c" 39 | -ibd.h additions use: "-- ibd.h" */ 40 | 41 | /* -- opc.h */ 42 | 43 | /* Allows reason codes to be output when assembler errors occur. */ 44 | #define CGEN_VERBOSE_ASSEMBLER_ERRORS 45 | 46 | /* Override disassembly hashing - there are variable bits in the top 47 | byte of these instructions. */ 48 | #define CGEN_DIS_HASH_SIZE 8 49 | #define CGEN_DIS_HASH(buf,value) (((* (unsigned char*) (buf)) >> 6) % CGEN_DIS_HASH_SIZE) 50 | 51 | /* -- asm.c */ 52 | 53 | static const char * 54 | parse_fsd (CGEN_CPU_DESC cd, 55 | const char ** strp, 56 | int opindex, 57 | long * valuep) 58 | { 59 | abort (); 60 | } 61 | 62 | /* -- dis.c */ 63 | 64 | static void 65 | print_likely (CGEN_CPU_DESC cd, 66 | void * dis_info, 67 | long value, 68 | unsigned int attrs, 69 | bfd_vma pc, 70 | int length) 71 | { 72 | disassemble_info *info = (disassemble_info *) dis_info; 73 | 74 | (*info->fprintf_func) (info->stream, (value) ? "/l" : "/u"); 75 | } 76 | 77 | /* -- */ 78 | -------------------------------------------------------------------------------- /etc/add-log.vi: -------------------------------------------------------------------------------- 1 | Here is a vi macro to create entries in the recommended format for 2 | GDB's ChangeLogs. 3 | 4 | map  1GO:r !date '+\%Y-\%m-\%d'2GA Jason Molenda (:r !whoamikJxA@:r !hostnameA)kJxkddjO * k$ 5 | 6 | It contains control and escape sequences, so don't just cut and paste it. 7 | You'll need to change the "Jason Molenda" bit, of course. :-) Put this 8 | in your $HOME/.exrc and when you type control-X in move-around-mode, 9 | you'll have a changelog template inserted. 10 | 11 | --- Jason Molenda 12 | -------------------------------------------------------------------------------- /etc/configbuild.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.1 2 | Portrait 3 | Center 4 | Inches 5 | 1200 2 6 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 7 | 1050 900 2100 900 2100 1425 1050 1425 1050 900 8 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 9 | 1 1 1.00 60.00 120.00 10 | 1500 1425 1500 2100 11 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 12 | 1 1 1.00 60.00 120.00 13 | 1500 2625 1500 3300 14 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 15 | 2925 900 3825 900 3825 1425 2925 1425 2925 900 16 | 2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 17 | 2325 2625 2325 2100 1050 2100 1050 2625 2325 2625 18 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 19 | 2850 2100 4125 2100 4125 2625 2850 2625 2850 2100 20 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 21 | 1 1 1.00 60.00 120.00 22 | 3375 1425 3375 2100 23 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 24 | 5100 900 6300 900 6300 1350 5100 1350 5100 900 25 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 26 | 1 1 1.00 60.00 120.00 27 | 5625 1350 5625 2100 28 | 2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 29 | 6375 2625 6375 2100 5100 2100 5100 2625 6375 2625 30 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 31 | 1 1 1.00 60.00 120.00 32 | 5625 2625 5625 3300 33 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 34 | 5100 3300 6225 3300 6225 3750 5100 3750 5100 3300 35 | 2 1 2 1 -1 7 0 0 -1 3.000 0 0 -1 1 0 2 36 | 1 1 1.00 60.00 120.00 37 | 2850 2400 2325 2400 38 | 2 1 2 1 -1 7 0 0 -1 3.000 0 0 -1 1 0 2 39 | 1 1 1.00 60.00 120.00 40 | 4125 2400 5100 2400 41 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 42 | 1050 3300 1950 3300 1950 3750 1050 3750 1050 3300 43 | 4 0 -1 0 0 0 12 0.0000000 4 180 645 1200 1200 config.in\001 44 | 4 0 -1 0 0 0 12 0.0000000 4 180 705 3000 1200 configure\001 45 | 4 0 -1 0 0 0 12 0.0000000 4 180 990 3000 2400 config.status\001 46 | 4 0 -1 0 0 0 12 0.0000000 4 180 990 1200 2400 config.status\001 47 | 4 0 -1 0 0 0 12 0.0000000 4 180 600 1200 3600 config.h\001 48 | 4 0 -1 0 0 0 12 0.0000000 4 135 855 5250 1200 Makefile.in\001 49 | 4 0 -1 0 0 0 12 0.0000000 4 180 990 5250 2400 config.status\001 50 | 4 0 -1 0 0 0 12 0.0000000 4 135 675 5250 3600 Makefile\001 51 | -------------------------------------------------------------------------------- /etc/configbuild.jin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yifanlu/cgen/c2fad9043c678cad4f413e702e51f1545a708c79/etc/configbuild.jin -------------------------------------------------------------------------------- /etc/configbuild.tin: -------------------------------------------------------------------------------- 1 | config.in *configure* Makefile.in 2 | | | | 3 | | v | 4 | | config.status | 5 | | | | 6 | *config.status*<======+==========>*config.status* 7 | | | 8 | v v 9 | config.h Makefile 10 | -------------------------------------------------------------------------------- /etc/configdev.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.1 2 | Portrait 3 | Center 4 | Inches 5 | 1200 2 6 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 7 | 1050 900 2100 900 2100 1425 1050 1425 1050 900 8 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 9 | 2925 900 3975 900 3975 1425 2925 1425 2925 900 10 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 11 | 5550 900 6750 900 6750 1350 5550 1350 5550 900 12 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 13 | 3750 1800 5025 1800 5025 2250 3750 2250 3750 1800 14 | 2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 15 | 2175 2625 2175 2100 1050 2100 1050 2625 2175 2625 16 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 17 | 5550 3300 6675 3300 6675 3750 5550 3750 5550 3300 18 | 2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 19 | 6600 2625 6600 2100 5550 2100 5550 2625 6600 2625 20 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 21 | 3750 3600 4875 3600 4875 4050 3750 4050 3750 3600 22 | 2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 23 | 4650 3150 4650 2700 3750 2700 3750 3150 4650 3150 24 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 25 | 2850 5700 3750 5700 3750 6150 2850 6150 2850 5700 26 | 2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 27 | 3750 5250 3750 4800 2925 4800 2925 5250 3750 5250 28 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 29 | 1 1 1.00 60.00 120.00 30 | 1500 1425 1500 2100 31 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 32 | 1 1 1.00 60.00 120.00 33 | 3300 1425 3300 4800 34 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 35 | 1 1 1.00 60.00 120.00 36 | 3300 1575 1875 1575 1875 2100 37 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 38 | 1 1 1.00 60.00 120.00 39 | 3300 1575 5700 1575 5700 2100 40 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 41 | 1 1 1.00 60.00 120.00 42 | 6225 1350 6225 2100 43 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 44 | 1 1 1.00 60.00 120.00 45 | 6075 2625 6075 3300 46 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 47 | 1 1 1.00 60.00 120.00 48 | 4200 2250 4200 2700 49 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 50 | 1 1 1.00 60.00 120.00 51 | 4200 3150 4200 3600 52 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 4 53 | 1 1 1.00 60.00 120.00 54 | 4200 4050 4200 4500 3675 4500 3675 4800 55 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 56 | 1 1 1.00 60.00 120.00 57 | 3375 5250 3375 5700 58 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 59 | 1 1 1.00 60.00 120.00 60 | 3300 2925 3750 2925 61 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 62 | 1 1 1.00 60.00 120.00 63 | 1500 2625 1500 3300 64 | 2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 65 | 1050 3300 2100 3300 2100 3750 1050 3750 1050 3300 66 | 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 4 67 | 1 1 1.00 60.00 120.00 68 | 4875 3825 5250 3825 5250 2400 5550 2400 69 | 4 0 -1 0 0 0 12 0.0000000 4 180 780 1200 1200 acconfig.h\001 70 | 4 0 -1 0 0 0 12 0.0000000 4 180 885 3000 1200 configure.in\001 71 | 4 0 -1 0 0 0 12 0.0000000 4 135 945 5700 1200 Makefile.am\001 72 | 4 0 -1 0 0 0 12 0.0000000 4 135 990 3900 2100 acinclude.m4\001 73 | 4 0 -1 0 0 0 12 0.0000000 4 135 840 1200 2400 autoheader\001 74 | 4 0 -1 0 0 0 12 0.0000000 4 180 645 1200 3600 config.in\001 75 | 4 0 -1 0 0 0 12 0.0000000 4 135 855 5700 3600 Makefile.in\001 76 | 4 0 -1 0 0 0 12 0.0000000 4 135 735 5700 2400 automake\001 77 | 4 0 -1 0 0 0 12 0.0000000 4 135 810 3900 3900 aclocal.m4\001 78 | 4 0 -1 0 0 0 12 0.0000000 4 135 540 3900 3000 aclocal\001 79 | 4 0 -1 0 0 0 12 0.0000000 4 180 705 3000 6000 configure\001 80 | 4 0 -1 0 0 0 12 0.0000000 4 135 660 3000 5100 autoconf\001 81 | -------------------------------------------------------------------------------- /etc/configdev.jin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yifanlu/cgen/c2fad9043c678cad4f413e702e51f1545a708c79/etc/configdev.jin -------------------------------------------------------------------------------- /etc/configdev.tin: -------------------------------------------------------------------------------- 1 | acconfig.h configure.in Makefile.am 2 | | | | 3 | | --------------+---------------------- | 4 | | | | | | 5 | v v | acinclude.m4 | | 6 | *autoheader* | | v v 7 | | | v --->*automake* 8 | v |--->*aclocal* | | 9 | config.in | | | v 10 | | v | Makefile.in 11 | | aclocal.m4--- 12 | | | 13 | v v 14 | *autoconf* 15 | | 16 | v 17 | configure 18 | -------------------------------------------------------------------------------- /etc/configure.in: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | AC_PREREQ(2.5) 3 | AC_INIT(Makefile.in) 4 | 5 | AC_PROG_INSTALL 6 | 7 | # Command-line options. 8 | # Very limited version of AC_MAINTAINER_MODE. 9 | AC_ARG_ENABLE([maintainer-mode], 10 | [AC_HELP_STRING([--enable-maintainer-mode], 11 | [enable make rules and dependencies not useful (and 12 | sometimes confusing) to the casual installer])], 13 | [case ${enable_maintainer_mode} in 14 | yes) MAINT='' ;; 15 | no) MAINT='#' ;; 16 | *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;; 17 | esac 18 | maintainer_mode=${enableval}], 19 | [MAINT='#']) 20 | AC_SUBST([MAINT])dnl 21 | 22 | AC_SUBST(datarootdir) 23 | AC_SUBST(docdir) 24 | AC_SUBST(htmldir) 25 | AC_SUBST(pdfdir) 26 | 27 | AC_OUTPUT(Makefile) 28 | -------------------------------------------------------------------------------- /etc/gnu-oids.texi: -------------------------------------------------------------------------------- 1 | @c This table of OID's is included in the GNU Coding Standards. 2 | @c 3 | @c Copyright 2008, 2009, 2010 Free Software Foundation, Inc. 4 | @c 5 | @c Copying and distribution of this file, with or without modification, 6 | @c are permitted in any medium without royalty provided the copyright 7 | @c notice and this notice are preserved. 8 | @c 9 | @c When adding new OIDs, please add them also to 10 | @c http://www.alvestrand.no/objectid/ (except it gets an internal 11 | @c server error, so never mind) 12 | @c (Our page is http://www.alvestrand.no/objectid/1.3.6.1.4.1.11591.html.) 13 | 14 | 1.3.6.1.4.1.11591 GNU 15 | 16 | 1.3.6.1.4.1.11591.1 GNU Radius 17 | 18 | 1.3.6.1.4.1.11591.2 GnuPG 19 | 1.3.6.1.4.1.11591.2.1 notation 20 | 1.3.6.1.4.1.11591.2.1.1 pkaAddress 21 | 22 | 1.3.6.1.4.1.11591.3 GNU Radar 23 | 24 | 1.3.6.1.4.1.11591.4 GNU GSS 25 | 26 | @c Added 2008-10-24 on request from Sergey Poznyakoff 27 | 1.3.6.1.4.1.11591.5 GNU Mailutils 28 | 29 | @c Added 2009-03-03 on request from Simon Josefsson 30 | 1.3.6.1.4.1.11591.6 GNU Shishi 31 | 32 | @c Added 2010-05-17 on request from Eric Blossom 33 | 1.3.6.1.4.1.11591.7 GNU Radio 34 | 35 | 1.3.6.1.4.1.11591.12 digestAlgorithm 36 | 1.3.6.1.4.1.11591.12.2 TIGER/192 37 | 1.3.6.1.4.1.11591.13 encryptionAlgorithm 38 | 1.3.6.1.4.1.11591.13.2 Serpent 39 | 1.3.6.1.4.1.11591.13.2.1 Serpent-128-ECB 40 | 1.3.6.1.4.1.11591.13.2.2 Serpent-128-CBC 41 | 1.3.6.1.4.1.11591.13.2.3 Serpent-128-OFB 42 | 1.3.6.1.4.1.11591.13.2.4 Serpent-128-CFB 43 | 1.3.6.1.4.1.11591.13.2.21 Serpent-192-ECB 44 | 1.3.6.1.4.1.11591.13.2.22 Serpent-192-CBC 45 | 1.3.6.1.4.1.11591.13.2.23 Serpent-192-OFB 46 | 1.3.6.1.4.1.11591.13.2.24 Serpent-192-CFB 47 | 1.3.6.1.4.1.11591.13.2.41 Serpent-256-ECB 48 | 1.3.6.1.4.1.11591.13.2.42 Serpent-256-CBC 49 | 1.3.6.1.4.1.11591.13.2.43 Serpent-256-OFB 50 | 1.3.6.1.4.1.11591.13.2.44 Serpent-256-CFB 51 | 1.3.6.1.4.1.11591.14 CRC algorithms 52 | 1.3.6.1.4.1.11591.14.1 CRC 32 53 | -------------------------------------------------------------------------------- /ltgcc.m4: -------------------------------------------------------------------------------- 1 | # _LT_LANG_GCJ_CONFIG([TAG]) 2 | # -------------------------- 3 | # Ensure that the configuration variables for the GNU Java Compiler compiler 4 | # are suitably defined. These variables are subsequently used by _LT_CONFIG 5 | # to write the compiler configuration to `libtool'. Locally modified to 6 | # run its tests on C programs, because we cannot link Java programs until 7 | # we have finished building libjava. 8 | AC_DEFUN([_LT_LANG_GCJ_CONFIG], 9 | [AC_REQUIRE([LT_PROG_GCJ])dnl 10 | AC_LANG_SAVE 11 | 12 | # Source file extension for Java test sources. 13 | ac_ext=c 14 | 15 | # Object file extension for compiled Java test sources. 16 | objext=o 17 | _LT_TAGVAR(objext, $1)=$objext 18 | 19 | # Code to be used in simple compile tests 20 | lt_simple_compile_test_code="int some_variable = 0;" 21 | 22 | # Code to be used in simple link tests 23 | lt_simple_link_test_code='int main(){return(0);}' 24 | 25 | # ltmain only uses $CC for tagged configurations so make sure $CC is set. 26 | _LT_TAG_COMPILER 27 | 28 | # save warnings/boilerplate of simple test code 29 | _LT_COMPILER_BOILERPLATE 30 | _LT_LINKER_BOILERPLATE 31 | 32 | # Allow CC to be a program name with arguments. 33 | GCC=yes 34 | compiler=$CC 35 | _LT_TAGVAR(compiler, $1)=$CC 36 | _LT_CC_BASENAME([$compiler]) 37 | 38 | # GCJ did not exist at the time GCC didn't implicitly link libc in. 39 | _LT_TAGVAR(archive_cmds_need_lc, $1)=no 40 | 41 | _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds 42 | 43 | ## CAVEAT EMPTOR: 44 | ## There is no encapsulation within the following macros, do not change 45 | ## the running order or otherwise move them around unless you know exactly 46 | ## what you are doing... 47 | if test -n "$compiler"; then 48 | _LT_COMPILER_NO_RTTI($1) 49 | _LT_COMPILER_PIC($1) 50 | _LT_COMPILER_C_O($1) 51 | _LT_COMPILER_FILE_LOCKS($1) 52 | _LT_LINKER_SHLIBS($1) 53 | _LT_LINKER_HARDCODE_LIBPATH($1) 54 | 55 | _LT_CONFIG($1) 56 | fi 57 | 58 | _LT_TAGVAR(compiler, $1)=${GCJ-gcj} 59 | AC_LANG_RESTORE 60 | ])# _LT_LANG_GCJ_CONFIG 61 | -------------------------------------------------------------------------------- /ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # Generated from ltversion.in. 11 | 12 | # serial 3134 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.7a]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3134]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.2.7a' 20 | macro_revision='1.3134' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /makefile.vms: -------------------------------------------------------------------------------- 1 | # 2 | # makefile for bfd, binutils and gas 3 | # 4 | # Created by Klaus K"ampf (kkaempf@rmi.de) 5 | # 6 | # You must use Version 3.76 of GNU Make 7 | # 8 | # 9 | 10 | ifeq ($(ARCH),ALPHA) 11 | CC = gcc 12 | GASCC = $(CC) 13 | else 14 | CC = cc 15 | GASCC = gcc 16 | endif 17 | 18 | ifeq ($(CC),cc) 19 | CHECK-COMPILER = check_compiler 20 | else 21 | CHECK-COMPILER = 22 | endif 23 | 24 | all: check_cc $(CHECK-COMPILER) [.binutils]makefile.vms 25 | $(CD) [.bfd] 26 | @gmake "CC=$(CC)" 27 | $(CD) [-.opcodes] 28 | @gmake "CC=$(CC)" 29 | $(CD) [-.libiberty] 30 | @gmake "CC=$(CC)" 31 | $(CD) [-.binutils] 32 | @gmake "CC=$(CC)" 33 | $(CD) [-.gas] 34 | @gmake "CC=$(GASCC)" 35 | $(CD) [-] 36 | 37 | check_cc: 38 | ifeq ($CC,) 39 | @$(ECHO) "Please edit MAKEFILE.VMS and select a C Compiler." 40 | stop 41 | endif 42 | 43 | check_compiler: 44 | @$(ECHO) "Perform a '$$ @setup' before starting make" 45 | 46 | [.binutils]makefile.vms: 47 | $(CD) [.binutils] 48 | $$ @configure 49 | $(CD) [-] 50 | 51 | install: all 52 | $(CD) [.binutils] 53 | @gmake "CC=$(CC)" install 54 | $(CD) [-] 55 | $(CD) [.gas] 56 | @gmake "CC=$(GASCC)" install 57 | $(CD) [-] 58 | 59 | clean: 60 | $(CD) [.bfd] 61 | @gmake clean 62 | $(CD) [-.opcodes] 63 | @gmake clean 64 | $(CD) [-.libiberty] 65 | @gmake clean 66 | $(CD) [-.binutils] 67 | @gmake clean 68 | $(CD) [-.gas] 69 | @gmake clean 70 | $(CD) [-] 71 | 72 | -------------------------------------------------------------------------------- /mkdep: -------------------------------------------------------------------------------- 1 | #!/bin/sh - 2 | # 3 | # Copyright (c) 1987 Regents of the University of California. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms are permitted 7 | # provided that the above copyright notice and this paragraph are 8 | # duplicated in all such forms and that any documentation, 9 | # advertising materials, and other materials related to such 10 | # distribution and use acknowledge that the software was developed 11 | # by the University of California, Berkeley. The name of the 12 | # University may not be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 15 | # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 16 | # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 | # 18 | # @(#)mkdep.sh 5.12 (Berkeley) 6/30/88 19 | # 20 | 21 | MAKE=Makefile # default makefile name is "Makefile" 22 | 23 | while : 24 | do case "$1" in 25 | # -f allows you to select a makefile name 26 | -f) 27 | MAKE=$2 28 | shift; shift ;; 29 | 30 | # the -p flag produces "program: program.c" style dependencies 31 | # so .o's don't get produced 32 | -p) 33 | SED='s;\.o;;' 34 | shift ;; 35 | *) 36 | break ;; 37 | esac 38 | done 39 | 40 | if [ $# = 0 ] ; then 41 | echo 'usage: mkdep [-p] [-f makefile] [flags] file ...' 42 | exit 1 43 | fi 44 | 45 | if [ ! -w $MAKE ]; then 46 | echo "mkdep: no writeable file \"$MAKE\"" 47 | exit 1 48 | fi 49 | 50 | TMP=/tmp/mkdep$$ 51 | 52 | trap 'rm -f $TMP ; exit 1' 1 2 3 13 15 53 | 54 | cp $MAKE ${MAKE}.bak 55 | 56 | sed -e '/DO NOT DELETE THIS LINE/,$d' < $MAKE > $TMP 57 | 58 | cat << _EOF_ >> $TMP 59 | # DO NOT DELETE THIS LINE -- mkdep uses it. 60 | # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. 61 | 62 | _EOF_ 63 | 64 | # If your compiler doesn't have -M, add it. If you can't, the next two 65 | # lines will try and replace the "cc -M". The real problem is that this 66 | # hack can't deal with anything that requires a search path, and doesn't 67 | # even try for anything using bracket (<>) syntax. 68 | # 69 | # egrep '^#include[ ]*".*"' /dev/null $* | 70 | # sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' | 71 | 72 | gcc -MM $* | 73 | sed " 74 | s; \./; ;g 75 | $SED" >> $TMP 76 | 77 | cat << _EOF_ >> $TMP 78 | 79 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY 80 | _EOF_ 81 | 82 | # copy to preserve permissions 83 | cp $TMP $MAKE 84 | rm -f ${MAKE}.bak $TMP 85 | exit 0 86 | 87 | 88 | -------------------------------------------------------------------------------- /mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Original author: Noah Friedman 7 | # Created: 1993-05-16 8 | # Public domain. 9 | # 10 | # This file is maintained in Automake, please report 11 | # bugs to or send patches to 12 | # . 13 | 14 | nl=' 15 | ' 16 | IFS=" "" $nl" 17 | errstatus=0 18 | dirmode= 19 | 20 | usage="\ 21 | Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... 22 | 23 | Create each directory DIR (with mode MODE, if specified), including all 24 | leading file name components. 25 | 26 | Report bugs to ." 27 | 28 | # process command line arguments 29 | while test $# -gt 0 ; do 30 | case $1 in 31 | -h | --help | --h*) # -h for help 32 | echo "$usage" 33 | exit $? 34 | ;; 35 | -m) # -m PERM arg 36 | shift 37 | test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } 38 | dirmode=$1 39 | shift 40 | ;; 41 | --version) 42 | echo "$0 $scriptversion" 43 | exit $? 44 | ;; 45 | --) # stop option processing 46 | shift 47 | break 48 | ;; 49 | -*) # unknown option 50 | echo "$usage" 1>&2 51 | exit 1 52 | ;; 53 | *) # first non-opt arg 54 | break 55 | ;; 56 | esac 57 | done 58 | 59 | for file 60 | do 61 | if test -d "$file"; then 62 | shift 63 | else 64 | break 65 | fi 66 | done 67 | 68 | case $# in 69 | 0) exit 0 ;; 70 | esac 71 | 72 | # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and 73 | # mkdir -p a/c at the same time, both will detect that a is missing, 74 | # one will create a, then the other will try to create a and die with 75 | # a "File exists" error. This is a problem when calling mkinstalldirs 76 | # from a parallel make. We use --version in the probe to restrict 77 | # ourselves to GNU mkdir, which is thread-safe. 78 | case $dirmode in 79 | '') 80 | if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then 81 | echo "mkdir -p -- $*" 82 | exec mkdir -p -- "$@" 83 | else 84 | # On NextStep and OpenStep, the `mkdir' command does not 85 | # recognize any option. It will interpret all options as 86 | # directories to create, and then abort because `.' already 87 | # exists. 88 | test -d ./-p && rmdir ./-p 89 | test -d ./--version && rmdir ./--version 90 | fi 91 | ;; 92 | *) 93 | if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && 94 | test ! -d ./--version; then 95 | echo "mkdir -m $dirmode -p -- $*" 96 | exec mkdir -m "$dirmode" -p -- "$@" 97 | else 98 | # Clean up after NextStep and OpenStep mkdir. 99 | for d in ./-m ./-p ./--version "./$dirmode"; 100 | do 101 | test -d $d && rmdir $d 102 | done 103 | fi 104 | ;; 105 | esac 106 | 107 | for file 108 | do 109 | case $file in 110 | /*) pathcomp=/ ;; 111 | *) pathcomp= ;; 112 | esac 113 | oIFS=$IFS 114 | IFS=/ 115 | set fnord $file 116 | shift 117 | IFS=$oIFS 118 | 119 | for d 120 | do 121 | test "x$d" = x && continue 122 | 123 | pathcomp=$pathcomp$d 124 | case $pathcomp in 125 | -*) pathcomp=./$pathcomp ;; 126 | esac 127 | 128 | if test ! -d "$pathcomp"; then 129 | echo "mkdir $pathcomp" 130 | 131 | mkdir "$pathcomp" || lasterr=$? 132 | 133 | if test ! -d "$pathcomp"; then 134 | errstatus=$lasterr 135 | else 136 | if test ! -z "$dirmode"; then 137 | echo "chmod $dirmode $pathcomp" 138 | lasterr= 139 | chmod "$dirmode" "$pathcomp" || lasterr=$? 140 | 141 | if test ! -z "$lasterr"; then 142 | errstatus=$lasterr 143 | fi 144 | fi 145 | fi 146 | fi 147 | 148 | pathcomp=$pathcomp/ 149 | done 150 | done 151 | 152 | exit $errstatus 153 | 154 | # Local Variables: 155 | # mode: shell-script 156 | # sh-indentation: 2 157 | # eval: (add-hook 'write-file-hooks 'time-stamp) 158 | # time-stamp-start: "scriptversion=" 159 | # time-stamp-format: "%:y-%02m-%02d.%02H" 160 | # time-stamp-time-zone: "UTC" 161 | # time-stamp-end: "; # UTC" 162 | # End: 163 | -------------------------------------------------------------------------------- /move-if-change: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Like mv $1 $2, but if the files are the same, just delete $1. 3 | # Status is zero if successful, nonzero otherwise. 4 | 5 | VERSION='2011-01-28 20:09'; # UTC 6 | # The definition above must lie within the first 8 lines in order 7 | # for the Emacs time-stamp write hook (at end) to update it. 8 | # If you change this file with Emacs, please let the write hook 9 | # do its job. Otherwise, update this string manually. 10 | 11 | # Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc. 12 | 13 | # This program is free software: you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation, either version 3 of the License, or 16 | # (at your option) any later version. 17 | 18 | # This program is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | # GNU General Public License for more details. 22 | 23 | # You should have received a copy of the GNU General Public License 24 | # along with this program. If not, see . 25 | 26 | usage="usage: $0 SOURCE DEST" 27 | 28 | help="$usage 29 | or: $0 OPTION 30 | If SOURCE is different than DEST, then move it to DEST; else remove SOURCE. 31 | 32 | --help display this help and exit 33 | --version output version information and exit 34 | 35 | The variable CMPPROG can be used to specify an alternative to \`cmp'. 36 | 37 | Report bugs to ." 38 | 39 | version=`expr "$VERSION" : '\([^ ]*\)'` 40 | version="move-if-change (gnulib) $version 41 | Copyright (C) 2011 Free Software Foundation, Inc. 42 | License GPLv3+: GNU GPL version 3 or later 43 | This is free software: you are free to change and redistribute it. 44 | There is NO WARRANTY, to the extent permitted by law." 45 | 46 | cmpprog=${CMPPROG-cmp} 47 | 48 | for arg 49 | do 50 | case $arg in 51 | --help | --hel | --he | --h) 52 | exec echo "$help" ;; 53 | --version | --versio | --versi | --vers | --ver | --ve | --v) 54 | exec echo "$version" ;; 55 | --) 56 | shift 57 | break ;; 58 | -*) 59 | echo "$0: invalid option: $arg" >&2 60 | exit 1 ;; 61 | *) 62 | break ;; 63 | esac 64 | done 65 | 66 | test $# -eq 2 || { echo "$0: $usage" >&2; exit 1; } 67 | 68 | if test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null; then 69 | rm -f -- "$1" 70 | else 71 | if mv -f -- "$1" "$2"; then :; else 72 | # Ignore failure due to a concurrent move-if-change. 73 | test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null && rm -f -- "$1" 74 | fi 75 | fi 76 | 77 | ## Local Variables: 78 | ## eval: (add-hook 'write-file-hooks 'time-stamp) 79 | ## time-stamp-start: "VERSION='" 80 | ## time-stamp-format: "%:y-%02m-%02d %02H:%02M" 81 | ## time-stamp-time-zone: "UTC" 82 | ## time-stamp-end: "'; # UTC" 83 | ## End: 84 | -------------------------------------------------------------------------------- /setup.com: -------------------------------------------------------------------------------- 1 | $! 2 | $! Build procedure 3 | $! 4 | $! Note: you need a DCL-compatible gnu make. 5 | $ MAKE="make381" 6 | $ OPT="" 7 | $! 8 | $ if (P1 .EQS. "CONFIGURE") .OR. (P1 .EQS. "ALL") 9 | $ then 10 | $ set def [.bfd] 11 | $ @configure 12 | $ set def [-.libiberty] 13 | $ @configure 14 | $ set def [-.opcodes] 15 | $ @configure 16 | $ set def [-.binutils] 17 | $ @configure 18 | $ set def [-.gas] 19 | $ @configure 20 | $ set def [-] 21 | $ endif 22 | $ if (P1 .EQS. "BUILD") .OR. (P1 .EQS. "ALL") 23 | $ then 24 | $ set def [.bfd] 25 | $ @build 26 | $ set def [-.libiberty] 27 | $ @build 28 | $ set def [-.opcodes] 29 | $ @build 30 | $ set def [-.binutils] 31 | $ @build 32 | $ set def [-.gas] 33 | $ @build 34 | $ set def [-] 35 | $ endif 36 | $ if P1 .EQS. "MAKE" 37 | $ then 38 | $ ARCH=F$GETSYI("ARCH_NAME") 39 | $ ARCH=F$EDIT(arch,"UPCASE") 40 | $ set def [.bfd] 41 | $ 'MAKE "ARCH=''ARCH'" "OPT=''OPT'" 42 | $ set def [-.libiberty] 43 | $ 'MAKE "ARCH=''ARCH'" "OPT=''OPT'" 44 | $ set def [-.opcodes] 45 | $ 'MAKE "ARCH=''ARCH'" "OPT=''OPT'" 46 | $ set def [-.binutils] 47 | $ 'MAKE "ARCH=''ARCH'" "OPT=''OPT'" 48 | $ set def [-.gas] 49 | $ 'MAKE "ARCH=''ARCH'" "OPT=''OPT'" 50 | $ set def [-] 51 | $ endif 52 | -------------------------------------------------------------------------------- /symlink-tree: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Create a symlink tree. 3 | # 4 | # Copyright (C) 1995, 2000, 2003 Free Software Foundation, Inc. 5 | # 6 | # This file is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | # As a special exception to the GNU General Public License, if you 22 | # distribute this file as part of a program that contains a 23 | # configuration script generated by Autoconf, you may include it under 24 | # the same distribution terms that you use for the rest of that program. 25 | # 26 | # Please report bugs to 27 | # and send patches to . 28 | 29 | # Syntax: symlink-tree srcdir "ignore1 ignore2 ..." 30 | # 31 | # where srcdir is the directory to create a symlink tree to, 32 | # and "ignoreN" is a list of files/directories to ignore. 33 | 34 | prog=$0 35 | srcdir=$1 36 | ignore="$2" 37 | 38 | if test $# -lt 1; then 39 | echo "symlink-tree error: Usage: symlink-tree srcdir \"ignore1 ignore2 ...\"" 40 | exit 1 41 | fi 42 | 43 | ignore_additional=". .. CVS" 44 | 45 | # If we were invoked with a relative path name, adjust ${prog} to work 46 | # in subdirs. 47 | case ${prog} in 48 | /* | [A-Za-z]:[\\/]*) ;; 49 | *) prog=../${prog} ;; 50 | esac 51 | 52 | # Set newsrcdir to something subdirectories can use. 53 | case ${srcdir} in 54 | /* | [A-Za-z]:[\\/]*) newsrcdir=${srcdir} ;; 55 | *) newsrcdir=../${srcdir} ;; 56 | esac 57 | 58 | for f in `ls -a ${srcdir}`; do 59 | if [ -d ${srcdir}/$f ]; then 60 | found= 61 | for i in ${ignore} ${ignore_additional}; do 62 | if [ "$f" = "$i" ]; then 63 | found=yes 64 | fi 65 | done 66 | if [ -z "${found}" ]; then 67 | echo "$f ..working in" 68 | if [ -d $f ]; then true; else mkdir $f; fi 69 | (cd $f; ${prog} ${newsrcdir}/$f "${ignore}") 70 | fi 71 | else 72 | echo "$f ..linked" 73 | rm -f $f 74 | ln -s ${srcdir}/$f . 75 | fi 76 | done 77 | 78 | exit 0 79 | --------------------------------------------------------------------------------