From 8a46e5b0f4dbc7572a44177d22a6b816eb1d442c Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 30 Jan 2001 18:32:08 +0000 Subject: [PATCH] Import binutils 2.10.1. --- gnu/dist/toolchain/Makefile.in | 235 +- gnu/dist/toolchain/README | 34 +- gnu/dist/toolchain/bfd/ChangeLog | 144 + gnu/dist/toolchain/bfd/coff-h8300.c | 15 +- gnu/dist/toolchain/bfd/coff-w65.c | 2 +- gnu/dist/toolchain/bfd/elf-hppa.h | 3 +- gnu/dist/toolchain/bfd/elf32-arm.h | 114 +- gnu/dist/toolchain/bfd/elf32-i386.c | 11 +- gnu/dist/toolchain/bfd/elf32-m68k.c | 7 +- gnu/dist/toolchain/bfd/elf32-mcore.c | 3 +- gnu/dist/toolchain/bfd/elf32-mips.c | 6 +- gnu/dist/toolchain/bfd/elf32-ppc.c | 14 +- gnu/dist/toolchain/bfd/elf32-sparc.c | 7 +- gnu/dist/toolchain/bfd/elf64-sparc.c | 7 +- gnu/dist/toolchain/bfd/elflink.c | 17 +- gnu/dist/toolchain/binutils/ChangeLog | 96 + gnu/dist/toolchain/binutils/Makefile.am | 14 +- gnu/dist/toolchain/binutils/Makefile.in | 69 +- gnu/dist/toolchain/binutils/binutils.info | 54 +- gnu/dist/toolchain/binutils/binutils.info-1 | 2 +- gnu/dist/toolchain/binutils/binutils.info-2 | 4 +- gnu/dist/toolchain/binutils/binutils.texi | 2 +- gnu/dist/toolchain/binutils/config.texi | 2 +- gnu/dist/toolchain/binutils/configure | 926 ++-- gnu/dist/toolchain/binutils/configure.in | 3 +- gnu/dist/toolchain/binutils/nm.c | 41 +- gnu/dist/toolchain/binutils/readelf.c | 81 +- gnu/dist/toolchain/binutils/stabs.c | 1 + gnu/dist/toolchain/config-ml.in | 93 +- gnu/dist/toolchain/config/ChangeLog | 40 +- gnu/dist/toolchain/config/acinclude.m4 | 1994 +++++++++ gnu/dist/toolchain/config/mh-i370pic | 1 + gnu/dist/toolchain/config/mpw/ChangeLog | 16 - gnu/dist/toolchain/config/mt-aix43 | 4 + gnu/dist/toolchain/config/mt-d30v | 4 + gnu/dist/toolchain/config/mt-i370pic | 1 + gnu/dist/toolchain/config/mt-wince | 10 + gnu/dist/toolchain/configure | 35 +- gnu/dist/toolchain/configure.in | 199 +- gnu/dist/toolchain/etc/Makefile.in | 90 +- gnu/dist/toolchain/etc/configbuild.ein | 149 + gnu/dist/toolchain/etc/configbuild.fig | 50 + gnu/dist/toolchain/etc/configbuild.jin | Bin 0 -> 11123 bytes gnu/dist/toolchain/etc/configbuild.tin | 9 + gnu/dist/toolchain/etc/configdev.ein | 185 + gnu/dist/toolchain/etc/configdev.fig | 80 + gnu/dist/toolchain/etc/configdev.jin | Bin 0 -> 17967 bytes gnu/dist/toolchain/etc/configdev.tin | 17 + gnu/dist/toolchain/etc/configure | 13 +- gnu/dist/toolchain/etc/configure.in | 4 +- gnu/dist/toolchain/etc/configure.info | 95 + gnu/dist/toolchain/etc/configure.info-1 | 1313 ++++++ gnu/dist/toolchain/etc/configure.info-2 | 1137 +++++ gnu/dist/toolchain/etc/configure.info-3 | 285 ++ gnu/dist/toolchain/etc/configure.texi | 2644 ++++++++++++ gnu/dist/toolchain/etc/make-stds.texi | 4 +- gnu/dist/toolchain/etc/standards.info | 3833 +++++++++++++++++ gnu/dist/toolchain/etc/standards.texi | 2 +- gnu/dist/toolchain/gas/ChangeLog | 37 + gnu/dist/toolchain/gas/config/obj-coff.c | 2 +- gnu/dist/toolchain/gas/doc/as.info | 620 +-- gnu/dist/toolchain/gas/doc/as.info-1 | 2 +- gnu/dist/toolchain/gas/doc/gasver.texi | 2 +- gnu/dist/toolchain/gprof/ChangeLog | 5 + gnu/dist/toolchain/gprof/configure | 336 +- gnu/dist/toolchain/gprof/configure.in | 2 +- gnu/dist/toolchain/include/ChangeLog | 4 + gnu/dist/toolchain/include/demangle.h | 63 +- gnu/dist/toolchain/include/dyn-string.h | 92 + gnu/dist/toolchain/include/elf/ChangeLog | 29 + gnu/dist/toolchain/include/elf/common.h | 23 +- gnu/dist/toolchain/ld/ChangeLog | 106 + gnu/dist/toolchain/ld/NEWS | 7 +- gnu/dist/toolchain/ld/configure | 209 +- gnu/dist/toolchain/ld/configure.in | 2 +- gnu/dist/toolchain/ld/emultempl/elf32.em | 317 +- gnu/dist/toolchain/ld/emultempl/mipsecoff.em | 7 +- gnu/dist/toolchain/ld/ld.info | 134 +- gnu/dist/toolchain/ld/ld.info-1 | 4 +- gnu/dist/toolchain/ld/ld.info-2 | 2 +- gnu/dist/toolchain/ld/ld.info-3 | 2 +- gnu/dist/toolchain/ld/ld.info-4 | 2 +- gnu/dist/toolchain/ld/ldlang.c | 5 +- gnu/dist/toolchain/ld/ldlang.h | 3 +- gnu/dist/toolchain/ld/ldlex.l | 5 + gnu/dist/toolchain/ld/ldver.texi | 2 +- gnu/dist/toolchain/ld/scripttempl/elf.sc | 4 +- gnu/dist/toolchain/ld/scripttempl/elfd30v.sc | 7 +- gnu/dist/toolchain/ld/testsuite/ChangeLog | 9 + .../ld/testsuite/ld-elfvsb/elf-offset.ld | 168 + .../ld/testsuite/ld-elfvsb/elfvsb.dat | 22 + .../ld/testsuite/ld-elfvsb/elfvsb.exp | 359 ++ .../toolchain/ld/testsuite/ld-elfvsb/main.c | 178 + .../toolchain/ld/testsuite/ld-elfvsb/sh1.c | 324 ++ .../toolchain/ld/testsuite/ld-elfvsb/sh2.c | 24 + .../toolchain/ld/testsuite/lib/ld-lib.exp | 16 +- gnu/dist/toolchain/libiberty/ChangeLog | 13 + gnu/dist/toolchain/libiberty/Makefile.in | 15 +- gnu/dist/toolchain/libiberty/cp-demangle.c | 3409 +++++++++++++++ gnu/dist/toolchain/libiberty/cplus-dem.c | 486 ++- gnu/dist/toolchain/libiberty/dyn-string.c | 409 ++ .../libiberty/testsuite/demangle-expected | 80 + .../libiberty/testsuite/regress-demangle | 2 + gnu/dist/toolchain/ltconfig | 832 ++-- gnu/dist/toolchain/ltmain.sh | 749 ++-- gnu/dist/toolchain/makefile.vms | 71 + gnu/dist/toolchain/missing | 26 +- gnu/dist/toolchain/mkdep | 87 + gnu/dist/toolchain/mpw-README | 376 ++ gnu/dist/toolchain/mpw-build.in | 204 + gnu/dist/toolchain/mpw-config.in | 113 + gnu/dist/toolchain/mpw-configure | 448 ++ gnu/dist/toolchain/mpw-install | 122 + gnu/dist/toolchain/setup.com | 8 + gnu/dist/toolchain/texinfo/texinfo.tex | 2040 +++++---- 115 files changed, 23708 insertions(+), 3138 deletions(-) create mode 100755 gnu/dist/toolchain/config/acinclude.m4 create mode 100644 gnu/dist/toolchain/config/mh-i370pic create mode 100644 gnu/dist/toolchain/config/mt-aix43 create mode 100644 gnu/dist/toolchain/config/mt-d30v create mode 100644 gnu/dist/toolchain/config/mt-i370pic create mode 100644 gnu/dist/toolchain/config/mt-wince create mode 100644 gnu/dist/toolchain/etc/configbuild.ein create mode 100644 gnu/dist/toolchain/etc/configbuild.fig create mode 100644 gnu/dist/toolchain/etc/configbuild.jin create mode 100644 gnu/dist/toolchain/etc/configbuild.tin create mode 100644 gnu/dist/toolchain/etc/configdev.ein create mode 100644 gnu/dist/toolchain/etc/configdev.fig create mode 100644 gnu/dist/toolchain/etc/configdev.jin create mode 100644 gnu/dist/toolchain/etc/configdev.tin create mode 100644 gnu/dist/toolchain/etc/configure.info create mode 100644 gnu/dist/toolchain/etc/configure.info-1 create mode 100644 gnu/dist/toolchain/etc/configure.info-2 create mode 100644 gnu/dist/toolchain/etc/configure.info-3 create mode 100644 gnu/dist/toolchain/etc/configure.texi create mode 100644 gnu/dist/toolchain/etc/standards.info create mode 100644 gnu/dist/toolchain/include/dyn-string.h create mode 100644 gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elf-offset.ld create mode 100644 gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elfvsb.dat create mode 100644 gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elfvsb.exp create mode 100644 gnu/dist/toolchain/ld/testsuite/ld-elfvsb/main.c create mode 100644 gnu/dist/toolchain/ld/testsuite/ld-elfvsb/sh1.c create mode 100644 gnu/dist/toolchain/ld/testsuite/ld-elfvsb/sh2.c create mode 100644 gnu/dist/toolchain/libiberty/cp-demangle.c create mode 100644 gnu/dist/toolchain/libiberty/dyn-string.c create mode 100644 gnu/dist/toolchain/makefile.vms create mode 100755 gnu/dist/toolchain/mkdep create mode 100644 gnu/dist/toolchain/mpw-README create mode 100644 gnu/dist/toolchain/mpw-build.in create mode 100644 gnu/dist/toolchain/mpw-config.in create mode 100644 gnu/dist/toolchain/mpw-configure create mode 100644 gnu/dist/toolchain/mpw-install create mode 100644 gnu/dist/toolchain/setup.com diff --git a/gnu/dist/toolchain/Makefile.in b/gnu/dist/toolchain/Makefile.in index 7af178465b9d..ed199492618d 100644 --- a/gnu/dist/toolchain/Makefile.in +++ b/gnu/dist/toolchain/Makefile.in @@ -37,9 +37,7 @@ infodir=${prefix}/info mandir=${prefix}/man gxx_include_dir=${includedir}/g++ -tooldir = $(exec_prefix)/$(target_alias) -build_tooldir = $(exec_prefix)/$(target_alias) - +tooldir = $(exec_prefix)/$(target) program_transform_name = @@ -61,7 +59,7 @@ GDB_NLM_DEPS = SHELL = /bin/sh # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a -# cygwin32 host. +# cygwin host. INSTALL_PROGRAM_ARGS = INSTALL = $(SHELL) $$s/install-sh -c @@ -86,6 +84,7 @@ HOST_PREFIX_1 = loser- CFLAGS = -g CXXFLAGS = -g -O2 +LDFLAGS = LIBCFLAGS = $(CFLAGS) CFLAGS_FOR_TARGET = $(CFLAGS) LDFLAGS_FOR_TARGET = @@ -98,9 +97,9 @@ CHILL_LIB = -lchill CXX = c++ # Use -O2 to stress test the compiler. -LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates +LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates -fexceptions CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates +LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates -fexceptions RANLIB = ranlib @@ -111,8 +110,7 @@ NM = nm LD = ld -# Not plain GZIP, since gzip looks there for extra command-line options. -GZIPPROG = gzip +BZIPPROG = bzip2 # These values are substituted by configure. DEFAULT_YACC = yacc @@ -169,7 +167,9 @@ OTHERS = # This is set by the configure script to the list of directories which # should be built using the target tools. -TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup opcodes libstub cygmon libf2c libchill libobjc + + +TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstdc++ libg++ winsup opcodes bsp libstub cygmon # Target libraries are put under this directory: # Changed by configure to $(target_alias) if cross. @@ -213,13 +213,16 @@ INSTALL_TARGET_CROSS = installdirs \ CC_FOR_TARGET = ` \ if [ -f $$r/gcc/xgcc ] ; then \ if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \ - if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \ - echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -B$(build_tooldir)/bin/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \ - else \ - echo $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/bin/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \ - fi; \ + case "$(target_canonical)" in \ + i[3456]86-*-cygwin*) \ + echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/winsup/include -idirafter $$s/newlib/libc/include -idirafter $$s/newlib/libc/sys/cygwin -idirafter $$s/newlib/libc/sys/cygwin32 -nostdinc; \ + ;; \ + *) \ + echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \ + ;; \ + esac \ else \ - echo $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/bin/; \ + echo $$r/gcc/xgcc -B$$r/gcc/; \ fi; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ @@ -233,11 +236,11 @@ CC_FOR_TARGET = ` \ # variable is passed down to the gcc Makefile, where it is used to # build libgcc2.a. We define it here so that it can itself be # overridden on the command line. -GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/bin/ -I$(build_tooldir)/include +GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ CHILL_FOR_TARGET = ` \ if [ -f $$r/gcc/xgcc ] ; then \ - echo $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/bin/ -L$$r/gcc/ch/runtime/; \ + echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ echo $(CC); \ @@ -249,13 +252,16 @@ CHILL_FOR_TARGET = ` \ CXX_FOR_TARGET = ` \ if [ -f $$r/gcc/xgcc ] ; then \ if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \ - if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \ - echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -B$(build_tooldir)/bin/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \ - else \ - echo $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/bin/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \ - fi; \ + case "$(target_canonical)" in \ + i[3456]86-*-cygwin*) \ + echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/winsup/include -idirafter $$s/newlib/libc/include -idirafter $$s/newlib/libc/sys/cygwin -idirafter $$s/newlib/libc/sys/cygwin32 -nostdinc; \ + ;; \ + *) \ + echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \ + ;; \ + esac \ else \ - echo $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/bin/; \ + echo $$r/gcc/xgcc -B$$r/gcc/; \ fi; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ @@ -416,7 +422,6 @@ BASE_FLAGS_TO_PASS = \ "sharedstatedir=$(sharedstatedir)" \ "sysconfdir=$(sysconfdir)" \ "tooldir=$(tooldir)" \ - "build_tooldir=$(build_tooldir)" \ "gxx_include_dir=$(gxx_include_dir)" \ "gcc_version=$(gcc_version)" \ "gcc_version_trigger=$(gcc_version_trigger)" \ @@ -543,6 +548,7 @@ ALL_MODULES = \ all-ld \ all-libgui \ all-libiberty \ + all-libtool \ all-m4 \ all-make \ all-mmalloc \ @@ -558,9 +564,9 @@ ALL_MODULES = \ all-send-pr \ all-shellutils \ all-sim \ - all-snavigator \ all-tar \ all-tcl \ + all-tcl8.1 \ all-texinfo \ all-textutils \ all-tgas \ @@ -629,7 +635,6 @@ CROSS_CHECK_MODULES = \ check-sed \ check-send-pr \ check-shellutils \ - check-snaviagor \ check-sim \ check-tar \ check-tcl \ @@ -686,6 +691,7 @@ INSTALL_MODULES = \ install-intl \ install-ispell \ install-tcl \ + install-tcl8.1 \ install-itcl \ install-ld \ install-libgui \ @@ -704,9 +710,7 @@ INSTALL_MODULES = \ install-send-pr \ install-shellutils \ install-sim \ - install-snavigator \ install-tar \ - install-texinfo \ install-textutils \ install-tgas \ install-time \ @@ -726,6 +730,7 @@ ALL_X11_MODULES = \ all-guile \ all-tclX \ all-tk \ + all-tk8.1 \ all-tix # This is a list of the check targets for all of the modules which are @@ -751,6 +756,7 @@ INSTALL_X11_MODULES = \ install-gash \ install-tclX \ install-tk \ + install-tk8.1 \ install-tix # This is a list of the targets for all of the modules which are compiled @@ -761,19 +767,14 @@ ALL_TARGET_MODULES = \ all-target-librx \ all-target-libg++ \ all-target-newlib \ - all-target-libf2c \ - all-target-libchill \ - all-target-libobjc \ + all-target-libtermcap \ all-target-winsup \ all-target-libgloss \ all-target-libiberty \ all-target-gperf \ all-target-examples \ all-target-libstub \ - all-target-libjava \ - all-target-zlib \ - all-target-boehm-gc \ - all-target-qthreads \ + all-target-bsp \ all-target-cygmon # This is a list of the configure targets for all of the modules which @@ -784,19 +785,14 @@ CONFIGURE_TARGET_MODULES = \ configure-target-librx \ configure-target-libg++ \ configure-target-newlib \ - configure-target-libf2c \ - configure-target-libchill \ - configure-target-libobjc \ + configure-target-libtermcap \ configure-target-winsup \ configure-target-libgloss \ configure-target-libiberty \ configure-target-gperf \ configure-target-examples \ configure-target-libstub \ - configure-target-libjava \ - configure-target-zlib \ - configure-target-boehm-gc \ - configure-target-qthreads \ + configure-target-bsp \ configure-target-cygmon # This is a list of the check targets for all of the modules which are @@ -806,15 +802,8 @@ CHECK_TARGET_MODULES = \ check-target-libstdc++ \ check-target-libg++ \ check-target-newlib \ - check-target-libf2c \ - check-target-libchill \ - check-target-libobjc \ check-target-winsup \ check-target-libiberty \ - check-target-libjava \ - check-target-zlib \ - check-target-boehm-gc \ - check-target-qthreads \ check-target-gperf # This is a list of the install targets for all of the modules which are @@ -824,17 +813,11 @@ INSTALL_TARGET_MODULES = \ install-target-libstdc++ \ install-target-libg++ \ install-target-newlib \ - install-target-libf2c \ - install-target-libchill \ - install-target-libobjc \ + install-target-libtermcap \ install-target-winsup \ install-target-libgloss \ install-target-libiberty \ install-target-bsp \ - install-target-libjava \ - install-target-zlib \ - install-target-boehm-gc \ - install-target-qthreads \ install-target-gperf # This is a list of the targets for which we can do a clean-{target}. @@ -892,7 +875,6 @@ CLEAN_MODULES = \ clean-send-pr \ clean-shellutils \ clean-sim \ - clean-snavigator \ clean-tar \ clean-tcl \ clean-texinfo \ @@ -903,7 +885,6 @@ CLEAN_MODULES = \ clean-wdiff \ clean-zip - # All of the target modules that can be cleaned CLEAN_TARGET_MODULES = \ clean-target-libio \ @@ -911,19 +892,13 @@ CLEAN_TARGET_MODULES = \ clean-target-librx \ clean-target-libg++ \ clean-target-newlib \ - clean-target-libf2c \ - clean-target-libchill \ - clean-target-libobjc \ clean-target-winsup \ clean-target-libgloss \ clean-target-libiberty \ clean-target-gperf \ clean-target-examples \ clean-target-libstub \ - clean-target-libjava \ - clean-target-zlib \ - clean-target-boehm-gc \ - clean-target-qthreads \ + clean-target-bsp \ clean-target-cygmon # All of the x11 modules that can be cleaned @@ -938,10 +913,6 @@ CLEAN_X11_MODULES = \ clean-tk \ clean-tix -# The first rule in the file had better be this one. Don't put any above it. -all: all.normal -.PHONY: all - # The target built for a native build. .PHONY: all.normal all.normal: \ @@ -1183,6 +1154,7 @@ gcc-no-fixedincludes: mv gcc/tmp-include gcc/include 2>/dev/null; \ else true; fi + # This rule is used to build the modules which use FLAGS_TO_PASS. To # build a target all-X means to cd to X and make all. # @@ -1561,13 +1533,13 @@ all-bash: all-bfd: all-libiberty all-intl all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl all-bison: all-texinfo -configure-target-boehm-gc: configure-target-newlib configure-target-qthreads -all-target-boehm-gc: configure-target-boehm-gc +configure-target-bsp: $(ALL_GCC) +all-target-bsp: configure-target-bsp all-gcc all-binutils all-target-newlib all-byacc: all-bzip2: all-cvssrc: configure-target-cygmon: $(ALL_GCC) -all-target-cygmon: configure-target-cygmon all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-libstub +all-target-cygmon: configure-target-cygmon all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-libstub all-target-bsp all-db: all-dejagnu: all-tcl all-expect all-tk all-diff: all-libiberty @@ -1594,7 +1566,6 @@ all-gnuserv: configure-target-gperf: $(ALL_GCC) all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++ all-gprof: all-libiberty all-bfd all-opcodes all-intl -all-grep: all-libiberty all-grez: all-libiberty all-bfd all-opcodes all-gui: all-gdb all-libproc all-target-librx all-guile: @@ -1604,7 +1575,7 @@ all-indent: all-inet: all-tcl all-send-pr all-perl all-intl: all-ispell: all-emacs19 -all-itcl: all-tcl all-tk +all-itcl: all-tcl all-tk all-tcl8.1 all-tk8.1 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl configure-target-libg++: $(ALL_GCC) configure-target-librx all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++ @@ -1612,11 +1583,9 @@ configure-target-libgloss: $(ALL_GCC) all-target-libgloss: configure-target-libgloss configure-target-newlib configure-target-libio: $(ALL_GCC) all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib -check-target-libio: all-target-libstdc++ -all-libgui: all-tcl all-tk all-itcl +check-target-libio: +all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl all-libiberty: -configure-target-libjava: $(ALL_GCC) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-newlib -all-target-libjava: configure-target-libjava all-gcc all-zip all-target-newlib all-target-zlib all-target-boehm-gc all-target-qthreads configure-target-librx: $(ALL_GCC) configure-target-newlib all-target-librx: configure-target-librx configure-target-libstdc++: $(ALL_GCC) @@ -1624,20 +1593,17 @@ all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-targ configure-target-libstub: $(ALL_GCC) all-target-libstub: configure-target-libstub all-libtool: -all-target-libf2c: configure-target-libf2c all-gas all-ld all-gcc all-target-libiberty all-target-newlib -all-target-libchill: configure-target-libchill all-gas all-ld all-gcc all-target-libiberty all-target-newlib -all-target-libobjc: configure-target-libobjc all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-m4: all-libiberty all-make: all-libiberty all-mmalloc: configure-target-newlib: $(ALL_GCC) +configure-target-libtermcap: $(ALL_GCC) all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc +all-target-libtermcap: configure-target-libtermcap all-binutils all-gas all-gcc all-opcodes: all-bfd all-libiberty all-patch: all-libiberty all-perl: all-prms: all-libiberty -configure-target-qthreads: configure-target-newlib -all-target-qthreads: configure-target-qthreads all-rcs: all-readline: all-recode: all-libiberty @@ -1645,28 +1611,27 @@ all-sed: all-libiberty all-send-pr: all-prms all-shellutils: all-sim: all-libiberty all-bfd all-opcodes all-readline -all-snavigator: all-tcl all-tk all-itcl all-db all-grep all-libgui all-tar: all-libiberty all-tcl: +all-tcl8.1: all-tclX: all-tcl all-tk all-tk: all-tcl +all-tk8.1: all-tcl8.1 all-texinfo: all-libiberty all-textutils: all-tgas: all-libiberty all-bfd all-opcodes all-time: -all-tix: all-tcl all-tk +all-tix: all-tcl all-tk all-tcl8.1 all-tk8.1 all-wdiff: -all-target-winsup: all-target-newlib all-target-libiberty all-target-libio configure-target-winsup +all-target-winsup: all-target-newlib all-target-libiberty all-target-libtermcap configure-target-winsup configure-target-winsup: configure-target-newlib all-uudecode: all-libiberty all-zip: -configure-target-zlib: $(ALL_GCC) -all-target-zlib: configure-target-zlib configure-target-libiberty: $(ALL_GCC) all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib all-target: $(ALL_TARGET_MODULES) install-target: $(INSTALL_TARGET_MODULES) - +install-gdb: install-tcl install-tk install-itcl install-tix install-libgui ### other supporting targets MAKEDIRS= \ @@ -1718,7 +1683,8 @@ DEVO_SUPPORT= README Makefile.in configure configure.in \ # ChangeLog omitted because it may refer to files which are not in this # distribution (perhaps it would be better to include it anyway). ETC_SUPPORT= Makefile.in configure configure.in standards.texi \ - make-stds.texi standards.info* + make-stds.texi standards.info* configure.texi configure.info* \ + configbuild.* configdev.* # When you use `make setup-dirs' or `make taz' you should always redefine # this macro. @@ -1726,9 +1692,8 @@ SUPPORT_FILES = list-of-support-files-for-tool-in-question .PHONY: taz -taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \ - texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo - # Take out texinfo from a few places +taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex + # Take out texinfo from a few places. sed -e '/^all\.normal: /s/\all-texinfo //' \ -e '/^ install-texinfo /d' \ tmp @@ -1772,8 +1737,6 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \ # mkdir proto-toplev/texinfo ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/ - ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/ - ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/ if test -r texinfo/util/tex3patch ; then \ mkdir proto-toplev/texinfo/util && \ ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \ @@ -1784,56 +1747,84 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \ else \ ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \ fi; \ - $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver + if test x"$(PACKAGE)" = x; then \ + package="$(TOOL)"; \ + else \ + package="$(PACKAGE)"; \ + fi; \ + $(MAKE) -f Makefile.in do-tar-bz2 TOOL=$(TOOL) VER=$$ver PACKAGE=$$package -do-tar-gz: - echo "==> Making $(TOOL)-$(VER).tar.gz" - -rm -f $(TOOL)-$(VER) - ln -s proto-toplev $(TOOL)-$(VER) - tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER) - $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar +do-tar-bz2: + echo "==> Making $(PACKAGE)-$(VER).tar.bz2" + -rm -f $(PACKAGE)-$(VER) + ln -s proto-toplev $(PACKAGE)-$(VER) + tar cfh $(PACKAGE)-$(VER).tar $(PACKAGE)-$(VER) + $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar -TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo +TEXINFO_SUPPORT= texinfo/texinfo.tex DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) -.PHONY: gas.tar.gz -GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms -gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas +.PHONY: gas.tar.bz2 +GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep +gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas $(MAKE) -f Makefile.in taz TOOL=gas \ SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" # The FSF "binutils" release includes gprof and ld. -.PHONY: binutils.tar.gz -BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms -binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils +.PHONY: binutils.tar.bz2 +BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep +binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils $(MAKE) -f Makefile.in taz TOOL=binutils \ - SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat" + SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)" -.PHONY: gas+binutils.tar.gz +.PHONY: gas+binutils.tar.bz2 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof -gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas +gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas $(MAKE) -f Makefile.in taz TOOL=gas \ - SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat" + SUPPORT_FILES="$(GASB_SUPPORT_DIRS)" -.PHONY: libg++.tar.gz +.PHONY: libg++.tar.bz2 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty -libg++.tar.gz: $(DIST_SUPPORT) libg++ +libg++.tar.bz2: $(DIST_SUPPORT) libg++ $(MAKE) -f Makefile.in taz TOOL=libg++ \ SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)" GNATS_SUPPORT_DIRS=include libiberty send-pr -gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats +gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats $(MAKE) -f Makefile.in taz TOOL=gnats \ SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)" -.PHONY: gdb.tar.gz +.PHONY: gdb.tar.bz2 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl -GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi` -gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb +gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb $(MAKE) -f Makefile.in taz TOOL=gdb \ - SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)" + SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" -.PHONY: newlib.tar.gz +.PHONY: dejagnu.tar.bz2 +DEJAGNU_SUPPORT_DIRS= tcl expect libiberty +dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu + $(MAKE) -f Makefile.in taz TOOL=dejagnu \ + SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)" + +.PHONY: gdb+dejagnu.tar.bz2 +GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu +gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb + $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE=gdb+dejagnu \ + SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)" + +.PHONY: insight.tar.bz2 +INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui +insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb + $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE=insight \ + SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)" + +.PHONY: insight+dejagnu.tar.bz2 +INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu +insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb + $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE="insight+dejagnu" \ + SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)" + +.PHONY: newlib.tar.bz2 NEWLIB_SUPPORT_DIRS=libgloss # taz configures for the sun4 target which won't configure newlib. # We need newlib configured so that the .info files are made. @@ -1846,7 +1837,7 @@ NEWLIB_SUPPORT_DIRS=libgloss # the make distclean. For now punt on the issue of shipping newlib info files # with newlib net releases and wait for a day when some native target (sun4?) # supports newlib (if only minimally). -newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib +newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib $(MAKE) -f Makefile.in taz TOOL=newlib \ SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \ DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib diff --git a/gnu/dist/toolchain/README b/gnu/dist/toolchain/README index 660ab17735f1..eb0e436d860f 100644 --- a/gnu/dist/toolchain/README +++ b/gnu/dist/toolchain/README @@ -3,10 +3,40 @@ This directory contains various GNU compilers, assemblers, linkers, debuggers, etc., plus their support routines, definitions, and documentation. +If you are receiving this as part of a GDB release, see the file gdb/README. +If with a binutils release, see binutils/README; if with a libg++ release, +see libg++/README, etc. That'll give you info about this +package -- supported targets, how to use it, how to report bugs, etc. -Check the INSTALL directory for detailed configuration and installation -instructions. +It is now possible to automatically configure and build a variety of +tools with one command. To build all of the tools contained herein, +run the ``configure'' script here, e.g.: + ./configure + make + +To install them (by default in /usr/local/bin, /usr/local/lib, etc), +then do: + make install + +(If the configure script can't determine your type of computer, give it +the name as an argument, for instance ``./configure sun4''. You can +use the script ``config.sub'' to test whether a name is recognized; if +it is, config.sub translates it to a triplet specifying CPU, vendor, +and OS.) + +If you have more than one compiler on your system, it is often best to +explicitly set CC in the environment before running configure, and to +also set CC when running make. For example (assuming sh/bash/ksh): + + CC=gcc ./configure + make + +A similar example using csh: + + setenv CC gcc + ./configure + make Much of the code and documentation enclosed is copyright by the Free Software Foundation, Inc. See the file COPYING or diff --git a/gnu/dist/toolchain/bfd/ChangeLog b/gnu/dist/toolchain/bfd/ChangeLog index b460bb8297ca..638ea679922f 100644 --- a/gnu/dist/toolchain/bfd/ChangeLog +++ b/gnu/dist/toolchain/bfd/ChangeLog @@ -1,3 +1,147 @@ +2000-11-07 Alan Modra + + * coff-h8300.c (special): Adjust reloc address. + + From mainline 2000-04-03 Kazu Hirata + * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to + the R_PCRWORD_B case. + +2000-11-05 Philip Blundell + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Always permit + BFDs containing no sections to be merged, regardless of their flags. + +2000-11-04 Philip Blundell + + * elf32-arm.h (elf32_arm_relocate_section): Suppress error message + if a relocation for an undefined symbol also results in an + overflow. + +2000-10-31 Philip Blundell + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Only handle + EF_SOFT_FLOAT if it is defined. + + From 2000-05-23 H.J. Lu + * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo. + +2000-10-27 Philip Blundell + + * elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse + attempts to mix PIC code with non-PIC, just mark the output as + being position dependent. + (elf32_arm_merge_private_bfd_data): Likewise. Print an error + message for EF_SOFT_FLOAT mismatches. Display diagnostics for + all mismatches, not just the first one. + +2000-10-23 Philip Blundell + + From 2000-05-23 H.J. Lu + * elf64-alpha.c (elf64_alpha_relocate_section): Check + h->root.other not h->other. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + +2000-10-23 Philip Blundell + + * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Undo previous + accidental checkin. + +2000-10-22 Philip Blundell + + * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Don't make + PLT entries that could serve as a definition for a weak symbol. + + From 2000-06-05 H.J. Lu + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't flag + an error when seeing an undefined symbol with hidden/internal + attribute. It is handled in *_relocate_section (). + + From 2000-05-23 H.J. Lu + * elf32-i386.c (elf_i386_relocate_section): Don't allow the + undefined symbol with the non-default visibility attributes. + * elf-hppa.h (elf_hppa_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2000-10-16 Geoffrey Keating + + From 2000-10-14 Geoffrey Keating + * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make PLT + entries that could serve as a definition for a weak symbol. + +2000-10-15 Philip Blundell + + From 2000-09-08 Nick Clifton + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not + initialise flags in output bfd if the input bfd is the default + architecture with the default flags. + + From 2000-09-03 Philip Blundell + * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate + references to undefined symbols in debugging sections. + + From 2000-05-30 H.J. Lu + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the + visibility bits if the symbol is undefined. Correctly handle + weak undefined symbols with hidden and internal attributes. + * elflink.h (elf_link_add_object_symbols): Always turn the + symbol into local if it has the hidden or internal attribute. + + From 2000-05-22 H.J. Lu + * elflink.h (elf_link_output_extsym): Clear the visibility + field for symbols not defined locally. + + From 2000-05-03 Martin v. Löwis + * elflink.h (elf_link_add_object_symbols): Reset dynindx for + hidden and internal symbols. + (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with + visibility. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not + assign a PLT or GOT entry to symbols with hidden and + internal visibility. + +2000-10-16 Philip Blundell + + * configure.in: Set version to 2.10.1. + * configure: Regenerate. + +2000-09-24 H.J. Lu + + From 2000-04-20 H.J. Lu + * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10 + patch to symbols defined by a shared object. + +2000-09-06 Philip Blundell + + Merge from mainline: + + 2000-05-31 Ulrich Drepper + + * elf.c (_bfd_elf_slurp_version_tables): Correct reading of version + definitions. We must not assume they are sorted in the file + according to their index numbers. + +2000-09-06 Philip Blundell + + * config.bfd (arm*-*-uclinux*): New target. + (armeb-*-elf, arm*b-*-linux-gnu*): Likewise. + +2000-08-22 Doug Kwan + + * coff-w65.c (CREATE_LITTLE_COFF_TARGET): Fix typo. + * coffcode.h (coff_set_flags): Add detection of w65 architecture. + +2000-04-14 Matthew Green + + * config.bfd: Add NetBSD/sparc64 support. + 2000-05-31 Mark Kettenis Add support for FreeBSD/Alpha. diff --git a/gnu/dist/toolchain/bfd/coff-h8300.c b/gnu/dist/toolchain/bfd/coff-h8300.c index 3d54f20a926c..c86c4b944226 100644 --- a/gnu/dist/toolchain/bfd/coff-h8300.c +++ b/gnu/dist/toolchain/bfd/coff-h8300.c @@ -192,18 +192,18 @@ h8300_coff_link_hash_table_create (abfd) return &ret->root.root; } -/* special handling for H8/300 relocs. +/* Special handling for H8/300 relocs. We only come here for pcrel stuff and return normally if not an -r link. When doing -r, we can't do any arithmetic for the pcrel stuff, because the code in reloc.c assumes that we can manipulate the targets of the pcrel branches. This isn't so, since the H8/300 can do relaxing, which means that the gap after the instruction may not be enough to - contain the offset required for the branch, so we have to use the only - the addend until the final link */ + contain the offset required for the branch, so we have to use only + the addend until the final link. */ static bfd_reloc_status_type special (abfd, reloc_entry, symbol, data, input_section, output_bfd, - error_message) + error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -215,6 +215,8 @@ special (abfd, reloc_entry, symbol, data, input_section, output_bfd, if (output_bfd == (bfd *) NULL) return bfd_reloc_continue; + /* Adjust the reloc address to that in the output section. */ + reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } @@ -902,6 +904,11 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, bfd_put_8 (abfd, tmp, data + dst_address - 2); break; + case 0x5c: + /* bsr:16 -> bsr:8 */ + bfd_put_8 (abfd, 0x55, data + dst_address - 2); + break; + default: abort (); } diff --git a/gnu/dist/toolchain/bfd/coff-w65.c b/gnu/dist/toolchain/bfd/coff-w65.c index 0379bfbc325e..c82d4d7844bd 100644 --- a/gnu/dist/toolchain/bfd/coff-w65.c +++ b/gnu/dist/toolchain/bfd/coff-w65.c @@ -401,4 +401,4 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, bfd_coff_reloc16_get_relocated_section_contents #define coff_bfd_relax_section bfd_coff_reloc16_relax_section -CREATE_LITTLE_COFF_TARGET_VEC (w65_vec, "coff-w95", BFD_IS_RELAXABLE, 0, '_', NULL) +CREATE_LITTLE_COFF_TARGET_VEC (w65_vec, "coff-w65", BFD_IS_RELAXABLE, 0, '_', NULL) diff --git a/gnu/dist/toolchain/bfd/elf-hppa.h b/gnu/dist/toolchain/bfd/elf-hppa.h index b55e1c4e5bc1..000ffea3c759 100644 --- a/gnu/dist/toolchain/bfd/elf-hppa.h +++ b/gnu/dist/toolchain/bfd/elf-hppa.h @@ -1079,7 +1079,8 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, relocation = 0; } /* Allow undefined symbols in shared libraries. */ - else if (info->shared && !info->no_undefined) + else if (info->shared && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) { if (info->symbolic) (*info->callbacks->undefined_symbol) diff --git a/gnu/dist/toolchain/bfd/elf32-arm.h b/gnu/dist/toolchain/bfd/elf32-arm.h index eaaf9763b408..2e8a657ec816 100644 --- a/gnu/dist/toolchain/bfd/elf32-arm.h +++ b/gnu/dist/toolchain/bfd/elf32-arm.h @@ -1756,7 +1756,14 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, (!info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 ) - && ((input_section->flags & SEC_ALLOC) != 0) + && ((input_section->flags & SEC_ALLOC) != 0 + /* DWARF will emit R_ARM_ABS32 relocations in its + sections against symbols defined externally + in shared libraries. We can't do anything + with them here. */ + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) ) relocation_needed = 0; break; @@ -1800,14 +1807,17 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (!((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } @@ -1836,10 +1846,15 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, switch (r) { case bfd_reloc_overflow: - if (!((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) - return false; + /* If the overflowing reloc was to an undefined symbol, + we have already printed one error message and there + is no point complaining again. */ + if ((! h || + h->root.type != bfd_link_hash_undefined) + && (!((*info->callbacks->reloc_overflow) + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset)))) + return false; break; case bfd_reloc_undefined: @@ -1923,10 +1938,6 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd) if (elf_flags_init (obfd) && in_flags != out_flags) { - /* Cannot mix PIC and non-PIC code. */ - if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) - return false; - /* Cannot mix APCS26 and APCS32 code. */ if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) return false; @@ -1946,6 +1957,10 @@ Warning: Clearing the interwork flag in %s because non-interworking code in %s h in_flags &= ~EF_INTERWORK; } + + /* Likewise for PIC, though don't warn for this case. */ + if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) + in_flags &= ~EF_PIC; } elf_elfheader (obfd)->e_flags = in_flags; @@ -1963,6 +1978,9 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) { flagword out_flags; flagword in_flags; + boolean flags_compatible = true; + boolean null_input_bfd = true; + asection *sec; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -1994,13 +2012,14 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) if (!elf_flags_init (obfd)) { - /* If the input is the default architecture then do not - bother setting the flags for the output architecture, - instead allow future merges to do this. If no future - merges ever set these flags then they will retain their - unitialised values, which surprise surprise, correspond + /* If the input is the default architecture and had the default + flags then do not bother setting the flags for the output + architecture, instead allow future merges to do this. If no + future merges ever set these flags then they will retain their + uninitialised values, which surprise surprise, correspond to the default values. */ - if (bfd_get_arch_info (ibfd)->the_default) + if (bfd_get_arch_info (ibfd)->the_default + && elf_elfheader (ibfd)->e_flags == 0) return true; elf_flags_init (obfd) = true; @@ -2013,48 +2032,77 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) return true; } - /* Check flag compatibility. */ + /* Identical flags must be compatible. */ if (in_flags == out_flags) return true; - /* Complain about various flag mismatches. */ + /* Check to see if the input BFD actually contains any sections. + If not, its flags may not have been initialised either, but it cannot + actually cause any incompatibility. */ + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + /* Ignore synthetic glue sections. */ + if (strcmp (sec->name, ".glue_7") + && strcmp (sec->name, ".glue_7t")) + { + null_input_bfd = false; + break; + } + } + if (null_input_bfd) + return true; + /* If any of the input BFDs is non-PIC, the output is also position + dependent. */ + if (!(in_flags & EF_PIC)) + elf_elfheader (obfd)->e_flags &= ~EF_PIC; + + /* Complain about various flag mismatches. */ if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) - _bfd_error_handler (_ ("\ + { + _bfd_error_handler (_ ("\ Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d"), bfd_get_filename (ibfd), in_flags & EF_APCS_26 ? 26 : 32, bfd_get_filename (obfd), out_flags & EF_APCS_26 ? 26 : 32); + flags_compatible = false; + } if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT)) - _bfd_error_handler (_ ("\ + { + _bfd_error_handler (_ ("\ Error: %s passes floats in %s registers, whereas %s passes them in %s registers"), bfd_get_filename (ibfd), in_flags & EF_APCS_FLOAT ? _ ("float") : _ ("integer"), bfd_get_filename (obfd), out_flags & EF_APCS_26 ? _ ("float") : _ ("integer")); + flags_compatible = false; + } - if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) - _bfd_error_handler (_ ("\ -Error: %s is compiled as position %s code, whereas %s is not"), - bfd_get_filename (ibfd), - in_flags & EF_PIC ? _ ("independent") : _ ("dependent"), - bfd_get_filename (obfd)); - - /* Interworking mismatch is only a warning. */ - if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) +#ifdef EF_SOFT_FLOAT + if ((in_flags & EF_SOFT_FLOAT) != (out_flags & EF_SOFT_FLOAT)) { _bfd_error_handler (_ ("\ +Error: %s uses %s floating point, whereas %s uses %s floating point"), + bfd_get_filename (ibfd), + in_flags & EF_SOFT_FLOAT ? _("soft") : _("hard"), + bfd_get_filename (obfd), + out_flags & EF_SOFT_FLOAT ? _("soft") : _("hard")); + flags_compatible = false; + } +#endif + + /* Interworking mismatch is only a warning. */ + if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) + _bfd_error_handler (_ ("\ Warning: %s %s interworking, whereas %s %s"), bfd_get_filename (ibfd), in_flags & EF_INTERWORK ? _ ("supports") : _ ("does not support"), bfd_get_filename (obfd), out_flags & EF_INTERWORK ? _ ("does not") : _ ("does")); - return true; - } - return false; + return flags_compatible; } /* Display the flags field */ diff --git a/gnu/dist/toolchain/bfd/elf32-i386.c b/gnu/dist/toolchain/bfd/elf32-i386.c index 90efba8dc9bc..fc1b5a8ccb6e 100644 --- a/gnu/dist/toolchain/bfd/elf32-i386.c +++ b/gnu/dist/toolchain/bfd/elf32-i386.c @@ -1291,7 +1291,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, sections against symbols defined externally in shared libraries. We can't do anything with them here. */ - || (input_section->flags & SEC_DEBUGGING) != 0))) + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) { /* In these cases, we don't need the relocation value. We check specially because in some @@ -1313,14 +1315,17 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } diff --git a/gnu/dist/toolchain/bfd/elf32-m68k.c b/gnu/dist/toolchain/bfd/elf32-m68k.c index cc6223017558..3df26d2c7f96 100644 --- a/gnu/dist/toolchain/bfd/elf32-m68k.c +++ b/gnu/dist/toolchain/bfd/elf32-m68k.c @@ -1479,14 +1479,17 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (!(info->callbacks->undefined_symbol (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } diff --git a/gnu/dist/toolchain/bfd/elf32-mcore.c b/gnu/dist/toolchain/bfd/elf32-mcore.c index 5963a9eff6ea..edc6f678c226 100644 --- a/gnu/dist/toolchain/bfd/elf32-mcore.c +++ b/gnu/dist/toolchain/bfd/elf32-mcore.c @@ -532,7 +532,8 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared) + else if (info->shared + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { diff --git a/gnu/dist/toolchain/bfd/elf32-mips.c b/gnu/dist/toolchain/bfd/elf32-mips.c index d91bab972684..e7e1c2a7ab20 100644 --- a/gnu/dist/toolchain/bfd/elf32-mips.c +++ b/gnu/dist/toolchain/bfd/elf32-mips.c @@ -5930,7 +5930,8 @@ mips_elf_calculate_relocation (abfd, and check to see if they exist by looking at their addresses. */ symbol = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic && !info->no_undefined + && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) symbol = 0; else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0) { @@ -5948,7 +5949,8 @@ mips_elf_calculate_relocation (abfd, if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section, relocation->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->root.other))))) return bfd_reloc_undefined; symbol = 0; } diff --git a/gnu/dist/toolchain/bfd/elf32-ppc.c b/gnu/dist/toolchain/bfd/elf32-ppc.c index 242cfb730ab5..b405feaa1f53 100644 --- a/gnu/dist/toolchain/bfd/elf32-ppc.c +++ b/gnu/dist/toolchain/bfd/elf32-ppc.c @@ -2687,6 +2687,13 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) + == 0) + sym->st_value = 0; } } @@ -3101,7 +3108,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { @@ -3111,7 +3120,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, input_section, rel->r_offset, (!info->shared - || info->no_undefined))) + || info->no_undefined + || ELF_ST_VISIBILITY (h->other)))) return false; relocation = 0; } diff --git a/gnu/dist/toolchain/bfd/elf32-sparc.c b/gnu/dist/toolchain/bfd/elf32-sparc.c index e61a82fabeb5..1c8d0ba275ae 100644 --- a/gnu/dist/toolchain/bfd/elf32-sparc.c +++ b/gnu/dist/toolchain/bfd/elf32-sparc.c @@ -1213,14 +1213,17 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } diff --git a/gnu/dist/toolchain/bfd/elf64-sparc.c b/gnu/dist/toolchain/bfd/elf64-sparc.c index 46e777552f2a..c9e862677ac7 100644 --- a/gnu/dist/toolchain/bfd/elf64-sparc.c +++ b/gnu/dist/toolchain/bfd/elf64-sparc.c @@ -2049,14 +2049,17 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } diff --git a/gnu/dist/toolchain/bfd/elflink.c b/gnu/dist/toolchain/bfd/elflink.c index 6534d84b18a0..8039b4fe35b0 100644 --- a/gnu/dist/toolchain/bfd/elflink.c +++ b/gnu/dist/toolchain/bfd/elflink.c @@ -226,20 +226,13 @@ _bfd_elf_link_record_dynamic_symbol (info, h) { case STV_INTERNAL: case STV_HIDDEN: - /* This symbol must be defined in the shared object or - executable. */ - if (h->root.type == bfd_link_hash_undefined) + if (h->root.type != bfd_link_hash_undefined + && h->root.type != bfd_link_hash_undefweak) { - bfd * abfd = h->root.u.undef.abfd; - const char * name = h->root.root.string; - - (*info->callbacks->undefined_symbol) - (info, name, abfd, bfd_und_section_ptr, 0, true); + h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; + return true; } - - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - break; - + default: break; } diff --git a/gnu/dist/toolchain/binutils/ChangeLog b/gnu/dist/toolchain/binutils/ChangeLog index 074d4b40f3ed..77775a81c3e6 100644 --- a/gnu/dist/toolchain/binutils/ChangeLog +++ b/gnu/dist/toolchain/binutils/ChangeLog @@ -1,3 +1,99 @@ +2000-11-01 Philip Blundell + + From 2000-06-15 H.J. Lu + * dyn-string.c: Removed. Not needed with dyn-string.c in + libiberty. + * dyn-string.h: Likewise. + * Makefile.am: Remove references to dyn-string.c and + dyn-string.h. Rebuild dependency. + * Makefile.in: Rebuild. + +2000-10-16 Philip Blundell + + * configure.in: Set version number to 2.10.1. + * configure: Regenerate. + +2000-10-14 Philip Blundell + + * config.sub, config.guess: Update from mainline sources. + + From 2000-09-07 H.J. Lu + + * configure.in (AC_ISC_POSIX): Put after AC_CANONICAL_SYSTEM. + * configure: Rebuild. + + From 2000-08-17 Nick Clifton + + * readelf.c (display_debug_pubnames): Only issue warning + message once. Terminate message with a new line. + (display_debug_aranges): Only display version 2 debug info. + + From 2000-07-19 H.J. Lu + + * readelf.c (get_dynamic_type): Change "AUXILARY" to + "AUXILIARY". + (process_dynamic_segment): Print out strings for DT_CONFIG, + DT_DEPAUDIT, DT_AUDIT and DT_RUNPATH. + + From 2000-07-19 H.J. Lu + + * readelf.c (process_dynamic_segment): Change DF_1_NODEPLIB + to DF_1_NODEFLIB. + + From 2000-07-19 H.J. Lu + + * readelf.c (get_dynamic_type): Fix DT_CHECKSUM. + + From 2000-07-19 H.J. Lu + + * readelf.c (get_dynamic_type): Change DT_FEATURE_1 to + DT_FEATURE. + (process_dynamic_segment): Likewise. + + * readelf.c (get_dynamic_type): Handle DT_CONFIG, DT_DEPAUDIT, + DT_AUDIT, DT_PLTPAD, DT_MOVETAB and DT_CHECKSUM. + (process_dynamic_segment): Handle DTF_1_CONFEXP, DF_1_NODEPLIB, + DF_1_NODUMP and DF_1_CONLFAT. + + From 2000-07-01 Alexander Aganichev + + * stabs.c (parse_stab_type): Divide size in bits by 8 as binutils + struct debug_type stores size in bytes. + + From 2000-08-17 Christopher C. Chimelis + + * objdump.c (LONGEST_ARCH): Set to sizeof("powerpc:common"). + + From 2000-07-11 Mark Kettenis + + * objdump.c (usage): Make output of `objdump --help' more + consistent with the rest of the GNU world. Add a line describing + the purpose of the program. + + From 2000-06-24 Nick Clifton + + * objdump.c (usage): Fix description of --stabs switch. + + From 2000-07-18 Nick Clifton + + * binutils.texi (readelf): Fix spelling typo. + + From 2000-07-19 Mark Kettenis + + * nm.c (usage): Change output of `nm --help' to include a + description of the purpose of the program and a detailed + description of the accepted options. + +2000-09-05 Todd Vierling + + From 2000-08-14 Todd Vierling + * objcopy.c (strip_main): Silently accept -d as an alias for -g + for compatability with old BSD systems. + +2000-09-04 Todd Vierling + + * strip.1: Fix stray '\' in -o formatting. + 2000-05-30 Alan Modra * objdump.c (display_target_list): Use bfd_close_all_done, not diff --git a/gnu/dist/toolchain/binutils/Makefile.am b/gnu/dist/toolchain/binutils/Makefile.am index 4c509bf6413e..a6eb22aa99d7 100644 --- a/gnu/dist/toolchain/binutils/Makefile.am +++ b/gnu/dist/toolchain/binutils/Makefile.am @@ -74,7 +74,7 @@ MKDEP = gcc -MM INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(prefix)/share/locale\"" HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h \ - windres.h winduni.h dyn-string.h + windres.h winduni.h GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h @@ -84,7 +84,7 @@ CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c \ objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c \ stabs.c strings.c sysdump.c version.c wrstabs.c \ windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c \ - resres.c dyn-string.c dllwrap.c rename.c + resres.c dllwrap.c rename.c GENERATED_CFILES = \ underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ @@ -242,7 +242,7 @@ sysinfo.h: sysinfo.c srconv_SOURCES = srconv.c coffgrok.c $(BULIBS) -dlltool_SOURCES = dlltool.c defparse.y deflex.l dyn-string.c $(BULIBS) +dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS) dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) dlltool.o:dlltool.c @@ -267,7 +267,7 @@ windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \ winduni.c resres.c $(BULIBS) windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) -dllwrap_SOURCES = dllwrap.c dyn-string.c version.c +dllwrap_SOURCES = dllwrap.c version.c dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) @@ -391,7 +391,7 @@ debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h debug.h dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h dyn-string.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h $(INCDIR)/dyn-string.h \ dlltool.h filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h @@ -484,11 +484,9 @@ readelf.o: readelf.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ $(INCDIR)/libiberty.h windres.h winduni.h -dyn-string.o: dyn-string.c config.h $(INCDIR)/ansidecl.h \ - dyn-string.h dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h dyn-string.h + $(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h underscore.o: underscore.c diff --git a/gnu/dist/toolchain/binutils/Makefile.in b/gnu/dist/toolchain/binutils/Makefile.in index 8172759603ab..f4178de276a9 100644 --- a/gnu/dist/toolchain/binutils/Makefile.in +++ b/gnu/dist/toolchain/binutils/Makefile.in @@ -151,8 +151,7 @@ DLLWRAP_PROG = dllwrap SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) -man_MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 \ - addr2line.1 nlmconv.1 $(DEMANGLER_NAME).1 +man_MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 addr2line.1 nlmconv.1 $(DEMANGLER_NAME).1 PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ @@ -174,24 +173,15 @@ MKDEP = gcc -MM INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(prefix)/share/locale\"" -HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h \ - windres.h winduni.h dyn-string.h +HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h windres.h winduni.h GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h -CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c \ - dlltool.c filemode.c ieee.c is-ranlib.c is-strip.c maybe-ranlib.c \ - maybe-strip.c nlmconv.c nm.c not-ranlib.c not-strip.c \ - objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c \ - stabs.c strings.c sysdump.c version.c wrstabs.c \ - windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c \ - resres.c dyn-string.c dllwrap.c rename.c +CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c dlltool.c filemode.c ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c nlmconv.c nm.c not-ranlib.c not-strip.c objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c stabs.c strings.c sysdump.c version.c wrstabs.c windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c resres.c dllwrap.c rename.c -GENERATED_CFILES = \ - underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ - defparse.c deflex.c nlmheader.c rcparse.c rclex.c +GENERATED_CFILES = underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c defparse.c deflex.c nlmheader.c rcparse.c rclex.c DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c @@ -208,29 +198,12 @@ LIBIBERTY = ../libiberty/libiberty.a POTFILES = $(CFILES) $(DEBUG_SRCS) $(HFILES) -EXPECT = `if [ -f $$r/../expect/expect ] ; then \ - echo $$r/../expect/expect ; \ - else echo expect ; fi` +EXPECT = `if [ -f $$r/../expect/expect ] ; then echo $$r/../expect/expect ; else echo expect ; fi` -RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \ - echo ${srcdir}/../dejagnu/runtest ; \ - else echo runtest ; fi` +RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo ${srcdir}/../dejagnu/runtest ; else echo runtest ; fi` -CC_FOR_TARGET = ` \ - if [ -f $$r/../gcc/xgcc ] ; then \ - if [ -f $$r/../newlib/Makefile ] ; then \ - echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \ - else \ - echo $$r/../gcc/xgcc -B$$r/../gcc/; \ - fi; \ - else \ - if [ "@host@" = "@target@" ] ; then \ - echo $(CC); \ - else \ - echo gcc | sed '$(transform)'; \ - fi; \ - fi` +CC_FOR_TARGET = ` if [ -f $$r/../gcc/xgcc ] ; then if [ -f $$r/../newlib/Makefile ] ; then echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; else echo $$r/../gcc/xgcc -B$$r/../gcc/; fi; else if [ "@host@" = "@target@" ] ; then echo $(CC); else echo gcc | sed '$(transform)'; fi; fi` info_TEXINFOS = binutils.texi @@ -266,7 +239,7 @@ addr2line_SOURCES = addr2line.c $(BULIBS) srconv_SOURCES = srconv.c coffgrok.c $(BULIBS) -dlltool_SOURCES = dlltool.c defparse.y deflex.l dyn-string.c $(BULIBS) +dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS) dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS) @@ -275,26 +248,22 @@ sysdump_SOURCES = sysdump.c $(BULIBS) nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS) -windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \ - winduni.c resres.c $(BULIBS) +windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l winduni.c resres.c $(BULIBS) windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) -dllwrap_SOURCES = dllwrap.c dyn-string.c version.c +dllwrap_SOURCES = dllwrap.c version.c dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) -DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ - syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c +DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c -DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \ - site.exp site.bak +DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h site.exp site.bak MAINTAINERCLEANFILES = config.texi -MOSTLYCLEANFILES = sysinfo $(DEMANGLER_NAME).1 binutils.log binutils.sum \ - abcdefgh* +MOSTLYCLEANFILES = sysinfo $(DEMANGLER_NAME).1 binutils.log binutils.sum abcdefgh* CLEANFILES = dep.sed DEP DEP1 DEP2 @@ -330,15 +299,15 @@ coffdump_OBJECTS = coffdump.o coffgrok.o bucomm.o version.o filemode.o coffdump_LDADD = $(LDADD) coffdump_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a coffdump_LDFLAGS = -dlltool_OBJECTS = dlltool.o defparse.o deflex.o dyn-string.o bucomm.o \ -version.o filemode.o +dlltool_OBJECTS = dlltool.o defparse.o deflex.o bucomm.o version.o \ +filemode.o dlltool_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a dlltool_LDFLAGS = windres_OBJECTS = windres.o resrc.o rescoff.o resbin.o rcparse.o \ rclex.o winduni.o resres.o bucomm.o version.o filemode.o windres_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a windres_LDFLAGS = -dllwrap_OBJECTS = dllwrap.o dyn-string.o version.o +dllwrap_OBJECTS = dllwrap.o version.o dllwrap_DEPENDENCIES = ../libiberty/libiberty.a dllwrap_LDFLAGS = size_OBJECTS = size.o bucomm.o version.o filemode.o @@ -1247,7 +1216,7 @@ debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h debug.h dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h dyn-string.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h $(INCDIR)/dyn-string.h \ dlltool.h filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h @@ -1340,11 +1309,9 @@ readelf.o: readelf.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ $(INCDIR)/libiberty.h windres.h winduni.h -dyn-string.o: dyn-string.c config.h $(INCDIR)/ansidecl.h \ - dyn-string.h dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h dyn-string.h + $(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h underscore.o: underscore.c diff --git a/gnu/dist/toolchain/binutils/binutils.info b/gnu/dist/toolchain/binutils/binutils.info index 13af724d97e9..ee48dd55088e 100644 --- a/gnu/dist/toolchain/binutils/binutils.info +++ b/gnu/dist/toolchain/binutils/binutils.info @@ -39,36 +39,36 @@ versions.  Indirect: binutils.info-1: 1845 -binutils.info-2: 49760 -binutils.info-3: 96951 +binutils.info-2: 49762 +binutils.info-3: 96952  Tag Table: (Indirect) Node: Top1845 -Node: ar3094 -Node: ar cmdline5268 -Node: ar scripts13107 -Node: nm18786 -Node: objcopy25756 -Node: objdump38583 -Node: ranlib49011 -Node: size49760 -Node: strings52491 -Node: strip54316 -Node: c++filt57281 -Ref: c++filt-Footnote-160138 -Node: addr2line60244 -Node: nlmconv62650 -Node: windres65254 -Node: dlltool70306 -Node: readelf79647 -Node: Selecting The Target System82798 -Node: Target Selection83815 -Node: Architecture Selection86516 -Node: Linker Emulation Selection87747 -Node: Reporting Bugs88625 -Node: Bug Criteria89376 -Node: Bug Reporting89922 -Node: Index96951 +Node: ar3096 +Node: ar cmdline5270 +Node: ar scripts13109 +Node: nm18788 +Node: objcopy25758 +Node: objdump38585 +Node: ranlib49013 +Node: size49762 +Node: strings52493 +Node: strip54318 +Node: c++filt57283 +Ref: c++filt-Footnote-160140 +Node: addr2line60246 +Node: nlmconv62652 +Node: windres65256 +Node: dlltool70308 +Node: readelf79649 +Node: Selecting The Target System82799 +Node: Target Selection83816 +Node: Architecture Selection86517 +Node: Linker Emulation Selection87748 +Node: Reporting Bugs88626 +Node: Bug Criteria89377 +Node: Bug Reporting89923 +Node: Index96952  End Tag Table diff --git a/gnu/dist/toolchain/binutils/binutils.info-1 b/gnu/dist/toolchain/binutils/binutils.info-1 index 27ad36abc292..2bbcd85ba5aa 100644 --- a/gnu/dist/toolchain/binutils/binutils.info-1 +++ b/gnu/dist/toolchain/binutils/binutils.info-1 @@ -43,7 +43,7 @@ Introduction ************ This brief manual contains preliminary documentation for the GNU -binary utilities (collectively version 2.10): +binary utilities (collectively version 2.10.1): * Menu: diff --git a/gnu/dist/toolchain/binutils/binutils.info-2 b/gnu/dist/toolchain/binutils/binutils.info-2 index def5a0d32645..5395d1d3faf8 100644 --- a/gnu/dist/toolchain/binutils/binutils.info-2 +++ b/gnu/dist/toolchain/binutils/binutils.info-2 @@ -968,8 +968,8 @@ equivalent. At least one option besides `-v' or `-H' must be given. `-D' `--use-dynamic' When displaying symbols, this option makes `readelf' use the - symblol table in the file's dynamic section, rather than the one - in the symbols section. + symbol table in the file's dynamic section, rather than the one in + the symbols section. `-x ' `--hex-dump=' diff --git a/gnu/dist/toolchain/binutils/binutils.texi b/gnu/dist/toolchain/binutils/binutils.texi index 1820d6615879..c2232e3026c3 100644 --- a/gnu/dist/toolchain/binutils/binutils.texi +++ b/gnu/dist/toolchain/binutils/binutils.texi @@ -2530,7 +2530,7 @@ exist. @item -D @itemx --use-dynamic When displaying symbols, this option makes @code{readelf} use the -symblol table in the file's dynamic section, rather than the one in the +symbol table in the file's dynamic section, rather than the one in the symbols section. @item -x diff --git a/gnu/dist/toolchain/binutils/config.texi b/gnu/dist/toolchain/binutils/config.texi index b696ac718c9a..4c75b6221634 100644 --- a/gnu/dist/toolchain/binutils/config.texi +++ b/gnu/dist/toolchain/binutils/config.texi @@ -1 +1 @@ -@set VERSION 2.10 +@set VERSION 2.10.1 diff --git a/gnu/dist/toolchain/binutils/configure b/gnu/dist/toolchain/binutils/configure index e733ae7b5e8d..f454df57fbf9 100755 --- a/gnu/dist/toolchain/binutils/configure +++ b/gnu/dist/toolchain/binutils/configure @@ -49,7 +49,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -164,7 +163,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -335,11 +333,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -505,16 +498,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -601,7 +590,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:605: checking host system type" >&5 +echo "configure:594: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -622,7 +611,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:626: checking target system type" >&5 +echo "configure:615: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -640,7 +629,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:644: checking build system type" >&5 +echo "configure:633: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -662,6 +651,249 @@ test "$host_alias" != "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:658: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:688: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:739: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:771: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 782 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:813: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:818: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:846: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:878: checking for POSIXized ISC" >&5 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -675,7 +907,7 @@ test "$host_alias" != "$target_alias" && # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:679: checking for a BSD compatible install" >&5 +echo "configure:911: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -728,7 +960,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:732: checking whether build environment is sane" >&5 +echo "configure:964: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -785,7 +1017,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:789: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1021: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -814,7 +1046,7 @@ fi PACKAGE=binutils -VERSION=2.10 +VERSION=2.10.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -831,7 +1063,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:835: checking for working aclocal" >&5 +echo "configure:1067: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -844,7 +1076,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:848: checking for working autoconf" >&5 +echo "configure:1080: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -857,7 +1089,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:861: checking for working automake" >&5 +echo "configure:1093: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -870,7 +1102,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:874: checking for working autoheader" >&5 +echo "configure:1106: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -883,7 +1115,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:887: checking for working makeinfo" >&5 +echo "configure:1119: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -969,7 +1201,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:973: checking for $ac_word" >&5 +echo "configure:1205: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -996,228 +1228,6 @@ else echo "$ac_t""no" 1>&6 fi -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1003: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1033: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1084: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1116: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 1127 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:1132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1158: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1163: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1191: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" @@ -1230,7 +1240,7 @@ ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1234: checking for ld used by GCC" >&5 +echo "configure:1244: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -1254,10 +1264,10 @@ echo "configure:1234: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1258: checking for GNU ld" >&5 +echo "configure:1268: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1261: checking for non-GNU ld" >&5 +echo "configure:1271: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1292,7 +1302,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1296: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1306: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1308,7 +1318,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1312: checking for BSD-compatible nm" >&5 +echo "configure:1322: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1344,7 +1354,7 @@ NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1348: checking whether ln -s works" >&5 +echo "configure:1358: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1393,8 +1403,8 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1397 "configure"' > conftest.$ac_ext - if { (eval echo configure:1398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1407 "configure"' > conftest.$ac_ext + if { (eval echo configure:1408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -1415,19 +1425,19 @@ case "$lt_target" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1419: checking whether the C compiler needs -belf" >&5 +echo "configure:1429: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -1563,7 +1573,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1567: checking for $ac_word" >&5 +echo "configure:1577: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1593,7 +1603,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1597: checking for $ac_word" >&5 +echo "configure:1607: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1644,7 +1654,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1648: checking for $ac_word" >&5 +echo "configure:1658: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1676,7 +1686,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1680: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1690: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1687,12 +1697,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1691 "configure" +#line 1701 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1718,12 +1728,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1722: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1732: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1727: checking whether we are using GNU C" >&5 +echo "configure:1737: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1732,7 +1742,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1751,7 +1761,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1755: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1765: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1788,7 +1798,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1792: checking for $ac_word" >&5 +echo "configure:1802: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1819,7 +1829,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1823: checking how to run the C preprocessor" >&5 +echo "configure:1833: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1834,13 +1844,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1851,13 +1861,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1868,13 +1878,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1904,7 +1914,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1908: checking for $ac_word" >&5 +echo "configure:1918: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1937,7 +1947,7 @@ test -n "$LEX" || LEX=""$missing_dir/missing flex"" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1941: checking for $ac_word" >&5 +echo "configure:1951: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1971,7 +1981,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1975: checking for yywrap in -l$ac_lib" >&5 +echo "configure:1985: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1979,7 +1989,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2013,7 +2023,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:2017: checking lex output file root" >&5 +echo "configure:2027: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2034,7 +2044,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:2038: checking whether yytext is a pointer" >&5 +echo "configure:2048: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2046,14 +2056,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -2076,34 +2086,13 @@ fi ALL_LINGUAS= -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:2081: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then - echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi -else - echo "$ac_t""no" 1>&6 - ISC= -fi - echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2102: checking for ANSI C header files" >&5 +echo "configure:2091: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2111,7 +2100,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2128,7 +2117,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2146,7 +2135,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2167,7 +2156,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2178,7 +2167,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2202,18 +2191,18 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2206: checking for working const" >&5 +echo "configure:2195: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2277,21 +2266,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2281: checking for inline" >&5 +echo "configure:2270: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2317,12 +2306,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2321: checking for off_t" >&5 +echo "configure:2310: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2350,12 +2339,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2354: checking for size_t" >&5 +echo "configure:2343: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2385,19 +2374,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2389: checking for working alloca.h" >&5 +echo "configure:2378: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { -char *p = alloca(2 * sizeof(int)); +void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2418,12 +2407,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2422: checking for alloca" >&5 +echo "configure:2411: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2483,12 +2472,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2487: checking whether alloca needs Cray hooks" >&5 +echo "configure:2476: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2517: checking for $ac_func" >&5 +echo "configure:2506: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2568,7 +2557,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2572: checking stack direction for C alloca" >&5 +echo "configure:2561: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2576,7 +2565,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2620,17 +2609,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2624: checking for $ac_hdr" >&5 +echo "configure:2613: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2659,12 +2648,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2663: checking for $ac_func" >&5 +echo "configure:2652: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2712,7 +2701,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2716: checking for working mmap" >&5 +echo "configure:2705: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2720,7 +2709,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include #include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -2807,7 +2799,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = malloc(pagesize); + data = (char*)malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -2828,7 +2820,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = malloc(2 * pagesize); + data2 = (char*)malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -2846,7 +2838,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); + data3 = (char*)malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -2860,7 +2852,7 @@ main() } EOF -if { (eval echo configure:2864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2888,17 +2880,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2892: checking for $ac_hdr" >&5 +echo "configure:2884: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2928,12 +2920,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2932: checking for $ac_func" >&5 +echo "configure:2924: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2985,12 +2977,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2989: checking for $ac_func" >&5 +echo "configure:2981: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3047,19 +3039,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3051: checking for LC_MESSAGES" >&5 +echo "configure:3043: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3080,7 +3072,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3084: checking whether NLS is requested" >&5 +echo "configure:3076: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3100,7 +3092,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3104: checking whether included gettext is requested" >&5 +echo "configure:3096: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3119,17 +3111,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3123: checking for libintl.h" >&5 +echo "configure:3115: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3146,19 +3138,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3150: checking for gettext in libc" >&5 +echo "configure:3142: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3174,7 +3166,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3178: checking for bindtextdomain in -lintl" >&5 +echo "configure:3170: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3182,7 +3174,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3209,19 +3201,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3213: checking for gettext in libintl" >&5 +echo "configure:3205: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3249,7 +3241,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3253: checking for $ac_word" >&5 +echo "configure:3245: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3283,12 +3275,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3287: checking for $ac_func" >&5 +echo "configure:3279: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3338,7 +3330,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3342: checking for $ac_word" >&5 +echo "configure:3334: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3374,7 +3366,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3378: checking for $ac_word" >&5 +echo "configure:3370: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3406,7 +3398,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3446,7 +3438,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3450: checking for $ac_word" >&5 +echo "configure:3442: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3480,7 +3472,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3484: checking for $ac_word" >&5 +echo "configure:3476: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3516,7 +3508,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3520: checking for $ac_word" >&5 +echo "configure:3512: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3606,7 +3598,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:3610: checking for catalogs to be installed" >&5 +echo "configure:3602: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -3634,17 +3626,17 @@ echo "configure:3610: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:3638: checking for linux/version.h" >&5 +echo "configure:3630: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3707,7 +3699,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:3711: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:3703: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -3730,12 +3722,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:3734: checking for Cygwin environment" >&5 +echo "configure:3726: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -3763,19 +3755,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:3767: checking for mingw32 environment" >&5 +echo "configure:3759: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -3794,7 +3786,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3798: checking for executable suffix" >&5 +echo "configure:3790: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3804,10 +3796,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:3808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:3800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -3847,7 +3839,7 @@ AR=${AR-ar} # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3851: checking for $ac_word" >&5 +echo "configure:3843: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3886,7 +3878,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:3890: checking for a BSD compatible install" >&5 +echo "configure:3882: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3953,7 +3945,7 @@ if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' else echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6 -echo "configure:3957: checking for build system executable suffix" >&5 +echo "configure:3949: checking for build system executable suffix" >&5 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3988,17 +3980,17 @@ for ac_hdr in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3992: checking for $ac_hdr" >&5 +echo "configure:3984: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4025,12 +4017,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:4029: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:4021: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4046,7 +4038,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:4050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -4069,19 +4061,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:4073: checking for working alloca.h" >&5 +echo "configure:4065: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { -char *p = alloca(2 * sizeof(int)); +void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -4102,12 +4094,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4106: checking for alloca" >&5 +echo "configure:4098: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4167,12 +4159,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4171: checking whether alloca needs Cray hooks" >&5 +echo "configure:4163: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4201: checking for $ac_func" >&5 +echo "configure:4193: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4252,7 +4244,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4256: checking stack direction for C alloca" >&5 +echo "configure:4248: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4260,7 +4252,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4303,12 +4295,12 @@ fi for ac_func in sbrk utimes setmode do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4307: checking for $ac_func" >&5 +echo "configure:4299: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4359,14 +4351,14 @@ done # Some systems have frexp only in -lm, not in -lc. echo $ac_n "checking for library containing frexp""... $ac_c" 1>&6 -echo "configure:4363: checking for library containing frexp" >&5 +echo "configure:4355: checking for library containing frexp" >&5 if eval "test \"`echo '$''{'ac_cv_search_frexp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_frexp="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_frexp="none required" else @@ -4388,7 +4380,7 @@ rm -f conftest* test "$ac_cv_search_frexp" = "no" && for i in m; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_frexp="-l$i" break @@ -4421,19 +4413,19 @@ else : fi echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6 -echo "configure:4425: checking for time_t in time.h" >&5 +echo "configure:4417: checking for time_t in time.h" >&5 if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:4437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_time_h=yes else @@ -4454,19 +4446,19 @@ EOF fi echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:4458: checking for time_t in sys/types.h" >&5 +echo "configure:4450: checking for time_t in sys/types.h" >&5 if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:4470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_types_h=yes else @@ -4489,12 +4481,12 @@ fi # Under Next 3.2 apparently does not define struct utimbuf # by default. echo $ac_n "checking for utime.h""... $ac_c" 1>&6 -echo "configure:4493: checking for utime.h" >&5 +echo "configure:4485: checking for utime.h" >&5 if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef HAVE_TIME_H @@ -4505,7 +4497,7 @@ int main() { struct utimbuf s; ; return 0; } EOF -if { (eval echo configure:4509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_header_utime_h=yes else @@ -4526,12 +4518,12 @@ EOF fi echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6 -echo "configure:4530: checking whether fprintf must be declared" >&5 +echo "configure:4522: checking whether fprintf must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4552,7 +4544,7 @@ int main() { char *(*pfn) = (char *(*)) fprintf ; return 0; } EOF -if { (eval echo configure:4556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_fprintf=no else @@ -4573,12 +4565,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4577: checking whether strstr must be declared" >&5 +echo "configure:4569: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4599,7 +4591,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4620,12 +4612,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:4624: checking whether sbrk must be declared" >&5 +echo "configure:4616: checking whether sbrk must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4646,7 +4638,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:4650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -4667,12 +4659,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4671: checking whether getenv must be declared" >&5 +echo "configure:4663: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4693,7 +4685,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -4714,12 +4706,12 @@ EOF fi echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:4718: checking whether environ must be declared" >&5 +echo "configure:4710: checking whether environ must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4740,7 +4732,7 @@ int main() { char *(*pfn) = (char *(*)) environ ; return 0; } EOF -if { (eval echo configure:4744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_environ=no else @@ -5045,6 +5037,7 @@ s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g +s%@CC@%$CC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g @@ -5057,7 +5050,6 @@ s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@RANLIB@%$RANLIB%g -s%@CC@%$CC%g s%@LN_S@%$LN_S%g s%@LIBTOOL@%$LIBTOOL%g s%@YACC@%$YACC%g diff --git a/gnu/dist/toolchain/binutils/configure.in b/gnu/dist/toolchain/binutils/configure.in index 9f724ec4ca5c..0a52219d8fce 100644 --- a/gnu/dist/toolchain/binutils/configure.in +++ b/gnu/dist/toolchain/binutils/configure.in @@ -4,8 +4,9 @@ AC_PREREQ(2.13) AC_INIT(ar.c) AC_CANONICAL_SYSTEM +AC_ISC_POSIX -AM_INIT_AUTOMAKE(binutils, 2.10) +AM_INIT_AUTOMAKE(binutils, 2.10.1) AM_PROG_LIBTOOL diff --git a/gnu/dist/toolchain/binutils/nm.c b/gnu/dist/toolchain/binutils/nm.c index 2ee48731bed4..ad5a00d37701 100644 --- a/gnu/dist/toolchain/binutils/nm.c +++ b/gnu/dist/toolchain/binutils/nm.c @@ -291,19 +291,38 @@ usage (stream, status) FILE *stream; int status; { - fprintf (stream, _("\ -Usage: %s [-aABCDglnopPrsuvV] [-t radix] [--radix=radix] [--target=bfdname]\n\ - [--debug-syms] [--extern-only] [--print-armap] [--print-file-name]\n\ - [--numeric-sort] [--no-sort] [--reverse-sort] [--size-sort]\n\ - [--undefined-only] [--portability] [-f {bsd,sysv,posix}]\n\ - [--format={bsd,sysv,posix}] [--demangle] [--no-demangle] [--dynamic]\n\ - [--defined-only] [--line-numbers]\n\ - [--version] [--help]\n\ - [file...]\n"), - program_name); + fprintf (stream, _("Usage: %s [OPTION]... [FILE]...\n"), program_name); + fprintf (stream, _("List symbols from FILEs (a.out by default).\n")); + fprintf (stream, _("\n\ + -a, --debug-syms Display debugger-only symbols\n\ + -A, --print-file-name Print name of the input file before every symbol\n\ + -B Same as --format=bsd\n\ + -C, --demangle Decode low-level symbol names into user-level names\n\ + --no-demangle Do not demangle low-level symbol names\n\ + -D, --dynamic Display dynamic symbols instead of normal symbols\n\ + --defined-only Display only defined symbols\n\ + -e (ignored)\n\ + -f, --format=FORMAT Use the output format FORMAT. FORMAT can be `bsd',\n\ + `sysv' or `posix'. The default is `bsd'\n\ + -g, --extern-only Display only external symbols\n\ + -h, --help Display this information\n\ + -l, --line-numbers Use debugging information to find a filename and\n\ + line number for each symbol\n\ + -n, --numeric-sort Sort symbols numerically by address\n\ + -o Same as -A\n\ + -p, --no-sort Do not sort the symbols\n\ + -P, --portability Same as --format=posix\n\ + -r, --reverse-sort Reverse the sense of the sort\n\ + -s, --print-armap Include index for symbols from archive members\n\ + --size-sort Sort symbols by size\n\ + -t, --radix=RADIX Use RADIX for printing symbol values\n\ + --target=BFDNAME Specify the target object format as BFDNAME\n\ + -u, --undefined-only Display only undefined symbols\n\ + -V, --version Display this program's version number\n\ +\n")); list_supported_targets (program_name, stream); if (status == 0) - fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); + fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); exit (status); } diff --git a/gnu/dist/toolchain/binutils/readelf.c b/gnu/dist/toolchain/binutils/readelf.c index fc011e4988a7..8858d57fbf7c 100644 --- a/gnu/dist/toolchain/binutils/readelf.c +++ b/gnu/dist/toolchain/binutils/readelf.c @@ -1063,15 +1063,21 @@ get_dynamic_type (type) case DT_PREINIT_ARRAY: return "PREINIT_ARRAY"; case DT_PREINIT_ARRAYSZ: return "PREINIT_ARRAYSZ"; + case DT_CHECKSUM: return "CHECKSUM"; case DT_PLTPADSZ: return "PLTPADSZ"; case DT_MOVEENT: return "MOVEENT"; case DT_MOVESZ: return "MOVESZ"; - case DT_FEATURE_1: return "FEATURE_1"; + case DT_FEATURE: return "FEATURE"; case DT_POSFLAG_1: return "POSFLAG_1"; case DT_SYMINSZ: return "SYMINSZ"; case DT_SYMINENT: return "SYMINENT"; /* aka VALRNGHI */ case DT_ADDRRNGLO: return "ADDRRNGLO"; + case DT_CONFIG: return "CONFIG"; + case DT_DEPAUDIT: return "DEPAUDIT"; + case DT_AUDIT: return "AUDIT"; + case DT_PLTPAD: return "PLTPAD"; + case DT_MOVETAB: return "MOVETAB"; case DT_SYMINFO: return "SYMINFO"; /* aka ADDRRNGHI */ case DT_VERSYM: return "VERSYM"; @@ -1084,7 +1090,7 @@ get_dynamic_type (type) case DT_VERNEED: return "VERNEED"; case DT_VERNEEDNUM: return "VERNEEDNUM"; - case DT_AUXILIARY: return "AUXILARY"; + case DT_AUXILIARY: return "AUXILIARY"; case DT_USED: return "USED"; case DT_FILTER: return "FILTER"; @@ -3202,12 +3208,33 @@ process_dynamic_segment (file) case DT_AUXILIARY: case DT_FILTER: + case DT_CONFIG: + case DT_DEPAUDIT: + case DT_AUDIT: if (do_dynamic) { - if (entry->d_tag == DT_AUXILIARY) - printf (_("Auxiliary library")); - else - printf (_("Filter library")); + switch (entry->d_tag) + { + case DT_AUXILIARY: + printf (_("Auxiliary library")); + break; + + case DT_FILTER: + printf (_("Filter library")); + break; + + case DT_CONFIG: + printf (_("Configuration file")); + break; + + case DT_DEPAUDIT: + printf (_("Dependency audit library")); + break; + + case DT_AUDIT: + printf (_("Audit library")); + break; + } if (dynamic_strings) printf (": [%s]\n", dynamic_strings + entry->d_un.d_val); @@ -3220,7 +3247,7 @@ process_dynamic_segment (file) } break; - case DT_FEATURE_1: + case DT_FEATURE: if (do_dynamic) { printf (_("Flags:")); @@ -3234,6 +3261,11 @@ process_dynamic_segment (file) printf (" PARINIT"); val ^= DTF_1_PARINIT; } + if (val & DTF_1_CONFEXP) + { + printf (" CONFEXP"); + val ^= DTF_1_CONFEXP; + } if (val != 0) printf (" %lx", val); puts (""); @@ -3331,6 +3363,21 @@ process_dynamic_segment (file) printf (" INTERPOSE"); val ^= DF_1_INTERPOSE; } + if (val & DF_1_NODEFLIB) + { + printf (" NODEFLIB"); + val ^= DF_1_NODEFLIB; + } + if (val & DF_1_NODUMP) + { + printf (" NODUMP"); + val ^= DF_1_NODUMP; + } + if (val & DF_1_CONLFAT) + { + printf (" CONLFAT"); + val ^= DF_1_CONLFAT; + } if (val != 0) printf (" %lx", val); puts (""); @@ -3359,6 +3406,7 @@ process_dynamic_segment (file) case DT_DEBUG : case DT_TEXTREL : case DT_JMPREL : + case DT_RUNPATH : dynamic_info[entry->d_tag] = entry->d_un.d_val; if (do_dynamic) @@ -3389,6 +3437,10 @@ process_dynamic_segment (file) printf (_("Library rpath: [%s]"), name); break; + case DT_RUNPATH: + printf (_("Library runpath: [%s]"), name); + break; + default: print_vma (entry->d_un.d_val, PREFIX_HEX); break; @@ -5039,7 +5091,14 @@ display_debug_pubnames (section, start, file) if (pubnames.pn_version != 2) { - warn (_("Only DWARF 2 pubnames are currently supported")); + static int warned = 0; + + if (! warned) + { + warn (_("Only DWARF 2 pubnames are currently supported\n")); + warned = 1; + } + continue; } @@ -6357,6 +6416,12 @@ display_debug_aranges (section, start, file) arange.ar_pointer_size = BYTE_GET (external->ar_pointer_size); arange.ar_segment_size = BYTE_GET (external->ar_segment_size); + if (arange.ar_version != 2) + { + warn (_("Only DWARF 2 aranges are currently supported.\n")); + break; + } + printf (_(" Length: %ld\n"), arange.ar_length); printf (_(" Version: %d\n"), arange.ar_version); printf (_(" Offset into .debug_info: %lx\n"), arange.ar_info_offset); diff --git a/gnu/dist/toolchain/binutils/stabs.c b/gnu/dist/toolchain/binutils/stabs.c index 8c20ed308e1c..5f600354257e 100644 --- a/gnu/dist/toolchain/binutils/stabs.c +++ b/gnu/dist/toolchain/binutils/stabs.c @@ -1261,6 +1261,7 @@ parse_stab_type (dhandle, info, typename, pp, slotp) { case 's': size = atoi (attr + 1); + size /= 8; /* Size is in bits. We store it in bytes. */ if (size <= 0) size = -1; break; diff --git a/gnu/dist/toolchain/config-ml.in b/gnu/dist/toolchain/config-ml.in index ed8b1edfaf4e..503f7cf1a182 100644 --- a/gnu/dist/toolchain/config-ml.in +++ b/gnu/dist/toolchain/config-ml.in @@ -72,14 +72,16 @@ # We have to handle being invoked by both Cygnus configure and Autoconf. # # Cygnus configure incoming variables: -# srcdir, subdir, target, arguments +# srcdir, subdir, host, arguments # # Autoconf incoming variables: -# srcdir, target, ac_configure_args +# srcdir, host, ac_configure_args # -# We *could* figure srcdir and target out, but we'd have to do work that +# We *could* figure srcdir and host out, but we'd have to do work that # our caller has already done to figure them out and requiring these two # seems reasonable. +# Note that `host' in this case is GCC's `target'. Target libraries are +# configured for a particular host. if [ -n "${ac_configure_args}" ]; then Makefile=${ac_file-Makefile} @@ -204,7 +206,10 @@ for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do fi done -case "${target}" in +# Target libraries are configured for the host they run on, so we check +# $host here, not $target. + +case "${host}" in arc-*-elf*) if [ x$enable_biendian != xyes ] then @@ -218,6 +223,64 @@ arc-*-elf*) done fi ;; +arm-*-*) + if [ x"$enable_fpu" = xno ] + then + old_multidirs=${multidirs} + multidirs="" + for x in ${old_multidirs}; do + case "${x}" in + *fpu*) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x"$enable_26bit" = xno ] + then + old_multidirs=${multidirs} + multidirs="" + for x in ${old_multidirs}; do + case "${x}" in + *26bit*) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x"$enable_underscore" = xno ] + then + old_multidirs=${multidirs} + multidirs="" + for x in ${old_multidirs}; do + case "${x}" in + *under*) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x"$enable_interwork" = xno ] + then + old_multidirs=${multidirs} + multidirs="" + for x in ${old_multidirs}; do + case "${x}" in + *interwork*) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_biendian = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *le* ) : ;; + *be* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + ;; m68*-*-*) if [ x$enable_softfloat = xno ] then @@ -299,28 +362,6 @@ mips*-*-*) esac done fi - case " $multidirs " in - *" mabi=64 "*) - # We will not be able to create libraries with -mabi=64 if - # we cannot even link a trivial program. It usually - # indicates the 64bit libraries are missing. - if echo 'main() {}' > conftest.c && - ${CC-gcc} -mabi=64 conftest.c -o conftest; then - : - else - echo Could not link program with -mabi=64, disabling it. - old_multidirs="${multidirs}" - multidirs="" - for x in ${old_multidirs}; do - case "$x" in - *mabi=64* ) : ;; - *) multidirs="${multidirs} ${x}" ;; - esac - done - fi - rm -f conftest.c conftest - ;; - esac ;; powerpc*-*-* | rs6000*-*-*) if [ x$enable_softfloat = xno ] diff --git a/gnu/dist/toolchain/config/ChangeLog b/gnu/dist/toolchain/config/ChangeLog index beaefd1d1ece..b5746b102f53 100644 --- a/gnu/dist/toolchain/config/ChangeLog +++ b/gnu/dist/toolchain/config/ChangeLog @@ -1,18 +1,28 @@ -Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com) +2000-02-23 Linas Vepstas - * gcc-2.95.2 Released. + * mh-i370pic: New file. + * mt-i370pic: New file. -Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com) +2000-02-22 Nick Clifton - * gcc-2.95.1 Released. + * config/mt-wince: new file: Makefile fragment for WinCE targets. -Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com) +2000-01-06 Geoff Keating - * gcc-2.95 Released. + * mh-aix43: Delete, move to mt-aix43. + * mt-aix43: New file. -Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com) +1999-04-07 Michael Meissner - * gcc-2.95 Released. + * mt-d30v: New file, pass -g -Os -Wa,-C as default options. + +1999-02-08 Syd Polk + + * acinclude.m4: Added macros to find itcl files. + Export TCL_CFLAGS from tclConfig.sh. + Export TCL_LIB_FULL_PATH, TK_LIB_FULL_PATH, ITCL_LIB_FULL_PATH, + ITK_LIB_FULL_PATH, and TIX_LIB_FULL_PATH + Replace TIX macros with better ones from snavigator. Tue Feb 2 22:51:21 1999 Philip Blundell @@ -35,6 +45,16 @@ Mon Nov 2 15:15:33 1998 Geoffrey Noer * mh-cygwin32: delete * mh-cygwin: was mh-cygwin32 +1998-10-26 Syd Polk + + * acinclude.m4: TCLHDIR and TKHDIR need to be run through + cygpath for Microsoft builds. + +1998-10-20 Syd Polk + + * acinclude.m4: Re-exported TCL_LIBS and TCL_LD_SEARCH_FLAGS + because itcl needs them. + Mon Aug 31 17:50:53 1998 David Edelsohn * mh-aix43 (NM_FOR_TARGET): Add -X32_64 as well. @@ -47,6 +67,10 @@ Mon Aug 10 00:15:47 1998 HJ Lu (hjl@gnu.org) * mt-linux (CXXFLAGS_FOR_TARGET): Add -D_GNU_SOURCE. +1998-05-29 Rob Savoye + + * acinclude.m4: New collection of generic autoconf macros. + Wed Apr 22 12:24:28 1998 Michael Meissner * mt-ospace: New file, support using -Os instead of -O2 to compile diff --git a/gnu/dist/toolchain/config/acinclude.m4 b/gnu/dist/toolchain/config/acinclude.m4 new file mode 100755 index 000000000000..f799ced44dd4 --- /dev/null +++ b/gnu/dist/toolchain/config/acinclude.m4 @@ -0,0 +1,1994 @@ +dnl This file is included into all any other acinclude file that needs +dnl to use these macros. + +dnl This is copied from autoconf 2.12, but does calls our own AC_PROG_CC_WORKS, +dnl and doesn't call AC_PROG_CXX_GNU, cause we test for that in AC_PROG_CC_WORKS. +dnl We are probably using a cross compiler, which will not be able to fully +dnl link an executable. This should really be fixed in autoconf itself. +dnl Find a working G++ cross compiler. This only works for the GNU C++ compiler. +AC_DEFUN(CYG_AC_PROG_CXX_CROSS, +[AC_BEFORE([$0], [AC_PROG_CXXCPP]) +AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) + +CYG_AC_PROG_GXX_WORKS + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +dnl Check whether -g works, even if CXXFLAGS is set, in case the package +dnl plays around with CXXFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CXXFLAGS="${CXXFLAGS+set}" + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS= + AC_PROG_CXX_G + if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS="$ac_save_CXXFLAGS" + elif test $ac_cv_prog_cxx_g = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-O2" + fi +else + GXX= + test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" +fi +]) + +dnl See if the G++ compiler we found works. +AC_DEFUN(CYG_AC_PROG_GXX_WORKS, +[AC_MSG_CHECKING([whether the G++ compiler ($CXX $CXXFLAGS $LDFLAGS) actually works]) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +dnl Try a test case. We only compile, because it's close to impossible +dnl to get a correct fully linked executable with a cross compiler. For +dnl most cross compilers, this test is bogus. For G++, we can use various +dnl other compile line options to get a decent idea that the cross compiler +dnl actually does work, even though we can't produce an executable without +dnl more info about the target it's being compiled for. This only works +dnl for the GNU C++ compiler. + +dnl Transform the name of the compiler to it's cross variant, unless +dnl CXX is set. This is also what CXX gets set to in the generated +dnl Makefile. +if test x"${CXX}" = xc++ ; then + CXX=`echo gcc | sed -e "${program_transform_name}"` +fi + +dnl Get G++'s full path to libgcc.a +libgccpath=`${CXX} --print-libgcc` + +dnl If we don't have a path with libgcc.a on the end, this isn't G++. +if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then + ac_cv_prog_gxx=yes +else + ac_cv_prog_gxx=no +fi + +dnl If we are using G++, look for the files that need to exist if this +dnl compiler works. +if test x"${ac_cv_prog_gxx}" = xyes ; then + gccfiles=`echo $libgccpath | sed -e 's:/libgcc.a::'` + if test -f ${gccfiles}/specs -a -f ${gccfiles}/cpp -a -f ${gccfiles}/cc1plus; then + gccfiles=yes + else + gccfiles=no + fi + gcclibs=`echo $libgccpath | sed -e 's:lib/gcc-lib/::' -e 's:/libgcc.a::' -e 's,\(.*\)/.*,\1,g'`/lib + if test -d ${gcclibs}/ldscripts -a -f ${gcclibs}/libc.a -a -f ${gcclibs}/libstdc++.a ; then + gcclibs=yes + else + gcclibs=no + fi +fi + +dnl If everything is OK, then we can safely assume the compiler works. +if test x"${gccfiles}" = xno -o x"${gcclibs}" = xno; then + ac_cv_prog_cxx_works=no + AC_MSG_ERROR(${CXX} is a non-working cross compiler) +else + ac_cv_prog_cxx_works=yes +fi + +AC_LANG_RESTORE +AC_MSG_RESULT($ac_cv_prog_cxx_works) +if test x"$ac_cv_prog_cxx_works" = xno; then + AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.]) +fi +AC_MSG_CHECKING([whether the G++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler]) +AC_MSG_RESULT($ac_cv_prog_cxx_cross) +cross_compiling=$ac_cv_prog_cxx_cross +AC_SUBST(CXX) +]) + +dnl ==================================================================== +dnl Find a working GCC cross compiler. This only works for the GNU gcc compiler. +dnl This is based on the macros above for G++. +AC_DEFUN(CYG_AC_PROG_CC_CROSS, +[AC_BEFORE([$0], [AC_PROG_CCPP]) +AC_CHECK_PROGS(CC, cc, gcc) + +CYG_AC_PROG_GCC_WORKS + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GXX= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +dnl See if the GCC compiler we found works. +AC_DEFUN(CYG_AC_PROG_GCC_WORKS, +[AC_MSG_CHECKING([whether the Gcc compiler ($CC $CFLAGS $LDFLAGS) actually works]) +AC_LANG_SAVE +AC_LANG_C +dnl Try a test case. We only compile, because it's close to impossible +dnl to get a correct fully linked executable with a cross +dnl compiler. For most cross compilers, this test is bogus. For G++, +dnl we can use various other compile line options to get a decent idea +dnl that the cross compiler actually does work, even though we can't +dnl produce an executable without more info about the target it's +dnl being compiled for. This only works for the GNU C++ compiler. + +dnl Transform the name of the compiler to it's cross variant, unless +dnl CXX is set. This is also what CC gets set to in the generated Makefile. +if test x"${CC}" = xcc ; then + CC=`echo gcc | sed -e "${program_transform_name}"` +fi + +dnl Get Gcc's full path to libgcc.a +libgccpath=`${CC} --print-libgcc` + +dnl If we don't have a path with libgcc.a on the end, this isn't G++. +if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi + +dnl If we are using Gcc, look for the files that need to exist if this +dnl compiler works. +if test x"${ac_cv_prog_gcc}" = xyes ; then + gccfiles=`echo $libgccpath | sed -e 's:/libgcc.a::'` + if test -f ${gccfiles}/specs -a -f ${gccfiles}/cpp -a -f ${gccfiles}/cc1plus; then + gccfiles=yes + else + gccfiles=no + fi + gcclibs=`echo $libgccpath | sed -e 's:lib/gcc-lib/::' -e 's:/libgcc.a::' -e 's,\(.*\)/.*,\1,g'`/lib + if test -d ${gcclibs}/ldscripts -a -f ${gcclibs}/libc.a -a -f ${gcclibs}/libstdc++.a ; then + gcclibs=yes + else + gcclibs=no + fi +fi + +dnl If everything is OK, then we can safely assume the compiler works. +if test x"${gccfiles}" = xno -o x"${gcclibs}" = xno; then + ac_cv_prog_cc_works=no + AC_MSG_ERROR(${CC} is a non-working cross compiler) +else + ac_cv_prog_cc_works=yes +fi + +AC_LANG_RESTORE +AC_MSG_RESULT($ac_cv_prog_cc_works) +if test x"$ac_cv_prog_cc_works" = xno; then + AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.]) +fi +AC_MSG_CHECKING([whether the Gcc compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler]) +AC_MSG_RESULT($ac_cv_prog_cc_cross) +cross_compiling=$ac_cv_prog_cc_cross +AC_SUBST(CC) +]) + +dnl ==================================================================== +dnl Find the BFD library in the build tree. This is used to access and +dnl manipulate object or executable files. +AC_DEFUN(CYG_AC_PATH_BFD, [ +AC_MSG_CHECKING(for the bfd header in the build tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +dnl Look for the header file +AC_CACHE_VAL(ac_cv_c_bfdh,[ +for i in $dirlist; do + if test -f "$i/bfd/bfd.h" ; then + ac_cv_c_bfdh=`(cd $i/bfd; pwd)` + break + fi +done +]) +if test x"${ac_cv_c_bfdh}" != x; then + BFDHDIR="-I${ac_cv_c_bfdh}" + AC_MSG_RESULT(${ac_cv_c_bfdh}) +else + AC_MSG_RESULT(none) +fi +AC_SUBST(BFDHDIR) + +dnl Look for the library +AC_MSG_CHECKING(for the bfd library in the build tree) +AC_CACHE_VAL(ac_cv_c_bfdlib,[ +for i in $dirlist; do + if test -f "$i/bfd/Makefile" ; then + ac_cv_c_bfdlib=`(cd $i/bfd; pwd)` + fi +done +]) +dnl We list two directories cause bfd now uses libtool +if test x"${ac_cv_c_bfdlib}" != x; then + BFDLIB="-L${ac_cv_c_bfdlib} -L${ac_cv_c_bfdlib}/.libs" + AC_MSG_RESULT(${ac_cv_c_bfdlib}) +else + AC_MSG_RESULT(none) +fi +AC_SUBST(BFDLIB) +]) + +dnl ==================================================================== +dnl Find the libiberty library. This defines many commonly used C +dnl functions that exists in various states based on the underlying OS. +AC_DEFUN(CYG_AC_PATH_LIBERTY, [ +AC_MSG_CHECKING(for the liberty library in the build tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +AC_CACHE_VAL(ac_cv_c_liberty,[ +for i in $dirlist; do + if test -f "$i/libiberty/Makefile" ; then + ac_cv_c_liberty=`(cd $i/libiberty; pwd)` + fi +done +]) +if test x"${ac_cv_c_liberty}" != x; then + LIBERTY="-L${ac_cv_c_liberty}" + AC_MSG_RESULT(${ac_cv_c_liberty}) +else + AC_MSG_RESULT(none) +fi +AC_SUBST(LIBERTY) +]) + +dnl ==================================================================== +dnl Find the opcodes library. This is used to do dissasemblies. +AC_DEFUN(CYG_AC_PATH_OPCODES, [ +AC_MSG_CHECKING(for the opcodes library in the build tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +AC_CACHE_VAL(ac_cv_c_opc,[ +for i in $dirlist; do + if test -f "$i/opcodes/Makefile" ; then + ac_cv_c_opc=`(cd $i/opcodes; pwd)` + fi +done +]) +if test x"${ac_cv_c_opc}" != x; then + OPCODESLIB="-L${ac_cv_c_opc}" + AC_MSG_RESULT(${ac_cv_c_opc}) +else + AC_MSG_RESULT(none) +fi +AC_SUBST(OPCODESLIB) +]) + +dnl ==================================================================== +dnl Look for the DejaGnu header file in the source tree. This file +dnl defines the functions used to testing support. +AC_DEFUN(CYG_AC_PATH_DEJAGNU, [ +AC_MSG_CHECKING(for the testing support files in the source tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +AC_CACHE_VAL(ac_cv_c_dejagnu,[ +for i in $dirlist; do + if test -f "$srcdir/$i/ecc/ecc/infra/testlib/current/include/dejagnu.h" ; then + ac_cv_c_dejagnu=`(cd $srcdir/$i/ecc/ecc/infra/testlib/current/include; pwd)` + fi +done +]) +if test x"${ac_cv_c_dejagnu}" != x; then + DEJAGNUHDIR="-I${ac_cv_c_dejagnu}" + AC_MSG_RESULT(${ac_cv_c_dejagnu}) +else + AC_MSG_RESULT(none) +fi +AC_CACHE_VAL(ac_cv_c_dejagnulib,[ +for i in $dirlist; do + if test -f "$srcdir/$i/infra/testlib/current/lib/hostutil.exp" ; then + ac_cv_c_dejagnulib=`(cd $srcdir/$i/infra/testlib/current/lib; pwd)` + fi +done +]) +if test x"${ac_cv_c_dejagnulib}" != x; then + DEJAGNULIB="${ac_cv_c_dejagnulib}" +else + DEJAGNULIB="" +fi +AC_MSG_CHECKING(for runtest in the source tree) +AC_CACHE_VAL(ac_cv_c_runtest,[ +for i in $dirlist; do + if test -f "$srcdir/$i/dejagnu/runtest" ; then + ac_cv_c_runtest=`(cd $srcdir/$i/dejagnu; pwd)` + fi +done +]) +if test x"${ac_cv_c_runtest}" != x; then + RUNTESTDIR="${ac_cv_c_runtest}" + AC_MSG_RESULT(${ac_cv_c_runtest}) +else + RUNTESTDIR="" + AC_MSG_RESULT(none) +fi +AC_SUBST(RUNTESTDIR) +AC_SUBST(DEJAGNULIB) +AC_SUBST(DEJAGNUHDIR) +]) + +dnl ==================================================================== +dnl Find the libintl library in the build tree. This is for +dnl internationalization support. +AC_DEFUN(CYG_AC_PATH_INTL, [ +AC_MSG_CHECKING(for the intl header in the build tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +dnl Look for the header file +AC_CACHE_VAL(ac_cv_c_intlh,[ +for i in $dirlist; do + if test -f "$i/intl/libintl.h" ; then + ac_cv_c_intlh=`(cd $i/intl; pwd)` + break + fi +done +]) +if test x"${ac_cv_c_intlh}" != x; then + INTLHDIR="-I${ac_cv_c_intlh}" + AC_MSG_RESULT(${ac_cv_c_intlh}) +else + AC_MSG_RESULT(none) +fi +AC_SUBST(INTLHDIR) + +dnl Look for the library +AC_MSG_CHECKING(for the libintl library in the build tree) +AC_CACHE_VAL(ac_cv_c_intllib,[ +for i in $dirlist; do + if test -f "$i/intl/Makefile" ; then + ac_cv_c_intllib=`(cd $i/intl; pwd)` + fi +done +]) +if test x"${ac_cv_c_intllib}" != x; then + INTLLIB="-L${ac_cv_c_intllib} -lintl" + AC_MSG_RESULT(${ac_cv_c_intllib}) +else + AC_MSG_RESULT(none) +fi +AC_SUBST(INTLLIB) +]) + +dnl ==================================================================== +dnl Find the simulator library. +AC_DEFUN(CYG_AC_PATH_SIM, [ +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.. ../../../../../../../../../.." +case "$target_cpu" in + powerpc) target_dir=ppc ;; + sparc*) target_dir=erc32 ;; + mips*) target_dir=mips ;; + *) target_dir=$target_cpu ;; +esac +dnl First look for the header file +AC_MSG_CHECKING(for the simulator header file) +AC_CACHE_VAL(ac_cv_c_simh,[ +for i in $dirlist; do + if test -f "${srcdir}/$i/include/remote-sim.h" ; then + ac_cv_c_simh=`(cd ${srcdir}/$i/include; pwd)` + break + fi +done +]) +if test x"${ac_cv_c_simh}" != x; then + SIMHDIR="-I${ac_cv_c_simh}" + AC_MSG_RESULT(${ac_cv_c_simh}) +else + AC_MSG_RESULT(none) +fi +AC_SUBST(SIMHDIR) + +dnl See whether it's a devo or Foundry branch simulator +AC_MSG_CHECKING(Whether this is a devo simulator ) +AC_CACHE_VAL(ac_cv_c_simdevo,[ + CPPFLAGS="$CPPFLAGS $SIMHDIR" + AC_EGREP_HEADER([SIM_DESC sim_open.*struct _bfd], remote-sim.h, + ac_cv_c_simdevo=yes, + ac_cv_c_simdevo=no) +]) +if test x"$ac_cv_c_simdevo" = x"yes" ; then + AC_DEFINE(HAVE_DEVO_SIM) +fi +AC_MSG_RESULT(${ac_cv_c_simdevo}) +AC_SUBST(HAVE_DEVO_SIM) + +dnl Next look for the library +AC_MSG_CHECKING(for the simulator library) +AC_CACHE_VAL(ac_cv_c_simlib,[ +for i in $dirlist; do + if test -f "$i/sim/$target_dir/Makefile" ; then + ac_cv_c_simlib=`(cd $i/sim/$target_dir; pwd)` + fi +done +]) +if test x"${ac_cv_c_simlib}" != x; then + SIMLIB="-L${ac_cv_c_simlib}" +else + AC_MSG_RESULT(none) + dnl FIXME: this is kinda bogus, cause umtimately the TM will build + dnl all the libraries for several architectures. But for now, this + dnl will work till then. +dnl AC_MSG_CHECKING(for the simulator installed with the compiler libraries) + dnl Transform the name of the compiler to it's cross variant, unless + dnl CXX is set. This is also what CXX gets set to in the generated + dnl Makefile. + CROSS_GCC=`echo gcc | sed -e "s/^/$target/"` + + dnl Get G++'s full path to libgcc.a +changequote(,) + gccpath=`${CROSS_GCC} --print-libgcc | sed -e 's:[a-z0-9A-Z\.\-]*/libgcc.a::' -e 's:lib/gcc-lib/::'`lib +changequote([,]) + if test -f $gccpath/libsim.a -o -f $gccpath/libsim.so ; then + ac_cv_c_simlib="$gccpath/" + SIMLIB="-L${ac_cv_c_simlib}" + AC_MSG_RESULT(${ac_cv_c_simlib}) + else + AM_CONDITIONAL(PSIM, test x$psim = xno) + SIMLIB="" + AC_MSG_RESULT(none) +dnl ac_cv_c_simlib=none + fi +fi +AC_SUBST(SIMLIB) +]) + +dnl ==================================================================== +dnl Find the libiberty library. +AC_DEFUN(CYG_AC_PATH_LIBIBERTY, [ +AC_MSG_CHECKING(for the libiberty library in the build tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +AC_CACHE_VAL(ac_cv_c_libib,[ +for i in $dirlist; do + if test -f "$i/libiberty/Makefile" ; then + ac_cv_c_libib=`(cd $i/libiberty/; pwd)` + fi +done +]) +if test x"${ac_cv_c_libib}" != x; then + LIBIBERTY="-L${ac_cv_c_libib}" + AC_MSG_RESULT(${ac_cv_c_libib}) +else + AC_MSG_RESULT(none) +fi +AC_SUBST(LIBIBERTY) +]) + +dnl ==================================================================== +AC_DEFUN(CYG_AC_PATH_DEVO, [ +AC_MSG_CHECKING(for devo headers in the source tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +AC_CACHE_VAL(ac_cv_c_devoh,[ +for i in $dirlist; do + if test -f "${srcdir}/$i/include/remote-sim.h" ; then + ac_cv_c_devoh=`(cd ${srcdir}/$i/include; pwd)` + fi +done +]) +if test x"${ac_cv_c_devoh}" != x; then + DEVOHDIR="-I${ac_cv_c_devoh}" + AC_MSG_RESULT(${ac_cv_c_devoh}) +else + AC_MSG_RESULT(none) +fi +AC_SUBST(DEVOHDIR) +]) + +dnl ==================================================================== +dnl find the IDE library and headers. +AC_DEFUN(CYG_AC_PATH_IDE, [ +AC_MSG_CHECKING(for IDE headers in the source tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +IDEHDIR= +IDELIB= +AC_CACHE_VAL(ac_cv_c_ideh,[ +for i in $dirlist; do + if test -f "${srcdir}/$i/libide/src/event.h" ; then + ac_cv_c_ideh=`(cd ${srcdir}/$i/libide/src; pwd)`; + fi +done +]) +if test x"${ac_cv_c_ideh}" != x; then + IDEHDIR="-I${ac_cv_c_ideh}" + AC_MSG_RESULT(${ac_cv_c_ideh}) +else + AC_MSG_RESULT(none) +fi + +AC_MSG_CHECKING(for LIBIDE TCL headers in the source tree) +AC_CACHE_VAL(ac_cv_c_idetclh,[ +for i in $dirlist; do + if test -f "${srcdir}/$i/libidetcl/src/idetcl.h" ; then + ac_cv_c_idetclh=`(cd ${srcdir}/$i/libidetcl/src; pwd)`; + fi +done +]) +if test x"${ac_cv_c_idetclh}" != x; then + IDEHDIR="${IDEHDIR} -I${ac_cv_c_idetclh}" + AC_MSG_RESULT(${ac_cv_c_idetclh}) +else + AC_MSG_RESULT(none) +fi + +AC_MSG_CHECKING(for IDE headers in the build tree) +AC_CACHE_VAL(ac_cv_c_ideh2,[ +for i in $dirlist; do + if test -f "$i/libide/src/Makefile" ; then + ac_cv_c_ideh2=`(cd $i/libide/src; pwd)`; + fi +done +]) +if test x"${ac_cv_c_ideh2}" != x; then + IDEHDIR="${IDEHDIR} -I${ac_cv_c_ideh2}" + AC_MSG_RESULT(${ac_cv_c_ideh2}) +else + AC_MSG_RESULT(none) +fi + +dnl look for the library +AC_MSG_CHECKING(for IDE library) +AC_CACHE_VAL(ac_cv_c_idelib,[ +if test x"${ac_cv_c_idelib}" = x ; then + for i in $dirlist; do + if test -f "$i/libide/src/Makefile" ; then + ac_cv_c_idelib=`(cd $i/libide/src; pwd)` + break + fi + done +fi]) +if test x"${ac_cv_c_idelib}" != x ; then + IDELIB="-L${ac_cv_c_idelib}" + AC_MSG_RESULT(${ac_cv_c_idelib}) +else + AC_MSG_RESULT(none) +fi + +dnl find libiddetcl.a if it exists +AC_MSG_CHECKING(for IDE TCL library) +AC_CACHE_VAL(ac_cv_c_idetcllib,[ +if test x"${ac_cv_c_idetcllib}" = x ; then + for i in $dirlist; do + if test -f "$i/libidetcl/src/Makefile" ; then + ac_cv_c_idetcllib=`(cd $i/libidetcl/src; pwd)` + break + fi + done +fi +]) +if test x"${ac_cv_c_idetcllib}" != x ; then + IDELIB="${IDELIB} -L${ac_cv_c_idetcllib}" + IDETCLLIB="-lidetcl" + AC_MSG_RESULT(${ac_cv_c_idetcllib}) +else + AC_MSG_RESULT(none) +fi +AC_SUBST(IDEHDIR) +AC_SUBST(IDELIB) +AC_SUBST(IDETCLLIB) +]) + +dnl ==================================================================== +dnl Find all the ILU headers and libraries +AC_DEFUN(CYG_AC_PATH_ILU, [ +AC_MSG_CHECKING(for ILU kernel headers in the source tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +AC_CACHE_VAL(ac_cv_c_iluh,[ +for i in $dirlist; do + if test -f "${srcdir}/$i/ilu/runtime/kernel/method.h" ; then + ac_cv_c_iluh=`(cd ${srcdir}/$i/ilu/runtime/kernel; pwd)` + fi +done +]) +if test x"${ac_cv_c_iluh}" != x; then + ILUHDIR="-I${ac_cv_c_iluh}" + AC_MSG_RESULT(${ac_cv_c_iluh}) +else + AC_MSG_RESULT(none) +fi + +AC_MSG_CHECKING(for ILU kernel headers in the build tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +AC_CACHE_VAL(ac_cv_c_iluh5,[ +for i in $dirlist; do + if test -f "$i/ilu/runtime/kernel/iluconf.h" ; then + ac_cv_c_iluh5=`(cd $i/ilu/runtime/kernel; pwd)` + fi +done +]) +if test x"${ac_cv_c_iluh5}" != x; then + ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh5}" + AC_MSG_RESULT(${ac_cv_c_iluh5}) +else + AC_MSG_RESULT(none) +fi + +AC_MSG_CHECKING(for ILU C++ headers in the source tree) +AC_CACHE_VAL(ac_cv_c_iluh2,[ +for i in $dirlist; do + if test -f "${srcdir}/$i/ilu/stubbers/cpp/resource.h" ; then + ac_cv_c_iluh2=`(cd ${srcdir}/$i/ilu/stubbers/cpp; pwd)` + fi +done +]) +if test x"${ac_cv_c_iluh2}" != x; then + ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh2}" + AC_MSG_RESULT(${ac_cv_c_iluh2}) +else + AC_MSG_RESULT(none) +fi + +AC_MSG_CHECKING(for ILU C headers) +AC_CACHE_VAL(ac_cv_c_iluh3,[ +for i in $dirlist; do + if test -f "${srcdir}/$i/ilu/stubbers/c/resource.h" ; then + ac_cv_c_iluh3=`(cd ${srcdir}/$i/ilu/stubbers/c ; pwd)` + fi +done +]) +if test x"${ac_cv_c_iluh3}" != x; then + ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh3}" + AC_MSG_RESULT(${ac_cv_c_iluh3}) +else + AC_MSG_RESULT(none) +fi + +AC_MSG_CHECKING(for ILU C runtime headers) +AC_CACHE_VAL(ac_cv_c_iluh4,[ +for i in $dirlist; do + if test -f "${srcdir}/$i/ilu/runtime/c/ilucstub.h" ; then + ac_cv_c_iluh4=`(cd ${srcdir}/$i/ilu/runtime/c ; pwd)` + fi +done +]) +if test x"${ac_cv_c_iluh4}" != x; then + ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh4}" + AC_MSG_RESULT(${ac_cv_c_iluh4}) +else + AC_MSG_RESULT(none) +fi + +AC_CACHE_VAL(ac_cv_c_ilupath,[ +for i in $dirlist; do + if test -f "$i/ilu/Makefile" ; then + ac_cv_c_ilupath=`(cd $i/ilu; pwd)` + break + fi +done +]) +ILUTOP=${ac_cv_c_ilupath} + +AC_MSG_CHECKING(for the ILU library in the build tree) +AC_CACHE_VAL(ac_cv_c_ilulib,[ +if test -f "$ac_cv_c_ilupath/runtime/kernel/Makefile" ; then + ac_cv_c_ilulib=`(cd $ac_cv_c_ilupath/runtime/kernel; pwd)` + AC_MSG_RESULT(found ${ac_cv_c_ilulib}/libilu.a) +else + AC_MSG_RESULT(no) +fi]) + +AC_MSG_CHECKING(for the ILU C++ bindings library in the build tree) +AC_CACHE_VAL(ac_cv_c_ilulib2,[ +if test -f "$ac_cv_c_ilupath/runtime/cpp/Makefile" ; then + ac_cv_c_ilulib2=`(cd $ac_cv_c_ilupath/runtime/cpp; pwd)` + AC_MSG_RESULT(found ${ac_cv_c_ilulib2}/libilu-c++.a) +else + AC_MSG_RESULT(no) +fi]) + +AC_MSG_CHECKING(for the ILU C bindings library in the build tree) +AC_CACHE_VAL(ac_cv_c_ilulib3,[ +if test -f "$ac_cv_c_ilupath/runtime/c/Makefile" ; then + ac_cv_c_ilulib3=`(cd $ac_cv_c_ilupath/runtime/c; pwd)` + AC_MSG_RESULT(found ${ac_cv_c_ilulib3}/libilu-c.a) +else + AC_MSG_RESULT(no) +fi]) + +AC_MSG_CHECKING(for the ILU Tk bindings library in the build tree) +AC_CACHE_VAL(ac_cv_c_ilulib4,[ +if test -f "$ac_cv_c_ilupath/runtime/mainloop/Makefile" ; then + ac_cv_c_ilulib4=`(cd $ac_cv_c_ilupath/runtime/mainloop; pwd)` + AC_MSG_RESULT(found ${ac_cv_c_ilulib4}/libilu-tk.a) +else + AC_MSG_RESULT(no) +fi]) + +if test x"${ac_cv_c_ilulib}" = x -a x"${ac_cv_c_ilulib2}" = x; then + ILUHDIR="" +fi + +if test x"${ac_cv_c_ilulib}" != x -a x"${ac_cv_c_ilulib2}" != x; then + ILULIB="-L${ac_cv_c_ilulib} -L${ac_cv_c_ilulib2} -L${ac_cv_c_ilulib3} -L${ac_cv_c_ilulib4}" +else + ILULIB="" +fi + +if test x"${ILULIB}" = x; then + AC_MSG_CHECKING(for ILU libraries installed with the compiler) + AC_CACHE_VAL(ac_cv_c_ilulib5,[ + NATIVE_GCC=`echo gcc | sed -e "${program_transform_name}"` + + dnl Get G++'s full path to it's libraries + ac_cv_c_ilulib5=`${NATIVE_GCC} --print-libgcc | sed -e 's:lib/gcc-lib/.*::'`lib + if test -f $ac_cv_c_ilulib5/libilu-c.a -o -f $ac_cv_c_ilulib5/libilu-c.so ; then + if test x"${ILUHDIR}" = x; then + ILUHDIR="-I${ac_cv_c_ilulib5}/../include" + fi + ILULIB="-L${ac_cv_c_ilulib5}" + AC_MSG_RESULT(${ac_cv_c_ilulib5}) + else + ac_cv_c_ilulib=none + AC_MSG_RESULT(none) + fi +fi]) +AC_SUBST(ILUHDIR) +AC_SUBST(ILULIB) +AC_SUBST(ILUTOP) +]) + +dnl ==================================================================== +dnl This defines the byte order for the host. We can't use +dnl AC_C_BIGENDIAN, cause we want to create a config file and +dnl substitue the real value, so the header files work right +AC_DEFUN(CYG_AC_C_ENDIAN, [ +AC_MSG_CHECKING(to see if this is a little endian host) +AC_CACHE_VAL(ac_cv_c_little_endian, [ +ac_cv_c_little_endian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +AC_TRY_COMPILE([#include +#include ], [ +#if !BYTE_ORDER || !_BIG_ENDIAN || !_LITTLE_ENDIAN + bogus endian macros +#endif], [# It does; now see whether it defined to _LITTLE_ENDIAN or not. +AC_TRY_COMPILE([#include +#include ], [ +#if BYTE_ORDER != _LITTLE_ENDIAN + not big endian +#endif], ac_cv_c_little_endian=yes, ac_cv_c_little_endian=no) +]) +if test ${ac_cv_c_little_endian} = unknown; then +old_cflags=$CFLAGS +CFLAGS=-g +AC_TRY_RUN([ +main () { + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[0] == 1); +}], +ac_cv_c_little_endian=no, +ac_cv_c_little_endian=yes,[ +dnl Yes, this is ugly, and only used for a canadian cross anyway. This +dnl is just to keep configure from stopping here. +case "${host}" in +changequote(,) + i[3456]86-*-*) ac_cv_c_little_endian=yes ;; + sparc*-*-*) ac_cv_c_little_endian=no ;; +changequote([,]) + *) AC_MSG_WARN(Can't cross compile this test) ;; +esac]) +CFLAGS=$old_cflags +fi]) + +if test x"${ac_cv_c_little_endian}" = xyes; then + AC_DEFINE(LITTLE_ENDIAN_HOST) + ENDIAN="CYG_LSBFIRST"; +else + ENDIAN="CYG_MSBFIRST"; +fi +AC_MSG_RESULT(${ac_cv_c_little_endian}) +AC_SUBST(ENDIAN) +]) + +dnl ==================================================================== +dnl Look for the path to libgcc, so we can use it to directly link +dnl in libgcc.a with LD. +AC_DEFUN(CYG_AC_PATH_LIBGCC, +[AC_MSG_CHECKING([Looking for the path to libgcc.a]) +AC_LANG_SAVE +AC_LANG_C + +dnl Get Gcc's full path to libgcc.a +libgccpath=`${CC} --print-libgcc` + +dnl If we don't have a path with libgcc.a on the end, this isn't G++. +if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi + +dnl +if test x"${ac_cv_prog_gcc}" = xyes ; then + gccpath=`echo $libgccpath | sed -e 's:/libgcc.a::'` + LIBGCC="-L${gccpath}" + AC_MSG_RESULT(${gccpath}) +else + LIBGCC="" + AC_MSG_ERROR(Not using gcc) +fi + +AC_LANG_RESTORE +AC_SUBST(LIBGCC) +]) + +dnl ==================================================================== +dnl Ok, lets find the tcl source trees so we can use the headers +dnl Warning: transition of version 9 to 10 will break this algorithm +dnl because 10 sorts before 9. We also look for just tcl. We have to +dnl be careful that we don't match stuff like tclX by accident. +dnl the alternative search directory is involked by --with-tclinclude +AC_DEFUN(CYG_AC_PATH_TCL, [ + CYG_AC_PATH_TCLH + CYG_AC_PATH_TCLCONFIG + CYG_AC_LOAD_TCLCONFIG +]) +AC_DEFUN(CYG_AC_PATH_TCLH, [ +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +no_tcl=true +AC_MSG_CHECKING(for Tcl headers in the source tree) +AC_ARG_WITH(tclinclude, [ --with-tclinclude directory where tcl headers are], with_tclinclude=${withval}) +AC_CACHE_VAL(ac_cv_c_tclh,[ +dnl first check to see if --with-tclinclude was specified +if test x"${with_tclinclude}" != x ; then + if test -f ${with_tclinclude}/tcl.h ; then + ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)` + elif test -f ${with_tclinclude}/generic/tcl.h ; then + ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; pwd)` + else + AC_MSG_ERROR([${with_tclinclude} directory doesn't contain headers]) + fi +fi + +dnl next check if it came with Tcl configuration file +if test x"${ac_cv_c_tclconfig}" != x ; then + for i in $dirlist; do + if test -f $ac_cv_c_tclconfig/$i/generic/tcl.h ; then + ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/$i/generic; pwd)` + break + fi + done +fi + +dnl next check in private source directory +dnl since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_tclh}" = x ; then + dnl find the top level Tcl source directory + for i in $dirlist; do + if test -n "`ls -dr $srcdir/$i/tcl* 2>/dev/null`" ; then + tclpath=$srcdir/$i + break + fi + done + + dnl find the exact Tcl source dir. We do it this way, cause there + dnl might be multiple version of Tcl, and we want the most recent one. + for i in `ls -dr $tclpath/tcl* 2>/dev/null ` ; do + if test -f $i/generic/tcl.h ; then + ac_cv_c_tclh=`(cd $i/generic; pwd)` + break + fi + done +fi + +dnl check if its installed with the compiler +if test x"${ac_cv_c_tclh}" = x ; then + dnl Get the path to the compiler + ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include + if test -f $ccpath/tcl.h; then + ac_cv_c_tclh=$ccpath + fi +fi + +dnl see if one is installed +if test x"${ac_cv_c_tclh}" = x ; then + AC_MSG_RESULT(none) + AC_CHECK_HEADER(tcl.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="") +else + AC_MSG_RESULT(${ac_cv_c_tclh}) +fi +]) + TCLHDIR="" +if test x"${ac_cv_c_tclh}" = x ; then + AC_MSG_ERROR([Can't find any Tcl headers]) +fi +if test x"${ac_cv_c_tclh}" != x ; then + no_tcl="" + if test x"${ac_cv_c_tclh}" != x"installed" ; then + if test x"${CC}" = xcl ; then + tmp="`cygpath --windows ${ac_cv_c_tclh}`" + ac_cv_c_tclh="`echo $tmp | sed -e s#\\\\\\\\#/#g`" + fi + AC_MSG_RESULT(${ac_cv_c_tclh}) + TCLHDIR="-I${ac_cv_c_tclh}" + fi +fi + +AC_SUBST(TCLHDIR) +]) + +dnl ==================================================================== +dnl Ok, lets find the tcl configuration +AC_DEFUN(CYG_AC_PATH_TCLCONFIG, [ +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +dnl First, look for one uninstalled. +dnl the alternative search directory is invoked by --with-tclconfig +if test x"${no_tcl}" = x ; then + dnl we reset no_tcl in case something fails here + no_tcl=true + AC_ARG_WITH(tclconfig, [ --with-tclconfig directory containing tcl configuration (tclConfig.sh)], + with_tclconfig=${withval}) + AC_MSG_CHECKING([for Tcl configuration script]) + AC_CACHE_VAL(ac_cv_c_tclconfig,[ + + dnl First check to see if --with-tclconfig was specified. + if test x"${with_tclconfig}" != x ; then + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) + fi + fi + + dnl next check if it came with Tcl configuration file in the source tree + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in $dirlist; do + if test -f $srcdir/$i/unix/tclConfig.sh ; then + ac_cv_c_tclconfig=`(cd $srcdir/$i/unix; pwd)` + break + fi + done + fi + dnl check in a few other locations + if test x"${ac_cv_c_tclconfig}" = x ; then + dnl find the top level Tcl source directory + for i in $dirlist; do + if test -n "`ls -dr $i/tcl* 2>/dev/null`" ; then + tclconfpath=$i + break + fi + done + + dnl find the exact Tcl dir. We do it this way, cause there + dnl might be multiple version of Tcl, and we want the most recent one. + for i in `ls -dr $tclconfpath/tcl* 2>/dev/null ` ; do + if test -f $i/unix/tclConfig.sh ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + dnl Check to see if it's installed. We have to look in the $CC path + dnl to find it, cause our $prefix may not match the compilers. + if test x"${ac_cv_c_tclconfig}" = x ; then + dnl Get the path to the compiler + ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib + if test -f $ccpath/tclConfig.sh; then + ac_cv_c_tclconfig=$ccpath + fi + fi + ]) dnl end of cache_val + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCLCONFIG="" + AC_MSG_WARN(Can't find Tcl configuration definitions) + else + no_tcl="" + TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh + AC_MSG_RESULT(${TCLCONFIG}) + fi +fi +AC_SUBST(TCLCONFIG) +]) + +dnl Defined as a separate macro so we don't have to cache the values +dnl from PATH_TCLCONFIG (because this can also be cached). +AC_DEFUN(CYG_AC_LOAD_TCLCONFIG, [ + . $TCLCONFIG + +dnl AC_SUBST(TCL_VERSION) +dnl AC_SUBST(TCL_MAJOR_VERSION) +dnl AC_SUBST(TCL_MINOR_VERSION) +dnl AC_SUBST(TCL_CC) + AC_SUBST(TCL_DEFS) + +dnl not used, don't export to save symbols + AC_SUBST(TCL_LIB_FILE) + AC_SUBST(TCL_LIB_FULL_PATH) + AC_SUBST(TCL_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_PREFIX) + + AC_SUBST(TCL_CFLAGS) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_EXEC_PREFIX) + + AC_SUBST(TCL_SHLIB_CFLAGS) + AC_SUBST(TCL_SHLIB_LD) +dnl don't export, not used outside of configure +dnl AC_SUBST(TCL_SHLIB_LD_LIBS) +dnl AC_SUBST(TCL_SHLIB_SUFFIX) +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_DL_LIBS) + AC_SUBST(TCL_LD_FLAGS) + AC_SUBST(TCL_LD_SEARCH_FLAGS) +dnl don't export, not used outside of configure +dnl AC_SUBST(TCL_COMPAT_OBJS) + AC_SUBST(TCL_RANLIB) + AC_SUBST(TCL_BUILD_LIB_SPEC) + AC_SUBST(TCL_LIB_SPEC) +dnl AC_SUBST(TCL_LIB_VERSIONS_OK) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_SHARED_LIB_SUFFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX) +]) + +dnl ==================================================================== +AC_DEFUN(CYG_AC_PATH_TK, [ + CYG_AC_PATH_TKH + CYG_AC_PATH_TKCONFIG + CYG_AC_LOAD_TKCONFIG +]) +AC_DEFUN(CYG_AC_PATH_TKH, [ +# +# Ok, lets find the tk source trees so we can use the headers +# If the directory (presumably symlink) named "tk" exists, use that one +# in preference to any others. Same logic is used when choosing library +# and again with Tcl. The search order is the best place to look first, then in +# decreasing significance. The loop breaks if the trigger file is found. +# Note the gross little conversion here of srcdir by cd'ing to the found +# directory. This converts the path from a relative to an absolute, so +# recursive cache variables for the path will work right. We check all +# the possible paths in one loop rather than many seperate loops to speed +# things up. +# the alternative search directory is involked by --with-tkinclude +# +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +no_tk=true +AC_MSG_CHECKING(for Tk headers in the source tree) +AC_ARG_WITH(tkinclude, [ --with-tkinclude directory where tk headers are], with_tkinclude=${withval}) +AC_CACHE_VAL(ac_cv_c_tkh,[ +dnl first check to see if --with-tkinclude was specified +if test x"${with_tkinclude}" != x ; then + if test -f ${with_tkinclude}/tk.h ; then + ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)` + elif test -f ${with_tkinclude}/generic/tk.h ; then + ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; pwd)` + else + AC_MSG_ERROR([${with_tkinclude} directory doesn't contain headers]) + fi +fi + +dnl next check if it came with Tk configuration file +if test x"${ac_cv_c_tkconfig}" != x ; then + for i in $dirlist; do + if test -f $ac_cv_c_tkconfig/$i/generic/tk.h ; then + ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/$i/generic; pwd)` + break + fi + done +fi + +dnl next check in private source directory +dnl since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_tkh}" = x ; then + dnl find the top level Tk source directory + for i in $dirlist; do + if test -n "`ls -dr $srcdir/$i/tk* 2>/dev/null`" ; then + tkpath=$srcdir/$i + break + fi + done + + dnl find the exact Tk source dir. We do it this way, cause there + dnl might be multiple version of Tk, and we want the most recent one. + for i in `ls -dr $tkpath/tk* 2>/dev/null ` ; do + if test -f $i/generic/tk.h ; then + ac_cv_c_tkh=`(cd $i/generic; pwd)` + break + fi + done +fi + +dnl see if one is installed +if test x"${ac_cv_c_tkh}" = x ; then + AC_MSG_RESULT(none) + dnl Get the path to the compiler. We do it this way instead of using + dnl AC_CHECK_HEADER, cause this doesn't depend in having X configured. + ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include + if test -f $ccpath/tk.h; then + ac_cv_c_tkh=$ccpath + fi +else + AC_MSG_RESULT(${ac_cv_c_tkh}) +fi +]) + TKHDIR="" +if test x"${ac_cv_c_tkh}" = x ; then + AC_MSG_ERROR([Can't find any Tk headers]) +fi +if test x"${ac_cv_c_tkh}" != x ; then + no_tk="" + if test x"${ac_cv_c_tkh}" != x"installed" ; then + if test x"${CC}" = xcl ; then + tmp="`cygpath --windows ${ac_cv_c_tkh}`" + ac_cv_c_tkh="`echo $tmp | sed -e s#\\\\\\\\#/#g`" + fi + AC_MSG_RESULT([found in ${ac_cv_c_tkh}]) + TKHDIR="-I${ac_cv_c_tkh}" + fi +fi + +AC_SUBST(TKHDIR) +]) + +AC_DEFUN(CYG_AC_PATH_TKCONFIG, [ +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +dnl First, look for one uninstalled. +dnl the alternative search directory is invoked by --with-tkconfig +if test x"${no_tk}" = x ; then + dnl we reset no_tk in case something fails here + no_tk=true + AC_ARG_WITH(tkconfig, [ --with-tkconfig directory containing tk configuration (tkConfig.sh)], + with_tkconfig=${withval}) + AC_MSG_CHECKING([for Tk configuration script]) + AC_CACHE_VAL(ac_cv_c_tkconfig,[ + + dnl First check to see if --with-tkconfig was specified. + if test x"${with_tkconfig}" != x ; then + if test -f "${with_tkconfig}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` + else + AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) + fi + fi + + dnl next check if it came with Tk configuration file in the source tree + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in $dirlist; do + if test -f $srcdir/$i/unix/tkConfig.sh ; then + ac_cv_c_tkconfig=`(cd $srcdir/$i/unix; pwd)` + break + fi + done + fi + dnl check in a few other locations + if test x"${ac_cv_c_tkconfig}" = x ; then + dnl find the top level Tk source directory + for i in $dirlist; do + if test -n "`ls -dr $i/tk* 2>/dev/null`" ; then + tkconfpath=$i + break + fi + done + + dnl find the exact Tk dir. We do it this way, cause there + dnl might be multiple version of Tk, and we want the most recent one. + for i in `ls -dr $tkconfpath/tk* 2>/dev/null ` ; do + if test -f $i/unix/tkConfig.sh ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + dnl Check to see if it's installed. We have to look in the $CC path + dnl to find it, cause our $prefix may not match the compilers. + if test x"${ac_cv_c_tkconfig}" = x ; then + dnl Get the path to the compiler + ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib + if test -f $ccpath/tkConfig.sh; then + ac_cv_c_tkconfig=$ccpath + fi + fi + ]) dnl end of cache_val + + if test x"${ac_cv_c_tkconfig}" = x ; then + TKCONFIG="" + AC_MSG_WARN(Can't find Tk configuration definitions) + else + no_tk="" + TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh + AC_MSG_RESULT(${TKCONFIG}) + fi +fi +AC_SUBST(TKCONFIG) +]) + +dnl Defined as a separate macro so we don't have to cache the values +dnl from PATH_TKCONFIG (because this can also be cached). +AC_DEFUN(CYG_AC_LOAD_TKCONFIG, [ + if test -f "$TKCONFIG" ; then + . $TKCONFIG + fi + + AC_SUBST(TK_VERSION) +dnl not actually used, don't export to save symbols +dnl AC_SUBST(TK_MAJOR_VERSION) +dnl AC_SUBST(TK_MINOR_VERSION) + AC_SUBST(TK_DEFS) + +dnl not used, don't export to save symbols + AC_SUBST(TK_LIB_FILE) + AC_SUBST(TK_LIB_FULL_PATH) + AC_SUBST(TK_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(TK_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TK_EXEC_PREFIX) + AC_SUBST(TK_BUILD_INCLUDES) + AC_SUBST(TK_XINCLUDES) + AC_SUBST(TK_XLIBSW) + AC_SUBST(TK_BUILD_LIB_SPEC) + AC_SUBST(TK_LIB_SPEC) +]) + +dnl ==================================================================== +dnl Ok, lets find the itcl source trees so we can use the headers +dnl the alternative search directory is involked by --with-itclinclude +AC_DEFUN(CYG_AC_PATH_ITCL, [ + CYG_AC_PATH_ITCLH + CYG_AC_PATH_ITCLLIB + CYG_AC_PATH_ITCLSH + CYG_AC_PATH_ITCLMKIDX +]) +AC_DEFUN(CYG_AC_PATH_ITCLH, [ +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +no_itcl=true +AC_MSG_CHECKING(for Itcl headers in the source tree) +AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval}) +AC_CACHE_VAL(ac_cv_c_itclh,[ +dnl first check to see if --with-itclinclude was specified +if test x"${with_itclinclude}" != x ; then + if test -f ${with_itclinclude}/itcl.h ; then + ac_cv_c_itclh=`(cd ${with_itclinclude}; pwd)` + elif test -f ${with_itclinclude}/src/itcl.h ; then + ac_cv_c_itclh=`(cd ${with_itclinclude}/src; pwd)` + else + AC_MSG_ERROR([${with_itclinclude} directory doesn't contain headers]) + fi +fi + +dnl next check if it came with Itcl configuration file +if test x"${ac_cv_c_itclconfig}" != x ; then + for i in $dirlist; do + if test -f $ac_cv_c_itclconfig/$i/src/itcl.h ; then + ac_cv_c_itclh=`(cd $ac_cv_c_itclconfig/$i/src; pwd)` + break + fi + done +fi + +dnl next check in private source directory +dnl since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_itclh}" = x ; then + dnl find the top level Itcl source directory + for i in $dirlist; do + if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then + itclpath=$srcdir/$i + break + fi + done + + dnl find the exact Itcl source dir. We do it this way, cause there + dnl might be multiple version of Itcl, and we want the most recent one. + for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do + if test -f $i/src/itcl.h ; then + ac_cv_c_itclh=`(cd $i/src; pwd)` + break + fi + done +fi + +dnl see if one is installed +if test x"${ac_cv_c_itclh}" = x ; then + AC_MSG_RESULT(none) + AC_CHECK_HEADER(itcl.h, ac_cv_c_itclh=installed, ac_cv_c_itclh="") +else + AC_MSG_RESULT(${ac_cv_c_itclh}) +fi +]) + ITCLHDIR="" +if test x"${ac_cv_c_itclh}" = x ; then + AC_MSG_ERROR([Can't find any Itcl headers]) +fi +if test x"${ac_cv_c_itclh}" != x ; then + no_itcl="" + if test x"${ac_cv_c_itclh}" != x"installed" ; then + AC_MSG_RESULT(${ac_cv_c_itclh}) + ITCLHDIR="-I${ac_cv_c_itclh}" + fi +fi + +AC_SUBST(ITCLHDIR) +]) + +dnl Ok, lets find the itcl library +dnl First, look for one uninstalled. +dnl the alternative search directory is invoked by --with-itcllib +AC_DEFUN(CYG_AC_PATH_ITCLLIB, [ +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +if test x"${no_itcl}" = x ; then + dnl we reset no_itcl incase something fails here + no_itcl=true + AC_ARG_WITH(itcllib, + [ --with-itcllib directory where the itcl library is], + with_itcllib=${withval}) + AC_MSG_CHECKING([for Itcl library]) + AC_CACHE_VAL(ac_cv_c_itcllib,[ + dnl First check to see if --with-itcllib was specified. + if test x"${with_itcllib}" != x ; then + if test -f "${with_itcllib}/libitcl$TCL_SHARED_LIB_SUFFIX" ; then + ac_cv_c_itcllib=`(cd ${with_itcllib}; pwd)`/libitcl$TCL_SHARED_LIB_SUFFIX + else + if test -f "${with_itcllib}/libitcl$TCL_UNSHARED_LIB_SUFFIX"; then + ac_cv_c_itcllib=`(cd ${with_itcllib}; pwd)`/libitcl$TCL_UNSHARED_LIB_SUFFIX + fi + fi + fi + dnl then check for a Itcl library. Since these are uninstalled, + dnl use the simple lib name root. + if test x"${ac_cv_c_itcllib}" = x ; then + dnl find the top level Itcl build directory + for i in $dirlist; do + if test -n "`ls -dr $i/itcl* 2>/dev/null`" ; then + itclpath=$i/itcl + break + fi + done + dnl Itcl 7.5 and greater puts library in subdir. Look there first. + if test -f "$itclpath/src/libitcl.$TCL_SHLIB_SUFFIX" ; then + ac_cv_c_itcllib=`(cd $itclpath/src; pwd)` + elif test -f "$itclpath/src/libitcl.a"; then + ac_cv_c_itcllib=`(cd $itclpath/src; pwd)` + fi + fi + dnl check in a few other private locations + if test x"${ac_cv_c_itcllib}" = x ; then + for i in ${dirlist}; do + if test -n "`ls -dr ${srcdir}/$i/itcl* 2>/dev/null`" ; then + itclpath=${srcdir}/$i + break + fi + done + for i in `ls -dr ${itclpath}/itcl* 2>/dev/null` ; do + dnl Itcl 7.5 and greater puts library in subdir. Look there first. + if test -f "$i/src/libitcl$TCL_SHLIB_SUFFIX" ; then + ac_cv_c_itcllib=`(cd $i/src; pwd)` + break + elif test -f "$i/src/libitcl.a"; then + ac_cv_c_itcllib=`(cd $i/src; pwd)` + break + fi + done + fi + + dnl see if one is conveniently installed with the compiler + if test x"${ac_cv_c_itcllib}" = x ; then + dnl Get the path to the compiler + ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib + dnl Itcl 7.5 and greater puts library in subdir. Look there first. + if test -f "${ccpath}/libitcl$TCL_SHLIB_SUFFIX" ; then + ac_cv_c_itcllib=`(cd ${ccpath}; pwd)` + elif test -f "${ccpath}/libitcl.a"; then + ac_cv_c_itcllib=`(cd ${ccpath}; pwd)` + fi + fi + ]) + if test x"${ac_cv_c_itcllib}" = x ; then + ITCLLIB="" + AC_MSG_WARN(Can't find Itcl library) + else + ITCLLIB="-L${ac_cv_c_itcllib}" + AC_MSG_RESULT(${ac_cv_c_itcllib}) + no_itcl="" + fi +fi + +AC_PROVIDE([$0]) +AC_SUBST(ITCLLIB) +]) + + +dnl ==================================================================== +dnl Ok, lets find the itcl source trees so we can use the itcl_sh script +dnl the alternative search directory is involked by --with-itclinclude +AC_DEFUN(CYG_AC_PATH_ITCLSH, [ +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +no_itcl=true +AC_MSG_CHECKING(for the itcl_sh script) +AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval}) +AC_CACHE_VAL(ac_cv_c_itclsh,[ +dnl first check to see if --with-itclinclude was specified +if test x"${with_itclinclude}" != x ; then + if test -f ${with_itclinclude}/itcl_sh ; then + ac_cv_c_itclsh=`(cd ${with_itclinclude}; pwd)` + elif test -f ${with_itclinclude}/src/itcl_sh ; then + ac_cv_c_itclsh=`(cd ${with_itclinclude}/src; pwd)` + else + AC_MSG_ERROR([${with_itclinclude} directory doesn't contain itcl_sh]) + fi +fi + +dnl next check in private source directory +dnl since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_itclsh}" = x ; then + dnl find the top level Itcl source directory + for i in $dirlist; do + if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then + itclpath=$srcdir/$i + break + fi + done + + dnl find the exact Itcl source dir. We do it this way, cause there + dnl might be multiple version of Itcl, and we want the most recent one. + for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do + if test -f $i/src/itcl_sh ; then + ac_cv_c_itclsh=`(cd $i/src; pwd)`/itcl_sh + break + fi + done +fi + +dnl see if one is installed +if test x"${ac_cv_c_itclsh}" = x ; then + AC_MSG_RESULT(none) + AC_PATH_PROG(ac_cv_c_itclsh, itcl_sh) +else + AC_MSG_RESULT(${ac_cv_c_itclsh}) +fi +]) + +if test x"${ac_cv_c_itclsh}" = x ; then + AC_MSG_ERROR([Can't find the itcl_sh script]) +fi +if test x"${ac_cv_c_itclsh}" != x ; then + no_itcl="" + AC_MSG_RESULT(${ac_cv_c_itclsh}) + ITCLSH="${ac_cv_c_itclsh}" +fi +AC_SUBST(ITCLSH) +]) + + +dnl ==================================================================== +dnl Ok, lets find the itcl source trees so we can use the itcl_sh script +dnl the alternative search directory is involked by --with-itclinclude +AC_DEFUN(CYG_AC_PATH_ITCLMKIDX, [ +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +no_itcl=true +AC_MSG_CHECKING(for itcl_mkindex.tcl script) +AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval}) +AC_CACHE_VAL(ac_cv_c_itclmkidx,[ +dnl first check to see if --with-itclinclude was specified +if test x"${with_itclinclude}" != x ; then + if test -f ${with_itclinclude}/itcl_sh ; then + ac_cv_c_itclmkidx=`(cd ${with_itclinclude}; pwd)` + elif test -f ${with_itclinclude}/src/itcl_sh ; then + ac_cv_c_itclmkidx=`(cd ${with_itclinclude}/src; pwd)` + else + AC_MSG_ERROR([${with_itclinclude} directory doesn't contain itcl_sh]) + fi +fi + +dnl next check in private source directory +dnl since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_itclmkidx}" = x ; then + dnl find the top level Itcl source directory + for i in $dirlist; do + if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then + itclpath=$srcdir/$i + break + fi + done + + dnl find the exact Itcl source dir. We do it this way, cause there + dnl might be multiple version of Itcl, and we want the most recent one. + for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do + if test -f $i/library/itcl_mkindex.tcl ; then + ac_cv_c_itclmkidx=`(cd $i/library; pwd)`/itcl_mkindex.tcl + break + fi + done +fi +if test x"${ac_cv_c_itclmkidx}" = x ; then + dnl Get the path to the compiler + ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/share + dnl Itcl 7.5 and greater puts library in subdir. Look there first. + for i in `ls -dr $ccpath/itcl* 2>/dev/null ` ; do + if test -f $i/itcl_mkindex.tcl ; then + ac_cv_c_itclmkidx=`(cd $i; pwd)`/itcl_mkindex.tcl + break + fi + done +fi +]) + +if test x"${ac_cv_c_itclmkidx}" = x ; then + AC_MSG_ERROR([Can't find the itcl_mkindex.tcl script]) +fi +if test x"${ac_cv_c_itclmkidx}" != x ; then + no_itcl="" + AC_MSG_RESULT(${ac_cv_c_itclmkidx}) + ITCLMKIDX="${ac_cv_c_itclmkidx}" +else + AC_MSG_RESULT(none) +fi +AC_SUBST(ITCLMKIDX) +]) + +dnl ==================================================================== +dnl Ok, lets find the tix source trees so we can use the headers +dnl the alternative search directory is involked by --with-tixinclude +AC_DEFUN(CYG_AC_PATH_TIX, [ + CYG_AC_PATH_TIXH + CYG_AC_PATH_TIXLIB +]) +AC_DEFUN(CYG_AC_PATH_TIXH, [ +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +no_tix=true +AC_MSG_CHECKING(for Tix headers in the source tree) +AC_ARG_WITH(tixinclude, [ --with-tixinclude directory where tix headers are], with_tixinclude=${withval}) +AC_CACHE_VAL(ac_cv_c_tixh,[ +dnl first check to see if --with-tixinclude was specified +if test x"${with_tixinclude}" != x ; then + if test -f ${with_tixinclude}/tix.h ; then + ac_cv_c_tixh=`(cd ${with_tixinclude}; pwd)` + elif test -f ${with_tixinclude}/generic/tix.h ; then + ac_cv_c_tixh=`(cd ${with_tixinclude}/generic; pwd)` + else + AC_MSG_ERROR([${with_tixinclude} directory doesn't contain headers]) + fi +fi + +dnl next check if it came with Tix configuration file +if test x"${ac_cv_c_tixconfig}" != x ; then + for i in $dirlist; do + if test -f $ac_cv_c_tixconfig/$i/generic/tix.h ; then + ac_cv_c_tixh=`(cd $ac_cv_c_tixconfig/$i/generic; pwd)` + break + fi + done +fi + +dnl next check in private source directory +dnl since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_tixh}" = x ; then + dnl find the top level Tix source directory + for i in $dirlist; do + if test -n "`ls -dr $srcdir/$i/tix* 2>/dev/null`" ; then + tixpath=$srcdir/$i + break + fi + done + + dnl find the exact Tix source dir. We do it this way, cause there + dnl might be multiple version of Tix, and we want the most recent one. + for i in `ls -dr $tixpath/tix* 2>/dev/null ` ; do + if test -f $i/generic/tix.h ; then + ac_cv_c_tixh=`(cd $i/generic; pwd)` + break + fi + done +fi + +dnl see if one is installed +if test x"${ac_cv_c_tixh}" = x ; then + AC_MSG_RESULT(none) + dnl Get the path to the compiler + + dnl Get the path to the compiler. We do it this way instead of using + dnl AC_CHECK_HEADER, cause this doesn't depend in having X configured. + ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include + if test -f $ccpath/tix.h; then + ac_cv_c_tixh=installed + fi +else + AC_MSG_RESULT(${ac_cv_c_tixh}) +fi +]) +if test x"${ac_cv_c_tixh}" = x ; then + AC_MSG_ERROR([Can't find any Tix headers]) +fi +if test x"${ac_cv_c_tixh}" != x ; then + no_tix="" + AC_MSG_RESULT(${ac_cv_c_tixh}) + if test x"${ac_cv_c_tixh}" != x"installed" ; then + TIXHDIR="-I${ac_cv_c_tixh}" + fi +fi + +AC_SUBST(TIXHDIR) +]) + +AC_DEFUN(CYG_AC_PATH_TIXCONFIG, [ +# +# Ok, lets find the tix configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-tixconfig +# + +if test x"${no_tix}" = x ; then + # we reset no_tix in case something fails here + no_tix=true + AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)], + with_tixconfig=${withval}) + AC_MSG_CHECKING([for Tix configuration]) + AC_CACHE_VAL(ac_cv_c_tixconfig,[ + + # First check to see if --with-tixconfig was specified. + if test x"${with_tixconfig}" != x ; then + if test -f "${with_tixconfig}/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd ${with_tixconfig}; pwd)` + else + AC_MSG_ERROR([${with_tixconfig} directory doesn't contain tixConfig.sh]) + fi + fi + + # then check for a private Tix library + if test x"${ac_cv_c_tixconfig}" = x ; then + for i in \ + ../tix \ + `ls -dr ../tix[[4]]* 2>/dev/null` \ + ../../tix \ + `ls -dr ../../tix[[4]]* 2>/dev/null` \ + ../../../tix \ + `ls -dr ../../../tix[[4]]* 2>/dev/null` ; do + if test -f "$i/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_tixconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + if test -f "$i/tixConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_tixconfig}" = x ; then + for i in \ + ${srcdir}/../tix \ + `ls -dr ${srcdir}/../tix[[4-9]]* 2>/dev/null` ; do + if test -f "$i/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_tixconfig}" = x ; then + TIXCONFIG="# no Tix configs found" + AC_MSG_WARN(Can't find Tix configuration definitions) + else + no_tix= + TIXCONFIG=${ac_cv_c_tixconfig}/tixConfig.sh + AC_MSG_RESULT(found $TIXCONFIG) + fi +fi + +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_TIXCONFIG (because this can also be cached). +AC_DEFUN(CYG_AC_LOAD_TIXCONFIG, [ + if test -f "$TIXCONFIG" ; then + . $TIXCONFIG + fi + + AC_SUBST(TIX_BUILD_LIB_SPEC) + AC_SUBST(TIX_LIB_FULL_PATH) +]) + +AC_DEFUN(CYG_AC_PATH_ITCLCONFIG, [ +# +# Ok, lets find the itcl configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-itclconfig +# + +if test x"${no_itcl}" = x ; then + # we reset no_itcl in case something fails here + no_itcl=true + AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)], + with_itclconfig=${withval}) + AC_MSG_CHECKING([for Itcl configuration]) + AC_CACHE_VAL(ac_cv_c_itclconfig,[ + + # First check to see if --with-itclconfig was specified. + if test x"${with_itclconfig}" != x ; then + if test -f "${with_itclconfig}/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd ${with_itclconfig}; pwd)` + else + AC_MSG_ERROR([${with_itclconfig} directory doesn't contain itclConfig.sh]) + fi + fi + + # then check for a private itcl library + if test x"${ac_cv_c_itclconfig}" = x ; then + for i in \ + ../itcl/itcl \ + `ls -dr ../itcl/itcl[[3]]* 2>/dev/null` \ + ../../itcl/itcl \ + `ls -dr ../../itcl/itcl[[3]]* 2>/dev/null` \ + ../../../itcl/itcl \ + `ls -dr ../../../itcl/itcl[[3]]* 2>/dev/null` ; do + if test -f "$i/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_itclconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + if test -f "$i/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_itclconfig}" = x ; then + for i in \ + ${srcdir}/../itcl/itcl \ + `ls -dr ${srcdir}/../itcl/itcl[[3]]* 2>/dev/null` ; do + if test -f "$i/itcl/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_itclconfig}" = x ; then + ITCLCONFIG="# no itcl configs found" + AC_MSG_WARN(Can't find itcl configuration definitions) + else + no_itcl= + ITCLCONFIG=${ac_cv_c_itclconfig}/itclConfig.sh + AC_MSG_RESULT(found $ITCLCONFIG) + fi +fi + +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_ITCLCONFIG (because this can also be cached). +AC_DEFUN(CYG_AC_LOAD_ITCLCONFIG, [ + if test -f "$ITCLCONFIG" ; then + . $ITCLCONFIG + fi + + AC_SUBST(ITCL_BUILD_LIB_SPEC) + AC_SUBST(ITCL_SH) + AC_SUBST(ITCL_LIB_FILE) + AC_SUBST(ITCL_LIB_FULL_PATH) + +]) + + +AC_DEFUN(CYG_AC_PATH_ITKCONFIG, [ +# +# Ok, lets find the itk configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-itkconfig +# + +if test x"${no_itk}" = x ; then + # we reset no_itk in case something fails here + no_itk=true + AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)], + with_itkconfig=${withval}) + AC_MSG_CHECKING([for Itk configuration]) + AC_CACHE_VAL(ac_cv_c_itkconfig,[ + + # First check to see if --with-itkconfig was specified. + if test x"${with_itkconfig}" != x ; then + if test -f "${with_itkconfig}/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd ${with_itkconfig}; pwd)` + else + AC_MSG_ERROR([${with_itkconfig} directory doesn't contain itkConfig.sh]) + fi + fi + + # then check for a private itk library + if test x"${ac_cv_c_itkconfig}" = x ; then + for i in \ + ../itcl/itk \ + `ls -dr ../itcl/itk[[3]]* 2>/dev/null` \ + ../../itcl/itk \ + `ls -dr ../../itcl/itk[[3]]* 2>/dev/null` \ + ../../../itcl/itk \ + `ls -dr ../../../itcl/itk[[3]]* 2>/dev/null` ; do + if test -f "$i/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_itkconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + if test -f "$i/itcl/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_itkconfig}" = x ; then + for i in \ + ${srcdir}/../itcl/itk \ + `ls -dr ${srcdir}/../itcl/itk[[3]]* 2>/dev/null` ; do + if test -f "$i/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_itkconfig}" = x ; then + ITCLCONFIG="# no itk configs found" + AC_MSG_WARN(Can't find itk configuration definitions) + else + no_itk= + ITKCONFIG=${ac_cv_c_itkconfig}/itkConfig.sh + AC_MSG_RESULT(found $ITKCONFIG) + fi +fi + +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_ITKCONFIG (because this can also be cached). +AC_DEFUN(CYG_AC_LOAD_ITKCONFIG, [ + if test -f "$ITKCONFIG" ; then + . $ITKCONFIG + fi + + AC_SUBST(ITK_BUILD_LIB_SPEC) + AC_SUBST(ITK_LIB_FILE) + AC_SUBST(ITK_LIB_FULL_PATH) +]) + + +dnl ==================================================================== +dnl Ok, lets find the libgui source trees so we can use the headers +dnl the alternative search directory is involked by --with-libguiinclude +AC_DEFUN(CYG_AC_PATH_LIBGUI, [ + CYG_AC_PATH_LIBGUIH + CYG_AC_PATH_LIBGUILIB +]) +AC_DEFUN(CYG_AC_PATH_LIBGUIH, [ +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../..../../../../../../../../../../.." +no_libgui=true +AC_MSG_CHECKING(for Libgui headers in the source tree) +AC_ARG_WITH(libguiinclude, [ --with-libguiinclude directory where libgui headers are], with_libguiinclude=${withval}) +AC_CACHE_VAL(ac_cv_c_libguih,[ +dnl first check to see if --with-libguiinclude was specified +if test x"${with_libguiinclude}" != x ; then + if test -f ${with_libguiinclude}/guitcl.h ; then + ac_cv_c_libguih=`(cd ${with_libguiinclude}; pwd)` + elif test -f ${with_libguiinclude}/src/guitcl.h ; then + ac_cv_c_libguih=`(cd ${with_libguiinclude}/src; pwd)` + else + AC_MSG_ERROR([${with_libguiinclude} directory doesn't contain headers]) + fi +fi + +dnl next check if it came with Libgui configuration file +if test x"${ac_cv_c_libguiconfig}" != x ; then + for i in $dirlist; do + if test -f $ac_cv_c_libguiconfig/$i/src/guitcl.h ; then + ac_cv_c_libguih=`(cd $ac_cv_c_libguiconfig/$i/src; pwd)` + break + fi + done +fi + +dnl next check in private source directory +dnl since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_libguih}" = x ; then + dnl find the top level Libgui source directory + for i in $dirlist; do + if test -n "`ls -dr $srcdir/$i/libgui* 2>/dev/null`" ; then + libguipath=$srcdir/$i + break + fi + done + + dnl find the exact Libgui source dir. We do it this way, cause there + dnl might be multiple version of Libgui, and we want the most recent one. + for i in `ls -dr $libguipath/libgui* 2>/dev/null ` ; do + if test -f $i/src/guitcl.h ; then + ac_cv_c_libguih=`(cd $i/src; pwd)` + break + fi + done +fi + +dnl see if one is installed +if test x"${ac_cv_c_libguih}" = x ; then + AC_MSG_RESULT(none) + AC_CHECK_HEADER(guitcl.h, ac_cv_c_libguih=installed, ac_cv_c_libguih="") +fi +]) +LIBGUIHDIR="" +if test x"${ac_cv_c_libguih}" = x ; then + AC_MSG_WARN([Can't find any Libgui headers]) +fi +if test x"${ac_cv_c_libguih}" != x ; then + no_libgui="" + if test x"${ac_cv_c_libguih}" != x"installed" ; then + LIBGUIHDIR="-I${ac_cv_c_libguih}" + fi +fi +AC_MSG_RESULT(${ac_cv_c_libguih}) +AC_SUBST(LIBGUIHDIR) +]) + +dnl ==================================================================== +dnl find the GUI library +AC_DEFUN(CYG_AC_PATH_LIBGUILIB, [ +AC_MSG_CHECKING(for GUI library in the build tree) +dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.." +dnl look for the library +AC_MSG_CHECKING(for GUI library) +AC_CACHE_VAL(ac_cv_c_libguilib,[ +if test x"${ac_cv_c_libguilib}" = x ; then + for i in $dirlist; do + if test -f "$i/libgui/src/Makefile" ; then + ac_cv_c_libguilib=`(cd $i/libgui/src; pwd)` + break + fi + done +fi +]) +if test x"${ac_cv_c_libguilib}" != x ; then + GUILIB="${GUILIB} -L${ac_cv_c_libguilib}" + LIBGUILIB="-lgui" + AC_MSG_RESULT(${ac_cv_c_libguilib}) +else + AC_MSG_RESULT(none) +fi + +AC_SUBST(GUILIB) +AC_SUBST(LIBGUILIB) +]) diff --git a/gnu/dist/toolchain/config/mh-i370pic b/gnu/dist/toolchain/config/mh-i370pic new file mode 100644 index 000000000000..35cf2c8ee4e3 --- /dev/null +++ b/gnu/dist/toolchain/config/mh-i370pic @@ -0,0 +1 @@ +PICFLAG=-fPIC diff --git a/gnu/dist/toolchain/config/mpw/ChangeLog b/gnu/dist/toolchain/config/mpw/ChangeLog index 551beca4b38a..3cdefbf7a750 100644 --- a/gnu/dist/toolchain/config/mpw/ChangeLog +++ b/gnu/dist/toolchain/config/mpw/ChangeLog @@ -1,19 +1,3 @@ -Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com) - - * gcc-2.95.2 Released. - -Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com) - - * gcc-2.95.1 Released. - -Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com) - - * gcc-2.95 Released. - -Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com) - - * gcc-2.95 Released. - Tue Nov 26 12:34:12 1996 Stan Shebs * g-mpw-make.sed: Fix some comments. diff --git a/gnu/dist/toolchain/config/mt-aix43 b/gnu/dist/toolchain/config/mt-aix43 new file mode 100644 index 000000000000..9eb750c29661 --- /dev/null +++ b/gnu/dist/toolchain/config/mt-aix43 @@ -0,0 +1,4 @@ +# AIX 4.3 and above requires -X32_64 flag to all ar and nm commands +# to handle both 32-bit and 64-bit objects. +AR_FOR_TARGET=ar -X32_64 +NM_FOR_TARGET=nm -X32_64 diff --git a/gnu/dist/toolchain/config/mt-d30v b/gnu/dist/toolchain/config/mt-d30v new file mode 100644 index 000000000000..d34b774b3f68 --- /dev/null +++ b/gnu/dist/toolchain/config/mt-d30v @@ -0,0 +1,4 @@ +# Build libraries optimizing for space, not speed. +# Turn off warnings about symbols named the same as registers + CFLAGS_FOR_TARGET = -g -Os -Wa,-C + CXXFLAGS_FOR_TARGET = -g -Os -Wa,-C diff --git a/gnu/dist/toolchain/config/mt-i370pic b/gnu/dist/toolchain/config/mt-i370pic new file mode 100644 index 000000000000..35b8c9e4dc23 --- /dev/null +++ b/gnu/dist/toolchain/config/mt-i370pic @@ -0,0 +1 @@ +PICFLAG_FOR_TARGET=-fPIC diff --git a/gnu/dist/toolchain/config/mt-wince b/gnu/dist/toolchain/config/mt-wince new file mode 100644 index 000000000000..cc7d67b58898 --- /dev/null +++ b/gnu/dist/toolchain/config/mt-wince @@ -0,0 +1,10 @@ +# For Windows CE, we need to build the program that converts, copies, +# and renames the platform SDK files into gcc directories. + +EXTRA_TARGET_HOST_ALL_MODULES:=$(EXTRA_TARGET_HOST_ALL_MODULES) all-utils +EXTRA_TARGET_HOST_INSTALL_MODULES:=$(EXTRA_TARGET_HOST_INSTALL_MODULES) install-utils + +all-utils : all-libiberty + +install-utils : all-libiberty + diff --git a/gnu/dist/toolchain/configure b/gnu/dist/toolchain/configure index a7d3cb8b1e2f..3e7d8655ac57 100755 --- a/gnu/dist/toolchain/configure +++ b/gnu/dist/toolchain/configure @@ -3,7 +3,7 @@ ### WARNING: this file contains embedded tabs. Do not run untabify on this file. # Configuration script -# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 1997 +# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -86,7 +86,7 @@ subdirs= target_alias=NOTARGET target_makefile_frag= undefs=NOUNDEFS -version="$Revision: 1.22 $" +version="$Revision: 1.5 $" x11=default bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' @@ -576,6 +576,7 @@ case "${srcdir}" in fi esac + # default exec_prefix case "${exec_prefixoption}" in "") exec_prefix="\$(prefix)" ;; @@ -586,12 +587,12 @@ esac # the gcc version number changes. if [ "${with_gcc_version_trigger+set}" = set ]; then gcc_version_trigger="$with_gcc_version_trigger" - gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${with_gcc_version_trigger}` + gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'` else # If gcc's sources are available, define the trigger file. if [ -f ${topsrcdir}/gcc/version.c ] ; then gcc_version_trigger=${topsrcdir}/gcc/version.c - gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${gcc_version_trigger}` + gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'` case "$arguments" in *--with-gcc-version-trigger=$gcc_version_trigger* ) ;; @@ -654,8 +655,8 @@ case "${TMPDIR}" in *) ;; esac -# keep this filename short for &%*%$*# 14 char file names -tmpfile=${TMPDIR}/cONf$$ +# keep this filename short for &%*%$*# 14 char file names and 8+3 file names +tmpfile=${TMPDIR}/cNf$$ # Note that under many versions of sh a trap handler for 0 will *override* any # exit status you explicitly specify! At this point, the only non-error exit # is at the end of the script; these actions are duplicated there, minus @@ -901,6 +902,9 @@ do test -n "$DEFAULT_LEX" && break done +# BINUTILS LOCAL: This is included in the default CFLAGS when using gcc. +warn_cflags="-W -Wall" + if [ "${build}" != "${host}" ]; then # If we are doing a Canadian Cross, in which the host and build systems # are not the same, we set reasonable default values for the tools. @@ -934,7 +938,7 @@ t loop AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as} BISON=${BISON-bison} CC=${CC-${host_alias}-gcc} - CFLAGS=${CFLAGS-"-g -O2"} + CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"} CXX=${CXX-${host_alias}-c++} CXXFLAGS=${CXXFLAGS-"-g -O2"} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} @@ -1014,10 +1018,10 @@ else CC="gcc" echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then - CFLAGS=${CFLAGS-"-g -O2"} + CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"} CXXFLAGS=${CXXFLAGS-"-g -O2"} else - CFLAGS=${CFLAGS-"-O2"} + CFLAGS=${CFLAGS-"-O2 ${warn_cflags}"} CXXFLAGS=${CXXFLAGS-"-O2"} fi rm -f conftest* @@ -1034,10 +1038,10 @@ else *gcc) echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then - CFLAGS=${CFLAGS-"-g -O2"} + CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"} CXXFLAGS=${CXXFLAGS-"-g -O2"} else - CFLAGS=${CFLAGS-"-O2"} + CFLAGS=${CFLAGS-"-O2 ${warn_cflags}"} CXXFLAGS=${CXXFLAGS-"-O2"} fi rm -f conftest* @@ -1062,14 +1066,12 @@ case "$host" in enable_gdbtk=no ;; *msdosdjgpp*) enable_gdbtk=no ;; - *cygwin32*) - enable_gdbtk=no ;; esac # FIXME: This should be in configure.in, not configure # Determine whether gdb needs tk/tcl or not. if [ "$enable_gdbtk" != "no" ]; then - GDB_TK="all-tcl all-tk all-itcl all-tix" + GDB_TK="all-tcl all-tk all-itcl all-tix all-libgui" else GDB_TK="" fi @@ -1403,18 +1405,19 @@ EOF s%^CXXFLAGS[ ]*=.*$%CXXFLAGS = ${CXXFLAGS}% }" \ -e "s|^SHELL[ ]*=.*$|SHELL = ${config_shell}|" \ - -e "s:^GDB_TK[ ]*=.*$:GDB_TK = ${GDB_TK}:" \ -e "s|^srcdir[ ]*=.*$|srcdir = ${makesrcdir}|" \ -e "s/ //" \ -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \ -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \ -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \ -e "s|^tooldir[ ]*=.*$|tooldir = ${tooldir}|" \ - -e "s|^build_tooldir[ ]*=.*$|build_tooldir = ${tooldir}|" \ -e "s:^DEFAULT_YACC[ ]*=.*$:DEFAULT_YACC = ${DEFAULT_YACC}:" \ -e "s:^DEFAULT_LEX[ ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \ -e "s:^DEFAULT_M4[ ]*=.*$:DEFAULT_M4 = ${DEFAULT_M4}:" \ ${subdir}/Makefile.tem >> ${Makefile} + + sed -e "s:^GDB_TK[ ]*=.*$:GDB_TK = ${GDB_TK}:" ${Makefile} >${Makefile}.tem + mv -f ${Makefile}.tem ${Makefile} # If this is a Canadian Cross, preset the values of many more # tools. diff --git a/gnu/dist/toolchain/configure.in b/gnu/dist/toolchain/configure.in index 7265f49a87f7..8171c53cdf00 100644 --- a/gnu/dist/toolchain/configure.in +++ b/gnu/dist/toolchain/configure.in @@ -14,7 +14,7 @@ ## For more information on these two systems, check out the documentation ## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi). -# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc. +# Copyright (C) 1992-99, 2000 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ # these libraries are used by various programs built for the host environment # -host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tclX itcl tix libgui" +host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tcl8.1 tk8.1 tclX itcl tix libgui" if [ "${enable_gdbgui}" = "yes" ] ; then host_libs="${host_libs} libgui" @@ -50,8 +50,7 @@ fi # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to # know that we are building the simulator. -host_tools="texinfo byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip" - +host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip" # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) @@ -62,14 +61,7 @@ target_libs="target-libiberty \ target-libio \ target-librx \ target-libstdc++ \ - target-libg++ \ - target-libf2c \ - target-libchill \ - target-libjava \ - target-zlib \ - target-boehm-gc \ - target-qthreads \ - target-libobjc" + target-libg++" # these tools are built using the target libs, and are intended to run only # in the target environment @@ -195,7 +187,7 @@ case "${host}" in i[3456]86-*-msdosdjgpp*) host_makefile_frag="${host_makefile_frag} config/mh-djgpp" ;; - *-cygwin32*) + *-cygwin*) host_makefile_frag="${host_makefile_frag} config/mh-cygwin" ;; *-mingw32*) @@ -231,9 +223,6 @@ case "${host}" in *-*-lynxos*) host_makefile_frag="${host_makefile_frag} config/mh-lynxos" ;; - *-*-aix4.[3456789]* | *-*-aix[56789].*) - host_makefile_frag="${host_makefile_frag} config/mh-aix43" - ;; *-*-sysv4*) host_makefile_frag="${host_makefile_frag} config/mh-sysv4" ;; @@ -293,12 +282,15 @@ if [ x${shared} = xyes ]; then hppa*-*-*) host_makefile_frag="${host_makefile_frag} config/mh-papic" ;; - i[3456]86-*-cygwin32*) - # We don't want -fPIC on cygwin32. + i[3456]86-*-cygwin*) + # We don't want -fPIC on Cygwin. ;; i[3456]86-*-*) host_makefile_frag="${host_makefile_frag} config/mh-x86pic" ;; + i370-*-*) + host_makefile_frag="${host_makefile_frag} config/mh-i370pic" + ;; sparc64-*-*) host_makefile_frag="${host_makefile_frag} config/mh-sparcpic" ;; @@ -337,9 +329,15 @@ case "${target}" in powerpc-*-netware*) target_makefile_frag="${target_makefile_frag} config/mt-netware" ;; - *-*-linux-gnu) + *-*-linux-gnu*) target_makefile_frag="${target_makefile_frag} config/mt-linux" ;; + *-*-aix4.[3456789]* | *-*-aix[56789].*) + target_makefile_frag="${target_makefile_frag} config/mt-aix43" + ;; + mips*-*-pe | sh*-*-pe | *arm-wince-pe) + target_makefile_frag="${target_makefile_frag} config/mt-wince" + ;; esac # If --enable-target-optspace always use -Os instead of -O2 to build @@ -349,7 +347,10 @@ case "${enable_target_optspace}:${target}" in yes:*) target_makefile_frag="${target_makefile_frag} config/mt-ospace" ;; - :m32r-*) + :d30v-*) + target_makefile_frag="${target_makefile_frag} config/mt-d30v" + ;; + :m32r-* | :d10v-* | :fr30-*) target_makefile_frag="${target_makefile_frag} config/mt-ospace" ;; no:* | :*) @@ -508,8 +509,8 @@ case "${host}" in configdirs="$configdirs dosrel" ;; i[3456]86-*-mingw32*) configdirs="$configdirs dosrel" ;; - *-cygwin32*) - configdirs="$configdirs dosrel" ;; + *-cygwin*) + configdirs="$configdirs libtermcap dosrel" ;; esac # Remove more programs from consideration, based on the host or @@ -527,16 +528,13 @@ case "${host}" in ;; i[3456]86-*-mingw32*) # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv" - noconfigdirs="expect dejagnu cvs autoconf automake send-pr gprof rcs guile perl texinfo apache inet libtool" + noconfigdirs="expect dejagnu cvs autoconf automake send-pr rcs guile perl texinfo apache inet libtool" ;; - *-*-cygwin32) - noconfigdirs="autoconf automake send-pr gprof rcs guile perl apache inet" - ;; - *-*-windows*) -# This is only used to build WinGDB... -# note that powerpc-eabi depends on sim configured before gdb. - configdirs="bfd libiberty opcodes readline sim gdb" - target_configdirs= + i[3456]86-*-beos*) + noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" + ;; + *-*-cygwin*) + noconfigdirs="autoconf automake send-pr rcs guile perl texinfo apache inet" ;; *-*-netbsd*) noconfigdirs="rcs" @@ -576,6 +574,21 @@ case "${target}" in # newlib is not 64 bit ready noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; + sh*-*-pe|mips*-*-pe|*arm-wince-pe) + noconfigdirs="$noconfigdirs target-libjava target-libffi target-zlib" + noconfigdirs="$noconfigdirs target-boehm-gc target-qthreads target-examples" + noconfigdirs="$noconfigdirs target-librx target-libiberty texinfo send-pr" + noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim" + noconfigdirs="$noconfigdirs expect dejagnu" + # the C++ libraries don't build on top of CE's C libraries + noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio" + skipdirs="$skipdirs target-newlib" + case "${host}" in + *-*-cygwin*) ;; # keep gdb and readline + *) noconfigdirs="$noconfigdirs gdb readline target-libio target-libstdc++ target-libg++" + ;; + esac + ;; arc-*-*) noconfigdirs="$noconfigdirs target-libgloss" ;; @@ -584,18 +597,18 @@ case "${target}" in ;; arm-*-coff*) noconfigdirs="$noconfigdirs target-libgloss" + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-cygmon" + fi ;; arm-*-elf*) noconfigdirs="$noconfigdirs target-libgloss" if [ x${is_cross_compiler} != xno ] ; then - target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + target_configdirs="${target_configdirs} target-bsp target-cygmon" fi ;; arm-*-oabi*) noconfigdirs="$noconfigdirs target-libgloss" - if [ x${is_cross_compiler} != xno ] ; then - target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" - fi ;; c4x-*-*) noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss" @@ -603,19 +616,48 @@ case "${target}" in thumb-*-coff) noconfigdirs="$noconfigdirs target-libgloss" ;; + thumb-*-elf) + noconfigdirs="$noconfigdirs target-libgloss" + ;; + thumb-*-oabi) + noconfigdirs="$noconfigdirs target-libgloss" + ;; + strongarm-*-elf) + noconfigdirs="$noconfigdirs target-libgloss" + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-cygmon" + fi + ;; + strongarm-*-coff) + noconfigdirs="$noconfigdirs target-libgloss" + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-cygmon" + fi + ;; + thumb-*-pe) + noconfigdirs="$noconfigdirs target-libgloss" + ;; arm-*-riscix*) noconfigdirs="$noconfigdirs ld target-libgloss" ;; d10v-*-*) - noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio target-libgloss" + noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio" + ;; + d30v-*-*) + ;; + fr30-*-elf*) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + fi ;; h8300*-*-* | \ h8500-*-*) noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss" ;; hppa*-*-*elf* | \ + hppa*-*-linux-gnu* | \ hppa*-*-lites*) - # Do configure ld/binutils/gas for this case. + # Do configure ld/binutils/gas for the above cases. ;; hppa*-*-*) # HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach @@ -627,14 +669,15 @@ case "${target}" in esac noconfigdirs="$noconfigdirs ld shellutils" ;; + i[3456]86-*-coff | i[3456]86-*-elf) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-libstub target-cygmon" + fi + ;; i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*) # but don't build gdb noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx" ;; - *-*-linux*) - # linux has rx in libc - skipdirs="$skipdirs target-librx" - ;; i[3456]86-*-mingw32*) target_configdirs="$target_configdirs target-mingw" noconfigdirs="$noconfigdirs expect target-libgloss" @@ -646,15 +689,15 @@ case "${target}" in ;; esac ;; - *-*-cygwin32*) - target_configdirs="$target_configdirs target-winsup" - noconfigdirs="$noconfigdirs target-gperf target-libgloss" + *-*-cygwin*) + target_configdirs="$target_configdirs target-libtermcap target-winsup" + noconfigdirs="$noconfigdirs target-libgloss" # always build newlib. skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` - # Can't build gdb for cygwin32 if not native. + # Can't build gdb for Cygwin if not native. case "${host}" in - *-*-cygwin32*) ;; # keep gdb tcl tk expect etc. + *-*-cygwin*) ;; # keep gdb tcl tk expect etc. *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv" ;; esac @@ -671,10 +714,7 @@ case "${target}" in noconfigdirs="$noconfigdirs gprof target-libgloss" ;; i[3456]86-*-solaris2*) - # The linker does static linking correctly, but the Solaris C library - # has bugs such that some important functions won't work when statically - # linked. (See man pages for getpwuid, for example.) - noconfigdirs="$noconfigdirs ld target-libgloss" + noconfigdirs="$noconfigdirs target-libgloss" ;; i[3456]86-*-sysv4*) # The SYSV4 C compiler doesn't handle Emacs correctly @@ -685,6 +725,19 @@ case "${target}" in # but that's okay since emacs doesn't work anyway noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss" ;; + i[3456]86-*-beos*) + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss" + ;; + m68k-*-elf*) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-cygmon" + fi + ;; + m68k-*-coff*) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-cygmon" + fi + ;; mn10200-*-*) noconfigdirs="$noconfigdirs" if [ x${is_cross_compiler} != xno ] ; then @@ -694,13 +747,16 @@ case "${target}" in mn10300-*-*) noconfigdirs="$noconfigdirs" if [ x${is_cross_compiler} != xno ] ; then - target_configdirs="${target_configdirs} target-libstub target-cygmon" + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" fi ;; powerpc-*-aix*) # copied from rs6000-*-* entry - noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss" - # This is needed until gcc and ld are fixed to work together. + # The configure and build of ld are currently disabled because + # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least) + # The symptom is that GDBtk 4.18 fails at startup with a segfault + # if linked by GNU ld, but not if linked by the native ld. + noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss ld" use_gnu_ld=no ;; powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe) @@ -713,14 +769,22 @@ case "${target}" in powerpcle-*-solaris*) noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv" ;; + powerpc-*-eabi) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + fi + ;; rs6000-*-lynxos*) # The CVS server code doesn't work on the RS/6000 # Newlib makes problems for libg++ in crosses. noconfigdirs="$noconfigdirs target-newlib gprof cvssrc" ;; rs6000-*-aix*) - noconfigdirs="$noconfigdirs gprof" - # This is needed until gcc and ld are fixed to work together. + # The configure and build of ld are currently disabled because + # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least) + # The symptom is that GDBtk 4.18 fails at startup with a segfault + # if linked by GNU ld, but not if linked by the native ld. + noconfigdirs="$noconfigdirs gprof ld" use_gnu_ld=no ;; rs6000-*-*) @@ -735,9 +799,14 @@ case "${target}" in noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss" ;; mips*-*-irix6*) - # The GNU assembler and linker do not support IRIX 6. + # The GNU assembler does not support IRIX 6. # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work) - noconfigdirs="$noconfigdirs ld gas gprof emacs target-libgloss" + noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss" + ;; + mips*-*-linux*) + noconfigdirs="$noconfigdirs gprof" + # linux has rx in libc + skipdirs="$skipdirs target-librx" ;; mips*-dec-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss" @@ -747,7 +816,7 @@ case "${target}" in ;; mipstx39-*-*) noconfigdirs="$noconfigdirs gprof" # same as generic mips - target_configdirs="${target_configdirs} target-libstub target-cygmon" + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" ;; mips*-*-*) noconfigdirs="$noconfigdirs gprof" @@ -774,9 +843,9 @@ case "${target}" in target_configdirs="${target_configdirs} target-libstub target-cygmon" fi ;; - sparclite-*-aout*) + sparclite-*-*) if [ x${is_cross_compiler} != xno ] ; then - target_configdirs="${target_configdirs} target-libstub target-cygmon" + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" fi ;; sparc-*-sunos4*) @@ -792,12 +861,22 @@ case "${target}" in v850-*-*) noconfigdirs="$noconfigdirs target-libgloss" ;; + v850e-*-*) + noconfigdirs="$noconfigdirs target-libgloss" + ;; + v850ea-*-*) + noconfigdirs="$noconfigdirs target-libgloss" + ;; vax-*-vms) noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss" ;; vax-*-*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; + *-*-linux*) + # linux has rx in libc + skipdirs="$skipdirs target-librx" + ;; *-*-lynxos*) # Newlib makes problems for libg++ in crosses. noconfigdirs="$noconfigdirs target-newlib target-libgloss" diff --git a/gnu/dist/toolchain/etc/Makefile.in b/gnu/dist/toolchain/etc/Makefile.in index c4900829c25f..eedc8c9c1ac2 100644 --- a/gnu/dist/toolchain/etc/Makefile.in +++ b/gnu/dist/toolchain/etc/Makefile.in @@ -31,8 +31,14 @@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ -MAKEINFO = makeinfo -TEXI2DVI = texi2dvi +MAKEINFO = `if [ -f ../texinfo/makeinfo/makeinfo ]; \ + then echo ../texinfo/makeinfo/makeinfo; \ + else echo makeinfo; fi` +TEXI2DVI = `if [ -f ../texinfo/util/texi2dvi ]; \ + then echo ../texinfo/util/texi2dvi; \ + else echo texi2dvi; fi` +TEXI2HTML = texi2html +DVIPS = dvips # Where to find texinfo.tex to format documentation with TeX. TEXIDIR = $(srcdir)/../texinfo @@ -40,8 +46,8 @@ TEXIDIR = $(srcdir)/../texinfo #### Host, target, and site specific Makefile fragments come in here. ### -INFOFILES = standards.info -DVIFILES = standards.dvi +INFOFILES = standards.info configure.info +DVIFILES = standards.dvi configure.dvi all: @@ -49,15 +55,42 @@ install: uninstall: -info: $(INFOFILES) - -install-info: info - if test ! -f standards.info ; then cd $(srcdir); fi; \ - for i in standards.info*; do \ - $(INSTALL_DATA) $$i $(infodir)/$$i; \ +info: + for f in $(INFOFILES); do \ + if test -f $(srcdir)/`echo $$f | sed -e 's/.info$$/.texi/'`; then \ + if $(MAKE) "MAKEINFO=$(MAKEINFO)" $$f; then \ + true; \ + else \ + exit 1; \ + fi; \ + fi; \ done -dvi: $(DVIFILES) +install-info: info + $(SHELL) $(srcdir)/../mkinstalldirs $(infodir) + if test ! -f standards.info; then cd $(srcdir); fi; \ + if test -f standards.info; then \ + for i in standards.info*; do \ + $(INSTALL_DATA) $$i $(infodir)/$$i; \ + done; \ + fi + if test ! -f configure.info; then cd $(srcdir); fi; \ + if test -f configure.info; then \ + for i in configure.info*; do \ + $(INSTALL_DATA) $$i $(infodir)/$$i; \ + done; \ + fi + +dvi: + for f in $(DVIFILES); do \ + if test -f $(srcdir)/`echo $$f | sed -e 's/.dvi$$/.texi/'`; then \ + if $(MAKE) "TEXI2DVI=$(TEXI2DVI)" $$f; then \ + true; \ + else \ + exit 1; \ + fi; \ + fi; \ + done standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi $(MAKEINFO) --no-split -I$(srcdir) -o standards.info $(srcdir)/standards.texi @@ -65,10 +98,45 @@ standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi standards.dvi: $(srcdir)/standards.texi TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/standards.texi +standards.ps: standards.dvi + $(DVIPS) standards.dvi -o standards.ps + +# makeinfo requires images to be in the current directory. +configure.info: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin + rm -f configdev.txt configbuild.txt + cp $(srcdir)/configdev.tin configdev.txt + cp $(srcdir)/configbuild.tin configbuild.txt + $(MAKEINFO) -I$(srcdir) -o configure.info $(srcdir)/configure.texi + rm -f configdev.txt configbuild.txt + +# texi2dvi wants both the .txt and the .eps files. +configure.dvi: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin $(srcdir)/configdev.ein $(srcdir)/configbuild.ein + rm -f configdev.txt configbuild.txt + cp $(srcdir)/configdev.tin configdev.txt + cp $(srcdir)/configbuild.tin configbuild.txt + rm -f configdev.eps configbuild.eps + cp $(srcdir)/configdev.ein configdev.eps + cp $(srcdir)/configbuild.ein configbuild.eps + TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/configure.texi + rm -f configdev.txt configbuild.txt + rm -f configdev.eps configbuild.eps + +# dvips requires images to be in the current directory +configure.ps: configure.dvi $(srcdir)/configdev.ein $(srcdir)/configbuild.ein + rm -f configdev.eps configbuild.eps + cp $(srcdir)/configdev.ein configdev.eps + cp $(srcdir)/configbuild.ein configbuild.eps + $(DVIPS) configure.dvi -o configure.ps + rm -f configdev.eps configbuild.eps + +configure.html: $(srcdir)/configure.texi + $(TEXI2HTML) -split_chapter $(srcdir)/configure.texi clean: rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs + rm -f configdev.txt configbuild.txt configdev.eps configbuild.eps + rm -f configdev.jpg configbuild.jpg mostlyclean: clean diff --git a/gnu/dist/toolchain/etc/configbuild.ein b/gnu/dist/toolchain/etc/configbuild.ein new file mode 100644 index 000000000000..7a0e214f2d52 --- /dev/null +++ b/gnu/dist/toolchain/etc/configbuild.ein @@ -0,0 +1,149 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: configbuild.fig +%%Creator: fig2dev Version 3.1 Patchlevel 1 +%%CreationDate: Fri Jun 12 20:13:16 1998 +%%For: ian@tito.cygnus.com (Ian Lance Taylor) +%%Orientation: Portrait +%%BoundingBox: 0 0 322 173 +%%Pages: 0 +%%BeginSetup +%%IncludeFeature: *PageSize Letter +%%EndSetup +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {} def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +-62.0 226.0 translate +1 -1 scale + +/clp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/l {lineto} bind def +/m {moveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def +%%EndProlog + +$F2psBegin +10 setmiterlimit + 0.06000 0.06000 sc +7.500 slw +% Polyline +n 1050 900 m 2100 900 l 2100 1425 l 1050 1425 l clp gs col-1 s gr +% Polyline +n 1500 1425 m 1500 2100 l gs col-1 s gr +n 1530.00 1980.00 m 1500.00 2100.00 l 1470.00 1980.00 l 1500.50 1980.50 l 1530.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 1500 2625 m 1500 3300 l gs col-1 s gr +n 1530.00 3180.00 m 1500.00 3300.00 l 1470.00 3180.00 l 1500.50 3180.50 l 1530.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 2925 900 m 3825 900 l 3825 1425 l 2925 1425 l clp gs col-1 s gr +% Polyline +n 1155 2100 m 1050 2100 1050 2520 105 arcto 4 {pop} repeat 1050 2625 2220 2625 105 arcto 4 {pop} repeat 2325 2625 2325 2205 105 arcto 4 {pop} repeat 2325 2100 1155 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 2850 2100 m 4125 2100 l 4125 2625 l 2850 2625 l clp gs col-1 s gr +% Polyline +n 3375 1425 m 3375 2100 l gs col-1 s gr +n 3405.00 1980.00 m 3375.00 2100.00 l 3345.00 1980.00 l 3375.50 1980.50 l 3405.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 5100 900 m 6300 900 l 6300 1350 l 5100 1350 l clp gs col-1 s gr +% Polyline +n 5625 1350 m 5625 2100 l gs col-1 s gr +n 5655.00 1980.00 m 5625.00 2100.00 l 5595.00 1980.00 l 5625.50 1980.50 l 5655.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 5205 2100 m 5100 2100 5100 2520 105 arcto 4 {pop} repeat 5100 2625 6270 2625 105 arcto 4 {pop} repeat 6375 2625 6375 2205 105 arcto 4 {pop} repeat 6375 2100 5205 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 5625 2625 m 5625 3300 l gs col-1 s gr +n 5655.00 3180.00 m 5625.00 3300.00 l 5595.00 3180.00 l 5625.50 3180.50 l 5655.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 5100 3300 m 6225 3300 l 6225 3750 l 5100 3750 l clp gs col-1 s gr +% Polyline + [1 50.0] 50.000000 setdash +n 2850 2400 m 2325 2400 l gs col-1 s gr [] 0 setdash +n 2445.00 2430.00 m 2325.00 2400.00 l 2445.00 2370.00 l 2445.50 2400.50 l 2445.00 2430.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline + [1 50.0] 50.000000 setdash +n 4125 2400 m 5100 2400 l gs col-1 s gr [] 0 setdash +n 4980.00 2370.00 m 5100.00 2400.00 l 4980.00 2430.00 l 4980.50 2400.50 l 4980.00 2370.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 1050 3300 m 1950 3300 l 1950 3750 l 1050 3750 l clp gs col-1 s gr +/Times-Roman findfont 180.00 scalefont setfont +1200 1200 m +gs 1 -1 sc (config.in) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3000 1200 m +gs 1 -1 sc (configure) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3000 2400 m +gs 1 -1 sc (config.status) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +1200 2400 m +gs 1 -1 sc (config.status) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +1200 3600 m +gs 1 -1 sc (config.h) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5250 1200 m +gs 1 -1 sc (Makefile.in) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5250 2400 m +gs 1 -1 sc (config.status) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5250 3600 m +gs 1 -1 sc (Makefile) col-1 show gr +$F2psEnd +restore diff --git a/gnu/dist/toolchain/etc/configbuild.fig b/gnu/dist/toolchain/etc/configbuild.fig new file mode 100644 index 000000000000..747592d3d623 --- /dev/null +++ b/gnu/dist/toolchain/etc/configbuild.fig @@ -0,0 +1,50 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 1050 900 2100 900 2100 1425 1050 1425 1050 900 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1500 1425 1500 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1500 2625 1500 3300 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 2925 900 3825 900 3825 1425 2925 1425 2925 900 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 2325 2625 2325 2100 1050 2100 1050 2625 2325 2625 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 2850 2100 4125 2100 4125 2625 2850 2625 2850 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3375 1425 3375 2100 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 5100 900 6300 900 6300 1350 5100 1350 5100 900 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 5625 1350 5625 2100 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 6375 2625 6375 2100 5100 2100 5100 2625 6375 2625 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 5625 2625 5625 3300 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 5100 3300 6225 3300 6225 3750 5100 3750 5100 3300 +2 1 2 1 -1 7 0 0 -1 3.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 2850 2400 2325 2400 +2 1 2 1 -1 7 0 0 -1 3.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 4125 2400 5100 2400 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 1050 3300 1950 3300 1950 3750 1050 3750 1050 3300 +4 0 -1 0 0 0 12 0.0000000 4 180 645 1200 1200 config.in\001 +4 0 -1 0 0 0 12 0.0000000 4 180 705 3000 1200 configure\001 +4 0 -1 0 0 0 12 0.0000000 4 180 990 3000 2400 config.status\001 +4 0 -1 0 0 0 12 0.0000000 4 180 990 1200 2400 config.status\001 +4 0 -1 0 0 0 12 0.0000000 4 180 600 1200 3600 config.h\001 +4 0 -1 0 0 0 12 0.0000000 4 135 855 5250 1200 Makefile.in\001 +4 0 -1 0 0 0 12 0.0000000 4 180 990 5250 2400 config.status\001 +4 0 -1 0 0 0 12 0.0000000 4 135 675 5250 3600 Makefile\001 diff --git a/gnu/dist/toolchain/etc/configbuild.jin b/gnu/dist/toolchain/etc/configbuild.jin new file mode 100644 index 0000000000000000000000000000000000000000..44cd9397aa168d404e3218ea65166d1bcde072d6 GIT binary patch literal 11123 zcmdUV1z42by7oH^Fw%(9HIzXqAs{VE83;(1bULJfh&UjEN=OMvx1i(*3|-PG9W!*N zq#!kO#xKslr8^{jZ-dh&h-JB*zKC~qn#D*zx60Dy2G0E-5$ z1E&ZHA%p~{AP@)<(J5lmvt*Q9fCmDD@$kU}1o-$kYA;+rfPb2RicR1e z;Tbg(2)ol+L7%XcQyg-LI%@Tv4Nf6b=VwI3G_-W|3|!~VU%1FEd__c5?5g*(s4nOj&|S=-pUJalz)f8_Dl_qm_{i3o z0s-LP*}{GQ&e#dQPUHB(!^a2XL%#C`!gI$p@M(MkHUUDaYibY^r!(w=KBvygg{2_s zh&Y7QH>gdWdx&W`g{QbSzq9rmXTQeSvww-R|77g{@Pz_M!64k_flmW6z#i&Cp3t>! zSaG041sXkOk_o%HFXNtLcq2u9SwoeYlNith1LSX>yFJu`9I>ISj*jh;zDZSKfte!s zC+2tX&x2)Hz!yD%k&tEF`S*|%hfLRyp==V#hc2yMDsK4#E83s;!ve^4@*$n!_jS<_ zeDWd?x<~#jp!R3eVG+E91x_6(GWFFj*wS3Cs1v$z$g<37Os`}TX)4B%%ewKxCTaU? z9(;0l4-35RCOoG0!3}VW!2&XR3m6Iq__wuxBTd&MEe<=6X&$c9@>mj>vN~(AL8}CN zoW46$IH)tYqnZATU0O0;z=ad7VKaVP?;B$SEzMS?P~*GNN@s;eUAh|$l!{Q_@iZ*( zT;etsNXm7=0+5oLBR6l+#T<%n*NZ;y9}LNCczR-iX6yd}M0p&IPZ^8)B$@N>qwd>< zjiPO~J4vtrY@9g{fwpkWo+mrD78OiW`VHni3kJ>yL>-+TS+lws}A4@R0SevNmpBFmO?U zQ`p{`zUoTiV#kTMv+VSW%iJ<<6>dQpde-~x{!vG`^q2a*EWG)W88QyV-t*OmUP0A{ zy~C4Z?5U$d1jB1xon@n=R3GRjXQ&_8p=|Xh#zt+$A8NU|v)qUXEaqVZl5?I-vP6v}uEW?1jx*e=)4K<4I$K(luRgazT>{wCsPVd9~^albo;> z97QeV^H)&MMJ|u|F!AgRpvz##~-n<{g5uPuCoH z3_mmr(bQ>}gnsrOR_o6bn+>GVL&m+Ad}WrUHzsNQdIi62PIJiljBl;QEXz!oL2^mW zz!CL3eQP~fkjUWHND+yX7gR2)&tHN`p>f89)RXCWF2V^62*(ooaE zG>0$&w!lPczy;us1_n3DY~dqueR&C3AfsTgYT#=^NZ4*gDc{k))~P2;cpl-RWAdN1 z#Kgc6x-0@%Ae5`**ze)`F`s|1r$S|QKcD>?Rnr5#QJqe*#d9+JW~Z&VLE8dzpt*z; zU)BVt7Q*-gWSpH7UsY3z9qFci+iwmcbNzgsIiVzd@0&Oy!(tr}$8Y3h)$z<0 zwgr_AD=5Zuf+gxut2AyjLtqs(f~W`w4n^m+ZCyipBA`i-MJRFDe_uIUoh2G@&>mC1a198akKD8D{B?rHlp8Mjw&I=HPexR7JP z)bZ&y>;ZWugqbI3Q|fhYX55;Bew^Wzxgpcak5&2w9DYwbXJt?fN;exAgpJc7$Fo@y z7CCy0?&66FR_>{2y*kUmUDX^RgX(@7Q3_5Y{Z%tw^>`2)N)Gl!KtdK`@I*O<#N!Kj zai#~&5@Y9iRK$Z@P(s0GF^~_V@=79)dga$6`kY(I3eWh&(dvPQahm2ORf$*1bZ`4a zW(KR@aEzcP1;euqf~X)CDI?NxDI+?qOsBmPxn8mR#DsGiQG-Q0(Ap%WGj2kDT>t?E z1-!+f5xz@(_m~}-dr-TvcjSMhjZ=LMEYQniJ8{A`UPvaTV1~C!Z(cfnmRGZLPwUwD z(F#U+?-hKN8Ygh6u_cROu;QlZZph28x#ZJ*t3%=slNF}#EVvEn^OsYETO7u zHuMY?n#3{DRDogCJ76Tl?V9!HHf1O?=i~Va%4KobsH1*8j5?=alpYHV?yqy&rc*QO zKQRYLtekhwpS2x7-zyB0(X1$|_Nn=pN;P(!Da-tJP--NnNm8nBP`H3WW3=xTFK&Gv zv^FAk?{?qnDooub!8FFiCTygs9ua%-ntJj_0gF~S^h*1rls<-A%*>P4P>xSd!tT9& z9tpRhMTe2{Ik8PP{Fa!}Ea}?_DEKLyX7w2ntmb1r+|z`*P2W}@#adJQZW8)UON>4Jvixc2rl$?O z5J|tD9*naA_6#nOlm(1|k;_g&+wowV|*1lP2` z9X8^?`MvzL35(w9#^d7Sl!~=pkHq^U((S?3Dxzi!hr^%Slcw{0Kb3pUhfPVHzgxa8^wop!S(u-^Vk+0>j#BIAI;h zep+@%9Nj1`sV#y$unchl8;uz#^2Wv^1az%DWV!i<@xU|hmt>g@seN`o(_(>citAXQ zuA}BCP!TP89}CDzQQ%y zKAG&Gc5~<`Vx0=NY3>y)Ab*AR!6y6|*pWG6YR3XC#YuT})5mu8sHn)}h?M$Wv@Wc2 zV$DY1a)+ma)snu+B`5$`SxgN8F8tAIH$#qm_-a;pGT}=PuGHwVoaj!x|(!IUZDbwPFcN%K=YQ}}^R4%8bBm&Ssu}C;kAR2luvuOLBMHAdL zQ|s@j5<-s78&P6`ldKvk6g7^wc#5dZ1i|Eo6`ZyR%y9A_1bv$4Q2qYW-R@W29G5QXpI0T#dn z7v&!Or;zz*a+zlWt9!od6UrH2w!!{m0=a z)c_ZBzOI=~dK8VR)4qRjG5e`E@rBfX+Ad#`nN41t*d?yPnKfi&jSg+nmg+-?Ljs%@ zFQRY$)oJ}D$UnK$l9eBM$->F*kH?J{z!QHXu924Z!BB}7>P}TXT9G;Z-MMme33JO( z(;FmEb7DWCIRw{0Ex^qD3uz9d$y2{Q#GfG^DKsH}1v#S2$CMvOFTtq`9QLfbnTkJ2 zP6Xv*0WfM@_ZzE1plafQ=U}n2J$QuNmaB zG}~u7)QPz%WyQt+yjq^1?uU#p)2=VOyL&n|X!Yv5V=J_37c|Nv&k`u(c~i^Qf-`LY zg#?%h@>00U=q`%&+LpuD#=i5#qJkdx#QbG0tv6j3c{!5i`*@FEXuxhLJ6;;n6FbGv zU})U+vL&3^e%m>lQU^Rgi>K)6guK2$~p5SjV3 z)CrinZugu_ z#{q|-&?Bziuby|A9t|Dh%z;7dc-P8mw^y~5dD8h;jE?onbIs&*aFW*z+VGQu681g@`TbA$NkBBrl10qUaVq!p_M|STy&7btCYqRje z#%_8wN3?2*$Vb^rDw%ZQS_(GR&AVzuASI%Zq>fgOFRL<-z4`5)UhWn4V)tAx8E&5& z<9kik%gtAR+3@w~DmtOFjyvTwxqwzv)w_(U#9uzCAs1 ztrc^of6`gp-M4s{ca<-XFg}%p@7%b;>pArN$8td`P>{K#l~h4JQ%G#~x5Q?xzRuk= zzRtYZtrdiku2Jsr=}$G5TdZqjoLr`4442ixm@N(FkG0G@;>b9cj0ANuxj{ooj;j^Q zk*UOGqwc;zq)hRfz8bVm(hQzx9^s*)g~WXl)Q8dcXMjU#b#fxUEuZ*sMtYP}2y=Su zf_Luf!%qG|38nB6m}wNoT#K?pP+fy@7Zz-EQQ?-o7B_^jDIwVw^#pZgrqj;d9nVnS zjgd0A)O__9APDP1D-*}_` zD)hLUNDPSeN_r*CCqH?M&rYSxW2~3@*%DJrOG-RH1?NS4pKeOKu!0SdY%A)v{ivKd zUgQ}UHf_(VN3(3i)A$iCUCJyw;?rq$CQOrj;F5gdx3u0lOvzV)QDzI(EqlX!NQRJyOgq+tx3^TibvKK!W_WG@xaufnxl1)9L+`;QJ^ z%~R>Tkz@*_0NWy+4Dw@ayVToFL_c2tbT&beig|g0NatFR>Yk|pU zH`G+@zu{j3$J0PBYC;}G)Je1S7cqL!s)`^&3hQ8G#YMT|4G90P5py**IfJ#}_SL$2 zlLCPMQ8Pw1YGRkVuVx3yfJ-~+a7h^z8uO{#9TQcrx8}sX|F$pzc{41J_{p-{Tyy81 zwo{km1cxzeG?eDThrjFRFt}N5$-4jxPq%xPB%V;_wCy!8>Jl&7G7On(Aqe2E_`Cig zs{EM1t7!B043n8%nf3-xCS2W_7Ra_lK>N-h(}29c>34~lhS{#mZy-xP=<7&E4C}XY za?cUBJ}0YL_bs4uCi-I%)*r*~N}VI6P1;vSWVvdwKPABQGGmNx!CzC$lmd!(7cWbHaVQGIRZ%`-#uwSyUA@go@Gjt*J@W9hli!r6 zM_i%5`AFCD!kIeM+Per+ni-W?PxIb24l096J5G^%!l`mM9%zmxR9u$(IzDy*oK~^v zA7+=mG|1|JkaMAo~e^}v`@o+=~O8#|{nd^t;1I=hOJC%ao zSIIIl{C#`0dw$2&+7{@fC1R(BV)?)=bGPXh?V-$We(1BQ=D6Lsw+kUoTbSE0iwE}2 z`1V~8HYYo$skmH1vOAM}RvCKNT}?|&wADOq=yNgc<$PNmIrKrY@AQ;35csp;{$ghR zJ3VWIGaCJT4~(r&eKfp{xcK0Vw~kLdxEb*w^ig*Go@i`vx?X3XfepHI*3y-bGMU!0 z^)R~>Zw%CO9_kY^osZkp4l>s^N@R;yTkEsq5P8#uS#x0DQi!RoB}r19Unn^5)R?+0 z3rl~dmouY_?chOhgJ?TPTgwWk9p1hUv75h+;5n^vKOfDuXR^YVB+aIBrKbl;Iz3fN zJhS1&vKD2Uy6i0=-!nl>o1Z&oH;%gAOc-iH`eu)OVZ=gRC_8QE`I0D*j=DzMd0#})rI}5GZh6D&z4cQS7V95 zX~vKnmNVe} ziM$qv!F*3YYB$`EeE8w3JXu&^>A^saPPDjNh8f%io_ZxaE|bbocPvUXO7?@#peBBk z+lOZ&ViL3%4V>H&UXX6EF=lJIHy5S=#&4fO_6 zG$@`zP5WPgO1{^beuSLp##Dg>>_aF%8XTbBpvA zWX`E2dr7$4;!N#LICfS|mH^l2SjfKv{hyEhTv?C#VoO%u^yOCGOKWtob9iUHclpZN zK!bDZ`}Q-`QSNW>QpdcZ(&CAcE+-M5U)lE0aiag8S$?$V`d`~@MaC}r`A#{64ug@!3xwQAC$NNMHnths>eFUjREtp67r=p<|IG1m@5?`{Mg0O`^A|Mc z1UmDt06M=<@&AOQ{iA67)89EKK+cmzmLE!Sf6Ou?%uI;ZDXgffsv2Z)>(7tad)(N6 zlbSz69;7atOrUxhz#-WQ|J!k<7Q-dV#cJrrXq5Kj`~!s)PQmnpjE=>nUHunzx||k= zEt#3ND?jMpKRx7ssAdAG2uUl+!D_-yg2u{x(oLI^OH5%1Errtp_@`T-dpL_fMcyZ~ zu!1Wc)UB;!0cM;}-~nSO*Mu-ni$5Q+jAMaKl+0ggwpgE+8|B-~gfL(M>xq>J{gE-R zSc;O4)ri?m4tqKq$MrX}zNC%U&ZQjb^=s29S7+eRrp=kLI$5jT@ zB8EXIZ*lQo*}yN+#Bby%3~o1Q-Ewjjra^_L%h;BMyUB|nzsTCq$1%pd78)H={LQ=* z{0MvCqFo5Qg=zs8?1o^XI%OI5v)1iq$Ate2-*X|+xlZp&PUAeq`sU-;loe<|z zR?4LzP}jsg{PS`yx#BP6Zkq5j!^VAu|;yxooH=cH$feJh^?bY$?$0_O0bFQT+ z5X-{HZ~7v2z}W+pnpP&sXuGJ0;c=S~S5hHEk^)3CV;j2-*t-p_>wgVuEXqMA;dqy9 zpi-M=E4}-s&rG-oX~ z6W#9B!}fF2gn+$oeXQ4fjF~&k4Z2@U@_x$NoUi<VZ%A= z2|t-tZd?gU-UWx~PqX4`756Zo@^Q5a?JG6EU-}=u{kwnvS)*eS#{%JA)AtVv4B?CK zaMj@x#VdzyLc)+~hc(vID|*b0nIm}*mt=z*;(F%=Umm^*C7+`@_qC3sO4_Vc(~Gq! z>T$f@z}H&eyS>6IDKO@>&K5OkO~#H{0v&XRTyW_+DFr?K=hBV5d{3_&gBW8(?1Cy4 z+5lx(6U#SFw>GaOt%E{yP-WqV2$*%rS)@gLdYtDGvizc3S4f0l90+_XL1uVg5?_HoIPhGWw%fBAF0=WavlV+J%DE=st+H`|)D zpYT8En%{L^v}>Qh*4Ryob4BepB*=9fmz_f(Pf=HvVnRf_JoF9N}rHO`t8fN z1D+atQxgONSHaFJZ#{&e@P6^OKGc4knV-0D8Y8!wK@^jI;Z>{wtr`{}PuM2@TAHpJ2(re#R2KP1|NJxGzxNHoj{FDd4_My- literal 0 HcmV?d00001 diff --git a/gnu/dist/toolchain/etc/configbuild.tin b/gnu/dist/toolchain/etc/configbuild.tin new file mode 100644 index 000000000000..cfdd6fe07437 --- /dev/null +++ b/gnu/dist/toolchain/etc/configbuild.tin @@ -0,0 +1,9 @@ + config.in *configure* Makefile.in + | | | + | v | + | config.status | + | | | + *config.status*<======+==========>*config.status* + | | + v v + config.h Makefile diff --git a/gnu/dist/toolchain/etc/configdev.ein b/gnu/dist/toolchain/etc/configdev.ein new file mode 100644 index 000000000000..7f837850d695 --- /dev/null +++ b/gnu/dist/toolchain/etc/configdev.ein @@ -0,0 +1,185 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: configdev.fig +%%Creator: fig2dev Version 3.1 Patchlevel 1 +%%CreationDate: Mon Jun 15 17:35:19 1998 +%%For: ian@tito.cygnus.com (Ian Lance Taylor) +%%Orientation: Portrait +%%BoundingBox: 0 0 344 317 +%%Pages: 0 +%%BeginSetup +%%IncludeFeature: *PageSize Letter +%%EndSetup +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {} def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +-62.0 370.0 translate +1 -1 scale + +/clp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/l {lineto} bind def +/m {moveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def +%%EndProlog + +$F2psBegin +10 setmiterlimit + 0.06000 0.06000 sc +7.500 slw +% Polyline +n 1050 900 m 2100 900 l 2100 1425 l 1050 1425 l clp gs col-1 s gr +% Polyline +n 2925 900 m 3975 900 l 3975 1425 l 2925 1425 l clp gs col-1 s gr +% Polyline +n 5550 900 m 6750 900 l 6750 1350 l 5550 1350 l clp gs col-1 s gr +% Polyline +n 3750 1800 m 5025 1800 l 5025 2250 l 3750 2250 l clp gs col-1 s gr +% Polyline +n 1155 2100 m 1050 2100 1050 2520 105 arcto 4 {pop} repeat 1050 2625 2070 2625 105 arcto 4 {pop} repeat 2175 2625 2175 2205 105 arcto 4 {pop} repeat 2175 2100 1155 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 5550 3300 m 6675 3300 l 6675 3750 l 5550 3750 l clp gs col-1 s gr +% Polyline +n 5655 2100 m 5550 2100 5550 2520 105 arcto 4 {pop} repeat 5550 2625 6495 2625 105 arcto 4 {pop} repeat 6600 2625 6600 2205 105 arcto 4 {pop} repeat 6600 2100 5655 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 3750 3600 m 4875 3600 l 4875 4050 l 3750 4050 l clp gs col-1 s gr +% Polyline +n 3855 2700 m 3750 2700 3750 3045 105 arcto 4 {pop} repeat 3750 3150 4545 3150 105 arcto 4 {pop} repeat 4650 3150 4650 2805 105 arcto 4 {pop} repeat 4650 2700 3855 2700 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 2850 5700 m 3750 5700 l 3750 6150 l 2850 6150 l clp gs col-1 s gr +% Polyline +n 3030 4800 m 2925 4800 2925 5145 105 arcto 4 {pop} repeat 2925 5250 3645 5250 105 arcto 4 {pop} repeat 3750 5250 3750 4905 105 arcto 4 {pop} repeat 3750 4800 3030 4800 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 1500 1425 m 1500 2100 l gs col-1 s gr +n 1530.00 1980.00 m 1500.00 2100.00 l 1470.00 1980.00 l 1500.50 1980.50 l 1530.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 3300 1425 m 3300 4800 l gs col-1 s gr +n 3330.00 4680.00 m 3300.00 4800.00 l 3270.00 4680.00 l 3300.50 4680.50 l 3330.00 4680.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 3300 1575 m 1875 1575 l 1875 2100 l gs col-1 s gr +n 1905.00 1980.00 m 1875.00 2100.00 l 1845.00 1980.00 l 1875.50 1980.50 l 1905.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 3300 1575 m 5700 1575 l 5700 2100 l gs col-1 s gr +n 5730.00 1980.00 m 5700.00 2100.00 l 5670.00 1980.00 l 5700.50 1980.50 l 5730.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 6225 1350 m 6225 2100 l gs col-1 s gr +n 6255.00 1980.00 m 6225.00 2100.00 l 6195.00 1980.00 l 6225.50 1980.50 l 6255.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 6075 2625 m 6075 3300 l gs col-1 s gr +n 6105.00 3180.00 m 6075.00 3300.00 l 6045.00 3180.00 l 6075.50 3180.50 l 6105.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 4200 2250 m 4200 2700 l gs col-1 s gr +n 4230.00 2580.00 m 4200.00 2700.00 l 4170.00 2580.00 l 4200.50 2580.50 l 4230.00 2580.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 4200 3150 m 4200 3600 l gs col-1 s gr +n 4230.00 3480.00 m 4200.00 3600.00 l 4170.00 3480.00 l 4200.50 3480.50 l 4230.00 3480.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 4200 4050 m 4200 4500 l 3675 4500 l 3675 4800 l gs col-1 s gr +n 3705.00 4680.00 m 3675.00 4800.00 l 3645.00 4680.00 l 3675.50 4680.50 l 3705.00 4680.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 3375 5250 m 3375 5700 l gs col-1 s gr +n 3405.00 5580.00 m 3375.00 5700.00 l 3345.00 5580.00 l 3375.50 5580.50 l 3405.00 5580.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 3300 2925 m 3750 2925 l gs col-1 s gr +n 3630.00 2895.00 m 3750.00 2925.00 l 3630.00 2955.00 l 3630.50 2925.50 l 3630.00 2895.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 1500 2625 m 1500 3300 l gs col-1 s gr +n 1530.00 3180.00 m 1500.00 3300.00 l 1470.00 3180.00 l 1500.50 3180.50 l 1530.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 1050 3300 m 2100 3300 l 2100 3750 l 1050 3750 l clp gs col-1 s gr +% Polyline +n 4875 3825 m 5250 3825 l 5250 2400 l 5550 2400 l gs col-1 s gr +n 5430.00 2370.00 m 5550.00 2400.00 l 5430.00 2430.00 l 5430.50 2400.50 l 5430.00 2370.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +/Times-Roman findfont 180.00 scalefont setfont +1200 1200 m +gs 1 -1 sc (acconfig.h) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3000 1200 m +gs 1 -1 sc (configure.in) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5700 1200 m +gs 1 -1 sc (Makefile.am) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3900 2100 m +gs 1 -1 sc (acinclude.m4) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +1200 2400 m +gs 1 -1 sc (autoheader) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +1200 3600 m +gs 1 -1 sc (config.in) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5700 3600 m +gs 1 -1 sc (Makefile.in) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5700 2400 m +gs 1 -1 sc (automake) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3900 3900 m +gs 1 -1 sc (aclocal.m4) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3900 3000 m +gs 1 -1 sc (aclocal) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3000 6000 m +gs 1 -1 sc (configure) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3000 5100 m +gs 1 -1 sc (autoconf) col-1 show gr +$F2psEnd +restore diff --git a/gnu/dist/toolchain/etc/configdev.fig b/gnu/dist/toolchain/etc/configdev.fig new file mode 100644 index 000000000000..4d386ec4ff7a --- /dev/null +++ b/gnu/dist/toolchain/etc/configdev.fig @@ -0,0 +1,80 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 1050 900 2100 900 2100 1425 1050 1425 1050 900 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 2925 900 3975 900 3975 1425 2925 1425 2925 900 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 5550 900 6750 900 6750 1350 5550 1350 5550 900 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 3750 1800 5025 1800 5025 2250 3750 2250 3750 1800 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 2175 2625 2175 2100 1050 2100 1050 2625 2175 2625 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 5550 3300 6675 3300 6675 3750 5550 3750 5550 3300 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 6600 2625 6600 2100 5550 2100 5550 2625 6600 2625 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 3750 3600 4875 3600 4875 4050 3750 4050 3750 3600 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 4650 3150 4650 2700 3750 2700 3750 3150 4650 3150 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 2850 5700 3750 5700 3750 6150 2850 6150 2850 5700 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3750 5250 3750 4800 2925 4800 2925 5250 3750 5250 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1500 1425 1500 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3300 1425 3300 4800 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 + 1 1 1.00 60.00 120.00 + 3300 1575 1875 1575 1875 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 + 1 1 1.00 60.00 120.00 + 3300 1575 5700 1575 5700 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 6225 1350 6225 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 6075 2625 6075 3300 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 4200 2250 4200 2700 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 4200 3150 4200 3600 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 4 + 1 1 1.00 60.00 120.00 + 4200 4050 4200 4500 3675 4500 3675 4800 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3375 5250 3375 5700 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3300 2925 3750 2925 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1500 2625 1500 3300 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 1050 3300 2100 3300 2100 3750 1050 3750 1050 3300 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 4 + 1 1 1.00 60.00 120.00 + 4875 3825 5250 3825 5250 2400 5550 2400 +4 0 -1 0 0 0 12 0.0000000 4 180 780 1200 1200 acconfig.h\001 +4 0 -1 0 0 0 12 0.0000000 4 180 885 3000 1200 configure.in\001 +4 0 -1 0 0 0 12 0.0000000 4 135 945 5700 1200 Makefile.am\001 +4 0 -1 0 0 0 12 0.0000000 4 135 990 3900 2100 acinclude.m4\001 +4 0 -1 0 0 0 12 0.0000000 4 135 840 1200 2400 autoheader\001 +4 0 -1 0 0 0 12 0.0000000 4 180 645 1200 3600 config.in\001 +4 0 -1 0 0 0 12 0.0000000 4 135 855 5700 3600 Makefile.in\001 +4 0 -1 0 0 0 12 0.0000000 4 135 735 5700 2400 automake\001 +4 0 -1 0 0 0 12 0.0000000 4 135 810 3900 3900 aclocal.m4\001 +4 0 -1 0 0 0 12 0.0000000 4 135 540 3900 3000 aclocal\001 +4 0 -1 0 0 0 12 0.0000000 4 180 705 3000 6000 configure\001 +4 0 -1 0 0 0 12 0.0000000 4 135 660 3000 5100 autoconf\001 diff --git a/gnu/dist/toolchain/etc/configdev.jin b/gnu/dist/toolchain/etc/configdev.jin new file mode 100644 index 0000000000000000000000000000000000000000..9b11a71acd7db8d64d2f47a4444edee262575b1d GIT binary patch literal 17967 zcmeHvbzD_zx9&tbq@=q9B&9)+loAm{x&@K$SfJuUTBH#WkWf;Ag>-{-D&5_ZQqrt- zC)>|&Z`k{s?LFT#;$Vj94|EvG04ARz$&68Hx|i~%wL z1{xYV8Y%`lIyxpM1{My{WgKj59CE@dctq3`v^3NdR8(|KTr6}99E?;{tU}i~uJiEo z^V713+!W>&xa$SA02=opw-*kFTVeBcriGV&!9WK>iX6tJ}?_>#O6S)RtMzO$@tHVzV`7nzl95wfWoBW$#>OuoC?qU$L*|yO zoVZSB2%{R4wT!y}_Jvvczci%VaZSGKlycE9iK9~>T? z*@Xlk|1b;u{=={fb`gMfT|z-YMnONb3+WOBJdg=cQ0aNl2&L|!KXAOl!22A7NIK$e zejO$wpV}s|iBk_22^0U!)vYtrezWY?4DzHPP$(UN< zL9~f5V=nEc|1xyvI}AF#w~qkARMDkmoe{wKi}%1M*u^3M3Ed?)o;~#7JK#d3C2{fM zKlh~jC4HtnRj!$OqXt&WsLgTi+bynHT~6tddd6v(23~Zc!NIQlNQ3ueiGaU6^rwPm zg|w2W3anq28CUd=FduVvhVx|=mpNd|wGWR6IVRPoApljoBk z@}I7T9mu%U9v%%zY(9B{09vw;Q{I82ec|Gt?)s;n6;|0Z(<3G|^PVG5z-Tu_TH%r6 zcfGitzO`69??{D?{Rox21H(T?9h{{;(0O#wss{$3eM*mD-rx(PA%IrgC3t;BEIj73 zBqgcVo}0M*7}s>^&Vn}mP8#N-!jvoNP3`GvTxDAOLU_;F^rE%fu0jBX9zLDhJEhMi zE1jDkKPs=KJkVTfBH605=XXpU>$1MaTgCB`_1+@dU45>;*NT|Ta`cShQpxTdmZSKa4fB-&Hq5yhZT1j{c)wJsha0hK9POHD zQn9$serzIibJQz>LoTkz;_I4?o|*02d=AOgI}nd29*3ptwq>hDbHW0jM-T3+1vKC< zhw}H_^wyTOX0w}cDv9KHu~@_VynW6BZ(+j(C+<^M?WSF|qcvxajPi(chE@0Nb*JeT zfwdYtA`f#XMmE^2`bVa9vQfz!7*%E&<16ug!KCpPPuPb!@DiV9_1-xt_~7M%9iEzf zL!r!|GBk5AtJ z9?#9O4-EA&O|kBQkxFCX;`bWRRs;vdpF0eS3-ssC@JxOgBF%naDKMJ0#~`HjP0Ks1k1?j=3z4- zE%#fX+bUwp!YXp!$J z^7w`Tia5-+VS_Db>jWe-uen<6+-$!rO-HM?pp$)YK7gnh5h`WrB`DI7W~v7(vNQ5e znI5zHdZnSXbS*xN*mt9?);_ZLasA4%#tB1G5R*^3NcJ*j+7!1P`}eP8c*$IUbqM@K3G z?6^j0xktwz93bKojjYFwrlF|;P*iI^_h{;v0Q6m$;M&ksIc2EGZR_l? zXV+_?it=UVk7#EX6h`%8!r8BDd7FZ3FSk{llso-!i%+);eZxo5G`tTJgVOX~M0v84 z4HYRN{ikuZMIUfI8c@nsRtv@m#aGvka^}GMsT17->gTVS5P1(%nU~G)90~cja^C2W zzk)6Igq_u|DGkCouRo!e8EZHH`iNNcbu>pV4yE(L&Rq#)YtuX3rs2a0Avb#4nF%I4 zDC~=(I`6Cpdvq`pnMfTc$AycqfL`D^3~D``Y9NoAyA`v@XcKi9x6N!}@G4rZBfM&z zY#eD-?O0fAx`lIwG=(grf9@nLfz&vaM)AsNAp!FW zne?G#ygObkCe84!`-P#~^&8lgI(!8dOoWWa;SLQx-WVtBU43ipZOksmHt$sHa1KZOpSbk2KGAk1m8v{hFBNVBytU%Krt^&F|5cA%|2I_ z2o3>krOXgUh&Hnp8>}+?4Gl6k-9A;&&OsHyEG0&q?G@$3i8bQRQQy{dTb7;Z2(b(T zOrh)B_c2M(dPhEu_nh3!u{=7>?SF4Fn6LB!?V7_vCqxKS%!ah1d0PFw{4jKnck8v;nv(&*Nbn58|$bytDc7eJSZ2V8z&7%hqEsY9f3aF%MRA%NbI>=c-a za>Ulw6Hc$GtgC?8qylR0v~ zMpub@1KdlO7LNM}0nF@= zxt9rot%nv4rxm?=_Cm*ok4CDoHd;pf9pB6`c!^@MzVrHdh#&xRXe;g*h*Rw0F%1T& zrU%I?RsFm7P`#eRQY(wgWs_tmgrdcqqB)2ITc!DY2D48Kn`w71b%Ti2SqK3zbpL>_ z=Q^NRMRTZ1Bh_MPG`;zGDnE(lw!T9CDq##;koNNgW4`ArtjIZMpzgeR;v;i-M@SaX z0}(K&MOgg6eSgyg_G|}!nEM7PrCyB{l$*ZxPCwRB`WgaJg z`eC>PMLq(+obo{cU#-u&!xWqi#0IEDNL^q;0+~htM-;mfCu9u>pb3QY|N9N)18V0* zX1k8DTEJe93aYoORTd&VP z)8MYW#kyUjCib3aL?lsEa5&!vd(pcffb|c@(g_3sFzqzf?qO9RfF5N7RA;y-0*LgO zH9AH$fPT$@dH*)cM9RdR-%aQ>IogvH@)M@G&xhTrHgjd9^Jb_+agL9IU*Y72d%AX= z5P&?z`TNt=7yxFJVd_Sks`K$8h?-J;~CrJgS$^ZXR zzb(7-eRZ#EE|Fw#QtxG8@oVE3*lkSlS64o;k~2k-0LX8K6hS{83cB7T_gHwHmeJ9* zvsCj3_(4wI+y}vq4hVL%5x{QHUTNCd5y`2g*XgF&ZOx#0>h?;v0a0nE@3NPN9BB=PM#xI~%G{2uOm1R(tg zoYc^q+Czp4ELP;RoIgMvbV7V!=hO}wokYl=Fx|*J#f)D%g%^M$67=<~gZ}=Vcy|pf ztQo%R)^9XFVGk?(jM@|Y(VmkDg>2%LcL6t4w;u*=nA)b=GC%b*1w%ah&rbctjy&tk zKMgx*2p+W6xhZ*%I1B+O>6)&oE-1czf$~1r*8FbcRmwOSw(kj>!b?e^{08J_!e}WtSthnohW)k#>E5H(* ze{@p+DfhtD{IZ%LYukbXT@fQeUN?mTr2W+4wMLgiDKTUN^yj(u94D9GHD!$(sXQHg z!PziXZs{8;RFE%rk{;yc0U(X0CVv{`9H=VUCtT%|Vk3$a5vUy0QoAmNrjIXA_Fm%R zi=^P5(HK;tlZNh;x-ajR)p#G;(&#}xIu(-R+iR$a90vK(IY}{AUm&5tA-}*}fgT(+ z*Patjy6iNiZ=@vfWm$u3yfm6jlu^6xIDbvn_{P)5P>eiDm>nLnMM=q)-dIOY1BwEn z@Z8`xjeC-x089sf%H*%sUJ>=hxCN4nGLC&SgAjJ^+lGf5>dWE~-KRDqDl^A*SxzBa)F4!%X=J_8X(@ZNWS> z6AOu2lm(Obg{RZx<9D&T46x;mifnsxn{D{+*Us_#jVjGiaI)k#qg`C&64jdIs-26r8L;HMqAAA7* z`Ph793WU00D#hQnpMIW#?7Q#WI2nP16vAe*|F{B(ev=_$ffjZVOoouDHQ%Yi=R~tI@~HANB{2 zNJl#*JEJ&;`090-P=)YwD)oKBy=>=AC7K?8NzXYzSL?IuQ}!6`(2AMWEPfOc^TnRk zCb;Ha+e3$@1WUsJMw-AQlCY}_1M~43FDDEdjmzV5yQ_M_k>qX6VgVc)VWP{}^4f0$ zEj1a0%@k*)>|Tf7QVm?;X<+-1#TX7CgI#p;jI%nb1yZ3<>}46l+hpr3`kCVOq;~Y2 z)18DGbF)CYu&CB&SodJ=0oor2VY!@!jWT${`HN$fJjeRY6C#9oWnX(~#9fVj9#D2k z#*>6mFXYZY)(A4ty+v0NXWK2t<0W~^#!L$(7*|BVpo(RtbVms6JbOVV?>i%Mkmdxp zw{y{ySCCUiYrMV05I`gRYDGVN&)^2-*SGlt51zcRSzB_4r3a|uqoN`MWuZDaHV`|D zOR*wdIU2&diGoCN41Mba%w@;wA3kQ`2~JO%I(BSmh=z#(d)co*0_X``CW!;|<~h(K zS?e=IMS}psmtIP&vD3mMbcduQQHkzJqIw{J<^;WtFu$X;5+TwaW!n->C3*J6=DTeq zlH$8hs9%RBv$A+u=L`v4%i&yqSExM+-bZw=txPDN<%X!F+&${@0tnY4R0%_tg@#${@uD_O2@Tv(i`C-btadh zRUuv=Z9segz2BFcxAr}ooYO8{fgXBOZdvx50LdEiF?xEE3dIP(bpVKJ( zlN~?mrFTcn`=;3ytkd82S@aXb$6$1X+1aD65*|G6P@FOm|D3M!)}zMxWN{ZB43EI=6!-8Iki^~U|kK9gb7BWPsry8JW4t^r(bZ@ z7|fVH6C$`J~GF9zG$7F!3fXKQ?F#a|>6hq2GzxQ;Bsr9X!ot z-W^p%W^^ajxWO_^q9kcn+Hdowx-;_iY_&`D{A5Rke8_WEN*dz^66xDsxU-&m%Ee_d zlXI#?{_eS-`y<+Tvzh3oTct!W@F*+PV@mfRlhEOf>9Xys7R=iZ@fKQZJt(Qk9zLXz zbu_OZoqxtvHWYbT&^&IoGURGMmxir5$t*d(Txv%+FRbU9hS{W|)+o^~4Q|ikCYb3L zk2*?sAJ3IcxKw7DVCIWNwn*b^|8>YcOD2sZPUTYb)Mq806xIb z@Hg=DUl=#X^NC_r|Ja?R`aNu=Z0tg(kem65lst+AYHz!DU%go>w)ris7(M}M4yg$| z1c1^9-PWKr1!)d+7m1TA${+yL_>p>CXk*^sIEVRE<_Q?Dt-qSC4TkF<){b0xI%(Zm z>A07~GruIV1hH`*){-zs09WyJ&Y)`mJft!OdF|O5_puQGW#lu6#@* zc$bk?Mh)*~$K;4kMr}sbeyibt+Jg2SWZy#tVW!e{G$#ccbITU)2h#?c?d;JzoaF5~ zHq49C1vlToo$&n}FDaHk58?f|PARiNXJz?}W{`jNm~u9Tn@Mf*g$XGx5W3;MK^nFh?^=wOZlH;`dpSBZKPH5=t|@=#!QR|r~z40=M{%`_g-Z39f3Y)YJZ%Kb^V zKK65RCGm$$7{}>X(0*93QWo-c>MXVKN#LAlv`vDvkq6!mb;6wuyCiHm%&DORHlNMtyU~H ziFk`7Jy+YB^nJQOPmwo!mfGGjy}vuNB}1Zy1B-sSJ)7ipb>JjY^5&)TV+nA*cAa|X zNbK59fXj6RTqrVw&^2OkA*I@V{da~5z@T-t+sNR8{RjiI{`5jEDQ(CNyL3~ibC!jz z#o~HntR}=P+AN%*nc7VCj=5D9qp4561AdGNQu$fA_#EF>^H5Ur5bCa`t@kd%kuC zTy!Te?<#1+k!C*a`jx!Hp`$s=a9!-IlaV(KEOGmcB9wQmdi8A#n{dTfRnb5Gp$2zW z+y-ITALBQOY&Pvryf&a~?C+t=HUnq0+Ic#eSVg_>!9Wg0@1qDLmk6d{ub$RWYO03> z(Po-;C{)JYyzJaxw)|>0Y8u{7*&=}0uo7j5 zq6pHgIbR2Fq}M!8{%Dcp%$Jo5qPJR5HLM? zz|wXa{dR0)?hCvx-k$q3kGoa*V71g~DPv}^h(D3rS*vPy)mm#6- zKQc846;h}|j;9P*s7O?)FQqViYw3Aum5@=_afKbooi{F1s>xrW-#b zcUTfuOO3?kne^iQGZB#0^1Mi+?1^8j&Xo!_F(19^@%FT6l*4j55)*XWmO&VE`Qm|p zb3Mj%eDkqN0JCk7z*Mc&%_H_n{JN^jBZ+$nRvd8CC=-ZAytuz!# z^zU_yOs7Rg8e%TuS5`STmG}PscAMF@rweU;@=j|LQ)M5#h^OG)t0W>q+F;GgY@Ga`I;DZg$#65+PCo?a2}O z#fjxoYgeMHUW6gJR4>1v%~3_#w%x0>yF1>E*5ok}@Z4386{gi$WPZ);V?rEO>z?yr zt2A*VCi5a1e|tlbEneC4UTD4Z%)>)F*Hy}E0h6V*uXH<;65hpH!{iz19^%WR{6*PA zlI$qcuQ7pSoSnXVtu>HQ2u8n?v3Kby9;=EaWoEeT(OaoRcgM@k z-VHm+F?fDQlH%1FJOvMD_+=1PQg@yDxpJR!#-EW>=a<9pO07Rp%V0=j0o5y)!6-ch zidQ&6aoN9~`ukbm&?jZgS`Y#$Ev@LdJDPa(?3;Gw3+eR!tQ0l{BH#lWK+TF=bcP51 zR+=S(073*yV`;I!E85s`zl$HU$%zTo`W&1X$>HVsbx)LsT3l5H7?PT{*6WZ!w#c^< zBJG33rr|0uLBJYaaqdEG{VA8;>dWOv#Q=nt*QB;0NW=Af&* zj;JH_vXZCt#++K8Nnt_RHd7g?m8Kw)ln&;nkOskta*6uK zZ*V1)LDe2=qF?c+K6NRxG`-fX@ye%zT5{5oJi!6MOC@Bc5jz^tUshWgmpNzDb`d;6$jfA7vR!Gf*utBw`!o63>)!WSJ!)iHZ z-8Anuo?|QQj^5NN4QB6p5w&15rJkkDC`wsPIK7f(19d2)$<{~zn~}6N1$K1CXi>i+ zbpqU?yAHm=6_;Ls`IsvLc=wyvgq$m5gM#8SiuI4jpX%Bdm-(53_e?oJ9Ghz`BS&(( zgcQ;@IqsQ6#(C$#OAmW`rq-1d)R4*}RkZZq#L9mxo26c;ase*Hi$@Zn9N(VtSshVW zKK@`psgSEPUy5|4)jEKeXCi_U({yxr$zeGn>Ef+UZWIRJ!x|@ynvv_D(Q!k~h|7Y< zwWqJsiL@m5**MHawLRVYgr4!66#9I*P2zmj?x!O8Tn&)*Per?*+Uq}>ldH_47NFCU z&WP~jBUx9ysJNI(&C*a2 z7K}TVjIT6p9Iyce@^3z2GTP71Q!ASDi)N+KxpSe4^;akq7Kjt5E`1_Idon%O-Hk4k z>OR?}xykDumuv2`FO`mat)E3nZSjfAH$pj_J&xTX$ zB!f^Z+%J_fGfqVLSW-5)eB(|Yr<8RSF^OiWFZ@z(M!%At?G=sL=CaG}>nL@)m*>=0r=gD;VF*LWD*Y7n$9f#TKHlc<4^MI$Not!f_iU zha`&E?!i*M2M;=&2}%@CIuEb#bG6@oZ`Nw)7HkK6|FB=f)3c5M^8HHQnmV86L-wrY z^@_Hq$S3RkokJ=mfrSyGIX5|q19mkf1Cx4@b<~=&cwb1NXkitNO+nRV{IOPSKD6M1 zED7Fi{i=9cKUZrV{_;G+W^&H&cqIlHd3Id!=EqDQ`3|F=j&B5_NVuw=blwHfngU)x ziv+So6-b(Ao40!x7qQ1gr$qGH;uzVzyquWshqvI6dweo|kDHq@zHF}UqgoWJg7L+! z*UZ8j2BDswLq=y2Gaf=q!ri*M(q##yiMF+Nw9M8M>o!#6%N#Q!^v5uf9K-T!o_Vtr zY`o!atvJN5Ea-SODc)|$k*QsPJ+7+lmfjtI9gSohH6~1-d@0d4Cq+p4W_in{((TOs zMSUJFUTOFSISFGOI%IP0T$d_J9KKcN+~cdm)i&SrbwVE3@ywcQ)kRj!h?Uto|c zDBE$GDx;LizCP#Hi>^Qa*bJPIC}+BrnY?3ET~N!D{+oRJ60}WhbLiAN7rLwVv+m*m zr`$64-~BAU{RJ%jP-vw0KZd2&kbg4`84`*jh-P7=^EnuD{2??+Jdl9!8KVKO= z!zI6(Z~sblG>E-x7sNzXv2H?PoUbq$Pra4MOW^D8s$Mrxu21R=I975l@P%UC@<_px zdir0y;Ct3nDKSAI$ew{*$(~?c;S?S&$9n&??y%S^W zKG^H=!F$DsO;86@CCcII?KHnlDFPgxFhx+uH?!Q`Wtj)VQO|0FA*r|)W~vtfL|W>#&l6} zn1<($3S9`PAcW2=44LWq!N8v~ogZS2zsraIAGNxW`2Q)*`H@Whp7#9yGYGAJ4J$aq z&j%rp$vxVO@_1hochhf;BvzC3(E`O2(;I>&kqqfFZ|obTO5uE%l{Y~WUl z&pTUo;8qK_!-O($tA)YHYLU4xaq^x78MGU6Ce!1eI*FFQP-X!vnEg^)JghxvqD^8o zBQQ8K^jz?8jPVI5$u;U2kwcYfhjq`mANf6vGw$cmGZEx|DmP5+Czmn}ttBp0QVM6v zwtQ>ot9zlvyF7c=3S3X8)?U=u3oIIx9jlOSJHOefED-^gxm^;4)Z9T?ipm*UyCs)I z45GE-Pp#9uoAQozA1r4iF1I`yw46D;W@{w+mgJtV%_|o6U?FK)#mO^J;A6T80LQNP$v98r8&rsoL`Z~y9cW%j2h;`Ly zY5Cn@%HfBsTWKGHwG=8V4hPIUhGQ?3tjU)mVlzq zEMInN8Z3!R6H4t)14-R@9p9Lf^CP|eFXW-WZ}~be8~rb@|L3Ik`SQYFrR~4Z-@lsE zzjE!D=RJ`Y9ys8mR?jYXfBVK=+{OhfI`+tbu6NXxj|y-&T>aF>k`6$AY1^9qY4XXd zo93YRqdgMbxUd84!(#Nzsf1ivSy|Dso{B?YWSi>~fevEnCQ05(d?bi48R!btE~euD z@z1{r8q&t$JGZ-w4b+B;2PztfY@ow@isY`0C^x))X~=fGaJ|cFgGT3XkTxV5EEQKK za&yiXT(&2Ba7Brdt#Ur(eI>GZ4jQiY{RYxq9y#N>6XSIj z&*wvXuW#G7qIfBg0UIo0fQr=;oM<(CwHDVUzjWfpxL3*($BUPepJVgG<>1_^4I$df8QqctG@@6h`y!GzA>TelLn(Y zcWbBotpjHxoX1$#ctyxt>86Lyl$pV`^XOnn=7E6_xNq;lhi5`tvitt)bFnH#q04in zNqg>r9c1*_wd7`4;;yLMoxD6$aiWqp+Sy-vLJe;mFSiNC0Y5p_B>EQfF}hcCnVeca6KpHjwh16e>XkqDuAa_qK0$ zgh9L+lWMv6yrmjG*7g@ClYiwMSF)hEt&$LE>gC&jcglQzOouoE`<(95+r6;Xb! z&h@|JZO%LrxMTM4sd!`(V}NRYlGaVe5UyE>+s$YVofl#NxOHT>;$vYAxD(D2wIzbB z3onrj$|ZXYEC1TSg5t!cIPJeOsrMu>H6BwnEu!`9Z*1VSw{X(~a0kSJch|nIc_5wj zy?w3w1=ex+E?7*8rW`3q9sW*EN+s?7Jw$VUni|IF zfR{W&*cvA-{JEyY*8bkNgMF2Q0|byXAu$Lo9-1tKpO0VXqfpA_u#Y<6E*B|@A=E=i3nTw%LfU_u3@XM^yO9Sy<%y|#$ z`5a*<(%HW!~s_|J!!CKG1rlu+q0jRoMTe`u*SE)z#I5x^Dg7`t~0;jo&8bN|!}alT1NX zy$&qvCZ8uLe{v}2wtD|r8|#4p0{L@IR7P1Ox9z_-^|2IzY}kEae+lky&DRA3M^Z~C zt2=^E7xIi@HV2fl*1lzyu2DA_85CSAC)#tQjPVk}F*TSVqc?wv{LU8tCLeHX3*A4h zplSfxD}YHK$1-4NF0WFcFOH?i$UP~0Q&biG!9Rs}E<6YQ;)W}e75JBy)?>4A68O_> z6mgg5Vr`Tg@0PNusF2!npyxJF%hjeD8m$PH##ovPa&mDz@;|sj8_N?|7!4f0-uBx5 z(p?w!rEDHq?Y|XnX&U|lRrRUk*vOAi{+So`?)udNDbJmFh!_8M@U#I1lewAzgHnzs?b#C*)9mHN<9jiSeRn)uhx0h>W7aU<-m{&T7^P6S-AKW2oQ8fnpCxLR zqx%(dBPr1w@@`C5>e1kyY7U=%O+N`K9+RQonkk3c8zlNsY1^kFqLS#wPnA+$K6&Yr zyIdn%acie-FKvvl6)8CX3t%jz_IN3HKms4!$mU!R-6M_yRqn9tgkRpx8aZ6^TI{kZ zlY{J@r_?)zlt&L=khFhgL$i-7fsr~kubE@N0l>Wc=i2&b&$zS=&p0+G<1#08roav@ zstD8Qhcw(=bF5h0HsMX1e~1sII4dlEs{{3P0$}pN1J>(;e(qfm-GrWAeoPC;0fWbE z)<4=Tn_G2@%O~d`s=nmNury=pZpE9>p3w=W9MUxiBhxh&ays*IEzAELz5fcr|4-UL H5hMQxiK{8f literal 0 HcmV?d00001 diff --git a/gnu/dist/toolchain/etc/configdev.tin b/gnu/dist/toolchain/etc/configdev.tin new file mode 100644 index 000000000000..c9b6f34f4d79 --- /dev/null +++ b/gnu/dist/toolchain/etc/configdev.tin @@ -0,0 +1,17 @@ + acconfig.h configure.in Makefile.am + | | | + | --------------+---------------------- | + | | | | | + v v | acinclude.m4 | | + *autoheader* | | v v + | | v --->*automake* + v |--->*aclocal* | | + config.in | | | v + | v | Makefile.in + | aclocal.m4--- + | | + v v + *autoconf* + | + v + configure diff --git a/gnu/dist/toolchain/etc/configure b/gnu/dist/toolchain/etc/configure index 55c701a511ca..101fcefecfcc 100755 --- a/gnu/dist/toolchain/etc/configure +++ b/gnu/dist/toolchain/etc/configure @@ -546,11 +546,12 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:554: checking for a BSD compatible install" >&5 +echo "configure:555: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -562,12 +563,13 @@ else /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. - # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" @@ -711,6 +713,7 @@ do done ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF @@ -743,7 +746,6 @@ s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g -s%@INSTALL@%$INSTALL%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g @@ -822,6 +824,10 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then top_srcdir="$ac_dots$ac_given_srcdir" ;; esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac echo creating "$ac_file" rm -f "$ac_file" @@ -837,6 +843,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* diff --git a/gnu/dist/toolchain/etc/configure.in b/gnu/dist/toolchain/etc/configure.in index f34241bea1e9..b785068009eb 100644 --- a/gnu/dist/toolchain/etc/configure.in +++ b/gnu/dist/toolchain/etc/configure.in @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.12.1) +AC_PREREQ(2.5) AC_INIT(Makefile.in) -EGCS_PROG_INSTALL +AC_PROG_INSTALL AC_OUTPUT(Makefile) diff --git a/gnu/dist/toolchain/etc/configure.info b/gnu/dist/toolchain/etc/configure.info new file mode 100644 index 000000000000..2ed20df83bd1 --- /dev/null +++ b/gnu/dist/toolchain/etc/configure.info @@ -0,0 +1,95 @@ +This is configure.info, produced by makeinfo version 4.0 from +./configure.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* configure: (configure). The GNU configure and build system +END-INFO-DIR-ENTRY + + This file documents the GNU configure and build system. + + Copyright (C) 1998 Cygnus Solutions. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +Indirect: +configure.info-1: 971 +configure.info-2: 48782 +configure.info-3: 98073 + +Tag Table: +(Indirect) +Node: Top971 +Node: Introduction1502 +Node: Goals2583 +Node: Tools3302 +Node: History4291 +Node: Building7284 +Node: Getting Started10374 +Node: Write configure.in10886 +Node: Write Makefile.am18132 +Node: Write acconfig.h21290 +Node: Generate files22827 +Node: Getting Started Example24788 +Node: Getting Started Example 125538 +Node: Getting Started Example 227475 +Node: Getting Started Example 330591 +Node: Generate Files in Example32961 +Node: Files34042 +Node: Developer Files34653 +Node: Developer Files Picture35028 +Node: Written Developer Files36320 +Node: Generated Developer Files38863 +Node: Build Files41998 +Node: Build Files Picture42654 +Node: Build Files Description43409 +Node: Support Files45406 +Node: Configuration Names48283 +Node: Configuration Name Definition48782 +Node: Using Configuration Names51100 +Node: Cross Compilation Tools53067 +Node: Cross Compilation Concepts53757 +Node: Host and Target54719 +Node: Using the Host Type56215 +Node: Specifying the Target57559 +Node: Using the Target Type58343 +Node: Cross Tools in the Cygnus Tree61769 +Node: Host and Target Libraries62821 +Node: Target Library Configure Scripts66561 +Node: Make Targets in Cygnus Tree69644 +Node: Target libiberty70983 +Node: Canadian Cross72361 +Node: Canadian Cross Example73201 +Node: Canadian Cross Concepts74315 +Node: Build Cross Host Tools75822 +Node: Build and Host Options76769 +Node: CCross not in Cygnus Tree78550 +Node: CCross in Cygnus Tree79523 +Node: Standard Cygnus CCross79939 +Node: Cross Cygnus CCross81294 +Node: Supporting Canadian Cross84085 +Node: CCross in Configure84695 +Node: CCross in Make87852 +Node: Cygnus Configure89446 +Node: Cygnus Configure Basics90280 +Node: Cygnus Configure in C++ Libraries94954 +Node: Multilibs95956 +Node: Multilibs in gcc97000 +Node: Multilibs in Target Libraries98073 +Node: FAQ102257 +Node: Index106353 + +End Tag Table diff --git a/gnu/dist/toolchain/etc/configure.info-1 b/gnu/dist/toolchain/etc/configure.info-1 new file mode 100644 index 000000000000..bb65d7dce46c --- /dev/null +++ b/gnu/dist/toolchain/etc/configure.info-1 @@ -0,0 +1,1313 @@ +This is configure.info, produced by makeinfo version 4.0 from +./configure.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* configure: (configure). The GNU configure and build system +END-INFO-DIR-ENTRY + + This file documents the GNU configure and build system. + + Copyright (C) 1998 Cygnus Solutions. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: configure.info, Node: Top, Next: Introduction, Up: (dir) + +GNU configure and build system +****************************** + + The GNU configure and build system. + +* Menu: + +* Introduction:: Introduction. +* Getting Started:: Getting Started. +* Files:: Files. +* Configuration Names:: Configuration Names. +* Cross Compilation Tools:: Cross Compilation Tools. +* Canadian Cross:: Canadian Cross. +* Cygnus Configure:: Cygnus Configure. +* Multilibs:: Multilibs. +* FAQ:: Frequently Asked Questions. +* Index:: Index. + + +File: configure.info, Node: Introduction, Next: Getting Started, Prev: Top, Up: Top + +Introduction +************ + + This document describes the GNU configure and build systems. It +describes how autoconf, automake, libtool, and make fit together. It +also includes a discussion of the older Cygnus configure system. + + This document does not describe in detail how to use each of the +tools; see the respective manuals for that. Instead, it describes +which files the developer must write, which files are machine generated +and how they are generated, and where certain common problems should be +addressed. + + This document draws on several sources, including the autoconf +manual by David MacKenzie (*note autoconf overview: (autoconf)Top.), +the automake manual by David MacKenzie and Tom Tromey (*note automake +overview: (automake)Top.), the libtool manual by Gordon Matzigkeit +(*note libtool overview: (libtool)Top.), and the Cygnus configure +manual by K. Richard Pixley. + +* Menu: + +* Goals:: Goals. +* Tools:: The tools. +* History:: History. +* Building:: Building. + + +File: configure.info, Node: Goals, Next: Tools, Up: Introduction + +Goals +===== + + The GNU configure and build system has two main goals. + + The first is to simplify the development of portable programs. The +system permits the developer to concentrate on writing the program, +simplifying many details of portability across Unix and even Windows +systems, and permitting the developer to describe how to build the +program using simple rules rather than complex Makefiles. + + The second is to simplify the building of programs distributed as +source code. All programs are built using a simple, standardized, two +step process. The program builder need not install any special tools in +order to build the program. + + +File: configure.info, Node: Tools, Next: History, Prev: Goals, Up: Introduction + +Tools +===== + + The GNU configure and build system is comprised of several different +tools. Program developers must build and install all of these tools. + + People who just want to build programs from distributed sources +normally do not need any special tools beyond a Unix shell, a make +program, and a C compiler. + +autoconf + provides a general portability framework, based on testing the + features of the host system at build time. + +automake + a system for describing how to build a program, permitting the + developer to write a simplified `Makefile'. + +libtool + a standardized approach to building shared libraries. + +gettext + provides a framework for translation of text messages into other + languages; not really discussed in this document. + +m4 + autoconf requires the GNU version of m4; the standard Unix m4 does + not suffice. + +perl + automake requires perl. + + +File: configure.info, Node: History, Next: Building, Prev: Tools, Up: Introduction + +History +======= + + This is a very brief and probably inaccurate history. + + As the number of Unix variants increased during the 1980s, it became +harder to write programs which could run on all variants. While it was +often possible to use `#ifdef' to identify particular systems, +developers frequently did not have access to every system, and the +characteristics of some systems changed from version to version. + + By 1992, at least three different approaches had been developed: + * The Metaconfig program, by Larry Wall, Harlan Stenn, and Raphael + Manfredi. + + * The Cygnus configure script, by K. Richard Pixley, and the gcc + configure script, by Richard Stallman. These use essentially the + same approach, and the developers communicated regularly. + + * The autoconf program, by David MacKenzie. + + The Metaconfig program is still used for Perl and a few other +programs. It is part of the Dist package. I do not know if it is +being developed. + + In 1994, David MacKenzie and others modified autoconf to incorporate +all the features of Cygnus configure. Since then, there has been a +slow but steady conversion of GNU programs from Cygnus configure to +autoconf. gcc has been converted, eliminating the gcc configure script. + + GNU autoconf was regularly maintained until late 1996. As of this +writing in June, 1998, it has no public maintainer. + + Most programs are built using the make program, which requires the +developer to write Makefiles describing how to build the programs. +Since most programs are built in pretty much the same way, this led to a +lot of duplication. + + The X Window system is built using the imake tool, which uses a +database of rules to eliminate the duplication. However, building a +tool which was developed using imake requires that the builder have +imake installed, violating one of the goals of the GNU system. + + The new BSD make provides a standard library of Makefile fragments, +which permits developers to write very simple Makefiles. However, this +requires that the builder install the new BSD make program. + + In 1994, David MacKenzie wrote the first version of automake, which +permitted writing a simple build description which was converted into a +Makefile which could be used by the standard make program. In 1995, Tom +Tromey completely rewrote automake in Perl, and he continues to enhance +it. + + Various free packages built libraries, and by around 1995 several +included support to build shared libraries on various platforms. +However, there was no consistent approach. In early 1996, Gordon +Matzigkeit began working on libtool, which provided a standardized +approach to building shared libraries. This was integrated into +automake from the start. + + The development of automake and libtool was driven by the GNITS +project, a group of GNU maintainers who designed standardized tools to +help meet the GNU coding standards. + + +File: configure.info, Node: Building, Prev: History, Up: Introduction + +Building +======== + + Most readers of this document should already know how to build a +tool by running `configure' and `make'. This section may serve as a +quick introduction or reminder. + + Building a tool is normally as simple as running `configure' +followed by `make'. You should normally run `configure' from an empty +directory, using some path to refer to the `configure' script in the +source directory. The directory in which you run `configure' is called +the "object directory". + + In order to use a object directory which is different from the source +directory, you must be using the GNU version of `make', which has the +required `VPATH' support. Despite this restriction, using a different +object directory is highly recommended: + * It keeps the files generated during the build from cluttering up + your sources. + + * It permits you to remove the built files by simply removing the + entire build directory. + + * It permits you to build from the same sources with several sets of + configure options simultaneously. + + If you don't have GNU `make', you will have to run `configure' in +the source directory. All GNU packages should support this; in +particular, GNU packages should not assume the presence of GNU `make'. + + After running `configure', you can build the tools by running `make'. + + To install the tools, run `make install'. Installing the tools will +copy the programs and any required support files to the "installation +directory". The location of the installation directory is controlled +by `configure' options, as described below. + + In the Cygnus tree at present, the info files are built and +installed as a separate step. To build them, run `make info'. To +install them, run `make install-info'. + + All `configure' scripts support a wide variety of options. The most +interesting ones are `--with' and `--enable' options which are +generally specific to particular tools. You can usually use the +`--help' option to get a list of interesting options for a particular +configure script. + + The only generic options you are likely to use are the `--prefix' +and `--exec-prefix' options. These options are used to specify the +installation directory. + + The directory named by the `--prefix' option will hold machine +independent files such as info files. + + The directory named by the `--exec-prefix' option, which is normally +a subdirectory of the `--prefix' directory, will hold machine dependent +files such as executables. + + The default for `--prefix' is `/usr/local'. The default for +`--exec-prefix' is the value used for `--prefix'. + + The convention used in Cygnus releases is to use a `--prefix' option +of `/usr/cygnus/RELEASE', where RELEASE is the name of the release, and +to use a `--exec-prefix' option of `/usr/cygnus/RELEASE/H-HOST', where +HOST is the configuration name of the host system (*note Configuration +Names::). + + Do not use either the source or the object directory as the +installation directory. That will just lead to confusion. + + +File: configure.info, Node: Getting Started, Next: Files, Prev: Introduction, Up: Top + +Getting Started +*************** + + To start using the GNU configure and build system with your software +package, you must write three files, and you must run some tools to +manually generate additional files. + +* Menu: + +* Write configure.in:: Write configure.in. +* Write Makefile.am:: Write Makefile.am. +* Write acconfig.h:: Write acconfig.h. +* Generate files:: Generate files. +* Getting Started Example:: Example. + + +File: configure.info, Node: Write configure.in, Next: Write Makefile.am, Up: Getting Started + +Write configure.in +================== + + You must first write the file `configure.in'. This is an autoconf +input file, and the autoconf manual describes in detail what this file +should look like. + + You will write tests in your `configure.in' file to check for +conditions that may change from one system to another, such as the +presence of particular header files or functions. + + For example, not all systems support the `gettimeofday' function. +If you want to use the `gettimeofday' function when it is available, +and to use some other function when it is not, you would check for this +by putting `AC_CHECK_FUNCS(gettimeofday)' in `configure.in'. + + When the configure script is run at build time, this will arrange to +define the preprocessor macro `HAVE_GETTIMEOFDAY' to the value 1 if the +`gettimeofday' function is available, and to not define the macro at +all if the function is not available. Your code can then use `#ifdef' +to test whether it is safe to call `gettimeofday'. + + If you have an existing body of code, the `autoscan' program may +help identify potential portability problems, and hence configure tests +that you will want to use. *Note Invoking autoscan: (autoconf)Invoking +autoscan. + + Another handy tool for an existing body of code is `ifnames'. This +will show you all the preprocessor conditionals that the code already +uses. *Note Invoking ifnames: (autoconf)Invoking ifnames. + + Besides the portability tests which are specific to your particular +package, every `configure.in' file should contain the following macros. + +`AC_INIT' + This macro takes a single argument, which is the name of a file in + your package. For example, `AC_INIT(foo.c)'. + +`AC_PREREQ(VERSION)' + This macro is optional. It may be used to indicate the version of + `autoconf' that you are using. This will prevent users from + running an earlier version of `autoconf' and perhaps getting an + invalid `configure' script. For example, `AC_PREREQ(2.12)'. + +`AM_INIT_AUTOMAKE' + This macro takes two arguments: the name of the package, and a + version number. For example, `AM_INIT_AUTOMAKE(foo, 1.0)'. (This + macro is not needed if you are not using automake). + +`AM_CONFIG_HEADER' + This macro names the header file which will hold the preprocessor + macro definitions at run time. Normally this should be + `config.h'. Your sources would then use `#include "config.h"' to + include it. + + This macro may optionally name the input file for that header + file; by default, this is `config.h.in', but that file name works + poorly on DOS filesystems. Therefore, it is often better to name + it explicitly as `config.in'. + + This is what you should normally put in `configure.in': + AM_CONFIG_HEADER(config.h:config.in) + + (If you are not using automake, use `AC_CONFIG_HEADER' rather than + `AM_CONFIG_HEADER'). + +`AM_MAINTAINER_MODE' + This macro always appears in Cygnus configure scripts. Other + programs may or may not use it. + + If this macro is used, the `--enable-maintainer-mode' option is + required to enable automatic rebuilding of generated files used by + the configure system. This of course requires that developers be + aware of, and use, that option. + + If this macro is not used, then the generated files will always be + rebuilt automatically. This will cause problems if the wrong + versions of autoconf, automake, or others are in the builder's + `PATH'. + + (If you are not using automake, you do not need to use this macro). + +`AC_EXEEXT' + Either this macro or `AM_EXEEXT' always appears in Cygnus configure + files. Other programs may or may not use one of them. + + This macro looks for the executable suffix used on the host + system. On Unix systems, this is the empty string. On Windows + systems, this is `.exe'. This macro directs automake to use the + executable suffix as appropriate when creating programs. This + macro does not take any arguments. + + The `AC_EXEEXT' form is new, and is part of a Cygnus patch to + autoconf to support compiling with Visual C++. Older programs use + `AM_EXEEXT' instead. + + (Programs which do not use automake use neither `AC_EXEEXT' nor + `AM_EXEEXT'). + +`AC_PROG_CC' + If you are writing C code, you will normally want to use this + macro. It locates the C compiler to use. It does not take any + arguments. + + However, if this `configure.in' file is for a library which is to + be compiled by a cross compiler which may not fully work, then you + will not want to use `AC_PROG_CC'. Instead, you will want to use a + variant which does not call the macro `AC_PROG_CC_WORKS'. Examples + can be found in various `configure.in' files for libraries that are + compiled with cross compilers, such as libiberty or libgloss. + This is essentially a bug in autoconf, and there will probably be + a better workaround at some point. + +`AC_PROG_CXX' + If you are writing C++ code, you will want to use this macro. It + locates the C++ compiler to use. It does not take any arguments. + The same cross compiler comments apply as for `AC_PROG_CC'. + +`AM_PROG_LIBTOOL' + If you want to build libraries, and you want to permit them to be + shared, or you want to link against libraries which were built + using libtool, then you will need this macro. This macro is + required in order to use libtool. + + By default, this will cause all libraries to be built as shared + libraries. To prevent this-to change the default-use + `AM_DISABLE_SHARED' before `AM_PROG_LIBTOOL'. The configure + options `--enable-shared' and `--disable-shared' may be used to + override the default at build time. + +`AC_DEFINE(_GNU_SOURCE)' + GNU packages should normally include this line before any other + feature tests. This defines the macro `_GNU_SOURCE' when + compiling, which directs the libc header files to provide the + standard GNU system interfaces including all GNU extensions. If + this macro is not defined, certain GNU extensions may not be + available. + +`AC_OUTPUT' + This macro takes a list of file names which the configure process + should produce. This is normally a list of one or more `Makefile' + files in different directories. If your package lives entirely in + a single directory, you would use simply `AC_OUTPUT(Makefile)'. + If you also have, for example, a `lib' subdirectory, you would use + `AC_OUTPUT(Makefile lib/Makefile)'. + + If you want to use locally defined macros in your `configure.in' +file, then you will need to write a `acinclude.m4' file which defines +them (if not using automake, this file is called `aclocal.m4'). +Alternatively, you can put separate macros in an `m4' subdirectory, and +put `ACLOCAL_AMFLAGS = -I m4' in your `Makefile.am' file so that the +`aclocal' program will be able to find them. + + The different macro prefixes indicate which tool defines the macro. +Macros which start with `AC_' are part of autoconf. Macros which start +with `AM_' are provided by automake or libtool. + + +File: configure.info, Node: Write Makefile.am, Next: Write acconfig.h, Prev: Write configure.in, Up: Getting Started + +Write Makefile.am +================= + + You must write the file `Makefile.am'. This is an automake input +file, and the automake manual describes in detail what this file should +look like. + + The automake commands in `Makefile.am' mostly look like variable +assignments in a `Makefile'. automake recognizes special variable +names, and automatically add make rules to the output as needed. + + There will be one `Makefile.am' file for each directory in your +package. For each directory with subdirectories, the `Makefile.am' +file should contain the line + SUBDIRS = DIR DIR ... + +where each DIR is the name of a subdirectory. + + For each `Makefile.am', there should be a corresponding `Makefile' +in the `AC_OUTPUT' macro in `configure.in'. + + Every `Makefile.am' written at Cygnus should contain the line + AUTOMAKE_OPTIONS = cygnus + +This puts automake into Cygnus mode. See the automake manual for +details. + + You may to include the version number of `automake' that you are +using on the `AUTOMAKE_OPTIONS' line. For example, + AUTOMAKE_OPTIONS = cygnus 1.3 + +This will prevent users from running an earlier version of `automake' +and perhaps getting an invalid `Makefile.in'. + + If your package builds a program, then in the directory where that +program is built you will normally want a line like + bin_PROGRAMS = PROGRAM + +where PROGRAM is the name of the program. You will then want a line +like + PROGRAM_SOURCES = FILE FILE ... + +where each FILE is the name of a source file to link into the program +(e.g., `foo.c'). + + If your package builds a library, and you do not want the library to +ever be built as a shared library, then in the directory where that +library is built you will normally want a line like + lib_LIBRARIES = libNAME.a + +where `libNAME.a' is the name of the library. You will then want a +line like + libNAME_a_SOURCES = FILE FILE ... + +where each FILE is the name of a source file to add to the library. + + If your package builds a library, and you want to permit building the +library as a shared library, then in the directory where that library is +built you will normally want a line like + lib_LTLIBRARIES = libNAME.la + The use of `LTLIBRARIES', and the `.la' extension, indicate a +library to be built using libtool. As usual, you will then want a line +like + libNAME_la_SOURCES = FILE FILE ... + + The strings `bin' and `lib' that appear above in `bin_PROGRAMS' and +`lib_LIBRARIES' are not arbitrary. They refer to particular +directories, which may be set by the `--bindir' and `--libdir' options +to `configure'. If those options are not used, the default values are +based on the `--prefix' or `--exec-prefix' options to `configure'. It +is possible to use other names if the program or library should be +installed in some other directory. + + The `Makefile.am' file may also contain almost anything that may +appear in a normal `Makefile'. automake also supports many other +special variables, as well as conditionals. + + See the automake manual for more information. + + +File: configure.info, Node: Write acconfig.h, Next: Generate files, Prev: Write Makefile.am, Up: Getting Started + +Write acconfig.h +================ + + If you are generating a portability header file, (i.e., you are using +`AM_CONFIG_HEADER' in `configure.in'), then you will have to write a +`acconfig.h' file. It will have to contain the following lines. + + /* Name of package. */ + #undef PACKAGE + + /* Version of package. */ + #undef VERSION + + This requirement is really a bug in the system, and the requirement +may be eliminated at some later date. + + The `acconfig.h' file will also similar comment and `#undef' lines +for any unusual macros in the `configure.in' file, including any macro +which appears in a `AC_DEFINE' macro. + + In particular, if you are writing a GNU package and therefore include +`AC_DEFINE(_GNU_SOURCE)' in `configure.in' as suggested above, you will +need lines like this in `acconfig.h': + /* Enable GNU extensions. */ + #undef _GNU_SOURCE + + Normally the `autoheader' program will inform you of any such +requirements by printing an error message when it is run. However, if +you do anything particular odd in your `configure.in' file, you will +have to make sure that the right entries appear in `acconfig.h', since +otherwise the results of the tests may not be available in the +`config.h' file which your code will use. + + (Thee `PACKAGE' and `VERSION' lines are not required if you are not +using automake, and in that case you may not need a `acconfig.h' file +at all). + + +File: configure.info, Node: Generate files, Next: Getting Started Example, Prev: Write acconfig.h, Up: Getting Started + +Generate files +============== + + Once you have written `configure.in', `Makefile.am', `acconfig.h', +and possibly `acinclude.m4', you must use autoconf and automake +programs to produce the first versions of the generated files. This is +done by executing the following sequence of commands. + + aclocal + autoconf + autoheader + automake + + The `aclocal' and `automake' commands are part of the automake +package, and the `autoconf' and `autoheader' commands are part of the +autoconf package. + + If you are using a `m4' subdirectory for your macros, you will need +to use the `-I m4' option when you run `aclocal'. + + If you are not using the Cygnus tree, use the `-a' option when +running `automake' command in order to copy the required support files +into your source directory. + + If you are using libtool, you must build and install the libtool +package with the same `--prefix' and `--exec-prefix' options as you +used with the autoconf and automake packages. You must do this before +running any of the above commands. If you are not using the Cygnus +tree, you will need to run the `libtoolize' program to copy the libtool +support files into your directory. + + Once you have managed to run these commands without getting any +errors, you should create a new empty directory, and run the `configure' +script which will have been created by `autoconf' with the +`--enable-maintainer-mode' option. This will give you a set of +Makefiles which will include rules to automatically rebuild all the +generated files. + + After doing that, whenever you have changed some of the input files +and want to regenerated the other files, go to your object directory +and run `make'. Doing this is more reliable than trying to rebuild the +files manually, because there are complex order dependencies and it is +easy to forget something. + + +File: configure.info, Node: Getting Started Example, Prev: Generate files, Up: Getting Started + +Example +======= + + Let's consider a trivial example. + + Suppose we want to write a simple version of `touch'. Our program, +which we will call `poke', will take a single file name argument, and +use the `utime' system call to set the modification and access times of +the file to the current time. We want this program to be highly +portable. + + We'll first see what this looks like without using autoconf and +automake, and then see what it looks like with them. + +* Menu: + +* Getting Started Example 1:: First Try. +* Getting Started Example 2:: Second Try. +* Getting Started Example 3:: Third Try. +* Generate Files in Example:: Generate Files. + + +File: configure.info, Node: Getting Started Example 1, Next: Getting Started Example 2, Up: Getting Started Example + +First Try +--------- + + Here is our first try at `poke.c'. Note that we've written it +without ANSI/ISO C prototypes, since we want it to be highly portable. + + #include + #include + #include + #include + + int + main (argc, argv) + int argc; + char **argv; + { + if (argc != 2) + { + fprintf (stderr, "Usage: poke file\n"); + exit (1); + } + + if (utime (argv[1], NULL) < 0) + { + perror ("utime"); + exit (1); + } + + exit (0); + } + + We also write a simple `Makefile'. + + CC = gcc + CFLAGS = -g -O2 + + all: poke + + poke: poke.o + $(CC) -o poke $(CFLAGS) $(LDFLAGS) poke.o + + So far, so good. + + Unfortunately, there are a few problems. + + On older Unix systems derived from BSD 4.3, the `utime' system call +does not accept a second argument of `NULL'. On those systems, we need +to pass a pointer to `struct utimbuf' structure. Unfortunately, even +older systems don't define that structure; on those systems, we need to +pass an array of two `long' values. + + The header file `stdlib.h' was invented by ANSI C, and older systems +don't have a copy. We included it above to get a declaration of `exit'. + + We can find some of these portability problems by running +`autoscan', which will create a `configure.scan' file which we can use +as a prototype for our `configure.in' file. I won't show the output, +but it will notice the potential problems with `utime' and `stdlib.h'. + + In our `Makefile', we don't provide any way to install the program. +This doesn't matter much for such a simple example, but a real program +will need an `install' target. For that matter, we will also want a +`clean' target. + + +File: configure.info, Node: Getting Started Example 2, Next: Getting Started Example 3, Prev: Getting Started Example 1, Up: Getting Started Example + +Second Try +---------- + + Here is our second try at this program. + + We modify `poke.c' to use preprocessor macros to control what +features are available. (I've cheated a bit by using the same macro +names which autoconf will use). + + #include + + #ifdef STDC_HEADERS + #include + #endif + + #include + + #ifdef HAVE_UTIME_H + #include + #endif + + #ifndef HAVE_UTIME_NULL + + #include + + #ifndef HAVE_STRUCT_UTIMBUF + + struct utimbuf + { + long actime; + long modtime; + }; + + #endif + + static int + utime_now (file) + char *file; + { + struct utimbuf now; + + now.actime = now.modtime = time (NULL); + return utime (file, &now); + } + + #define utime(f, p) utime_now (f) + + #endif /* HAVE_UTIME_NULL */ + + int + main (argc, argv) + int argc; + char **argv; + { + if (argc != 2) + { + fprintf (stderr, "Usage: poke file\n"); + exit (1); + } + + if (utime (argv[1], NULL) < 0) + { + perror ("utime"); + exit (1); + } + + exit (0); + } + + Here is the associated `Makefile'. We've added support for the +preprocessor flags we use. We've also added `install' and `clean' +targets. + + # Set this to your installation directory. + bindir = /usr/local/bin + + # Uncomment this if you have the standard ANSI/ISO C header files. + # STDC_HDRS = -DSTDC_HEADERS + + # Uncomment this if you have utime.h. + # UTIME_H = -DHAVE_UTIME_H + + # Uncomment this if utime (FILE, NULL) works on your system. + # UTIME_NULL = -DHAVE_UTIME_NULL + + # Uncomment this if struct utimbuf is defined in utime.h. + # UTIMBUF = -DHAVE_STRUCT_UTIMBUF + + CC = gcc + CFLAGS = -g -O2 + + ALL_CFLAGS = $(STDC_HDRS) $(UTIME_H) $(UTIME_NULL) $(UTIMBUF) $(CFLAGS) + + all: poke + + poke: poke.o + $(CC) -o poke $(ALL_CFLAGS) $(LDFLAGS) poke.o + + .c.o: + $(CC) -c $(ALL_CFLAGS) poke.c + + install: poke + cp poke $(bindir)/poke + + clean: + rm poke poke.o + + Some problems with this approach should be clear. + + Users who want to compile poke will have to know how `utime' works +on their systems, so that they can uncomment the `Makefile' correctly. + + The installation is done using `cp', but many systems have an +`install' program which may be used, and which supports optional +features such as stripping debugging information out of the installed +binary. + + The use of `Makefile' variables like `CC', `CFLAGS' and `LDFLAGS' +follows the requirements of the GNU standards. This is convenient for +all packages, since it reduces surprises for users. However, it is +easy to get the details wrong, and wind up with a slightly nonstandard +distribution. + + +File: configure.info, Node: Getting Started Example 3, Next: Generate Files in Example, Prev: Getting Started Example 2, Up: Getting Started Example + +Third Try +--------- + + For our third try at this program, we will write a `configure.in' +script to discover the configuration features on the host system, rather +than requiring the user to edit the `Makefile'. We will also write a +`Makefile.am' rather than a `Makefile'. + + The only change to `poke.c' is to add a line at the start of the +file: + #include "config.h" + + The new `configure.in' file is as follows. + + AC_INIT(poke.c) + AM_INIT_AUTOMAKE(poke, 1.0) + AM_CONFIG_HEADER(config.h:config.in) + AC_PROG_CC + AC_HEADER_STDC + AC_CHECK_HEADERS(utime.h) + AC_EGREP_HEADER(utimbuf, utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF)) + AC_FUNC_UTIME_NULL + AC_OUTPUT(Makefile) + + The first four macros in this file, and the last one, were described +above; see *Note Write configure.in::. If we omit these macros, then +when we run `automake' we will get a reminder that we need them. + + The other macros are standard autoconf macros. + +`AC_HEADER_STDC' + Check for standard C headers. + +`AC_CHECK_HEADERS' + Check whether a particular header file exists. + +`AC_EGREP_HEADER' + Check for a particular string in a particular header file, in this + case checking for `utimbuf' in `utime.h'. + +`AC_FUNC_UTIME_NULL' + Check whether `utime' accepts a NULL second argument to set the + file change time to the current time. + + See the autoconf manual for a more complete description. + + The new `Makefile.am' file is as follows. Note how simple this is +compared to our earlier `Makefile'. + + bin_PROGRAMS = poke + + poke_SOURCES = poke.c + + This means that we should build a single program name `poke'. It +should be installed in the binary directory, which we called `bindir' +earlier. The program `poke' is built from the source file `poke.c'. + + We must also write a `acconfig.h' file. Besides `PACKAGE' and +`VERSION', which must be mentioned for all packages which use automake, +we must include `HAVE_STRUCT_UTIMBUF', since we mentioned it in an +`AC_DEFINE'. + + /* Name of package. */ + #undef PACKAGE + + /* Version of package. */ + #undef VERSION + + /* Whether utime.h defines struct utimbuf. */ + #undef HAVE_STRUCT_UTIMBUF + + +File: configure.info, Node: Generate Files in Example, Prev: Getting Started Example 3, Up: Getting Started Example + +Generate Files +-------------- + + We must now generate the other files, using the following commands. + + aclocal + autoconf + autoheader + automake + + When we run `autoheader', it will remind us of any macros we forgot +to add to `acconfig.h'. + + When we run `automake', it will want to add some files to our +distribution. It will add them automatically if we use the +`--add-missing' option. + + By default, `automake' will run in GNU mode, which means that it +will want us to create certain additional files; as of this writing, it +will want `NEWS', `README', `AUTHORS', and `ChangeLog', all of which +are files which should appear in a standard GNU distribution. We can +either add those files, or run `automake' with the `--foreign' option. + + Running these tools will generate the following files, all of which +are described in the next chapter. + + * `aclocal.m4' + + * `configure' + + * `config.in' + + * `Makefile.in' + + * `stamp-h.in' + + +File: configure.info, Node: Files, Next: Configuration Names, Prev: Getting Started, Up: Top + +Files +***** + + As was seen in the previous chapter, the GNU configure and build +system uses a number of different files. The developer must write a +few files. The others are generated by various tools. + + The system is rather flexible, and can be used in many different +ways. In describing the files that it uses, I will describe the common +case, and mention some other cases that may arise. + +* Menu: + +* Developer Files:: Developer Files. +* Build Files:: Build Files. +* Support Files:: Support Files. + + +File: configure.info, Node: Developer Files, Next: Build Files, Up: Files + +Developer Files +=============== + + This section describes the files written or generated by the +developer of a package. + +* Menu: + +* Developer Files Picture:: Developer Files Picture. +* Written Developer Files:: Written Developer Files. +* Generated Developer Files:: Generated Developer Files. + + +File: configure.info, Node: Developer Files Picture, Next: Written Developer Files, Up: Developer Files + +Developer Files Picture +----------------------- + + Here is a picture of the files which are written by the developer, +the generated files which would be included with a complete source +distribution, and the tools which create those files. The file names +are plain text and the tool names are enclosed by `*' characters (e.g., +`autoheader' is the name of a tool, not the name of a file). + + acconfig.h configure.in Makefile.am + | | | + | --------------+---------------------- | + | | | | | + v v | acinclude.m4 | | + *autoheader* | | v v + | | v --->*automake* + v |--->*aclocal* | | + config.in | | | v + | v | Makefile.in + | aclocal.m4--- + | | + v v + *autoconf* + | + v + configure + + +File: configure.info, Node: Written Developer Files, Next: Generated Developer Files, Prev: Developer Files Picture, Up: Developer Files + +Written Developer Files +----------------------- + + The following files would be written by the developer. + +`configure.in' + This is the configuration script. This script contains + invocations of autoconf macros. It may also contain ordinary + shell script code. This file will contain feature tests for + portability issues. The last thing in the file will normally be + an `AC_OUTPUT' macro listing which files to create when the + builder runs the configure script. This file is always required + when using the GNU configure system. *Note Write configure.in::. + +`Makefile.am' + This is the automake input file. It describes how the code should + be built. It consists of definitions of automake variables. It + may also contain ordinary Makefile targets. This file is only + needed when using automake (newer tools normally use automake, but + there are still older tools which have not been converted, in + which the developer writes `Makefile.in' directly). *Note Write + Makefile.am::. + +`acconfig.h' + When the configure script creates a portability header file, by + using `AM_CONFIG_HEADER' (or, if not using automake, + `AC_CONFIG_HEADER'), this file is used to describe macros which are + not recognized by the `autoheader' command. This is normally a + fairly uninteresting file, consisting of a collection of `#undef' + lines with comments. Normally any call to `AC_DEFINE' in + `configure.in' will require a line in this file. *Note Write + acconfig.h::. + +`acinclude.m4' + This file is not always required. It defines local autoconf + macros. These macros may then be used in `configure.in'. If you + don't need any local autoconf macros, then you don't need this + file at all. In fact, in general, you never need local autoconf + macros, since you can put everything in `configure.in', but + sometimes a local macro is convenient. + + Newer tools may omit `acinclude.m4', and instead use a + subdirectory, typically named `m4', and define `ACLOCAL_AMFLAGS = + -I m4' in `Makefile.am' to force `aclocal' to look there for macro + definitions. The macro definitions are then placed in separate + files in that directory. + + The `acinclude.m4' file is only used when using automake; in older + tools, the developer writes `aclocal.m4' directly, if it is needed. + + +File: configure.info, Node: Generated Developer Files, Prev: Written Developer Files, Up: Developer Files + +Generated Developer Files +------------------------- + + The following files would be generated by the developer. + + When using automake, these files are normally not generated manually +after the first time. Instead, the generated `Makefile' contains rules +to automatically rebuild the files as required. When +`AM_MAINTAINER_MODE' is used in `configure.in' (the normal case in +Cygnus code), the automatic rebuilding rules will only be defined if +you configure using the `--enable-maintainer-mode' option. + + When using automatic rebuilding, it is important to ensure that all +the various tools have been built and installed on your `PATH'. Using +automatic rebuilding is highly recommended, so much so that I'm not +going to explain what you have to do if you don't use it. + +`configure' + This is the configure script which will be run when building the + package. This is generated by `autoconf' from `configure.in' and + `aclocal.m4'. This is a shell script. + +`Makefile.in' + This is the file which the configure script will turn into the + `Makefile' at build time. This file is generated by `automake' + from `Makefile.am'. If you aren't using automake, you must write + this file yourself. This file is pretty much a normal `Makefile', + with some configure substitutions for certain variables. + +`aclocal.m4' + This file is created by the `aclocal' program, based on the + contents of `configure.in' and `acinclude.m4' (or, as noted in the + description of `acinclude.m4' above, on the contents of an `m4' + subdirectory). This file contains definitions of autoconf macros + which `autoconf' will use when generating the file `configure'. + These autoconf macros may be defined by you in `acinclude.m4' or + they may be defined by other packages such as automake, libtool or + gettext. If you aren't using automake, you will normally write + this file yourself; in that case, if `configure.in' uses only + standard autoconf macros, this file will not be needed at all. + +`config.in' + This file is created by `autoheader' based on `acconfig.h' and + `configure.in'. At build time, the configure script will define + some of the macros in it to create `config.h', which may then be + included by your program. This permits your C code to use + preprocessor conditionals to change its behaviour based on the + characteristics of the host system. This file may also be called + `config.h.in'. + +`stamp.h-in' + This rather uninteresting file, which I omitted from the picture, + is generated by `automake'. It always contains the string + `timestamp'. It is used as a timestamp file indicating whether + `config.in' is up to date. Using a timestamp file means that + `config.in' can be marked as up to date without actually changing + its modification time. This is useful since `config.in' depends + upon `configure.in', but it is easy to change `configure.in' in a + way which does not affect `config.in'. + + +File: configure.info, Node: Build Files, Next: Support Files, Prev: Developer Files, Up: Files + +Build Files +=========== + + This section describes the files which are created at configure and +build time. These are the files which somebody who builds the package +will see. + + Of course, the developer will also build the package. The +distinction between developer files and build files is not that the +developer does not see the build files, but that somebody who only +builds the package does not have to worry about the developer files. + +* Menu: + +* Build Files Picture:: Build Files Picture. +* Build Files Description:: Build Files Description. + + +File: configure.info, Node: Build Files Picture, Next: Build Files Description, Up: Build Files + +Build Files Picture +------------------- + + Here is a picture of the files which will be created at build time. +`config.status' is both a created file and a shell script which is run +to create other files, and the picture attempts to show that. + + config.in *configure* Makefile.in + | | | + | v | + | config.status | + | | | + *config.status*<======+==========>*config.status* + | | + v v + config.h Makefile + + +File: configure.info, Node: Build Files Description, Prev: Build Files Picture, Up: Build Files + +Build Files Description +----------------------- + + This is a description of the files which are created at build time. + +`config.status' + The first step in building a package is to run the `configure' + script. The `configure' script will create the file + `config.status', which is itself a shell script. When you first + run `configure', it will automatically run `config.status'. An + `Makefile' derived from an automake generated `Makefile.in' will + contain rules to automatically run `config.status' again when + necessary to recreate certain files if their inputs change. + +`Makefile' + This is the file which make will read to build the program. The + `config.status' script will transform `Makefile.in' into + `Makefile'. + +`config.h' + This file defines C preprocessor macros which C code can use to + adjust its behaviour on different systems. The `config.status' + script will transform `config.in' into `config.h'. + +`config.cache' + This file did not fit neatly into the picture, and I omitted it. + It is used by the `configure' script to cache results between + runs. This can be an important speedup. If you modify + `configure.in' in such a way that the results of old tests should + change (perhaps you have added a new library to `LDFLAGS'), then + you will have to remove `config.cache' to force the tests to be + rerun. + + The autoconf manual explains how to set up a site specific cache + file. This can speed up running `configure' scripts on your + system. + +`stamp.h' + This file, which I omitted from the picture, is similar to + `stamp-h.in'. It is used as a timestamp file indicating whether + `config.h' is up to date. This is useful since `config.h' depends + upon `config.status', but it is easy for `config.status' to change + in a way which does not affect `config.h'. + + +File: configure.info, Node: Support Files, Prev: Build Files, Up: Files + +Support Files +============= + + The GNU configure and build system requires several support files to +be included with your distribution. You do not normally need to concern +yourself with these. If you are using the Cygnus tree, most are already +present. Otherwise, they will be installed with your source by +`automake' (with the `--add-missing' option) and `libtoolize'. + + You don't have to put the support files in the top level directory. +You can put them in a subdirectory, and use the `AC_CONFIG_AUX_DIR' +macro in `configure.in' to tell `automake' and the `configure' script +where they are. + + In this section, I describe the support files, so that you can know +what they are and why they are there. + +`ABOUT-NLS' + Added by automake if you are using gettext. This is a + documentation file about the gettext project. + +`ansi2knr.c' + Used by an automake generated `Makefile' if you put `ansi2knr' in + `AUTOMAKE_OPTIONS' in `Makefile.am'. This permits compiling ANSI + C code with a K&R C compiler. + +`ansi2knr.1' + The man page which goes with `ansi2knr.c'. + +`config.guess' + A shell script which determines the configuration name for the + system on which it is run. + +`config.sub' + A shell script which canonicalizes a configuration name entered by + a user. + +`elisp-comp' + Used to compile Emacs LISP files. + +`install-sh' + A shell script which installs a program. This is used if the + configure script can not find an install binary. + +`ltconfig' + Used by libtool. This is a shell script which configures libtool + for the particular system on which it is used. + +`ltmain.sh' + Used by libtool. This is the actual libtool script which is used, + after it is configured by `ltconfig' to build a library. + +`mdate-sh' + A shell script used by an automake generated `Makefile' to pretty + print the modification time of a file. This is used to maintain + version numbers for texinfo files. + +`missing' + A shell script used if some tool is missing entirely. This is + used by an automake generated `Makefile' to avoid certain sorts of + timestamp problems. + +`mkinstalldirs' + A shell script which creates a directory, including all parent + directories. This is used by an automake generated `Makefile' + during installation. + +`texinfo.tex' + Required if you have any texinfo files. This is used when + converting Texinfo files into DVI using `texi2dvi' and TeX. + +`ylwrap' + A shell script used by an automake generated `Makefile' to run + programs like `bison', `yacc', `flex', and `lex'. These programs + default to producing output files with a fixed name, and the + `ylwrap' script runs them in a subdirectory to avoid file name + conflicts when using a parallel make program. + + +File: configure.info, Node: Configuration Names, Next: Cross Compilation Tools, Prev: Files, Up: Top + +Configuration Names +******************* + + The GNU configure system names all systems using a "configuration +name". All such names used to be triplets (they may now contain four +parts in certain cases), and the term "configuration triplet" is still +seen. + +* Menu: + +* Configuration Name Definition:: Configuration Name Definition. +* Using Configuration Names:: Using Configuration Names. + diff --git a/gnu/dist/toolchain/etc/configure.info-2 b/gnu/dist/toolchain/etc/configure.info-2 new file mode 100644 index 000000000000..2c9c6676f75c --- /dev/null +++ b/gnu/dist/toolchain/etc/configure.info-2 @@ -0,0 +1,1137 @@ +This is configure.info, produced by makeinfo version 4.0 from +./configure.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* configure: (configure). The GNU configure and build system +END-INFO-DIR-ENTRY + + This file documents the GNU configure and build system. + + Copyright (C) 1998 Cygnus Solutions. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: configure.info, Node: Configuration Name Definition, Next: Using Configuration Names, Up: Configuration Names + +Configuration Name Definition +============================= + + This is a string of the form CPU-MANUFACTURER-OPERATING_SYSTEM. In +some cases, this is extended to a four part form: +CPU-MANUFACTURER-KERNEL-OPERATING_SYSTEM. + + When using a configuration name in a configure option, it is normally +not necessary to specify an entire name. In particular, the +MANUFACTURER field is often omitted, leading to strings such as +`i386-linux' or `sparc-sunos'. The shell script `config.sub' will +translate these shortened strings into the canonical form. autoconf +will arrange for `config.sub' to be run automatically when it is needed. + + The fields of a configuration name are as follows: + +CPU + The type of processor. This is typically something like `i386' or + `sparc'. More specific variants are used as well, such as + `mipsel' to indicate a little endian MIPS processor. + +MANUFACTURER + A somewhat freeform field which indicates the manufacturer of the + system. This is often simply `unknown'. Other common strings are + `pc' for an IBM PC compatible system, or the name of a workstation + vendor, such as `sun'. + +OPERATING_SYSTEM + The name of the operating system which is run on the system. This + will be something like `solaris2.5' or `irix6.3'. There is no + particular restriction on the version number, and strings like + `aix4.1.4.0' are seen. For an embedded system, which has no + operating system, this field normally indicates the type of object + file format, such as `elf' or `coff'. + +KERNEL + This is used mainly for GNU/Linux. A typical GNU/Linux + configuration name is `i586-pc-linux-gnulibc1'. In this case the + kernel, `linux', is separated from the operating system, + `gnulibc1'. + + The shell script `config.guess' will normally print the correct +configuration name for the system on which it is run. It does by +running `uname' and by examining other characteristics of the system. + + Because `config.guess' can normally determine the configuration name +for a machine, it is normally only necessary to specify a configuration +name when building a cross-compiler or when building using a +cross-compiler. + + +File: configure.info, Node: Using Configuration Names, Prev: Configuration Name Definition, Up: Configuration Names + +Using Configuration Names +========================= + + A configure script will sometimes have to make a decision based on a +configuration name. You will need to do this if you have to compile +code differently based on something which can not be tested using a +standard autoconf feature test. + + It is normally better to test for particular features, rather than to +test for a particular system. This is because as Unix evolves, +different systems copy features from one another. Even if you need to +determine whether the feature is supported based on a configuration +name, you should define a macro which describes the feature, rather than +defining a macro which describes the particular system you are on. + + Testing for a particular system is normally done using a case +statement in `configure.in'. The case statement might look something +like the following, assuming that `host' is a shell variable holding a +canonical configuration name (which will be the case if `configure.in' +uses the `AC_CANONICAL_HOST' or `AC_CANONICAL_SYSTEM' macro). + + case "${host}" in + i[3456]86-*-linux-gnu*) do something ;; + sparc*-sun-solaris2.[56789]*) do something ;; + sparc*-sun-solaris*) do something ;; + mips*-*-elf*) do something ;; + esac + + It is particularly important to use `*' after the operating system +field, in order to match the version number which will be generated by +`config.guess'. + + In most cases you must be careful to match a range of processor +types. For most processor families, a trailing `*' suffices, as in +`mips*' above. For the i386 family, something along the lines of +`i[3456]86' suffices at present. For the m68k family, you will need +something like `m68*'. Of course, if you do not need to match on the +processor, it is simpler to just replace the entire field by a `*', as +in `*-*-irix*'. + + +File: configure.info, Node: Cross Compilation Tools, Next: Canadian Cross, Prev: Configuration Names, Up: Top + +Cross Compilation Tools +*********************** + + The GNU configure and build system can be used to build "cross +compilation" tools. A cross compilation tool is a tool which runs on +one system and produces code which runs on another system. + +* Menu: + +* Cross Compilation Concepts:: Cross Compilation Concepts. +* Host and Target:: Host and Target. +* Using the Host Type:: Using the Host Type. +* Specifying the Target:: Specifying the Target. +* Using the Target Type:: Using the Target Type. +* Cross Tools in the Cygnus Tree:: Cross Tools in the Cygnus Tree + + +File: configure.info, Node: Cross Compilation Concepts, Next: Host and Target, Up: Cross Compilation Tools + +Cross Compilation Concepts +========================== + + A compiler which produces programs which run on a different system +is a cross compilation compiler, or simply a "cross compiler". +Similarly, we speak of cross assemblers, cross linkers, etc. + + In the normal case, a compiler produces code which runs on the same +system as the one on which the compiler runs. When it is necessary to +distinguish this case from the cross compilation case, such a compiler +is called a "native compiler". Similarly, we speak of native +assemblers, etc. + + Although the debugger is not strictly speaking a compilation tool, +it is nevertheless meaningful to speak of a cross debugger: a debugger +which is used to debug code which runs on another system. Everything +that is said below about configuring cross compilation tools applies to +the debugger as well. + + +File: configure.info, Node: Host and Target, Next: Using the Host Type, Prev: Cross Compilation Concepts, Up: Cross Compilation Tools + +Host and Target +=============== + + When building cross compilation tools, there are two different +systems involved: the system on which the tools will run, and the +system for which the tools generate code. + + The system on which the tools will run is called the "host" system. + + The system for which the tools generate code is called the "target" +system. + + For example, suppose you have a compiler which runs on a GNU/Linux +system and generates ELF programs for a MIPS embedded system. In this +case the GNU/Linux system is the host, and the MIPS ELF system is the +target. Such a compiler could be called a GNU/Linux cross MIPS ELF +compiler, or, equivalently, a `i386-linux-gnu' cross `mips-elf' +compiler. + + Naturally, most programs are not cross compilation tools. For those +programs, it does not make sense to speak of a target. It only makes +sense to speak of a target for tools like `gcc' or the `binutils' which +actually produce running code. For example, it does not make sense to +speak of the target of a tool like `bison' or `make'. + + Most cross compilation tools can also serve as native tools. For a +native compilation tool, it is still meaningful to speak of a target. +For a native tool, the target is the same as the host. For example, for +a GNU/Linux native compiler, the host is GNU/Linux, and the target is +also GNU/Linux. + + +File: configure.info, Node: Using the Host Type, Next: Specifying the Target, Prev: Host and Target, Up: Cross Compilation Tools + +Using the Host Type +=================== + + In almost all cases the host system is the system on which you run +the `configure' script, and on which you build the tools (for the case +when they differ, *note Canadian Cross::). + + If your configure script needs to know the configuration name of the +host system, and the package is not a cross compilation tool and +therefore does not have a target, put `AC_CANONICAL_HOST' in +`configure.in'. This macro will arrange to define a few shell +variables when the `configure' script is run. + +`host' + The canonical configuration name of the host. This will normally + be determined by running the `config.guess' shell script, although + the user is permitted to override this by using an explicit + `--host' option. + +`host_alias' + In the unusual case that the user used an explicit `--host' option, + this will be the argument to `--host'. In the normal case, this + will be the same as the `host' variable. + +`host_cpu' +`host_vendor' +`host_os' + The first three parts of the canonical configuration name. + + The shell variables may be used by putting shell code in +`configure.in'. For an example, see *Note Using Configuration Names::. + + +File: configure.info, Node: Specifying the Target, Next: Using the Target Type, Prev: Using the Host Type, Up: Cross Compilation Tools + +Specifying the Target +===================== + + By default, the `configure' script will assume that the target is +the same as the host. This is the more common case; for example, it +leads to a native compiler rather than a cross compiler. + + If you want to build a cross compilation tool, you must specify the +target explicitly by using the `--target' option when you run +`configure'. The argument to `--target' is the configuration name of +the system for which you wish to generate code. *Note Configuration +Names::. + + For example, to build tools which generate code for a MIPS ELF +embedded system, you would use `--target mips-elf'. + + +File: configure.info, Node: Using the Target Type, Next: Cross Tools in the Cygnus Tree, Prev: Specifying the Target, Up: Cross Compilation Tools + +Using the Target Type +===================== + + When writing `configure.in' for a cross compilation tool, you will +need to use information about the target. To do this, put +`AC_CANONICAL_SYSTEM' in `configure.in'. + + `AC_CANONICAL_SYSTEM' will look for a `--target' option and +canonicalize it using the `config.sub' shell script. It will also run +`AC_CANONICAL_HOST' (*note Using the Host Type::). + + The target type will be recorded in the following shell variables. +Note that the host versions of these variables will also be defined by +`AC_CANONICAL_HOST'. + +`target' + The canonical configuration name of the target. + +`target_alias' + The argument to the `--target' option. If the user did not specify + a `--target' option, this will be the same as `host_alias'. + +`target_cpu' +`target_vendor' +`target_os' + The first three parts of the canonical target configuration name. + + Note that if `host' and `target' are the same string, you can assume +a native configuration. If they are different, you can assume a cross +configuration. + + It is arguably possible for `host' and `target' to represent the +same system, but for the strings to not be identical. For example, if +`config.guess' returns `sparc-sun-sunos4.1.4', and somebody configures +with `--target sparc-sun-sunos4.1', then the slight differences between +the two versions of SunOS may be unimportant for your tool. However, +in the general case it can be quite difficult to determine whether the +differences between two configuration names are significant or not. +Therefore, by convention, if the user specifies a `--target' option +without specifying a `--host' option, it is assumed that the user wants +to configure a cross compilation tool. + + The variables `target' and `target_alias' should be handled +differently. + + In general, whenever the user may actually see a string, +`target_alias' should be used. This includes anything which may appear +in the file system, such as a directory name or part of a tool name. +It also includes any tool output, unless it is clearly labelled as the +canonical target configuration name. This permits the user to use the +`--target' option to specify how the tool will appear to the outside +world. + + On the other hand, when checking for characteristics of the target +system, `target' should be used. This is because a wide variety of +`--target' options may map into the same canonical configuration name. +You should not attempt to duplicate the canonicalization done by +`config.sub' in your own code. + + By convention, cross tools are installed with a prefix of the +argument used with the `--target' option, also known as `target_alias' +(*note Using the Target Type::). If the user does not use the +`--target' option, and thus is building a native tool, no prefix is +used. + + For example, if gcc is configured with `--target mips-elf', then the +installed binary will be named `mips-elf-gcc'. If gcc is configured +without a `--target' option, then the installed binary will be named +`gcc'. + + The autoconf macro `AC_ARG_PROGRAM' will handle this for you. If +you are using automake, no more need be done; the programs will +automatically be installed with the correct prefixes. Otherwise, see +the autoconf documentation for `AC_ARG_PROGRAM'. + + +File: configure.info, Node: Cross Tools in the Cygnus Tree, Prev: Using the Target Type, Up: Cross Compilation Tools + +Cross Tools in the Cygnus Tree +============================== + + The Cygnus tree is used for various packages including gdb, the GNU +binutils, and egcs. It is also, of course, used for Cygnus releases. + + In the Cygnus tree, the top level `configure' script uses the old +Cygnus configure system, not autoconf. The top level `Makefile.in' is +written to build packages based on what is in the source tree, and +supports building a large number of tools in a single +`configure'/`make' step. + + The Cygnus tree may be configured with a `--target' option. The +`--target' option applies recursively to every subdirectory, and +permits building an entire set of cross tools at once. + +* Menu: + +* Host and Target Libraries:: Host and Target Libraries. +* Target Library Configure Scripts:: Target Library Configure Scripts. +* Make Targets in Cygnus Tree:: Make Targets in Cygnus Tree. +* Target libiberty:: Target libiberty + + +File: configure.info, Node: Host and Target Libraries, Next: Target Library Configure Scripts, Up: Cross Tools in the Cygnus Tree + +Host and Target Libraries +------------------------- + + The Cygnus tree distinguishes host libraries from target libraries. + + Host libraries are built with the compiler used to build the programs +which run on the host, which is called the host compiler. This includes +libraries such as `bfd' and `tcl'. These libraries are built with the +host compiler, and are linked into programs like the binutils or gcc +which run on the host. + + Target libraries are built with the target compiler. If gcc is +present in the source tree, then the target compiler is the gcc that is +built using the host compiler. Target libraries are libraries such as +`newlib' and `libstdc++'. These libraries are not linked into the host +programs, but are instead made available for use with programs built +with the target compiler. + + For the rest of this section, assume that gcc is present in the +source tree, so that it will be used to build the target libraries. + + There is a complication here. The configure process needs to know +which compiler you are going to use to build a tool; otherwise, the +feature tests will not work correctly. The Cygnus tree handles this by +not configuring the target libraries until the target compiler is +built. In order to permit everything to build using a single +`configure'/`make', the configuration of the target libraries is +actually triggered during the make step. + + When the target libraries are configured, the `--target' option is +not used. Instead, the `--host' option is used with the argument of +the `--target' option for the overall configuration. If no `--target' +option was used for the overall configuration, the `--host' option will +be passed with the output of the `config.guess' shell script. Any +`--build' option is passed down unchanged. + + This translation of configuration options is done because since the +target libraries are compiled with the target compiler, they are being +built in order to run on the target of the overall configuration. By +the definition of host, this means that their host system is the same as +the target system of the overall configuration. + + The same process is used for both a native configuration and a cross +configuration. Even when using a native configuration, the target +libraries will be configured and built using the newly built compiler. +This is particularly important for the C++ libraries, since there is no +reason to assume that the C++ compiler used to build the host tools (if +there even is one) uses the same ABI as the g++ compiler which will be +used to build the target libraries. + + There is one difference between a native configuration and a cross +configuration. In a native configuration, the target libraries are +normally configured and built as siblings of the host tools. In a cross +configuration, the target libraries are normally built in a subdirectory +whose name is the argument to `--target'. This is mainly for +historical reasons. + + To summarize, running `configure' in the Cygnus tree configures all +the host libraries and tools, but does not configure any of the target +libraries. Running `make' then does the following steps: + + * Build the host libraries. + + * Build the host programs, including gcc. Note that we call gcc + both a host program (since it runs on the host) and a target + compiler (since it generates code for the target). + + * Using the newly built target compiler, configure the target + libraries. + + * Build the target libraries. + + The steps need not be done in precisely this order, since they are +actually controlled by `Makefile' targets. + + +File: configure.info, Node: Target Library Configure Scripts, Next: Make Targets in Cygnus Tree, Prev: Host and Target Libraries, Up: Cross Tools in the Cygnus Tree + +Target Library Configure Scripts +-------------------------------- + + There are a few things you must know in order to write a configure +script for a target library. This is just a quick sketch, and beginners +shouldn't worry if they don't follow everything here. + + The target libraries are configured and built using a newly built +target compiler. There may not be any startup files or libraries for +this target compiler. In fact, those files will probably be built as +part of some target library, which naturally means that they will not +exist when your target library is configured. + + This means that the configure script for a target library may not use +any test which requires doing a link. This unfortunately includes many +useful autoconf macros, such as `AC_CHECK_FUNCS'. autoconf macros +which do a compile but not a link, such as `AC_CHECK_HEADERS', may be +used. + + This is a severe restriction, but normally not a fatal one, as target +libraries can often assume the presence of other target libraries, and +thus know which functions will be available. + + As of this writing, the autoconf macro `AC_PROG_CC' does a link to +make sure that the compiler works. This may fail in a target library, +so target libraries must use a different set of macros to locate the +compiler. See the `configure.in' file in a directory like `libiberty' +or `libgloss' for an example. + + As noted in the previous section, target libraries are sometimes +built in directories which are siblings to the host tools, and are +sometimes built in a subdirectory. The `--with-target-subdir' configure +option will be passed when the library is configured. Its value will be +an empty string if the target library is a sibling. Its value will be +the name of the subdirectory if the target library is in a subdirectory. + + If the overall build is not a native build (i.e., the overall +configure used the `--target' option), then the library will be +configured with the `--with-cross-host' option. The value of this +option will be the host system of the overall build. Recall that the +host system of the library will be the target of the overall build. If +the overall build is a native build, the `--with-cross-host' option +will not be used. + + A library which can be built both standalone and as a target library +may want to install itself into different directories depending upon the +case. When built standalone, or when built native, the library should +be installed in `$(libdir)'. When built as a target library which is +not native, the library should be installed in `$(tooldir)/lib'. The +`--with-cross-host' option may be used to distinguish these cases. + + This same test of `--with-cross-host' may be used to see whether it +is OK to use link tests in the configure script. If the +`--with-cross-host' option is not used, then the library is being built +either standalone or native, and a link should work. + + +File: configure.info, Node: Make Targets in Cygnus Tree, Next: Target libiberty, Prev: Target Library Configure Scripts, Up: Cross Tools in the Cygnus Tree + +Make Targets in Cygnus Tree +--------------------------- + + The top level `Makefile' in the Cygnus tree defines targets for +every known subdirectory. + + For every subdirectory DIR which holds a host library or program, +the `Makefile' target `all-DIR' will build that library or program. + + There are dependencies among host tools. For example, building gcc +requires first building gas, because the gcc build process invokes the +target assembler. These dependencies are reflected in the top level +`Makefile'. + + For every subdirectory DIR which holds a target library, the +`Makefile' target `configure-target-DIR' will configure that library. +The `Makefile' target `all-target-DIR' will build that library. + + Every `configure-target-DIR' target depends upon `all-gcc', since +gcc, the target compiler, is required to configure the tool. Every +`all-target-DIR' target depends upon the corresponding +`configure-target-DIR' target. + + There are several other targets which may be of interest for each +directory: `install-DIR', `clean-DIR', and `check-DIR'. There are also +corresponding `target' versions of these for the target libraries , +such as `install-target-DIR'. + + +File: configure.info, Node: Target libiberty, Prev: Make Targets in Cygnus Tree, Up: Cross Tools in the Cygnus Tree + +Target libiberty +---------------- + + The `libiberty' subdirectory is currently a special case, in that it +is the only directory which is built both using the host compiler and +using the target compiler. + + This is because the files in `libiberty' are used when building the +host tools, and they are also incorporated into the `libstdc++' target +library as support code. + + This duality does not pose any particular difficulties. It means +that there are targets for both `all-libiberty' and +`all-target-libiberty'. + + In a native configuration, when target libraries are not built in a +subdirectory, the same objects are normally used as both the host build +and the target build. This is normally OK, since libiberty contains +only C code, and in a native configuration the results of the host +compiler and the target compiler are normally interoperable. + + Irix 6 is again an exception here, since the SGI native compiler +defaults to using the `O32' ABI, and gcc defaults to using the `N32' +ABI. On Irix 6, the target libraries are built in a subdirectory even +for a native configuration, avoiding this problem. + + There are currently no other libraries built for both the host and +the target, but there is no conceptual problem with adding more. + + +File: configure.info, Node: Canadian Cross, Next: Cygnus Configure, Prev: Cross Compilation Tools, Up: Top + +Canadian Cross +************** + + It is possible to use the GNU configure and build system to build a +program which will run on a system which is different from the system on +which the tools are built. In other words, it is possible to build +programs using a cross compiler. + + This is referred to as a "Canadian Cross". + +* Menu: + +* Canadian Cross Example:: Canadian Cross Example. +* Canadian Cross Concepts:: Canadian Cross Concepts. +* Build Cross Host Tools:: Build Cross Host Tools. +* Build and Host Options:: Build and Host Options. +* CCross not in Cygnus Tree:: Canadian Cross not in Cygnus Tree. +* CCross in Cygnus Tree:: Canadian Cross in Cygnus Tree. +* Supporting Canadian Cross:: Supporting Canadian Cross. + + +File: configure.info, Node: Canadian Cross Example, Next: Canadian Cross Concepts, Up: Canadian Cross + +Canadian Cross Example +====================== + + Here is an example of a Canadian Cross. + + While running on a GNU/Linux, you can build a program which will run +on a Solaris system. You would use a GNU/Linux cross Solaris compiler +to build the program. + + Of course, you could not run the resulting program on your GNU/Linux +system. You would have to copy it over to a Solaris system before you +would run it. + + Of course, you could also simply build the programs on the Solaris +system in the first place. However, perhaps the Solaris system is not +available for some reason; perhaps you actually don't have one, but you +want to build the tools for somebody else to use. Or perhaps your +GNU/Linux system is much faster than your Solaris system. + + A Canadian Cross build is most frequently used when building +programs to run on a non-Unix system, such as DOS or Windows. It may +be simpler to configure and build on a Unix system than to support the +configuration machinery on a non-Unix system. + + +File: configure.info, Node: Canadian Cross Concepts, Next: Build Cross Host Tools, Prev: Canadian Cross Example, Up: Canadian Cross + +Canadian Cross Concepts +======================= + + When building a Canadian Cross, there are at least two different +systems involved: the system on which the tools are being built, and +the system on which the tools will run. + + The system on which the tools are being built is called the "build" +system. + + The system on which the tools will run is called the host system. + + For example, if you are building a Solaris program on a GNU/Linux +system, as in the previous section, the build system would be GNU/Linux, +and the host system would be Solaris. + + It is, of course, possible to build a cross compiler using a Canadian +Cross (i.e., build a cross compiler using a cross compiler). In this +case, the system for which the resulting cross compiler generates code +is called the target system. (For a more complete discussion of host +and target systems, *note Host and Target::). + + An example of building a cross compiler using a Canadian Cross would +be building a Windows cross MIPS ELF compiler on a GNU/Linux system. In +this case the build system would be GNU/Linux, the host system would be +Windows, and the target system would be MIPS ELF. + + The name Canadian Cross comes from the case when the build, host, and +target systems are all different. At the time that these issues were +all being hashed out, Canada had three national political parties. + + +File: configure.info, Node: Build Cross Host Tools, Next: Build and Host Options, Prev: Canadian Cross Concepts, Up: Canadian Cross + +Build Cross Host Tools +====================== + + In order to configure a program for a Canadian Cross build, you must +first build and install the set of cross tools you will use to build the +program. + + These tools will be build cross host tools. That is, they will run +on the build system, and will produce code that runs on the host system. + + It is easy to confuse the meaning of build and host here. Always +remember that the build system is where you are doing the build, and the +host system is where the resulting program will run. Therefore, you +need a build cross host compiler. + + In general, you must have a complete cross environment in order to do +the build. This normally means a cross compiler, cross assembler, and +so forth, as well as libraries and include files for the host system. + + +File: configure.info, Node: Build and Host Options, Next: CCross not in Cygnus Tree, Prev: Build Cross Host Tools, Up: Canadian Cross + +Build and Host Options +====================== + + When you run `configure', you must use both the `--build' and +`--host' options. + + The `--build' option is used to specify the configuration name of +the build system. This can normally be the result of running the +`config.guess' shell script, and it is reasonable to use +`--build=`config.guess`'. + + The `--host' option is used to specify the configuration name of the +host system. + + As we explained earlier, `config.guess' is used to set the default +value for the `--host' option (*note Using the Host Type::). We can +now see that since `config.guess' returns the type of system on which +it is run, it really identifies the build system. Since the host +system is normally the same as the build system (i.e., people do not +normally build using a cross compiler), it is reasonable to use the +result of `config.guess' as the default for the host system when the +`--host' option is not used. + + It might seem that if the `--host' option were used without the +`--build' option that the configure script could run `config.guess' to +determine the build system, and presume a Canadian Cross if the result +of `config.guess' differed from the `--host' option. However, for +historical reasons, some configure scripts are routinely run using an +explicit `--host' option, rather than using the default from +`config.guess'. As noted earlier, it is difficult or impossible to +reliably compare configuration names (*note Using the Target Type::). +Therefore, by convention, if the `--host' option is used, but the +`--build' option is not used, then the build system defaults to the +host system. + + +File: configure.info, Node: CCross not in Cygnus Tree, Next: CCross in Cygnus Tree, Prev: Build and Host Options, Up: Canadian Cross + +Canadian Cross not in Cygnus Tree. +================================== + + If you are not using the Cygnus tree, you must explicitly specify the +cross tools which you want to use to build the program. This is done by +setting environment variables before running the `configure' script. + + You must normally set at least the environment variables `CC', `AR', +and `RANLIB' to the cross tools which you want to use to build. + + For some programs, you must set additional cross tools as well, such +as `AS', `LD', or `NM'. + + You would set these environment variables to the build cross tools +which you are going to use. + + For example, if you are building a Solaris program on a GNU/Linux +system, and your GNU/Linux cross Solaris compiler were named +`solaris-gcc', then you would set the environment variable `CC' to +`solaris-gcc'. + + +File: configure.info, Node: CCross in Cygnus Tree, Next: Supporting Canadian Cross, Prev: CCross not in Cygnus Tree, Up: Canadian Cross + +Canadian Cross in Cygnus Tree +============================= + + This section describes configuring and building a Canadian Cross when +using the Cygnus tree. + +* Menu: + +* Standard Cygnus CCross:: Building a Normal Program. +* Cross Cygnus CCross:: Building a Cross Program. + + +File: configure.info, Node: Standard Cygnus CCross, Next: Cross Cygnus CCross, Up: CCross in Cygnus Tree + +Building a Normal Program +------------------------- + + When configuring a Canadian Cross in the Cygnus tree, all the +appropriate environment variables are automatically set to `HOST-TOOL', +where HOST is the value used for the `--host' option, and TOOL is the +name of the tool (e.g., `gcc', `as', etc.). These tools must be on +your `PATH'. + + Adding a prefix of HOST will give the usual name for the build cross +host tools. To see this, consider that when these cross tools were +built, they were configured to run on the build system and to produce +code for the host system. That is, they were configured with a +`--target' option that is the same as the system which we are now +calling the host. Recall that the default name for installed cross +tools uses the target system as a prefix (*note Using the Target +Type::). Since that is the system which we are now calling the host, +HOST is the right prefix to use. + + For example, if you configure with `--build=i386-linux-gnu' and +`--host=solaris', then the Cygnus tree will automatically default to +using the compiler `solaris-gcc'. You must have previously built and +installed this compiler, probably by doing a build with no `--host' +option and with a `--target' option of `solaris'. + + +File: configure.info, Node: Cross Cygnus CCross, Prev: Standard Cygnus CCross, Up: CCross in Cygnus Tree + +Building a Cross Program +------------------------ + + There are additional considerations if you want to build a cross +compiler, rather than a native compiler, in the Cygnus tree using a +Canadian Cross. + + When you build a cross compiler using the Cygnus tree, then the +target libraries will normally be built with the newly built target +compiler (*note Host and Target Libraries::). However, this will not +work when building with a Canadian Cross. This is because the newly +built target compiler will be a program which runs on the host system, +and therefore will not be able to run on the build system. + + Therefore, when building a cross compiler with the Cygnus tree, you +must first install a set of build cross target tools. These tools will +be used when building the target libraries. + + Note that this is not a requirement of a Canadian Cross in general. +For example, it would be possible to build just the host cross target +tools on the build system, to copy the tools to the host system, and to +build the target libraries on the host system. The requirement for +build cross target tools is imposed by the Cygnus tree, which expects +to be able to build both host programs and target libraries in a single +`configure'/`make' step. Because it builds these in a single step, it +expects to be able to build the target libraries on the build system, +which means that it must use a build cross target toolchain. + + For example, suppose you want to build a Windows cross MIPS ELF +compiler on a GNU/Linux system. You must have previously installed +both a GNU/Linux cross Windows compiler and a GNU/Linux cross MIPS ELF +compiler. + + In order to build the Windows (configuration name `i386-cygwin32') +cross MIPS ELF (configure name `mips-elf') compiler, you might execute +the following commands (long command lines are broken across lines with +a trailing backslash as a continuation character). + + mkdir linux-x-cygwin32 + cd linux-x-cygwin32 + SRCDIR/configure --target i386-cygwin32 --prefix=INSTALLDIR \ + --exec-prefix=INSTALLDIR/H-i386-linux + make + make install + cd .. + mkdir linux-x-mips-elf + cd linux-x-mips-elf + SRCDIR/configure --target mips-elf --prefix=INSTALLDIR \ + --exec-prefix=INSTALLDIR/H-i386-linux + make + make install + cd .. + mkdir cygwin32-x-mips-elf + cd cygwin32-x-mips-elf + SRCDIR/configure --build=i386-linux-gnu --host=i386-cygwin32 \ + --target=mips-elf --prefix=WININSTALLDIR \ + --exec-prefix=WININSTALLDIR/H-i386-cygwin32 + make + make install + + You would then copy the contents of WININSTALLDIR over to the +Windows machine, and run the resulting programs. + + +File: configure.info, Node: Supporting Canadian Cross, Prev: CCross in Cygnus Tree, Up: Canadian Cross + +Supporting Canadian Cross +========================= + + If you want to make it possible to build a program you are developing +using a Canadian Cross, you must take some care when writing your +configure and make rules. Simple cases will normally work correctly. +However, it is not hard to write configure and make tests which will +fail in a Canadian Cross. + +* Menu: + +* CCross in Configure:: Supporting Canadian Cross in Configure Scripts. +* CCross in Make:: Supporting Canadian Cross in Makefiles. + + +File: configure.info, Node: CCross in Configure, Next: CCross in Make, Up: Supporting Canadian Cross + +Supporting Canadian Cross in Configure Scripts +---------------------------------------------- + + In a `configure.in' file, after calling `AC_PROG_CC', you can find +out whether this is a Canadian Cross configure by examining the shell +variable `cross_compiling'. In a Canadian Cross, which means that the +compiler is a cross compiler, `cross_compiling' will be `yes'. In a +normal configuration, `cross_compiling' will be `no'. + + You ordinarily do not need to know the type of the build system in a +configure script. However, if you do need that information, you can get +it by using the macro `AC_CANONICAL_SYSTEM', the same macro that is +used to determine the target system. This macro will set the variables +`build', `build_alias', `build_cpu', `build_vendor', and `build_os', +which correspond to the similar `target' and `host' variables, except +that they describe the build system. + + When writing tests in `configure.in', you must remember that you +want to test the host environment, not the build environment. + + Macros like `AC_CHECK_FUNCS' which use the compiler will test the +host environment. That is because the tests will be done by running the +compiler, which is actually a build cross host compiler. If the +compiler can find the function, that means that the function is present +in the host environment. + + Tests like `test -f /dev/ptyp0', on the other hand, will test the +build environment. Remember that the configure script is running on the +build system, not the host system. If your configure scripts examines +files, those files will be on the build system. Whatever you determine +based on those files may or may not be the case on the host system. + + Most autoconf macros will work correctly for a Canadian Cross. The +main exception is `AC_TRY_RUN'. This macro tries to compile and run a +test program. This will fail in a Canadian Cross, because the program +will be compiled for the host system, which means that it will not run +on the build system. + + The `AC_TRY_RUN' macro provides an optional argument to tell the +configure script what to do in a Canadian Cross. If that argument is +not present, you will get a warning when you run `autoconf': + warning: AC_TRY_RUN called without default to allow cross compiling + +This tells you that the resulting `configure' script will not work with +a Canadian Cross. + + In some cases while it may better to perform a test at configure +time, it is also possible to perform the test at run time. In such a +case you can use the cross compiling argument to `AC_TRY_RUN' to tell +your program that the test could not be performed at configure time. + + There are a few other autoconf macros which will not work correctly +with a Canadian Cross: a partial list is `AC_FUNC_GETPGRP', +`AC_FUNC_SETPGRP', `AC_FUNC_SETVBUF_REVERSED', and +`AC_SYS_RESTARTABLE_SYSCALLS'. The `AC_CHECK_SIZEOF' macro is +generally not very useful with a Canadian Cross; it permits an optional +argument indicating the default size, but there is no way to know what +the correct default should be. + + +File: configure.info, Node: CCross in Make, Prev: CCross in Configure, Up: Supporting Canadian Cross + +Supporting Canadian Cross in Makefiles. +--------------------------------------- + + The main Canadian Cross issue in a `Makefile' arises when you want +to use a subsidiary program to generate code or data which you will then +include in your real program. + + If you compile this subsidiary program using `$(CC)' in the usual +way, you will not be able to run it. This is because `$(CC)' will +build a program for the host system, but the program is being built on +the build system. + + You must instead use a compiler for the build system, rather than the +host system. In the Cygnus tree, this make variable `$(CC_FOR_BUILD)' +will hold a compiler for the build system. + + Note that you should not include `config.h' in a file you are +compiling with `$(CC_FOR_BUILD)'. The `configure' script will build +`config.h' with information for the host system. However, you are +compiling the file using a compiler for the build system (a native +compiler). Subsidiary programs are normally simple filters which do no +user interaction, and it is normally possible to write them in a highly +portable fashion so that the absence of `config.h' is not crucial. + + The gcc `Makefile.in' shows a complex situation in which certain +files, such as `rtl.c', must be compiled into both subsidiary programs +run on the build system and into the final program. This approach may +be of interest for advanced build system hackers. Note that the build +system compiler is rather confusingly called `HOST_CC'. + + +File: configure.info, Node: Cygnus Configure, Next: Multilibs, Prev: Canadian Cross, Up: Top + +Cygnus Configure +**************** + + The Cygnus configure script predates autoconf. All of its +interesting features have been incorporated into autoconf. No new +programs should be written to use the Cygnus configure script. + + However, the Cygnus configure script is still used in a few places: +at the top of the Cygnus tree and in a few target libraries in the +Cygnus tree. Until those uses have been replaced with autoconf, some +brief notes are appropriate here. This is not complete documentation, +but it should be possible to use this as a guide while examining the +scripts themselves. + +* Menu: + +* Cygnus Configure Basics:: Cygnus Configure Basics. +* Cygnus Configure in C++ Libraries:: Cygnus Configure in C++ Libraries. + + +File: configure.info, Node: Cygnus Configure Basics, Next: Cygnus Configure in C++ Libraries, Up: Cygnus Configure + +Cygnus Configure Basics +======================= + + Cygnus configure does not use any generated files; there is no +program corresponding to `autoconf'. Instead, there is a single shell +script named `configure' which may be found at the top of the Cygnus +tree. This shell script was written by hand; it was not generated by +autoconf, and it is incorrect, and indeed harmful, to run `autoconf' in +the top level of a Cygnus tree. + + Cygnus configure works in a particular directory by examining the +file `configure.in' in that directory. That file is broken into four +separate shell scripts. + + The first is the contents of `configure.in' up to a line that starts +with `# per-host:'. This is the common part. + + The second is the rest of `configure.in' up to a line that starts +with `# per-target:'. This is the per host part. + + The third is the rest of `configure.in' up to a line that starts +with `# post-target:'. This is the per target part. + + The fourth is the remainder of `configure.in'. This is the post +target part. + + If any of these comment lines are missing, the corresponding shell +script is empty. + + Cygnus configure will first execute the common part. This must set +the shell variable `srctrigger' to the name of a source file, to +confirm that Cygnus configure is looking at the right directory. This +may set the shell variables `package_makefile_frag' and +`package_makefile_rules_frag'. + + Cygnus configure will next set the `build' and `host' shell +variables, and execute the per host part. This may set the shell +variable `host_makefile_frag'. + + Cygnus configure will next set the `target' variable, and execute +the per target part. This may set the shell variable +`target_makefile_frag'. + + Any of these scripts may set the `subdirs' shell variable. This +variable is a list of subdirectories where a `Makefile.in' file may be +found. Cygnus configure will automatically look for a `Makefile.in' +file in the current directory. The `subdirs' shell variable is not +normally used, and I believe that the only directory which uses it at +present is `newlib'. + + For each `Makefile.in', Cygnus configure will automatically create a +`Makefile' by adding definitions for `make' variables such as `host' +and `target', and automatically editing the values of `make' variables +such as `prefix' if they are present. + + Also, if any of the `makefile_frag' shell variables are set, Cygnus +configure will interpret them as file names relative to either the +working directory or the source directory, and will read the contents of +the file into the generated `Makefile'. The file contents will be read +in after the first line in `Makefile.in' which starts with `####'. + + These `Makefile' fragments are used to customize behaviour for a +particular host or target. They serve to select particular files to +compile, and to define particular preprocessor macros by providing +values for `make' variables which are then used during compilation. +Cygnus configure, unlike autoconf, normally does not do feature tests, +and normally requires support to be added manually for each new host. + + The `Makefile' fragment support is similar to the autoconf +`AC_SUBST_FILE' macro. + + After creating each `Makefile', the post target script will be run +(i.e., it may be run several times). This script may further customize +the `Makefile'. When it is run, the shell variable `Makefile' will +hold the name of the `Makefile', including the appropriate directory +component. + + Like an autoconf generated `configure' script, Cygnus configure will +create a file named `config.status' which, when run, will automatically +recreate the configuration. The `config.status' file will simply +execute the Cygnus configure script again with the appropriate +arguments. + + Any of the parts of `configure.in' may set the shell variables +`files' and `links'. Cygnus configure will set up symlinks from the +names in `links' to the files named in `files'. This is similar to the +autoconf `AC_LINK_FILES' macro. + + Finally, any of the parts of `configure.in' may set the shell +variable `configdirs' to a set of subdirectories. If it is set, Cygnus +configure will recursively run the configure process in each +subdirectory. If the subdirectory uses Cygnus configure, it will +contain a `configure.in' file but no `configure' file, in which case +Cygnus configure will invoke itself recursively. If the subdirectory +has a `configure' file, Cygnus configure assumes that it is an autoconf +generated `configure' script, and simply invokes it directly. + + +File: configure.info, Node: Cygnus Configure in C++ Libraries, Prev: Cygnus Configure Basics, Up: Cygnus Configure + +Cygnus Configure in C++ Libraries +================================= + + The C++ library configure system, written by Per Bothner, deserves +special mention. It uses Cygnus configure, but it does feature testing +like that done by autoconf generated `configure' scripts. This +approach is used in the libraries `libio', `libstdc++', and `libg++'. + + Most of the `Makefile' information is written out by the shell +script `libio/config.shared'. Each `configure.in' file sets certain +shell variables, and then invokes `config.shared' to create two package +`Makefile' fragments. These fragments are then incorporated into the +resulting `Makefile' by the Cygnus configure script. + + The file `_G_config.h' is created in the `libio' object directory by +running the shell script `libio/gen-params'. This shell script uses +feature tests to define macros and typedefs in `_G_config.h'. + + +File: configure.info, Node: Multilibs, Next: FAQ, Prev: Cygnus Configure, Up: Top + +Multilibs +********* + + For some targets gcc may have different processor requirements +depending upon command line options. An obvious example is the +`-msoft-float' option supported on several processors. This option +means that the floating point registers are not available, which means +that floating point operations must be done by calling an emulation +subroutine rather than by using machine instructions. + + For such options, gcc is often configured to compile target libraries +twice: once with `-msoft-float' and once without. When gcc compiles +target libraries more than once, the resulting libraries are called +"multilibs". + + Multilibs are not really part of the GNU configure and build system, +but we discuss them here since they require support in the `configure' +scripts and `Makefile's used for target libraries. + +* Menu: + +* Multilibs in gcc:: Multilibs in gcc. +* Multilibs in Target Libraries:: Multilibs in Target Libraries. + + +File: configure.info, Node: Multilibs in gcc, Next: Multilibs in Target Libraries, Up: Multilibs + +Multilibs in gcc +================ + + In gcc, multilibs are defined by setting the variable +`MULTILIB_OPTIONS' in the target `Makefile' fragment. Several other +`MULTILIB' variables may also be defined there. *Note The Target +Makefile Fragment: (gcc)Target Fragment. + + If you have built gcc, you can see what multilibs it uses by running +it with the `-print-multi-lib' option. The output `.;' means that no +multilibs are used. In general, the output is a sequence of lines, one +per multilib. The first part of each line, up to the `;', is the name +of the multilib directory. The second part is a list of compiler +options separated by `@' characters. + + Multilibs are built in a tree of directories. The top of the tree, +represented by `.' in the list of multilib directories, is the default +library to use when no special compiler options are used. The +subdirectories of the tree hold versions of the library to use when +particular compiler options are used. + diff --git a/gnu/dist/toolchain/etc/configure.info-3 b/gnu/dist/toolchain/etc/configure.info-3 new file mode 100644 index 000000000000..bf1dcc076b1c --- /dev/null +++ b/gnu/dist/toolchain/etc/configure.info-3 @@ -0,0 +1,285 @@ +This is configure.info, produced by makeinfo version 4.0 from +./configure.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* configure: (configure). The GNU configure and build system +END-INFO-DIR-ENTRY + + This file documents the GNU configure and build system. + + Copyright (C) 1998 Cygnus Solutions. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: configure.info, Node: Multilibs in Target Libraries, Prev: Multilibs in gcc, Up: Multilibs + +Multilibs in Target Libraries +============================= + + The target libraries in the Cygnus tree are automatically built with +multilibs. That means that each library is built multiple times. + + This default is set in the top level `configure.in' file, by adding +`--enable-multilib' to the list of arguments passed to configure when +it is run for the target libraries (*note Host and Target Libraries::). + + Each target library uses the shell script `config-ml.in', written by +Doug Evans, to prepare to build target libraries. This shell script is +invoked after the `Makefile' has been created by the `configure' +script. If multilibs are not enabled, it does nothing, otherwise it +modifies the `Makefile' to support multilibs. + + The `config-ml.in' script makes one copy of the `Makefile' for each +multilib in the appropriate subdirectory. When configuring in the +source directory (which is not recommended), it will build a symlink +tree of the sources in each subdirectory. + + The `config-ml.in' script sets several variables in the various +`Makefile's. The `Makefile.in' must have definitions for these +variables already; `config-ml.in' simply changes the existing values. +The `Makefile' should use default values for these variables which will +do the right thing in the subdirectories. + +`MULTISRCTOP' + `config-ml.in' will set this to a sequence of `../' strings, where + the number of strings is the number of multilib levels in the + source tree. The default value should be the empty string. + +`MULTIBUILDTOP' + `config-ml.in' will set this to a sequence of `../' strings, where + the number of strings is number of multilib levels in the object + directory. The default value should be the empty string. This + will differ from `MULTISRCTOP' when configuring in the source tree + (which is not recommended). + +`MULTIDIRS' + In the top level `Makefile' only, `config-ml.in' will set this to + the list of multilib subdirectories. The default value should be + the empty string. + +`MULTISUBDIR' + `config-ml.in' will set this to the installed subdirectory name to + use for this subdirectory, with a leading `/'. The default value + shold be the empty string. + +`MULTIDO' +`MULTICLEAN' + In the top level `Makefile' only, `config-ml.in' will set these + variables to commands to use when doing a recursive make. These + variables should both default to the string `true', so that by + default nothing happens. + + All references to the parent of the source directory should use the +variable `MULTISRCTOP'. Instead of writing `$(srcdir)/..', you must +write `$(srcdir)/$(MULTISRCTOP)..'. + + Similarly, references to the parent of the object directory should +use the variable `MULTIBUILDTOP'. + + In the installation target, the libraries should be installed in the +subdirectory `MULTISUBDIR'. Instead of installing +`$(libdir)/libfoo.a', install `$(libdir)$(MULTISUBDIR)/libfoo.a'. + + The `config-ml.in' script also modifies the top level `Makefile' to +add `multi-do' and `multi-clean' targets which are used when building +multilibs. + + The default target of the `Makefile' should include the following +command: + @$(MULTIDO) $(FLAGS_TO_PASS) DO=all multi-do + +This assumes that `$(FLAGS_TO_PASS)' is defined as a set of variables +to pass to a recursive invocation of `make'. This will build all the +multilibs. Note that the default value of `MULTIDO' is `true', so by +default this command will do nothing. It will only do something in the +top level `Makefile' if multilibs were enabled. + + The `install' target of the `Makefile' should include the following +command: + @$(MULTIDO) $(FLAGS_TO_PASS) DO=install multi-do + + In general, any operation, other than clean, which should be +performed on all the multilibs should use a `$(MULTIDO)' line, setting +the variable `DO' to the target of each recursive call to `make'. + + The `clean' targets (`clean', `mostlyclean', etc.) should use +`$(MULTICLEAN)'. For example, the `clean' target should do this: + @$(MULTICLEAN) DO=clean multi-clean + + +File: configure.info, Node: FAQ, Next: Index, Prev: Multilibs, Up: Top + +Frequently Asked Questions +************************** + +Which do I run first, `autoconf' or `automake'? + Except when you first add autoconf or automake support to a + package, you shouldn't run either by hand. Instead, configure + with the `--enable-maintainer-mode' option, and let `make' take + care of it. + +`autoconf' says something about undefined macros. + This means that you have macros in your `configure.in' which are + not defined by `autoconf'. You may be using an old version of + `autoconf'; try building and installing a newer one. Make sure the + newly installled `autoconf' is first on your `PATH'. Also, see + the next question. + +My `configure' script has stuff like `CY_GNU_GETTEXT' in it. + This means that you have macros in your `configure.in' which should + be defined in your `aclocal.m4' file, but aren't. This usually + means that `aclocal' was not able to appropriate definitions of the + macros. Make sure that you have installed all the packages you + need. In particular, make sure that you have installed libtool + (this is where `AM_PROG_LIBTOOL' is defined) and gettext (this is + where `CY_GNU_GETTEXT' is defined, at least in the Cygnus version + of gettext). + +My `Makefile' has `@' characters in it. + This may mean that you tried to use an autoconf substitution in + your `Makefile.in' without adding the appropriate `AC_SUBST' call + to your `configure' script. Or it may just mean that you need to + rebuild `Makefile' in your build directory. To rebuild `Makefile' + from `Makefile.in', run the shell script `config.status' with no + arguments. If you need to force `configure' to run again, first + run `config.status --recheck'. These runs are normally done + automatically by `Makefile' targets, but if your `Makefile' has + gotten messed up you'll need to help them along. + +Why do I have to run both `config.status --recheck' and `config.status'? + Normally, you don't; they will be run automatically by `Makefile' + targets. If you do need to run them, use `config.status --recheck' + to run the `configure' script again with the same arguments as the + first time you ran it. Use `config.status' (with no arguments) to + regenerate all files (`Makefile', `config.h', etc.) based on the + results of the configure script. The two cases are separate + because it isn't always necessary to regenerate all the files + after running `config.status --recheck'. The `Makefile' targets + generated by automake will use the environment variables + `CONFIG_FILES' and `CONFIG_HEADERS' to only regenerate files as + they are needed. + +What is the Cygnus tree? + The Cygnus tree is used for various packages including gdb, the GNU + binutils, and egcs. It is also, of course, used for Cygnus + releases. It is the build system which was developed at Cygnus, + using the Cygnus configure script. It permits building many + different packages with a single configure and make. The + configure scripts in the tree are being converted to autoconf, but + the general build structure remains intact. + +Why do I have to keep rebuilding and reinstalling the tools? + I know, it's a pain. Unfortunately, there are bugs in the tools + themselves which need to be fixed, and each time that happens + everybody who uses the tools need to reinstall new versions of + them. I don't know if there is going to be a clever fix until the + tools stabilize. + +Why not just have a Cygnus tree `make' target to update the tools? + The tools unfortunately need to be installed before they can be + used. That means that they must be built using an appropriate + prefix, and it seems unwise to assume that every configuration + uses an appropriate prefix. It might be possible to make them + work in place, or it might be possible to install them in some + subdirectory; so far these approaches have not been implemented. + + +File: configure.info, Node: Index, Prev: FAQ, Up: Top + +Index +***** + +* Menu: + +* --build option: Build and Host Options. +* --host option: Build and Host Options. +* --target option: Specifying the Target. +* _GNU_SOURCE: Write configure.in. +* AC_CANONICAL_HOST: Using the Host Type. +* AC_CANONICAL_SYSTEM: Using the Target Type. +* AC_CONFIG_HEADER: Write configure.in. +* AC_EXEEXT: Write configure.in. +* AC_INIT: Write configure.in. +* AC_OUTPUT: Write configure.in. +* AC_PREREQ: Write configure.in. +* AC_PROG_CC: Write configure.in. +* AC_PROG_CXX: Write configure.in. +* acconfig.h: Written Developer Files. +* acconfig.h, writing: Write acconfig.h. +* acinclude.m4: Written Developer Files. +* aclocal.m4: Generated Developer Files. +* AM_CONFIG_HEADER: Write configure.in. +* AM_DISABLE_SHARED: Write configure.in. +* AM_EXEEXT: Write configure.in. +* AM_INIT_AUTOMAKE: Write configure.in. +* AM_MAINTAINER_MODE: Write configure.in. +* AM_PROG_LIBTOOL: Write configure.in. +* AM_PROG_LIBTOOL in configure: FAQ. +* build option: Build and Host Options. +* building with a cross compiler: Canadian Cross. +* canadian cross: Canadian Cross. +* canadian cross in configure: CCross in Configure. +* canadian cross in cygnus tree: CCross in Cygnus Tree. +* canadian cross in makefile: CCross in Make. +* canadian cross, configuring: Build and Host Options. +* canonical system names: Configuration Names. +* config.cache: Build Files Description. +* config.h: Build Files Description. +* config.h.in: Generated Developer Files. +* config.in: Generated Developer Files. +* config.status: Build Files Description. +* config.status --recheck: FAQ. +* configuration names: Configuration Names. +* configuration triplets: Configuration Names. +* configure: Generated Developer Files. +* configure build system: Build and Host Options. +* configure host: Build and Host Options. +* configure target: Specifying the Target. +* configure.in: Written Developer Files. +* configure.in, writing: Write configure.in. +* configuring a canadian cross: Build and Host Options. +* cross compiler: Cross Compilation Concepts. +* cross compiler, building with: Canadian Cross. +* cross tools: Cross Compilation Tools. +* CY_GNU_GETTEXT in configure: FAQ. +* cygnus configure: Cygnus Configure. +* goals: Goals. +* history: History. +* host names: Configuration Names. +* host option: Build and Host Options. +* host system: Host and Target. +* host triplets: Configuration Names. +* HOST_CC: CCross in Make. +* libg++ configure: Cygnus Configure in C++ Libraries. +* libio configure: Cygnus Configure in C++ Libraries. +* libstdc++ configure: Cygnus Configure in C++ Libraries. +* Makefile: Build Files Description. +* Makefile, garbage characters: FAQ. +* Makefile.am: Written Developer Files. +* Makefile.am, writing: Write Makefile.am. +* Makefile.in: Generated Developer Files. +* multilibs: Multilibs. +* stamp-h: Build Files Description. +* stamp-h.in: Generated Developer Files. +* system names: Configuration Names. +* system types: Configuration Names. +* target option: Specifying the Target. +* target system: Host and Target. +* triplets: Configuration Names. +* undefined macros: FAQ. + + diff --git a/gnu/dist/toolchain/etc/configure.texi b/gnu/dist/toolchain/etc/configure.texi new file mode 100644 index 000000000000..91401671f925 --- /dev/null +++ b/gnu/dist/toolchain/etc/configure.texi @@ -0,0 +1,2644 @@ +\input texinfo +@c %**start of header +@setfilename configure.info +@settitle The GNU configure and build system +@setchapternewpage off +@c %**end of header + +@dircategory GNU admin +@direntry +* configure: (configure). The GNU configure and build system +@end direntry + +@ifinfo +This file documents the GNU configure and build system. + +Copyright (C) 1998 Cygnus Solutions. + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries copying permission +notice identical to this one except for the removal of this paragraph + + +@end ignore +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation approved +by the Foundation. +@end ifinfo + +@titlepage +@title The GNU configure and build system +@author Ian Lance Taylor + +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 1998 Cygnus Solutions + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation +approved by the Free Software Foundation. +@end titlepage + +@ifinfo +@node Top +@top GNU configure and build system + +The GNU configure and build system. + +@menu +* Introduction:: Introduction. +* Getting Started:: Getting Started. +* Files:: Files. +* Configuration Names:: Configuration Names. +* Cross Compilation Tools:: Cross Compilation Tools. +* Canadian Cross:: Canadian Cross. +* Cygnus Configure:: Cygnus Configure. +* Multilibs:: Multilibs. +* FAQ:: Frequently Asked Questions. +* Index:: Index. +@end menu + +@end ifinfo + +@node Introduction +@chapter Introduction + +This document describes the GNU configure and build systems. It +describes how autoconf, automake, libtool, and make fit together. It +also includes a discussion of the older Cygnus configure system. + +This document does not describe in detail how to use each of the tools; +see the respective manuals for that. Instead, it describes which files +the developer must write, which files are machine generated and how they +are generated, and where certain common problems should be addressed. + +@ifnothtml +This document draws on several sources, including the autoconf manual by +David MacKenzie (@pxref{Top, , autoconf overview, autoconf, Autoconf}), +the automake manual by David MacKenzie and Tom Tromey (@pxref{Top, , +automake overview, automake, GNU Automake}), the libtool manual by +Gordon Matzigkeit (@pxref{Top, , libtool overview, libtool, GNU +libtool}), and the Cygnus configure manual by K. Richard Pixley. +@end ifnothtml +@ifhtml +This document draws on several sources, including +@uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_toc.html, the +autoconf manual} by David MacKenzie, +@uref{http://www.delorie.com/gnu/docs/automake/automake_toc.html, the +automake manual} by David MacKenzie and Tom Tromey, +@uref{http://www.delorie.com/gnu/docs/libtool/libtool_toc.html, the +libtool manual} by Gordon Matzigkeit, and the Cygnus configure manual by +K. Richard Pixley. +@end ifhtml + +@menu +* Goals:: Goals. +* Tools:: The tools. +* History:: History. +* Building:: Building. +@end menu + +@node Goals +@section Goals +@cindex goals + +The GNU configure and build system has two main goals. + +The first is to simplify the development of portable programs. The +system permits the developer to concentrate on writing the program, +simplifying many details of portability across Unix and even Windows +systems, and permitting the developer to describe how to build the +program using simple rules rather than complex Makefiles. + +The second is to simplify the building of programs distributed as source +code. All programs are built using a simple, standardized, two step +process. The program builder need not install any special tools in +order to build the program. + +@node Tools +@section Tools + +The GNU configure and build system is comprised of several different +tools. Program developers must build and install all of these tools. + +People who just want to build programs from distributed sources normally +do not need any special tools beyond a Unix shell, a make program, and a +C compiler. + +@table @asis +@item autoconf +provides a general portability framework, based on testing the features +of the host system at build time. +@item automake +a system for describing how to build a program, permitting the developer +to write a simplified @file{Makefile}. +@item libtool +a standardized approach to building shared libraries. +@item gettext +provides a framework for translation of text messages into other +languages; not really discussed in this document. +@item m4 +autoconf requires the GNU version of m4; the standard Unix m4 does not +suffice. +@item perl +automake requires perl. +@end table + +@node History +@section History +@cindex history + +This is a very brief and probably inaccurate history. + +As the number of Unix variants increased during the 1980s, it became +harder to write programs which could run on all variants. While it was +often possible to use @code{#ifdef} to identify particular systems, +developers frequently did not have access to every system, and the +characteristics of some systems changed from version to version. + +By 1992, at least three different approaches had been developed: +@itemize @bullet +@item +The Metaconfig program, by Larry Wall, Harlan Stenn, and Raphael +Manfredi. +@item +The Cygnus configure script, by K. Richard Pixley, and the gcc configure +script, by Richard Stallman. These use essentially the same approach, +and the developers communicated regularly. +@item +The autoconf program, by David MacKenzie. +@end itemize + +The Metaconfig program is still used for Perl and a few other programs. +It is part of the Dist package. I do not know if it is being developed. + +In 1994, David MacKenzie and others modified autoconf to incorporate all +the features of Cygnus configure. Since then, there has been a slow but +steady conversion of GNU programs from Cygnus configure to autoconf. gcc +has been converted, eliminating the gcc configure script. + +GNU autoconf was regularly maintained until late 1996. As of this +writing in June, 1998, it has no public maintainer. + +Most programs are built using the make program, which requires the +developer to write Makefiles describing how to build the programs. +Since most programs are built in pretty much the same way, this led to a +lot of duplication. + +The X Window system is built using the imake tool, which uses a database +of rules to eliminate the duplication. However, building a tool which +was developed using imake requires that the builder have imake +installed, violating one of the goals of the GNU system. + +The new BSD make provides a standard library of Makefile fragments, +which permits developers to write very simple Makefiles. However, this +requires that the builder install the new BSD make program. + +In 1994, David MacKenzie wrote the first version of automake, which +permitted writing a simple build description which was converted into a +Makefile which could be used by the standard make program. In 1995, Tom +Tromey completely rewrote automake in Perl, and he continues to enhance +it. + +Various free packages built libraries, and by around 1995 several +included support to build shared libraries on various platforms. +However, there was no consistent approach. In early 1996, Gordon +Matzigkeit began working on libtool, which provided a standardized +approach to building shared libraries. This was integrated into +automake from the start. + +The development of automake and libtool was driven by the GNITS project, +a group of GNU maintainers who designed standardized tools to help meet +the GNU coding standards. + +@node Building +@section Building + +Most readers of this document should already know how to build a tool by +running @samp{configure} and @samp{make}. This section may serve as a +quick introduction or reminder. + +Building a tool is normally as simple as running @samp{configure} +followed by @samp{make}. You should normally run @samp{configure} from +an empty directory, using some path to refer to the @samp{configure} +script in the source directory. The directory in which you run +@samp{configure} is called the @dfn{object directory}. + +In order to use a object directory which is different from the source +directory, you must be using the GNU version of @samp{make}, which has +the required @samp{VPATH} support. Despite this restriction, using a +different object directory is highly recommended: +@itemize @bullet +@item +It keeps the files generated during the build from cluttering up your +sources. +@item +It permits you to remove the built files by simply removing the entire +build directory. +@item +It permits you to build from the same sources with several sets of +configure options simultaneously. +@end itemize + +If you don't have GNU @samp{make}, you will have to run @samp{configure} +in the source directory. All GNU packages should support this; in +particular, GNU packages should not assume the presence of GNU +@samp{make}. + +After running @samp{configure}, you can build the tools by running +@samp{make}. + +To install the tools, run @samp{make install}. Installing the tools +will copy the programs and any required support files to the +@dfn{installation directory}. The location of the installation +directory is controlled by @samp{configure} options, as described below. + +In the Cygnus tree at present, the info files are built and installed as +a separate step. To build them, run @samp{make info}. To install them, +run @samp{make install-info}. + +All @samp{configure} scripts support a wide variety of options. The +most interesting ones are @samp{--with} and @samp{--enable} options +which are generally specific to particular tools. You can usually use +the @samp{--help} option to get a list of interesting options for a +particular configure script. + +The only generic options you are likely to use are the @samp{--prefix} +and @samp{--exec-prefix} options. These options are used to specify the +installation directory. + +The directory named by the @samp{--prefix} option will hold machine +independent files such as info files. + +The directory named by the @samp{--exec-prefix} option, which is +normally a subdirectory of the @samp{--prefix} directory, will hold +machine dependent files such as executables. + +The default for @samp{--prefix} is @file{/usr/local}. The default for +@samp{--exec-prefix} is the value used for @samp{--prefix}. + +The convention used in Cygnus releases is to use a @samp{--prefix} +option of @file{/usr/cygnus/@var{release}}, where @var{release} is the +name of the release, and to use a @samp{--exec-prefix} option of +@file{/usr/cygnus/@var{release}/H-@var{host}}, where @var{host} is the +configuration name of the host system (@pxref{Configuration Names}). + +Do not use either the source or the object directory as the installation +directory. That will just lead to confusion. + +@node Getting Started +@chapter Getting Started + +To start using the GNU configure and build system with your software +package, you must write three files, and you must run some tools to +manually generate additional files. + +@menu +* Write configure.in:: Write configure.in. +* Write Makefile.am:: Write Makefile.am. +* Write acconfig.h:: Write acconfig.h. +* Generate files:: Generate files. +* Getting Started Example:: Example. +@end menu + +@node Write configure.in +@section Write configure.in +@cindex @file{configure.in}, writing + +You must first write the file @file{configure.in}. This is an autoconf +input file, and the autoconf manual describes in detail what this file +should look like. + +You will write tests in your @file{configure.in} file to check for +conditions that may change from one system to another, such as the +presence of particular header files or functions. + +For example, not all systems support the @samp{gettimeofday} function. +If you want to use the @samp{gettimeofday} function when it is +available, and to use some other function when it is not, you would +check for this by putting @samp{AC_CHECK_FUNCS(gettimeofday)} in +@file{configure.in}. + +When the configure script is run at build time, this will arrange to +define the preprocessor macro @samp{HAVE_GETTIMEOFDAY} to the value 1 if +the @samp{gettimeofday} function is available, and to not define the +macro at all if the function is not available. Your code can then use +@samp{#ifdef} to test whether it is safe to call @samp{gettimeofday}. + +If you have an existing body of code, the @samp{autoscan} program may +help identify potential portability problems, and hence configure tests +that you will want to use. +@ifnothtml +@xref{Invoking autoscan, , , autoconf, the autoconf manual}. +@end ifnothtml +@ifhtml +See @uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_4.html, the +autoscan documentation}. +@end ifhtml + +Another handy tool for an existing body of code is @samp{ifnames}. This +will show you all the preprocessor conditionals that the code already +uses. +@ifnothtml +@xref{Invoking ifnames, , , autoconf, the autoconf manual}. +@end ifnothtml +@ifhtml +See @uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_5.html, the +ifnames documentation}. +@end ifhtml + +Besides the portability tests which are specific to your particular +package, every @file{configure.in} file should contain the following +macros. + +@table @samp +@item AC_INIT +@cindex @samp{AC_INIT} +This macro takes a single argument, which is the name of a file in your +package. For example, @samp{AC_INIT(foo.c)}. + +@item AC_PREREQ(@var{VERSION}) +@cindex @samp{AC_PREREQ} +This macro is optional. It may be used to indicate the version of +@samp{autoconf} that you are using. This will prevent users from +running an earlier version of @samp{autoconf} and perhaps getting an +invalid @file{configure} script. For example, @samp{AC_PREREQ(2.12)}. + +@item AM_INIT_AUTOMAKE +@cindex @samp{AM_INIT_AUTOMAKE} +This macro takes two arguments: the name of the package, and a version +number. For example, @samp{AM_INIT_AUTOMAKE(foo, 1.0)}. (This macro is +not needed if you are not using automake). + +@item AM_CONFIG_HEADER +@cindex @samp{AM_CONFIG_HEADER} +This macro names the header file which will hold the preprocessor macro +definitions at run time. Normally this should be @file{config.h}. Your +sources would then use @samp{#include "config.h"} to include it. + +This macro may optionally name the input file for that header file; by +default, this is @file{config.h.in}, but that file name works poorly on +DOS filesystems. Therefore, it is often better to name it explicitly as +@file{config.in}. + +This is what you should normally put in @file{configure.in}: +@example +AM_CONFIG_HEADER(config.h:config.in) +@end example + +@cindex @samp{AC_CONFIG_HEADER} +(If you are not using automake, use @samp{AC_CONFIG_HEADER} rather than +@samp{AM_CONFIG_HEADER}). + +@item AM_MAINTAINER_MODE +@cindex @samp{AM_MAINTAINER_MODE} +This macro always appears in Cygnus configure scripts. Other programs +may or may not use it. + +If this macro is used, the @samp{--enable-maintainer-mode} option is +required to enable automatic rebuilding of generated files used by the +configure system. This of course requires that developers be aware of, +and use, that option. + +If this macro is not used, then the generated files will always be +rebuilt automatically. This will cause problems if the wrong versions +of autoconf, automake, or others are in the builder's @samp{PATH}. + +(If you are not using automake, you do not need to use this macro). + +@item AC_EXEEXT +@cindex @samp{AC_EXEEXT} +@cindex @samp{AM_EXEEXT} +Either this macro or @samp{AM_EXEEXT} always appears in Cygnus configure +files. Other programs may or may not use one of them. + +This macro looks for the executable suffix used on the host system. On +Unix systems, this is the empty string. On Windows systems, this is +@samp{.exe}. This macro directs automake to use the executable suffix +as appropriate when creating programs. This macro does not take any +arguments. + +The @samp{AC_EXEEXT} form is new, and is part of a Cygnus patch to +autoconf to support compiling with Visual C++. Older programs use +@samp{AM_EXEEXT} instead. + +(Programs which do not use automake use neither @samp{AC_EXEEXT} nor +@samp{AM_EXEEXT}). + +@item AC_PROG_CC +@cindex @samp{AC_PROG_CC} +If you are writing C code, you will normally want to use this macro. It +locates the C compiler to use. It does not take any arguments. + +However, if this @file{configure.in} file is for a library which is to +be compiled by a cross compiler which may not fully work, then you will +not want to use @samp{AC_PROG_CC}. Instead, you will want to use a +variant which does not call the macro @samp{AC_PROG_CC_WORKS}. Examples +can be found in various @file{configure.in} files for libraries that are +compiled with cross compilers, such as libiberty or libgloss. This is +essentially a bug in autoconf, and there will probably be a better +workaround at some point. + +@item AC_PROG_CXX +@cindex @samp{AC_PROG_CXX} +If you are writing C++ code, you will want to use this macro. It +locates the C++ compiler to use. It does not take any arguments. The +same cross compiler comments apply as for @samp{AC_PROG_CC}. + +@item AM_PROG_LIBTOOL +@cindex @samp{AM_PROG_LIBTOOL} +If you want to build libraries, and you want to permit them to be +shared, or you want to link against libraries which were built using +libtool, then you will need this macro. This macro is required in order +to use libtool. + +@cindex @samp{AM_DISABLE_SHARED} +By default, this will cause all libraries to be built as shared +libraries. To prevent this--to change the default--use +@samp{AM_DISABLE_SHARED} before @samp{AM_PROG_LIBTOOL}. The configure +options @samp{--enable-shared} and @samp{--disable-shared} may be used +to override the default at build time. + +@item AC_DEFINE(_GNU_SOURCE) +@cindex @samp{_GNU_SOURCE} +GNU packages should normally include this line before any other feature +tests. This defines the macro @samp{_GNU_SOURCE} when compiling, which +directs the libc header files to provide the standard GNU system +interfaces including all GNU extensions. If this macro is not defined, +certain GNU extensions may not be available. + +@item AC_OUTPUT +@cindex @samp{AC_OUTPUT} +This macro takes a list of file names which the configure process should +produce. This is normally a list of one or more @file{Makefile} files +in different directories. If your package lives entirely in a single +directory, you would use simply @samp{AC_OUTPUT(Makefile)}. If you also +have, for example, a @file{lib} subdirectory, you would use +@samp{AC_OUTPUT(Makefile lib/Makefile)}. +@end table + +If you want to use locally defined macros in your @file{configure.in} +file, then you will need to write a @file{acinclude.m4} file which +defines them (if not using automake, this file is called +@file{aclocal.m4}). Alternatively, you can put separate macros in an +@file{m4} subdirectory, and put @samp{ACLOCAL_AMFLAGS = -I m4} in your +@file{Makefile.am} file so that the @samp{aclocal} program will be able +to find them. + +The different macro prefixes indicate which tool defines the macro. +Macros which start with @samp{AC_} are part of autoconf. Macros which +start with @samp{AM_} are provided by automake or libtool. + +@node Write Makefile.am +@section Write Makefile.am +@cindex @file{Makefile.am}, writing + +You must write the file @file{Makefile.am}. This is an automake input +file, and the automake manual describes in detail what this file should +look like. + +The automake commands in @file{Makefile.am} mostly look like variable +assignments in a @file{Makefile}. automake recognizes special variable +names, and automatically add make rules to the output as needed. + +There will be one @file{Makefile.am} file for each directory in your +package. For each directory with subdirectories, the @file{Makefile.am} +file should contain the line +@smallexample +SUBDIRS = @var{dir} @var{dir} @dots{} +@end smallexample +@noindent +where each @var{dir} is the name of a subdirectory. + +For each @file{Makefile.am}, there should be a corresponding +@file{Makefile} in the @samp{AC_OUTPUT} macro in @file{configure.in}. + +Every @file{Makefile.am} written at Cygnus should contain the line +@smallexample +AUTOMAKE_OPTIONS = cygnus +@end smallexample +@noindent +This puts automake into Cygnus mode. See the automake manual for +details. + +You may to include the version number of @samp{automake} that you are +using on the @samp{AUTOMAKE_OPTIONS} line. For example, +@smallexample +AUTOMAKE_OPTIONS = cygnus 1.3 +@end smallexample +@noindent +This will prevent users from running an earlier version of +@samp{automake} and perhaps getting an invalid @file{Makefile.in}. + +If your package builds a program, then in the directory where that +program is built you will normally want a line like +@smallexample +bin_PROGRAMS = @var{program} +@end smallexample +@noindent +where @var{program} is the name of the program. You will then want a +line like +@smallexample +@var{program}_SOURCES = @var{file} @var{file} @dots{} +@end smallexample +@noindent +where each @var{file} is the name of a source file to link into the +program (e.g., @samp{foo.c}). + +If your package builds a library, and you do not want the library to +ever be built as a shared library, then in the directory where that +library is built you will normally want a line like +@smallexample +lib_LIBRARIES = lib@var{name}.a +@end smallexample +@noindent +where @samp{lib@var{name}.a} is the name of the library. You will then +want a line like +@smallexample +lib@var{name}_a_SOURCES = @var{file} @var{file} @dots{} +@end smallexample +@noindent +where each @var{file} is the name of a source file to add to the +library. + +If your package builds a library, and you want to permit building the +library as a shared library, then in the directory where that library is +built you will normally want a line like +@smallexample +lib_LTLIBRARIES = lib@var{name}.la +@end smallexample +The use of @samp{LTLIBRARIES}, and the @samp{.la} extension, indicate a +library to be built using libtool. As usual, you will then want a line +like +@smallexample +lib@var{name}_la_SOURCES = @var{file} @var{file} @dots{} +@end smallexample + +The strings @samp{bin} and @samp{lib} that appear above in +@samp{bin_PROGRAMS} and @samp{lib_LIBRARIES} are not arbitrary. They +refer to particular directories, which may be set by the @samp{--bindir} +and @samp{--libdir} options to @file{configure}. If those options are +not used, the default values are based on the @samp{--prefix} or +@samp{--exec-prefix} options to @file{configure}. It is possible to use +other names if the program or library should be installed in some other +directory. + +The @file{Makefile.am} file may also contain almost anything that may +appear in a normal @file{Makefile}. automake also supports many other +special variables, as well as conditionals. + +See the automake manual for more information. + +@node Write acconfig.h +@section Write acconfig.h +@cindex @file{acconfig.h}, writing + +If you are generating a portability header file, (i.e., you are using +@samp{AM_CONFIG_HEADER} in @file{configure.in}), then you will have to +write a @file{acconfig.h} file. It will have to contain the following +lines. + +@smallexample +/* Name of package. */ +#undef PACKAGE + +/* Version of package. */ +#undef VERSION +@end smallexample + +This requirement is really a bug in the system, and the requirement may +be eliminated at some later date. + +The @file{acconfig.h} file will also similar comment and @samp{#undef} +lines for any unusual macros in the @file{configure.in} file, including +any macro which appears in a @samp{AC_DEFINE} macro. + +In particular, if you are writing a GNU package and therefore include +@samp{AC_DEFINE(_GNU_SOURCE)} in @file{configure.in} as suggested above, +you will need lines like this in @file{acconfig.h}: +@smallexample +/* Enable GNU extensions. */ +#undef _GNU_SOURCE +@end smallexample + +Normally the @samp{autoheader} program will inform you of any such +requirements by printing an error message when it is run. However, if +you do anything particular odd in your @file{configure.in} file, you +will have to make sure that the right entries appear in +@file{acconfig.h}, since otherwise the results of the tests may not be +available in the @file{config.h} file which your code will use. + +(Thee @samp{PACKAGE} and @samp{VERSION} lines are not required if you +are not using automake, and in that case you may not need a +@file{acconfig.h} file at all). + +@node Generate files +@section Generate files + +Once you have written @file{configure.in}, @file{Makefile.am}, +@file{acconfig.h}, and possibly @file{acinclude.m4}, you must use +autoconf and automake programs to produce the first versions of the +generated files. This is done by executing the following sequence of +commands. + +@smallexample +aclocal +autoconf +autoheader +automake +@end smallexample + +The @samp{aclocal} and @samp{automake} commands are part of the automake +package, and the @samp{autoconf} and @samp{autoheader} commands are part +of the autoconf package. + +If you are using a @file{m4} subdirectory for your macros, you will need +to use the @samp{-I m4} option when you run @samp{aclocal}. + +If you are not using the Cygnus tree, use the @samp{-a} option when +running @samp{automake} command in order to copy the required support +files into your source directory. + +If you are using libtool, you must build and install the libtool package +with the same @samp{--prefix} and @samp{--exec-prefix} options as you +used with the autoconf and automake packages. You must do this before +running any of the above commands. If you are not using the Cygnus +tree, you will need to run the @samp{libtoolize} program to copy the +libtool support files into your directory. + +Once you have managed to run these commands without getting any errors, +you should create a new empty directory, and run the @samp{configure} +script which will have been created by @samp{autoconf} with the +@samp{--enable-maintainer-mode} option. This will give you a set of +Makefiles which will include rules to automatically rebuild all the +generated files. + +After doing that, whenever you have changed some of the input files and +want to regenerated the other files, go to your object directory and run +@samp{make}. Doing this is more reliable than trying to rebuild the +files manually, because there are complex order dependencies and it is +easy to forget something. + +@node Getting Started Example +@section Example + +Let's consider a trivial example. + +Suppose we want to write a simple version of @samp{touch}. Our program, +which we will call @samp{poke}, will take a single file name argument, +and use the @samp{utime} system call to set the modification and access +times of the file to the current time. We want this program to be +highly portable. + +We'll first see what this looks like without using autoconf and +automake, and then see what it looks like with them. + +@menu +* Getting Started Example 1:: First Try. +* Getting Started Example 2:: Second Try. +* Getting Started Example 3:: Third Try. +* Generate Files in Example:: Generate Files. +@end menu + +@node Getting Started Example 1 +@subsection First Try + +Here is our first try at @samp{poke.c}. Note that we've written it +without ANSI/ISO C prototypes, since we want it to be highly portable. + +@example +#include +#include +#include +#include + +int +main (argc, argv) + int argc; + char **argv; +@{ + if (argc != 2) + @{ + fprintf (stderr, "Usage: poke file\n"); + exit (1); + @} + + if (utime (argv[1], NULL) < 0) + @{ + perror ("utime"); + exit (1); + @} + + exit (0); +@} +@end example + +We also write a simple @file{Makefile}. + +@example +CC = gcc +CFLAGS = -g -O2 + +all: poke + +poke: poke.o + $(CC) -o poke $(CFLAGS) $(LDFLAGS) poke.o +@end example + +So far, so good. + +Unfortunately, there are a few problems. + +On older Unix systems derived from BSD 4.3, the @samp{utime} system call +does not accept a second argument of @samp{NULL}. On those systems, we +need to pass a pointer to @samp{struct utimbuf} structure. +Unfortunately, even older systems don't define that structure; on those +systems, we need to pass an array of two @samp{long} values. + +The header file @file{stdlib.h} was invented by ANSI C, and older +systems don't have a copy. We included it above to get a declaration of +@samp{exit}. + +We can find some of these portability problems by running +@samp{autoscan}, which will create a @file{configure.scan} file which we +can use as a prototype for our @file{configure.in} file. I won't show +the output, but it will notice the potential problems with @samp{utime} +and @file{stdlib.h}. + +In our @file{Makefile}, we don't provide any way to install the program. +This doesn't matter much for such a simple example, but a real program +will need an @samp{install} target. For that matter, we will also want +a @samp{clean} target. + +@node Getting Started Example 2 +@subsection Second Try + +Here is our second try at this program. + +We modify @file{poke.c} to use preprocessor macros to control what +features are available. (I've cheated a bit by using the same macro +names which autoconf will use). + +@example +#include + +#ifdef STDC_HEADERS +#include +#endif + +#include + +#ifdef HAVE_UTIME_H +#include +#endif + +#ifndef HAVE_UTIME_NULL + +#include + +#ifndef HAVE_STRUCT_UTIMBUF + +struct utimbuf +@{ + long actime; + long modtime; +@}; + +#endif + +static int +utime_now (file) + char *file; +@{ + struct utimbuf now; + + now.actime = now.modtime = time (NULL); + return utime (file, &now); +@} + +#define utime(f, p) utime_now (f) + +#endif /* HAVE_UTIME_NULL */ + +int +main (argc, argv) + int argc; + char **argv; +@{ + if (argc != 2) + @{ + fprintf (stderr, "Usage: poke file\n"); + exit (1); + @} + + if (utime (argv[1], NULL) < 0) + @{ + perror ("utime"); + exit (1); + @} + + exit (0); +@} +@end example + +Here is the associated @file{Makefile}. We've added support for the +preprocessor flags we use. We've also added @samp{install} and +@samp{clean} targets. + +@example +# Set this to your installation directory. +bindir = /usr/local/bin + +# Uncomment this if you have the standard ANSI/ISO C header files. +# STDC_HDRS = -DSTDC_HEADERS + +# Uncomment this if you have utime.h. +# UTIME_H = -DHAVE_UTIME_H + +# Uncomment this if utime (FILE, NULL) works on your system. +# UTIME_NULL = -DHAVE_UTIME_NULL + +# Uncomment this if struct utimbuf is defined in utime.h. +# UTIMBUF = -DHAVE_STRUCT_UTIMBUF + +CC = gcc +CFLAGS = -g -O2 + +ALL_CFLAGS = $(STDC_HDRS) $(UTIME_H) $(UTIME_NULL) $(UTIMBUF) $(CFLAGS) + +all: poke + +poke: poke.o + $(CC) -o poke $(ALL_CFLAGS) $(LDFLAGS) poke.o + +.c.o: + $(CC) -c $(ALL_CFLAGS) poke.c + +install: poke + cp poke $(bindir)/poke + +clean: + rm poke poke.o +@end example + +Some problems with this approach should be clear. + +Users who want to compile poke will have to know how @samp{utime} works +on their systems, so that they can uncomment the @file{Makefile} +correctly. + +The installation is done using @samp{cp}, but many systems have an +@samp{install} program which may be used, and which supports optional +features such as stripping debugging information out of the installed +binary. + +The use of @file{Makefile} variables like @samp{CC}, @samp{CFLAGS} and +@samp{LDFLAGS} follows the requirements of the GNU standards. This is +convenient for all packages, since it reduces surprises for users. +However, it is easy to get the details wrong, and wind up with a +slightly nonstandard distribution. + +@node Getting Started Example 3 +@subsection Third Try + +For our third try at this program, we will write a @file{configure.in} +script to discover the configuration features on the host system, rather +than requiring the user to edit the @file{Makefile}. We will also write +a @file{Makefile.am} rather than a @file{Makefile}. + +The only change to @file{poke.c} is to add a line at the start of the +file: +@smallexample +#include "config.h" +@end smallexample + +The new @file{configure.in} file is as follows. + +@example +AC_INIT(poke.c) +AM_INIT_AUTOMAKE(poke, 1.0) +AM_CONFIG_HEADER(config.h:config.in) +AC_PROG_CC +AC_HEADER_STDC +AC_CHECK_HEADERS(utime.h) +AC_EGREP_HEADER(utimbuf, utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF)) +AC_FUNC_UTIME_NULL +AC_OUTPUT(Makefile) +@end example + +The first four macros in this file, and the last one, were described +above; see @ref{Write configure.in}. If we omit these macros, then when +we run @samp{automake} we will get a reminder that we need them. + +The other macros are standard autoconf macros. + +@table @samp +@item AC_HEADER_STDC +Check for standard C headers. +@item AC_CHECK_HEADERS +Check whether a particular header file exists. +@item AC_EGREP_HEADER +Check for a particular string in a particular header file, in this case +checking for @samp{utimbuf} in @file{utime.h}. +@item AC_FUNC_UTIME_NULL +Check whether @samp{utime} accepts a NULL second argument to set the +file change time to the current time. +@end table + +See the autoconf manual for a more complete description. + +The new @file{Makefile.am} file is as follows. Note how simple this is +compared to our earlier @file{Makefile}. + +@example +bin_PROGRAMS = poke + +poke_SOURCES = poke.c +@end example + +This means that we should build a single program name @samp{poke}. It +should be installed in the binary directory, which we called +@samp{bindir} earlier. The program @samp{poke} is built from the source +file @file{poke.c}. + +We must also write a @file{acconfig.h} file. Besides @samp{PACKAGE} and +@samp{VERSION}, which must be mentioned for all packages which use +automake, we must include @samp{HAVE_STRUCT_UTIMBUF}, since we mentioned +it in an @samp{AC_DEFINE}. + +@example +/* Name of package. */ +#undef PACKAGE + +/* Version of package. */ +#undef VERSION + +/* Whether utime.h defines struct utimbuf. */ +#undef HAVE_STRUCT_UTIMBUF +@end example + +@node Generate Files in Example +@subsection Generate Files + +We must now generate the other files, using the following commands. + +@smallexample +aclocal +autoconf +autoheader +automake +@end smallexample + +When we run @samp{autoheader}, it will remind us of any macros we forgot +to add to @file{acconfig.h}. + +When we run @samp{automake}, it will want to add some files to our +distribution. It will add them automatically if we use the +@samp{--add-missing} option. + +By default, @samp{automake} will run in GNU mode, which means that it +will want us to create certain additional files; as of this writing, it +will want @file{NEWS}, @file{README}, @file{AUTHORS}, and +@file{ChangeLog}, all of which are files which should appear in a +standard GNU distribution. We can either add those files, or run +@samp{automake} with the @samp{--foreign} option. + +Running these tools will generate the following files, all of which are +described in the next chapter. + +@itemize @bullet +@item +@file{aclocal.m4} +@item +@file{configure} +@item +@file{config.in} +@item +@file{Makefile.in} +@item +@file{stamp-h.in} +@end itemize + +@node Files +@chapter Files + +As was seen in the previous chapter, the GNU configure and build system +uses a number of different files. The developer must write a few files. +The others are generated by various tools. + +The system is rather flexible, and can be used in many different ways. +In describing the files that it uses, I will describe the common case, +and mention some other cases that may arise. + +@menu +* Developer Files:: Developer Files. +* Build Files:: Build Files. +* Support Files:: Support Files. +@end menu + +@node Developer Files +@section Developer Files + +This section describes the files written or generated by the developer +of a package. + +@menu +* Developer Files Picture:: Developer Files Picture. +* Written Developer Files:: Written Developer Files. +* Generated Developer Files:: Generated Developer Files. +@end menu + +@node Developer Files Picture +@subsection Developer Files Picture + +Here is a picture of the files which are written by the developer, the +generated files which would be included with a complete source +distribution, and the tools which create those files. +@ifinfo +The file names are plain text and the tool names are enclosed by +@samp{*} characters +@end ifinfo +@ifnotinfo +The file names are in rectangles with square corners and the tool names +are in rectangles with rounded corners +@end ifnotinfo +(e.g., @samp{autoheader} is the name of a tool, not the name of a file). + +@image{configdev} + +@node Written Developer Files +@subsection Written Developer Files + +The following files would be written by the developer. + +@table @file +@item configure.in +@cindex @file{configure.in} +This is the configuration script. This script contains invocations of +autoconf macros. It may also contain ordinary shell script code. This +file will contain feature tests for portability issues. The last thing +in the file will normally be an @samp{AC_OUTPUT} macro listing which +files to create when the builder runs the configure script. This file +is always required when using the GNU configure system. @xref{Write +configure.in}. + +@item Makefile.am +@cindex @file{Makefile.am} +This is the automake input file. It describes how the code should be +built. It consists of definitions of automake variables. It may also +contain ordinary Makefile targets. This file is only needed when using +automake (newer tools normally use automake, but there are still older +tools which have not been converted, in which the developer writes +@file{Makefile.in} directly). @xref{Write Makefile.am}. + +@item acconfig.h +@cindex @file{acconfig.h} +When the configure script creates a portability header file, by using +@samp{AM_CONFIG_HEADER} (or, if not using automake, +@samp{AC_CONFIG_HEADER}), this file is used to describe macros which are +not recognized by the @samp{autoheader} command. This is normally a +fairly uninteresting file, consisting of a collection of @samp{#undef} +lines with comments. Normally any call to @samp{AC_DEFINE} in +@file{configure.in} will require a line in this file. @xref{Write +acconfig.h}. + +@item acinclude.m4 +@cindex @file{acinclude.m4} +This file is not always required. It defines local autoconf macros. +These macros may then be used in @file{configure.in}. If you don't need +any local autoconf macros, then you don't need this file at all. In +fact, in general, you never need local autoconf macros, since you can +put everything in @file{configure.in}, but sometimes a local macro is +convenient. + +Newer tools may omit @file{acinclude.m4}, and instead use a +subdirectory, typically named @file{m4}, and define +@samp{ACLOCAL_AMFLAGS = -I m4} in @file{Makefile.am} to force +@samp{aclocal} to look there for macro definitions. The macro +definitions are then placed in separate files in that directory. + +The @file{acinclude.m4} file is only used when using automake; in older +tools, the developer writes @file{aclocal.m4} directly, if it is needed. +@end table + +@node Generated Developer Files +@subsection Generated Developer Files + +The following files would be generated by the developer. + +When using automake, these files are normally not generated manually +after the first time. Instead, the generated @file{Makefile} contains +rules to automatically rebuild the files as required. When +@samp{AM_MAINTAINER_MODE} is used in @file{configure.in} (the normal +case in Cygnus code), the automatic rebuilding rules will only be +defined if you configure using the @samp{--enable-maintainer-mode} +option. + +When using automatic rebuilding, it is important to ensure that all the +various tools have been built and installed on your @samp{PATH}. Using +automatic rebuilding is highly recommended, so much so that I'm not +going to explain what you have to do if you don't use it. + +@table @file +@item configure +@cindex @file{configure} +This is the configure script which will be run when building the +package. This is generated by @samp{autoconf} from @file{configure.in} +and @file{aclocal.m4}. This is a shell script. + +@item Makefile.in +@cindex @file{Makefile.in} +This is the file which the configure script will turn into the +@file{Makefile} at build time. This file is generated by +@samp{automake} from @file{Makefile.am}. If you aren't using automake, +you must write this file yourself. This file is pretty much a normal +@file{Makefile}, with some configure substitutions for certain +variables. + +@item aclocal.m4 +@cindex @file{aclocal.m4} +This file is created by the @samp{aclocal} program, based on the +contents of @file{configure.in} and @file{acinclude.m4} (or, as noted in +the description of @file{acinclude.m4} above, on the contents of an +@file{m4} subdirectory). This file contains definitions of autoconf +macros which @samp{autoconf} will use when generating the file +@file{configure}. These autoconf macros may be defined by you in +@file{acinclude.m4} or they may be defined by other packages such as +automake, libtool or gettext. If you aren't using automake, you will +normally write this file yourself; in that case, if @file{configure.in} +uses only standard autoconf macros, this file will not be needed at all. + +@item config.in +@cindex @file{config.in} +@cindex @file{config.h.in} +This file is created by @samp{autoheader} based on @file{acconfig.h} and +@file{configure.in}. At build time, the configure script will define +some of the macros in it to create @file{config.h}, which may then be +included by your program. This permits your C code to use preprocessor +conditionals to change its behaviour based on the characteristics of the +host system. This file may also be called @file{config.h.in}. + +@item stamp.h-in +@cindex @file{stamp-h.in} +This rather uninteresting file, which I omitted from the picture, is +generated by @samp{automake}. It always contains the string +@samp{timestamp}. It is used as a timestamp file indicating whether +@file{config.in} is up to date. Using a timestamp file means that +@file{config.in} can be marked as up to date without actually changing +its modification time. This is useful since @file{config.in} depends +upon @file{configure.in}, but it is easy to change @file{configure.in} +in a way which does not affect @file{config.in}. +@end table + +@node Build Files +@section Build Files + +This section describes the files which are created at configure and +build time. These are the files which somebody who builds the package +will see. + +Of course, the developer will also build the package. The distinction +between developer files and build files is not that the developer does +not see the build files, but that somebody who only builds the package +does not have to worry about the developer files. + +@menu +* Build Files Picture:: Build Files Picture. +* Build Files Description:: Build Files Description. +@end menu + +@node Build Files Picture +@subsection Build Files Picture + +Here is a picture of the files which will be created at build time. +@file{config.status} is both a created file and a shell script which is +run to create other files, and the picture attempts to show that. + +@image{configbuild} + +@node Build Files Description +@subsection Build Files Description + +This is a description of the files which are created at build time. + +@table @file +@item config.status +@cindex @file{config.status} +The first step in building a package is to run the @file{configure} +script. The @file{configure} script will create the file +@file{config.status}, which is itself a shell script. When you first +run @file{configure}, it will automatically run @file{config.status}. +An @file{Makefile} derived from an automake generated @file{Makefile.in} +will contain rules to automatically run @file{config.status} again when +necessary to recreate certain files if their inputs change. + +@item Makefile +@cindex @file{Makefile} +This is the file which make will read to build the program. The +@file{config.status} script will transform @file{Makefile.in} into +@file{Makefile}. + +@item config.h +@cindex @file{config.h} +This file defines C preprocessor macros which C code can use to adjust +its behaviour on different systems. The @file{config.status} script +will transform @file{config.in} into @file{config.h}. + +@item config.cache +@cindex @file{config.cache} +This file did not fit neatly into the picture, and I omitted it. It is +used by the @file{configure} script to cache results between runs. This +can be an important speedup. If you modify @file{configure.in} in such +a way that the results of old tests should change (perhaps you have +added a new library to @samp{LDFLAGS}), then you will have to remove +@file{config.cache} to force the tests to be rerun. + +The autoconf manual explains how to set up a site specific cache file. +This can speed up running @file{configure} scripts on your system. + +@item stamp.h +@cindex @file{stamp-h} +This file, which I omitted from the picture, is similar to +@file{stamp-h.in}. It is used as a timestamp file indicating whether +@file{config.h} is up to date. This is useful since @file{config.h} +depends upon @file{config.status}, but it is easy for +@file{config.status} to change in a way which does not affect +@file{config.h}. +@end table + +@node Support Files +@section Support Files + +The GNU configure and build system requires several support files to be +included with your distribution. You do not normally need to concern +yourself with these. If you are using the Cygnus tree, most are already +present. Otherwise, they will be installed with your source by +@samp{automake} (with the @samp{--add-missing} option) and +@samp{libtoolize}. + +You don't have to put the support files in the top level directory. You +can put them in a subdirectory, and use the @samp{AC_CONFIG_AUX_DIR} +macro in @file{configure.in} to tell @samp{automake} and the +@file{configure} script where they are. + +In this section, I describe the support files, so that you can know what +they are and why they are there. + +@table @file +@item ABOUT-NLS +Added by automake if you are using gettext. This is a documentation +file about the gettext project. +@item ansi2knr.c +Used by an automake generated @file{Makefile} if you put @samp{ansi2knr} +in @samp{AUTOMAKE_OPTIONS} in @file{Makefile.am}. This permits +compiling ANSI C code with a K&R C compiler. +@item ansi2knr.1 +The man page which goes with @file{ansi2knr.c}. +@item config.guess +A shell script which determines the configuration name for the system on +which it is run. +@item config.sub +A shell script which canonicalizes a configuration name entered by a +user. +@item elisp-comp +Used to compile Emacs LISP files. +@item install-sh +A shell script which installs a program. This is used if the configure +script can not find an install binary. +@item ltconfig +Used by libtool. This is a shell script which configures libtool for +the particular system on which it is used. +@item ltmain.sh +Used by libtool. This is the actual libtool script which is used, after +it is configured by @file{ltconfig} to build a library. +@item mdate-sh +A shell script used by an automake generated @file{Makefile} to pretty +print the modification time of a file. This is used to maintain version +numbers for texinfo files. +@item missing +A shell script used if some tool is missing entirely. This is used by +an automake generated @file{Makefile} to avoid certain sorts of +timestamp problems. +@item mkinstalldirs +A shell script which creates a directory, including all parent +directories. This is used by an automake generated @file{Makefile} +during installation. +@item texinfo.tex +Required if you have any texinfo files. This is used when converting +Texinfo files into DVI using @samp{texi2dvi} and @TeX{}. +@item ylwrap +A shell script used by an automake generated @file{Makefile} to run +programs like @samp{bison}, @samp{yacc}, @samp{flex}, and @samp{lex}. +These programs default to producing output files with a fixed name, and +the @file{ylwrap} script runs them in a subdirectory to avoid file name +conflicts when using a parallel make program. +@end table + +@node Configuration Names +@chapter Configuration Names +@cindex configuration names +@cindex configuration triplets +@cindex triplets +@cindex host names +@cindex host triplets +@cindex canonical system names +@cindex system names +@cindex system types + +The GNU configure system names all systems using a @dfn{configuration +name}. All such names used to be triplets (they may now contain four +parts in certain cases), and the term @dfn{configuration triplet} is +still seen. + +@menu +* Configuration Name Definition:: Configuration Name Definition. +* Using Configuration Names:: Using Configuration Names. +@end menu + +@node Configuration Name Definition +@section Configuration Name Definition + +This is a string of the form +@var{cpu}-@var{manufacturer}-@var{operating_system}. In some cases, +this is extended to a four part form: +@var{cpu}-@var{manufacturer}-@var{kernel}-@var{operating_system}. + +When using a configuration name in a configure option, it is normally +not necessary to specify an entire name. In particular, the +@var{manufacturer} field is often omitted, leading to strings such as +@samp{i386-linux} or @samp{sparc-sunos}. The shell script +@file{config.sub} will translate these shortened strings into the +canonical form. autoconf will arrange for @file{config.sub} to be run +automatically when it is needed. + +The fields of a configuration name are as follows: + +@table @var +@item cpu +The type of processor. This is typically something like @samp{i386} or +@samp{sparc}. More specific variants are used as well, such as +@samp{mipsel} to indicate a little endian MIPS processor. +@item manufacturer +A somewhat freeform field which indicates the manufacturer of the +system. This is often simply @samp{unknown}. Other common strings are +@samp{pc} for an IBM PC compatible system, or the name of a workstation +vendor, such as @samp{sun}. +@item operating_system +The name of the operating system which is run on the system. This will +be something like @samp{solaris2.5} or @samp{irix6.3}. There is no +particular restriction on the version number, and strings like +@samp{aix4.1.4.0} are seen. For an embedded system, which has no +operating system, this field normally indicates the type of object file +format, such as @samp{elf} or @samp{coff}. +@item kernel +This is used mainly for GNU/Linux. A typical GNU/Linux configuration +name is @samp{i586-pc-linux-gnulibc1}. In this case the kernel, +@samp{linux}, is separated from the operating system, @samp{gnulibc1}. +@end table + +The shell script @file{config.guess} will normally print the correct +configuration name for the system on which it is run. It does by +running @samp{uname} and by examining other characteristics of the +system. + +Because @file{config.guess} can normally determine the configuration +name for a machine, it is normally only necessary to specify a +configuration name when building a cross-compiler or when building using +a cross-compiler. + +@node Using Configuration Names +@section Using Configuration Names + +A configure script will sometimes have to make a decision based on a +configuration name. You will need to do this if you have to compile +code differently based on something which can not be tested using a +standard autoconf feature test. + +It is normally better to test for particular features, rather than to +test for a particular system. This is because as Unix evolves, +different systems copy features from one another. Even if you need to +determine whether the feature is supported based on a configuration +name, you should define a macro which describes the feature, rather than +defining a macro which describes the particular system you are on. + +Testing for a particular system is normally done using a case statement +in @file{configure.in}. The case statement might look something like +the following, assuming that @samp{host} is a shell variable holding a +canonical configuration name (which will be the case if +@file{configure.in} uses the @samp{AC_CANONICAL_HOST} or +@samp{AC_CANONICAL_SYSTEM} macro). + +@smallexample +case "$@{host@}" in +i[3456]86-*-linux-gnu*) do something ;; +sparc*-sun-solaris2.[56789]*) do something ;; +sparc*-sun-solaris*) do something ;; +mips*-*-elf*) do something ;; +esac +@end smallexample + +It is particularly important to use @samp{*} after the operating system +field, in order to match the version number which will be generated by +@file{config.guess}. + +In most cases you must be careful to match a range of processor types. +For most processor families, a trailing @samp{*} suffices, as in +@samp{mips*} above. For the i386 family, something along the lines of +@samp{i[3456]86} suffices at present. For the m68k family, you will +need something like @samp{m68*}. Of course, if you do not need to match +on the processor, it is simpler to just replace the entire field by a +@samp{*}, as in @samp{*-*-irix*}. + +@node Cross Compilation Tools +@chapter Cross Compilation Tools +@cindex cross tools + +The GNU configure and build system can be used to build @dfn{cross +compilation} tools. A cross compilation tool is a tool which runs on +one system and produces code which runs on another system. + +@menu +* Cross Compilation Concepts:: Cross Compilation Concepts. +* Host and Target:: Host and Target. +* Using the Host Type:: Using the Host Type. +* Specifying the Target:: Specifying the Target. +* Using the Target Type:: Using the Target Type. +* Cross Tools in the Cygnus Tree:: Cross Tools in the Cygnus Tree +@end menu + +@node Cross Compilation Concepts +@section Cross Compilation Concepts + +@cindex cross compiler +A compiler which produces programs which run on a different system is a +cross compilation compiler, or simply a @dfn{cross compiler}. +Similarly, we speak of cross assemblers, cross linkers, etc. + +In the normal case, a compiler produces code which runs on the same +system as the one on which the compiler runs. When it is necessary to +distinguish this case from the cross compilation case, such a compiler +is called a @dfn{native compiler}. Similarly, we speak of native +assemblers, etc. + +Although the debugger is not strictly speaking a compilation tool, it is +nevertheless meaningful to speak of a cross debugger: a debugger which +is used to debug code which runs on another system. Everything that is +said below about configuring cross compilation tools applies to the +debugger as well. + +@node Host and Target +@section Host and Target +@cindex host system +@cindex target system + +When building cross compilation tools, there are two different systems +involved: the system on which the tools will run, and the system for +which the tools generate code. + +The system on which the tools will run is called the @dfn{host} system. + +The system for which the tools generate code is called the @dfn{target} +system. + +For example, suppose you have a compiler which runs on a GNU/Linux +system and generates ELF programs for a MIPS embedded system. In this +case the GNU/Linux system is the host, and the MIPS ELF system is the +target. Such a compiler could be called a GNU/Linux cross MIPS ELF +compiler, or, equivalently, a @samp{i386-linux-gnu} cross +@samp{mips-elf} compiler. + +Naturally, most programs are not cross compilation tools. For those +programs, it does not make sense to speak of a target. It only makes +sense to speak of a target for tools like @samp{gcc} or the +@samp{binutils} which actually produce running code. For example, it +does not make sense to speak of the target of a tool like @samp{bison} +or @samp{make}. + +Most cross compilation tools can also serve as native tools. For a +native compilation tool, it is still meaningful to speak of a target. +For a native tool, the target is the same as the host. For example, for +a GNU/Linux native compiler, the host is GNU/Linux, and the target is +also GNU/Linux. + +@node Using the Host Type +@section Using the Host Type + +In almost all cases the host system is the system on which you run the +@samp{configure} script, and on which you build the tools (for the case +when they differ, @pxref{Canadian Cross}). + +@cindex @samp{AC_CANONICAL_HOST} +If your configure script needs to know the configuration name of the +host system, and the package is not a cross compilation tool and +therefore does not have a target, put @samp{AC_CANONICAL_HOST} in +@file{configure.in}. This macro will arrange to define a few shell +variables when the @samp{configure} script is run. + +@table @samp +@item host +The canonical configuration name of the host. This will normally be +determined by running the @file{config.guess} shell script, although the +user is permitted to override this by using an explicit @samp{--host} +option. +@item host_alias +In the unusual case that the user used an explicit @samp{--host} option, +this will be the argument to @samp{--host}. In the normal case, this +will be the same as the @samp{host} variable. +@item host_cpu +@itemx host_vendor +@itemx host_os +The first three parts of the canonical configuration name. +@end table + +The shell variables may be used by putting shell code in +@file{configure.in}. For an example, see @ref{Using Configuration +Names}. + +@node Specifying the Target +@section Specifying the Target + +By default, the @samp{configure} script will assume that the target is +the same as the host. This is the more common case; for example, it +leads to a native compiler rather than a cross compiler. + +@cindex @samp{--target} option +@cindex target option +@cindex configure target +If you want to build a cross compilation tool, you must specify the +target explicitly by using the @samp{--target} option when you run +@samp{configure}. The argument to @samp{--target} is the configuration +name of the system for which you wish to generate code. +@xref{Configuration Names}. + +For example, to build tools which generate code for a MIPS ELF embedded +system, you would use @samp{--target mips-elf}. + +@node Using the Target Type +@section Using the Target Type + +@cindex @samp{AC_CANONICAL_SYSTEM} +When writing @file{configure.in} for a cross compilation tool, you will +need to use information about the target. To do this, put +@samp{AC_CANONICAL_SYSTEM} in @file{configure.in}. + +@samp{AC_CANONICAL_SYSTEM} will look for a @samp{--target} option and +canonicalize it using the @file{config.sub} shell script. It will also +run @samp{AC_CANONICAL_HOST} (@pxref{Using the Host Type}). + +The target type will be recorded in the following shell variables. Note +that the host versions of these variables will also be defined by +@samp{AC_CANONICAL_HOST}. + +@table @samp +@item target +The canonical configuration name of the target. +@item target_alias +The argument to the @samp{--target} option. If the user did not specify +a @samp{--target} option, this will be the same as @samp{host_alias}. +@item target_cpu +@itemx target_vendor +@itemx target_os +The first three parts of the canonical target configuration name. +@end table + +Note that if @samp{host} and @samp{target} are the same string, you can +assume a native configuration. If they are different, you can assume a +cross configuration. + +It is arguably possible for @samp{host} and @samp{target} to represent +the same system, but for the strings to not be identical. For example, +if @samp{config.guess} returns @samp{sparc-sun-sunos4.1.4}, and somebody +configures with @samp{--target sparc-sun-sunos4.1}, then the slight +differences between the two versions of SunOS may be unimportant for +your tool. However, in the general case it can be quite difficult to +determine whether the differences between two configuration names are +significant or not. Therefore, by convention, if the user specifies a +@samp{--target} option without specifying a @samp{--host} option, it is +assumed that the user wants to configure a cross compilation tool. + +The variables @samp{target} and @samp{target_alias} should be handled +differently. + +In general, whenever the user may actually see a string, +@samp{target_alias} should be used. This includes anything which may +appear in the file system, such as a directory name or part of a tool +name. It also includes any tool output, unless it is clearly labelled +as the canonical target configuration name. This permits the user to +use the @samp{--target} option to specify how the tool will appear to +the outside world. + +On the other hand, when checking for characteristics of the target +system, @samp{target} should be used. This is because a wide variety of +@samp{--target} options may map into the same canonical configuration +name. You should not attempt to duplicate the canonicalization done by +@samp{config.sub} in your own code. + +By convention, cross tools are installed with a prefix of the argument +used with the @samp{--target} option, also known as @samp{target_alias} +(@pxref{Using the Target Type}). If the user does not use the +@samp{--target} option, and thus is building a native tool, no prefix is +used. + +For example, if gcc is configured with @samp{--target mips-elf}, then +the installed binary will be named @samp{mips-elf-gcc}. If gcc is +configured without a @samp{--target} option, then the installed binary +will be named @samp{gcc}. + +The autoconf macro @samp{AC_ARG_PROGRAM} will handle this for you. If +you are using automake, no more need be done; the programs will +automatically be installed with the correct prefixes. Otherwise, see +the autoconf documentation for @samp{AC_ARG_PROGRAM}. + +@node Cross Tools in the Cygnus Tree +@section Cross Tools in the Cygnus Tree + +The Cygnus tree is used for various packages including gdb, the GNU +binutils, and egcs. It is also, of course, used for Cygnus releases. + +In the Cygnus tree, the top level @file{configure} script uses the old +Cygnus configure system, not autoconf. The top level @file{Makefile.in} +is written to build packages based on what is in the source tree, and +supports building a large number of tools in a single +@samp{configure}/@samp{make} step. + +The Cygnus tree may be configured with a @samp{--target} option. The +@samp{--target} option applies recursively to every subdirectory, and +permits building an entire set of cross tools at once. + +@menu +* Host and Target Libraries:: Host and Target Libraries. +* Target Library Configure Scripts:: Target Library Configure Scripts. +* Make Targets in Cygnus Tree:: Make Targets in Cygnus Tree. +* Target libiberty:: Target libiberty +@end menu + +@node Host and Target Libraries +@subsection Host and Target Libraries + +The Cygnus tree distinguishes host libraries from target libraries. + +Host libraries are built with the compiler used to build the programs +which run on the host, which is called the host compiler. This includes +libraries such as @samp{bfd} and @samp{tcl}. These libraries are built +with the host compiler, and are linked into programs like the binutils +or gcc which run on the host. + +Target libraries are built with the target compiler. If gcc is present +in the source tree, then the target compiler is the gcc that is built +using the host compiler. Target libraries are libraries such as +@samp{newlib} and @samp{libstdc++}. These libraries are not linked into +the host programs, but are instead made available for use with programs +built with the target compiler. + +For the rest of this section, assume that gcc is present in the source +tree, so that it will be used to build the target libraries. + +There is a complication here. The configure process needs to know which +compiler you are going to use to build a tool; otherwise, the feature +tests will not work correctly. The Cygnus tree handles this by not +configuring the target libraries until the target compiler is built. In +order to permit everything to build using a single +@samp{configure}/@samp{make}, the configuration of the target libraries +is actually triggered during the make step. + +When the target libraries are configured, the @samp{--target} option is +not used. Instead, the @samp{--host} option is used with the argument +of the @samp{--target} option for the overall configuration. If no +@samp{--target} option was used for the overall configuration, the +@samp{--host} option will be passed with the output of the +@file{config.guess} shell script. Any @samp{--build} option is passed +down unchanged. + +This translation of configuration options is done because since the +target libraries are compiled with the target compiler, they are being +built in order to run on the target of the overall configuration. By +the definition of host, this means that their host system is the same as +the target system of the overall configuration. + +The same process is used for both a native configuration and a cross +configuration. Even when using a native configuration, the target +libraries will be configured and built using the newly built compiler. +This is particularly important for the C++ libraries, since there is no +reason to assume that the C++ compiler used to build the host tools (if +there even is one) uses the same ABI as the g++ compiler which will be +used to build the target libraries. + +There is one difference between a native configuration and a cross +configuration. In a native configuration, the target libraries are +normally configured and built as siblings of the host tools. In a cross +configuration, the target libraries are normally built in a subdirectory +whose name is the argument to @samp{--target}. This is mainly for +historical reasons. + +To summarize, running @samp{configure} in the Cygnus tree configures all +the host libraries and tools, but does not configure any of the target +libraries. Running @samp{make} then does the following steps: + +@itemize @bullet +@item +Build the host libraries. +@item +Build the host programs, including gcc. Note that we call gcc both a +host program (since it runs on the host) and a target compiler (since it +generates code for the target). +@item +Using the newly built target compiler, configure the target libraries. +@item +Build the target libraries. +@end itemize + +The steps need not be done in precisely this order, since they are +actually controlled by @file{Makefile} targets. + +@node Target Library Configure Scripts +@subsection Target Library Configure Scripts + +There are a few things you must know in order to write a configure +script for a target library. This is just a quick sketch, and beginners +shouldn't worry if they don't follow everything here. + +The target libraries are configured and built using a newly built target +compiler. There may not be any startup files or libraries for this +target compiler. In fact, those files will probably be built as part of +some target library, which naturally means that they will not exist when +your target library is configured. + +This means that the configure script for a target library may not use +any test which requires doing a link. This unfortunately includes many +useful autoconf macros, such as @samp{AC_CHECK_FUNCS}. autoconf macros +which do a compile but not a link, such as @samp{AC_CHECK_HEADERS}, may +be used. + +This is a severe restriction, but normally not a fatal one, as target +libraries can often assume the presence of other target libraries, and +thus know which functions will be available. + +As of this writing, the autoconf macro @samp{AC_PROG_CC} does a link to +make sure that the compiler works. This may fail in a target library, +so target libraries must use a different set of macros to locate the +compiler. See the @file{configure.in} file in a directory like +@file{libiberty} or @file{libgloss} for an example. + +As noted in the previous section, target libraries are sometimes built +in directories which are siblings to the host tools, and are sometimes +built in a subdirectory. The @samp{--with-target-subdir} configure +option will be passed when the library is configured. Its value will be +an empty string if the target library is a sibling. Its value will be +the name of the subdirectory if the target library is in a subdirectory. + +If the overall build is not a native build (i.e., the overall configure +used the @samp{--target} option), then the library will be configured +with the @samp{--with-cross-host} option. The value of this option will +be the host system of the overall build. Recall that the host system of +the library will be the target of the overall build. If the overall +build is a native build, the @samp{--with-cross-host} option will not be +used. + +A library which can be built both standalone and as a target library may +want to install itself into different directories depending upon the +case. When built standalone, or when built native, the library should +be installed in @samp{$(libdir)}. When built as a target library which +is not native, the library should be installed in @samp{$(tooldir)/lib}. +The @samp{--with-cross-host} option may be used to distinguish these +cases. + +This same test of @samp{--with-cross-host} may be used to see whether it +is OK to use link tests in the configure script. If the +@samp{--with-cross-host} option is not used, then the library is being +built either standalone or native, and a link should work. + +@node Make Targets in Cygnus Tree +@subsection Make Targets in Cygnus Tree + +The top level @file{Makefile} in the Cygnus tree defines targets for +every known subdirectory. + +For every subdirectory @var{dir} which holds a host library or program, +the @file{Makefile} target @samp{all-@var{dir}} will build that library +or program. + +There are dependencies among host tools. For example, building gcc +requires first building gas, because the gcc build process invokes the +target assembler. These dependencies are reflected in the top level +@file{Makefile}. + +For every subdirectory @var{dir} which holds a target library, the +@file{Makefile} target @samp{configure-target-@var{dir}} will configure +that library. The @file{Makefile} target @samp{all-target-@var{dir}} +will build that library. + +Every @samp{configure-target-@var{dir}} target depends upon +@samp{all-gcc}, since gcc, the target compiler, is required to configure +the tool. Every @samp{all-target-@var{dir}} target depends upon the +corresponding @samp{configure-target-@var{dir}} target. + +There are several other targets which may be of interest for each +directory: @samp{install-@var{dir}}, @samp{clean-@var{dir}}, and +@samp{check-@var{dir}}. There are also corresponding @samp{target} +versions of these for the target libraries , such as +@samp{install-target-@var{dir}}. + +@node Target libiberty +@subsection Target libiberty + +The @file{libiberty} subdirectory is currently a special case, in that +it is the only directory which is built both using the host compiler and +using the target compiler. + +This is because the files in @file{libiberty} are used when building the +host tools, and they are also incorporated into the @file{libstdc++} +target library as support code. + +This duality does not pose any particular difficulties. It means that +there are targets for both @samp{all-libiberty} and +@samp{all-target-libiberty}. + +In a native configuration, when target libraries are not built in a +subdirectory, the same objects are normally used as both the host build +and the target build. This is normally OK, since libiberty contains +only C code, and in a native configuration the results of the host +compiler and the target compiler are normally interoperable. + +Irix 6 is again an exception here, since the SGI native compiler +defaults to using the @samp{O32} ABI, and gcc defaults to using the +@samp{N32} ABI. On Irix 6, the target libraries are built in a +subdirectory even for a native configuration, avoiding this problem. + +There are currently no other libraries built for both the host and the +target, but there is no conceptual problem with adding more. + +@node Canadian Cross +@chapter Canadian Cross +@cindex canadian cross +@cindex building with a cross compiler +@cindex cross compiler, building with + +It is possible to use the GNU configure and build system to build a +program which will run on a system which is different from the system on +which the tools are built. In other words, it is possible to build +programs using a cross compiler. + +This is referred to as a @dfn{Canadian Cross}. + +@menu +* Canadian Cross Example:: Canadian Cross Example. +* Canadian Cross Concepts:: Canadian Cross Concepts. +* Build Cross Host Tools:: Build Cross Host Tools. +* Build and Host Options:: Build and Host Options. +* CCross not in Cygnus Tree:: Canadian Cross not in Cygnus Tree. +* CCross in Cygnus Tree:: Canadian Cross in Cygnus Tree. +* Supporting Canadian Cross:: Supporting Canadian Cross. +@end menu + +@node Canadian Cross Example +@section Canadian Cross Example + +Here is an example of a Canadian Cross. + +While running on a GNU/Linux, you can build a program which will run on +a Solaris system. You would use a GNU/Linux cross Solaris compiler to +build the program. + +Of course, you could not run the resulting program on your GNU/Linux +system. You would have to copy it over to a Solaris system before you +would run it. + +Of course, you could also simply build the programs on the Solaris +system in the first place. However, perhaps the Solaris system is not +available for some reason; perhaps you actually don't have one, but you +want to build the tools for somebody else to use. Or perhaps your +GNU/Linux system is much faster than your Solaris system. + +A Canadian Cross build is most frequently used when building programs to +run on a non-Unix system, such as DOS or Windows. It may be simpler to +configure and build on a Unix system than to support the configuration +machinery on a non-Unix system. + +@node Canadian Cross Concepts +@section Canadian Cross Concepts + +When building a Canadian Cross, there are at least two different systems +involved: the system on which the tools are being built, and the system +on which the tools will run. + +The system on which the tools are being built is called the @dfn{build} +system. + +The system on which the tools will run is called the host system. + +For example, if you are building a Solaris program on a GNU/Linux +system, as in the previous section, the build system would be GNU/Linux, +and the host system would be Solaris. + +It is, of course, possible to build a cross compiler using a Canadian +Cross (i.e., build a cross compiler using a cross compiler). In this +case, the system for which the resulting cross compiler generates code +is called the target system. (For a more complete discussion of host +and target systems, @pxref{Host and Target}). + +An example of building a cross compiler using a Canadian Cross would be +building a Windows cross MIPS ELF compiler on a GNU/Linux system. In +this case the build system would be GNU/Linux, the host system would be +Windows, and the target system would be MIPS ELF. + +The name Canadian Cross comes from the case when the build, host, and +target systems are all different. At the time that these issues were +all being hashed out, Canada had three national political parties. + +@node Build Cross Host Tools +@section Build Cross Host Tools + +In order to configure a program for a Canadian Cross build, you must +first build and install the set of cross tools you will use to build the +program. + +These tools will be build cross host tools. That is, they will run on +the build system, and will produce code that runs on the host system. + +It is easy to confuse the meaning of build and host here. Always +remember that the build system is where you are doing the build, and the +host system is where the resulting program will run. Therefore, you +need a build cross host compiler. + +In general, you must have a complete cross environment in order to do +the build. This normally means a cross compiler, cross assembler, and +so forth, as well as libraries and include files for the host system. + +@node Build and Host Options +@section Build and Host Options +@cindex configuring a canadian cross +@cindex canadian cross, configuring + +When you run @file{configure}, you must use both the @samp{--build} and +@samp{--host} options. + +@cindex @samp{--build} option +@cindex build option +@cindex configure build system +The @samp{--build} option is used to specify the configuration name of +the build system. This can normally be the result of running the +@file{config.guess} shell script, and it is reasonable to use +@samp{--build=`config.guess`}. + +@cindex @samp{--host} option +@cindex host option +@cindex configure host +The @samp{--host} option is used to specify the configuration name of +the host system. + +As we explained earlier, @file{config.guess} is used to set the default +value for the @samp{--host} option (@pxref{Using the Host Type}). We +can now see that since @file{config.guess} returns the type of system on +which it is run, it really identifies the build system. Since the host +system is normally the same as the build system (i.e., people do not +normally build using a cross compiler), it is reasonable to use the +result of @file{config.guess} as the default for the host system when +the @samp{--host} option is not used. + +It might seem that if the @samp{--host} option were used without the +@samp{--build} option that the configure script could run +@file{config.guess} to determine the build system, and presume a +Canadian Cross if the result of @file{config.guess} differed from the +@samp{--host} option. However, for historical reasons, some configure +scripts are routinely run using an explicit @samp{--host} option, rather +than using the default from @file{config.guess}. As noted earlier, it +is difficult or impossible to reliably compare configuration names +(@pxref{Using the Target Type}). Therefore, by convention, if the +@samp{--host} option is used, but the @samp{--build} option is not used, +then the build system defaults to the host system. + +@node CCross not in Cygnus Tree +@section Canadian Cross not in Cygnus Tree. + +If you are not using the Cygnus tree, you must explicitly specify the +cross tools which you want to use to build the program. This is done by +setting environment variables before running the @file{configure} +script. + +You must normally set at least the environment variables @samp{CC}, +@samp{AR}, and @samp{RANLIB} to the cross tools which you want to use to +build. + +For some programs, you must set additional cross tools as well, such as +@samp{AS}, @samp{LD}, or @samp{NM}. + +You would set these environment variables to the build cross tools which +you are going to use. + +For example, if you are building a Solaris program on a GNU/Linux +system, and your GNU/Linux cross Solaris compiler were named +@samp{solaris-gcc}, then you would set the environment variable +@samp{CC} to @samp{solaris-gcc}. + +@node CCross in Cygnus Tree +@section Canadian Cross in Cygnus Tree +@cindex canadian cross in cygnus tree + +This section describes configuring and building a Canadian Cross when +using the Cygnus tree. + +@menu +* Standard Cygnus CCross:: Building a Normal Program. +* Cross Cygnus CCross:: Building a Cross Program. +@end menu + +@node Standard Cygnus CCross +@subsection Building a Normal Program + +When configuring a Canadian Cross in the Cygnus tree, all the +appropriate environment variables are automatically set to +@samp{@var{host}-@var{tool}}, where @var{host} is the value used for the +@samp{--host} option, and @var{tool} is the name of the tool (e.g., +@samp{gcc}, @samp{as}, etc.). These tools must be on your @samp{PATH}. + +Adding a prefix of @var{host} will give the usual name for the build +cross host tools. To see this, consider that when these cross tools +were built, they were configured to run on the build system and to +produce code for the host system. That is, they were configured with a +@samp{--target} option that is the same as the system which we are now +calling the host. Recall that the default name for installed cross +tools uses the target system as a prefix (@pxref{Using the Target +Type}). Since that is the system which we are now calling the host, +@var{host} is the right prefix to use. + +For example, if you configure with @samp{--build=i386-linux-gnu} and +@samp{--host=solaris}, then the Cygnus tree will automatically default +to using the compiler @samp{solaris-gcc}. You must have previously +built and installed this compiler, probably by doing a build with no +@samp{--host} option and with a @samp{--target} option of +@samp{solaris}. + +@node Cross Cygnus CCross +@subsection Building a Cross Program + +There are additional considerations if you want to build a cross +compiler, rather than a native compiler, in the Cygnus tree using a +Canadian Cross. + +When you build a cross compiler using the Cygnus tree, then the target +libraries will normally be built with the newly built target compiler +(@pxref{Host and Target Libraries}). However, this will not work when +building with a Canadian Cross. This is because the newly built target +compiler will be a program which runs on the host system, and therefore +will not be able to run on the build system. + +Therefore, when building a cross compiler with the Cygnus tree, you must +first install a set of build cross target tools. These tools will be +used when building the target libraries. + +Note that this is not a requirement of a Canadian Cross in general. For +example, it would be possible to build just the host cross target tools +on the build system, to copy the tools to the host system, and to build +the target libraries on the host system. The requirement for build +cross target tools is imposed by the Cygnus tree, which expects to be +able to build both host programs and target libraries in a single +@samp{configure}/@samp{make} step. Because it builds these in a single +step, it expects to be able to build the target libraries on the build +system, which means that it must use a build cross target toolchain. + +For example, suppose you want to build a Windows cross MIPS ELF compiler +on a GNU/Linux system. You must have previously installed both a +GNU/Linux cross Windows compiler and a GNU/Linux cross MIPS ELF +compiler. + +In order to build the Windows (configuration name @samp{i386-cygwin32}) +cross MIPS ELF (configure name @samp{mips-elf}) compiler, you might +execute the following commands (long command lines are broken across +lines with a trailing backslash as a continuation character). + +@example +mkdir linux-x-cygwin32 +cd linux-x-cygwin32 +@var{srcdir}/configure --target i386-cygwin32 --prefix=@var{installdir} \ + --exec-prefix=@var{installdir}/H-i386-linux +make +make install +cd .. +mkdir linux-x-mips-elf +cd linux-x-mips-elf +@var{srcdir}/configure --target mips-elf --prefix=@var{installdir} \ + --exec-prefix=@var{installdir}/H-i386-linux +make +make install +cd .. +mkdir cygwin32-x-mips-elf +cd cygwin32-x-mips-elf +@var{srcdir}/configure --build=i386-linux-gnu --host=i386-cygwin32 \ + --target=mips-elf --prefix=@var{wininstalldir} \ + --exec-prefix=@var{wininstalldir}/H-i386-cygwin32 +make +make install +@end example + +You would then copy the contents of @var{wininstalldir} over to the +Windows machine, and run the resulting programs. + +@node Supporting Canadian Cross +@section Supporting Canadian Cross + +If you want to make it possible to build a program you are developing +using a Canadian Cross, you must take some care when writing your +configure and make rules. Simple cases will normally work correctly. +However, it is not hard to write configure and make tests which will +fail in a Canadian Cross. + +@menu +* CCross in Configure:: Supporting Canadian Cross in Configure Scripts. +* CCross in Make:: Supporting Canadian Cross in Makefiles. +@end menu + +@node CCross in Configure +@subsection Supporting Canadian Cross in Configure Scripts +@cindex canadian cross in configure + +In a @file{configure.in} file, after calling @samp{AC_PROG_CC}, you can +find out whether this is a Canadian Cross configure by examining the +shell variable @samp{cross_compiling}. In a Canadian Cross, which means +that the compiler is a cross compiler, @samp{cross_compiling} will be +@samp{yes}. In a normal configuration, @samp{cross_compiling} will be +@samp{no}. + +You ordinarily do not need to know the type of the build system in a +configure script. However, if you do need that information, you can get +it by using the macro @samp{AC_CANONICAL_SYSTEM}, the same macro that is +used to determine the target system. This macro will set the variables +@samp{build}, @samp{build_alias}, @samp{build_cpu}, @samp{build_vendor}, +and @samp{build_os}, which correspond to the similar @samp{target} and +@samp{host} variables, except that they describe the build system. + +When writing tests in @file{configure.in}, you must remember that you +want to test the host environment, not the build environment. + +Macros like @samp{AC_CHECK_FUNCS} which use the compiler will test the +host environment. That is because the tests will be done by running the +compiler, which is actually a build cross host compiler. If the +compiler can find the function, that means that the function is present +in the host environment. + +Tests like @samp{test -f /dev/ptyp0}, on the other hand, will test the +build environment. Remember that the configure script is running on the +build system, not the host system. If your configure scripts examines +files, those files will be on the build system. Whatever you determine +based on those files may or may not be the case on the host system. + +Most autoconf macros will work correctly for a Canadian Cross. The main +exception is @samp{AC_TRY_RUN}. This macro tries to compile and run a +test program. This will fail in a Canadian Cross, because the program +will be compiled for the host system, which means that it will not run +on the build system. + +The @samp{AC_TRY_RUN} macro provides an optional argument to tell the +configure script what to do in a Canadian Cross. If that argument is +not present, you will get a warning when you run @samp{autoconf}: +@smallexample +warning: AC_TRY_RUN called without default to allow cross compiling +@end smallexample +@noindent +This tells you that the resulting @file{configure} script will not work +with a Canadian Cross. + +In some cases while it may better to perform a test at configure time, +it is also possible to perform the test at run time. In such a case you +can use the cross compiling argument to @samp{AC_TRY_RUN} to tell your +program that the test could not be performed at configure time. + +There are a few other autoconf macros which will not work correctly with +a Canadian Cross: a partial list is @samp{AC_FUNC_GETPGRP}, +@samp{AC_FUNC_SETPGRP}, @samp{AC_FUNC_SETVBUF_REVERSED}, and +@samp{AC_SYS_RESTARTABLE_SYSCALLS}. The @samp{AC_CHECK_SIZEOF} macro is +generally not very useful with a Canadian Cross; it permits an optional +argument indicating the default size, but there is no way to know what +the correct default should be. + +@node CCross in Make +@subsection Supporting Canadian Cross in Makefiles. +@cindex canadian cross in makefile + +The main Canadian Cross issue in a @file{Makefile} arises when you want +to use a subsidiary program to generate code or data which you will then +include in your real program. + +If you compile this subsidiary program using @samp{$(CC)} in the usual +way, you will not be able to run it. This is because @samp{$(CC)} will +build a program for the host system, but the program is being built on +the build system. + +You must instead use a compiler for the build system, rather than the +host system. In the Cygnus tree, this make variable +@samp{$(CC_FOR_BUILD)} will hold a compiler for the build system. + +Note that you should not include @file{config.h} in a file you are +compiling with @samp{$(CC_FOR_BUILD)}. The @file{configure} script will +build @file{config.h} with information for the host system. However, +you are compiling the file using a compiler for the build system (a +native compiler). Subsidiary programs are normally simple filters which +do no user interaction, and it is normally possible to write them in a +highly portable fashion so that the absence of @file{config.h} is not +crucial. + +@cindex @samp{HOST_CC} +The gcc @file{Makefile.in} shows a complex situation in which certain +files, such as @file{rtl.c}, must be compiled into both subsidiary +programs run on the build system and into the final program. This +approach may be of interest for advanced build system hackers. Note +that the build system compiler is rather confusingly called +@samp{HOST_CC}. + +@node Cygnus Configure +@chapter Cygnus Configure +@cindex cygnus configure + +The Cygnus configure script predates autoconf. All of its interesting +features have been incorporated into autoconf. No new programs should +be written to use the Cygnus configure script. + +However, the Cygnus configure script is still used in a few places: at +the top of the Cygnus tree and in a few target libraries in the Cygnus +tree. Until those uses have been replaced with autoconf, some brief +notes are appropriate here. This is not complete documentation, but it +should be possible to use this as a guide while examining the scripts +themselves. + +@menu +* Cygnus Configure Basics:: Cygnus Configure Basics. +* Cygnus Configure in C++ Libraries:: Cygnus Configure in C++ Libraries. +@end menu + +@node Cygnus Configure Basics +@section Cygnus Configure Basics + +Cygnus configure does not use any generated files; there is no program +corresponding to @samp{autoconf}. Instead, there is a single shell +script named @samp{configure} which may be found at the top of the +Cygnus tree. This shell script was written by hand; it was not +generated by autoconf, and it is incorrect, and indeed harmful, to run +@samp{autoconf} in the top level of a Cygnus tree. + +Cygnus configure works in a particular directory by examining the file +@file{configure.in} in that directory. That file is broken into four +separate shell scripts. + +The first is the contents of @file{configure.in} up to a line that +starts with @samp{# per-host:}. This is the common part. + +The second is the rest of @file{configure.in} up to a line that starts +with @samp{# per-target:}. This is the per host part. + +The third is the rest of @file{configure.in} up to a line that starts +with @samp{# post-target:}. This is the per target part. + +The fourth is the remainder of @file{configure.in}. This is the post +target part. + +If any of these comment lines are missing, the corresponding shell +script is empty. + +Cygnus configure will first execute the common part. This must set the +shell variable @samp{srctrigger} to the name of a source file, to +confirm that Cygnus configure is looking at the right directory. This +may set the shell variables @samp{package_makefile_frag} and +@samp{package_makefile_rules_frag}. + +Cygnus configure will next set the @samp{build} and @samp{host} shell +variables, and execute the per host part. This may set the shell +variable @samp{host_makefile_frag}. + +Cygnus configure will next set the @samp{target} variable, and execute +the per target part. This may set the shell variable +@samp{target_makefile_frag}. + +Any of these scripts may set the @samp{subdirs} shell variable. This +variable is a list of subdirectories where a @file{Makefile.in} file may +be found. Cygnus configure will automatically look for a +@file{Makefile.in} file in the current directory. The @samp{subdirs} +shell variable is not normally used, and I believe that the only +directory which uses it at present is @file{newlib}. + +For each @file{Makefile.in}, Cygnus configure will automatically create +a @file{Makefile} by adding definitions for @samp{make} variables such +as @samp{host} and @samp{target}, and automatically editing the values +of @samp{make} variables such as @samp{prefix} if they are present. + +Also, if any of the @samp{makefile_frag} shell variables are set, Cygnus +configure will interpret them as file names relative to either the +working directory or the source directory, and will read the contents of +the file into the generated @file{Makefile}. The file contents will be +read in after the first line in @file{Makefile.in} which starts with +@samp{####}. + +These @file{Makefile} fragments are used to customize behaviour for a +particular host or target. They serve to select particular files to +compile, and to define particular preprocessor macros by providing +values for @samp{make} variables which are then used during compilation. +Cygnus configure, unlike autoconf, normally does not do feature tests, +and normally requires support to be added manually for each new host. + +The @file{Makefile} fragment support is similar to the autoconf +@samp{AC_SUBST_FILE} macro. + +After creating each @file{Makefile}, the post target script will be run +(i.e., it may be run several times). This script may further customize +the @file{Makefile}. When it is run, the shell variable @samp{Makefile} +will hold the name of the @file{Makefile}, including the appropriate +directory component. + +Like an autoconf generated @file{configure} script, Cygnus configure +will create a file named @file{config.status} which, when run, will +automatically recreate the configuration. The @file{config.status} file +will simply execute the Cygnus configure script again with the +appropriate arguments. + +Any of the parts of @file{configure.in} may set the shell variables +@samp{files} and @samp{links}. Cygnus configure will set up symlinks +from the names in @samp{links} to the files named in @samp{files}. This +is similar to the autoconf @samp{AC_LINK_FILES} macro. + +Finally, any of the parts of @file{configure.in} may set the shell +variable @samp{configdirs} to a set of subdirectories. If it is set, +Cygnus configure will recursively run the configure process in each +subdirectory. If the subdirectory uses Cygnus configure, it will +contain a @file{configure.in} file but no @file{configure} file, in +which case Cygnus configure will invoke itself recursively. If the +subdirectory has a @file{configure} file, Cygnus configure assumes that +it is an autoconf generated @file{configure} script, and simply invokes +it directly. + +@node Cygnus Configure in C++ Libraries +@section Cygnus Configure in C++ Libraries +@cindex @file{libstdc++} configure +@cindex @file{libio} configure +@cindex @file{libg++} configure + +The C++ library configure system, written by Per Bothner, deserves +special mention. It uses Cygnus configure, but it does feature testing +like that done by autoconf generated @file{configure} scripts. This +approach is used in the libraries @file{libio}, @file{libstdc++}, and +@file{libg++}. + +Most of the @file{Makefile} information is written out by the shell +script @file{libio/config.shared}. Each @file{configure.in} file sets +certain shell variables, and then invokes @file{config.shared} to create +two package @file{Makefile} fragments. These fragments are then +incorporated into the resulting @file{Makefile} by the Cygnus configure +script. + +The file @file{_G_config.h} is created in the @file{libio} object +directory by running the shell script @file{libio/gen-params}. This +shell script uses feature tests to define macros and typedefs in +@file{_G_config.h}. + +@node Multilibs +@chapter Multilibs +@cindex multilibs + +For some targets gcc may have different processor requirements depending +upon command line options. An obvious example is the +@samp{-msoft-float} option supported on several processors. This option +means that the floating point registers are not available, which means +that floating point operations must be done by calling an emulation +subroutine rather than by using machine instructions. + +For such options, gcc is often configured to compile target libraries +twice: once with @samp{-msoft-float} and once without. When gcc +compiles target libraries more than once, the resulting libraries are +called @dfn{multilibs}. + +Multilibs are not really part of the GNU configure and build system, but +we discuss them here since they require support in the @file{configure} +scripts and @file{Makefile}s used for target libraries. + +@menu +* Multilibs in gcc:: Multilibs in gcc. +* Multilibs in Target Libraries:: Multilibs in Target Libraries. +@end menu + +@node Multilibs in gcc +@section Multilibs in gcc + +In gcc, multilibs are defined by setting the variable +@samp{MULTILIB_OPTIONS} in the target @file{Makefile} fragment. Several +other @samp{MULTILIB} variables may also be defined there. @xref{Target +Fragment, , The Target Makefile Fragment, gcc, Using and Porting GNU +CC}. + +If you have built gcc, you can see what multilibs it uses by running it +with the @samp{-print-multi-lib} option. The output @samp{.;} means +that no multilibs are used. In general, the output is a sequence of +lines, one per multilib. The first part of each line, up to the +@samp{;}, is the name of the multilib directory. The second part is a +list of compiler options separated by @samp{@@} characters. + +Multilibs are built in a tree of directories. The top of the tree, +represented by @samp{.} in the list of multilib directories, is the +default library to use when no special compiler options are used. The +subdirectories of the tree hold versions of the library to use when +particular compiler options are used. + +@node Multilibs in Target Libraries +@section Multilibs in Target Libraries + +The target libraries in the Cygnus tree are automatically built with +multilibs. That means that each library is built multiple times. + +This default is set in the top level @file{configure.in} file, by adding +@samp{--enable-multilib} to the list of arguments passed to configure +when it is run for the target libraries (@pxref{Host and Target +Libraries}). + +Each target library uses the shell script @file{config-ml.in}, written +by Doug Evans, to prepare to build target libraries. This shell script +is invoked after the @file{Makefile} has been created by the +@file{configure} script. If multilibs are not enabled, it does nothing, +otherwise it modifies the @file{Makefile} to support multilibs. + +The @file{config-ml.in} script makes one copy of the @file{Makefile} for +each multilib in the appropriate subdirectory. When configuring in the +source directory (which is not recommended), it will build a symlink +tree of the sources in each subdirectory. + +The @file{config-ml.in} script sets several variables in the various +@file{Makefile}s. The @file{Makefile.in} must have definitions for +these variables already; @file{config-ml.in} simply changes the existing +values. The @file{Makefile} should use default values for these +variables which will do the right thing in the subdirectories. + +@table @samp +@item MULTISRCTOP +@file{config-ml.in} will set this to a sequence of @samp{../} strings, +where the number of strings is the number of multilib levels in the +source tree. The default value should be the empty string. +@item MULTIBUILDTOP +@file{config-ml.in} will set this to a sequence of @samp{../} strings, +where the number of strings is number of multilib levels in the object +directory. The default value should be the empty string. This will +differ from @samp{MULTISRCTOP} when configuring in the source tree +(which is not recommended). +@item MULTIDIRS +In the top level @file{Makefile} only, @file{config-ml.in} will set this +to the list of multilib subdirectories. The default value should be the +empty string. +@item MULTISUBDIR +@file{config-ml.in} will set this to the installed subdirectory name to +use for this subdirectory, with a leading @samp{/}. The default value +shold be the empty string. +@item MULTIDO +@itemx MULTICLEAN +In the top level @file{Makefile} only, @file{config-ml.in} will set +these variables to commands to use when doing a recursive make. These +variables should both default to the string @samp{true}, so that by +default nothing happens. +@end table + +All references to the parent of the source directory should use the +variable @samp{MULTISRCTOP}. Instead of writing @samp{$(srcdir)/..}, +you must write @samp{$(srcdir)/$(MULTISRCTOP)..}. + +Similarly, references to the parent of the object directory should use +the variable @samp{MULTIBUILDTOP}. + +In the installation target, the libraries should be installed in the +subdirectory @samp{MULTISUBDIR}. Instead of installing +@samp{$(libdir)/libfoo.a}, install +@samp{$(libdir)$(MULTISUBDIR)/libfoo.a}. + +The @file{config-ml.in} script also modifies the top level +@file{Makefile} to add @samp{multi-do} and @samp{multi-clean} targets +which are used when building multilibs. + +The default target of the @file{Makefile} should include the following +command: +@smallexample +@@$(MULTIDO) $(FLAGS_TO_PASS) DO=all multi-do +@end smallexample +@noindent +This assumes that @samp{$(FLAGS_TO_PASS)} is defined as a set of +variables to pass to a recursive invocation of @samp{make}. This will +build all the multilibs. Note that the default value of @samp{MULTIDO} +is @samp{true}, so by default this command will do nothing. It will +only do something in the top level @file{Makefile} if multilibs were +enabled. + +The @samp{install} target of the @file{Makefile} should include the +following command: +@smallexample +@@$(MULTIDO) $(FLAGS_TO_PASS) DO=install multi-do +@end smallexample + +In general, any operation, other than clean, which should be performed +on all the multilibs should use a @samp{$(MULTIDO)} line, setting the +variable @samp{DO} to the target of each recursive call to @samp{make}. + +The @samp{clean} targets (@samp{clean}, @samp{mostlyclean}, etc.) should +use @samp{$(MULTICLEAN)}. For example, the @samp{clean} target should +do this: +@smallexample +@@$(MULTICLEAN) DO=clean multi-clean +@end smallexample + +@node FAQ +@chapter Frequently Asked Questions + +@table @asis +@item Which do I run first, @samp{autoconf} or @samp{automake}? +Except when you first add autoconf or automake support to a package, you +shouldn't run either by hand. Instead, configure with the +@samp{--enable-maintainer-mode} option, and let @samp{make} take care of +it. + +@cindex undefined macros +@item @samp{autoconf} says something about undefined macros. +This means that you have macros in your @file{configure.in} which are +not defined by @samp{autoconf}. You may be using an old version of +@samp{autoconf}; try building and installing a newer one. Make sure the +newly installled @samp{autoconf} is first on your @samp{PATH}. Also, +see the next question. + +@cindex @samp{CY_GNU_GETTEXT} in @file{configure} +@cindex @samp{AM_PROG_LIBTOOL} in @file{configure} +@item My @file{configure} script has stuff like @samp{CY_GNU_GETTEXT} in it. +This means that you have macros in your @file{configure.in} which should +be defined in your @file{aclocal.m4} file, but aren't. This usually +means that @samp{aclocal} was not able to appropriate definitions of the +macros. Make sure that you have installed all the packages you need. +In particular, make sure that you have installed libtool (this is where +@samp{AM_PROG_LIBTOOL} is defined) and gettext (this is where +@samp{CY_GNU_GETTEXT} is defined, at least in the Cygnus version of +gettext). + +@cindex @file{Makefile}, garbage characters +@item My @file{Makefile} has @samp{@@} characters in it. +This may mean that you tried to use an autoconf substitution in your +@file{Makefile.in} without adding the appropriate @samp{AC_SUBST} call +to your @file{configure} script. Or it may just mean that you need to +rebuild @file{Makefile} in your build directory. To rebuild +@file{Makefile} from @file{Makefile.in}, run the shell script +@file{config.status} with no arguments. If you need to force +@file{configure} to run again, first run @samp{config.status --recheck}. +These runs are normally done automatically by @file{Makefile} targets, +but if your @file{Makefile} has gotten messed up you'll need to help +them along. + +@cindex @samp{config.status --recheck} +@item Why do I have to run both @samp{config.status --recheck} and @samp{config.status}? +Normally, you don't; they will be run automatically by @file{Makefile} +targets. If you do need to run them, use @samp{config.status --recheck} +to run the @file{configure} script again with the same arguments as the +first time you ran it. Use @samp{config.status} (with no arguments) to +regenerate all files (@file{Makefile}, @file{config.h}, etc.) based on +the results of the configure script. The two cases are separate because +it isn't always necessary to regenerate all the files after running +@samp{config.status --recheck}. The @file{Makefile} targets generated +by automake will use the environment variables @samp{CONFIG_FILES} and +@samp{CONFIG_HEADERS} to only regenerate files as they are needed. + +@item What is the Cygnus tree? +The Cygnus tree is used for various packages including gdb, the GNU +binutils, and egcs. It is also, of course, used for Cygnus releases. +It is the build system which was developed at Cygnus, using the Cygnus +configure script. It permits building many different packages with a +single configure and make. The configure scripts in the tree are being +converted to autoconf, but the general build structure remains intact. + +@item Why do I have to keep rebuilding and reinstalling the tools? +I know, it's a pain. Unfortunately, there are bugs in the tools +themselves which need to be fixed, and each time that happens everybody +who uses the tools need to reinstall new versions of them. I don't know +if there is going to be a clever fix until the tools stabilize. + +@item Why not just have a Cygnus tree @samp{make} target to update the tools? +The tools unfortunately need to be installed before they can be used. +That means that they must be built using an appropriate prefix, and it +seems unwise to assume that every configuration uses an appropriate +prefix. It might be possible to make them work in place, or it might be +possible to install them in some subdirectory; so far these approaches +have not been implemented. +@end table + +@node Index +@unnumbered Index + +@printindex cp + +@contents +@bye diff --git a/gnu/dist/toolchain/etc/make-stds.texi b/gnu/dist/toolchain/etc/make-stds.texi index b8e0bbed4f18..2149764b8e9c 100644 --- a/gnu/dist/toolchain/etc/make-stds.texi +++ b/gnu/dist/toolchain/etc/make-stds.texi @@ -79,7 +79,7 @@ foo.1 : foo.man sedscript @noindent will fail when the build directory is not the source directory, because -@file{foo.man} and @file{sedscript} are in the source directory. +@file{foo.man} and @file{sedscript} are in the the source directory. When using GNU @code{make}, relying on @samp{VPATH} to find the source file will work in the case where there is a single dependency file, @@ -745,7 +745,7 @@ The easiest way to do this is to create a subdirectory appropriately named, use @code{ln} or @code{cp} to install the proper files in it, and then @code{tar} that subdirectory. -Compress the tar file with @code{gzip}. For example, the actual +Compress the tar file file with @code{gzip}. For example, the actual distribution file for GCC version 1.40 is called @file{gcc-1.40.tar.gz}. The @code{dist} target should explicitly depend on all non-source files diff --git a/gnu/dist/toolchain/etc/standards.info b/gnu/dist/toolchain/etc/standards.info new file mode 100644 index 000000000000..47501bda4f7b --- /dev/null +++ b/gnu/dist/toolchain/etc/standards.info @@ -0,0 +1,3833 @@ +This is standards.info, produced by makeinfo version 4.0 from +./standards.texi. + +START-INFO-DIR-ENTRY +* Standards: (standards). GNU coding standards. +END-INFO-DIR-ENTRY + + GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996, +1997, 1998 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Free Software Foundation. + + +File: standards.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir) + +Version +******* + + Last updated March 13, 1998. + +* Menu: + +* Preface:: About the GNU Coding Standards +* Intellectual Property:: Keeping Free Software Free +* Design Advice:: General Program Design +* Program Behavior:: Program Behavior for All Programs +* Writing C:: Making The Best Use of C +* Documentation:: Documenting Programs +* Managing Releases:: The Release Process + + +File: standards.info, Node: Preface, Next: Intellectual Property, Prev: Top, Up: Top + +About the GNU Coding Standards +****************************** + + The GNU Coding Standards were written by Richard Stallman and other +GNU Project volunteers. Their purpose is to make the GNU system clean, +consistent, and easy to install. This document can also be read as a +guide to writing portable, robust and reliable programs. It focuses on +programs written in C, but many of the rules and principles are useful +even if you write in another programming language. The rules often +state reasons for writing in a certain way. + + Corrections or suggestions for this document should be sent to +. If you make a suggestion, please include a suggested +new wording for it; our time is limited. We prefer a context diff to +the `standards.texi' or `make-stds.texi' files, but if you don't have +those files, please mail your suggestion anyway. + + This release of the GNU Coding Standards was last updated March 13, +1998. + + +File: standards.info, Node: Intellectual Property, Next: Design Advice, Prev: Preface, Up: Top + +Keeping Free Software Free +************************** + + This node discusses how you can make sure that GNU software remains +unencumbered. + +* Menu: + +* Reading Non-Free Code:: Referring to Proprietary Programs +* Contributions:: Accepting Contributions + + +File: standards.info, Node: Reading Non-Free Code, Next: Contributions, Up: Intellectual Property + +Referring to Proprietary Programs +================================= + + Don't in any circumstances refer to Unix source code for or during +your work on GNU! (Or to any other proprietary programs.) + + If you have a vague recollection of the internals of a Unix program, +this does not absolutely mean you can't write an imitation of it, but +do try to organize the imitation internally along different lines, +because this is likely to make the details of the Unix version +irrelevant and dissimilar to your results. + + For example, Unix utilities were generally optimized to minimize +memory use; if you go for speed instead, your program will be very +different. You could keep the entire input file in core and scan it +there instead of using stdio. Use a smarter algorithm discovered more +recently than the Unix program. Eliminate use of temporary files. Do +it in one pass instead of two (we did this in the assembler). + + Or, on the contrary, emphasize simplicity instead of speed. For some +applications, the speed of today's computers makes simpler algorithms +adequate. + + Or go for generality. For example, Unix programs often have static +tables or fixed-size strings, which make for arbitrary limits; use +dynamic allocation instead. Make sure your program handles NULs and +other funny characters in the input files. Add a programming language +for extensibility and write part of the program in that language. + + Or turn some parts of the program into independently usable +libraries. Or use a simple garbage collector instead of tracking +precisely when to free memory, or use a new GNU facility such as +obstacks. + + +File: standards.info, Node: Contributions, Prev: Reading Non-Free Code, Up: Intellectual Property + +Accepting Contributions +======================= + + If someone else sends you a piece of code to add to the program you +are working on, we need legal papers to use it--the same sort of legal +papers we will need to get from you. _Each_ significant contributor to +a program must sign some sort of legal papers in order for us to have +clear title to the program. The main author alone is not enough. + + So, before adding in any contributions from other people, please tell +us, so we can arrange to get the papers. Then wait until we tell you +that we have received the signed papers, before you actually use the +contribution. + + This applies both before you release the program and afterward. If +you receive diffs to fix a bug, and they make significant changes, we +need legal papers for that change. + + This also applies to comments and documentation files. For copyright +law, comments and code are just text. Copyright applies to all kinds of +text, so we need legal papers for all kinds. + + You don't need papers for changes of a few lines here or there, since +they are not significant for copyright purposes. Also, you don't need +papers if all you get from the suggestion is some ideas, not actual code +which you use. For example, if you write a different solution to the +problem, you don't need to get papers. + + We know this is frustrating; it's frustrating for us as well. But if +you don't wait, you are going out on a limb--for example, what if the +contributor's employer won't sign a disclaimer? You might have to take +that code out again! + + The very worst thing is if you forget to tell us about the other +contributor. We could be very embarrassed in court some day as a +result. + + We have more detailed advice for maintainers of programs; if you have +reached the stage of actually maintaining a program for GNU (whether +released or not), please ask us for a copy. + + +File: standards.info, Node: Design Advice, Next: Program Behavior, Prev: Intellectual Property, Up: Top + +General Program Design +********************** + + This node discusses some of the issues you should take into account +when designing your program. + +* Menu: + +* Compatibility:: Compatibility with other implementations +* Using Extensions:: Using non-standard features +* ANSI C:: Using ANSI C features +* Source Language:: Using languages other than C + + +File: standards.info, Node: Compatibility, Next: Using Extensions, Up: Design Advice + +Compatibility with Other Implementations +======================================== + + With occasional exceptions, utility programs and libraries for GNU +should be upward compatible with those in Berkeley Unix, and upward +compatible with ANSI C if ANSI C specifies their behavior, and upward +compatible with POSIX if POSIX specifies their behavior. + + When these standards conflict, it is useful to offer compatibility +modes for each of them. + + ANSI C and POSIX prohibit many kinds of extensions. Feel free to +make the extensions anyway, and include a `--ansi', `--posix', or +`--compatible' option to turn them off. However, if the extension has +a significant chance of breaking any real programs or scripts, then it +is not really upward compatible. Try to redesign its interface. + + Many GNU programs suppress extensions that conflict with POSIX if the +environment variable `POSIXLY_CORRECT' is defined (even if it is +defined with a null value). Please make your program recognize this +variable if appropriate. + + When a feature is used only by users (not by programs or command +files), and it is done poorly in Unix, feel free to replace it +completely with something totally different and better. (For example, +`vi' is replaced with Emacs.) But it is nice to offer a compatible +feature as well. (There is a free `vi' clone, so we offer it.) + + Additional useful features not in Berkeley Unix are welcome. + + +File: standards.info, Node: Using Extensions, Next: ANSI C, Prev: Compatibility, Up: Design Advice + +Using Non-standard Features +=========================== + + Many GNU facilities that already exist support a number of convenient +extensions over the comparable Unix facilities. Whether to use these +extensions in implementing your program is a difficult question. + + On the one hand, using the extensions can make a cleaner program. +On the other hand, people will not be able to build the program unless +the other GNU tools are available. This might cause the program to +work on fewer kinds of machines. + + With some extensions, it might be easy to provide both alternatives. +For example, you can define functions with a "keyword" `INLINE' and +define that as a macro to expand into either `inline' or nothing, +depending on the compiler. + + In general, perhaps it is best not to use the extensions if you can +straightforwardly do without them, but to use the extensions if they +are a big improvement. + + An exception to this rule are the large, established programs (such +as Emacs) which run on a great variety of systems. Such programs would +be broken by use of GNU extensions. + + Another exception is for programs that are used as part of +compilation: anything that must be compiled with other compilers in +order to bootstrap the GNU compilation facilities. If these require +the GNU compiler, then no one can compile them without having them +installed already. That would be no good. + + +File: standards.info, Node: ANSI C, Next: Source Language, Prev: Using Extensions, Up: Design Advice + +ANSI C and pre-ANSI C +===================== + + Do not ever use the "trigraph" feature of ANSI C. + + ANSI C is widespread enough now that it is ok to write new programs +that use ANSI C features (and therefore will not work in non-ANSI +compilers). And if a program is already written in ANSI C, there's no +need to convert it to support non-ANSI compilers. + + However, it is easy to support non-ANSI compilers in most programs, +so you might still consider doing so when you write a program. Instead +of writing function definitions in ANSI prototype form, + + int + foo (int x, int y) + ... + +write the definition in pre-ANSI style like this, + + int + foo (x, y) + int x, y; + ... + +and use a separate declaration to specify the argument prototype: + + int foo (int, int); + + You need such a declaration anyway, in a header file, to get the +benefit of ANSI C prototypes in all the files where the function is +called. And once you have it, you lose nothing by writing the function +definition in the pre-ANSI style. + + If you don't know non-ANSI C, there's no need to learn it; just +write in ANSI C. + + +File: standards.info, Node: Source Language, Prev: ANSI C, Up: Design Advice + +Using Languages Other Than C +============================ + + Using a language other than C is like using a non-standard feature: +it will cause trouble for users. Even if GCC supports the other +language, users may find it inconvenient to have to install the +compiler for that other language in order to build your program. For +example, if you write your program in C++, people will have to install +the C++ compiler in order to compile your program. Thus, it is better +if you write in C. + + But there are three situations when there is no disadvantage in using +some other language: + + * It is okay to use another language if your program contains an + interpreter for that language. + + For example, if your program links with GUILE, it is ok to write + part of the program in Scheme or another language supported by + GUILE. + + * It is okay to use another language in a tool specifically intended + for use with that language. + + This is okay because the only people who want to build the tool + will be those who have installed the other language anyway. + + * If an application is of interest to a narrow community, then + perhaps it's not important if the application is inconvenient to + install. + + C has one other advantage over C++ and other compiled languages: more +people know C, so more people will find it easy to read and modify the +program if it is written in C. + + +File: standards.info, Node: Program Behavior, Next: Writing C, Prev: Design Advice, Up: Top + +Program Behavior for All Programs +********************************* + + This node describes how to write robust software. It also describes +general standards for error messages, the command line interface, and +how libraries should behave. + +* Menu: + +* Semantics:: Writing robust programs +* Libraries:: Library behavior +* Errors:: Formatting error messages +* User Interfaces:: Standards for command line interfaces +* Option Table:: Table of long options. +* Memory Usage:: When and how to care about memory needs + + +File: standards.info, Node: Semantics, Next: Libraries, Up: Program Behavior + +Writing Robust Programs +======================= + + Avoid arbitrary limits on the length or number of _any_ data +structure, including file names, lines, files, and symbols, by +allocating all data structures dynamically. In most Unix utilities, +"long lines are silently truncated". This is not acceptable in a GNU +utility. + + Utilities reading files should not drop NUL characters, or any other +nonprinting characters _including those with codes above 0177_. The +only sensible exceptions would be utilities specifically intended for +interface to certain types of printers that can't handle those +characters. + + Check every system call for an error return, unless you know you +wish to ignore errors. Include the system error text (from `perror' or +equivalent) in _every_ error message resulting from a failing system +call, as well as the name of the file if any and the name of the +utility. Just "cannot open foo.c" or "stat failed" is not sufficient. + + Check every call to `malloc' or `realloc' to see if it returned +zero. Check `realloc' even if you are making the block smaller; in a +system that rounds block sizes to a power of 2, `realloc' may get a +different block if you ask for less space. + + In Unix, `realloc' can destroy the storage block if it returns zero. +GNU `realloc' does not have this bug: if it fails, the original block +is unchanged. Feel free to assume the bug is fixed. If you wish to +run your program on Unix, and wish to avoid lossage in this case, you +can use the GNU `malloc'. + + You must expect `free' to alter the contents of the block that was +freed. Anything you want to fetch from the block, you must fetch before +calling `free'. + + If `malloc' fails in a noninteractive program, make that a fatal +error. In an interactive program (one that reads commands from the +user), it is better to abort the command and return to the command +reader loop. This allows the user to kill other processes to free up +virtual memory, and then try the command again. + + Use `getopt_long' to decode arguments, unless the argument syntax +makes this unreasonable. + + When static storage is to be written in during program execution, use +explicit C code to initialize it. Reserve C initialized declarations +for data that will not be changed. + + Try to avoid low-level interfaces to obscure Unix data structures +(such as file directories, utmp, or the layout of kernel memory), since +these are less likely to work compatibly. If you need to find all the +files in a directory, use `readdir' or some other high-level interface. +These will be supported compatibly by GNU. + + By default, the GNU system will provide the signal handling +functions of BSD and of POSIX. So GNU software should be written to use +these. + + In error checks that detect "impossible" conditions, just abort. +There is usually no point in printing any message. These checks +indicate the existence of bugs. Whoever wants to fix the bugs will have +to read the source code and run a debugger. So explain the problem with +comments in the source. The relevant data will be in variables, which +are easy to examine with the debugger, so there is no point moving them +elsewhere. + + Do not use a count of errors as the exit status for a program. +_That does not work_, because exit status values are limited to 8 bits +(0 through 255). A single run of the program might have 256 errors; if +you try to return 256 as the exit status, the parent process will see 0 +as the status, and it will appear that the program succeeded. + + If you make temporary files, check the `TMPDIR' environment +variable; if that variable is defined, use the specified directory +instead of `/tmp'. + + +File: standards.info, Node: Libraries, Next: Errors, Prev: Semantics, Up: Program Behavior + +Library Behavior +================ + + Try to make library functions reentrant. If they need to do dynamic +storage allocation, at least try to avoid any nonreentrancy aside from +that of `malloc' itself. + + Here are certain name conventions for libraries, to avoid name +conflicts. + + Choose a name prefix for the library, more than two characters long. +All external function and variable names should start with this prefix. +In addition, there should only be one of these in any given library +member. This usually means putting each one in a separate source file. + + An exception can be made when two external symbols are always used +together, so that no reasonable program could use one without the +other; then they can both go in the same file. + + External symbols that are not documented entry points for the user +should have names beginning with `_'. They should also contain the +chosen name prefix for the library, to prevent collisions with other +libraries. These can go in the same files with user entry points if +you like. + + Static functions and variables can be used as you like and need not +fit any naming convention. + + +File: standards.info, Node: Errors, Next: User Interfaces, Prev: Libraries, Up: Program Behavior + +Formatting Error Messages +========================= + + Error messages from compilers should look like this: + + SOURCE-FILE-NAME:LINENO: MESSAGE + + Error messages from other noninteractive programs should look like +this: + + PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE + +when there is an appropriate source file, or like this: + + PROGRAM: MESSAGE + +when there is no relevant source file. + + In an interactive program (one that is reading commands from a +terminal), it is better not to include the program name in an error +message. The place to indicate which program is running is in the +prompt or with the screen layout. (When the same program runs with +input from a source other than a terminal, it is not interactive and +would do best to print error messages using the noninteractive style.) + + The string MESSAGE should not begin with a capital letter when it +follows a program name and/or file name. Also, it should not end with +a period. + + Error messages from interactive programs, and other messages such as +usage messages, should start with a capital letter. But they should not +end with a period. + + +File: standards.info, Node: User Interfaces, Next: Option Table, Prev: Errors, Up: Program Behavior + +Standards for Command Line Interfaces +===================================== + + Please don't make the behavior of a utility depend on the name used +to invoke it. It is useful sometimes to make a link to a utility with +a different name, and that should not change what it does. + + Instead, use a run time option or a compilation switch or both to +select among the alternate behaviors. + + Likewise, please don't make the behavior of the program depend on the +type of output device it is used with. Device independence is an +important principle of the system's design; do not compromise it merely +to save someone from typing an option now and then. + + If you think one behavior is most useful when the output is to a +terminal, and another is most useful when the output is a file or a +pipe, then it is usually best to make the default behavior the one that +is useful with output to a terminal, and have an option for the other +behavior. + + Compatibility requires certain programs to depend on the type of +output device. It would be disastrous if `ls' or `sh' did not do so in +the way all users expect. In some of these cases, we supplement the +program with a preferred alternate version that does not depend on the +output device type. For example, we provide a `dir' program much like +`ls' except that its default output format is always multi-column +format. + + It is a good idea to follow the POSIX guidelines for the +command-line options of a program. The easiest way to do this is to use +`getopt' to parse them. Note that the GNU version of `getopt' will +normally permit options anywhere among the arguments unless the special +argument `--' is used. This is not what POSIX specifies; it is a GNU +extension. + + Please define long-named options that are equivalent to the +single-letter Unix-style options. We hope to make GNU more user +friendly this way. This is easy to do with the GNU function +`getopt_long'. + + One of the advantages of long-named options is that they can be +consistent from program to program. For example, users should be able +to expect the "verbose" option of any GNU program which has one, to be +spelled precisely `--verbose'. To achieve this uniformity, look at the +table of common long-option names when you choose the option names for +your program (*note Option Table::). + + It is usually a good idea for file names given as ordinary arguments +to be input files only; any output files would be specified using +options (preferably `-o' or `--output'). Even if you allow an output +file name as an ordinary argument for compatibility, try to provide an +option as another way to specify it. This will lead to more consistency +among GNU utilities, and fewer idiosyncracies for users to remember. + + All programs should support two standard options: `--version' and +`--help'. + +`--version' + This option should direct the program to information about its + name, version, origin and legal status, all on standard output, + and then exit successfully. Other options and arguments should be + ignored once this is seen, and the program should not perform its + normal function. + + The first line is meant to be easy for a program to parse; the + version number proper starts after the last space. In addition, + it contains the canonical name for this program, in this format: + + GNU Emacs 19.30 + + The program's name should be a constant string; _don't_ compute it + from `argv[0]'. The idea is to state the standard or canonical + name for the program, not its file name. There are other ways to + find out the precise file name where a command is found in `PATH'. + + If the program is a subsidiary part of a larger package, mention + the package name in parentheses, like this: + + emacsserver (GNU Emacs) 19.30 + + If the package has a version number which is different from this + program's version number, you can mention the package version + number just before the close-parenthesis. + + If you *need* to mention the version numbers of libraries which + are distributed separately from the package which contains this + program, you can do so by printing an additional line of version + info for each library you want to mention. Use the same format + for these lines as for the first line. + + Please do not mention all of the libraries that the program uses + "just for completeness"--that would produce a lot of unhelpful + clutter. Please mention library version numbers only if you find + in practice that they are very important to you in debugging. + + The following line, after the version number line or lines, should + be a copyright notice. If more than one copyright notice is + called for, put each on a separate line. + + Next should follow a brief statement that the program is free + software, and that users are free to copy and change it on certain + conditions. If the program is covered by the GNU GPL, say so + here. Also mention that there is no warranty, to the extent + permitted by law. + + It is ok to finish the output with a list of the major authors of + the program, as a way of giving credit. + + Here's an example of output that follows these rules: + + GNU Emacs 19.34.5 + Copyright (C) 1996 Free Software Foundation, Inc. + GNU Emacs comes with NO WARRANTY, + to the extent permitted by law. + You may redistribute copies of GNU Emacs + under the terms of the GNU General Public License. + For more information about these matters, + see the files named COPYING. + + You should adapt this to your program, of course, filling in the + proper year, copyright holder, name of program, and the references + to distribution terms, and changing the rest of the wording as + necessary. + + This copyright notice only needs to mention the most recent year in + which changes were made--there's no need to list the years for + previous versions' changes. You don't have to mention the name of + the program in these notices, if that is inconvenient, since it + appeared in the first line. + +`--help' + This option should output brief documentation for how to invoke the + program, on standard output, then exit successfully. Other + options and arguments should be ignored once this is seen, and the + program should not perform its normal function. + + Near the end of the `--help' option's output there should be a line + that says where to mail bug reports. It should have this format: + + Report bugs to MAILING-ADDRESS. + + +File: standards.info, Node: Option Table, Next: Memory Usage, Prev: User Interfaces, Up: Program Behavior + +Table of Long Options +===================== + + Here is a table of long options used by GNU programs. It is surely +incomplete, but we aim to list all the options that a new program might +want to be compatible with. If you use names not already in the table, +please send a list of them, with their meanings, so we +can update the table. + +`after-date' + `-N' in `tar'. + +`all' + `-a' in `du', `ls', `nm', `stty', `uname', and `unexpand'. + +`all-text' + `-a' in `diff'. + +`almost-all' + `-A' in `ls'. + +`append' + `-a' in `etags', `tee', `time'; `-r' in `tar'. + +`archive' + `-a' in `cp'. + +`archive-name' + `-n' in `shar'. + +`arglength' + `-l' in `m4'. + +`ascii' + `-a' in `diff'. + +`assign' + `-v' in `gawk'. + +`assume-new' + `-W' in Make. + +`assume-old' + `-o' in Make. + +`auto-check' + `-a' in `recode'. + +`auto-pager' + `-a' in `wdiff'. + +`auto-reference' + `-A' in `ptx'. + +`avoid-wraps' + `-n' in `wdiff'. + +`backward-search' + `-B' in `ctags'. + +`basename' + `-f' in `shar'. + +`batch' + Used in GDB. + +`baud' + Used in GDB. + +`before' + `-b' in `tac'. + +`binary' + `-b' in `cpio' and `diff'. + +`bits-per-code' + `-b' in `shar'. + +`block-size' + Used in `cpio' and `tar'. + +`blocks' + `-b' in `head' and `tail'. + +`break-file' + `-b' in `ptx'. + +`brief' + Used in various programs to make output shorter. + +`bytes' + `-c' in `head', `split', and `tail'. + +`c++' + `-C' in `etags'. + +`catenate' + `-A' in `tar'. + +`cd' + Used in various programs to specify the directory to use. + +`changes' + `-c' in `chgrp' and `chown'. + +`classify' + `-F' in `ls'. + +`colons' + `-c' in `recode'. + +`command' + `-c' in `su'; `-x' in GDB. + +`compare' + `-d' in `tar'. + +`compat' + Used in `gawk'. + +`compress' + `-Z' in `tar' and `shar'. + +`concatenate' + `-A' in `tar'. + +`confirmation' + `-w' in `tar'. + +`context' + Used in `diff'. + +`copyleft' + `-W copyleft' in `gawk'. + +`copyright' + `-C' in `ptx', `recode', and `wdiff'; `-W copyright' in `gawk'. + +`core' + Used in GDB. + +`count' + `-q' in `who'. + +`count-links' + `-l' in `du'. + +`create' + Used in `tar' and `cpio'. + +`cut-mark' + `-c' in `shar'. + +`cxref' + `-x' in `ctags'. + +`date' + `-d' in `touch'. + +`debug' + `-d' in Make and `m4'; `-t' in Bison. + +`define' + `-D' in `m4'. + +`defines' + `-d' in Bison and `ctags'. + +`delete' + `-D' in `tar'. + +`dereference' + `-L' in `chgrp', `chown', `cpio', `du', `ls', and `tar'. + +`dereference-args' + `-D' in `du'. + +`diacritics' + `-d' in `recode'. + +`dictionary-order' + `-d' in `look'. + +`diff' + `-d' in `tar'. + +`digits' + `-n' in `csplit'. + +`directory' + Specify the directory to use, in various programs. In `ls', it + means to show directories themselves rather than their contents. + In `rm' and `ln', it means to not treat links to directories + specially. + +`discard-all' + `-x' in `strip'. + +`discard-locals' + `-X' in `strip'. + +`dry-run' + `-n' in Make. + +`ed' + `-e' in `diff'. + +`elide-empty-files' + `-z' in `csplit'. + +`end-delete' + `-x' in `wdiff'. + +`end-insert' + `-z' in `wdiff'. + +`entire-new-file' + `-N' in `diff'. + +`environment-overrides' + `-e' in Make. + +`eof' + `-e' in `xargs'. + +`epoch' + Used in GDB. + +`error-limit' + Used in `makeinfo'. + +`error-output' + `-o' in `m4'. + +`escape' + `-b' in `ls'. + +`exclude-from' + `-X' in `tar'. + +`exec' + Used in GDB. + +`exit' + `-x' in `xargs'. + +`exit-0' + `-e' in `unshar'. + +`expand-tabs' + `-t' in `diff'. + +`expression' + `-e' in `sed'. + +`extern-only' + `-g' in `nm'. + +`extract' + `-i' in `cpio'; `-x' in `tar'. + +`faces' + `-f' in `finger'. + +`fast' + `-f' in `su'. + +`fatal-warnings' + `-E' in `m4'. + +`file' + `-f' in `info', `gawk', Make, `mt', and `tar'; `-n' in `sed'; `-r' + in `touch'. + +`field-separator' + `-F' in `gawk'. + +`file-prefix' + `-b' in Bison. + +`file-type' + `-F' in `ls'. + +`files-from' + `-T' in `tar'. + +`fill-column' + Used in `makeinfo'. + +`flag-truncation' + `-F' in `ptx'. + +`fixed-output-files' + `-y' in Bison. + +`follow' + `-f' in `tail'. + +`footnote-style' + Used in `makeinfo'. + +`force' + `-f' in `cp', `ln', `mv', and `rm'. + +`force-prefix' + `-F' in `shar'. + +`format' + Used in `ls', `time', and `ptx'. + +`freeze-state' + `-F' in `m4'. + +`fullname' + Used in GDB. + +`gap-size' + `-g' in `ptx'. + +`get' + `-x' in `tar'. + +`graphic' + `-i' in `ul'. + +`graphics' + `-g' in `recode'. + +`group' + `-g' in `install'. + +`gzip' + `-z' in `tar' and `shar'. + +`hashsize' + `-H' in `m4'. + +`header' + `-h' in `objdump' and `recode' + +`heading' + `-H' in `who'. + +`help' + Used to ask for brief usage information. + +`here-delimiter' + `-d' in `shar'. + +`hide-control-chars' + `-q' in `ls'. + +`idle' + `-u' in `who'. + +`ifdef' + `-D' in `diff'. + +`ignore' + `-I' in `ls'; `-x' in `recode'. + +`ignore-all-space' + `-w' in `diff'. + +`ignore-backups' + `-B' in `ls'. + +`ignore-blank-lines' + `-B' in `diff'. + +`ignore-case' + `-f' in `look' and `ptx'; `-i' in `diff' and `wdiff'. + +`ignore-errors' + `-i' in Make. + +`ignore-file' + `-i' in `ptx'. + +`ignore-indentation' + `-I' in `etags'. + +`ignore-init-file' + `-f' in Oleo. + +`ignore-interrupts' + `-i' in `tee'. + +`ignore-matching-lines' + `-I' in `diff'. + +`ignore-space-change' + `-b' in `diff'. + +`ignore-zeros' + `-i' in `tar'. + +`include' + `-i' in `etags'; `-I' in `m4'. + +`include-dir' + `-I' in Make. + +`incremental' + `-G' in `tar'. + +`info' + `-i', `-l', and `-m' in Finger. + +`initial' + `-i' in `expand'. + +`initial-tab' + `-T' in `diff'. + +`inode' + `-i' in `ls'. + +`interactive' + `-i' in `cp', `ln', `mv', `rm'; `-e' in `m4'; `-p' in `xargs'; + `-w' in `tar'. + +`intermix-type' + `-p' in `shar'. + +`jobs' + `-j' in Make. + +`just-print' + `-n' in Make. + +`keep-going' + `-k' in Make. + +`keep-files' + `-k' in `csplit'. + +`kilobytes' + `-k' in `du' and `ls'. + +`language' + `-l' in `etags'. + +`less-mode' + `-l' in `wdiff'. + +`level-for-gzip' + `-g' in `shar'. + +`line-bytes' + `-C' in `split'. + +`lines' + Used in `split', `head', and `tail'. + +`link' + `-l' in `cpio'. + +`lint' +`lint-old' + Used in `gawk'. + +`list' + `-t' in `cpio'; `-l' in `recode'. + +`list' + `-t' in `tar'. + +`literal' + `-N' in `ls'. + +`load-average' + `-l' in Make. + +`login' + Used in `su'. + +`machine' + No listing of which programs already use this; someone should + check to see if any actually do, and tell . + +`macro-name' + `-M' in `ptx'. + +`mail' + `-m' in `hello' and `uname'. + +`make-directories' + `-d' in `cpio'. + +`makefile' + `-f' in Make. + +`mapped' + Used in GDB. + +`max-args' + `-n' in `xargs'. + +`max-chars' + `-n' in `xargs'. + +`max-lines' + `-l' in `xargs'. + +`max-load' + `-l' in Make. + +`max-procs' + `-P' in `xargs'. + +`mesg' + `-T' in `who'. + +`message' + `-T' in `who'. + +`minimal' + `-d' in `diff'. + +`mixed-uuencode' + `-M' in `shar'. + +`mode' + `-m' in `install', `mkdir', and `mkfifo'. + +`modification-time' + `-m' in `tar'. + +`multi-volume' + `-M' in `tar'. + +`name-prefix' + `-a' in Bison. + +`nesting-limit' + `-L' in `m4'. + +`net-headers' + `-a' in `shar'. + +`new-file' + `-W' in Make. + +`no-builtin-rules' + `-r' in Make. + +`no-character-count' + `-w' in `shar'. + +`no-check-existing' + `-x' in `shar'. + +`no-common' + `-3' in `wdiff'. + +`no-create' + `-c' in `touch'. + +`no-defines' + `-D' in `etags'. + +`no-deleted' + `-1' in `wdiff'. + +`no-dereference' + `-d' in `cp'. + +`no-inserted' + `-2' in `wdiff'. + +`no-keep-going' + `-S' in Make. + +`no-lines' + `-l' in Bison. + +`no-piping' + `-P' in `shar'. + +`no-prof' + `-e' in `gprof'. + +`no-regex' + `-R' in `etags'. + +`no-sort' + `-p' in `nm'. + +`no-split' + Used in `makeinfo'. + +`no-static' + `-a' in `gprof'. + +`no-time' + `-E' in `gprof'. + +`no-timestamp' + `-m' in `shar'. + +`no-validate' + Used in `makeinfo'. + +`no-wait' + Used in `emacsclient'. + +`no-warn' + Used in various programs to inhibit warnings. + +`node' + `-n' in `info'. + +`nodename' + `-n' in `uname'. + +`nonmatching' + `-f' in `cpio'. + +`nstuff' + `-n' in `objdump'. + +`null' + `-0' in `xargs'. + +`number' + `-n' in `cat'. + +`number-nonblank' + `-b' in `cat'. + +`numeric-sort' + `-n' in `nm'. + +`numeric-uid-gid' + `-n' in `cpio' and `ls'. + +`nx' + Used in GDB. + +`old-archive' + `-o' in `tar'. + +`old-file' + `-o' in Make. + +`one-file-system' + `-l' in `tar', `cp', and `du'. + +`only-file' + `-o' in `ptx'. + +`only-prof' + `-f' in `gprof'. + +`only-time' + `-F' in `gprof'. + +`output' + In various programs, specify the output file name. + +`output-prefix' + `-o' in `shar'. + +`override' + `-o' in `rm'. + +`overwrite' + `-c' in `unshar'. + +`owner' + `-o' in `install'. + +`paginate' + `-l' in `diff'. + +`paragraph-indent' + Used in `makeinfo'. + +`parents' + `-p' in `mkdir' and `rmdir'. + +`pass-all' + `-p' in `ul'. + +`pass-through' + `-p' in `cpio'. + +`port' + `-P' in `finger'. + +`portability' + `-c' in `cpio' and `tar'. + +`posix' + Used in `gawk'. + +`prefix-builtins' + `-P' in `m4'. + +`prefix' + `-f' in `csplit'. + +`preserve' + Used in `tar' and `cp'. + +`preserve-environment' + `-p' in `su'. + +`preserve-modification-time' + `-m' in `cpio'. + +`preserve-order' + `-s' in `tar'. + +`preserve-permissions' + `-p' in `tar'. + +`print' + `-l' in `diff'. + +`print-chars' + `-L' in `cmp'. + +`print-data-base' + `-p' in Make. + +`print-directory' + `-w' in Make. + +`print-file-name' + `-o' in `nm'. + +`print-symdefs' + `-s' in `nm'. + +`printer' + `-p' in `wdiff'. + +`prompt' + `-p' in `ed'. + +`query-user' + `-X' in `shar'. + +`question' + `-q' in Make. + +`quiet' + Used in many programs to inhibit the usual output. *Note:* every + program accepting `--quiet' should accept `--silent' as a synonym. + +`quiet-unshar' + `-Q' in `shar' + +`quote-name' + `-Q' in `ls'. + +`rcs' + `-n' in `diff'. + +`re-interval' + Used in `gawk'. + +`read-full-blocks' + `-B' in `tar'. + +`readnow' + Used in GDB. + +`recon' + `-n' in Make. + +`record-number' + `-R' in `tar'. + +`recursive' + Used in `chgrp', `chown', `cp', `ls', `diff', and `rm'. + +`reference-limit' + Used in `makeinfo'. + +`references' + `-r' in `ptx'. + +`regex' + `-r' in `tac' and `etags'. + +`release' + `-r' in `uname'. + +`reload-state' + `-R' in `m4'. + +`relocation' + `-r' in `objdump'. + +`rename' + `-r' in `cpio'. + +`replace' + `-i' in `xargs'. + +`report-identical-files' + `-s' in `diff'. + +`reset-access-time' + `-a' in `cpio'. + +`reverse' + `-r' in `ls' and `nm'. + +`reversed-ed' + `-f' in `diff'. + +`right-side-defs' + `-R' in `ptx'. + +`same-order' + `-s' in `tar'. + +`same-permissions' + `-p' in `tar'. + +`save' + `-g' in `stty'. + +`se' + Used in GDB. + +`sentence-regexp' + `-S' in `ptx'. + +`separate-dirs' + `-S' in `du'. + +`separator' + `-s' in `tac'. + +`sequence' + Used by `recode' to chose files or pipes for sequencing passes. + +`shell' + `-s' in `su'. + +`show-all' + `-A' in `cat'. + +`show-c-function' + `-p' in `diff'. + +`show-ends' + `-E' in `cat'. + +`show-function-line' + `-F' in `diff'. + +`show-tabs' + `-T' in `cat'. + +`silent' + Used in many programs to inhibit the usual output. *Note:* every + program accepting `--silent' should accept `--quiet' as a synonym. + +`size' + `-s' in `ls'. + +`sort' + Used in `ls'. + +`source' + `-W source' in `gawk'. + +`sparse' + `-S' in `tar'. + +`speed-large-files' + `-H' in `diff'. + +`split-at' + `-E' in `unshar'. + +`split-size-limit' + `-L' in `shar'. + +`squeeze-blank' + `-s' in `cat'. + +`start-delete' + `-w' in `wdiff'. + +`start-insert' + `-y' in `wdiff'. + +`starting-file' + Used in `tar' and `diff' to specify which file within a directory + to start processing with. + +`statistics' + `-s' in `wdiff'. + +`stdin-file-list' + `-S' in `shar'. + +`stop' + `-S' in Make. + +`strict' + `-s' in `recode'. + +`strip' + `-s' in `install'. + +`strip-all' + `-s' in `strip'. + +`strip-debug' + `-S' in `strip'. + +`submitter' + `-s' in `shar'. + +`suffix' + `-S' in `cp', `ln', `mv'. + +`suffix-format' + `-b' in `csplit'. + +`sum' + `-s' in `gprof'. + +`summarize' + `-s' in `du'. + +`symbolic' + `-s' in `ln'. + +`symbols' + Used in GDB and `objdump'. + +`synclines' + `-s' in `m4'. + +`sysname' + `-s' in `uname'. + +`tabs' + `-t' in `expand' and `unexpand'. + +`tabsize' + `-T' in `ls'. + +`terminal' + `-T' in `tput' and `ul'. `-t' in `wdiff'. + +`text' + `-a' in `diff'. + +`text-files' + `-T' in `shar'. + +`time' + Used in `ls' and `touch'. + +`to-stdout' + `-O' in `tar'. + +`total' + `-c' in `du'. + +`touch' + `-t' in Make, `ranlib', and `recode'. + +`trace' + `-t' in `m4'. + +`traditional' + `-t' in `hello'; `-W traditional' in `gawk'; `-G' in `ed', `m4', + and `ptx'. + +`tty' + Used in GDB. + +`typedefs' + `-t' in `ctags'. + +`typedefs-and-c++' + `-T' in `ctags'. + +`typeset-mode' + `-t' in `ptx'. + +`uncompress' + `-z' in `tar'. + +`unconditional' + `-u' in `cpio'. + +`undefine' + `-U' in `m4'. + +`undefined-only' + `-u' in `nm'. + +`update' + `-u' in `cp', `ctags', `mv', `tar'. + +`usage' + Used in `gawk'; same as `--help'. + +`uuencode' + `-B' in `shar'. + +`vanilla-operation' + `-V' in `shar'. + +`verbose' + Print more information about progress. Many programs support this. + +`verify' + `-W' in `tar'. + +`version' + Print the version number. + +`version-control' + `-V' in `cp', `ln', `mv'. + +`vgrind' + `-v' in `ctags'. + +`volume' + `-V' in `tar'. + +`what-if' + `-W' in Make. + +`whole-size-limit' + `-l' in `shar'. + +`width' + `-w' in `ls' and `ptx'. + +`word-regexp' + `-W' in `ptx'. + +`writable' + `-T' in `who'. + +`zeros' + `-z' in `gprof'. + + +File: standards.info, Node: Memory Usage, Prev: Option Table, Up: Program Behavior + +Memory Usage +============ + + If it typically uses just a few meg of memory, don't bother making +any effort to reduce memory usage. For example, if it is impractical +for other reasons to operate on files more than a few meg long, it is +reasonable to read entire input files into core to operate on them. + + However, for programs such as `cat' or `tail', that can usefully +operate on very large files, it is important to avoid using a technique +that would artificially limit the size of files it can handle. If a +program works by lines and could be applied to arbitrary user-supplied +input files, it should keep only a line in memory, because this is not +very hard and users will want to be able to operate on input files that +are bigger than will fit in core all at once. + + If your program creates complicated data structures, just make them +in core and give a fatal error if `malloc' returns zero. + + +File: standards.info, Node: Writing C, Next: Documentation, Prev: Program Behavior, Up: Top + +Making The Best Use of C +************************ + + This node provides advice on how best to use the C language when +writing GNU software. + +* Menu: + +* Formatting:: Formatting Your Source Code +* Comments:: Commenting Your Work +* Syntactic Conventions:: Clean Use of C Constructs +* Names:: Naming Variables and Functions +* System Portability:: Portability between different operating systems +* CPU Portability:: Supporting the range of CPU types +* System Functions:: Portability and ``standard'' library functions +* Internationalization:: Techniques for internationalization +* Mmap:: How you can safely use `mmap'. + + +File: standards.info, Node: Formatting, Next: Comments, Up: Writing C + +Formatting Your Source Code +=========================== + + It is important to put the open-brace that starts the body of a C +function in column zero, and avoid putting any other open-brace or +open-parenthesis or open-bracket in column zero. Several tools look +for open-braces in column zero to find the beginnings of C functions. +These tools will not work on code not formatted that way. + + It is also important for function definitions to start the name of +the function in column zero. This helps people to search for function +definitions, and may also help certain tools recognize them. Thus, the +proper format is this: + + static char * + concat (s1, s2) /* Name starts in column zero here */ + char *s1, *s2; + { /* Open brace in column zero here */ + ... + } + +or, if you want to use ANSI C, format the definition like this: + + static char * + concat (char *s1, char *s2) + { + ... + } + + In ANSI C, if the arguments don't fit nicely on one line, split it +like this: + + int + lots_of_args (int an_integer, long a_long, short a_short, + double a_double, float a_float) + ... + + For the body of the function, we prefer code formatted like this: + + if (x < foo (y, z)) + haha = bar[4] + 5; + else + { + while (z) + { + haha += foo (z, z); + z--; + } + return ++x + bar (); + } + + We find it easier to read a program when it has spaces before the +open-parentheses and after the commas. Especially after the commas. + + When you split an expression into multiple lines, split it before an +operator, not after one. Here is the right way: + + if (foo_this_is_long && bar > win (x, y, z) + && remaining_condition) + + Try to avoid having two operators of different precedence at the same +level of indentation. For example, don't write this: + + mode = (inmode[j] == VOIDmode + || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]) + ? outmode[j] : inmode[j]); + + Instead, use extra parentheses so that the indentation shows the +nesting: + + mode = ((inmode[j] == VOIDmode + || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]))) + ? outmode[j] : inmode[j]); + + Insert extra parentheses so that Emacs will indent the code properly. +For example, the following indentation looks nice if you do it by hand, +but Emacs would mess it up: + + v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 + + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000; + + But adding a set of parentheses solves the problem: + + v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 + + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000); + + Format do-while statements like this: + + do + { + a = foo (a); + } + while (a > 0); + + Please use formfeed characters (control-L) to divide the program into +pages at logical places (but not within a function). It does not matter +just how long the pages are, since they do not have to fit on a printed +page. The formfeeds should appear alone on lines by themselves. + + +File: standards.info, Node: Comments, Next: Syntactic Conventions, Prev: Formatting, Up: Writing C + +Commenting Your Work +==================== + + Every program should start with a comment saying briefly what it is +for. Example: `fmt - filter for simple filling of text'. + + Please write the comments in a GNU program in English, because +English is the one language that nearly all programmers in all +countries can read. If you do not write English well, please write +comments in English as well as you can, then ask other people to help +rewrite them. If you can't write comments in English, please find +someone to work with you and translate your comments into English. + + Please put a comment on each function saying what the function does, +what sorts of arguments it gets, and what the possible values of +arguments mean and are used for. It is not necessary to duplicate in +words the meaning of the C argument declarations, if a C type is being +used in its customary fashion. If there is anything nonstandard about +its use (such as an argument of type `char *' which is really the +address of the second character of a string, not the first), or any +possible values that would not work the way one would expect (such as, +that strings containing newlines are not guaranteed to work), be sure +to say so. + + Also explain the significance of the return value, if there is one. + + Please put two spaces after the end of a sentence in your comments, +so that the Emacs sentence commands will work. Also, please write +complete sentences and capitalize the first word. If a lower-case +identifier comes at the beginning of a sentence, don't capitalize it! +Changing the spelling makes it a different identifier. If you don't +like starting a sentence with a lower case letter, write the sentence +differently (e.g., "The identifier lower-case is ..."). + + The comment on a function is much clearer if you use the argument +names to speak about the argument values. The variable name itself +should be lower case, but write it in upper case when you are speaking +about the value rather than the variable itself. Thus, "the inode +number NODE_NUM" rather than "an inode". + + There is usually no purpose in restating the name of the function in +the comment before it, because the reader can see that for himself. +There might be an exception when the comment is so long that the +function itself would be off the bottom of the screen. + + There should be a comment on each static variable as well, like this: + + /* Nonzero means truncate lines in the display; + zero means continue them. */ + int truncate_lines; + + Every `#endif' should have a comment, except in the case of short +conditionals (just a few lines) that are not nested. The comment should +state the condition of the conditional that is ending, _including its +sense_. `#else' should have a comment describing the condition _and +sense_ of the code that follows. For example: + + #ifdef foo + ... + #else /* not foo */ + ... + #endif /* not foo */ + #ifdef foo + ... + #endif /* foo */ + +but, by contrast, write the comments this way for a `#ifndef': + + #ifndef foo + ... + #else /* foo */ + ... + #endif /* foo */ + #ifndef foo + ... + #endif /* not foo */ + + +File: standards.info, Node: Syntactic Conventions, Next: Names, Prev: Comments, Up: Writing C + +Clean Use of C Constructs +========================= + + Please explicitly declare all arguments to functions. Don't omit +them just because they are `int's. + + Declarations of external functions and functions to appear later in +the source file should all go in one place near the beginning of the +file (somewhere before the first function definition in the file), or +else should go in a header file. Don't put `extern' declarations inside +functions. + + It used to be common practice to use the same local variables (with +names like `tem') over and over for different values within one +function. Instead of doing this, it is better declare a separate local +variable for each distinct purpose, and give it a name which is +meaningful. This not only makes programs easier to understand, it also +facilitates optimization by good compilers. You can also move the +declaration of each local variable into the smallest scope that includes +all its uses. This makes the program even cleaner. + + Don't use local variables or parameters that shadow global +identifiers. + + Don't declare multiple variables in one declaration that spans lines. +Start a new declaration on each line, instead. For example, instead of +this: + + int foo, + bar; + +write either this: + + int foo, bar; + +or this: + + int foo; + int bar; + +(If they are global variables, each should have a comment preceding it +anyway.) + + When you have an `if'-`else' statement nested in another `if' +statement, always put braces around the `if'-`else'. Thus, never write +like this: + + if (foo) + if (bar) + win (); + else + lose (); + +always like this: + + if (foo) + { + if (bar) + win (); + else + lose (); + } + + If you have an `if' statement nested inside of an `else' statement, +either write `else if' on one line, like this, + + if (foo) + ... + else if (bar) + ... + +with its `then'-part indented like the preceding `then'-part, or write +the nested `if' within braces like this: + + if (foo) + ... + else + { + if (bar) + ... + } + + Don't declare both a structure tag and variables or typedefs in the +same declaration. Instead, declare the structure tag separately and +then use it to declare the variables or typedefs. + + Try to avoid assignments inside `if'-conditions. For example, don't +write this: + + if ((foo = (char *) malloc (sizeof *foo)) == 0) + fatal ("virtual memory exhausted"); + +instead, write this: + + foo = (char *) malloc (sizeof *foo); + if (foo == 0) + fatal ("virtual memory exhausted"); + + Don't make the program ugly to placate `lint'. Please don't insert +any casts to `void'. Zero without a cast is perfectly fine as a null +pointer constant, except when calling a varargs function. + + +File: standards.info, Node: Names, Next: System Portability, Prev: Syntactic Conventions, Up: Writing C + +Naming Variables and Functions +============================== + + The names of global variables and functions in a program serve as +comments of a sort. So don't choose terse names--instead, look for +names that give useful information about the meaning of the variable or +function. In a GNU program, names should be English, like other +comments. + + Local variable names can be shorter, because they are used only +within one context, where (presumably) comments explain their purpose. + + Please use underscores to separate words in a name, so that the Emacs +word commands can be useful within them. Stick to lower case; reserve +upper case for macros and `enum' constants, and for name-prefixes that +follow a uniform convention. + + For example, you should use names like `ignore_space_change_flag'; +don't use names like `iCantReadThis'. + + Variables that indicate whether command-line options have been +specified should be named after the meaning of the option, not after +the option-letter. A comment should state both the exact meaning of +the option and its letter. For example, + + /* Ignore changes in horizontal whitespace (-b). */ + int ignore_space_change_flag; + + When you want to define names with constant integer values, use +`enum' rather than `#define'. GDB knows about enumeration constants. + + Use file names of 14 characters or less, to avoid creating gratuitous +problems on older System V systems. You can use the program `doschk' +to test for this. `doschk' also tests for potential name conflicts if +the files were loaded onto an MS-DOS file system--something you may or +may not care about. + + +File: standards.info, Node: System Portability, Next: CPU Portability, Prev: Names, Up: Writing C + +Portability between System Types +================================ + + In the Unix world, "portability" refers to porting to different Unix +versions. For a GNU program, this kind of portability is desirable, but +not paramount. + + The primary purpose of GNU software is to run on top of the GNU +kernel, compiled with the GNU C compiler, on various types of CPU. The +amount and kinds of variation among GNU systems on different CPUs will +be comparable to the variation among Linux-based GNU systems or among +BSD systems today. So the kinds of portability that are absolutely +necessary are quite limited. + + But many users do run GNU software on non-GNU Unix or Unix-like +systems. So supporting a variety of Unix-like systems is desirable, +although not paramount. + + The easiest way to achieve portability to most Unix-like systems is +to use Autoconf. It's unlikely that your program needs to know more +information about the host platform than Autoconf can provide, simply +because most of the programs that need such knowledge have already been +written. + + Avoid using the format of semi-internal data bases (e.g., +directories) when there is a higher-level alternative (`readdir'). + + As for systems that are not like Unix, such as MSDOS, Windows, the +Macintosh, VMS, and MVS, supporting them is usually so much work that it +is better if you don't. + + The planned GNU kernel is not finished yet, but you can tell which +facilities it will provide by looking at the GNU C Library Manual. The +GNU kernel is based on Mach, so the features of Mach will also be +available. However, if you use Mach features, you'll probably have +trouble debugging your program today. + + +File: standards.info, Node: CPU Portability, Next: System Functions, Prev: System Portability, Up: Writing C + +Portability between CPUs +======================== + + Even GNU systems will differ because of differences among CPU +types--for example, difference in byte ordering and alignment +requirements. It is absolutely essential to handle these differences. +However, don't make any effort to cater to the possibility that an +`int' will be less than 32 bits. We don't support 16-bit machines in +GNU. + + Don't assume that the address of an `int' object is also the address +of its least-significant byte. This is false on big-endian machines. +Thus, don't make the following mistake: + + int c; + ... + while ((c = getchar()) != EOF) + write(file_descriptor, &c, 1); + + When calling functions, you need not worry about the difference +between pointers of various types, or between pointers and integers. +On most machines, there's no difference anyway. As for the few +machines where there is a difference, all of them support ANSI C, so +you can use prototypes (conditionalized to be active only in ANSI C) to +make the code work on those systems. + + In certain cases, it is ok to pass integer and pointer arguments +indiscriminately to the same function, and use no prototype on any +system. For example, many GNU programs have error-reporting functions +that pass their arguments along to `printf' and friends: + + error (s, a1, a2, a3) + char *s; + int a1, a2, a3; + { + fprintf (stderr, "error: "); + fprintf (stderr, s, a1, a2, a3); + } + +In practice, this works on all machines, and it is much simpler than any +"correct" alternative. Be sure _not_ to use a prototype for such +functions. + + However, avoid casting pointers to integers unless you really need +to. These assumptions really reduce portability, and in most programs +they are easy to avoid. In the cases where casting pointers to +integers is essential--such as, a Lisp interpreter which stores type +information as well as an address in one word--it is ok to do so, but +you'll have to make explicit provisions to handle different word sizes. + + +File: standards.info, Node: System Functions, Next: Internationalization, Prev: CPU Portability, Up: Writing C + +Calling System Functions +======================== + + C implementations differ substantially. ANSI C reduces but does not +eliminate the incompatibilities; meanwhile, many users wish to compile +GNU software with pre-ANSI compilers. This chapter gives +recommendations for how to use the more or less standard C library +functions to avoid unnecessary loss of portability. + + * Don't use the value of `sprintf'. It returns the number of + characters written on some systems, but not on all systems. + + * `main' should be declared to return type `int'. It should + terminate either by calling `exit' or by returning the integer + status code; make sure it cannot ever return an undefined value. + + * Don't declare system functions explicitly. + + Almost any declaration for a system function is wrong on some + system. To minimize conflicts, leave it to the system header + files to declare system functions. If the headers don't declare a + function, let it remain undeclared. + + While it may seem unclean to use a function without declaring it, + in practice this works fine for most system library functions on + the systems where this really happens; thus, the disadvantage is + only theoretical. By contrast, actual declarations have + frequently caused actual conflicts. + + * If you must declare a system function, don't specify the argument + types. Use an old-style declaration, not an ANSI prototype. The + more you specify about the function, the more likely a conflict. + + * In particular, don't unconditionally declare `malloc' or `realloc'. + + Most GNU programs use those functions just once, in functions + conventionally named `xmalloc' and `xrealloc'. These functions + call `malloc' and `realloc', respectively, and check the results. + + Because `xmalloc' and `xrealloc' are defined in your program, you + can declare them in other files without any risk of type conflict. + + On most systems, `int' is the same length as a pointer; thus, the + calls to `malloc' and `realloc' work fine. For the few + exceptional systems (mostly 64-bit machines), you can use + *conditionalized* declarations of `malloc' and `realloc'--or put + these declarations in configuration files specific to those + systems. + + * The string functions require special treatment. Some Unix systems + have a header file `string.h'; others have `strings.h'. Neither + file name is portable. There are two things you can do: use + Autoconf to figure out which file to include, or don't include + either file. + + * If you don't include either strings file, you can't get + declarations for the string functions from the header file in the + usual way. + + That causes less of a problem than you might think. The newer ANSI + string functions should be avoided anyway because many systems + still don't support them. The string functions you can use are + these: + + strcpy strncpy strcat strncat + strlen strcmp strncmp + strchr strrchr + + The copy and concatenate functions work fine without a declaration + as long as you don't use their values. Using their values without + a declaration fails on systems where the width of a pointer + differs from the width of `int', and perhaps in other cases. It + is trivial to avoid using their values, so do that. + + The compare functions and `strlen' work fine without a declaration + on most systems, possibly all the ones that GNU software runs on. + You may find it necessary to declare them *conditionally* on a few + systems. + + The search functions must be declared to return `char *'. Luckily, + there is no variation in the data type they return. But there is + variation in their names. Some systems give these functions the + names `index' and `rindex'; other systems use the names `strchr' + and `strrchr'. Some systems support both pairs of names, but + neither pair works on all systems. + + You should pick a single pair of names and use it throughout your + program. (Nowadays, it is better to choose `strchr' and `strrchr' + for new programs, since those are the standard ANSI names.) + Declare both of those names as functions returning `char *'. On + systems which don't support those names, define them as macros in + terms of the other pair. For example, here is what to put at the + beginning of your file (or in a header) if you want to use the + names `strchr' and `strrchr' throughout: + + #ifndef HAVE_STRCHR + #define strchr index + #endif + #ifndef HAVE_STRRCHR + #define strrchr rindex + #endif + + char *strchr (); + char *strrchr (); + + Here we assume that `HAVE_STRCHR' and `HAVE_STRRCHR' are macros +defined in systems where the corresponding functions exist. One way to +get them properly defined is to use Autoconf. + + +File: standards.info, Node: Internationalization, Next: Mmap, Prev: System Functions, Up: Writing C + +Internationalization +==================== + + GNU has a library called GNU gettext that makes it easy to translate +the messages in a program into various languages. You should use this +library in every program. Use English for the messages as they appear +in the program, and let gettext provide the way to translate them into +other languages. + + Using GNU gettext involves putting a call to the `gettext' macro +around each string that might need translation--like this: + + printf (gettext ("Processing file `%s'...")); + +This permits GNU gettext to replace the string `"Processing file +`%s'..."' with a translated version. + + Once a program uses gettext, please make a point of writing calls to +`gettext' when you add new strings that call for translation. + + Using GNU gettext in a package involves specifying a "text domain +name" for the package. The text domain name is used to separate the +translations for this package from the translations for other packages. +Normally, the text domain name should be the same as the name of the +package--for example, `fileutils' for the GNU file utilities. + + To enable gettext to work well, avoid writing code that makes +assumptions about the structure of words or sentences. When you want +the precise text of a sentence to vary depending on the data, use two or +more alternative string constants each containing a complete sentences, +rather than inserting conditionalized words or phrases into a single +sentence framework. + + Here is an example of what not to do: + + printf ("%d file%s processed", nfiles, + nfiles != 1 ? "s" : ""); + +The problem with that example is that it assumes that plurals are made +by adding `s'. If you apply gettext to the format string, like this, + + printf (gettext ("%d file%s processed"), nfiles, + nfiles != 1 ? "s" : ""); + +the message can use different words, but it will still be forced to use +`s' for the plural. Here is a better way: + + printf ((nfiles != 1 ? "%d files processed" + : "%d file processed"), + nfiles); + +This way, you can apply gettext to each of the two strings +independently: + + printf ((nfiles != 1 ? gettext ("%d files processed") + : gettext ("%d file processed")), + nfiles); + +This can be any method of forming the plural of the word for "file", and +also handles languages that require agreement in the word for +"processed". + + A similar problem appears at the level of sentence structure with +this code: + + printf ("# Implicit rule search has%s been done.\n", + f->tried_implicit ? "" : " not"); + +Adding `gettext' calls to this code cannot give correct results for all +languages, because negation in some languages requires adding words at +more than one place in the sentence. By contrast, adding `gettext' +calls does the job straightfowardly if the code starts out like this: + + printf (f->tried_implicit + ? "# Implicit rule search has been done.\n", + : "# Implicit rule search has not been done.\n"); + + +File: standards.info, Node: Mmap, Prev: Internationalization, Up: Writing C + +Mmap +==== + + Don't assume that `mmap' either works on all files or fails for all +files. It may work on some files and fail on others. + + The proper way to use `mmap' is to try it on the specific file for +which you want to use it--and if `mmap' doesn't work, fall back on +doing the job in another way using `read' and `write'. + + The reason this precaution is needed is that the GNU kernel (the +HURD) provides a user-extensible file system, in which there can be many +different kinds of "ordinary files." Many of them support `mmap', but +some do not. It is important to make programs handle all these kinds +of files. + + +File: standards.info, Node: Documentation, Next: Managing Releases, Prev: Writing C, Up: Top + +Documenting Programs +******************** + +* Menu: + +* GNU Manuals:: Writing proper manuals. +* Manual Structure Details:: Specific structure conventions. +* NEWS File:: NEWS files supplement manuals. +* Change Logs:: Recording Changes +* Man Pages:: Man pages are secondary. +* Reading other Manuals:: How far you can go in learning + from other manuals. + + +File: standards.info, Node: GNU Manuals, Next: Manual Structure Details, Up: Documentation + +GNU Manuals +=========== + + The preferred way to document part of the GNU system is to write a +manual in the Texinfo formatting language. See the Texinfo manual, +either the hardcopy, or the on-line version available through `info' or +the Emacs Info subsystem (`C-h i'). + + Programmers often find it most natural to structure the documentation +following the structure of the implementation, which they know. But +this structure is not necessarily good for explaining how to use the +program; it may be irrelevant and confusing for a user. + + At every level, from the sentences in a paragraph to the grouping of +topics into separate manuals, the right way to structure documentation +is according to the concepts and questions that a user will have in mind +when reading it. Sometimes this structure of ideas matches the +structure of the implementation of the software being documented--but +often they are different. Often the most important part of learning to +write good documentation is learning to notice when you are structuring +the documentation like the implementation, and think about better +alternatives. + + For example, each program in the GNU system probably ought to be +documented in one manual; but this does not mean each program should +have its own manual. That would be following the structure of the +implementation, rather than the structure that helps the user +understand. + + Instead, each manual should cover a coherent _topic_. For example, +instead of a manual for `diff' and a manual for `diff3', we have one +manual for "comparison of files" which covers both of those programs, +as well as `cmp'. By documenting these programs together, we can make +the whole subject clearer. + + The manual which discusses a program should document all of the +program's command-line options and all of its commands. It should give +examples of their use. But don't organize the manual as a list of +features. Instead, organize it logically, by subtopics. Address the +questions that a user will ask when thinking about the job that the +program does. + + In general, a GNU manual should serve both as tutorial and reference. +It should be set up for convenient access to each topic through Info, +and for reading straight through (appendixes aside). A GNU manual +should give a good introduction to a beginner reading through from the +start, and should also provide all the details that hackers want. + + That is not as hard as it first sounds. Arrange each chapter as a +logical breakdown of its topic, but order the sections, and write their +text, so that reading the chapter straight through makes sense. Do +likewise when structuring the book into chapters, and when structuring a +section into paragraphs. The watchword is, _at each point, address the +most fundamental and important issue raised by the preceding text._ + + If necessary, add extra chapters at the beginning of the manual which +are purely tutorial and cover the basics of the subject. These provide +the framework for a beginner to understand the rest of the manual. The +Bison manual provides a good example of how to do this. + + Don't use Unix man pages as a model for how to write GNU +documentation; most of them are terse, badly structured, and give +inadequate explanation of the underlying concepts. (There are, of +course exceptions.) Also Unix man pages use a particular format which +is different from what we use in GNU manuals. + + Please do not use the term "pathname" that is used in Unix +documentation; use "file name" (two words) instead. We use the term +"path" only for search paths, which are lists of file names. + + Please do not use the term "illegal" to refer to erroneous input to a +computer program. Please use "invalid" for this, and reserve the term +"illegal" for violations of law. + + +File: standards.info, Node: Manual Structure Details, Next: NEWS File, Prev: GNU Manuals, Up: Documentation + +Manual Structure Details +======================== + + The title page of the manual should state the version of the +programs or packages documented in the manual. The Top node of the +manual should also contain this information. If the manual is changing +more frequently than or independent of the program, also state a version +number for the manual in both of these places. + + Each program documented in the manual should should have a node named +`PROGRAM Invocation' or `Invoking PROGRAM'. This node (together with +its subnodes, if any) should describe the program's command line +arguments and how to run it (the sort of information people would look +in a man page for). Start with an `@example' containing a template for +all the options and arguments that the program uses. + + Alternatively, put a menu item in some menu whose item name fits one +of the above patterns. This identifies the node which that item points +to as the node for this purpose, regardless of the node's actual name. + + There will be automatic features for specifying a program name and +quickly reading just this part of its manual. + + If one manual describes several programs, it should have such a node +for each program described. + + +File: standards.info, Node: NEWS File, Next: Change Logs, Prev: Manual Structure Details, Up: Documentation + +The NEWS File +============= + + In addition to its manual, the package should have a file named +`NEWS' which contains a list of user-visible changes worth mentioning. +In each new release, add items to the front of the file and identify +the version they pertain to. Don't discard old items; leave them in +the file after the newer items. This way, a user upgrading from any +previous version can see what is new. + + If the `NEWS' file gets very long, move some of the older items into +a file named `ONEWS' and put a note at the end referring the user to +that file. + + +File: standards.info, Node: Change Logs, Next: Man Pages, Prev: NEWS File, Up: Documentation + +Change Logs +=========== + + Keep a change log to describe all the changes made to program source +files. The purpose of this is so that people investigating bugs in the +future will know about the changes that might have introduced the bug. +Often a new bug can be found by looking at what was recently changed. +More importantly, change logs can help you eliminate conceptual +inconsistencies between different parts of a program, by giving you a +history of how the conflicting concepts arose and who they came from. + +* Menu: + +* Change Log Concepts:: +* Style of Change Logs:: +* Simple Changes:: +* Conditional Changes:: + + +File: standards.info, Node: Change Log Concepts, Next: Style of Change Logs, Up: Change Logs + +Change Log Concepts +------------------- + + You can think of the change log as a conceptual "undo list" which +explains how earlier versions were different from the current version. +People can see the current version; they don't need the change log to +tell them what is in it. What they want from a change log is a clear +explanation of how the earlier version differed. + + The change log file is normally called `ChangeLog' and covers an +entire directory. Each directory can have its own change log, or a +directory can use the change log of its parent directory-it's up to you. + + Another alternative is to record change log information with a +version control system such as RCS or CVS. This can be converted +automatically to a `ChangeLog' file. + + There's no need to describe the full purpose of the changes or how +they work together. If you think that a change calls for explanation, +you're probably right. Please do explain it--but please put the +explanation in comments in the code, where people will see it whenever +they see the code. For example, "New function" is enough for the +change log when you add a function, because there should be a comment +before the function definition to explain what it does. + + However, sometimes it is useful to write one line to describe the +overall purpose of a batch of changes. + + The easiest way to add an entry to `ChangeLog' is with the Emacs +command `M-x add-change-log-entry'. An entry should have an asterisk, +the name of the changed file, and then in parentheses the name of the +changed functions, variables or whatever, followed by a colon. Then +describe the changes you made to that function or variable. + + +File: standards.info, Node: Style of Change Logs, Next: Simple Changes, Prev: Change Log Concepts, Up: Change Logs + +Style of Change Logs +-------------------- + + Here are some examples of change log entries: + + * register.el (insert-register): Return nil. + (jump-to-register): Likewise. + + * sort.el (sort-subr): Return nil. + + * tex-mode.el (tex-bibtex-file, tex-file, tex-region): + Restart the tex shell if process is gone or stopped. + (tex-shell-running): New function. + + * expr.c (store_one_arg): Round size up for move_block_to_reg. + (expand_call): Round up when emitting USE insns. + * stmt.c (assign_parms): Round size up for move_block_from_reg. + + It's important to name the changed function or variable in full. +Don't abbreviate function or variable names, and don't combine them. +Subsequent maintainers will often search for a function name to find all +the change log entries that pertain to it; if you abbreviate the name, +they won't find it when they search. + + For example, some people are tempted to abbreviate groups of function +names by writing `* register.el ({insert,jump-to}-register)'; this is +not a good idea, since searching for `jump-to-register' or +`insert-register' would not find that entry. + + Separate unrelated change log entries with blank lines. When two +entries represent parts of the same change, so that they work together, +then don't put blank lines between them. Then you can omit the file +name and the asterisk when successive entries are in the same file. + + +File: standards.info, Node: Simple Changes, Next: Conditional Changes, Prev: Style of Change Logs, Up: Change Logs + +Simple Changes +-------------- + + Certain simple kinds of changes don't need much detail in the change +log. + + When you change the calling sequence of a function in a simple +fashion, and you change all the callers of the function, there is no +need to make individual entries for all the callers that you changed. +Just write in the entry for the function being called, "All callers +changed." + + * keyboard.c (Fcommand_execute): New arg SPECIAL. + All callers changed. + + When you change just comments or doc strings, it is enough to write +an entry for the file, without mentioning the functions. Just "Doc +fixes" is enough for the change log. + + There's no need to make change log entries for documentation files. +This is because documentation is not susceptible to bugs that are hard +to fix. Documentation does not consist of parts that must interact in a +precisely engineered fashion. To correct an error, you need not know +the history of the erroneous passage; it is enough to compare what the +documentation says with the way the program actually works. + + +File: standards.info, Node: Conditional Changes, Prev: Simple Changes, Up: Change Logs + +Conditional Changes +------------------- + + C programs often contain compile-time `#if' conditionals. Many +changes are conditional; sometimes you add a new definition which is +entirely contained in a conditional. It is very useful to indicate in +the change log the conditions for which the change applies. + + Our convention for indicating conditional changes is to use square +brackets around the name of the condition. + + Here is a simple example, describing a change which is conditional +but does not have a function or entity name associated with it: + + * xterm.c [SOLARIS2]: Include string.h. + + Here is an entry describing a new definition which is entirely +conditional. This new definition for the macro `FRAME_WINDOW_P' is +used only when `HAVE_X_WINDOWS' is defined: + + * frame.h [HAVE_X_WINDOWS] (FRAME_WINDOW_P): Macro defined. + + Here is an entry for a change within the function `init_display', +whose definition as a whole is unconditional, but the changes themselves +are contained in a `#ifdef HAVE_LIBNCURSES' conditional: + + * dispnew.c (init_display) [HAVE_LIBNCURSES]: If X, call tgetent. + + Here is an entry for a change that takes affect only when a certain +macro is _not_ defined: + + (gethostname) [!HAVE_SOCKETS]: Replace with winsock version. + + +File: standards.info, Node: Man Pages, Next: Reading other Manuals, Prev: Change Logs, Up: Documentation + +Man Pages +========= + + In the GNU project, man pages are secondary. It is not necessary or +expected for every GNU program to have a man page, but some of them do. +It's your choice whether to include a man page in your program. + + When you make this decision, consider that supporting a man page +requires continual effort each time the program is changed. The time +you spend on the man page is time taken away from more useful work. + + For a simple program which changes little, updating the man page may +be a small job. Then there is little reason not to include a man page, +if you have one. + + For a large program that changes a great deal, updating a man page +may be a substantial burden. If a user offers to donate a man page, +you may find this gift costly to accept. It may be better to refuse +the man page unless the same person agrees to take full responsibility +for maintaining it--so that you can wash your hands of it entirely. If +this volunteer later ceases to do the job, then don't feel obliged to +pick it up yourself; it may be better to withdraw the man page from the +distribution until someone else agrees to update it. + + When a program changes only a little, you may feel that the +discrepancies are small enough that the man page remains useful without +updating. If so, put a prominent note near the beginning of the man +page explaining that you don't maintain it and that the Texinfo manual +is more authoritative. The note should say how to access the Texinfo +documentation. + + +File: standards.info, Node: Reading other Manuals, Prev: Man Pages, Up: Documentation + +Reading other Manuals +===================== + + There may be non-free books or documentation files that describe the +program you are documenting. + + It is ok to use these documents for reference, just as the author of +a new algebra textbook can read other books on algebra. A large portion +of any non-fiction book consists of facts, in this case facts about how +a certain program works, and these facts are necessarily the same for +everyone who writes about the subject. But be careful not to copy your +outline structure, wording, tables or examples from preexisting non-free +documentation. Copying from free documentation may be ok; please check +with the FSF about the individual case. + + +File: standards.info, Node: Managing Releases, Prev: Documentation, Up: Top + +The Release Process +******************* + + Making a release is more than just bundling up your source files in a +tar file and putting it up for FTP. You should set up your software so +that it can be configured to run on a variety of systems. Your Makefile +should conform to the GNU standards described below, and your directory +layout should also conform to the standards discussed below. Doing so +makes it easy to include your package into the larger framework of all +GNU software. + +* Menu: + +* Configuration:: How Configuration Should Work +* Makefile Conventions:: Makefile Conventions +* Releases:: Making Releases + + +File: standards.info, Node: Configuration, Next: Makefile Conventions, Up: Managing Releases + +How Configuration Should Work +============================= + + Each GNU distribution should come with a shell script named +`configure'. This script is given arguments which describe the kind of +machine and system you want to compile the program for. + + The `configure' script must record the configuration options so that +they affect compilation. + + One way to do this is to make a link from a standard name such as +`config.h' to the proper configuration file for the chosen system. If +you use this technique, the distribution should _not_ contain a file +named `config.h'. This is so that people won't be able to build the +program without configuring it first. + + Another thing that `configure' can do is to edit the Makefile. If +you do this, the distribution should _not_ contain a file named +`Makefile'. Instead, it should include a file `Makefile.in' which +contains the input used for editing. Once again, this is so that people +won't be able to build the program without configuring it first. + + If `configure' does write the `Makefile', then `Makefile' should +have a target named `Makefile' which causes `configure' to be rerun, +setting up the same configuration that was set up last time. The files +that `configure' reads should be listed as dependencies of `Makefile'. + + All the files which are output from the `configure' script should +have comments at the beginning explaining that they were generated +automatically using `configure'. This is so that users won't think of +trying to edit them by hand. + + The `configure' script should write a file named `config.status' +which describes which configuration options were specified when the +program was last configured. This file should be a shell script which, +if run, will recreate the same configuration. + + The `configure' script should accept an option of the form +`--srcdir=DIRNAME' to specify the directory where sources are found (if +it is not the current directory). This makes it possible to build the +program in a separate directory, so that the actual source directory is +not modified. + + If the user does not specify `--srcdir', then `configure' should +check both `.' and `..' to see if it can find the sources. If it finds +the sources in one of these places, it should use them from there. +Otherwise, it should report that it cannot find the sources, and should +exit with nonzero status. + + Usually the easy way to support `--srcdir' is by editing a +definition of `VPATH' into the Makefile. Some rules may need to refer +explicitly to the specified source directory. To make this possible, +`configure' can add to the Makefile a variable named `srcdir' whose +value is precisely the specified directory. + + The `configure' script should also take an argument which specifies +the type of system to build the program for. This argument should look +like this: + + CPU-COMPANY-SYSTEM + + For example, a Sun 3 might be `m68k-sun-sunos4.1'. + + The `configure' script needs to be able to decode all plausible +alternatives for how to describe a machine. Thus, `sun3-sunos4.1' +would be a valid alias. For many programs, `vax-dec-ultrix' would be +an alias for `vax-dec-bsd', simply because the differences between +Ultrix and BSD are rarely noticeable, but a few programs might need to +distinguish them. + + There is a shell script called `config.sub' that you can use as a +subroutine to validate system types and canonicalize aliases. + + Other options are permitted to specify in more detail the software +or hardware present on the machine, and include or exclude optional +parts of the package: + +`--enable-FEATURE[=PARAMETER]' + Configure the package to build and install an optional user-level + facility called FEATURE. This allows users to choose which + optional features to include. Giving an optional PARAMETER of + `no' should omit FEATURE, if it is built by default. + + No `--enable' option should *ever* cause one feature to replace + another. No `--enable' option should ever substitute one useful + behavior for another useful behavior. The only proper use for + `--enable' is for questions of whether to build part of the program + or exclude it. + +`--with-PACKAGE' + The package PACKAGE will be installed, so configure this package + to work with PACKAGE. + + Possible values of PACKAGE include `gnu-as' (or `gas'), `gnu-ld', + `gnu-libc', `gdb', `x', and `x-toolkit'. + + Do not use a `--with' option to specify the file name to use to + find certain files. That is outside the scope of what `--with' + options are for. + +`--nfp' + The target machine has no floating point processor. + +`--gas' + The target machine assembler is GAS, the GNU assembler. This is + obsolete; users should use `--with-gnu-as' instead. + +`--x' + The target machine has the X Window System installed. This is + obsolete; users should use `--with-x' instead. + + All `configure' scripts should accept all of these "detail" options, +whether or not they make any difference to the particular package at +hand. In particular, they should accept any option that starts with +`--with-' or `--enable-'. This is so users will be able to configure +an entire GNU source tree at once with a single set of options. + + You will note that the categories `--with-' and `--enable-' are +narrow: they *do not* provide a place for any sort of option you might +think of. That is deliberate. We want to limit the possible +configuration options in GNU software. We do not want GNU programs to +have idiosyncratic configuration options. + + Packages that perform part of the compilation process may support +cross-compilation. In such a case, the host and target machines for +the program may be different. The `configure' script should normally +treat the specified type of system as both the host and the target, +thus producing a program which works for the same type of machine that +it runs on. + + The way to build a cross-compiler, cross-assembler, or what have +you, is to specify the option `--host=HOSTTYPE' when running +`configure'. This specifies the host system without changing the type +of target system. The syntax for HOSTTYPE is the same as described +above. + + Bootstrapping a cross-compiler requires compiling it on a machine +other than the host it will run on. Compilation packages accept a +configuration option `--build=HOSTTYPE' for specifying the +configuration on which you will compile them, in case that is different +from the host. + + Programs for which cross-operation is not meaningful need not accept +the `--host' option, because configuring an entire operating system for +cross-operation is not a meaningful thing. + + Some programs have ways of configuring themselves automatically. If +your program is set up to do this, your `configure' script can simply +ignore most of its arguments. + + +File: standards.info, Node: Makefile Conventions, Next: Releases, Prev: Configuration, Up: Managing Releases + +Makefile Conventions +==================== + + This node describes conventions for writing the Makefiles for GNU +programs. + +* Menu: + +* Makefile Basics:: General Conventions for Makefiles +* Utilities in Makefiles:: Utilities in Makefiles +* Command Variables:: Variables for Specifying Commands +* Directory Variables:: Variables for Installation Directories +* Standard Targets:: Standard Targets for Users +* Install Command Categories:: Three categories of commands in the `install' + rule: normal, pre-install and post-install. + + +File: standards.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions + +General Conventions for Makefiles +--------------------------------- + + Every Makefile should contain this line: + + SHELL = /bin/sh + +to avoid trouble on systems where the `SHELL' variable might be +inherited from the environment. (This is never a problem with GNU +`make'.) + + Different `make' programs have incompatible suffix lists and +implicit rules, and this sometimes creates confusion or misbehavior. So +it is a good idea to set the suffix list explicitly using only the +suffixes you need in the particular Makefile, like this: + + .SUFFIXES: + .SUFFIXES: .c .o + +The first line clears out the suffix list, the second introduces all +suffixes which may be subject to implicit rules in this Makefile. + + Don't assume that `.' is in the path for command execution. When +you need to run programs that are a part of your package during the +make, please make sure that it uses `./' if the program is built as +part of the make or `$(srcdir)/' if the file is an unchanging part of +the source code. Without one of these prefixes, the current search +path is used. + + The distinction between `./' (the "build directory") and +`$(srcdir)/' (the "source directory") is important because users can +build in a separate directory using the `--srcdir' option to +`configure'. A rule of the form: + + foo.1 : foo.man sedscript + sed -e sedscript foo.man > foo.1 + +will fail when the build directory is not the source directory, because +`foo.man' and `sedscript' are in the the source directory. + + When using GNU `make', relying on `VPATH' to find the source file +will work in the case where there is a single dependency file, since +the `make' automatic variable `$<' will represent the source file +wherever it is. (Many versions of `make' set `$<' only in implicit +rules.) A Makefile target like + + foo.o : bar.c + $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o + +should instead be written as + + foo.o : bar.c + $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@ + +in order to allow `VPATH' to work correctly. When the target has +multiple dependencies, using an explicit `$(srcdir)' is the easiest way +to make the rule work well. For example, the target above for `foo.1' +is best written as: + + foo.1 : foo.man sedscript + sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@ + + GNU distributions usually contain some files which are not source +files--for example, Info files, and the output from Autoconf, Automake, +Bison or Flex. Since these files normally appear in the source +directory, they should always appear in the source directory, not in the +build directory. So Makefile rules to update them should put the +updated files in the source directory. + + However, if a file does not appear in the distribution, then the +Makefile should not put it in the source directory, because building a +program in ordinary circumstances should not modify the source directory +in any way. + + Try to make the build and installation targets, at least (and all +their subtargets) work correctly with a parallel `make'. + + +File: standards.info, Node: Utilities in Makefiles, Next: Command Variables, Prev: Makefile Basics, Up: Makefile Conventions + +Utilities in Makefiles +---------------------- + + Write the Makefile commands (and any shell scripts, such as +`configure') to run in `sh', not in `csh'. Don't use any special +features of `ksh' or `bash'. + + The `configure' script and the Makefile rules for building and +installation should not use any utilities directly except these: + + cat cmp cp diff echo egrep expr false grep install-info + ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true + + The compression program `gzip' can be used in the `dist' rule. + + Stick to the generally supported options for these programs. For +example, don't use `mkdir -p', convenient as it may be, because most +systems don't support it. + + It is a good idea to avoid creating symbolic links in makefiles, +since a few systems don't support them. + + The Makefile rules for building and installation can also use +compilers and related programs, but should do so via `make' variables +so that the user can substitute alternatives. Here are some of the +programs we mean: + + ar bison cc flex install ld ldconfig lex + make makeinfo ranlib texi2dvi yacc + + Use the following `make' variables to run those programs: + + $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX) + $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) + + When you use `ranlib' or `ldconfig', you should make sure nothing +bad happens if the system does not have the program in question. +Arrange to ignore an error from that command, and print a message before +the command to tell the user that failure of this command does not mean +a problem. (The Autoconf `AC_PROG_RANLIB' macro can help with this.) + + If you use symbolic links, you should implement a fallback for +systems that don't have symbolic links. + + Additional utilities that can be used via Make variables are: + + chgrp chmod chown mknod + + It is ok to use other utilities in Makefile portions (or scripts) +intended only for particular systems where you know those utilities +exist. + + +File: standards.info, Node: Command Variables, Next: Directory Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions + +Variables for Specifying Commands +--------------------------------- + + Makefiles should provide variables for overriding certain commands, +options, and so on. + + In particular, you should run most utility programs via variables. +Thus, if you use Bison, have a variable named `BISON' whose default +value is set with `BISON = bison', and refer to it with `$(BISON)' +whenever you need to use Bison. + + File management utilities such as `ln', `rm', `mv', and so on, need +not be referred to through variables in this way, since users don't +need to replace them with other programs. + + Each program-name variable should come with an options variable that +is used to supply options to the program. Append `FLAGS' to the +program-name variable name to get the options variable name--for +example, `BISONFLAGS'. (The names `CFLAGS' for the C compiler, +`YFLAGS' for yacc, and `LFLAGS' for lex, are exceptions to this rule, +but we keep them because they are standard.) Use `CPPFLAGS' in any +compilation command that runs the preprocessor, and use `LDFLAGS' in +any compilation command that does linking as well as in any direct use +of `ld'. + + If there are C compiler options that _must_ be used for proper +compilation of certain files, do not include them in `CFLAGS'. Users +expect to be able to specify `CFLAGS' freely themselves. Instead, +arrange to pass the necessary options to the C compiler independently +of `CFLAGS', by writing them explicitly in the compilation commands or +by defining an implicit rule, like this: + + CFLAGS = -g + ALL_CFLAGS = -I. $(CFLAGS) + .c.o: + $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< + + Do include the `-g' option in `CFLAGS', because that is not +_required_ for proper compilation. You can consider it a default that +is only recommended. If the package is set up so that it is compiled +with GCC by default, then you might as well include `-O' in the default +value of `CFLAGS' as well. + + Put `CFLAGS' last in the compilation command, after other variables +containing compiler options, so the user can use `CFLAGS' to override +the others. + + `CFLAGS' should be used in every invocation of the C compiler, both +those which do compilation and those which do linking. + + Every Makefile should define the variable `INSTALL', which is the +basic command for installing a file into the system. + + Every Makefile should also define the variables `INSTALL_PROGRAM' +and `INSTALL_DATA'. (The default for each of these should be +`$(INSTALL)'.) Then it should use those variables as the commands for +actual installation, for executables and nonexecutables respectively. +Use these variables as follows: + + $(INSTALL_PROGRAM) foo $(bindir)/foo + $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a + + Optionally, you may prepend the value of `DESTDIR' to the target +filename. Doing this allows the installer to create a snapshot of the +installation to be copied onto the real target filesystem later. Do not +set the value of `DESTDIR' in your Makefile, and do not include it in +any installed files. With support for `DESTDIR', the above examples +become: + + $(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo + $(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a + +Always use a file name, not a directory name, as the second argument of +the installation commands. Use a separate command for each file to be +installed. + + +File: standards.info, Node: Directory Variables, Next: Standard Targets, Prev: Command Variables, Up: Makefile Conventions + +Variables for Installation Directories +-------------------------------------- + + Installation directories should always be named by variables, so it +is easy to install in a nonstandard place. The standard names for these +variables are described below. They are based on a standard filesystem +layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and +other modern operating systems. + + These two variables set the root for the installation. All the other +installation directories should be subdirectories of one of these two, +and nothing should be directly installed into these two directories. + +`prefix' + A prefix used in constructing the default values of the variables + listed below. The default value of `prefix' should be + `/usr/local'. When building the complete GNU system, the prefix + will be empty and `/usr' will be a symbolic link to `/'. (If you + are using Autoconf, write it as `@prefix@'.) + + Running `make install' with a different value of `prefix' from the + one used to build the program should NOT recompile the program. + +`exec_prefix' + A prefix used in constructing the default values of some of the + variables listed below. The default value of `exec_prefix' should + be `$(prefix)'. (If you are using Autoconf, write it as + `@exec_prefix@'.) + + Generally, `$(exec_prefix)' is used for directories that contain + machine-specific files (such as executables and subroutine + libraries), while `$(prefix)' is used directly for other + directories. + + Running `make install' with a different value of `exec_prefix' + from the one used to build the program should NOT recompile the + program. + + Executable programs are installed in one of the following +directories. + +`bindir' + The directory for installing executable programs that users can + run. This should normally be `/usr/local/bin', but write it as + `$(exec_prefix)/bin'. (If you are using Autoconf, write it as + `@bindir@'.) + +`sbindir' + The directory for installing executable programs that can be run + from the shell, but are only generally useful to system + administrators. This should normally be `/usr/local/sbin', but + write it as `$(exec_prefix)/sbin'. (If you are using Autoconf, + write it as `@sbindir@'.) + +`libexecdir' + The directory for installing executable programs to be run by other + programs rather than by users. This directory should normally be + `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'. + (If you are using Autoconf, write it as `@libexecdir@'.) + + Data files used by the program during its execution are divided into +categories in two ways. + + * Some files are normally modified by programs; others are never + normally modified (though users may edit some of these). + + * Some files are architecture-independent and can be shared by all + machines at a site; some are architecture-dependent and can be + shared only by machines of the same kind and operating system; + others may never be shared between two machines. + + This makes for six different possibilities. However, we want to +discourage the use of architecture-dependent files, aside from object +files and libraries. It is much cleaner to make other data files +architecture-independent, and it is generally not hard. + + Therefore, here are the variables Makefiles should use to specify +directories: + +`datadir' + The directory for installing read-only architecture independent + data files. This should normally be `/usr/local/share', but write + it as `$(prefix)/share'. (If you are using Autoconf, write it as + `@datadir@'.) As a special exception, see `$(infodir)' and + `$(includedir)' below. + +`sysconfdir' + The directory for installing read-only data files that pertain to a + single machine-that is to say, files for configuring a host. + Mailer and network configuration files, `/etc/passwd', and so + forth belong here. All the files in this directory should be + ordinary ASCII text files. This directory should normally be + `/usr/local/etc', but write it as `$(prefix)/etc'. (If you are + using Autoconf, write it as `@sysconfdir@'.) + + Do not install executables here in this directory (they probably + belong in `$(libexecdir)' or `$(sbindir)'). Also do not install + files that are modified in the normal course of their use (programs + whose purpose is to change the configuration of the system + excluded). Those probably belong in `$(localstatedir)'. + +`sharedstatedir' + The directory for installing architecture-independent data files + which the programs modify while they run. This should normally be + `/usr/local/com', but write it as `$(prefix)/com'. (If you are + using Autoconf, write it as `@sharedstatedir@'.) + +`localstatedir' + The directory for installing data files which the programs modify + while they run, and that pertain to one specific machine. Users + should never need to modify files in this directory to configure + the package's operation; put such configuration information in + separate files that go in `$(datadir)' or `$(sysconfdir)'. + `$(localstatedir)' should normally be `/usr/local/var', but write + it as `$(prefix)/var'. (If you are using Autoconf, write it as + `@localstatedir@'.) + +`libdir' + The directory for object files and libraries of object code. Do + not install executables here, they probably ought to go in + `$(libexecdir)' instead. The value of `libdir' should normally be + `/usr/local/lib', but write it as `$(exec_prefix)/lib'. (If you + are using Autoconf, write it as `@libdir@'.) + +`infodir' + The directory for installing the Info files for this package. By + default, it should be `/usr/local/info', but it should be written + as `$(prefix)/info'. (If you are using Autoconf, write it as + `@infodir@'.) + +`lispdir' + The directory for installing any Emacs Lisp files in this package. + By default, it should be `/usr/local/share/emacs/site-lisp', but + it should be written as `$(prefix)/share/emacs/site-lisp'. + + If you are using Autoconf, write the default as `@lispdir@'. In + order to make `@lispdir@' work, you need the following lines in + your `configure.in' file: + + lispdir='${datadir}/emacs/site-lisp' + AC_SUBST(lispdir) + +`includedir' + The directory for installing header files to be included by user + programs with the C `#include' preprocessor directive. This + should normally be `/usr/local/include', but write it as + `$(prefix)/include'. (If you are using Autoconf, write it as + `@includedir@'.) + + Most compilers other than GCC do not look for header files in + directory `/usr/local/include'. So installing the header files + this way is only useful with GCC. Sometimes this is not a problem + because some libraries are only really intended to work with GCC. + But some libraries are intended to work with other compilers. + They should install their header files in two places, one + specified by `includedir' and one specified by `oldincludedir'. + +`oldincludedir' + The directory for installing `#include' header files for use with + compilers other than GCC. This should normally be `/usr/include'. + (If you are using Autoconf, you can write it as `@oldincludedir@'.) + + The Makefile commands should check whether the value of + `oldincludedir' is empty. If it is, they should not try to use + it; they should cancel the second installation of the header files. + + A package should not replace an existing header in this directory + unless the header came from the same package. Thus, if your Foo + package provides a header file `foo.h', then it should install the + header file in the `oldincludedir' directory if either (1) there + is no `foo.h' there or (2) the `foo.h' that exists came from the + Foo package. + + To tell whether `foo.h' came from the Foo package, put a magic + string in the file--part of a comment--and `grep' for that string. + + Unix-style man pages are installed in one of the following: + +`mandir' + The top-level directory for installing the man pages (if any) for + this package. It will normally be `/usr/local/man', but you should + write it as `$(prefix)/man'. (If you are using Autoconf, write it + as `@mandir@'.) + +`man1dir' + The directory for installing section 1 man pages. Write it as + `$(mandir)/man1'. + +`man2dir' + The directory for installing section 2 man pages. Write it as + `$(mandir)/man2' + +`...' + *Don't make the primary documentation for any GNU software be a + man page. Write a manual in Texinfo instead. Man pages are just + for the sake of people running GNU software on Unix, which is a + secondary application only.* + +`manext' + The file name extension for the installed man page. This should + contain a period followed by the appropriate digit; it should + normally be `.1'. + +`man1ext' + The file name extension for installed section 1 man pages. + +`man2ext' + The file name extension for installed section 2 man pages. + +`...' + Use these names instead of `manext' if the package needs to + install man pages in more than one section of the manual. + + And finally, you should set the following variable: + +`srcdir' + The directory for the sources being compiled. The value of this + variable is normally inserted by the `configure' shell script. + (If you are using Autconf, use `srcdir = @srcdir@'.) + + For example: + + # Common prefix for installation directories. + # NOTE: This directory must exist when you start the install. + prefix = /usr/local + exec_prefix = $(prefix) + # Where to put the executable for the command `gcc'. + bindir = $(exec_prefix)/bin + # Where to put the directories used by the compiler. + libexecdir = $(exec_prefix)/libexec + # Where to put the Info files. + infodir = $(prefix)/info + + If your program installs a large number of files into one of the +standard user-specified directories, it might be useful to group them +into a subdirectory particular to that program. If you do this, you +should write the `install' rule to create these subdirectories. + + Do not expect the user to include the subdirectory name in the value +of any of the variables listed above. The idea of having a uniform set +of variable names for installation directories is to enable the user to +specify the exact same values for several different GNU packages. In +order for this to be useful, all the packages must be designed so that +they will work sensibly when the user does so. + + +File: standards.info, Node: Standard Targets, Next: Install Command Categories, Prev: Directory Variables, Up: Makefile Conventions + +Standard Targets for Users +-------------------------- + + All GNU programs should have the following targets in their +Makefiles: + +`all' + Compile the entire program. This should be the default target. + This target need not rebuild any documentation files; Info files + should normally be included in the distribution, and DVI files + should be made only when explicitly asked for. + + By default, the Make rules should compile and link with `-g', so + that executable programs have debugging symbols. Users who don't + mind being helpless can strip the executables later if they wish. + +`install' + Compile the program and copy the executables, libraries, and so on + to the file names where they should reside for actual use. If + there is a simple test to verify that a program is properly + installed, this target should run that test. + + Do not strip executables when installing them. Devil-may-care + users can use the `install-strip' target to do that. + + If possible, write the `install' target rule so that it does not + modify anything in the directory where the program was built, + provided `make all' has just been done. This is convenient for + building the program under one user name and installing it under + another. + + The commands should create all the directories in which files are + to be installed, if they don't already exist. This includes the + directories specified as the values of the variables `prefix' and + `exec_prefix', as well as all subdirectories that are needed. One + way to do this is by means of an `installdirs' target as described + below. + + Use `-' before any command for installing a man page, so that + `make' will ignore any errors. This is in case there are systems + that don't have the Unix man page documentation system installed. + + The way to install Info files is to copy them into `$(infodir)' + with `$(INSTALL_DATA)' (*note Command Variables::), and then run + the `install-info' program if it is present. `install-info' is a + program that edits the Info `dir' file to add or update the menu + entry for the given Info file; it is part of the Texinfo package. + Here is a sample rule to install an Info file: + + $(DESTDIR)$(infodir)/foo.info: foo.info + $(POST_INSTALL) + # There may be a newer info file in . than in srcdir. + -if test -f foo.info; then d=.; \ + else d=$(srcdir); fi; \ + $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@; \ + # Run install-info only if it exists. + # Use `if' instead of just prepending `-' to the + # line so we notice real errors from install-info. + # We use `$(SHELL) -c' because some shells do not + # fail gracefully when there is an unknown command. + if $(SHELL) -c 'install-info --version' \ + >/dev/null 2>&1; then \ + install-info --dir-file=$(DESTDIR)$(infodir)/dir \ + $(DESTDIR)$(infodir)/foo.info; \ + else true; fi + + When writing the `install' target, you must classify all the + commands into three categories: normal ones, "pre-installation" + commands and "post-installation" commands. *Note Install Command + Categories::. + +`uninstall' + Delete all the installed files--the copies that the `install' + target creates. + + This rule should not modify the directories where compilation is + done, only the directories where files are installed. + + The uninstallation commands are divided into three categories, + just like the installation commands. *Note Install Command + Categories::. + +`install-strip' + Like `install', but strip the executable files while installing + them. In many cases, the definition of this target can be very + simple: + + install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \ + install + + Normally we do not recommend stripping an executable unless you + are sure the program has no bugs. However, it can be reasonable + to install a stripped executable for actual execution while saving + the unstripped executable elsewhere in case there is a bug. + +`clean' + Delete all files from the current directory that are normally + created by building the program. Don't delete the files that + record the configuration. Also preserve files that could be made + by building, but normally aren't because the distribution comes + with them. + + Delete `.dvi' files here if they are not part of the distribution. + +`distclean' + Delete all files from the current directory that are created by + configuring or building the program. If you have unpacked the + source and built the program without creating any other files, + `make distclean' should leave only the files that were in the + distribution. + +`mostlyclean' + Like `clean', but may refrain from deleting a few files that people + normally don't want to recompile. For example, the `mostlyclean' + target for GCC does not delete `libgcc.a', because recompiling it + is rarely necessary and takes a lot of time. + +`maintainer-clean' + Delete almost everything from the current directory that can be + reconstructed with this Makefile. This typically includes + everything deleted by `distclean', plus more: C source files + produced by Bison, tags tables, Info files, and so on. + + The reason we say "almost everything" is that running the command + `make maintainer-clean' should not delete `configure' even if + `configure' can be remade using a rule in the Makefile. More + generally, `make maintainer-clean' should not delete anything that + needs to exist in order to run `configure' and then begin to build + the program. This is the only exception; `maintainer-clean' should + delete everything else that can be rebuilt. + + The `maintainer-clean' target is intended to be used by a + maintainer of the package, not by ordinary users. You may need + special tools to reconstruct some of the files that `make + maintainer-clean' deletes. Since these files are normally + included in the distribution, we don't take care to make them easy + to reconstruct. If you find you need to unpack the full + distribution again, don't blame us. + + To help make users aware of this, the commands for the special + `maintainer-clean' target should start with these two: + + @echo 'This command is intended for maintainers to use; it' + @echo 'deletes files that may need special tools to rebuild.' + +`TAGS' + Update a tags table for this program. + +`info' + Generate any Info files needed. The best way to write the rules + is as follows: + + info: foo.info + + foo.info: foo.texi chap1.texi chap2.texi + $(MAKEINFO) $(srcdir)/foo.texi + + You must define the variable `MAKEINFO' in the Makefile. It should + run the `makeinfo' program, which is part of the Texinfo + distribution. + + Normally a GNU distribution comes with Info files, and that means + the Info files are present in the source directory. Therefore, + the Make rule for an info file should update it in the source + directory. When users build the package, ordinarily Make will not + update the Info files because they will already be up to date. + +`dvi' + Generate DVI files for all Texinfo documentation. For example: + + dvi: foo.dvi + + foo.dvi: foo.texi chap1.texi chap2.texi + $(TEXI2DVI) $(srcdir)/foo.texi + + You must define the variable `TEXI2DVI' in the Makefile. It should + run the program `texi2dvi', which is part of the Texinfo + distribution.(1) Alternatively, write just the dependencies, and + allow GNU `make' to provide the command. + +`dist' + Create a distribution tar file for this program. The tar file + should be set up so that the file names in the tar file start with + a subdirectory name which is the name of the package it is a + distribution for. This name can include the version number. + + For example, the distribution tar file of GCC version 1.40 unpacks + into a subdirectory named `gcc-1.40'. + + The easiest way to do this is to create a subdirectory + appropriately named, use `ln' or `cp' to install the proper files + in it, and then `tar' that subdirectory. + + Compress the tar file file with `gzip'. For example, the actual + distribution file for GCC version 1.40 is called `gcc-1.40.tar.gz'. + + The `dist' target should explicitly depend on all non-source files + that are in the distribution, to make sure they are up to date in + the distribution. *Note Making Releases: Releases. + +`check' + Perform self-tests (if any). The user must build the program + before running the tests, but need not install the program; you + should write the self-tests so that they work when the program is + built but not installed. + + The following targets are suggested as conventional names, for +programs in which they are useful. + +`installcheck' + Perform installation tests (if any). The user must build and + install the program before running the tests. You should not + assume that `$(bindir)' is in the search path. + +`installdirs' + It's useful to add a target named `installdirs' to create the + directories where files are installed, and their parent + directories. There is a script called `mkinstalldirs' which is + convenient for this; you can find it in the Texinfo package. You + can use a rule like this: + + # Make sure all installation directories (e.g. $(bindir)) + # actually exist by making them if necessary. + installdirs: mkinstalldirs + $(srcdir)/mkinstalldirs $(bindir) $(datadir) \ + $(libdir) $(infodir) \ + $(mandir) + + This rule should not modify the directories where compilation is + done. It should do nothing but create installation directories. + + ---------- Footnotes ---------- + + (1) `texi2dvi' uses TeX to do the real work of formatting. TeX is +not distributed with Texinfo. + + +File: standards.info, Node: Install Command Categories, Prev: Standard Targets, Up: Makefile Conventions + +Install Command Categories +-------------------------- + + When writing the `install' target, you must classify all the +commands into three categories: normal ones, "pre-installation" +commands and "post-installation" commands. + + Normal commands move files into their proper places, and set their +modes. They may not alter any files except the ones that come entirely +from the package they belong to. + + Pre-installation and post-installation commands may alter other +files; in particular, they can edit global configuration files or data +bases. + + Pre-installation commands are typically executed before the normal +commands, and post-installation commands are typically run after the +normal commands. + + The most common use for a post-installation command is to run +`install-info'. This cannot be done with a normal command, since it +alters a file (the Info directory) which does not come entirely and +solely from the package being installed. It is a post-installation +command because it needs to be done after the normal command which +installs the package's Info files. + + Most programs don't need any pre-installation commands, but we have +the feature just in case it is needed. + + To classify the commands in the `install' rule into these three +categories, insert "category lines" among them. A category line +specifies the category for the commands that follow. + + A category line consists of a tab and a reference to a special Make +variable, plus an optional comment at the end. There are three +variables you can use, one for each category; the variable name +specifies the category. Category lines are no-ops in ordinary execution +because these three Make variables are normally undefined (and you +_should not_ define them in the makefile). + + Here are the three possible category lines, each with a comment that +explains what it means: + + $(PRE_INSTALL) # Pre-install commands follow. + $(POST_INSTALL) # Post-install commands follow. + $(NORMAL_INSTALL) # Normal commands follow. + + If you don't use a category line at the beginning of the `install' +rule, all the commands are classified as normal until the first category +line. If you don't use any category lines, all the commands are +classified as normal. + + These are the category lines for `uninstall': + + $(PRE_UNINSTALL) # Pre-uninstall commands follow. + $(POST_UNINSTALL) # Post-uninstall commands follow. + $(NORMAL_UNINSTALL) # Normal commands follow. + + Typically, a pre-uninstall command would be used for deleting entries +from the Info directory. + + If the `install' or `uninstall' target has any dependencies which +act as subroutines of installation, then you should start _each_ +dependency's commands with a category line, and start the main target's +commands with a category line also. This way, you can ensure that each +command is placed in the right category regardless of which of the +dependencies actually run. + + Pre-installation and post-installation commands should not run any +programs except for these: + + [ basename bash cat chgrp chmod chown cmp cp dd diff echo + egrep expand expr false fgrep find getopt grep gunzip gzip + hostname install install-info kill ldconfig ln ls md5sum + mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee + test touch true uname xargs yes + + The reason for distinguishing the commands in this way is for the +sake of making binary packages. Typically a binary package contains +all the executables and other files that need to be installed, and has +its own method of installing them--so it does not need to run the normal +installation commands. But installing the binary package does need to +execute the pre-installation and post-installation commands. + + Programs to build binary packages work by extracting the +pre-installation and post-installation commands. Here is one way of +extracting the pre-installation commands: + + make -n install -o all \ + PRE_INSTALL=pre-install \ + POST_INSTALL=post-install \ + NORMAL_INSTALL=normal-install \ + | gawk -f pre-install.awk + +where the file `pre-install.awk' could contain this: + + $0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ {on = 0} + on {print $0} + $0 ~ /^\t[ \t]*pre_install[ \t]*$/ {on = 1} + + The resulting file of pre-installation commands is executed as a +shell script as part of installing the binary package. + + +File: standards.info, Node: Releases, Prev: Makefile Conventions, Up: Managing Releases + +Making Releases +=============== + + Package the distribution of `Foo version 69.96' up in a gzipped tar +file with the name `foo-69.96.tar.gz'. It should unpack into a +subdirectory named `foo-69.96'. + + Building and installing the program should never modify any of the +files contained in the distribution. This means that all the files +that form part of the program in any way must be classified into "source +files" and "non-source files". Source files are written by humans and +never changed automatically; non-source files are produced from source +files by programs under the control of the Makefile. + + Naturally, all the source files must be in the distribution. It is +okay to include non-source files in the distribution, provided they are +up-to-date and machine-independent, so that building the distribution +normally will never modify them. We commonly include non-source files +produced by Bison, `lex', TeX, and `makeinfo'; this helps avoid +unnecessary dependencies between our distributions, so that users can +install whichever packages they want to install. + + Non-source files that might actually be modified by building and +installing the program should *never* be included in the distribution. +So if you do distribute non-source files, always make sure they are up +to date when you make a new distribution. + + Make sure that the directory into which the distribution unpacks (as +well as any subdirectories) are all world-writable (octal mode 777). +This is so that old versions of `tar' which preserve the ownership and +permissions of the files from the tar archive will be able to extract +all the files even if the user is unprivileged. + + Make sure that all the files in the distribution are world-readable. + + Make sure that no file name in the distribution is more than 14 +characters long. Likewise, no file created by building the program +should have a name longer than 14 characters. The reason for this is +that some systems adhere to a foolish interpretation of the POSIX +standard, and refuse to open a longer name, rather than truncating as +they did in the past. + + Don't include any symbolic links in the distribution itself. If the +tar file contains symbolic links, then people cannot even unpack it on +systems that don't support symbolic links. Also, don't use multiple +names for one file in different directories, because certain file +systems cannot handle this and that prevents unpacking the distribution. + + Try to make sure that all the file names will be unique on MS-DOS. A +name on MS-DOS consists of up to 8 characters, optionally followed by a +period and up to three characters. MS-DOS will truncate extra +characters both before and after the period. Thus, `foobarhacker.c' +and `foobarhacker.o' are not ambiguous; they are truncated to +`foobarha.c' and `foobarha.o', which are distinct. + + Include in your distribution a copy of the `texinfo.tex' you used to +test print any `*.texinfo' or `*.texi' files. + + Likewise, if your program uses small GNU software packages like +regex, getopt, obstack, or termcap, include them in the distribution +file. Leaving them out would make the distribution file a little +smaller at the expense of possible inconvenience to a user who doesn't +know what other files to get. + + + +Tag Table: +Node: Top962 +Node: Preface1505 +Node: Intellectual Property2532 +Node: Reading Non-Free Code2907 +Node: Contributions4639 +Node: Design Advice6633 +Node: Compatibility7150 +Node: Using Extensions8661 +Node: ANSI C10163 +Node: Source Language11399 +Node: Program Behavior12892 +Node: Semantics13601 +Node: Libraries17355 +Node: Errors18590 +Node: User Interfaces19813 +Node: Option Table26559 +Node: Memory Usage40648 +Node: Writing C41642 +Node: Formatting42483 +Node: Comments45755 +Node: Syntactic Conventions49053 +Node: Names51991 +Node: System Portability53727 +Node: CPU Portability55503 +Node: System Functions57664 +Node: Internationalization62768 +Node: Mmap65916 +Node: Documentation66621 +Node: GNU Manuals67179 +Node: Manual Structure Details71066 +Node: NEWS File72396 +Node: Change Logs73077 +Node: Change Log Concepts73794 +Node: Style of Change Logs75562 +Node: Simple Changes77116 +Node: Conditional Changes78307 +Node: Man Pages79684 +Node: Reading other Manuals81303 +Node: Managing Releases82087 +Node: Configuration82823 +Node: Makefile Conventions89763 +Node: Makefile Basics90443 +Node: Utilities in Makefiles93612 +Node: Command Variables95748 +Node: Directory Variables99249 +Node: Standard Targets110126 +Ref: Standard Targets-Footnote-1120565 +Node: Install Command Categories120665 +Node: Releases125238 + +End Tag Table diff --git a/gnu/dist/toolchain/etc/standards.texi b/gnu/dist/toolchain/etc/standards.texi index 93fddcb0e212..910bf8b0479e 100644 --- a/gnu/dist/toolchain/etc/standards.texi +++ b/gnu/dist/toolchain/etc/standards.texi @@ -2593,7 +2593,7 @@ also contain this information. If the manual is changing more frequently than or independent of the program, also state a version number for the manual in both of these places. -Each program documented in the manual should have a node named +Each program documented in the manual should should have a node named @samp{@var{program} Invocation} or @samp{Invoking @var{program}}. This node (together with its subnodes, if any) should describe the program's command line arguments and how to run it (the sort of information people diff --git a/gnu/dist/toolchain/gas/ChangeLog b/gnu/dist/toolchain/gas/ChangeLog index 00424ba6110c..ce918a5ed5cd 100644 --- a/gnu/dist/toolchain/gas/ChangeLog +++ b/gnu/dist/toolchain/gas/ChangeLog @@ -1,3 +1,40 @@ +2000-11-02 Theo Honohan + + * config/tc-arm.c (do_msr): Improve error message. + +2000-11-01 Philip Blundell + + From 2000-08-01 Nick Clifton + * config/tc-arm.c (do_mrs): Fix skip of 'cpsr_all' flag. + +2000-10-16 Philip Blundell + + * configure.in: Set version number to 2.10.1. + * configure: Regenerate. + +2000-10-14 Philip Blundell + + From 2000-06-17 Mark Elbrecht + + * config/obj-coff.c (obj_coff_weak): Typo fix: Change BFD_ASSEMLER + to BFD_ASSEMBLER. + +2000-09-08 Philip Blundell + + * config/tc-arm.c (md_apply_fix3): Correct handling of ADRL when + offset is negative. + +2000-08-30 Matthew Jacob + + * config/tc-alpha.c (md_undefined_symbol): Properly understand that + $at is the integer register $r28, vs. both $r28 and the floating + point register $f28. + +2000-04-14 Matthew Green + + * configure.in: Add NetBSD/sparc ELF and NetBSD/sparc64 support. + * configure: Regenerate. + 2000-06-09 Nick Clifton * config/tc-arm.c (cons_fix_new_arm): Assign correct reloc value diff --git a/gnu/dist/toolchain/gas/config/obj-coff.c b/gnu/dist/toolchain/gas/config/obj-coff.c index d7508680336a..a0847c4c600f 100644 --- a/gnu/dist/toolchain/gas/config/obj-coff.c +++ b/gnu/dist/toolchain/gas/config/obj-coff.c @@ -213,7 +213,7 @@ obj_coff_weak (ignore) *input_line_pointer = c; SKIP_WHITESPACE (); -#ifdef BFD_ASSEMLER +#ifdef BFD_ASSEMBLER S_SET_WEAK (symbolP); #endif diff --git a/gnu/dist/toolchain/gas/doc/as.info b/gnu/dist/toolchain/gas/doc/as.info index ec20c1926464..d2e6a9d21daa 100644 --- a/gnu/dist/toolchain/gas/doc/as.info +++ b/gnu/dist/toolchain/gas/doc/as.info @@ -25,319 +25,319 @@ versions.  Indirect: as.info-1: 866 -as.info-2: 50538 -as.info-3: 100405 -as.info-4: 149817 -as.info-5: 198317 -as.info-6: 244878 -as.info-7: 294771 -as.info-8: 315443 +as.info-2: 50540 +as.info-3: 100407 +as.info-4: 149819 +as.info-5: 198319 +as.info-6: 244880 +as.info-7: 294773 +as.info-8: 315445  Tag Table: (Indirect) Node: Top866 -Node: Overview1538 -Node: Manual13605 -Node: GNU Assembler14544 -Node: Object Formats15710 -Node: Command Line16157 -Node: Input Files17239 -Node: Object19218 -Node: Errors20165 -Node: Invoking21355 -Node: a23201 -Node: D24535 -Node: f24755 -Node: I25258 -Node: K25797 -Node: L26096 -Node: M26922 -Node: MD31312 -Node: o31731 -Node: R32179 -Node: statistics33195 -Node: traditional-format33595 -Node: v34061 -Node: W34329 -Node: Z35229 -Node: Syntax35744 -Node: Preprocessing36334 -Node: Whitespace37894 -Node: Comments38284 -Node: Symbol Intro40304 -Node: Statements40987 -Node: Constants42901 -Node: Characters43527 -Node: Strings44020 -Node: Chars46173 -Node: Numbers46914 -Node: Integers47445 -Node: Bignums48088 -Node: Flonums48431 -Node: Sections50164 -Node: Secs Background50538 -Node: Ld Sections55564 -Node: As Sections57958 -Node: Sub-Sections58863 -Node: bss61862 -Node: Symbols62807 -Node: Labels63454 -Node: Setting Symbols64180 -Node: Symbol Names64545 -Node: Dot67507 -Node: Symbol Attributes67949 -Node: Symbol Value68681 -Node: Symbol Type69717 -Node: a.out Symbols70096 -Node: Symbol Desc70346 -Node: Symbol Other70628 -Node: COFF Symbols70784 -Node: SOM Symbols71413 -Node: Expressions71846 -Node: Empty Exprs72594 -Node: Integer Exprs72936 -Node: Arguments73326 -Node: Operators74423 -Node: Prefix Ops74749 -Node: Infix Ops75068 -Node: Pseudo Ops76560 -Node: Abort80777 -Node: ABORT81178 -Node: Align81440 -Node: Ascii83629 -Node: Asciz83930 -Node: Balign84170 -Node: Byte86028 -Node: Comm86261 -Node: Data87620 -Node: Def87930 -Node: Desc88298 -Node: Dim88791 -Node: Double89182 -Node: Eject89513 -Node: Else89681 -Node: Elseif89971 -Node: End90255 -Node: Endef90463 -Node: Endfunc90786 -Node: Endif90954 -Node: Equ91207 -Node: Equiv91510 -Node: Err91906 -Node: Exitm92209 -Node: Extern92369 -Node: Fail92623 -Node: File93061 -Node: Fill93670 -Node: Float94627 -Node: Func94961 -Node: Global95541 -Node: hword96283 -Node: Ident96604 -Node: If96904 -Node: Include99496 -Node: Int100036 -Node: Irp100405 -Node: Irpc101199 -Node: Lcomm102018 -Node: Lflags102759 -Node: Line102946 -Node: Linkonce103969 -Node: Ln105189 -Node: MRI105337 -Node: List105664 -Node: Long106267 -Node: Macro106437 -Node: Nolist108821 -Node: Octa109237 -Node: Org109563 -Node: P2align110838 -Node: Print112754 -Node: Psize112971 -Node: Purgem113644 -Node: Quad113851 -Node: Rept114292 -Node: Sbttl114698 -Node: Scl115056 -Node: Section115552 -Node: Set117953 -Node: Short118505 -Node: Single118818 -Node: Size119155 -Node: Sleb128119550 -Node: Skip119865 -Node: Space120180 -Node: Stab121065 -Node: String123060 -Node: Struct123479 -Node: Symver124191 -Node: Tag125776 -Node: Text126284 -Node: Title126596 -Node: Type126968 -Node: Val127344 -Node: Uleb128127705 -Node: Visibility128027 -Node: Word129070 -Node: Deprecated130906 -Node: Machine Dependencies131131 -Node: ARC-Dependent133009 -Node: ARC-Opts133323 -Node: ARC-Float134057 -Node: ARC-Directives134355 -Node: AMD29K-Dependent134748 -Node: AMD29K Options135129 -Node: AMD29K Syntax135303 -Node: AMD29K-Macros135567 -Node: AMD29K-Chars135818 -Node: AMD29K-Regs136081 -Node: AMD29K Floating Point137345 -Node: AMD29K Directives137551 -Node: AMD29K Opcodes138959 -Node: ARM-Dependent139295 -Node: ARM Options139669 -Node: ARM Syntax142169 -Node: ARM-Chars142389 -Node: ARM-Regs142941 -Node: ARM Floating Point143113 -Node: ARM Directives143303 -Node: ARM Opcodes145309 -Node: D10V-Dependent147362 -Node: D10V-Opts147704 -Node: D10V-Syntax148337 -Node: D10V-Size148857 -Node: D10V-Subs149817 -Node: D10V-Chars150839 -Node: D10V-Regs152425 -Node: D10V-Addressing153456 -Node: D10V-Word154129 -Node: D10V-Float154630 -Node: D10V-Opcodes154932 -Node: D30V-Dependent155316 -Node: D30V-Opts155661 -Node: D30V-Syntax156327 -Node: D30V-Size156850 -Node: D30V-Subs157808 -Node: D30V-Chars158830 -Node: D30V-Guarded161115 -Node: D30V-Regs161783 -Node: D30V-Addressing162909 -Node: D30V-Float163564 -Node: D30V-Opcodes163866 -Node: H8/300-Dependent164250 -Node: H8/300 Options164654 -Node: H8/300 Syntax164835 -Node: H8/300-Chars165122 -Node: H8/300-Regs165406 -Node: H8/300-Addressing166310 -Node: H8/300 Floating Point167336 -Node: H8/300 Directives167652 -Node: H8/300 Opcodes168172 -Node: H8/500-Dependent176525 -Node: H8/500 Options176929 -Node: H8/500 Syntax177110 -Node: H8/500-Chars177397 -Node: H8/500-Regs177688 -Node: H8/500-Addressing178444 -Node: H8/500 Floating Point179061 -Node: H8/500 Directives179377 -Node: H8/500 Opcodes179696 -Node: HPPA-Dependent184809 -Node: HPPA Notes185234 -Node: HPPA Options185981 -Node: HPPA Syntax186165 -Node: HPPA Floating Point187424 -Node: HPPA Directives187619 -Node: HPPA Opcodes194210 -Node: ESA/390-Dependent194458 -Node: ESA/390 Notes194908 -Node: ESA/390 Options195688 -Node: ESA/390 Syntax195887 -Node: ESA/390 Floating Point198048 -Node: ESA/390 Directives198317 -Node: ESA/390 Opcodes201594 -Node: i386-Dependent201845 -Node: i386-Options202653 -Node: i386-Syntax202797 -Node: i386-Mnemonics204910 -Node: i386-Regs207052 -Node: i386-Prefixes208195 -Node: i386-Memory210283 -Node: i386-jumps212592 -Node: i386-Float213682 -Node: i386-SIMD215500 -Node: i386-16bit216598 -Node: i386-Bugs218561 -Node: i386-Notes219301 -Node: i960-Dependent220141 -Node: Options-i960220533 -Node: Floating Point-i960224414 -Node: Directives-i960224671 -Node: Opcodes for i960226691 -Node: callj-i960227297 -Node: Compare-and-branch-i960227772 -Node: M68K-Dependent229661 -Node: M68K-Opts230115 -Node: M68K-Syntax235063 -Node: M68K-Moto-Syntax236891 -Node: M68K-Float239469 -Node: M68K-Directives239978 -Node: M68K-opcodes240573 -Node: M68K-Branch240785 -Node: M68K-Chars243600 -Node: MIPS-Dependent243998 -Node: MIPS Opts244878 -Node: MIPS Object248908 -Node: MIPS Stabs250463 -Node: MIPS ISA251174 -Node: MIPS autoextend252282 -Node: MIPS insn252993 -Node: MIPS option stack253479 -Node: PJ-Dependent254192 -Node: PJ Options254405 -Node: SH-Dependent254672 -Node: SH Options255052 -Node: SH Syntax255217 -Node: SH-Chars255476 -Node: SH-Regs255755 -Node: SH-Addressing256354 -Node: SH Floating Point257248 -Node: SH Directives257544 -Node: SH Opcodes257900 -Node: Sparc-Dependent262147 -Node: Sparc-Opts262519 -Node: Sparc-Aligned-Data264765 -Node: Sparc-Float265609 -Node: Sparc-Directives265799 -Node: Z8000-Dependent267748 -Node: Z8000 Options268707 -Node: Z8000 Syntax268882 -Node: Z8000-Chars269158 -Node: Z8000-Regs269376 -Node: Z8000-Addressing270166 -Node: Z8000 Directives271109 -Node: Z8000 Opcodes272707 -Node: Vax-Dependent282643 -Node: VAX-Opts283150 -Node: VAX-float286874 -Node: VAX-directives287495 -Node: VAX-opcodes288344 -Node: VAX-branch288722 -Node: VAX-operands291218 -Node: VAX-no291970 -Node: V850-Dependent292196 -Node: V850 Options292582 -Node: V850 Syntax294395 -Node: V850-Chars294621 -Node: V850-Regs294771 -Node: V850 Floating Point296308 -Node: V850 Directives296503 -Node: V850 Opcodes297403 -Node: Reporting Bugs302688 -Node: Bug Criteria303411 -Node: Bug Reporting304171 -Node: Acknowledgements310740 -Ref: Acknowledgements-Footnote-1315417 -Node: Index315443 +Node: Overview1540 +Node: Manual13607 +Node: GNU Assembler14546 +Node: Object Formats15712 +Node: Command Line16159 +Node: Input Files17241 +Node: Object19220 +Node: Errors20167 +Node: Invoking21357 +Node: a23203 +Node: D24537 +Node: f24757 +Node: I25260 +Node: K25799 +Node: L26098 +Node: M26924 +Node: MD31314 +Node: o31733 +Node: R32181 +Node: statistics33197 +Node: traditional-format33597 +Node: v34063 +Node: W34331 +Node: Z35231 +Node: Syntax35746 +Node: Preprocessing36336 +Node: Whitespace37896 +Node: Comments38286 +Node: Symbol Intro40306 +Node: Statements40989 +Node: Constants42903 +Node: Characters43529 +Node: Strings44022 +Node: Chars46175 +Node: Numbers46916 +Node: Integers47447 +Node: Bignums48090 +Node: Flonums48433 +Node: Sections50166 +Node: Secs Background50540 +Node: Ld Sections55566 +Node: As Sections57960 +Node: Sub-Sections58865 +Node: bss61864 +Node: Symbols62809 +Node: Labels63456 +Node: Setting Symbols64182 +Node: Symbol Names64547 +Node: Dot67509 +Node: Symbol Attributes67951 +Node: Symbol Value68683 +Node: Symbol Type69719 +Node: a.out Symbols70098 +Node: Symbol Desc70348 +Node: Symbol Other70630 +Node: COFF Symbols70786 +Node: SOM Symbols71415 +Node: Expressions71848 +Node: Empty Exprs72596 +Node: Integer Exprs72938 +Node: Arguments73328 +Node: Operators74425 +Node: Prefix Ops74751 +Node: Infix Ops75070 +Node: Pseudo Ops76562 +Node: Abort80779 +Node: ABORT81180 +Node: Align81442 +Node: Ascii83631 +Node: Asciz83932 +Node: Balign84172 +Node: Byte86030 +Node: Comm86263 +Node: Data87622 +Node: Def87932 +Node: Desc88300 +Node: Dim88793 +Node: Double89184 +Node: Eject89515 +Node: Else89683 +Node: Elseif89973 +Node: End90257 +Node: Endef90465 +Node: Endfunc90788 +Node: Endif90956 +Node: Equ91209 +Node: Equiv91512 +Node: Err91908 +Node: Exitm92211 +Node: Extern92371 +Node: Fail92625 +Node: File93063 +Node: Fill93672 +Node: Float94629 +Node: Func94963 +Node: Global95543 +Node: hword96285 +Node: Ident96606 +Node: If96906 +Node: Include99498 +Node: Int100038 +Node: Irp100407 +Node: Irpc101201 +Node: Lcomm102020 +Node: Lflags102761 +Node: Line102948 +Node: Linkonce103971 +Node: Ln105191 +Node: MRI105339 +Node: List105666 +Node: Long106269 +Node: Macro106439 +Node: Nolist108823 +Node: Octa109239 +Node: Org109565 +Node: P2align110840 +Node: Print112756 +Node: Psize112973 +Node: Purgem113646 +Node: Quad113853 +Node: Rept114294 +Node: Sbttl114700 +Node: Scl115058 +Node: Section115554 +Node: Set117955 +Node: Short118507 +Node: Single118820 +Node: Size119157 +Node: Sleb128119552 +Node: Skip119867 +Node: Space120182 +Node: Stab121067 +Node: String123062 +Node: Struct123481 +Node: Symver124193 +Node: Tag125778 +Node: Text126286 +Node: Title126598 +Node: Type126970 +Node: Val127346 +Node: Uleb128127707 +Node: Visibility128029 +Node: Word129072 +Node: Deprecated130908 +Node: Machine Dependencies131133 +Node: ARC-Dependent133011 +Node: ARC-Opts133325 +Node: ARC-Float134059 +Node: ARC-Directives134357 +Node: AMD29K-Dependent134750 +Node: AMD29K Options135131 +Node: AMD29K Syntax135305 +Node: AMD29K-Macros135569 +Node: AMD29K-Chars135820 +Node: AMD29K-Regs136083 +Node: AMD29K Floating Point137347 +Node: AMD29K Directives137553 +Node: AMD29K Opcodes138961 +Node: ARM-Dependent139297 +Node: ARM Options139671 +Node: ARM Syntax142171 +Node: ARM-Chars142391 +Node: ARM-Regs142943 +Node: ARM Floating Point143115 +Node: ARM Directives143305 +Node: ARM Opcodes145311 +Node: D10V-Dependent147364 +Node: D10V-Opts147706 +Node: D10V-Syntax148339 +Node: D10V-Size148859 +Node: D10V-Subs149819 +Node: D10V-Chars150841 +Node: D10V-Regs152427 +Node: D10V-Addressing153458 +Node: D10V-Word154131 +Node: D10V-Float154632 +Node: D10V-Opcodes154934 +Node: D30V-Dependent155318 +Node: D30V-Opts155663 +Node: D30V-Syntax156329 +Node: D30V-Size156852 +Node: D30V-Subs157810 +Node: D30V-Chars158832 +Node: D30V-Guarded161117 +Node: D30V-Regs161785 +Node: D30V-Addressing162911 +Node: D30V-Float163566 +Node: D30V-Opcodes163868 +Node: H8/300-Dependent164252 +Node: H8/300 Options164656 +Node: H8/300 Syntax164837 +Node: H8/300-Chars165124 +Node: H8/300-Regs165408 +Node: H8/300-Addressing166312 +Node: H8/300 Floating Point167338 +Node: H8/300 Directives167654 +Node: H8/300 Opcodes168174 +Node: H8/500-Dependent176527 +Node: H8/500 Options176931 +Node: H8/500 Syntax177112 +Node: H8/500-Chars177399 +Node: H8/500-Regs177690 +Node: H8/500-Addressing178446 +Node: H8/500 Floating Point179063 +Node: H8/500 Directives179379 +Node: H8/500 Opcodes179698 +Node: HPPA-Dependent184811 +Node: HPPA Notes185236 +Node: HPPA Options185983 +Node: HPPA Syntax186167 +Node: HPPA Floating Point187426 +Node: HPPA Directives187621 +Node: HPPA Opcodes194212 +Node: ESA/390-Dependent194460 +Node: ESA/390 Notes194910 +Node: ESA/390 Options195690 +Node: ESA/390 Syntax195889 +Node: ESA/390 Floating Point198050 +Node: ESA/390 Directives198319 +Node: ESA/390 Opcodes201596 +Node: i386-Dependent201847 +Node: i386-Options202655 +Node: i386-Syntax202799 +Node: i386-Mnemonics204912 +Node: i386-Regs207054 +Node: i386-Prefixes208197 +Node: i386-Memory210285 +Node: i386-jumps212594 +Node: i386-Float213684 +Node: i386-SIMD215502 +Node: i386-16bit216600 +Node: i386-Bugs218563 +Node: i386-Notes219303 +Node: i960-Dependent220143 +Node: Options-i960220535 +Node: Floating Point-i960224416 +Node: Directives-i960224673 +Node: Opcodes for i960226693 +Node: callj-i960227299 +Node: Compare-and-branch-i960227774 +Node: M68K-Dependent229663 +Node: M68K-Opts230117 +Node: M68K-Syntax235065 +Node: M68K-Moto-Syntax236893 +Node: M68K-Float239471 +Node: M68K-Directives239980 +Node: M68K-opcodes240575 +Node: M68K-Branch240787 +Node: M68K-Chars243602 +Node: MIPS-Dependent244000 +Node: MIPS Opts244880 +Node: MIPS Object248910 +Node: MIPS Stabs250465 +Node: MIPS ISA251176 +Node: MIPS autoextend252284 +Node: MIPS insn252995 +Node: MIPS option stack253481 +Node: PJ-Dependent254194 +Node: PJ Options254407 +Node: SH-Dependent254674 +Node: SH Options255054 +Node: SH Syntax255219 +Node: SH-Chars255478 +Node: SH-Regs255757 +Node: SH-Addressing256356 +Node: SH Floating Point257250 +Node: SH Directives257546 +Node: SH Opcodes257902 +Node: Sparc-Dependent262149 +Node: Sparc-Opts262521 +Node: Sparc-Aligned-Data264767 +Node: Sparc-Float265611 +Node: Sparc-Directives265801 +Node: Z8000-Dependent267750 +Node: Z8000 Options268709 +Node: Z8000 Syntax268884 +Node: Z8000-Chars269160 +Node: Z8000-Regs269378 +Node: Z8000-Addressing270168 +Node: Z8000 Directives271111 +Node: Z8000 Opcodes272709 +Node: Vax-Dependent282645 +Node: VAX-Opts283152 +Node: VAX-float286876 +Node: VAX-directives287497 +Node: VAX-opcodes288346 +Node: VAX-branch288724 +Node: VAX-operands291220 +Node: VAX-no291972 +Node: V850-Dependent292198 +Node: V850 Options292584 +Node: V850 Syntax294397 +Node: V850-Chars294623 +Node: V850-Regs294773 +Node: V850 Floating Point296310 +Node: V850 Directives296505 +Node: V850 Opcodes297405 +Node: Reporting Bugs302690 +Node: Bug Criteria303413 +Node: Bug Reporting304173 +Node: Acknowledgements310742 +Ref: Acknowledgements-Footnote-1315419 +Node: Index315445  End Tag Table diff --git a/gnu/dist/toolchain/gas/doc/as.info-1 b/gnu/dist/toolchain/gas/doc/as.info-1 index 58b4b94ee3d5..a588551b38a6 100644 --- a/gnu/dist/toolchain/gas/doc/as.info-1 +++ b/gnu/dist/toolchain/gas/doc/as.info-1 @@ -28,7 +28,7 @@ File: as.info, Node: Top, Next: Overview, Up: (dir) Using as ******** - This file is a user guide to the GNU assembler `as' version 2.10. + This file is a user guide to the GNU assembler `as' version 2.10.1. * Menu: diff --git a/gnu/dist/toolchain/gas/doc/gasver.texi b/gnu/dist/toolchain/gas/doc/gasver.texi index b696ac718c9a..4c75b6221634 100644 --- a/gnu/dist/toolchain/gas/doc/gasver.texi +++ b/gnu/dist/toolchain/gas/doc/gasver.texi @@ -1 +1 @@ -@set VERSION 2.10 +@set VERSION 2.10.1 diff --git a/gnu/dist/toolchain/gprof/ChangeLog b/gnu/dist/toolchain/gprof/ChangeLog index 47ca5b37efea..8e7f6100deca 100644 --- a/gnu/dist/toolchain/gprof/ChangeLog +++ b/gnu/dist/toolchain/gprof/ChangeLog @@ -1,3 +1,8 @@ +2000-10-16 Philip Blundell + + * configure.in: Set version number to 2.10.1. + * configure: Regenerate. + 2000-06-07 Philippe De Muyter * source.c: Remove direct inclusion of sys/stat.h. diff --git a/gnu/dist/toolchain/gprof/configure b/gnu/dist/toolchain/gprof/configure index dda64d510a7e..8a0077f3044d 100755 --- a/gnu/dist/toolchain/gprof/configure +++ b/gnu/dist/toolchain/gprof/configure @@ -45,7 +45,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -160,7 +159,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -331,11 +329,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -501,16 +494,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -597,7 +586,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:601: checking host system type" >&5 +echo "configure:590: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -618,7 +607,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:622: checking target system type" >&5 +echo "configure:611: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -636,7 +625,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:640: checking build system type" >&5 +echo "configure:629: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -671,7 +660,7 @@ test "$host_alias" != "$target_alias" && # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:675: checking for a BSD compatible install" >&5 +echo "configure:664: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -724,7 +713,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:728: checking whether build environment is sane" >&5 +echo "configure:717: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -781,7 +770,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:785: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:774: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -810,7 +799,7 @@ fi PACKAGE=gprof -VERSION=2.10 +VERSION=2.10.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -827,7 +816,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:831: checking for working aclocal" >&5 +echo "configure:820: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -840,7 +829,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:844: checking for working autoconf" >&5 +echo "configure:833: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -853,7 +842,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:857: checking for working automake" >&5 +echo "configure:846: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -866,7 +855,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:870: checking for working autoheader" >&5 +echo "configure:859: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -879,7 +868,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:883: checking for working makeinfo" >&5 +echo "configure:872: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -965,7 +954,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:969: checking for $ac_word" >&5 +echo "configure:958: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -995,7 +984,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:999: checking for $ac_word" >&5 +echo "configure:988: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1025,7 +1014,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1029: checking for $ac_word" >&5 +echo "configure:1018: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1076,7 +1065,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1080: checking for $ac_word" >&5 +echo "configure:1069: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1108,7 +1097,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1112: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1101: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1119,12 +1108,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1123 "configure" +#line 1112 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1150,12 +1139,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1154: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1143: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1159: checking whether we are using GNU C" >&5 +echo "configure:1148: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1164,7 +1153,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1183,7 +1172,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1187: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1176: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1226,7 +1215,7 @@ ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1230: checking for ld used by GCC" >&5 +echo "configure:1219: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -1250,10 +1239,10 @@ echo "configure:1230: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1254: checking for GNU ld" >&5 +echo "configure:1243: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1257: checking for non-GNU ld" >&5 +echo "configure:1246: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1288,7 +1277,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1292: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1281: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1304,7 +1293,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1308: checking for BSD-compatible nm" >&5 +echo "configure:1297: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1340,7 +1329,7 @@ NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1344: checking whether ln -s works" >&5 +echo "configure:1333: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1389,8 +1378,8 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1393 "configure"' > conftest.$ac_ext - if { (eval echo configure:1394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1382 "configure"' > conftest.$ac_ext + if { (eval echo configure:1383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -1411,19 +1400,19 @@ case "$lt_target" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1415: checking whether the C compiler needs -belf" >&5 +echo "configure:1404: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -1532,7 +1521,7 @@ exec 5>>./config.log # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1536: checking for $ac_word" >&5 +echo "configure:1525: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1562,7 +1551,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1566: checking for $ac_word" >&5 +echo "configure:1555: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1613,7 +1602,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1617: checking for $ac_word" >&5 +echo "configure:1606: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1645,7 +1634,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1649: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1638: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1656,12 +1645,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1660 "configure" +#line 1649 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1687,12 +1676,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1691: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1680: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1696: checking whether we are using GNU C" >&5 +echo "configure:1685: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1701,7 +1690,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1720,7 +1709,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1724: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1713: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1763,7 +1752,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1767: checking for a BSD compatible install" >&5 +echo "configure:1756: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1817,7 +1806,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1821: checking for POSIXized ISC" >&5 +echo "configure:1810: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -1840,12 +1829,12 @@ fi for ac_func in setmode do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1844: checking for $ac_func" >&5 +echo "configure:1833: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1895,7 +1884,7 @@ done ALL_LINGUAS= echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1899: checking how to run the C preprocessor" >&5 +echo "configure:1888: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1910,13 +1899,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1927,13 +1916,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1944,13 +1933,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1975,12 +1964,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1979: checking for ANSI C header files" >&5 +echo "configure:1968: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1988,7 +1977,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2005,7 +1994,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2023,7 +2012,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2044,7 +2033,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2055,7 +2044,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2079,18 +2068,18 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2083: checking for working const" >&5 +echo "configure:2072: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2154,21 +2143,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2158: checking for inline" >&5 +echo "configure:2147: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2194,12 +2183,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2198: checking for off_t" >&5 +echo "configure:2187: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2227,12 +2216,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2231: checking for size_t" >&5 +echo "configure:2220: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2262,19 +2251,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2266: checking for working alloca.h" >&5 +echo "configure:2255: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { -char *p = alloca(2 * sizeof(int)); +void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2295,12 +2284,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2299: checking for alloca" >&5 +echo "configure:2288: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2360,12 +2349,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2364: checking whether alloca needs Cray hooks" >&5 +echo "configure:2353: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2394: checking for $ac_func" >&5 +echo "configure:2383: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2445,7 +2434,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2449: checking stack direction for C alloca" >&5 +echo "configure:2438: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2453,7 +2442,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2497,17 +2486,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2501: checking for $ac_hdr" >&5 +echo "configure:2490: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2536,12 +2525,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2540: checking for $ac_func" >&5 +echo "configure:2529: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2589,7 +2578,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2593: checking for working mmap" >&5 +echo "configure:2582: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2597,7 +2586,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include #include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -2684,7 +2676,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = malloc(pagesize); + data = (char*)malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -2705,7 +2697,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = malloc(2 * pagesize); + data2 = (char*)malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -2723,7 +2715,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); + data3 = (char*)malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -2737,7 +2729,7 @@ main() } EOF -if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2765,17 +2757,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2769: checking for $ac_hdr" >&5 +echo "configure:2761: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2805,12 +2797,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2809: checking for $ac_func" >&5 +echo "configure:2801: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2862,12 +2854,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2866: checking for $ac_func" >&5 +echo "configure:2858: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2924,19 +2916,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2928: checking for LC_MESSAGES" >&5 +echo "configure:2920: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -2957,7 +2949,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2961: checking whether NLS is requested" >&5 +echo "configure:2953: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2977,7 +2969,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2981: checking whether included gettext is requested" >&5 +echo "configure:2973: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -2996,17 +2988,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3000: checking for libintl.h" >&5 +echo "configure:2992: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3023,19 +3015,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3027: checking for gettext in libc" >&5 +echo "configure:3019: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3051,7 +3043,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3055: checking for bindtextdomain in -lintl" >&5 +echo "configure:3047: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3059,7 +3051,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3086,19 +3078,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3090: checking for gettext in libintl" >&5 +echo "configure:3082: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3126,7 +3118,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3130: checking for $ac_word" >&5 +echo "configure:3122: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3160,12 +3152,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3164: checking for $ac_func" >&5 +echo "configure:3156: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3215,7 +3207,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3219: checking for $ac_word" >&5 +echo "configure:3211: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3251,7 +3243,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3255: checking for $ac_word" >&5 +echo "configure:3247: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3283,7 +3275,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3323,7 +3315,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3327: checking for $ac_word" >&5 +echo "configure:3319: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3357,7 +3349,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3361: checking for $ac_word" >&5 +echo "configure:3353: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3393,7 +3385,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3397: checking for $ac_word" >&5 +echo "configure:3389: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3483,7 +3475,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:3487: checking for catalogs to be installed" >&5 +echo "configure:3479: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -3511,17 +3503,17 @@ echo "configure:3487: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:3515: checking for linux/version.h" >&5 +echo "configure:3507: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3584,7 +3576,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:3588: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:3580: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -3607,12 +3599,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:3611: checking for Cygwin environment" >&5 +echo "configure:3603: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -3640,19 +3632,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:3644: checking for mingw32 environment" >&5 +echo "configure:3636: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3648: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -3671,7 +3663,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3675: checking for executable suffix" >&5 +echo "configure:3667: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3681,10 +3673,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:3685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:3677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done diff --git a/gnu/dist/toolchain/gprof/configure.in b/gnu/dist/toolchain/gprof/configure.in index 05a837ba70c3..c3beb91e7e6d 100644 --- a/gnu/dist/toolchain/gprof/configure.in +++ b/gnu/dist/toolchain/gprof/configure.in @@ -4,7 +4,7 @@ AC_INIT(gprof.c) AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(gprof, 2.10) +AM_INIT_AUTOMAKE(gprof, 2.10.1) AM_PROG_LIBTOOL diff --git a/gnu/dist/toolchain/include/ChangeLog b/gnu/dist/toolchain/include/ChangeLog index 4408899df90a..a41d5b1793c7 100644 --- a/gnu/dist/toolchain/include/ChangeLog +++ b/gnu/dist/toolchain/include/ChangeLog @@ -1,3 +1,7 @@ +2000-10-23 Philip Blundell + + * demangle.h, dyn-string.h: Update from trunk version. + 2000-05-26 Eli Zaretskii * filenames.h: New file. diff --git a/gnu/dist/toolchain/include/demangle.h b/gnu/dist/toolchain/include/demangle.h index 63fe5e2adf4f..61dd23071a45 100644 --- a/gnu/dist/toolchain/include/demangle.h +++ b/gnu/dist/toolchain/include/demangle.h @@ -24,21 +24,23 @@ /* Options passed to cplus_demangle (in 2nd parameter). */ -#define DMGL_NO_OPTS 0 /* For readability... */ -#define DMGL_PARAMS (1 << 0) /* Include function args */ -#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ -#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */ +#define DMGL_NO_OPTS 0 /* For readability... */ +#define DMGL_PARAMS (1 << 0) /* Include function args */ +#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ +#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */ -#define DMGL_AUTO (1 << 8) -#define DMGL_GNU (1 << 9) -#define DMGL_LUCID (1 << 10) -#define DMGL_ARM (1 << 11) -#define DMGL_HP (1 << 12) /* For the HP aCC compiler; same as ARM - except for template arguments, etc. */ -#define DMGL_EDG (1 << 13) +#define DMGL_AUTO (1 << 8) +#define DMGL_GNU (1 << 9) +#define DMGL_LUCID (1 << 10) +#define DMGL_ARM (1 << 11) +#define DMGL_HP (1 << 12) /* For the HP aCC compiler; + same as ARM except for + template arguments, etc. */ +#define DMGL_EDG (1 << 13) +#define DMGL_GNU_NEW_ABI (1 << 14) /* If none of these are set, use 'current_demangling_style' as the default. */ -#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG) +#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_NEW_ABI) /* Enumeration of possible demangling styles. @@ -56,17 +58,19 @@ extern enum demangling_styles lucid_demangling = DMGL_LUCID, arm_demangling = DMGL_ARM, hp_demangling = DMGL_HP, - edg_demangling = DMGL_EDG + edg_demangling = DMGL_EDG, + gnu_new_abi_demangling = DMGL_GNU_NEW_ABI } current_demangling_style; /* Define string names for the various demangling styles. */ -#define AUTO_DEMANGLING_STYLE_STRING "auto" -#define GNU_DEMANGLING_STYLE_STRING "gnu" -#define LUCID_DEMANGLING_STYLE_STRING "lucid" -#define ARM_DEMANGLING_STYLE_STRING "arm" -#define HP_DEMANGLING_STYLE_STRING "hp" -#define EDG_DEMANGLING_STYLE_STRING "edg" +#define AUTO_DEMANGLING_STYLE_STRING "auto" +#define GNU_DEMANGLING_STYLE_STRING "gnu" +#define LUCID_DEMANGLING_STYLE_STRING "lucid" +#define ARM_DEMANGLING_STYLE_STRING "arm" +#define HP_DEMANGLING_STYLE_STRING "hp" +#define EDG_DEMANGLING_STYLE_STRING "edg" +#define GNU_NEW_ABI_DEMANGLING_STYLE_STRING "gnu-new-abi" /* Some macros to test what demangling style is active. */ @@ -77,6 +81,17 @@ extern enum demangling_styles #define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM) #define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP) #define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG) +#define GNU_NEW_ABI_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_NEW_ABI) + +/* Provide information about the available demangle styles. This code is + pulled from gdb into libiberty because it is useful to binutils also. */ + +extern struct demangler_engine +{ + const char *demangling_style_name; + enum demangling_styles demangling_style; + const char *demangling_style_doc; +} libiberty_demanglers[]; extern char * cplus_demangle PARAMS ((const char *mangled, int options)); @@ -92,4 +107,14 @@ cplus_mangle_opname PARAMS ((const char *opname, int options)); extern void set_cplus_marker_for_demangling PARAMS ((int ch)); +extern enum demangling_styles +cplus_demangle_set_style PARAMS ((enum demangling_styles style)); + +extern enum demangling_styles +cplus_demangle_name_to_style PARAMS ((const char *name)); + +/* New-ABI demangling entry point, defined in cp-demangle.c. */ +extern char* +cplus_demangle_new_abi PARAMS ((const char* mangled)); + #endif /* DEMANGLE_H */ diff --git a/gnu/dist/toolchain/include/dyn-string.h b/gnu/dist/toolchain/include/dyn-string.h new file mode 100644 index 000000000000..67f7ab7d36e4 --- /dev/null +++ b/gnu/dist/toolchain/include/dyn-string.h @@ -0,0 +1,92 @@ +/* An abstract string datatype. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by Mark Mitchell (mark@markmitchell.com). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +typedef struct dyn_string +{ + int allocated; /* The amount of space allocated for the string. */ + int length; /* The actual length of the string. */ + char *s; /* The string itself, NUL-terminated. */ +}* dyn_string_t; + +/* The length STR, in bytes, not including the terminating NUL. */ +#define dyn_string_length(STR) \ + ((STR)->length) + +/* The NTBS in which the contents of STR are stored. */ +#define dyn_string_buf(STR) \ + ((STR)->s) + +/* Compare DS1 to DS2 with strcmp. */ +#define dyn_string_compare(DS1, DS2) \ + (strcmp ((DS1)->s, (DS2)->s)) + + +/* dyn_string functions are used in the demangling implementation + included in the G++ runtime library. To prevent collisions with + names in user programs, the functions that are used in the + demangler are given implementation-reserved names. */ + +#ifdef IN_LIBGCC2 + +#define dyn_string_init __cxa_dyn_string_init +#define dyn_string_new __cxa_dyn_string_new +#define dyn_string_delete __cxa_dyn_string_delete +#define dyn_string_release __cxa_dyn_string_release +#define dyn_string_resize __cxa_dyn_string_resize +#define dyn_string_clear __cxa_dyn_string_clear +#define dyn_string_copy __cxa_dyn_string_copy +#define dyn_string_copy_cstr __cxa_dyn_string_copy_cstr +#define dyn_string_prepend __cxa_dyn_string_prepend +#define dyn_string_prepend_cstr __cxa_dyn_string_prepend_cstr +#define dyn_string_insert __cxa_dyn_string_insert +#define dyn_string_insert_cstr __cxa_dyn_string_insert_cstr +#define dyn_string_insert_char __cxa_dyn_string_insert_char +#define dyn_string_append __cxa_dyn_string_append +#define dyn_string_append_cstr __cxa_dyn_string_append_cstr +#define dyn_string_append_char __cxa_dyn_string_append_char +#define dyn_string_substring __cxa_dyn_string_substring +#define dyn_string_eq __cxa_dyn_string_eq + +#endif /* IN_LIBGCC2 */ + + +extern int dyn_string_init PARAMS ((struct dyn_string *, int)); +extern dyn_string_t dyn_string_new PARAMS ((int)); +extern void dyn_string_delete PARAMS ((dyn_string_t)); +extern char *dyn_string_release PARAMS ((dyn_string_t)); +extern dyn_string_t dyn_string_resize PARAMS ((dyn_string_t, int)); +extern void dyn_string_clear PARAMS ((dyn_string_t)); +extern int dyn_string_copy PARAMS ((dyn_string_t, dyn_string_t)); +extern int dyn_string_copy_cstr PARAMS ((dyn_string_t, const char *)); +extern int dyn_string_prepend PARAMS ((dyn_string_t, dyn_string_t)); +extern int dyn_string_prepend_cstr PARAMS ((dyn_string_t, const char *)); +extern int dyn_string_insert PARAMS ((dyn_string_t, int, + dyn_string_t)); +extern int dyn_string_insert_cstr PARAMS ((dyn_string_t, int, + const char *)); +extern int dyn_string_insert_char PARAMS ((dyn_string_t, int, int)); +extern int dyn_string_append PARAMS ((dyn_string_t, dyn_string_t)); +extern int dyn_string_append_cstr PARAMS ((dyn_string_t, const char *)); +extern int dyn_string_append_char PARAMS ((dyn_string_t, int)); +extern int dyn_string_substring PARAMS ((dyn_string_t, + dyn_string_t, int, int)); +extern int dyn_string_eq PARAMS ((dyn_string_t, dyn_string_t)); diff --git a/gnu/dist/toolchain/include/elf/ChangeLog b/gnu/dist/toolchain/include/elf/ChangeLog index 4b5a50b175e1..ba8bf9f8d0f6 100644 --- a/gnu/dist/toolchain/include/elf/ChangeLog +++ b/gnu/dist/toolchain/include/elf/ChangeLog @@ -1,3 +1,32 @@ +2000-10-14 Philip Blundell + + From 2000-07-19 H.J. Lu + + * common.h (DF_1_NODEFLIB): Renamed from DF_1_NODEPLIB. + + From 2000-07-19 H.J. Lu + + * common.h (DT_CHECKSUM): Set to 0x6ffffdf8. + (DTF_1_CONFEXP): It is 0x00000002 as suspected. + + From 2000-07-19 H.J. Lu + + * common.h (DT_FEATURE): Renamed from DT_FEATURE_1. + (DT_CONFIG): New. From Solaris 8. + (DT_DEPAUDIT): Likewise. + (DT_AUDIT): Likewise. + (DT_PLTPAD): Likewise. + (DT_MOVETAB): Likewise. + (DF_1_NODEPLIB): Likewise. + (DF_1_NODUMP): Likewise. + (DF_1_CONLFAT): Likewise. + (DT_CHECKSUM): Likewise. FIXME. Check the value on Solaris 8. + (DTF_1_CONFEXP): Likewise. + + From 2000-07-18 H.J. Lu + + * common.h (DT_FLAGS_1): Renamed from DT_1_FLAGS. + 2000-05-02 H.J. Lu * common.h (ELFOSABI_NONE): Renamed from ELFOSABI_SYSV. diff --git a/gnu/dist/toolchain/include/elf/common.h b/gnu/dist/toolchain/include/elf/common.h index 09b96697ad85..b2908539bbb0 100644 --- a/gnu/dist/toolchain/include/elf/common.h +++ b/gnu/dist/toolchain/include/elf/common.h @@ -444,16 +444,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ OS specific values. This is a deliberate special case and we maintain it for backwards compatability. */ #define DT_VALRNGLO 0x6ffffd00 +#define DT_CHECKSUM 0x6ffffdf8 #define DT_PLTPADSZ 0x6ffffdf9 #define DT_MOVEENT 0x6ffffdfa #define DT_MOVESZ 0x6ffffdfb -#define DT_FEATURE_1 0x6ffffdfc +#define DT_FEATURE 0x6ffffdfc #define DT_POSFLAG_1 0x6ffffdfd #define DT_SYMINSZ 0x6ffffdfe #define DT_SYMINENT 0x6ffffdff #define DT_VALRNGHI 0x6ffffdff #define DT_ADDRRNGLO 0x6ffffe00 +#define DT_CONFIG 0x6ffffefa +#define DT_DEPAUDIT 0x6ffffefb +#define DT_AUDIT 0x6ffffefc +#define DT_PLTPAD 0x6ffffefd +#define DT_MOVETAB 0x6ffffefe #define DT_SYMINFO 0x6ffffeff #define DT_ADDRRNGHI 0x6ffffeff @@ -478,14 +484,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DT_USED 0x7ffffffe #define DT_FILTER 0x7fffffff -/* Values used in DT_FEATURE_1 .dynamic entry. */ + +/* Values used in DT_FEATURE .dynamic entry. */ #define DTF_1_PARINIT 0x00000001 +/* From + + http://docs.sun.com:80/ab2/coll.45.13/LLM/@Ab2PageView/21165?Ab2Lang=C&Ab2Enc=iso-8859-1 + + DTF_1_CONFEXP is the same as DTF_1_PARINIT. It is a typo. The value + defined here is the same as the one in on Solaris 8. */ +#define DTF_1_CONFEXP 0x00000002 /* Flag values used in the DT_POSFLAG_1 .dynamic entry. */ #define DF_P1_LAZYLOAD 0x00000001 #define DF_P1_GROUPPERM 0x00000002 -/* Flag value in in the DT_1_FLAGS .dynamic entry. */ +/* Flag value in in the DT_FLAGS_1 .dynamic entry. */ #define DF_1_NOW 0x00000001 #define DF_1_GLOBAL 0x00000002 #define DF_1_GROUP 0x00000004 @@ -497,6 +511,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DF_1_DIRECT 0x00000100 #define DF_1_TRANS 0x00000200 #define DF_1_INTERPOSE 0x00000400 +#define DF_1_NODEFLIB 0x00000800 +#define DF_1_NODUMP 0x00001000 +#define DF_1_CONLFAT 0x00002000 /* Flag values for the DT_FLAGS entry. */ #define DF_ORIGIN (1 << 0) diff --git a/gnu/dist/toolchain/ld/ChangeLog b/gnu/dist/toolchain/ld/ChangeLog index 612d09802754..39a6b79e3775 100644 --- a/gnu/dist/toolchain/ld/ChangeLog +++ b/gnu/dist/toolchain/ld/ChangeLog @@ -1,3 +1,105 @@ +2000-11-06 Alan Modra + + Merge most place_orphan changes from mainline. + 2000-09-07 Alan Modra + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Fix + broken list handling. Create __start_SECNAME and __stop_SECNAME + when no place-holder. Add some comments. Test both SEC_CODE and + SEC_READONLY for hold_text to prevent .rodata orphan poisoning. + Handle case where no output section statement created. + + 2000-09-06 Alan Modra + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't + try shuffling sections when the orphan happens to be the place + holder. Keep count of unique section names generated so we speed + the search for a new name. + + 2000-04-25 Alan Modra + * emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Delete. + (output_rel_find): New function. + (hold_section, hold_use): Delete. + (hold_text, hold_rodata, hold_data, hold_bss, hold_rel, + hold_interp): Make local to place_orphan. + (gld${EMULATION_NAME}_place_orphan): Use lang_output_section_find + rather than place_section to find possible previous use of orphan. + Similarly find the place-holder output sections. Use returned + value from lang_enter_output_section_statement rather than calling + lang_output_section_statement_lookup. + * ldlang.c (lang_enter_output_section_statement): Return output + section statement. + * ldlang.h (lang_enter_output_section_statement): Change + declaration too. + * ldlang.h (lang_output_section_statement): Export it. + * ldlang.c (lang_output_section_statement): Ditto. + + 2000-04-18 H.J. Lu + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Call + lang_leave_output_section_statement () after calling + lang_enter_output_section_statement (). + + 2000-04-18 Alan Modra + * emultempl/elf32.em (struct orphan_save): Add section field. + (gld${EMULATION_NAME}_place_orphan): Use above to keep sections in + better order, and place first orphan section as we did before the + 2000-04-12 patch. Ignore ~SEC_ALLOC sections when choosing place. + Don't call make_bfd_section here, let wild_doit do the job for us. + Don't build a statement list when we'll only throw it away. + + 2000-04-14 Alan Modra + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Process + ~SEC_ALLOC sections too. Init start address of debug sections. + + 2000-04-12 Alan Modra + * emultempl/elf32.em (struct orphan_save): New. + (hold_text, hold_rodata, hold_data, hold_bss, hold_rel, + hold_interp): Make them struct orphan_save. + (gld${EMULATION_NAME}_place_section): Modify for new hold_*. + (gld${EMULATION_NAME}_place_orphan): Add new orphan sections to + the end of the relevant section list. Also add associated section + statements to the end of any previous orphan statements. + +2000-11-05 Alan Modra + + * ldlex.l (yy_create_string_buffer): Init yy_is_our_buffer, + yy_is_interactive, yy_at_bol, and yy_fill_buffer. + * ldlex.c: Regenerate. + + * Makefile.am (DISTCLEANFILES): Add stringify.sed. + * Makefile.in: Regenerate. + +2000-10-16 Philip Blundell + + * configure.in: Set version number to 2.10.1. + * configure: Regenerate. + +2000-10-12 Peter Jeremy + + From 2000-08-08 Peter Jeremy + * emultempl/elf32.em (_after_close): Refer to -rpath not --rpath + in error message. + +2000-04-14 Matthew Green + + * configure.tgt: Add NetBSD/sparc ELF, and NetBSD/sparc64 support. + +2000-06-07 Michael Sokolov + + * emultempl/mipsecoff.em (gld{EMULATION_NAME}_after_open): Require all + input objects to be ECOFF. + (check_sections): einfo takes %B, not %P, to print a BFD name. + +2000-07-31 Rodney Brown + + * configure.tgt: Select targ_emul=elf_i386 for Unixware 7 + (i586-sco-sysv5uw7.1.0). + +2000-06-18 Alan Modra + + * NEWS: Update list of targets supporting --gc-sections. + + * scripttempl/elf.sc: KEEP .eh_frame contents. + * scripttempl/elfd30v.sc: Same here. + 2000-05-22 David O'Brien * configure.tgt: Recognize alpha-*-freebsd*. @@ -38,6 +140,10 @@ * ld.h: Correctly check GCC version. +2000-04-21 Richard Henderson + + * scripttempl/elfd30v.sc: Place .gcc_except_table. + 2000-04-19 Alan Modra * ld.texinfo (Simple Example): Remove extraneous paragraph. diff --git a/gnu/dist/toolchain/ld/NEWS b/gnu/dist/toolchain/ld/NEWS index 2c2340f385e0..95062014c619 100644 --- a/gnu/dist/toolchain/ld/NEWS +++ b/gnu/dist/toolchain/ld/NEWS @@ -2,9 +2,14 @@ Changes in version 2.10: +* Added AT> to the linker script language to allow load-time allocation of + sections into regions. + * Added garbage collection of unused sections, enabled by --gc-sections. It does require a bit of backend support; currently implemented are - ppc-elf, mips-elf, and mn10300-elf. Others will ignore the option. + avr-elf, d10v-elf, fr30-elf, i386-elf, m32r-elf, m68k-elf, mcore-elf, + mips-elf, mn10300-elf, ppc-elf, sh-elf, sparc-elf, and v850-elf. + Others will ignore the option. * Added SORT to the linker script language to permit sorting sections by file name or section name. diff --git a/gnu/dist/toolchain/ld/configure b/gnu/dist/toolchain/ld/configure index a60a18968bcd..92d00d64ed46 100755 --- a/gnu/dist/toolchain/ld/configure +++ b/gnu/dist/toolchain/ld/configure @@ -803,7 +803,7 @@ fi PACKAGE=ld -VERSION=2.10 +VERSION=2.10.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -2133,7 +2133,7 @@ for ac_kw in inline __inline__ __inline; do #include "confdefs.h" int main() { -} $ac_kw foo() { +} int $ac_kw foo() { ; return 0; } EOF if { (eval echo configure:2140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then @@ -2239,7 +2239,7 @@ else #include "confdefs.h" #include int main() { -char *p = alloca(2 * sizeof(int)); +void *p = alloca(2 * sizeof(int)); ; return 0; } EOF if { (eval echo configure:2246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then @@ -2592,12 +2592,15 @@ else #include #include #include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -2652,7 +2655,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = malloc(pagesize); + data = (char*)malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -2673,7 +2676,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = malloc(2 * pagesize); + data2 = (char*)malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -2691,7 +2694,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); + data3 = (char*)malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -2705,7 +2708,7 @@ main() } EOF -if { (eval echo configure:2709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2733,17 +2736,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2737: checking for $ac_hdr" >&5 +echo "configure:2740: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2773,12 +2776,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2777: checking for $ac_func" >&5 +echo "configure:2780: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2830,12 +2833,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2834: checking for $ac_func" >&5 +echo "configure:2837: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2892,19 +2895,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2896: checking for LC_MESSAGES" >&5 +echo "configure:2899: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -2925,7 +2928,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2929: checking whether NLS is requested" >&5 +echo "configure:2932: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2945,7 +2948,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2949: checking whether included gettext is requested" >&5 +echo "configure:2952: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -2964,17 +2967,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:2968: checking for libintl.h" >&5 +echo "configure:2971: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2991,19 +2994,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:2995: checking for gettext in libc" >&5 +echo "configure:2998: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3019,7 +3022,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3023: checking for bindtextdomain in -lintl" >&5 +echo "configure:3026: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3027,7 +3030,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3054,19 +3057,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3058: checking for gettext in libintl" >&5 +echo "configure:3061: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3094,7 +3097,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3098: checking for $ac_word" >&5 +echo "configure:3101: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3128,12 +3131,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3132: checking for $ac_func" >&5 +echo "configure:3135: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3183,7 +3186,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3187: checking for $ac_word" >&5 +echo "configure:3190: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3219,7 +3222,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3223: checking for $ac_word" >&5 +echo "configure:3226: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3251,7 +3254,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3291,7 +3294,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3295: checking for $ac_word" >&5 +echo "configure:3298: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3325,7 +3328,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3329: checking for $ac_word" >&5 +echo "configure:3332: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3361,7 +3364,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3365: checking for $ac_word" >&5 +echo "configure:3368: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3451,7 +3454,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:3455: checking for catalogs to be installed" >&5 +echo "configure:3458: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -3479,17 +3482,17 @@ echo "configure:3455: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:3483: checking for linux/version.h" >&5 +echo "configure:3486: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3552,12 +3555,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:3556: checking for Cygwin environment" >&5 +echo "configure:3559: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -3585,19 +3588,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:3589: checking for mingw32 environment" >&5 +echo "configure:3592: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -3616,7 +3619,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3620: checking for executable suffix" >&5 +echo "configure:3623: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3626,7 +3629,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:3630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:3633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -3652,7 +3655,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3656: checking for $ac_word" >&5 +echo "configure:3659: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3688,7 +3691,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3692: checking for $ac_word" >&5 +echo "configure:3695: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3721,7 +3724,7 @@ test -n "$LEX" || LEX=""$missing_dir/missing flex"" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3725: checking for $ac_word" >&5 +echo "configure:3728: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3755,7 +3758,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:3759: checking for yywrap in -l$ac_lib" >&5 +echo "configure:3762: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3763,7 +3766,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3797,7 +3800,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:3801: checking lex output file root" >&5 +echo "configure:3804: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3818,7 +3821,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:3822: checking whether yytext is a pointer" >&5 +echo "configure:3825: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3830,14 +3833,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -3860,7 +3863,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:3864: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:3867: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -3894,17 +3897,17 @@ for ac_hdr in string.h strings.h stdlib.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3898: checking for $ac_hdr" >&5 +echo "configure:3901: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3933,12 +3936,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3937: checking for $ac_func" >&5 +echo "configure:3940: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3990,12 +3993,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:3994: checking for $ac_hdr that defines DIR" >&5 +echo "configure:3997: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -4003,7 +4006,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4028,7 +4031,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4032: checking for opendir in -ldir" >&5 +echo "configure:4035: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4036,7 +4039,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4069,7 +4072,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4073: checking for opendir in -lx" >&5 +echo "configure:4076: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4077,7 +4080,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4121,12 +4124,12 @@ EOF esac echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4125: checking whether strstr must be declared" >&5 +echo "configure:4128: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4147,7 +4150,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4168,12 +4171,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4172: checking whether free must be declared" >&5 +echo "configure:4175: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4194,7 +4197,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4215,12 +4218,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:4219: checking whether sbrk must be declared" >&5 +echo "configure:4222: checking whether sbrk must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4241,7 +4244,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:4245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -4262,12 +4265,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4266: checking whether getenv must be declared" >&5 +echo "configure:4269: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4288,7 +4291,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -4309,12 +4312,12 @@ EOF fi echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:4313: checking whether environ must be declared" >&5 +echo "configure:4316: checking whether environ must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4335,7 +4338,7 @@ int main() { char *(*pfn) = (char *(*)) environ ; return 0; } EOF -if { (eval echo configure:4339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_environ=no else @@ -4363,19 +4366,19 @@ fi # constants, while still supporting pre-ANSI compilers which do not # support string concatenation. echo $ac_n "checking whether ANSI C string concatenation works""... $ac_c" 1>&6 -echo "configure:4367: checking whether ANSI C string concatenation works" >&5 +echo "configure:4370: checking whether ANSI C string concatenation works" >&5 if eval "test \"`echo '$''{'ld_cv_string_concatenation'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ld_cv_string_concatenation=yes else diff --git a/gnu/dist/toolchain/ld/configure.in b/gnu/dist/toolchain/ld/configure.in index 91916f7645f9..d4b67ac680a9 100644 --- a/gnu/dist/toolchain/ld/configure.in +++ b/gnu/dist/toolchain/ld/configure.in @@ -5,7 +5,7 @@ AC_INIT(ldmain.c) AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(ld, 2.10) +AM_INIT_AUTOMAKE(ld, 2.10.1) AM_PROG_LIBTOOL diff --git a/gnu/dist/toolchain/ld/emultempl/elf32.em b/gnu/dist/toolchain/ld/emultempl/elf32.em index 2913ecf1bcb0..b502d9ee8ca3 100644 --- a/gnu/dist/toolchain/ld/emultempl/elf32.em +++ b/gnu/dist/toolchain/ld/emultempl/elf32.em @@ -7,7 +7,7 @@ cat >e${EMULATION_NAME}.c < ELF support by Ian Lance Taylor @@ -63,10 +63,9 @@ static void gld${EMULATION_NAME}_before_allocation PARAMS ((void)); static void gld${EMULATION_NAME}_find_statement_assignment PARAMS ((lang_statement_union_type *)); static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *)); +static lang_output_section_statement_type *output_rel_find PARAMS ((void)); static boolean gld${EMULATION_NAME}_place_orphan PARAMS ((lang_input_statement_type *, asection *)); -static void gld${EMULATION_NAME}_place_section - PARAMS ((lang_statement_union_type *)); static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); static void @@ -376,7 +375,7 @@ cat >>e${EMULATION_NAME}.c <name, l->by); } } @@ -862,58 +861,83 @@ gld${EMULATION_NAME}_find_exp_assignment (exp) } } +/* A variant of lang_output_section_find. Used by place_orphan. */ + +static lang_output_section_statement_type * +output_rel_find () +{ + lang_statement_union_type *u; + lang_output_section_statement_type *lookup; + + for (u = lang_output_section_statement.head; + u != (lang_statement_union_type *) NULL; + u = lookup->next) + { + lookup = &u->output_section_statement; + if (strncmp (".rel", lookup->name, 4) == 0 + && lookup->bfd_section != NULL + && (lookup->bfd_section->flags & SEC_ALLOC) != 0) + { + return lookup; + } + } + return (lang_output_section_statement_type *) NULL; +} + /* Place an orphan section. We use this to put random SHF_ALLOC sections in the right segment. */ -static asection *hold_section; -static lang_output_section_statement_type *hold_use; -static lang_output_section_statement_type *hold_text; -static lang_output_section_statement_type *hold_rodata; -static lang_output_section_statement_type *hold_data; -static lang_output_section_statement_type *hold_bss; -static lang_output_section_statement_type *hold_rel; -static lang_output_section_statement_type *hold_interp; +struct orphan_save { + lang_output_section_statement_type *os; + asection **section; + lang_statement_union_type **stmt; +}; -/*ARGSUSED*/ static boolean gld${EMULATION_NAME}_place_orphan (file, s) lang_input_statement_type *file; asection *s; { - lang_output_section_statement_type *place; - asection *snew, **pps; + static struct orphan_save hold_text; + static struct orphan_save hold_rodata; + static struct orphan_save hold_data; + static struct orphan_save hold_bss; + static struct orphan_save hold_rel; + static struct orphan_save hold_interp; + struct orphan_save *place; lang_statement_list_type *old; lang_statement_list_type add; etree_type *address; - const char *secname, *ps; + const char *secname; const char *outsecname; + const char *ps = NULL; lang_output_section_statement_type *os; - if ((s->flags & SEC_ALLOC) == 0) - return false; + secname = bfd_get_section_name (s->owner, s); - /* Look through the script to see where to place this section. */ - hold_section = s; - hold_use = NULL; - lang_for_each_statement (gld${EMULATION_NAME}_place_section); + /* Look through the script to see where to place this section. */ + os = lang_output_section_find (secname); - if (hold_use != NULL) + if (os != NULL + && os->bfd_section != NULL + && ((s->flags ^ os->bfd_section->flags) & (SEC_LOAD | SEC_ALLOC)) == 0) { /* We have already placed a section with this name. */ - wild_doit (&hold_use->children, s, hold_use, file); + wild_doit (&os->children, s, os, file); return true; } - secname = bfd_get_section_name (s->owner, s); + if (hold_text.os == NULL) + hold_text.os = lang_output_section_find (".text"); /* If this is a final link, then always put .gnu.warning.SYMBOL sections into the .text section to get them out of the way. */ if (! link_info.shared && ! link_info.relocateable && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0 - && hold_text != NULL) + && hold_text.os != NULL) { - wild_doit (&hold_text->children, s, hold_text, file); + wild_doit (&hold_text.os->children, s, hold_text.os, file); return true; } @@ -922,31 +946,37 @@ gld${EMULATION_NAME}_place_orphan (file, s) right after the .interp section, so that the PT_NOTE segment is stored right after the program headers where the OS can read it in the first page. */ - place = NULL; +#define HAVE_SECTION(hold, name) \ +(hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL) + if (s->flags & SEC_EXCLUDE) return false; + + place = NULL; + if ((s->flags & SEC_ALLOC) == 0) + ; else if ((s->flags & SEC_LOAD) != 0 - && strncmp (secname, ".note", 4) == 0 - && hold_interp != NULL) - place = hold_interp; + && strncmp (secname, ".note", 4) == 0 + && HAVE_SECTION (hold_interp, ".interp")) + place = &hold_interp; else if ((s->flags & SEC_HAS_CONTENTS) == 0 - && hold_bss != NULL) - place = hold_bss; + && HAVE_SECTION (hold_bss, ".bss")) + place = &hold_bss; else if ((s->flags & SEC_READONLY) == 0 - && hold_data != NULL) - place = hold_data; + && HAVE_SECTION (hold_data, ".data")) + place = &hold_data; else if (strncmp (secname, ".rel", 4) == 0 - && hold_rel != NULL) - place = hold_rel; - else if ((s->flags & SEC_CODE) == 0 - && (s->flags & SEC_READONLY) != 0 - && hold_rodata != NULL) - place = hold_rodata; - else if ((s->flags & SEC_READONLY) != 0 - && hold_text != NULL) - place = hold_text; - if (place == NULL) - return false; + && (hold_rel.os != NULL + || (hold_rel.os = output_rel_find ()) != NULL)) + place = &hold_rel; + else if ((s->flags & (SEC_CODE | SEC_READONLY)) == SEC_READONLY + && HAVE_SECTION (hold_rodata, ".rodata")) + place = &hold_rodata; + else if ((s->flags & (SEC_CODE | SEC_READONLY)) == (SEC_CODE | SEC_READONLY) + && hold_text.os != NULL) + place = &hold_text; + +#undef HAVE_SECTION /* Choose a unique name for the section. This will be needed if the same section name appears in the input file with different @@ -972,115 +1002,144 @@ gld${EMULATION_NAME}_place_orphan (file, s) outsecname = newname; } - /* Create the section in the output file, and put it in the right - place. This shuffling is to make the output file look neater. */ - snew = bfd_make_section (output_bfd, outsecname); - if (snew == NULL) - einfo ("%P%F: output format %s cannot represent section called %s\n", - output_bfd->xvec->name, outsecname); - if (place->bfd_section != NULL) - { - for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) - ; - *pps = snew->next; - snew->next = place->bfd_section->next; - place->bfd_section->next = snew; - } - - /* Start building a list of statements for this section. */ + /* Start building a list of statements for this section. + First save the current statement pointer. */ old = stat_ptr; - stat_ptr = &add; - lang_list_init (stat_ptr); - /* If the name of the section is representable in C, then create - symbols to mark the start and the end of the section. */ - for (ps = outsecname; *ps != '\0'; ps++) - if (! isalnum ((unsigned char) *ps) && *ps != '_') - break; - if (*ps == '\0' && config.build_constructors) + /* If we have found an appropriate place for the output section + statements for this orphan, add them to our own private list, + inserting them later into the global statement list. */ + if (place != NULL) { - char *symname; - - symname = (char *) xmalloc (ps - outsecname + sizeof "__start_"); - sprintf (symname, "__start_%s", outsecname); - lang_add_assignment (exp_assop ('=', symname, - exp_unop (ALIGN_K, - exp_intop ((bfd_vma) 1 - << s->alignment_power)))); + stat_ptr = &add; + lang_list_init (stat_ptr); } - if (! link_info.relocateable) - address = NULL; - else + if (config.build_constructors) + { + /* If the name of the section is representable in C, then create + symbols to mark the start and the end of the section. */ + for (ps = outsecname; *ps != '\0'; ps++) + if (! isalnum ((unsigned char) *ps) && *ps != '_') + break; + if (*ps == '\0') + { + char *symname; + etree_type *e_align; + + symname = (char *) xmalloc (ps - outsecname + sizeof "__start_"); + sprintf (symname, "__start_%s", outsecname); + e_align = exp_unop (ALIGN_K, + exp_intop ((bfd_vma) 1 << s->alignment_power)); + lang_add_assignment (exp_assop ('=', symname, e_align)); + } + } + + if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0) address = exp_intop ((bfd_vma) 0); + else + address = NULL; - lang_enter_output_section_statement (outsecname, address, 0, - (bfd_vma) 0, - (etree_type *) NULL, - (etree_type *) NULL, - (etree_type *) NULL); + os = lang_enter_output_section_statement (outsecname, address, 0, + (bfd_vma) 0, + (etree_type *) NULL, + (etree_type *) NULL, + (etree_type *) NULL); - os = lang_output_section_statement_lookup (outsecname); wild_doit (&os->children, s, os, file); lang_leave_output_section_statement - ((bfd_vma) 0, "*default*", (struct lang_output_section_phdr_list *) NULL, - "*default*"); - stat_ptr = &add; + ((bfd_vma) 0, "*default*", + (struct lang_output_section_phdr_list *) NULL, "*default*"); - if (*ps == '\0' && config.build_constructors) + if (config.build_constructors && *ps == '\0') { char *symname; + /* lang_leave_ouput_section_statement resets stat_ptr. Put + stat_ptr back where we want it. */ + if (place != NULL) + stat_ptr = &add; + symname = (char *) xmalloc (ps - outsecname + sizeof "__stop_"); sprintf (symname, "__stop_%s", outsecname); lang_add_assignment (exp_assop ('=', symname, exp_nameop (NAME, "."))); } - /* Now stick the new statement list right after PLACE. */ - *add.tail = place->header.next; - place->header.next = add.head; - + /* Restore the global list pointer. */ stat_ptr = old; + if (place != NULL) + { + asection *snew, **pps; + + snew = os->bfd_section; + if (place->section != NULL + || (place->os->bfd_section != NULL + && place->os->bfd_section != snew)) + { + /* Shuffle the section to make the output file look neater. + This is really only cosmetic. */ + if (place->section == NULL) + { +#if 0 + /* Finding the end of the list is a little tricky. We + make a wild stab at it by comparing section flags. */ + flagword first_flags = place->os->bfd_section->flags; + for (pps = &place->os->bfd_section->next; + *pps != NULL && (*pps)->flags == first_flags; + pps = &(*pps)->next) + ; + place->section = pps; +#else + /* Put orphans after the first section on the list. */ + place->section = &place->os->bfd_section->next; +#endif + } + + /* Unlink the section. */ + for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) + ; + *pps = snew->next; + + /* Now tack it on to the "place->os" section list. */ + snew->next = *place->section; + *place->section = snew; + } + place->section = &snew->next; /* Save the end of this list. */ + + if (add.head != NULL) + { + /* We try to put the output statements in some sort of + reasonable order here, because they determine the final + load addresses of the orphan sections. */ + if (place->stmt == NULL) + { + /* Put the new statement list right at the head. */ + *add.tail = place->os->header.next; + place->os->header.next = add.head; + } + else + { + /* Put it after the last orphan statement we added. */ + *add.tail = *place->stmt; + *place->stmt = add.head; + } + + /* Fix the global list pointer if we happened to tack our + new list at the tail. */ + if (*old->tail == add.head) + old->tail = add.tail; + + /* Save the end of this list. */ + place->stmt = add.tail; + } + } + return true; } -static void -gld${EMULATION_NAME}_place_section (s) - lang_statement_union_type *s; -{ - lang_output_section_statement_type *os; - - if (s->header.type != lang_output_section_statement_enum) - return; - - os = &s->output_section_statement; - - if (strcmp (os->name, hold_section->name) == 0 - && os->bfd_section != NULL - && ((hold_section->flags & (SEC_LOAD | SEC_ALLOC)) - == (os->bfd_section->flags & (SEC_LOAD | SEC_ALLOC)))) - hold_use = os; - - if (strcmp (os->name, ".text") == 0) - hold_text = os; - else if (strcmp (os->name, ".rodata") == 0) - hold_rodata = os; - else if (strcmp (os->name, ".data") == 0) - hold_data = os; - else if (strcmp (os->name, ".bss") == 0) - hold_bss = os; - else if (hold_rel == NULL - && os->bfd_section != NULL - && (os->bfd_section->flags & SEC_ALLOC) != 0 - && strncmp (os->name, ".rel", 4) == 0) - hold_rel = os; - else if (strcmp (os->name, ".interp") == 0) - hold_interp = os; -} - static char * gld${EMULATION_NAME}_get_script(isfile) int *isfile; diff --git a/gnu/dist/toolchain/ld/emultempl/mipsecoff.em b/gnu/dist/toolchain/ld/emultempl/mipsecoff.em index 4c932a14fad3..61ab7d4e91b9 100644 --- a/gnu/dist/toolchain/ld/emultempl/mipsecoff.em +++ b/gnu/dist/toolchain/ld/emultempl/mipsecoff.em @@ -69,6 +69,11 @@ gld${EMULATION_NAME}_after_open () { asection *datasec; + /* As first-order business, make sure that each input BFD is ECOFF. It + better be, as we are directly calling an ECOFF backend function. */ + if (bfd_get_flavour (abfd) != bfd_target_ecoff_flavour) + einfo ("%F%B: all input objects must be ECOFF for --embedded-relocs\n"); + datasec = bfd_get_section_by_name (abfd, ".sdata"); /* Note that we assume that the reloc_count field has already @@ -113,7 +118,7 @@ check_sections (abfd, sec, sdatasec) if ((bfd_get_section_flags (abfd, sec) & SEC_CODE) == 0 && sec != (asection *) sdatasec && sec->reloc_count != 0) - einfo ("%P%X: section %s has relocs; can not use --embedded-relocs\n", + einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n", abfd, bfd_get_section_name (abfd, sec)); } diff --git a/gnu/dist/toolchain/ld/ld.info b/gnu/dist/toolchain/ld/ld.info index 69c36bd32e70..d0ffc49ec022 100644 --- a/gnu/dist/toolchain/ld/ld.info +++ b/gnu/dist/toolchain/ld/ld.info @@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY * Ld: (ld). The GNU linker. END-INFO-DIR-ENTRY - This file documents the GNU linker LD version 2.10. + This file documents the GNU linker LD version 2.10.1. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. @@ -24,74 +24,74 @@ versions.  Indirect: -ld.info-1: 880 -ld.info-2: 50060 -ld.info-3: 98401 -ld.info-4: 146817 +ld.info-1: 882 +ld.info-2: 50064 +ld.info-3: 98405 +ld.info-4: 146821  Tag Table: (Indirect) -Node: Top880 -Node: Overview1397 -Node: Invocation2510 -Node: Options2917 -Node: Environment50060 -Node: Scripts51815 -Node: Basic Script Concepts53548 -Node: Script Format56250 -Node: Simple Example57108 -Node: Simple Commands60198 -Node: Entry Point60644 -Node: File Commands61394 -Node: Format Commands64447 -Node: Miscellaneous Commands66403 -Node: Assignments68394 -Node: Simple Assignments68726 -Node: PROVIDE70422 -Node: SECTIONS71595 -Node: Output Section Description73481 -Node: Output Section Name74466 -Node: Output Section Address75333 -Node: Input Section76967 -Node: Input Section Basics77759 -Node: Input Section Wildcards80027 -Node: Input Section Common82834 -Node: Input Section Keep84303 -Node: Input Section Example84772 -Node: Output Section Data85729 -Node: Output Section Keywords88174 -Node: Output Section Discarding91606 -Node: Output Section Attributes92551 -Node: Output Section Type93385 -Node: Output Section LMA94526 -Node: Output Section Region96630 -Node: Output Section Phdr97043 -Node: Output Section Fill97694 -Node: Overlay Description98401 -Node: MEMORY102640 -Node: PHDRS106717 -Node: VERSION111756 -Node: Expressions117834 -Node: Constants118668 -Node: Symbols119224 -Node: Location Counter119956 -Node: Operators122261 -Node: Evaluation123172 -Node: Expression Section124526 -Node: Builtin Functions126002 -Node: Implicit Linker Scripts131004 -Node: Machine Dependent131772 -Node: H8/300132226 -Node: i960133022 -Node: ARM134702 -Node: BFD135837 -Node: BFD outline137291 -Node: BFD information loss138576 -Node: Canonical format141084 -Node: Reporting Bugs145430 -Node: Bug Criteria146123 -Node: Bug Reporting146817 -Node: MRI153578 -Node: Index158177 +Node: Top882 +Node: Overview1401 +Node: Invocation2514 +Node: Options2921 +Node: Environment50064 +Node: Scripts51819 +Node: Basic Script Concepts53552 +Node: Script Format56254 +Node: Simple Example57112 +Node: Simple Commands60202 +Node: Entry Point60648 +Node: File Commands61398 +Node: Format Commands64451 +Node: Miscellaneous Commands66407 +Node: Assignments68398 +Node: Simple Assignments68730 +Node: PROVIDE70426 +Node: SECTIONS71599 +Node: Output Section Description73485 +Node: Output Section Name74470 +Node: Output Section Address75337 +Node: Input Section76971 +Node: Input Section Basics77763 +Node: Input Section Wildcards80031 +Node: Input Section Common82838 +Node: Input Section Keep84307 +Node: Input Section Example84776 +Node: Output Section Data85733 +Node: Output Section Keywords88178 +Node: Output Section Discarding91610 +Node: Output Section Attributes92555 +Node: Output Section Type93389 +Node: Output Section LMA94530 +Node: Output Section Region96634 +Node: Output Section Phdr97047 +Node: Output Section Fill97698 +Node: Overlay Description98405 +Node: MEMORY102644 +Node: PHDRS106721 +Node: VERSION111760 +Node: Expressions117838 +Node: Constants118672 +Node: Symbols119228 +Node: Location Counter119960 +Node: Operators122265 +Node: Evaluation123176 +Node: Expression Section124530 +Node: Builtin Functions126006 +Node: Implicit Linker Scripts131008 +Node: Machine Dependent131776 +Node: H8/300132230 +Node: i960133026 +Node: ARM134706 +Node: BFD135841 +Node: BFD outline137295 +Node: BFD information loss138580 +Node: Canonical format141088 +Node: Reporting Bugs145434 +Node: Bug Criteria146127 +Node: Bug Reporting146821 +Node: MRI153582 +Node: Index158181  End Tag Table diff --git a/gnu/dist/toolchain/ld/ld.info-1 b/gnu/dist/toolchain/ld/ld.info-1 index f0f49b4caa20..0695587000d8 100644 --- a/gnu/dist/toolchain/ld/ld.info-1 +++ b/gnu/dist/toolchain/ld/ld.info-1 @@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY * Ld: (ld). The GNU linker. END-INFO-DIR-ENTRY - This file documents the GNU linker LD version 2.10. + This file documents the GNU linker LD version 2.10.1. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. @@ -28,7 +28,7 @@ File: ld.info, Node: Top, Next: Overview, Up: (dir) Using ld ******** - This file documents the GNU linker ld version 2.10. + This file documents the GNU linker ld version 2.10.1. * Menu: diff --git a/gnu/dist/toolchain/ld/ld.info-2 b/gnu/dist/toolchain/ld/ld.info-2 index 9818847b65a6..3df61c6bd4c0 100644 --- a/gnu/dist/toolchain/ld/ld.info-2 +++ b/gnu/dist/toolchain/ld/ld.info-2 @@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY * Ld: (ld). The GNU linker. END-INFO-DIR-ENTRY - This file documents the GNU linker LD version 2.10. + This file documents the GNU linker LD version 2.10.1. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. diff --git a/gnu/dist/toolchain/ld/ld.info-3 b/gnu/dist/toolchain/ld/ld.info-3 index 68f54d7f4de5..af7eec5578ca 100644 --- a/gnu/dist/toolchain/ld/ld.info-3 +++ b/gnu/dist/toolchain/ld/ld.info-3 @@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY * Ld: (ld). The GNU linker. END-INFO-DIR-ENTRY - This file documents the GNU linker LD version 2.10. + This file documents the GNU linker LD version 2.10.1. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. diff --git a/gnu/dist/toolchain/ld/ld.info-4 b/gnu/dist/toolchain/ld/ld.info-4 index f51054d1823f..d452d0b4780e 100644 --- a/gnu/dist/toolchain/ld/ld.info-4 +++ b/gnu/dist/toolchain/ld/ld.info-4 @@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY * Ld: (ld). The GNU linker. END-INFO-DIR-ENTRY - This file documents the GNU linker LD version 2.10. + This file documents the GNU linker LD version 2.10.1. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. diff --git a/gnu/dist/toolchain/ld/ldlang.c b/gnu/dist/toolchain/ld/ldlang.c index d40ff07a5b33..8f0c607b7a1c 100644 --- a/gnu/dist/toolchain/ld/ldlang.c +++ b/gnu/dist/toolchain/ld/ldlang.c @@ -58,7 +58,6 @@ static lang_output_section_statement_type *default_common_section; static boolean map_option_f; static bfd_vma print_dot; static lang_input_statement_type *first_file; -static lang_statement_list_type lang_output_section_statement; static CONST char *current_target; static CONST char *output_target; static lang_statement_list_type statement_list; @@ -166,6 +165,7 @@ static char * get_first_input_target PARAMS ((void)); /* EXPORTS */ lang_output_section_statement_type *abs_output_section; +lang_statement_list_type lang_output_section_statement; lang_statement_list_type *stat_ptr = &statement_list; lang_statement_list_type file_chain = { NULL, NULL }; const char *entry_symbol = NULL; @@ -3813,7 +3813,7 @@ topower (x) return 0; } -void +lang_output_section_statement_type * lang_enter_output_section_statement (output_section_statement_name, address_exp, sectype, block_value, align, subalign, ebase) @@ -3861,6 +3861,7 @@ lang_enter_output_section_statement (output_section_statement_name, "section alignment", 0)); os->load_base = ebase; + return os; } diff --git a/gnu/dist/toolchain/ld/ldlang.h b/gnu/dist/toolchain/ld/ldlang.h index 068cd96ac840..553db4b2a059 100644 --- a/gnu/dist/toolchain/ld/ldlang.h +++ b/gnu/dist/toolchain/ld/ldlang.h @@ -371,6 +371,7 @@ struct lang_nocrossrefs extern struct lang_nocrossrefs *nocrossref_list; extern lang_output_section_statement_type *abs_output_section; +extern lang_statement_list_type lang_output_section_statement; extern boolean lang_has_input_file; extern etree_type *base; extern lang_statement_list_type *stat_ptr; @@ -388,7 +389,7 @@ extern void lang_map PARAMS ((void)); extern void lang_set_flags PARAMS ((lang_memory_region_type *, const char *, int)); extern void lang_add_output PARAMS ((const char *, int from_script)); -extern void lang_enter_output_section_statement +extern lang_output_section_statement_type *lang_enter_output_section_statement PARAMS ((const char *output_section_statement_name, etree_type * address_exp, enum section_type sectype, diff --git a/gnu/dist/toolchain/ld/ldlex.l b/gnu/dist/toolchain/ld/ldlex.l index 2eef80f1fe2b..f3efe77f00f9 100644 --- a/gnu/dist/toolchain/ld/ldlex.l +++ b/gnu/dist/toolchain/ld/ldlex.l @@ -479,6 +479,11 @@ yy_create_string_buffer (string, size) b->yy_n_chars = size+1; b->yy_buf_pos = &b->yy_ch_buf[1]; + b->yy_is_our_buffer = 1; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + /* flex 2.4.7 changed the interface. FIXME: We should not be using a flex internal interface in the first place! */ #ifdef YY_BUFFER_NEW diff --git a/gnu/dist/toolchain/ld/ldver.texi b/gnu/dist/toolchain/ld/ldver.texi index b696ac718c9a..4c75b6221634 100644 --- a/gnu/dist/toolchain/ld/ldver.texi +++ b/gnu/dist/toolchain/ld/ldver.texi @@ -1 +1 @@ -@set VERSION 2.10 +@set VERSION 2.10.1 diff --git a/gnu/dist/toolchain/ld/scripttempl/elf.sc b/gnu/dist/toolchain/ld/scripttempl/elf.sc index ccc4b914093e..6c4741b3c558 100644 --- a/gnu/dist/toolchain/ld/scripttempl/elf.sc +++ b/gnu/dist/toolchain/ld/scripttempl/elf.sc @@ -234,7 +234,7 @@ SECTIONS ${CONSTRUCTING+SORT(CONSTRUCTORS)} } .data1 ${RELOCATING-0} : { *(.data1) } - .eh_frame : { *(.eh_frame) } + .eh_frame : { KEEP (*(.eh_frame)) } .gcc_except_table : { *(.gcc_except_table) } ${WRITABLE_RODATA+${RODATA}} ${RELOCATING+${OTHER_READWRITE_SECTIONS}} @@ -242,7 +242,7 @@ SECTIONS ${RELOCATING+${DTOR}} ${DATA_PLT+${PLT}} ${RELOCATING+${OTHER_GOT_SYMBOLS}} - .got ${RELOCATING-0} : { *(.got.plt) *(.got) } + .got ${RELOCATING-0} : { *(.got.plt) *(.got) } ${TEXT_DYNAMIC-${DYNAMIC}} /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so diff --git a/gnu/dist/toolchain/ld/scripttempl/elfd30v.sc b/gnu/dist/toolchain/ld/scripttempl/elfd30v.sc index 0ff928345be2..f33f90ce14b1 100644 --- a/gnu/dist/toolchain/ld/scripttempl/elfd30v.sc +++ b/gnu/dist/toolchain/ld/scripttempl/elfd30v.sc @@ -121,7 +121,8 @@ SECTIONS .rodata ${RELOCATING-0} : { *(.rodata) } ${RELOCATING+ > ${DATA_MEMORY}} /* C++ exception support. */ - .eh_frame ${RELOCATING-0} : { *(.eh_frame) } ${RELOCATING+ > ${DATA_MEMORY}} + .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) } ${RELOCATING+ > ${DATA_MEMORY}} + .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } ${RELOCATING+ > ${DATA_MEMORY}} ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} @@ -213,7 +214,3 @@ SECTIONS PROVIDE (__stack = ${STACK_START_ADDR}); } EOF - - - - diff --git a/gnu/dist/toolchain/ld/testsuite/ChangeLog b/gnu/dist/toolchain/ld/testsuite/ChangeLog index 8b4c8703220d..d350d66dec8e 100644 --- a/gnu/dist/toolchain/ld/testsuite/ChangeLog +++ b/gnu/dist/toolchain/ld/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2000-11-06 Alan Modra + + * ld-elfvsb/main.c (PROTECTED_CHECK): Include stdio.h. + (main): Prune unused args. + +2000-10-17 Philip Blundell + + * lib/ld-lib.exp, ld-elfvsb: Update from trunk version. + 2000-04-12 Alan Modra * ld-selective/selective.exp (test4): Delete incorrect foo__1B test. diff --git a/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elf-offset.ld b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elf-offset.ld new file mode 100644 index 000000000000..dfe429309a74 --- /dev/null +++ b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elf-offset.ld @@ -0,0 +1,168 @@ +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0x100000; + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : { KEEP (*(.init)) } + .plt : { *(.plt) } + .text : + { + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } + _etext = .; + PROVIDE (etext = .); + .fini : { KEEP (*(.fini)) } =0x9090 + .rodata : + { + *(.rodata) + *(.rodata.*) + *(.gnu.linkonce.r*) + } + .rodata1 : { *(.rodata1) } + /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ + . = ALIGN(0x1000) + (. & (0x1000 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : { *(.sdata) *(.sdata.*) } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : { *(.sbss) *(.scommon) } + .bss : + { + *(.dynbss) + *(.bss) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + } + . = ALIGN(32 / 8); + _end = . ; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} diff --git a/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elfvsb.dat b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elfvsb.dat new file mode 100644 index 000000000000..e94a178e14bf --- /dev/null +++ b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elfvsb.dat @@ -0,0 +1,22 @@ +mainvar == 1 +overriddenvar == 2 +shlibvar1 == 3 +shlib_mainvar () == 1 +shlib_overriddenvar () == 2 +shlib_shlibvar1 () == 3 +shlib_shlibvar2 () == 4 +shlib_shlibcall () == 5 +shlib_shlibcall2 () == 8 +shlib_maincall () == 6 +main_called () == 6 +shlib_checkfunptr1 (shlib_shlibvar1) == 1 +shlib_checkfunptr2 (main_called) == 1 +shlib_getfunptr1 () == shlib_shlibvar1 +shlib_getfunptr2 () == main_called +shlib_check () == 1 +visibility_check () == 1 +visibility_checkfunptr () == 1 +main_visibility_check () == 1 +visibility_checkvar () == 1 +visibility_checkvarptr () == 1 +main_visibility_checkvar () == 1 diff --git a/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elfvsb.exp b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elfvsb.exp new file mode 100644 index 000000000000..b563c3487dd5 --- /dev/null +++ b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/elfvsb.exp @@ -0,0 +1,359 @@ +# Expect script for ld-visibility tests +# Copyright (C) 2000 Free Software Foundation +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Written by Ian Lance Taylor (ian@cygnus.com) +# and H.J. Lu (hjl@gnu.org) +# + +# Make sure that ld can generate ELF shared libraries with visibility. + +# This test can only be run if ld generates native executables. +if ![isnative] then {return} + +# This test can only be run on a couple of ELF platforms. +# Square bracket expressions seem to confuse istarget. +if { ![istarget i386-*-linux*] \ + && ![istarget i486-*-linux*] \ + && ![istarget i586-*-linux*] \ + && ![istarget i686-*-linux*] \ + && ![istarget m68k-*-linux*] \ + && ![istarget powerpc-*-linux*] \ + && ![istarget sparc*-*-linux*] } { + return +} + +if { [istarget *-*-linux*aout*] \ + || [istarget *-*-linux*oldld*] } { + return +} + +set tmpdir tmpdir +set SHCFLAG "" + +if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + + # AIX shared libraries do not seem to support useful features, + # like overriding the shared library function or letting the + # shared library refer to objects defined in the main program. We + # avoid testing those features. + set SHCFLAG "-DXCOFF_TEST" + + # The AIX 3.2.5 loader appears to randomly fail when loading + # shared libraries from NSF mounted partitions, so we avoid any + # potential problems by using a local directory. + catch {exec /bin/sh -c "echo $$"} pid + set tmpdir /usr/tmp/ld.$pid + catch "exec mkdir $tmpdir" exec_status + + # On AIX, we need to explicitly export the symbols the shared + # library is going to provide, and need. + set file [open $tmpdir/xcoff.exp w] + puts $file shlibvar1 + puts $file shlibvar2 + puts $file shlib_shlibvar1 + puts $file shlib_shlibvar2 + puts $file shlib_shlibcall + puts $file shlib_shlibcalled + puts $file shlib_checkfunptr1 + puts $file shlib_getfunptr1 + puts $file shlib_check + close $file +} + +set support_protected "no" + +if [istarget *-*-linux*] { + if [ld_compile "$CC -g $CFLAGS -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] { + if [ld_link $ld $tmpdir/main "$tmpdir/main.o"] { + catch "exec $tmpdir/main" support_protected + } + } +} + +# The test procedure. +proc visibility_test { visibility progname testname main sh1 sh2 dat args } { + global ld + global srcdir + global subdir + global exec_output + global link_output + global host_triplet + global tmpdir + + if [llength $args] { set shldflags [lindex $args 0] } else { set shldflags "" } + + # Build the shared library. + # On AIX, we need to use an export file. + set shared -shared + if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + set shared "-bM:SRE -bE:$tmpdir/xcoff.exp" + } + if {![ld_simple_link $ld $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} { + if { [ string match $visibility "hidden_undef" ] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { if { [ string match $visibility "protected_undef" ] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { + fail "$testname" + }} + return + } + + # Link against the shared library. Use -rpath so that the + # dynamic linker can locate the shared library at runtime. + # On AIX, we must include /lib in -rpath, as otherwise the loader + # can not find -lc. + set rpath $tmpdir + if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + set rpath /lib:$tmpdir + } + if ![ld_link $ld $tmpdir/$progname "-rpath $rpath $tmpdir/$main $tmpdir/$progname.so"] { + if { [ string match $visibility "hidden" ] + && [regexp ".*/main.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/main.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { if { [ string match $visibility "hidden_undef_def" ] + && [regexp ".*/main.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/main.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { + fail "$testname" + }} + return + } + + if { [ string match $visibility "hidden" ] + || [ string match $visibility "hidden_undef" ] + || [ string match $visibility "protected_undef" ] } { + fail "$testname" + } + + # Run the resulting program + send_log "$tmpdir/$progname >$tmpdir/$progname.out\n" + verbose "$tmpdir/$progname >$tmpdir/$progname.out" + catch "exec $tmpdir/$progname >$tmpdir/$progname.out" exec_output + if ![string match "" $exec_output] then { + send_log "$exec_output\n" + verbose "$exec_output" + fail "$testname" + return + } + + send_log "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat\n" + verbose "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat" + catch "exec diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat" exec_output + set exec_output [prune_warnings $exec_output] + + if {![string match "" $exec_output]} then { + send_log "$exec_output\n" + verbose "$exec_output" + fail "$testname" + return + } + + pass "$testname" +} + +proc visibility_run {visibility} { + global CC + global CFLAGS + global SHCFLAG + global srcdir + global subdir + global tmpdir + global picflag + global target_triplet + global support_protected + + if [ string match $visibility "hidden" ] { + set VSBCFLAG "-DHIDDEN_TEST" + } else { if [ string match $visibility "hidden_normal" ] { + set VSBCFLAG "-DHIDDEN_NORMAL_TEST" + } else { if [ string match $visibility "hidden_undef" ] { + set VSBCFLAG "-DHIDDEN_UNDEF_TEST" + } else { if [ string match $visibility "hidden_undef_def" ] { + set VSBCFLAG "-DHIDDEN_UNDEF_TEST -DDSO_DEFINE_TEST" + } else { if [ string match $visibility "hidden_weak" ] { + set VSBCFLAG "-DHIDDEN_WEAK_TEST" + } else { if [ string match $visibility "protected" ] { + set VSBCFLAG "-DPROTECTED_TEST" + } else { if [ string match $visibility "protected_undef" ] { + set VSBCFLAG "-DPROTECTED_UNDEF_TEST" + } else { if [ string match $visibility "protected_undef_def" ] { + set VSBCFLAG "-DPROTECTED_UNDEF_TEST -DDSO_DEFINE_TEST" + } else { if [ string match $visibility "protected_weak" ] { + set VSBCFLAG "-DPROTECTED_WEAK_TEST" + } else { + set VSBCFLAG "" + }}}}}}}}} + + # Compile the main program. + if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] { + unresolved "visibility ($visibility) (non PIC)" + unresolved "visibility ($visibility)" + } else { + # The shared library is composed of two files. First compile them + # without using -fpic. That should work on an ELF system, + # although it will be less efficient because the dynamic linker + # will need to do more relocation work. However, note that not + # using -fpic will cause some of the tests to return different + # results. + if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o] + || ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } { + unresolved "visibility ($visibility) (non PIC)" + } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + visibility_test $visibility vnp "visibility ($visibility) (nonPIC)" mainnp.o sh1np.o sh2np.o xcoff + } else { + # SunOS non PIC shared libraries don't permit some cases of + # overriding. + if { [ string match $visibility "protected" ] + || [ string match $visibility "protected_undef_def" ] } { + if [ string match $support_protected "no" ] { + setup_xfail $target_triplet + } + } else { + setup_xfail "*-*-sunos4*" + } + visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o elfvsb + + # Test ELF shared library relocations with a non-zero load + # address for the library. Near as I can tell, the R_*_RELATIVE + # relocations for various targets are broken in the case where + # the load address is not zero (which is the default). + if { [ string match $visibility "protected" ] + || [ string match $visibility "protected_undef_def" ] } { + if [ string match $support_protected "no" ] { + setup_xfail $target_triplet + } + } else { + setup_xfail "*-*-sunos4*" + setup_xfail "*-*-linux*libc1" + } + visibility_test $visibility vnp "visibility ($visibility) (non PIC, load offset)" \ + mainnp.o sh1np.o sh2np.o elfvsb \ + "-T $srcdir/$subdir/elf-offset.ld" + } } + + # Now compile the code using -fpic. + + if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o] + || ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } { + unresolved "visibility ($visibility)" + } else { + if { [ string match $visibility "protected" ] + || [ string match $visibility "protected_undef_def" ] } { + if [ string match $support_protected "no" ] { + setup_xfail $target_triplet + } + } + # SunOS can not compare function pointers correctly + if [istarget "*-*-sunos4*"] { + visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o sun4 + } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o xcoff + } else { + visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb + } } + } + } + + # Now do the same tests again, but this time compile main.c PIC. + if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG $picflag" $srcdir/$subdir/main.c $tmpdir/mainp.o] { + unresolved "visibility ($visibility) (PIC main, non PIC so)" + unresolved "visibility ($visibility) (PIC main)" + } else { + if { [file exists $tmpdir/sh1np.o ] && [ file exists $tmpdir/sh2np.o ] } { + if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o xcoff + } else { + # SunOS non PIC shared libraries don't permit some cases of + # overriding. + if { [ string match $visibility "protected" ] + || [ string match $visibility "protected_undef_def" ] } { + if [ string match $support_protected "no" ] { + setup_xfail $target_triplet + } + } else { + setup_xfail "*-*-sunos4*" + } + visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o elfvsb + } + } else { + unresolved "visibility (PIC main, non PIC so)" + } + + if { [file exists $tmpdir/sh1p.o ] && [ file exists $tmpdir/sh2p.o ] } { + if { [ string match $visibility "protected" ] + || [ string match $visibility "protected_undef_def" ] } { + if [ string match $support_protected "no" ] { + setup_xfail $target_triplet + } + } + if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o xcoff + } else { + visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o elfvsb + } + } else { + unresolved "visibility ($visibility) (PIC main)" + } + } +} + +if [istarget mips*-*-*] { + set picflag "" +} else { + # Unfortunately, the gcc argument is -fpic and the cc argument is + # -KPIC. We have to try both. + set picflag "-fpic" + send_log "$CC $picflag\n" + verbose "$CC $picflag" + catch "exec $CC $picflag" exec_output + send_log "$exec_output\n" + verbose "--" "$exec_output" + if { [string match "*illegal option*" $exec_output] \ + || [string match "*option ignored*" $exec_output] \ + || [string match "*unrecognized option*" $exec_output] \ + || [string match "*passed to ld*" $exec_output] } { + if [istarget *-*-sunos4*] { + set picflag "-pic" + } else { + set picflag "-KPIC" + } + } +} +verbose "Using $picflag to compile PIC code" + +visibility_run hidden +visibility_run hidden_normal +visibility_run hidden_undef +visibility_run hidden_undef_def +visibility_run hidden_weak +visibility_run protected +visibility_run protected_undef +visibility_run protected_undef_def +visibility_run protected_weak +visibility_run normal + +if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + # Remove the temporary directory. + catch "exec rm -rf $tmpdir" exec_status +} diff --git a/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/main.c b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/main.c new file mode 100644 index 000000000000..26542b8a1fcf --- /dev/null +++ b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/main.c @@ -0,0 +1,178 @@ +#ifdef PROTECTED_CHECK +#include +#include + +int +main (void) +{ +#if defined (__GLIBC__) && (__GLIBC__ > 2 \ + || (__GLIBC__ == 2 \ + && __GLIBC_MINOR__ >= 2)) + puts ("yes"); +#else + puts ("no"); +#endif + return 0; +} +#else +/* This is the main program for the shared library test. */ + +#include + +int mainvar = 1; +int overriddenvar = 2; +extern int shlibvar1; + +extern int shlib_mainvar (); +extern int shlib_overriddenvar (); +extern int shlib_shlibvar1 (); +extern int shlib_shlibvar2 (); +extern int shlib_shlibcall (); +extern int shlib_maincall (); +extern int shlib_checkfunptr1 (); +extern int shlib_checkfunptr2 (); +extern int (*shlib_getfunptr1 ()) (); +extern int (*shlib_getfunptr2 ()) (); +extern int shlib_check (); +extern int shlib_shlibcall2 (); +extern int visibility_check (); +extern int visibility_checkfunptr (); +extern void *visibility_funptr (); +extern int visibility_checkvar (); +extern int visibility_checkvarptr (); +extern int visibility_varval (); +extern void *visibility_varptr (); + +#ifdef HIDDEN_WEAK_TEST +#define WEAK_TEST +#endif + +#ifdef PROTECTED_WEAK_TEST +#define WEAK_TEST +#endif + +#ifdef PROTECTED_UNDEF_TEST +#define PROTECTED_TEST +#endif + +#ifndef WEAK_TEST +extern int visibility (); +extern int visibility_var; +#endif + +#if !defined (HIDDEN_TEST) && defined (PROTECTED_TEST) +int +visibility () +{ + return 1; +} + +static int +main_visibility_check () +{ + return visibility_funptr () != visibility; +} + +int visibility_var = 1; + +static int +main_visibility_checkvar () +{ + return visibility_varval () != visibility_var + && visibility_varptr () != &visibility_var; +} +#else +static int +main_visibility_check () +{ +#ifdef WEAK_TEST + return visibility_funptr () == NULL; +#else + return visibility_funptr () == visibility; +#endif +} + +static int +main_visibility_checkvar () +{ +#ifdef WEAK_TEST + return visibility_varval () == 0 + && visibility_varptr () == NULL; +#else + return visibility_varval () == visibility_var + && visibility_varptr () == &visibility_var; +#endif +} +#endif + +/* This function is called by the shared library. */ + +int +main_called () +{ + return 6; +} + +/* This function overrides a function in the shared library. */ + +int +shlib_overriddencall2 () +{ + return 8; +} + +int +main () +{ + int (*p) (); + + printf ("mainvar == %d\n", mainvar); + printf ("overriddenvar == %d\n", overriddenvar); + printf ("shlibvar1 == %d\n", shlibvar1); +#ifndef XCOFF_TEST + printf ("shlib_mainvar () == %d\n", shlib_mainvar ()); + printf ("shlib_overriddenvar () == %d\n", shlib_overriddenvar ()); +#endif + printf ("shlib_shlibvar1 () == %d\n", shlib_shlibvar1 ()); + printf ("shlib_shlibvar2 () == %d\n", shlib_shlibvar2 ()); + printf ("shlib_shlibcall () == %d\n", shlib_shlibcall ()); +#ifndef XCOFF_TEST + printf ("shlib_shlibcall2 () == %d\n", shlib_shlibcall2 ()); + printf ("shlib_maincall () == %d\n", shlib_maincall ()); +#endif + printf ("main_called () == %d\n", main_called ()); + printf ("shlib_checkfunptr1 (shlib_shlibvar1) == %d\n", + shlib_checkfunptr1 (shlib_shlibvar1)); +#ifndef XCOFF_TEST + printf ("shlib_checkfunptr2 (main_called) == %d\n", + shlib_checkfunptr2 (main_called)); +#endif + p = shlib_getfunptr1 (); + printf ("shlib_getfunptr1 () "); + if (p == shlib_shlibvar1) + printf ("=="); + else + printf ("!="); + printf (" shlib_shlibvar1\n"); +#ifndef XCOFF_TEST + p = shlib_getfunptr2 (); + printf ("shlib_getfunptr2 () "); + if (p == main_called) + printf ("=="); + else + printf ("!="); + printf (" main_called\n"); +#endif + printf ("shlib_check () == %d\n", shlib_check ()); + printf ("visibility_check () == %d\n", visibility_check ()); + printf ("visibility_checkfunptr () == %d\n", + visibility_checkfunptr ()); + printf ("main_visibility_check () == %d\n", main_visibility_check ()); + printf ("visibility_checkvar () == %d\n", visibility_checkvar ()); + printf ("visibility_checkvarptr () == %d\n", + visibility_checkvarptr ()); + printf ("main_visibility_checkvar () == %d\n", + main_visibility_checkvar ()); + return 0; +} +#endif diff --git a/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/sh1.c b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/sh1.c new file mode 100644 index 000000000000..2299f83bdc36 --- /dev/null +++ b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/sh1.c @@ -0,0 +1,324 @@ +#ifndef NULL +#define NULL ((void *) 0) +#endif + +/* This is part of the shared library ld test. This file becomes part + of a shared library. */ + +/* This variable is supplied by the main program. */ +#ifndef XCOFF_TEST +extern int mainvar; +#endif + +/* This variable is defined in the shared library, and overridden by + the main program. */ +#ifndef XCOFF_TEST +int overriddenvar = -1; +#endif + +/* This variable is defined in the shared library. */ +int shlibvar1 = 3; + +/* This variable is defined by another object in the shared library. */ +extern int shlibvar2; + +/* These functions return the values of the above variables as seen in + the shared library. */ + +#ifndef XCOFF_TEST +int +shlib_mainvar () +{ + return mainvar; +} +#endif + +#ifndef XCOFF_TEST +int +shlib_overriddenvar () +{ + return overriddenvar; +} +#endif + +int +shlib_shlibvar1 () +{ + return shlibvar1; +} + +int +shlib_shlibvar2 () +{ + return shlibvar2; +} + +/* This function calls a function defined by another object in the + shared library. */ + +extern int shlib_shlibcalled (); + +int +shlib_shlibcall () +{ + return shlib_shlibcalled (); +} + +#ifndef XCOFF_TEST +/* This function calls a function defined in this object in the shared + library. The main program will override the called function. */ + +extern int shlib_overriddencall2 (); + +int +shlib_shlibcall2 () +{ + return shlib_overriddencall2 (); +} + +int +shlib_overriddencall2 () +{ + return 7; +} +#endif + +/* This function calls a function defined by the main program. */ + +#ifndef XCOFF_TEST +extern int main_called (); + +int +shlib_maincall () +{ + return main_called (); +} +#endif + +/* This function is passed a function pointer to shlib_mainvar. It + confirms that the pointer compares equally. */ + +int +shlib_checkfunptr1 (p) + int (*p) (); +{ + return p == shlib_shlibvar1; +} + +/* This function is passed a function pointer to main_called. It + confirms that the pointer compares equally. */ + +#ifndef XCOFF_TEST +int +shlib_checkfunptr2 (p) + int (*p) (); +{ + return p == main_called; +} +#endif + +/* This function returns a pointer to shlib_mainvar. */ + +int +(*shlib_getfunptr1 ()) () +{ + return shlib_shlibvar1; +} + +/* This function returns a pointer to main_called. */ + +#ifndef XCOFF_TEST +int +(*shlib_getfunptr2 ()) () +{ + return main_called; +} +#endif + +/* This function makes sure that constant data and local functions + work. */ + +#ifndef __STDC__ +#define const +#endif + +static int i = 6; +static const char *str = "Hello, world\n"; + +int +shlib_check () +{ + const char *s1, *s2; + + if (i != 6) + return 0; + + /* To isolate the test, don't rely on any external functions, such + as strcmp. */ + s1 = "Hello, world\n"; + s2 = str; + while (*s1 != '\0') + if (*s1++ != *s2++) + return 0; + if (*s2 != '\0') + return 0; + + if (shlib_shlibvar1 () != 3) + return 0; + + return 1; +} + +#ifdef HIDDEN_WEAK_TEST +#define HIDDEN_UNDEF_TEST +#define WEAK_TEST +#endif + +#ifdef PROTECTED_WEAK_TEST +#define PROTECTED_UNDEF_TEST +#define WEAK_TEST +#endif + +#if defined (HIDDEN_UNDEF_TEST) || defined (PROTECTED_UNDEF_TEST) +extern int visibility (); +#else +int +visibility () +{ + return 2; +} +#endif + +#ifdef HIDDEN_NORMAL_TEST +asm (".hidden visibility_normal"); + +int +visibility_normal () +{ + return 2; +} +#endif + +int +visibility_checkfunptr () +{ +#ifdef WEAK_TEST + return 1; +#else +#ifdef HIDDEN_NORMAL_TEST + int (*v) () = visibility_normal; +#else + int (*v) () = visibility; +#endif + return (*v) () == 2; +#endif +} + +int +visibility_check () +{ +#ifdef WEAK_TEST + if (&visibility) + return visibility () == 1; + else + return 1; +#else +#ifdef HIDDEN_NORMAL_TEST + return visibility_normal () == 2; +#else + return visibility () == 2; +#endif +#endif +} + +void * +visibility_funptr () +{ +#ifdef WEAK_TEST + if (&visibility == NULL) + return NULL; + else +#endif + return visibility; +} + +#if defined (HIDDEN_UNDEF_TEST) || defined (PROTECTED_UNDEF_TEST) +extern int visibility_var; +#else +int visibility_var = 2; +#endif + +#ifdef HIDDEN_NORMAL_TEST +asm (".hidden visibility_var_normal"); + +int visibility_var_normal = 2; +#endif + +int +visibility_checkvarptr () +{ +#ifdef WEAK_TEST + if (&visibility_var) + return visibility_var == 1; + else + return 1; +#else +#ifdef HIDDEN_NORMAL_TEST + int *v = &visibility_var_normal; +#else + int *v = &visibility_var; +#endif + return *v == 2; +#endif +} + +int +visibility_checkvar () +{ +#ifdef WEAK_TEST + return 1; +#else +#ifdef HIDDEN_NORMAL_TEST + return visibility_var_normal == 2; +#else + return visibility_var == 2; +#endif +#endif +} + +void * +visibility_varptr () +{ +#ifdef WEAK_TEST + if (&visibility_var == NULL) + return NULL; + else +#endif + return &visibility_var; +} + +int +visibility_varval () +{ +#ifdef WEAK_TEST + if (&visibility_var == NULL) + return 0; + else +#endif + return visibility_var; +} + +#if defined (HIDDEN_TEST) || defined (HIDDEN_UNDEF_TEST) +asm (".hidden visibility"); +asm (".hidden visibility_var"); +#else +#if defined (PROTECTED_TEST) || defined (PROTECTED_UNDEF_TEST) || defined (PROTECTED_WEAK_TEST) +asm (".protected visibility"); +asm (".protected visibility_var"); +#endif +#endif + +#ifdef WEAK_TEST +asm (".weak visibility"); +asm (".weak visibility_var"); +#endif diff --git a/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/sh2.c b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/sh2.c new file mode 100644 index 000000000000..6ed30bc52e1f --- /dev/null +++ b/gnu/dist/toolchain/ld/testsuite/ld-elfvsb/sh2.c @@ -0,0 +1,24 @@ +/* This is part of the shared library ld test. This file becomes part + of a shared library. */ + +/* This variable is defined here, and referenced by another file in + the shared library. */ +int shlibvar2 = 4; + +/* This function is called by another file in the shared library. */ + +int +shlib_shlibcalled () +{ + return 5; +} + +#ifdef DSO_DEFINE_TEST +int +visibility () +{ + return 2; +} + +int visibility_var = 2; +#endif diff --git a/gnu/dist/toolchain/ld/testsuite/lib/ld-lib.exp b/gnu/dist/toolchain/ld/testsuite/lib/ld-lib.exp index 1c912578c57f..11185d825fd8 100644 --- a/gnu/dist/toolchain/ld/testsuite/lib/ld-lib.exp +++ b/gnu/dist/toolchain/ld/testsuite/lib/ld-lib.exp @@ -85,6 +85,7 @@ proc default_ld_link { ld target objects } { global HOSTING_LIBS global LIBS global host_triplet + global link_output set objs "$HOSTING_CRT0 $objects" set libs "$LIBS $HOSTING_LIBS" @@ -98,12 +99,12 @@ proc default_ld_link { ld target objects } { verbose -log "$ld $HOSTING_EMU $flags -o $target $objs $libs" - catch "exec $ld $HOSTING_EMU $flags -o $target $objs $libs" exec_output - set exec_output [prune_warnings $exec_output] - if [string match "" $exec_output] then { + catch "exec $ld $HOSTING_EMU $flags -o $target $objs $libs" link_output + set exec_output [prune_warnings $link_output] + if [string match "" $link_output] then { return 1 } else { - verbose -log "$exec_output" + verbose -log "$link_output" return 0 } } @@ -114,7 +115,8 @@ proc default_ld_link { ld target objects } { # proc default_ld_simple_link { ld target objects } { global host_triplet - + global link_output + if { [which $ld] == 0 } then { perror "$ld does not exist" return 0 @@ -124,8 +126,8 @@ proc default_ld_simple_link { ld target objects } { verbose -log "$ld $flags -o $target $objects" - catch "exec $ld $flags -o $target $objects" exec_output - set exec_output [prune_warnings $exec_output] + catch "exec $ld $flags -o $target $objects" link_output + set exec_output [prune_warnings $link_output] # We don't care if we get a warning about a non-existent start # symbol, since the default linker script might use ENTRY. diff --git a/gnu/dist/toolchain/libiberty/ChangeLog b/gnu/dist/toolchain/libiberty/ChangeLog index c858409d301e..dbd616b1a206 100644 --- a/gnu/dist/toolchain/libiberty/ChangeLog +++ b/gnu/dist/toolchain/libiberty/ChangeLog @@ -1,3 +1,16 @@ +2000-10-17 Philip Blundell + + * cp-demangle.c, dyn-string.c, cplus-dem.c: Update from trunk + version. + * testsuite/demangle-expected, testsuite/regress-demangle: + Likewise. + + From 2000-06-04 Alex Samuel + * Makefile.in (CFILES): Add cp-demangle.c and dyn-string.c. + (REQUIRED_OFILES): Add cp-demangle.o and dyn-string.o. + (cp-demangle.o): New dependency. + (dyn-string.o): Likewise. + Thu Mar 16 01:33:58 2000 Jeffrey A Law (law@cygnus.com) * Makefile.in (partition.o): Depend on config.h diff --git a/gnu/dist/toolchain/libiberty/Makefile.in b/gnu/dist/toolchain/libiberty/Makefile.in index 9aa57f06d4bf..5858a5072c0a 100644 --- a/gnu/dist/toolchain/libiberty/Makefile.in +++ b/gnu/dist/toolchain/libiberty/Makefile.in @@ -1,6 +1,6 @@ # # Makefile -# Copyright (C) 1990, 91 - 99, 2000 +# Copyright (C) 1990, 91, 00 - 99, 2000 # Free Software Foundation # # This file is part of the libiberty library. @@ -124,7 +124,8 @@ HFILES = alloca-conf.h # (alphabetical), and add them to REQUIRED_OFILES or funcs in # configure.in. CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \ - bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c fdmatch.c \ + bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c \ + cp-demangle.c dyn-string.c fdmatch.c \ fnmatch.c getcwd.c getpwd.c getopt.c getopt1.c getpagesize.c \ getruntime.c floatformat.c hashtab.c hex.c index.c insque.c memchr.c \ memcmp.c memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \ @@ -136,10 +137,10 @@ CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \ xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c # These are always included in the library. -REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o \ - fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o \ - hex.o floatformat.o objalloc.o obstack.o partition.o pexecute.o spaces.o \ - splay-tree.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o \ +REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o cp-demangle.o \ + dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o getruntime.o \ + hashtab.o hex.o floatformat.o objalloc.o obstack.o partition.o pexecute.o \ + spaces.o splay-tree.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o \ xmemdup.o xstrdup.o xstrerror.o $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA) @@ -259,6 +260,8 @@ choose-temp.o: config.h clock.o: config.h concat.o: $(INCDIR)/libiberty.h cplus-dem.o: config.h $(INCDIR)/demangle.h +cp-demangle.o: config.h $(INCDIR)/dyn-string.h $(INCDIR)/demangle.h +dyn-string.o: config.h $(INCDIR)/dyn-string.h fdmatch.o: $(INCDIR)/libiberty.h fnmatch.o: config.h $(INCDIR)/fnmatch.h getcwd.o: config.h diff --git a/gnu/dist/toolchain/libiberty/cp-demangle.c b/gnu/dist/toolchain/libiberty/cp-demangle.c new file mode 100644 index 000000000000..1eb24027e513 --- /dev/null +++ b/gnu/dist/toolchain/libiberty/cp-demangle.c @@ -0,0 +1,3409 @@ +/* Demangler for IA64 / g++ standard C++ ABI. + Copyright (C) 2000 CodeSourcery LLC. + Written by Alex Samuel . + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* This file implements demangling of C++ names mangled according to + the IA64 / g++ standard C++ ABI. Use the cp_demangle function to + demangle a mangled name, or compile with the preprocessor macro + STANDALONE_DEMANGLER defined to create a demangling filter + executable. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#ifdef HAVE_STDLIB_H +#include +#endif + +#include + +#ifdef HAVE_STRING_H +#include +#endif + +#include "ansidecl.h" +#include "libiberty.h" +#include "dyn-string.h" +#include "demangle.h" + +/* If CP_DEMANGLE_DEBUG is defined, a trace of the grammar evaluation, + and other debugging output, will be generated. */ +#ifdef CP_DEMANGLE_DEBUG +#define DEMANGLE_TRACE(PRODUCTION, DM) \ + fprintf (stderr, " -> %-24s at position %3d\n", \ + (PRODUCTION), current_position (DM)); +#else +#define DEMANGLE_TRACE(PRODUCTION, DM) +#endif + +/* Don't include , to prevent additional unresolved symbols + from being dragged into the C++ runtime library. */ +#define IS_DIGIT(CHAR) ((CHAR) >= '0' && (CHAR) <= '9') +#define IS_ALPHA(CHAR) \ + (((CHAR) >= 'a' && (CHAR) <= 'z') \ + || ((CHAR) >= 'A' && (CHAR) <= 'Z')) + +/* If flag_verbose is zero, some simplifications will be made to the + output to make it easier to read and supress details that are + generally not of interest to the average C++ programmer. + Otherwise, the demangled representation will attempt to convey as + much information as the mangled form. */ +static int flag_verbose; + +/* If flag_strict is non-zero, demangle strictly according to the + specification -- don't demangle special g++ manglings. */ +static int flag_strict; + +/* String_list_t is an extended form of dyn_string_t which provides a link + field. A string_list_t may safely be cast to and used as a + dyn_string_t. */ + +struct string_list_def +{ + struct dyn_string string; + struct string_list_def *next; +}; + +typedef struct string_list_def *string_list_t; + +/* Data structure representing a potential substitution. */ + +struct substitution_def +{ + /* The demangled text of the substitution. */ + dyn_string_t text; + + /* The template parameter that this represents, indexed from zero. + If this is not a template paramter number, the value is + NOT_TEMPLATE_PARM. */ + int template_parm_number; + + /* Whether this substitution represents a template item. */ + int template_p : 1; +}; + +#define NOT_TEMPLATE_PARM (-1) + +/* Data structure representing a template argument list. */ + +struct template_arg_list_def +{ + /* The next (lower) template argument list in the stack of currently + active template arguments. */ + struct template_arg_list_def *next; + + /* The first element in the list of template arguments in + left-to-right order. */ + string_list_t first_argument; + + /* The last element in the arguments lists. */ + string_list_t last_argument; +}; + +typedef struct template_arg_list_def *template_arg_list_t; + +/* Data structure to maintain the state of the current demangling. */ + +struct demangling_def +{ + /* The full mangled name being mangled. */ + const char *name; + + /* Pointer into name at the current position. */ + const char *next; + + /* Stack for strings containing demangled result generated so far. + Text is emitted to the topmost (first) string. */ + string_list_t result; + + /* The number of presently available substitutions. */ + int num_substitutions; + + /* The allocated size of the substitutions array. */ + int substitutions_allocated; + + /* An array of available substitutions. The number of elements in + the array is given by num_substitions, and the allocated array + size in substitutions_size. + + The most recent substition is at the end, so + + - `S_' corresponds to substititutions[num_substitutions - 1] + - `S0_' corresponds to substititutions[num_substitutions - 2] + + etc. */ + struct substitution_def *substitutions; + + /* The stack of template argument lists. */ + template_arg_list_t template_arg_lists; + + /* The most recently demangled source-name. */ + dyn_string_t last_source_name; +}; + +typedef struct demangling_def *demangling_t; + +/* This type is the standard return code from most functions. Values + other than STATUS_OK contain descriptive messages. */ +typedef const char *status_t; + +/* Special values that can be used as a status_t. */ +#define STATUS_OK NULL +#define STATUS_ERROR "Error." +#define STATUS_UNIMPLEMENTED "Unimplemented." +#define STATUS_INTERNAL_ERROR "Internal error." + +/* This status code indicates a failure in malloc or realloc. */ +static const char* const status_allocation_failed = "Allocation failed."; +#define STATUS_ALLOCATION_FAILED status_allocation_failed + +/* Non-zero if STATUS indicates that no error has occurred. */ +#define STATUS_NO_ERROR(STATUS) ((STATUS) == STATUS_OK) + +/* Evaluate EXPR, which must produce a status_t. If the status code + indicates an error, return from the current function with that + status code. */ +#define RETURN_IF_ERROR(EXPR) \ + do \ + { \ + status_t s = EXPR; \ + if (!STATUS_NO_ERROR (s)) \ + return s; \ + } \ + while (0) + +static status_t int_to_dyn_string + PARAMS ((int, dyn_string_t)); +static string_list_t string_list_new + PARAMS ((int)); +static void string_list_delete + PARAMS ((string_list_t)); +static status_t result_close_template_list + PARAMS ((demangling_t)); +static status_t result_push + PARAMS ((demangling_t)); +static string_list_t result_pop + PARAMS ((demangling_t)); +static int substitution_start + PARAMS ((demangling_t)); +static status_t substitution_add + PARAMS ((demangling_t, int, int, int)); +static dyn_string_t substitution_get + PARAMS ((demangling_t, int, int *)); +#ifdef CP_DEMANGLE_DEBUG +static void substitutions_print + PARAMS ((demangling_t, FILE *)); +#endif +static template_arg_list_t template_arg_list_new + PARAMS ((void)); +static void template_arg_list_delete + PARAMS ((template_arg_list_t)); +static void template_arg_list_add_arg + PARAMS ((template_arg_list_t, string_list_t)); +static string_list_t template_arg_list_get_arg + PARAMS ((template_arg_list_t, int)); +static void push_template_arg_list + PARAMS ((demangling_t, template_arg_list_t)); +static void pop_to_template_arg_list + PARAMS ((demangling_t, template_arg_list_t)); +#ifdef CP_DEMANGLE_DEBUG +static void template_arg_list_print + PARAMS ((template_arg_list_t, FILE *)); +#endif +static template_arg_list_t current_template_arg_list + PARAMS ((demangling_t)); +static demangling_t demangling_new + PARAMS ((const char *)); +static void demangling_delete + PARAMS ((demangling_t)); + +/* The last character of DS. Warning: DS is evaluated twice. */ +#define dyn_string_last_char(DS) \ + (dyn_string_buf (DS)[dyn_string_length (DS) - 1]) + +/* Append a space character (` ') to DS if it does not already end + with one. Evaluates to 1 on success, or 0 on allocation failure. */ +#define dyn_string_append_space(DS) \ + ((dyn_string_length (DS) > 0 \ + && dyn_string_last_char (DS) != ' ') \ + ? dyn_string_append_char ((DS), ' ') \ + : 1) + +/* Returns the index of the current position in the mangled name. */ +#define current_position(DM) ((DM)->next - (DM)->name) + +/* Returns the character at the current position of the mangled name. */ +#define peek_char(DM) (*((DM)->next)) + +/* Returns the character one past the current position of the mangled + name. */ +#define peek_char_next(DM) \ + (peek_char (DM) == '\0' ? '\0' : (*((DM)->next + 1))) + +/* Returns the character at the current position, and advances the + current position to the next character. */ +#define next_char(DM) (*((DM)->next)++) + +/* Returns non-zero if the current position is the end of the mangled + name, i.e. one past the last character. */ +#define end_of_name_p(DM) (peek_char (DM) == '\0') + +/* Advances the current position by one character. */ +#define advance_char(DM) (++(DM)->next) + +/* Returns the string containing the current demangled result. */ +#define result_string(DM) (&(DM)->result->string) + +/* Appends a dyn_string_t to the demangled result. */ +#define result_append_string(DM, STRING) \ + (dyn_string_append (&(DM)->result->string, (STRING)) \ + ? STATUS_OK : STATUS_ALLOCATION_FAILED) + +/* Appends NUL-terminated string CSTR to the demangled result. */ +#define result_append(DM, CSTR) \ + (dyn_string_append_cstr (&(DM)->result->string, (CSTR)) \ + ? STATUS_OK : STATUS_ALLOCATION_FAILED) + +/* Appends character CHAR to the demangled result. */ +#define result_append_char(DM, CHAR) \ + (dyn_string_append_char (&(DM)->result->string, (CHAR)) \ + ? STATUS_OK : STATUS_ALLOCATION_FAILED) + +/* The length of the current demangled result. */ +#define result_length(DM) \ + dyn_string_length (&(DM)->result->string) + +/* Appends a space to the demangled result if the last character is + not a space. */ +#define result_append_space(DM) \ + (dyn_string_append_space (&(DM)->result->string) \ + ? STATUS_OK : STATUS_ALLOCATION_FAILED) + +/* Appends a base 10 representation of VALUE to DS. STATUS_OK on + success. On failure, deletes DS and returns an error code. */ + +static status_t +int_to_dyn_string (value, ds) + int value; + dyn_string_t ds; +{ + int i; + int mask = 1; + + /* Handle zero up front. */ + if (value == 0) + { + if (!dyn_string_append_char (ds, '0')) + return STATUS_ALLOCATION_FAILED; + return STATUS_OK; + } + + /* For negative numbers, emit a minus sign. */ + if (value < 0) + { + if (!dyn_string_append_char (ds, '-')) + return STATUS_ALLOCATION_FAILED; + value = -value; + } + + /* Find the power of 10 of the first digit. */ + i = value; + while (i > 9) + { + mask *= 10; + i /= 10; + } + + /* Write the digits. */ + while (mask > 0) + { + int digit = value / mask; + + if (!dyn_string_append_char (ds, '0' + digit)) + return STATUS_ALLOCATION_FAILED; + + value -= digit * mask; + mask /= 10; + } + + return STATUS_OK; +} + +/* Creates a new string list node. The contents of the string are + empty, but the initial buffer allocation is LENGTH. The string + list node should be deleted with string_list_delete. Returns NULL + if allocation fails. */ + +static string_list_t +string_list_new (length) + int length; +{ + string_list_t s = (string_list_t) malloc (sizeof (struct string_list_def)); + if (s == NULL) + return NULL; + if (!dyn_string_init ((dyn_string_t) s, length)) + return NULL; + return s; +} + +/* Deletes the entire string list starting at NODE. */ + +static void +string_list_delete (node) + string_list_t node; +{ + while (node != NULL) + { + string_list_t next = node->next; + free (node); + node = next; + } +} + +/* Appends a greater-than character to the demangled result. If the + last character is a greater-than character, a space is inserted + first, so that the two greater-than characters don't look like a + right shift token. */ + +static status_t +result_close_template_list (dm) + demangling_t dm; +{ + dyn_string_t s = &dm->result->string; + + /* Add a space if the last character is already a closing angle + bracket, so that a nested template arg list doesn't look like + it's closed with a right-shift operator. */ + if (dyn_string_last_char (s) == '>') + { + if (!dyn_string_append_char (s, ' ')) + return STATUS_ALLOCATION_FAILED; + } + + /* Add closing angle brackets. */ + if (!dyn_string_append_char (s, '>')) + return STATUS_ALLOCATION_FAILED; + + return STATUS_OK; +} + +/* Allocates and pushes a new string onto the demangled results stack + for DM. Subsequent demangling with DM will emit to the new string. + Returns STATUS_OK on success, STATUS_ALLOCATION_FAILED on + allocation failure. */ + +static status_t +result_push (dm) + demangling_t dm; +{ + string_list_t new_string = string_list_new (0); + if (new_string == NULL) + /* Allocation failed. */ + return STATUS_ALLOCATION_FAILED; + + /* Link the new string to the front of the list of result strings. */ + new_string->next = (string_list_t) dm->result; + dm->result = new_string; + return STATUS_OK; +} + +/* Removes and returns the topmost element on the demangled results + stack for DM. The caller assumes ownership for the returned + string. */ + +static string_list_t +result_pop (dm) + demangling_t dm; +{ + string_list_t top = dm->result; + dm->result = top->next; + return top; +} + +/* Returns the start position of a fragment of the demangled result + that will be a substitution candidate. Should be called at the + start of productions that can add substitutions. */ + +static int +substitution_start (dm) + demangling_t dm; +{ + return result_length (dm); +} + +/* Adds the suffix of the current demangled result of DM starting at + START_POSITION as a potential substitution. If TEMPLATE_P is + non-zero, this potential substitution is a template-id. + + If TEMPLATE_PARM_NUMBER is not NOT_TEMPLATE_PARM, the substitution + is for that particular , and is distinct from other + otherwise-identical types and other s with + different indices. */ + +static status_t +substitution_add (dm, start_position, template_p, template_parm_number) + demangling_t dm; + int start_position; + int template_p; + int template_parm_number; +{ + dyn_string_t result = result_string (dm); + dyn_string_t substitution = dyn_string_new (0); + int i; + + if (substitution == NULL) + return STATUS_ALLOCATION_FAILED; + + /* Extract the substring of the current demangling result that + represents the subsitution candidate. */ + if (!dyn_string_substring (substitution, + result, start_position, result_length (dm))) + { + dyn_string_delete (substitution); + return STATUS_ALLOCATION_FAILED; + } + + /* Check whether SUBSTITUTION already occurs. */ + for (i = 0; i < dm->num_substitutions; ++i) + if (dyn_string_eq (dm->substitutions[i].text, substitution) + && dm->substitutions[i].template_parm_number == template_parm_number) + /* Found SUBSTITUTION already present. */ + { + /* Callers expect this function to take ownership of + SUBSTITUTION, so delete it. */ + dyn_string_delete (substitution); + return STATUS_OK; + } + + /* If there's no room for the new entry, grow the array. */ + if (dm->substitutions_allocated == dm->num_substitutions) + { + size_t new_array_size; + dm->substitutions_allocated *= 2; + new_array_size = + sizeof (struct substitution_def) * dm->substitutions_allocated; + + dm->substitutions = (struct substitution_def *) + realloc (dm->substitutions, new_array_size); + if (dm->substitutions == NULL) + /* Realloc failed. */ + { + dyn_string_delete (substitution); + return STATUS_ALLOCATION_FAILED; + } + } + + /* Add the substitution to the array. */ + dm->substitutions[i].text = substitution; + dm->substitutions[i].template_p = template_p; + dm->substitutions[i].template_parm_number = template_parm_number; + ++dm->num_substitutions; + +#ifdef CP_DEMANGLE_DEBUG + substitutions_print (dm, stderr); +#endif + + return STATUS_OK; +} + +/* Returns the Nth-most-recent substitution. Sets *TEMPLATE_P to + non-zero if the substitution is a template-id, zero otherwise. + N is numbered from zero. DM retains ownership of the returned + string. If N is negative, or equal to or greater than the current + number of substitution candidates, returns NULL. */ + +static dyn_string_t +substitution_get (dm, n, template_p) + demangling_t dm; + int n; + int *template_p; +{ + struct substitution_def *sub; + + /* Make sure N is in the valid range. */ + if (n < 0 || n >= dm->num_substitutions) + return NULL; + + sub = &(dm->substitutions[n]); + *template_p = sub->template_p; + return sub->text; +} + +#ifdef CP_DEMANGLE_DEBUG +/* Debugging routine to print the current substitutions to FP. */ + +static void +substitutions_print (dm, fp) + demangling_t dm; + FILE *fp; +{ + int seq_id; + int num = dm->num_substitutions; + + fprintf (fp, "SUBSTITUTIONS:\n"); + for (seq_id = -1; seq_id < num - 1; ++seq_id) + { + int template_p; + dyn_string_t text = substitution_get (dm, seq_id + 1, &template_p); + + if (seq_id == -1) + fprintf (fp, " S_ "); + else + fprintf (fp, " S%d_", seq_id); + fprintf (fp, " %c: %s\n", template_p ? '*' : ' ', dyn_string_buf (text)); + } +} + +#endif /* CP_DEMANGLE_DEBUG */ + +/* Creates a new template argument list. Returns NULL if allocation + fails. */ + +static template_arg_list_t +template_arg_list_new () +{ + template_arg_list_t new_list = + (template_arg_list_t) malloc (sizeof (struct template_arg_list_def)); + if (new_list == NULL) + return NULL; + /* Initialize the new list to have no arguments. */ + new_list->first_argument = NULL; + new_list->last_argument = NULL; + /* Return the new list. */ + return new_list; +} + +/* Deletes a template argument list and the template arguments it + contains. */ + +static void +template_arg_list_delete (list) + template_arg_list_t list; +{ + /* If there are any arguments on LIST, delete them. */ + if (list->first_argument != NULL) + string_list_delete (list->first_argument); + /* Delete LIST. */ + free (list); +} + +/* Adds ARG to the template argument list ARG_LIST. */ + +static void +template_arg_list_add_arg (arg_list, arg) + template_arg_list_t arg_list; + string_list_t arg; +{ + if (arg_list->first_argument == NULL) + /* If there were no arguments before, ARG is the first one. */ + arg_list->first_argument = arg; + else + /* Make ARG the last argument on the list. */ + arg_list->last_argument->next = arg; + /* Make ARG the last on the list. */ + arg_list->last_argument = arg; + arg->next = NULL; +} + +/* Returns the template arugment at position INDEX in template + argument list ARG_LIST. */ + +static string_list_t +template_arg_list_get_arg (arg_list, index) + template_arg_list_t arg_list; + int index; +{ + string_list_t arg = arg_list->first_argument; + /* Scan down the list of arguments to find the one at position + INDEX. */ + while (index--) + { + arg = arg->next; + if (arg == NULL) + /* Ran out of arguments before INDEX hit zero. That's an + error. */ + return NULL; + } + /* Return the argument at position INDEX. */ + return arg; +} + +/* Pushes ARG_LIST onto the top of the template argument list stack. */ + +static void +push_template_arg_list (dm, arg_list) + demangling_t dm; + template_arg_list_t arg_list; +{ + arg_list->next = dm->template_arg_lists; + dm->template_arg_lists = arg_list; +#ifdef CP_DEMANGLE_DEBUG + fprintf (stderr, " ** pushing template arg list\n"); + template_arg_list_print (arg_list, stderr); +#endif +} + +/* Pops and deletes elements on the template argument list stack until + arg_list is the topmost element. If arg_list is NULL, all elements + are popped and deleted. */ + +static void +pop_to_template_arg_list (dm, arg_list) + demangling_t dm; + template_arg_list_t arg_list; +{ + while (dm->template_arg_lists != arg_list) + { + template_arg_list_t top = dm->template_arg_lists; + /* Disconnect the topmost element from the list. */ + dm->template_arg_lists = top->next; + /* Delete the popped element. */ + template_arg_list_delete (top); +#ifdef CP_DEMANGLE_DEBUG + fprintf (stderr, " ** removing template arg list\n"); +#endif + } +} + +#ifdef CP_DEMANGLE_DEBUG + +/* Prints the contents of ARG_LIST to FP. */ + +static void +template_arg_list_print (arg_list, fp) + template_arg_list_t arg_list; + FILE *fp; +{ + string_list_t arg; + int index = -1; + + fprintf (fp, "TEMPLATE ARGUMENT LIST:\n"); + for (arg = arg_list->first_argument; arg != NULL; arg = arg->next) + { + if (index == -1) + fprintf (fp, " T_ : "); + else + fprintf (fp, " T%d_ : ", index); + ++index; + fprintf (fp, "%s\n", dyn_string_buf ((dyn_string_t) arg)); + } +} + +#endif /* CP_DEMANGLE_DEBUG */ + +/* Returns the topmost element on the stack of template argument + lists. If there is no list of template arguments, returns NULL. */ + +static template_arg_list_t +current_template_arg_list (dm) + demangling_t dm; +{ + return dm->template_arg_lists; +} + +/* Allocates a demangling_t object for demangling mangled NAME. A new + result must be pushed before the returned object can be used. + Returns NULL if allocation fails. */ + +static demangling_t +demangling_new (name) + const char *name; +{ + demangling_t dm; + dm = (demangling_t) malloc (sizeof (struct demangling_def)); + if (dm == NULL) + return NULL; + + dm->name = name; + dm->next = name; + dm->result = NULL; + dm->num_substitutions = 0; + dm->substitutions_allocated = 10; + dm->template_arg_lists = NULL; + dm->last_source_name = dyn_string_new (0); + if (dm->last_source_name == NULL) + return NULL; + dm->substitutions = (struct substitution_def *) + malloc (dm->substitutions_allocated * sizeof (struct substitution_def)); + if (dm->substitutions == NULL) + { + dyn_string_delete (dm->last_source_name); + return NULL; + } + + return dm; +} + +/* Deallocates a demangling_t object and all memory associated with + it. */ + +static void +demangling_delete (dm) + demangling_t dm; +{ + int i; + template_arg_list_t arg_list = dm->template_arg_lists; + + /* Delete the stack of template argument lists. */ + while (arg_list != NULL) + { + template_arg_list_t next = arg_list->next; + template_arg_list_delete (arg_list); + arg_list = next; + } + /* Delete the list of substitutions. */ + for (i = dm->num_substitutions; --i >= 0; ) + dyn_string_delete (dm->substitutions[i].text); + free (dm->substitutions); + /* Delete the demangled result. */ + string_list_delete (dm->result); + /* Delete the stored identifier name. */ + dyn_string_delete (dm->last_source_name); + /* Delete the context object itself. */ + free (dm); +} + +/* These functions demangle an alternative of the corresponding + production in the mangling spec. The first argument of each is a + demangling context structure for the current demangling + operation. Most emit demangled text directly to the topmost result + string on the result string stack in the demangling context + structure. */ + +static status_t demangle_char + PARAMS ((demangling_t, int)); +static status_t demangle_mangled_name + PARAMS ((demangling_t)); +static status_t demangle_encoding + PARAMS ((demangling_t)); +static status_t demangle_name + PARAMS ((demangling_t, int *)); +static status_t demangle_nested_name + PARAMS ((demangling_t, int *)); +static status_t demangle_prefix + PARAMS ((demangling_t, int *)); +static status_t demangle_unqualified_name + PARAMS ((demangling_t)); +static status_t demangle_source_name + PARAMS ((demangling_t)); +static status_t demangle_number + PARAMS ((demangling_t, int *, int, int)); +static status_t demangle_number_literally + PARAMS ((demangling_t, dyn_string_t, int, int)); +static status_t demangle_identifier + PARAMS ((demangling_t, int, dyn_string_t)); +static status_t demangle_operator_name + PARAMS ((demangling_t, int, int *)); +static status_t demangle_special_name + PARAMS ((demangling_t)); +static status_t demangle_ctor_dtor_name + PARAMS ((demangling_t)); +static status_t demangle_type_ptr + PARAMS ((demangling_t)); +static status_t demangle_type + PARAMS ((demangling_t)); +static status_t demangle_CV_qualifiers + PARAMS ((demangling_t, dyn_string_t)); +static status_t demangle_builtin_type + PARAMS ((demangling_t)); +static status_t demangle_function_type + PARAMS ((demangling_t, int)); +static status_t demangle_bare_function_type + PARAMS ((demangling_t, int)); +static status_t demangle_class_enum_type + PARAMS ((demangling_t, int *)); +static status_t demangle_array_type + PARAMS ((demangling_t)); +static status_t demangle_template_param + PARAMS ((demangling_t, int *)); +static status_t demangle_template_args + PARAMS ((demangling_t)); +static status_t demangle_literal + PARAMS ((demangling_t)); +static status_t demangle_template_arg + PARAMS ((demangling_t)); +static status_t demangle_expression + PARAMS ((demangling_t)); +static status_t demangle_scope_expression + PARAMS ((demangling_t)); +static status_t demangle_expr_primary + PARAMS ((demangling_t)); +static status_t demangle_substitution + PARAMS ((demangling_t, int *, int *)); +static status_t demangle_local_name + PARAMS ((demangling_t)); +static status_t demangle_discriminator + PARAMS ((demangling_t, int)); +static status_t cp_demangle + PARAMS ((const char *, dyn_string_t)); +static status_t cp_demangle_type + PARAMS ((const char*, dyn_string_t)); + +/* When passed to demangle_bare_function_type, indicates that the + function's return type is not encoded before its parameter types. */ +#define BFT_NO_RETURN_TYPE -1 + +/* Check that the next character is C. If so, consume it. If not, + return an error. */ + +static status_t +demangle_char (dm, c) + demangling_t dm; + int c; +{ + static char *error_message = NULL; + + if (peek_char (dm) == c) + { + advance_char (dm); + return STATUS_OK; + } + else + { + if (error_message == NULL) + error_message = strdup ("Expected ?"); + error_message[9] = c; + return error_message; + } +} + +/* Demangles and emits a . + + ::= _Z */ + +static status_t +demangle_mangled_name (dm) + demangling_t dm; +{ + DEMANGLE_TRACE ("mangled-name", dm); + RETURN_IF_ERROR (demangle_char (dm, '_')); + RETURN_IF_ERROR (demangle_char (dm, 'Z')); + RETURN_IF_ERROR (demangle_encoding (dm)); + return STATUS_OK; +} + +/* Demangles and emits an . + + ::= + ::= + ::= */ + +static status_t +demangle_encoding (dm) + demangling_t dm; +{ + int template_p; + int start_position; + template_arg_list_t old_arg_list = current_template_arg_list (dm); + char peek = peek_char (dm); + + DEMANGLE_TRACE ("encoding", dm); + + /* Remember where the name starts. If it turns out to be a template + function, we'll have to insert the return type here. */ + start_position = result_length (dm); + + if (peek == 'G' || peek == 'T') + RETURN_IF_ERROR (demangle_special_name (dm)); + else + { + /* Now demangle the name. */ + RETURN_IF_ERROR (demangle_name (dm, &template_p)); + + /* If there's anything left, the name was a function name, with + maybe its return type, and its parameters types, following. */ + if (!end_of_name_p (dm) + && peek_char (dm) != 'E') + { + if (template_p) + /* Template functions have their return type encoded. The + return type should be inserted at start_position. */ + RETURN_IF_ERROR + (demangle_bare_function_type (dm, start_position)); + else + /* Non-template functions don't have their return type + encoded. */ + RETURN_IF_ERROR + (demangle_bare_function_type (dm, BFT_NO_RETURN_TYPE)); + } + } + + /* Pop off template argument lists that were built during the + mangling of this name, to restore the old template context. */ + pop_to_template_arg_list (dm, old_arg_list); + + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= + ::= + ::= + ::= + + ::= + ::= St # ::std:: + + + ::= + ::= */ + +static status_t +demangle_name (dm, template_p) + demangling_t dm; + int *template_p; +{ + int special_std_substitution; + int start = substitution_start (dm); + + DEMANGLE_TRACE ("name", dm); + + switch (peek_char (dm)) + { + case 'N': + /* This is a . */ + RETURN_IF_ERROR (demangle_nested_name (dm, template_p)); + break; + + case 'Z': + RETURN_IF_ERROR (demangle_local_name (dm)); + break; + + case 'S': + /* The `St' substitution allows a name nested in std:: to appear + without being enclosed in a nested name. */ + if (peek_char_next (dm) == 't') + { + (void) next_char (dm); + (void) next_char (dm); + RETURN_IF_ERROR (result_append (dm, "std::")); + RETURN_IF_ERROR (demangle_unqualified_name (dm)); + } + else + { + RETURN_IF_ERROR (demangle_substitution (dm, template_p, + &special_std_substitution)); + if (special_std_substitution) + { + /* This was the magic `std::' substitution. We can have + a or one of the unscoped names + following. */ + RETURN_IF_ERROR (result_append (dm, "::")); + RETURN_IF_ERROR (demangle_name (dm, template_p)); + } + } + /* Check if a template argument list immediately follows. + If so, then we just demangled an . */ + if (peek_char (dm) == 'I') + { + RETURN_IF_ERROR (substitution_add (dm, start, 0, + NOT_TEMPLATE_PARM)); + RETURN_IF_ERROR (demangle_template_args (dm)); + } + break; + + default: + /* This is an or . */ + RETURN_IF_ERROR (demangle_unqualified_name (dm)); + + /* If the is followed by template args, this + is an . */ + if (peek_char (dm) == 'I') + { + /* Add a substitution for the unqualified template name. */ + RETURN_IF_ERROR (substitution_add (dm, start, 0, + NOT_TEMPLATE_PARM)); + + RETURN_IF_ERROR (demangle_template_args (dm)); + *template_p = 1; + } + else + *template_p = 0; + + break; + } + + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= N [] E */ + +static status_t +demangle_nested_name (dm, template_p) + demangling_t dm; + int *template_p; +{ + char peek; + + DEMANGLE_TRACE ("nested-name", dm); + + RETURN_IF_ERROR (demangle_char (dm, 'N')); + + peek = peek_char (dm); + if (peek == 'r' || peek == 'V' || peek == 'K') + { + status_t status; + + /* Snarf up and emit CV qualifiers. */ + dyn_string_t cv_qualifiers = dyn_string_new (24); + if (cv_qualifiers == NULL) + return STATUS_ALLOCATION_FAILED; + + demangle_CV_qualifiers (dm, cv_qualifiers); + status = result_append_string (dm, cv_qualifiers); + dyn_string_delete (cv_qualifiers); + RETURN_IF_ERROR (status); + RETURN_IF_ERROR (result_append_space (dm)); + } + + RETURN_IF_ERROR (demangle_prefix (dm, template_p)); + /* No need to demangle the final ; demangle_prefix will + handle it. */ + RETURN_IF_ERROR (demangle_char (dm, 'E')); + + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= + ::= + ::= # empty + ::= + + ::= + ::= + + ::= + ::= */ + +static status_t +demangle_prefix (dm, template_p) + demangling_t dm; + int *template_p; +{ + int start = substitution_start (dm); + int nested = 0; + + /* TEMPLATE_P is updated as we decend the nesting chain. After + , it is set to non-zero; after everything else it + is set to zero. */ + + DEMANGLE_TRACE ("prefix", dm); + + while (1) + { + char peek; + int unused; + + if (end_of_name_p (dm)) + return "Unexpected end of name in ."; + + peek = peek_char (dm); + + if (IS_DIGIT ((unsigned char) peek) + || (peek >= 'a' && peek <= 'z') + || peek == 'C' || peek == 'D' + || peek == 'S') + { + /* We have another level of scope qualification. */ + if (nested) + RETURN_IF_ERROR (result_append (dm, "::")); + else + nested = 1; + + if (peek == 'S') + /* The substitution determines whether this is a + template-id. */ + RETURN_IF_ERROR (demangle_substitution (dm, template_p, + &unused)); + else + { + RETURN_IF_ERROR (demangle_unqualified_name (dm)); + *template_p = 0; + } + } + else if (peek == 'Z') + RETURN_IF_ERROR (demangle_local_name (dm)); + else if (peek == 'I') + { + if (*template_p) + return STATUS_INTERNAL_ERROR; + /* The template name is a substitution candidate. */ + RETURN_IF_ERROR (substitution_add (dm, start, 0, NOT_TEMPLATE_PARM)); + RETURN_IF_ERROR (demangle_template_args (dm)); + *template_p = 1; + } + else if (peek == 'E') + /* All done. */ + return STATUS_OK; + else + return "Unexpected character in ."; + + /* Add a new substitution for the prefix thus far. */ + RETURN_IF_ERROR (substitution_add (dm, start, *template_p, + NOT_TEMPLATE_PARM)); + } +} + +/* Demangles and emits an . If the + is a function and the first element in the + argument list should be taken to be its return type, + ENCODE_RETURN_TYPE is non-zero. + + ::= + ::= + ::= */ + +static status_t +demangle_unqualified_name (dm) + demangling_t dm; +{ + char peek = peek_char (dm); + + DEMANGLE_TRACE ("unqualified-name", dm); + + if (IS_DIGIT ((unsigned char) peek)) + RETURN_IF_ERROR (demangle_source_name (dm)); + else if (peek >= 'a' && peek <= 'z') + { + int num_args; + RETURN_IF_ERROR (demangle_operator_name (dm, 0, &num_args)); + } + else if (peek == 'C' || peek == 'D') + RETURN_IF_ERROR (demangle_ctor_dtor_name (dm)); + else + return "Unexpected character in ."; + + return STATUS_OK; +} + +/* Demangles and emits . + + ::= */ + +static status_t +demangle_source_name (dm) + demangling_t dm; +{ + int length; + + DEMANGLE_TRACE ("source-name", dm); + + /* Decode the length of the identifier. */ + RETURN_IF_ERROR (demangle_number (dm, &length, 10, 0)); + if (length == 0) + return "Zero length in ."; + + /* Now the identifier itself. It's placed into last_source_name, + where it can be used to build a constructor or destructor name. */ + RETURN_IF_ERROR (demangle_identifier (dm, length, + dm->last_source_name)); + + /* Emit it. */ + RETURN_IF_ERROR (result_append_string (dm, dm->last_source_name)); + + return STATUS_OK; +} + +/* Demangles a number, either a or a at the + current position, consuming all consecutive digit characters. Sets + *VALUE to the resulting numberand returns STATUS_OK. The number is + interpreted as BASE, which must be either 10 or 36. If IS_SIGNED + is non-zero, negative numbers -- prefixed with `n' -- are accepted. + + ::= [n] + + ::= */ + +static status_t +demangle_number (dm, value, base, is_signed) + demangling_t dm; + int *value; + int base; + int is_signed; +{ + dyn_string_t number = dyn_string_new (10); + + DEMANGLE_TRACE ("number", dm); + + if (number == NULL) + return STATUS_ALLOCATION_FAILED; + + demangle_number_literally (dm, number, base, is_signed); + *value = strtol (dyn_string_buf (number), NULL, base); + dyn_string_delete (number); + + return STATUS_OK; +} + +/* Demangles a number at the current position. The digits (and minus + sign, if present) that make up the number are appended to STR. + Only base-BASE digits are accepted; BASE must be either 10 or 36. + If IS_SIGNED, negative numbers -- prefixed with `n' -- are + accepted. Does not consume a trailing underscore or other + terminating character. */ + +static status_t +demangle_number_literally (dm, str, base, is_signed) + demangling_t dm; + dyn_string_t str; + int base; + int is_signed; +{ + DEMANGLE_TRACE ("number*", dm); + + if (base != 10 && base != 36) + return STATUS_INTERNAL_ERROR; + + /* An `n' denotes a negative number. */ + if (is_signed && peek_char (dm) == 'n') + { + /* Skip past the n. */ + advance_char (dm); + /* The normal way to write a negative number is with a minus + sign. */ + if (!dyn_string_append_char (str, '-')) + return STATUS_ALLOCATION_FAILED; + } + + /* Loop until we hit a non-digit. */ + while (1) + { + char peek = peek_char (dm); + if (IS_DIGIT ((unsigned char) peek) + || (base == 36 && peek >= 'A' && peek <= 'Z')) + { + /* Accumulate digits. */ + if (!dyn_string_append_char (str, next_char (dm))) + return STATUS_ALLOCATION_FAILED; + } + else + /* Not a digit? All done. */ + break; + } + + return STATUS_OK; +} + +/* Demangles an identifier at the current position of LENGTH + characters and places it in IDENTIFIER. */ + +static status_t +demangle_identifier (dm, length, identifier) + demangling_t dm; + int length; + dyn_string_t identifier; +{ + DEMANGLE_TRACE ("identifier", dm); + + dyn_string_clear (identifier); + if (!dyn_string_resize (identifier, length)) + return STATUS_ALLOCATION_FAILED; + + while (length-- > 0) + { + if (end_of_name_p (dm)) + return "Unexpected end of name in ."; + if (!dyn_string_append_char (identifier, next_char (dm))) + return STATUS_ALLOCATION_FAILED; + } + + return STATUS_OK; +} + +/* Demangles and emits an . If SHORT_NAME is non-zero, + the short form is emitted; otherwise the full source form + (`operator +' etc.) is emitted. *NUM_ARGS is set to the number of + operands that the operator takes. + + + ::= nw # new + ::= na # new[] + ::= dl # delete + ::= da # delete[] + ::= ps # + (unary) + ::= ng # - (unary) + ::= ad # & (unary) + ::= de # * (unary) + ::= co # ~ + ::= pl # + + ::= mi # - + ::= ml # * + ::= dv # / + ::= rm # % + ::= an # & + ::= or # | + ::= eo # ^ + ::= aS # = + ::= pL # += + ::= mI # -= + ::= mL # *= + ::= dV # /= + ::= rM # %= + ::= aN # &= + ::= oR # |= + ::= eO # ^= + ::= ls # << + ::= rs # >> + ::= lS # <<= + ::= rS # >>= + ::= eq # == + ::= ne # != + ::= lt # < + ::= gt # > + ::= le # <= + ::= ge # >= + ::= nt # ! + ::= aa # && + ::= oo # || + ::= pp # ++ + ::= mm # -- + ::= cm # , + ::= pm # ->* + ::= pt # -> + ::= cl # () + ::= ix # [] + ::= qu # ? + ::= sz # sizeof + ::= cv # cast + ::= vx # vendor extended operator */ + +static status_t +demangle_operator_name (dm, short_name, num_args) + demangling_t dm; + int short_name; + int *num_args; +{ + struct operator_code + { + /* The mangled code for this operator. */ + const char *code; + /* The source name of this operator. */ + const char *name; + /* The number of arguments this operator takes. */ + int num_args; + }; + + static const struct operator_code operators[] = + { + { "aN", "&=" , 2 }, + { "aS", "=" , 2 }, + { "aa", "&&" , 2 }, + { "ad", "&" , 1 }, + { "an", "&" , 2 }, + { "cl", "()" , 0 }, + { "cm", "," , 2 }, + { "co", "~" , 1 }, + { "dV", "/=" , 2 }, + { "da", " delete[]", 1 }, + { "de", "*" , 1 }, + { "dl", " delete" , 1 }, + { "dv", "/" , 2 }, + { "eO", "^=" , 2 }, + { "eo", "^" , 2 }, + { "eq", "==" , 2 }, + { "ge", ">=" , 2 }, + { "gt", ">" , 2 }, + { "ix", "[]" , 2 }, + { "lS", "<<=" , 2 }, + { "le", "<=" , 2 }, + { "ls", "<<" , 2 }, + { "lt", "<" , 2 }, + { "mI", "-=" , 2 }, + { "mL", "*=" , 2 }, + { "mi", "-" , 2 }, + { "ml", "*" , 2 }, + { "mm", "--" , 1 }, + { "na", " new[]" , 1 }, + { "ne", "!=" , 2 }, + { "ng", "-" , 1 }, + { "nt", "!" , 1 }, + { "nw", " new" , 1 }, + { "oR", "|=" , 2 }, + { "oo", "||" , 2 }, + { "or", "|" , 2 }, + { "pL", "+=" , 2 }, + { "pl", "+" , 2 }, + { "pm", "->*" , 2 }, + { "pp", "++" , 1 }, + { "ps", "+" , 1 }, + { "qu", "?" , 3 }, + { "rM", "%=" , 2 }, + { "rS", ">>=" , 2 }, + { "rm", "%" , 2 }, + { "rs", ">>" , 2 }, + { "sz", " sizeof" , 1 } + }; + + const int num_operators = + sizeof (operators) / sizeof (struct operator_code); + + int c0 = next_char (dm); + int c1 = next_char (dm); + const struct operator_code* p1 = operators; + const struct operator_code* p2 = operators + num_operators; + + DEMANGLE_TRACE ("operator-name", dm); + + /* Is this a vendor extended operator? */ + if (c0 == 'v' && c1 == 'x') + { + RETURN_IF_ERROR (result_append (dm, "operator")); + RETURN_IF_ERROR (demangle_source_name (dm)); + *num_args = 0; + return STATUS_OK; + } + + /* Is this a conversion operator? */ + if (c0 == 'c' && c1 == 'v') + { + RETURN_IF_ERROR (result_append (dm, "operator ")); + /* Demangle the converted-to type. */ + RETURN_IF_ERROR (demangle_type (dm)); + *num_args = 0; + return STATUS_OK; + } + + /* Perform a binary search for the operator code. */ + while (1) + { + const struct operator_code* p = p1 + (p2 - p1) / 2; + char match0 = p->code[0]; + char match1 = p->code[1]; + + if (c0 == match0 && c1 == match1) + /* Found it. */ + { + if (!short_name) + RETURN_IF_ERROR (result_append (dm, "operator")); + RETURN_IF_ERROR (result_append (dm, p->name)); + *num_args = p->num_args; + + return STATUS_OK; + } + + if (p == p1) + /* Couldn't find it. */ + return "Unknown code in ."; + + /* Try again. */ + if (c0 < match0 || (c0 == match0 && c1 < match1)) + p2 = p; + else + p1 = p; + } +} + +/* Demangles and emits a . + + ::= GV # Guard variable + ::= Th[n] _ + # non-virtual base override thunk + ::= Tv[n] _ + _ + # virtual base override thunk + ::= TV # virtual table + ::= TT # VTT + ::= TI # typeinfo structure + ::= TS # typeinfo name + + Also demangles the special g++ manglings, + + ::= CT _ + # construction vtable + ::= TF # typeinfo function (old ABI only) + ::= TJ # java Class structure */ + +static status_t +demangle_special_name (dm) + demangling_t dm; +{ + dyn_string_t number; + int unused; + char peek = peek_char (dm); + + DEMANGLE_TRACE ("special-name", dm); + + if (peek == 'G') + { + /* A guard variable name. Consume the G. */ + advance_char (dm); + RETURN_IF_ERROR (demangle_char (dm, 'V')); + RETURN_IF_ERROR (result_append (dm, "guard variable for ")); + RETURN_IF_ERROR (demangle_name (dm, &unused)); + } + else if (peek == 'T') + { + status_t status = STATUS_OK; + + /* Other C++ implementation miscellania. Consume the T. */ + advance_char (dm); + + switch (peek_char (dm)) + { + case 'V': + /* Virtual table. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "vtable for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'T': + /* VTT structure. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "VTT for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'I': + /* Typeinfo structure. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "typeinfo for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'F': + /* Typeinfo function. Used only in old ABI with new mangling. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "typeinfo fn for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'S': + /* Character string containing type name, used in typeinfo. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "typeinfo name for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'J': + /* The java Class variable corresponding to a C++ class. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "java Class for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'h': + /* Non-virtual thunk. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "non-virtual thunk")); + /* Demangle and emit the offset. */ + number = dyn_string_new (4); + if (number == NULL) + return STATUS_ALLOCATION_FAILED; + demangle_number_literally (dm, number, 10, 1); + /* Don't display the offset unless in verbose mode. */ + if (flag_verbose) + { + status = result_append_char (dm, ' '); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, number); + } + dyn_string_delete (number); + RETURN_IF_ERROR (status); + /* Demangle the separator. */ + RETURN_IF_ERROR (demangle_char (dm, '_')); + /* Demangle and emit the target name and function type. */ + RETURN_IF_ERROR (result_append (dm, " to ")); + RETURN_IF_ERROR (demangle_encoding (dm)); + break; + + case 'v': + /* Virtual thunk. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "virtual thunk ")); + /* Demangle and emit the offset. */ + number = dyn_string_new (4); + if (number == NULL) + return STATUS_ALLOCATION_FAILED; + demangle_number_literally (dm, number, 10, 1); + /* Don't display the offset unless in verbose mode. */ + if (flag_verbose) + { + status = result_append_string (dm, number); + if (STATUS_NO_ERROR (status)) + result_append_char (dm, ' '); + } + dyn_string_delete (number); + RETURN_IF_ERROR (status); + /* Demangle the separator. */ + RETURN_IF_ERROR (demangle_char (dm, '_')); + /* Demangle and emit the vcall offset. */ + number = dyn_string_new (4); + if (number == NULL) + return STATUS_ALLOCATION_FAILED; + demangle_number_literally (dm, number, 10, 1); + /* Don't display the vcall offset unless in verbose mode. */ + if (flag_verbose) + { + status = result_append_string (dm, number); + if (STATUS_NO_ERROR (status)) + status = result_append_char (dm, ' '); + } + dyn_string_delete (number); + RETURN_IF_ERROR (status); + /* Demangle the separator. */ + RETURN_IF_ERROR (demangle_char (dm, '_')); + /* Demangle and emit the target function. */ + RETURN_IF_ERROR (result_append (dm, "to ")); + RETURN_IF_ERROR (demangle_encoding (dm)); + break; + + case 'C': + /* TC is a special g++ mangling for a construction vtable. */ + if (!flag_strict) + { + dyn_string_t derived_type; + + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "construction vtable for ")); + + /* Demangle the derived type off to the side. */ + RETURN_IF_ERROR (result_push (dm)); + RETURN_IF_ERROR (demangle_type (dm)); + derived_type = (dyn_string_t) result_pop (dm); + + /* Demangle the offset. */ + number = dyn_string_new (4); + if (number == NULL) + { + dyn_string_delete (derived_type); + return STATUS_ALLOCATION_FAILED; + } + demangle_number_literally (dm, number, 10, 1); + /* Demangle the underscore separator. */ + status = demangle_char (dm, '_'); + + /* Demangle the base type. */ + if (STATUS_NO_ERROR (status)) + status = demangle_type (dm); + + /* Emit the derived type. */ + if (STATUS_NO_ERROR (status)) + status = result_append (dm, "-in-"); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, derived_type); + dyn_string_delete (derived_type); + + /* Don't display the offset unless in verbose mode. */ + if (flag_verbose) + { + status = result_append_char (dm, ' '); + if (STATUS_NO_ERROR (status)) + result_append_string (dm, number); + } + dyn_string_delete (number); + RETURN_IF_ERROR (status); + break; + } + /* If flag_strict, fall through. */ + + default: + return "Unrecognized ."; + } + } + else + return STATUS_ERROR; + + return STATUS_OK; +} + +/* Demangles and emits a . + + + ::= C1 # complete object (in-charge) ctor + ::= C2 # base object (not-in-charge) ctor + ::= C3 # complete object (in-charge) allocating ctor + ::= C4 # base object (not-in-charge) allocating ctor + ::= D0 # deleting (in-charge) dtor + ::= D1 # complete object (in-charge) dtor + ::= D2 # base object (not-in-charge) dtor */ + +static status_t +demangle_ctor_dtor_name (dm) + demangling_t dm; +{ + static const char *const ctor_flavors[] = + { + "in-charge", + "not-in-charge", + "in-charge allocating", + "not-in-charge allocating" + }; + static const char *const dtor_flavors[] = + { + "in-charge deleting", + "in-charge", + "not-in-charge" + }; + + int flavor; + char peek = peek_char (dm); + + DEMANGLE_TRACE ("ctor-dtor-name", dm); + + if (peek == 'C') + { + /* A constructor name. Consume the C. */ + advance_char (dm); + if (peek_char (dm) < '1' || peek_char (dm) > '4') + return "Unrecognized constructor."; + RETURN_IF_ERROR (result_append_string (dm, dm->last_source_name)); + /* Print the flavor of the constructor if in verbose mode. */ + flavor = next_char (dm) - '1'; + if (flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, "[")); + RETURN_IF_ERROR (result_append (dm, ctor_flavors[flavor])); + RETURN_IF_ERROR (result_append_char (dm, ']')); + } + } + else if (peek == 'D') + { + /* A destructor name. Consume the D. */ + advance_char (dm); + if (peek_char (dm) < '0' || peek_char (dm) > '2') + return "Unrecognized destructor."; + RETURN_IF_ERROR (result_append_char (dm, '~')); + RETURN_IF_ERROR (result_append_string (dm, dm->last_source_name)); + /* Print the flavor of the destructor if in verbose mode. */ + flavor = next_char (dm) - '0'; + if (flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, " [")); + RETURN_IF_ERROR (result_append (dm, dtor_flavors[flavor])); + RETURN_IF_ERROR (result_append_char (dm, ']')); + } + } + else + return STATUS_ERROR; + + return STATUS_OK; +} + +/* Handle pointer, reference, and pointer-to-member cases for + demangle_type. All consecutive `P's, `R's, and 'M's are joined to + build a pointer/reference type. We snarf all these, plus the + following , all at once since we need to know whether we have + a pointer to data or pointer to function to construct the right + output syntax. C++'s pointer syntax is hairy. + + ::= P + ::= R + ::= + + ::= M */ + +static status_t +demangle_type_ptr (dm) + demangling_t dm; +{ + char next; + status_t status; + + /* Collect pointer symbols into this string. */ + dyn_string_t symbols = dyn_string_new (10); + + DEMANGLE_TRACE ("type*", dm); + + if (symbols == NULL) + return STATUS_ALLOCATION_FAILED; + + /* Scan forward, collecting pointers and references into symbols, + until we hit something else. Then emit the type. */ + while (1) + { + next = peek_char (dm); + if (next == 'P') + { + if (!dyn_string_append_char (symbols, '*')) + return STATUS_ALLOCATION_FAILED; + advance_char (dm); + } + else if (next == 'R') + { + if (!dyn_string_append_char (symbols, '&')) + return STATUS_ALLOCATION_FAILED; + advance_char (dm); + } + else if (next == 'M') + { + /* Pointer-to-member. */ + dyn_string_t class_type; + + /* Eat the 'M'. */ + advance_char (dm); + + /* Capture the type of which this is a pointer-to-member. */ + RETURN_IF_ERROR (result_push (dm)); + RETURN_IF_ERROR (demangle_type (dm)); + class_type = (dyn_string_t) result_pop (dm); + + /* Build the pointer-to-member notation. It comes before + other pointer and reference qualifiers -- */ + if (!dyn_string_prepend_cstr (symbols, "::*")) + return STATUS_ALLOCATION_FAILED; + if (!dyn_string_prepend (symbols, class_type)) + return STATUS_ALLOCATION_FAILED; + dyn_string_delete (class_type); + + if (peek_char (dm) == 'F') + continue; + + /* Demangle the type of the pointed-to member. */ + status = demangle_type (dm); + /* Make it pretty. */ + if (STATUS_NO_ERROR (status)) + status = result_append_space (dm); + /* Add the pointer-to-member syntax, and other pointer and + reference symbols. */ + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, symbols); + /* Clean up. */ + dyn_string_delete (symbols); + + RETURN_IF_ERROR (status); + return STATUS_OK; + } + else if (next == 'F') + { + /* Ooh, tricky, a pointer-to-function. */ + int position = result_length (dm); + status = result_append_char (dm, '('); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, symbols); + if (STATUS_NO_ERROR (status)) + status = result_append_char (dm, ')'); + dyn_string_delete (symbols); + RETURN_IF_ERROR (status); + + RETURN_IF_ERROR (demangle_function_type (dm, position)); + return STATUS_OK; + } + else + { + /* No more pointe or reference tokens. Finish up. */ + status = demangle_type (dm); + + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, symbols); + dyn_string_delete (symbols); + RETURN_IF_ERROR (status); + + RETURN_IF_ERROR (status); + return STATUS_OK; + } + } +} + +/* Demangles and emits a . + + ::= + ::= + ::= + ::= + ::= + ::= + ::= + ::= P # pointer-to + ::= R # reference-to + ::= C # complex pair (C 2000) + ::= G # imaginary (C 2000) + ::= U # vendor extended type qualifier + ::= */ + +static status_t +demangle_type (dm) + demangling_t dm; +{ + int start = substitution_start (dm); + char peek = peek_char (dm); + char peek_next; + int template_p = 0; + int special_std_substitution; + int is_builtin_type = 0; + template_arg_list_t old_arg_list = current_template_arg_list (dm); + int template_parm = NOT_TEMPLATE_PARM; + + DEMANGLE_TRACE ("type", dm); + + /* A can start with a digit (a ), an + N (a ), or a Z (a ). */ + if (IS_DIGIT ((unsigned char) peek) || peek == 'N' || peek == 'Z') + RETURN_IF_ERROR (demangle_class_enum_type (dm, &template_p)); + else if (peek >= 'a' && peek <= 'z') + { + RETURN_IF_ERROR (demangle_builtin_type (dm)); + is_builtin_type = 1; + } + else + switch (peek) + { + case 'r': + case 'V': + case 'K': + { + status_t status; + dyn_string_t cv_qualifiers = dyn_string_new (24); + + if (cv_qualifiers == NULL) + return STATUS_ALLOCATION_FAILED; + + demangle_CV_qualifiers (dm, cv_qualifiers); + + /* If the qualifiers apply to a pointer or reference, they + need to come after the whole qualified type. */ + if (peek_char (dm) == 'P' || peek_char (dm) == 'R') + { + status = demangle_type (dm); + if (STATUS_NO_ERROR (status)) + status = result_append_space (dm); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, cv_qualifiers); + } + /* Otherwise, the qualifiers come first. */ + else + { + status = result_append_string (dm, cv_qualifiers); + if (STATUS_NO_ERROR (status)) + status = result_append_space (dm); + if (STATUS_NO_ERROR (status)) + status = demangle_type (dm); + } + + dyn_string_delete (cv_qualifiers); + RETURN_IF_ERROR (status); + } + break; + + case 'F': + return "Non-pointer or -reference function type."; + + case 'A': + RETURN_IF_ERROR (demangle_array_type (dm)); + break; + + case 'T': + RETURN_IF_ERROR (demangle_template_param (dm, &template_parm)); + break; + + case 'S': + /* First check if this is a special substitution. If it is, + this is a . Special substitutions have a + letter following the `S'; other substitutions have a digit + or underscore. */ + peek_next = peek_char_next (dm); + if (IS_DIGIT (peek_next) || peek_next == '_') + RETURN_IF_ERROR (demangle_substitution (dm, &template_p, + &special_std_substitution)); + else + demangle_class_enum_type (dm, &template_p); + break; + + case 'P': + case 'R': + case 'M': + RETURN_IF_ERROR (demangle_type_ptr (dm)); + break; + + case 'C': + /* A C99 complex type. */ + RETURN_IF_ERROR (result_append (dm, "complex ")); + advance_char (dm); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'G': + /* A C99 imaginary type. */ + RETURN_IF_ERROR (result_append (dm, "imaginary ")); + advance_char (dm); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'U': + /* Vendor extended type qualifier. */ + advance_char (dm); + RETURN_IF_ERROR (demangle_source_name (dm)); + RETURN_IF_ERROR (result_append_char (dm, ' ')); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + default: + return "Unexpected character in ."; + } + + /* Unqualified builin types are not substitution candidates. */ + if (!is_builtin_type) + /* Add a new substitution for the type. If this type was a + , pass its index since from the point of + substitutions, a token is a substitution + candidate distinct from the type that is substituted for it. */ + RETURN_IF_ERROR (substitution_add (dm, start, template_p, template_parm)); + + /* Pop off template argument lists added during mangling of this + type. */ + pop_to_template_arg_list (dm, old_arg_list); + + return STATUS_OK; +} + +/* C++ source names of builtin types, indexed by the mangled code + letter's position in the alphabet ('a' -> 0, 'b' -> 1, etc). */ +static const char *const builtin_type_names[26] = +{ + "signed char", /* a */ + "bool", /* b */ + "char", /* c */ + "double", /* d */ + "long double", /* e */ + "float", /* f */ + "__float128", /* g */ + "unsigned char", /* h */ + "int", /* i */ + "unsigned", /* j */ + NULL, /* k */ + "long", /* l */ + "unsigned long", /* m */ + "__int128", /* n */ + "unsigned __int128", /* o */ + NULL, /* p */ + NULL, /* q */ + NULL, /* r */ + "short", /* s */ + "unsigned short", /* t */ + NULL, /* u */ + "void", /* v */ + "wchar_t", /* w */ + "long long", /* x */ + "unsigned long long", /* y */ + "..." /* z */ +}; + +/* Demangles and emits a . + + ::= v # void + ::= w # wchar_t + ::= b # bool + ::= c # char + ::= a # signed char + ::= h # unsigned char + ::= s # short + ::= t # unsigned short + ::= i # int + ::= j # unsigned int + ::= l # long + ::= m # unsigned long + ::= x # long long, __int64 + ::= y # unsigned long long, __int64 + ::= n # __int128 + ::= o # unsigned __int128 + ::= f # float + ::= d # double + ::= e # long double, __float80 + ::= g # __float128 + ::= z # ellipsis + ::= u # vendor extended type */ + +static status_t +demangle_builtin_type (dm) + demangling_t dm; +{ + + char code = peek_char (dm); + + DEMANGLE_TRACE ("builtin-type", dm); + + if (code == 'u') + { + advance_char (dm); + RETURN_IF_ERROR (demangle_source_name (dm)); + return STATUS_OK; + } + else if (code >= 'a' && code <= 'z') + { + const char *type_name = builtin_type_names[code - 'a']; + if (type_name == NULL) + return "Unrecognized code."; + + RETURN_IF_ERROR (result_append (dm, type_name)); + advance_char (dm); + return STATUS_OK; + } + else + return "Non-alphabetic code."; +} + +/* Demangles all consecutive CV-qualifiers (const, volatile, and + restrict) at the current position. The qualifiers are appended to + QUALIFIERS. Returns STATUS_OK. */ + +static status_t +demangle_CV_qualifiers (dm, qualifiers) + demangling_t dm; + dyn_string_t qualifiers; +{ + DEMANGLE_TRACE ("CV-qualifiers", dm); + + while (1) + { + switch (peek_char (dm)) + { + case 'r': + if (!dyn_string_append_space (qualifiers)) + return STATUS_ALLOCATION_FAILED; + if (!dyn_string_append_cstr (qualifiers, "restrict")) + return STATUS_ALLOCATION_FAILED; + break; + + case 'V': + if (!dyn_string_append_space (qualifiers)) + return STATUS_ALLOCATION_FAILED; + if (!dyn_string_append_cstr (qualifiers, "volatile")) + return STATUS_ALLOCATION_FAILED; + break; + + case 'K': + if (!dyn_string_append_space (qualifiers)) + return STATUS_ALLOCATION_FAILED; + if (!dyn_string_append_cstr (qualifiers, "const")) + return STATUS_ALLOCATION_FAILED; + break; + + default: + return STATUS_OK; + } + + advance_char (dm); + } +} + +/* Demangles and emits a FUNCTION_NAME_POS is the + position in the result string of the start of the function + identifier, at which the function's return type will be inserted. + + ::= F [Y] E */ + +static status_t +demangle_function_type (dm, function_name_pos) + demangling_t dm; + int function_name_pos; +{ + DEMANGLE_TRACE ("function-type", dm); + RETURN_IF_ERROR (demangle_char (dm, 'F')); + if (peek_char (dm) == 'Y') + { + /* Indicate this function has C linkage if in verbose mode. */ + if (flag_verbose) + RETURN_IF_ERROR (result_append (dm, " [extern \"C\"] ")); + advance_char (dm); + } + RETURN_IF_ERROR (demangle_bare_function_type (dm, function_name_pos)); + RETURN_IF_ERROR (demangle_char (dm, 'E')); + return STATUS_OK; +} + +/* Demangles and emits a . RETURN_TYPE_POS is the + position in the result string at which the function return type + should be inserted. If RETURN_TYPE_POS is BFT_NO_RETURN_TYPE, the + function's return type is assumed not to be encoded. + + ::= + */ + +static status_t +demangle_bare_function_type (dm, return_type_pos) + demangling_t dm; + int return_type_pos; +{ + /* Sequence is the index of the current function parameter, counting + from zero. The value -1 denotes the return type. */ + int sequence = + (return_type_pos == BFT_NO_RETURN_TYPE ? 0 : -1); + + DEMANGLE_TRACE ("bare-function-type", dm); + + RETURN_IF_ERROR (result_append_char (dm, '(')); + while (!end_of_name_p (dm) && peek_char (dm) != 'E') + { + if (sequence == -1) + /* We're decoding the function's return type. */ + { + dyn_string_t return_type; + status_t status = STATUS_OK; + + /* Decode the return type off to the side. */ + RETURN_IF_ERROR (result_push (dm)); + RETURN_IF_ERROR (demangle_type (dm)); + return_type = (dyn_string_t) result_pop (dm); + + /* Add a space to the end of the type. Insert the return + type where we've been asked to. */ + if (!dyn_string_append_space (return_type) + || !dyn_string_insert (result_string (dm), return_type_pos, + return_type)) + status = STATUS_ALLOCATION_FAILED; + + dyn_string_delete (return_type); + RETURN_IF_ERROR (status); + } + else + { + /* Skip `void' parameter types. One should only occur as + the only type in a parameter list; in that case, we want + to print `foo ()' instead of `foo (void)'. */ + if (peek_char (dm) == 'v') + { + /* Consume the v. */ + advance_char (dm); + continue; + } + /* Separate parameter types by commas. */ + if (sequence > 0) + RETURN_IF_ERROR (result_append (dm, ", ")); + /* Demangle the type. */ + RETURN_IF_ERROR (demangle_type (dm)); + } + + ++sequence; + } + RETURN_IF_ERROR (result_append_char (dm, ')')); + + return STATUS_OK; +} + +/* Demangles and emits a . *TEMPLATE_P is set to + non-zero if the type is a template-id, zero otherwise. + + ::= */ + +static status_t +demangle_class_enum_type (dm, template_p) + demangling_t dm; + int *template_p; +{ + DEMANGLE_TRACE ("class-enum-type", dm); + + RETURN_IF_ERROR (demangle_name (dm, template_p)); + return STATUS_OK; +} + +/* Demangles and emits an . + + ::= A [] _ */ + +static status_t +demangle_array_type (dm) + demangling_t dm; +{ + status_t status; + dyn_string_t array_size = dyn_string_new (10); + + if (array_size == NULL) + return STATUS_ALLOCATION_FAILED; + + status = demangle_char (dm, 'A'); + + /* Demangle the array size into array_size. */ + if (STATUS_NO_ERROR (status)) + status = demangle_number_literally (dm, array_size, 10, 0); + + /* Demangle the base type of the array. */ + if (STATUS_NO_ERROR (status)) + status = demangle_char (dm, '_'); + if (STATUS_NO_ERROR (status)) + status = demangle_type (dm); + + /* Emit the array dimension syntax. */ + if (STATUS_NO_ERROR (status)) + status = result_append_char (dm, '['); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, array_size); + if (STATUS_NO_ERROR (status)) + status = result_append_char (dm, ']'); + dyn_string_delete (array_size); + + RETURN_IF_ERROR (status); + + return STATUS_OK; +} + +/* Demangles and emits a . The zero-indexed position + in the parameter list is placed in *TEMPLATE_PARM_NUMBER. + + ::= T_ # first template parameter + ::= T _ */ + +static status_t +demangle_template_param (dm, template_parm_number) + demangling_t dm; + int *template_parm_number; +{ + int parm_number; + template_arg_list_t current_arg_list = current_template_arg_list (dm); + string_list_t arg; + + DEMANGLE_TRACE ("template-param", dm); + + /* Make sure there is a template argmust list in which to look up + this parameter reference. */ + if (current_arg_list == NULL) + return "Template parameter outside of template."; + + RETURN_IF_ERROR (demangle_char (dm, 'T')); + if (peek_char (dm) == '_') + parm_number = 0; + else + { + RETURN_IF_ERROR (demangle_number (dm, &parm_number, 10, 0)); + ++parm_number; + } + RETURN_IF_ERROR (demangle_char (dm, '_')); + + arg = template_arg_list_get_arg (current_arg_list, parm_number); + if (arg == NULL) + /* parm_number exceeded the number of arguments in the current + template argument list. */ + return "Template parameter number out of bounds."; + RETURN_IF_ERROR (result_append_string (dm, (dyn_string_t) arg)); + + if (peek_char (dm) == 'I') + RETURN_IF_ERROR (demangle_template_args (dm)); + + *template_parm_number = parm_number; + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= I + E */ + +static status_t +demangle_template_args (dm) + demangling_t dm; +{ + int first = 1; + dyn_string_t old_last_source_name; + template_arg_list_t arg_list = template_arg_list_new (); + + if (arg_list == NULL) + return STATUS_ALLOCATION_FAILED; + + /* Preserve the most recently demangled source name. */ + old_last_source_name = dm->last_source_name; + dm->last_source_name = dyn_string_new (0); + + DEMANGLE_TRACE ("template-args", dm); + + if (dm->last_source_name == NULL) + return STATUS_ALLOCATION_FAILED; + + RETURN_IF_ERROR (demangle_char (dm, 'I')); + RETURN_IF_ERROR (result_append_char (dm, '<')); + do + { + string_list_t arg; + + if (first) + first = 0; + else + RETURN_IF_ERROR (result_append (dm, ", ")); + + /* Capture the template arg. */ + RETURN_IF_ERROR (result_push (dm)); + RETURN_IF_ERROR (demangle_template_arg (dm)); + arg = result_pop (dm); + + /* Emit it in the demangled name. */ + RETURN_IF_ERROR (result_append_string (dm, (dyn_string_t) arg)); + + /* Save it for use in expanding s. */ + template_arg_list_add_arg (arg_list, arg); + } + while (peek_char (dm) != 'E'); + /* Append the '>'. */ + RETURN_IF_ERROR (result_close_template_list (dm)); + + /* Consume the 'E'. */ + advance_char (dm); + + /* Restore the most recent demangled source name. */ + dyn_string_delete (dm->last_source_name); + dm->last_source_name = old_last_source_name; + + /* Push the list onto the top of the stack of template argument + lists, so that arguments from it are used from now on when + expanding s. */ + push_template_arg_list (dm, arg_list); + + return STATUS_OK; +} + +/* This function, which does not correspond to a production in the + mangling spec, handles the `literal' production for both + and . It does not expect or consume + the initial `L' or final `E'. The demangling is given by: + + ::= + + and the emitted output is `(type)number'. */ + +static status_t +demangle_literal (dm) + demangling_t dm; +{ + char peek = peek_char (dm); + dyn_string_t value_string; + status_t status; + + DEMANGLE_TRACE ("literal", dm); + + if (!flag_verbose && peek >= 'a' && peek <= 'z') + { + /* If not in verbose mode and this is a builtin type, see if we + can produce simpler numerical output. In particular, for + integer types shorter than `long', just write the number + without type information; for bools, write `true' or `false'. + Other refinements could be made here too. */ + + /* This constant string is used to map from codes + (26 letters of the alphabet) to codes that determine how the + value will be displayed. The codes are: + b: display as bool + i: display as int + l: display as long + A space means the value will be represented using cast + notation. */ + static const char *const code_map = "ibi iii ll ii i "; + + char code = code_map[peek - 'a']; + /* FIXME: Implement demangling of floats and doubles. */ + if (code == 'u') + return STATUS_UNIMPLEMENTED; + if (code == 'b') + { + /* It's a boolean. */ + char value; + + /* Consume the b. */ + advance_char (dm); + /* Look at the next character. It should be 0 or 1, + corresponding to false or true, respectively. */ + value = peek_char (dm); + if (value == '0') + RETURN_IF_ERROR (result_append (dm, "false")); + else if (value == '1') + RETURN_IF_ERROR (result_append (dm, "true")); + else + return "Unrecognized bool constant."; + /* Consume the 0 or 1. */ + advance_char (dm); + return STATUS_OK; + } + else if (code == 'i' || code == 'l') + { + /* It's an integer or long. */ + + /* Consume the type character. */ + advance_char (dm); + + /* Demangle the number and write it out. */ + value_string = dyn_string_new (0); + status = demangle_number_literally (dm, value_string, 10, 1); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, value_string); + /* For long integers, append an l. */ + if (code == 'l' && STATUS_NO_ERROR (status)) + status = result_append_char (dm, code); + dyn_string_delete (value_string); + + RETURN_IF_ERROR (status); + return STATUS_OK; + } + /* ...else code == ' ', so fall through to represent this + literal's type explicitly using cast syntax. */ + } + + RETURN_IF_ERROR (result_append_char (dm, '(')); + RETURN_IF_ERROR (demangle_type (dm)); + RETURN_IF_ERROR (result_append_char (dm, ')')); + + value_string = dyn_string_new (0); + if (value_string == NULL) + return STATUS_ALLOCATION_FAILED; + + status = demangle_number_literally (dm, value_string, 10, 1); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, value_string); + dyn_string_delete (value_string); + RETURN_IF_ERROR (status); + + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= # type + ::= L E # literal + ::= LZ E # external name + ::= X E # expression */ + +static status_t +demangle_template_arg (dm) + demangling_t dm; +{ + DEMANGLE_TRACE ("template-arg", dm); + + switch (peek_char (dm)) + { + case 'L': + advance_char (dm); + + if (peek_char (dm) == 'Z') + { + /* External name. */ + advance_char (dm); + /* FIXME: Standard is contradictory here. */ + RETURN_IF_ERROR (demangle_encoding (dm)); + } + else + RETURN_IF_ERROR (demangle_literal (dm)); + RETURN_IF_ERROR (demangle_char (dm, 'E')); + break; + + case 'X': + /* Expression. */ + advance_char (dm); + RETURN_IF_ERROR (demangle_expression (dm)); + break; + + default: + RETURN_IF_ERROR (demangle_type (dm)); + break; + } + + return STATUS_OK; +} + +/* Demangles and emits an . + + ::= + ::= + ::= + ::= */ + +static status_t +demangle_expression (dm) + demangling_t dm; +{ + char peek = peek_char (dm); + + DEMANGLE_TRACE ("expression", dm); + + if (peek == 'L' || peek == 'T') + RETURN_IF_ERROR (demangle_expr_primary (dm)); + else if (peek == 's' && peek_char_next (dm) == 'r') + RETURN_IF_ERROR (demangle_scope_expression (dm)); + else + /* An operator expression. */ + { + int num_args; + status_t status = STATUS_OK; + dyn_string_t operator_name; + + /* We have an operator name. Since we want to output binary + operations in infix notation, capture the operator name + first. */ + RETURN_IF_ERROR (result_push (dm)); + RETURN_IF_ERROR (demangle_operator_name (dm, 1, &num_args)); + operator_name = (dyn_string_t) result_pop (dm); + + /* If it's binary, do an operand first. */ + if (num_args > 1) + { + status = result_append_char (dm, '('); + if (STATUS_NO_ERROR (status)) + status = demangle_expression (dm); + if (STATUS_NO_ERROR (status)) + status = result_append_char (dm, ')'); + } + + /* Emit the operator. */ + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, operator_name); + dyn_string_delete (operator_name); + RETURN_IF_ERROR (status); + + /* Emit its second (if binary) or only (if unary) operand. */ + RETURN_IF_ERROR (result_append_char (dm, '(')); + RETURN_IF_ERROR (demangle_expression (dm)); + RETURN_IF_ERROR (result_append_char (dm, ')')); + + /* The ternary operator takes a third operand. */ + if (num_args == 3) + { + RETURN_IF_ERROR (result_append (dm, ":(")); + RETURN_IF_ERROR (demangle_expression (dm)); + RETURN_IF_ERROR (result_append_char (dm, ')')); + } + } + + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= sr + ::= sr */ + +static status_t +demangle_scope_expression (dm) + demangling_t dm; +{ + RETURN_IF_ERROR (demangle_char (dm, 's')); + RETURN_IF_ERROR (demangle_char (dm, 'r')); + RETURN_IF_ERROR (demangle_type (dm)); + RETURN_IF_ERROR (result_append (dm, "::")); + RETURN_IF_ERROR (demangle_encoding (dm)); + return STATUS_OK; +} + +/* Demangles and emits an . + + ::= + ::= L E # literal + ::= L E # external name */ + +static status_t +demangle_expr_primary (dm) + demangling_t dm; +{ + char peek = peek_char (dm); + int unused; + + DEMANGLE_TRACE ("expr-primary", dm); + + if (peek == 'T') + RETURN_IF_ERROR (demangle_template_param (dm, &unused)); + else if (peek == 'L') + { + /* Consume the `L'. */ + advance_char (dm); + peek = peek_char (dm); + + if (peek == '_') + RETURN_IF_ERROR (demangle_mangled_name (dm)); + else + RETURN_IF_ERROR (demangle_literal (dm)); + + RETURN_IF_ERROR (demangle_char (dm, 'E')); + } + else + return STATUS_ERROR; + + return STATUS_OK; +} + +/* Demangles and emits a . Sets *TEMPLATE_P to non-zero + if the substitution is the name of a template, zero otherwise. If + the substitution token is St, which corresponds to the `::std::' + namespace and can appear in a non-nested name, sets + *SPECIAL_STD_SUBSTITUTION to non-zero; zero otherwise. + + ::= S _ + ::= S_ + + ::= St # ::std:: + ::= Sa # ::std::allocator + ::= Sb # ::std::basic_string + ::= Ss # ::std::basic_string, + ::std::allocator > + ::= Si # ::std::basic_istream > + ::= So # ::std::basic_ostream > + ::= Sd # ::std::basic_iostream > +*/ + +static status_t +demangle_substitution (dm, template_p, special_std_substitution) + demangling_t dm; + int *template_p; + int *special_std_substitution; +{ + int seq_id; + int peek; + dyn_string_t text; + + DEMANGLE_TRACE ("substitution", dm); + + RETURN_IF_ERROR (demangle_char (dm, 'S')); + *special_std_substitution = 0; + + /* Scan the substitution sequence index. A missing number denotes + the first index. */ + peek = peek_char (dm); + if (peek == '_') + seq_id = -1; + /* If the following character is 0-9 or a capital letter, interpret + the sequence up to the next underscore as a base-36 substitution + index. */ + else if (IS_DIGIT ((unsigned char) peek) + || (peek >= 'A' && peek <= 'Z')) + RETURN_IF_ERROR (demangle_number (dm, &seq_id, 36, 0)); + else + { + const char *new_last_source_name = NULL; + + switch (peek) + { + case 't': + RETURN_IF_ERROR (result_append (dm, "std")); + *special_std_substitution = 1; + break; + + case 'a': + RETURN_IF_ERROR (result_append (dm, "std::allocator")); + new_last_source_name = "allocator"; + *template_p = 1; + break; + + case 'b': + RETURN_IF_ERROR (result_append (dm, "std::basic_string")); + new_last_source_name = "basic_string"; + *template_p = 1; + break; + + case 's': + if (!flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, "std::string")); + new_last_source_name = "string"; + } + else + { + RETURN_IF_ERROR (result_append (dm, "std::basic_string, std::allocator >")); + new_last_source_name = "basic_string"; + } + *template_p = 0; + break; + + case 'i': + if (!flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, "std::istream")); + new_last_source_name = "istream"; + } + else + { + RETURN_IF_ERROR (result_append (dm, "std::basic_istream >")); + new_last_source_name = "basic_istream"; + } + *template_p = 0; + break; + + case 'o': + if (!flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, "std::ostream")); + new_last_source_name = "ostream"; + } + else + { + RETURN_IF_ERROR (result_append (dm, "std::basic_ostream >")); + new_last_source_name = "basic_ostream"; + } + *template_p = 0; + break; + + case 'd': + if (!flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, "std::iostream")); + new_last_source_name = "iostream"; + } + else + { + RETURN_IF_ERROR (result_append (dm, "std::basic_iostream >")); + new_last_source_name = "basic_iostream"; + } + *template_p = 0; + break; + + default: + return "Unrecognized ."; + } + + /* Consume the character we just processed. */ + advance_char (dm); + + if (new_last_source_name != NULL) + { + if (!dyn_string_copy_cstr (dm->last_source_name, + new_last_source_name)) + return STATUS_ALLOCATION_FAILED; + } + + return STATUS_OK; + } + + /* Look up the substitution text. Since `S_' is the most recent + substitution, `S0_' is the second-most-recent, etc., shift the + numbering by one. */ + text = substitution_get (dm, seq_id + 1, template_p); + if (text == NULL) + return "Substitution number out of range."; + + /* Emit the substitution text. */ + RETURN_IF_ERROR (result_append_string (dm, text)); + + RETURN_IF_ERROR (demangle_char (dm, '_')); + return STATUS_OK; +} + +/* Demangles and emits a . + + := Z E [] + := Z E s [] */ + +static status_t +demangle_local_name (dm) + demangling_t dm; +{ + DEMANGLE_TRACE ("local-name", dm); + + RETURN_IF_ERROR (demangle_char (dm, 'Z')); + RETURN_IF_ERROR (demangle_encoding (dm)); + RETURN_IF_ERROR (demangle_char (dm, 'E')); + RETURN_IF_ERROR (result_append (dm, "'s ")); + + if (peek_char (dm) == 's') + { + /* Local character string literal. */ + RETURN_IF_ERROR (result_append (dm, "string literal")); + /* Consume the s. */ + advance_char (dm); + RETURN_IF_ERROR (demangle_discriminator (dm, 0)); + } + else + { + int unused; + RETURN_IF_ERROR (result_append (dm, "local ")); + /* Local name for some other entity. Demangle its name. */ + RETURN_IF_ERROR (demangle_name (dm, &unused)); + RETURN_IF_ERROR (demangle_discriminator (dm, 1)); + } + + return STATUS_OK; + } + + /* Optimonally demangles and emits a . If there is no + at the current position in the mangled string, the + descriminator is assumed to be zero. Emit the discriminator number + in parentheses, unless SUPPRESS_FIRST is non-zero and the + discriminator is zero. + + ::= _ */ + +static status_t +demangle_discriminator (dm, suppress_first) + demangling_t dm; + int suppress_first; +{ + /* Output for s to the demangled name is completely + supressed if not in verbose mode. */ + + if (peek_char (dm) == '_') + { + /* Consume the underscore. */ + advance_char (dm); + if (flag_verbose) + RETURN_IF_ERROR (result_append (dm, " [#")); + /* Check if there's a number following the underscore. */ + if (IS_DIGIT ((unsigned char) peek_char (dm))) + { + int discriminator; + /* Demangle the number. */ + RETURN_IF_ERROR (demangle_number (dm, &discriminator, 10, 0)); + if (flag_verbose) + /* Write the discriminator. The mangled number is two + less than the discriminator ordinal, counting from + zero. */ + RETURN_IF_ERROR (int_to_dyn_string (discriminator + 2, + (dyn_string_t) dm->result)); + } + else + { + if (flag_verbose) + /* A missing digit correspond to one. */ + RETURN_IF_ERROR (result_append_char (dm, '1')); + } + if (flag_verbose) + RETURN_IF_ERROR (result_append_char (dm, ']')); + } + else if (!suppress_first) + { + if (flag_verbose) + RETURN_IF_ERROR (result_append (dm, " [#0]")); + } + + return STATUS_OK; +} + +/* Demangle NAME into RESULT, which must be an initialized + dyn_string_t. On success, returns STATUS_OK. On failure, returns + an error message, and the contents of RESULT are unchanged. */ + +static status_t +cp_demangle (name, result) + const char *name; + dyn_string_t result; +{ + status_t status; + int length = strlen (name); + + if (length > 2 && name[0] == '_' && name[1] == 'Z') + { + demangling_t dm = demangling_new (name); + if (dm == NULL) + return STATUS_ALLOCATION_FAILED; + + status = result_push (dm); + if (status != STATUS_OK) + { + demangling_delete (dm); + return status; + } + + status = demangle_mangled_name (dm); + if (STATUS_NO_ERROR (status)) + { + dyn_string_t demangled = (dyn_string_t) result_pop (dm); + if (!dyn_string_copy (result, demangled)) + return STATUS_ALLOCATION_FAILED; + dyn_string_delete (demangled); + } + + demangling_delete (dm); + } + else + { + /* It's evidently not a mangled C++ name. It could be the name + of something with C linkage, though, so just copy NAME into + RESULT. */ + if (!dyn_string_copy_cstr (result, name)) + return STATUS_ALLOCATION_FAILED; + status = STATUS_OK; + } + + return status; +} + +/* Demangle TYPE_NAME into RESULT, which must be an initialized + dyn_string_t. On success, returns STATUS_OK. On failiure, returns + an error message, and the contents of RESULT are unchanged. */ + +static status_t +cp_demangle_type (type_name, result) + const char* type_name; + dyn_string_t result; +{ + status_t status; + demangling_t dm = demangling_new (type_name); + + if (dm == NULL) + return STATUS_ALLOCATION_FAILED; + + /* Demangle the type name. The demangled name is stored in dm. */ + status = result_push (dm); + if (status != STATUS_OK) + { + demangling_delete (dm); + return status; + } + + status = demangle_type (dm); + + if (STATUS_NO_ERROR (status)) + { + /* The demangling succeeded. Pop the result out of dm and copy + it into RESULT. */ + dyn_string_t demangled = (dyn_string_t) result_pop (dm); + if (!dyn_string_copy (result, demangled)) + return STATUS_ALLOCATION_FAILED; + dyn_string_delete (demangled); + } + + /* Clean up. */ + demangling_delete (dm); + + return status; +} + + +#ifdef IN_LIBGCC2 + +extern char *__cxa_demangle PARAMS ((const char *, char *, size_t *, int *)); + +/* ABI-mandated entry point in the C++ runtime library for performing + demangling. MANGLED_NAME is a NUL-terminated character string + containing the name to be demangled. + + OUTPUT_BUFFER is a region of memory, allocated with malloc, of + *LENGTH bytes, into which the demangled name is stored. If + OUTPUT_BUFFER is not long enough, it is expanded using realloc. + OUTPUT_BUFFER may instead be NULL; in that case, the demangled name + is placed in a region of memory allocated with malloc. + + If LENGTH is non-NULL, the length of the buffer conaining the + demangled name, is placed in *LENGTH. + + The return value is a pointer to the start of the NUL-terminated + demangled name, or NULL if the demangling fails. The caller is + responsible for deallocating this memory using free. + + *STATUS is set to one of the following values: + 0: The demangling operation succeeded. + -1: A memory allocation failiure occurred. + -2: MANGLED_NAME is not a valid name under the C++ ABI mangling rules. + -3: One of the arguments is invalid. + + The demagling is performed using the C++ ABI mangling rules, with + GNU extensions. */ + +char * +__cxa_demangle (mangled_name, output_buffer, length, status) + const char *mangled_name; + char *output_buffer; + size_t *length; + int *status; +{ + struct dyn_string demangled_name; + status_t result; + + if (status == NULL) + return NULL; + + if (mangled_name == NULL) { + *status = -3; + return NULL; + } + + /* Did the caller provide a buffer for the demangled name? */ + if (output_buffer == NULL) { + /* No; dyn_string will malloc a buffer for us. */ + if (!dyn_string_init (&demangled_name, 0)) + { + *status = -1; + return NULL; + } + } + else { + /* Yes. Check that the length was provided. */ + if (length == NULL) { + *status = -3; + return NULL; + } + /* Install the buffer into a dyn_string. */ + demangled_name.allocated = *length; + demangled_name.length = 0; + demangled_name.s = output_buffer; + } + + if (mangled_name[0] == '_' && mangled_name[1] == 'Z') + /* MANGLED_NAME apprears to be a function or variable name. + Demangle it accordingly. */ + result = cp_demangle (mangled_name, &demangled_name); + else + /* Try to demangled MANGLED_NAME as the name of a type. */ + result = cp_demangle_type (mangled_name, &demangled_name); + + if (result == STATUS_OK) + /* The demangling succeeded. */ + { + /* If LENGTH isn't NULL, store the allocated buffer length + there; the buffer may have been realloced by dyn_string + functions. */ + if (length != NULL) + *length = demangled_name.allocated; + /* The operation was a success. */ + *status = 0; + return dyn_string_buf (&demangled_name); + } + else if (result == STATUS_ALLOCATION_FAILED) + /* A call to malloc or realloc failed during the demangling + operation. */ + { + *status = -1; + return NULL; + } + else + /* The demangling failed for another reason, most probably because + MANGLED_NAME isn't a valid mangled name. */ + { + /* If the buffer containing the demangled name wasn't provided + by the caller, free it. */ + if (output_buffer == NULL) + free (dyn_string_buf (&demangled_name)); + *status = -2; + return NULL; + } +} + +#else /* !IN_LIBGCC2 */ + +/* Variant entry point for integration with the existing cplus-dem + demangler. Attempts to demangle MANGLED. If the demangling + succeeds, returns a buffer, allocated with malloc, containing the + demangled name. The caller must deallocate the buffer using free. + If the demangling failes, returns NULL. */ + +char * +cplus_demangle_new_abi (mangled) + const char* mangled; +{ + /* Create a dyn_string to hold the demangled name. */ + dyn_string_t demangled = dyn_string_new (0); + /* Attempt the demangling. */ + status_t status = cp_demangle ((char *) mangled, demangled); + if (STATUS_NO_ERROR (status)) + /* Demangling succeeded. */ + { + /* Grab the demangled result from the dyn_string. It was + allocated with malloc, so we can return it directly. */ + char *return_value = dyn_string_release (demangled); + /* Hand back the demangled name. */ + return return_value; + } + else if (status == STATUS_ALLOCATION_FAILED) + { + fprintf (stderr, "Memory allocation failed.\n"); + abort (); + } + else + /* Demangling failed. */ + { + dyn_string_delete (demangled); + return NULL; + } +} + +#endif /* IN_LIBGCC2 */ + +#ifdef STANDALONE_DEMANGLER + +#include "getopt.h" + +static void print_usage + PARAMS ((FILE* fp, int exit_value)); + +/* Non-zero if CHAR is a character than can occur in a mangled name. */ +#define is_mangled_char(CHAR) \ + (IS_ALPHA (CHAR) || IS_DIGIT (CHAR) || (CHAR) == '_') + +/* The name of this program, as invoked. */ +const char* program_name; + +/* Prints usage summary to FP and then exits with EXIT_VALUE. */ + +static void +print_usage (fp, exit_value) + FILE* fp; + int exit_value; +{ + fprintf (fp, "Usage: %s [options] [names ...]\n", program_name); + fprintf (fp, "Options:\n", program_name); + fprintf (fp, " -h,--help Display this message.\n"); + fprintf (fp, " -s,--strict Demangle standard names only.\n"); + fprintf (fp, " -v,--verbose Produce verbose demanglings.\n"); + fprintf (fp, "If names are provided, they are demangled. Otherwise filters standard input.\n"); + + exit (exit_value); +} + +/* Option specification for getopt_long. */ +static struct option long_options[] = +{ + { "help", no_argument, NULL, 'h' }, + { "strict", no_argument, NULL, 's' }, + { "verbose", no_argument, NULL, 'v' }, + { NULL, no_argument, NULL, 0 }, +}; + +/* Main entry for a demangling filter executable. It will demangle + its command line arguments, if any. If none are provided, it will + filter stdin to stdout, replacing any recognized mangled C++ names + with their demangled equivalents. */ + +int +main (argc, argv) + int argc; + char *argv[]; +{ + status_t status; + int i; + int opt_char; + + /* Use the program name of this program, as invoked. */ + program_name = argv[0]; + + /* Parse options. */ + do + { + opt_char = getopt_long (argc, argv, "hsv", long_options, NULL); + switch (opt_char) + { + case '?': /* Unrecognized option. */ + print_usage (stderr, 1); + break; + + case 'h': + print_usage (stdout, 0); + break; + + case 's': + flag_strict = 1; + break; + + case 'v': + flag_verbose = 1; + break; + } + } + while (opt_char != -1); + + if (optind == argc) + /* No command line arguments were provided. Filter stdin. */ + { + dyn_string_t mangled = dyn_string_new (3); + dyn_string_t demangled = dyn_string_new (0); + status_t status; + + /* Read all of input. */ + while (!feof (stdin)) + { + char c = getchar (); + + /* The first character of a mangled name is an underscore. */ + if (feof (stdin)) + break; + if (c != '_') + { + /* It's not a mangled name. Print the character and go + on. */ + putchar (c); + continue; + } + c = getchar (); + + /* The second character of a mangled name is a capital `Z'. */ + if (feof (stdin)) + break; + if (c != 'Z') + { + /* It's not a mangled name. Print the previous + underscore, the `Z', and go on. */ + putchar ('_'); + putchar (c); + continue; + } + + /* Start keeping track of the candidate mangled name. */ + dyn_string_append_char (mangled, '_'); + dyn_string_append_char (mangled, 'Z'); + + /* Pile characters into mangled until we hit one that can't + occur in a mangled name. */ + c = getchar (); + while (!feof (stdin) && is_mangled_char (c)) + { + dyn_string_append_char (mangled, c); + if (feof (stdin)) + break; + c = getchar (); + } + + /* Attempt to demangle the name. */ + status = cp_demangle (dyn_string_buf (mangled), demangled); + + /* If the demangling succeeded, great! Print out the + demangled version. */ + if (STATUS_NO_ERROR (status)) + fputs (dyn_string_buf (demangled), stdout); + /* Abort on allocation failures. */ + else if (status == STATUS_ALLOCATION_FAILED) + { + fprintf (stderr, "Memory allocation failed.\n"); + abort (); + } + /* Otherwise, it might not have been a mangled name. Just + print out the original text. */ + else + fputs (dyn_string_buf (mangled), stdout); + + /* If we haven't hit EOF yet, we've read one character that + can't occur in a mangled name, so print it out. */ + if (!feof (stdin)) + putchar (c); + + /* Clear the candidate mangled name, to start afresh next + time we hit a `_Z'. */ + dyn_string_clear (mangled); + } + + dyn_string_delete (mangled); + dyn_string_delete (demangled); + } + else + /* Demangle command line arguments. */ + { + dyn_string_t result = dyn_string_new (0); + + /* Loop over command line arguments. */ + for (i = optind; i < argc; ++i) + { + /* Attempt to demangle. */ + status = cp_demangle (argv[i], result); + + /* If it worked, print the demangled name. */ + if (STATUS_NO_ERROR (status)) + printf ("%s\n", dyn_string_buf (result)); + /* Abort on allocaiton failures. */ + else if (status == STATUS_ALLOCATION_FAILED) + { + fprintf (stderr, "Memory allocaiton failed.\n"); + abort (); + } + /* If not, print the error message to stderr instead. */ + else + fprintf (stderr, "%s\n", status); + } + dyn_string_delete (result); + } + + return 0; +} + +#endif /* STANDALONE_DEMANGLER */ diff --git a/gnu/dist/toolchain/libiberty/cplus-dem.c b/gnu/dist/toolchain/libiberty/cplus-dem.c index 52249d2b580c..8a672c684b15 100644 --- a/gnu/dist/toolchain/libiberty/cplus-dem.c +++ b/gnu/dist/toolchain/libiberty/cplus-dem.c @@ -252,6 +252,55 @@ typedef enum type_kind_t tk_real } type_kind_t; +struct demangler_engine libiberty_demanglers[] = +{ + { + AUTO_DEMANGLING_STYLE_STRING, + auto_demangling, + "Automatic selection based on executable" + } + , + { + GNU_DEMANGLING_STYLE_STRING, + gnu_demangling, + "GNU (g++) style demangling" + } + , + { + LUCID_DEMANGLING_STYLE_STRING, + lucid_demangling, + "Lucid (lcc) style demangling" + } + , + { + ARM_DEMANGLING_STYLE_STRING, + arm_demangling, + "ARM style demangling" + } + , + { + HP_DEMANGLING_STYLE_STRING, + hp_demangling, + "HP (aCC) style demangling" + } + , + { + EDG_DEMANGLING_STYLE_STRING, + edg_demangling, + "EDG style demangling" + } + , + { + GNU_NEW_ABI_DEMANGLING_STYLE_STRING, + gnu_new_abi_demangling, + "GNU (g++) new-ABI-style demangling" + } + , + { + NULL, unknown_demangling, NULL + } +}; + #define STRING_EMPTY(str) ((str) -> b == (str) -> p) #define PREPEND_BLANK(str) {if (!STRING_EMPTY(str)) \ string_prepend(str, " ");} @@ -268,12 +317,21 @@ typedef enum type_kind_t /* Prototypes for local functions */ +static void +delete_work_stuff PARAMS ((struct work_stuff *)); + +static void +delete_non_B_K_work_stuff PARAMS ((struct work_stuff *)); + static char * mop_up PARAMS ((struct work_stuff *, string *, int)); static void squangle_mop_up PARAMS ((struct work_stuff *)); +static void +work_stuff_copy_to_from PARAMS ((struct work_stuff *, struct work_stuff *)); + #if 0 static int demangle_method_args PARAMS ((struct work_stuff *, const char **, string *)); @@ -379,6 +437,10 @@ static void demangle_function_name PARAMS ((struct work_stuff *, const char **, string *, const char *)); +static int +iterate_demangle_function PARAMS ((struct work_stuff *, + const char **, string *, const char *)); + static void remember_type PARAMS ((struct work_stuff *, const char *, int)); @@ -636,8 +698,8 @@ cplus_demangle_opname (opname, result, options) } } else if (opname[0] == '_' && opname[1] == '_' - && opname[2] >= 'a' && opname[2] <= 'z' - && opname[3] >= 'a' && opname[3] <= 'z') + && islower((unsigned char)opname[2]) + && islower((unsigned char)opname[3])) { if (opname[4] == '\0') { @@ -733,6 +795,7 @@ cplus_demangle_opname (opname, result, options) return ret; } + /* Takes operator name as e.g. "++" and returns mangled operator name (e.g. "postincrement_expr"), or NULL if not found. @@ -758,6 +821,40 @@ cplus_mangle_opname (opname, options) return (0); } +/* Add a routine to set the demangling style to be sure it is valid and + allow for any demangler initialization that maybe necessary. */ + +enum demangling_styles +cplus_demangle_set_style (style) + enum demangling_styles style; +{ + struct demangler_engine *demangler = libiberty_demanglers; + + for (; demangler->demangling_style != unknown_demangling; ++demangler) + if (style == demangler->demangling_style) + { + current_demangling_style = style; + return current_demangling_style; + } + + return unknown_demangling; +} + +/* Do string name to style translation */ + +enum demangling_styles +cplus_demangle_name_to_style (name) + const char *name; +{ + struct demangler_engine *demangler = libiberty_demanglers; + + for (; demangler->demangling_style != unknown_demangling; ++demangler) + if (strcmp (name, demangler->demangling_style_name) == 0) + return demangler->demangling_style; + + return unknown_demangling; +} + /* char *cplus_demangle (const char *mangled, int options) If MANGLED is a mangled function name produced by GNU C++, then @@ -798,6 +895,10 @@ cplus_demangle (mangled, options) if ((work -> options & DMGL_STYLE_MASK) == 0) work -> options |= (int) current_demangling_style & DMGL_STYLE_MASK; + /* The new-ABI demangling is implemented elsewhere. */ + if (GNU_NEW_ABI_DEMANGLING) + return cplus_demangle_new_abi (mangled); + ret = internal_cplus_demangle (work, mangled); squangle_mop_up (work); return (ret); @@ -893,16 +994,85 @@ squangle_mop_up (work) } } -/* Clear out any mangled storage */ -static char * -mop_up (work, declp, success) - struct work_stuff *work; - string *declp; - int success; +/* Copy the work state and storage. */ + +static void +work_stuff_copy_to_from (to, from) + struct work_stuff *to; + struct work_stuff *from; { - char *demangled = NULL; + int i; + delete_work_stuff (to); + + /* Shallow-copy scalars. */ + memcpy (to, from, sizeof (*to)); + + /* Deep-copy dynamic storage. */ + if (from->typevec_size) + to->typevec + = (char **) xmalloc (from->typevec_size * sizeof (to->typevec[0])); + + for (i = 0; i < from->ntypes; i++) + { + int len = strlen (from->typevec[i]) + 1; + + to->typevec[i] = xmalloc (len); + memcpy (to->typevec[i], from->typevec[i], len); + } + + if (from->ksize) + to->ktypevec + = (char **) xmalloc (from->ksize * sizeof (to->ktypevec[0])); + + for (i = 0; i < from->numk; i++) + { + int len = strlen (from->ktypevec[i]) + 1; + + to->ktypevec[i] = xmalloc (len); + memcpy (to->ktypevec[i], from->ktypevec[i], len); + } + + if (from->bsize) + to->btypevec + = (char **) xmalloc (from->bsize * sizeof (to->btypevec[0])); + + for (i = 0; i < from->numb; i++) + { + int len = strlen (from->btypevec[i]) + 1; + + to->btypevec[i] = xmalloc (len); + memcpy (to->btypevec[i], from->btypevec[i], len); + } + + if (from->ntmpl_args) + to->tmpl_argvec + = xmalloc (from->ntmpl_args * sizeof (to->tmpl_argvec[0])); + + for (i = 0; i < from->ntmpl_args; i++) + { + int len = strlen (from->tmpl_argvec[i]) + 1; + + to->tmpl_argvec[i] = xmalloc (len); + memcpy (to->tmpl_argvec[i], from->tmpl_argvec[i], len); + } + + if (from->previous_argument) + { + to->previous_argument = (string*) xmalloc (sizeof (string)); + string_init (to->previous_argument); + string_appends (to->previous_argument, from->previous_argument); + } +} + + +/* Delete dynamic stuff in work_stuff that is not to be re-used. */ + +static void +delete_non_B_K_work_stuff (work) + struct work_stuff *work; +{ /* Discard the remembered types, if any. */ forget_types (work); @@ -929,6 +1099,30 @@ mop_up (work, declp, success) free ((char*) work->previous_argument); work->previous_argument = NULL; } +} + + +/* Delete all dynamic storage in work_stuff. */ +static void +delete_work_stuff (work) + struct work_stuff *work; +{ + delete_non_B_K_work_stuff (work); + squangle_mop_up (work); +} + + +/* Clear out any mangled storage */ + +static char * +mop_up (work, declp, success) + struct work_stuff *work; + string *declp; + int success; +{ + char *demangled = NULL; + + delete_non_B_K_work_stuff (work); /* If demangling was successful, ensure that the demangled string is null terminated and return it. Otherwise, free the demangling decl. */ @@ -1154,7 +1348,7 @@ demangle_signature (work, mangled, declp) break; case '_': - if (GNU_DEMANGLING && expect_return_type) + if ((AUTO_DEMANGLING || GNU_DEMANGLING) && expect_return_type) { /* Read the return type. */ string return_type; @@ -1188,7 +1382,7 @@ demangle_signature (work, mangled, declp) break; case 'H': - if (GNU_DEMANGLING) + if (AUTO_DEMANGLING || GNU_DEMANGLING) { /* A G++ template function. Read the template arguments. */ success = demangle_template (work, mangled, declp, 0, 0, @@ -1433,6 +1627,11 @@ demangle_integral_value (work, mangled, s) { int value; + /* By default, we let the number decide whether we shall consume an + underscore. */ + int consume_following_underscore = 0; + int leave_following_underscore = 0; + success = 0; /* Negative numbers are indicated with a leading `m'. */ @@ -1441,17 +1640,49 @@ demangle_integral_value (work, mangled, s) string_appendn (s, "-", 1); (*mangled)++; } + else if (mangled[0][0] == '_' && mangled[0][1] == 'm') + { + /* Since consume_count_with_underscores does not handle the + `m'-prefix we must do it here, using consume_count and + adjusting underscores: we have to consume the underscore + matching the prepended one. */ + consume_following_underscore = 1; + string_appendn (s, "-", 1); + (*mangled) += 2; + } + else if (**mangled == '_') + { + /* Do not consume a following underscore; + consume_following_underscore will consume what should be + consumed. */ + leave_following_underscore = 1; + } + + /* We must call consume_count if we expect to remove a trailing + underscore, since consume_count_with_underscores expects + the leading underscore (that we consumed) if it is to handle + multi-digit numbers. */ + if (consume_following_underscore) + value = consume_count (mangled); + else + value = consume_count_with_underscores (mangled); - /* Read the rest of the number. */ - value = consume_count_with_underscores (mangled); if (value != -1) { char buf[INTBUF_SIZE]; sprintf (buf, "%d", value); string_append (s, buf); - /* If the next character is an underscore, skip it. */ - if (**mangled == '_') + /* Numbers not otherwise delimited, might have an underscore + appended as a delimeter, which we should skip. + + ??? This used to always remove a following underscore, which + is wrong. If other (arbitrary) cases are followed by an + underscore, we need to do something more radical. */ + + if ((value > 9 || consume_following_underscore) + && ! leave_following_underscore + && **mangled == '_') (*mangled)++; /* All is well. */ @@ -1616,7 +1847,7 @@ demangle_template_value_parm (work, mangled, s, tk) template parameters (e.g. S) is placed in TRAWNAME if TRAWNAME is non-NULL. If IS_TYPE is nonzero, this template is a type template, not a function template. If both IS_TYPE and REMEMBER are nonzero, - the tmeplate is remembered in the list of back-referenceable + the template is remembered in the list of back-referenceable types. */ static int @@ -2148,6 +2379,86 @@ demangle_class (work, mangled, declp) return (success); } + +/* Called when there's a "__" in the mangled name, with `scan' pointing to + the rightmost guess. + + Find the correct "__"-sequence where the function name ends and the + signature starts, which is ambiguous with GNU mangling. + Call demangle_signature here, so we can make sure we found the right + one; *mangled will be consumed so caller will not make further calls to + demangle_signature. */ + +static int +iterate_demangle_function (work, mangled, declp, scan) + struct work_stuff *work; + const char **mangled; + string *declp; + const char *scan; +{ + const char *mangle_init = *mangled; + int success = 0; + string decl_init; + struct work_stuff work_init; + + if (*(scan + 2) == '\0') + return 0; + + /* Do not iterate for some demangling modes, or if there's only one + "__"-sequence. This is the normal case. */ + if (ARM_DEMANGLING || LUCID_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING + || mystrstr (scan + 2, "__") == NULL) + { + demangle_function_name (work, mangled, declp, scan); + return 1; + } + + /* Save state so we can restart if the guess at the correct "__" was + wrong. */ + string_init (&decl_init); + string_appends (&decl_init, declp); + memset (&work_init, 0, sizeof work_init); + work_stuff_copy_to_from (&work_init, work); + + /* Iterate over occurrences of __, allowing names and types to have a + "__" sequence in them. We must start with the first (not the last) + occurrence, since "__" most often occur between independent mangled + parts, hence starting at the last occurence inside a signature + might get us a "successful" demangling of the signature. */ + + while (scan[2]) + { + demangle_function_name (work, mangled, declp, scan); + success = demangle_signature (work, mangled, declp); + if (success) + break; + + /* Reset demangle state for the next round. */ + *mangled = mangle_init; + string_clear (declp); + string_appends (declp, &decl_init); + work_stuff_copy_to_from (work, &work_init); + + /* Leave this underscore-sequence. */ + scan += 2; + + /* Scan for the next "__" sequence. */ + while (*scan && (scan[0] != '_' || scan[1] != '_')) + scan++; + + /* Move to last "__" in this sequence. */ + while (*scan && *scan == '_') + scan++; + scan -= 2; + } + + /* Delete saved state. */ + delete_work_stuff (&work_init); + string_delete (&decl_init); + + return success; +} + /* LOCAL FUNCTION @@ -2163,6 +2474,8 @@ SYNOPSIS DESCRIPTION Consume and demangle the prefix of the mangled name. + While processing the function name root, arrange to call + demangle_signature if the root is ambiguous. DECLP points to the string buffer into which demangled output is placed. On entry, the buffer is empty. On exit it contains @@ -2336,29 +2649,16 @@ demangle_prefix (work, mangled, declp) success = 0; } else - { - const char *tmp; - - /* Look for the LAST occurrence of __, allowing names to - have the '__' sequence embedded in them. */ - if (!(ARM_DEMANGLING || HP_DEMANGLING)) - { - while ((tmp = mystrstr (scan + 2, "__")) != NULL) - scan = tmp; - } - if (*(scan + 2) == '\0') - success = 0; - else - demangle_function_name (work, mangled, declp, scan); - } + return iterate_demangle_function (work, mangled, declp, scan); } } else if (*(scan + 2) != '\0') { /* Mangled name does not start with "__" but does have one somewhere in there with non empty stuff after it. Looks like a global - function name. */ - demangle_function_name (work, mangled, declp, scan); + function name. Iterate over all "__":s until the right + one is found. */ + return iterate_demangle_function (work, mangled, declp, scan); } else { @@ -2512,6 +2812,25 @@ gnu_special (work, mangled, declp) success = 0; break; } + + if (n > 10 && strncmp (*mangled, "_GLOBAL_", 8) == 0 + && (*mangled)[9] == 'N' + && (*mangled)[8] == (*mangled)[10] + && strchr (cplus_markers, (*mangled)[8])) + { + /* A member of the anonymous namespace. There's information + about what identifier or filename it was keyed to, but + it's just there to make the mangled name unique; we just + step over it. */ + string_append (declp, "{anonymous}"); + (*mangled) += n; + + /* Now p points to the marker before the N, so we need to + update it to the first marker after what we consumed. */ + p = strpbrk (*mangled, cplus_markers); + break; + } + string_appendn (declp, *mangled, n); (*mangled) += n; } @@ -2573,7 +2892,7 @@ gnu_special (work, mangled, declp) success = demangle_template (work, mangled, declp, 0, 1, 1); break; default: - success = demangle_fund_type (work, mangled, declp); + success = do_type (work, mangled, declp); break; } if (success && **mangled != '\0') @@ -3311,7 +3630,7 @@ demangle_fund_type (work, mangled, result) int done = 0; int success = 1; char buf[10]; - int dec = 0; + unsigned int dec = 0; string btype; type_kind_t tk = tk_integral; @@ -3455,7 +3774,7 @@ demangle_fund_type (work, mangled, result) *mangled += min (strlen (*mangled), 2); } sscanf (buf, "%x", &dec); - sprintf (buf, "int%i_t", dec); + sprintf (buf, "int%u_t", dec); APPEND_BLANK (result); string_append (result, buf); break; @@ -4188,8 +4507,8 @@ demangle_function_name (work, mangled, declp, scan) } } else if (declp->b[0] == '_' && declp->b[1] == '_' - && declp->b[2] >= 'a' && declp->b[2] <= 'z' - && declp->b[3] >= 'a' && declp->b[3] <= 'z') + && islower((unsigned char)declp->b[2]) + && islower((unsigned char)declp->b[3])) { if (declp->b[4] == '\0') { @@ -4402,6 +4721,7 @@ static int flags = DMGL_PARAMS | DMGL_ANSI; static void demangle_it PARAMS ((char *)); static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN; static void fatal PARAMS ((const char *)) ATTRIBUTE_NORETURN; +static void print_demangler_list PARAMS ((FILE *)); static void demangle_it (mangled_name) @@ -4421,16 +4741,43 @@ demangle_it (mangled_name) } } +static void +print_demangler_list (stream) + FILE *stream; +{ + struct demangler_engine *demangler; + + fprintf (stream, "{%s", libiberty_demanglers->demangling_style_name); + + for (demangler = libiberty_demanglers + 1; + demangler->demangling_style != unknown_demangling; + ++demangler) + fprintf (stream, ",%s", demangler->demangling_style_name); + + fprintf (stream, "}"); +} + static void usage (stream, status) FILE *stream; int status; { fprintf (stream, "\ -Usage: %s [-_] [-n] [-s {gnu,lucid,arm,hp,edg}] [--strip-underscores]\n\ - [--no-strip-underscores] [--format={gnu,lucid,arm,hp,edg}]\n\ - [--help] [--version] [arg...]\n", +Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n", program_name); + + fprintf (stream, "\ + [-s "); + print_demangler_list (stream); + fprintf (stream, "]\n"); + + fprintf (stream, "\ + [--format "); + print_demangler_list (stream); + fprintf (stream, "]\n"); + + fprintf (stream, "\ + [--help] [--version] [arg...]\n"); exit (status); } @@ -4468,6 +4815,9 @@ standard_symbol_characters PARAMS ((void)); static const char * hp_symbol_characters PARAMS ((void)); +static const char * +gnu_new_abi_symbol_characters PARAMS ((void)); + /* Return the string of non-alnum characters that may occur as a valid symbol component, in the standard assembler symbol syntax. */ @@ -4516,6 +4866,17 @@ hp_symbol_characters () } +/* Return the string of non-alnum characters that may occur + as a valid symbol component in the GNU standard C++ ABI mangling + scheme. */ + +static const char * +gnu_new_abi_symbol_characters () +{ + return "_"; +} + + extern int main PARAMS ((int, char **)); int @@ -4553,32 +4914,19 @@ main (argc, argv) flags |= DMGL_JAVA; break; case 's': - if (strcmp (optarg, "gnu") == 0) - { - current_demangling_style = gnu_demangling; - } - else if (strcmp (optarg, "lucid") == 0) - { - current_demangling_style = lucid_demangling; - } - else if (strcmp (optarg, "arm") == 0) - { - current_demangling_style = arm_demangling; - } - else if (strcmp (optarg, "hp") == 0) - { - current_demangling_style = hp_demangling; - } - else if (strcmp (optarg, "edg") == 0) - { - current_demangling_style = edg_demangling; - } - else - { - fprintf (stderr, "%s: unknown demangling style `%s'\n", - program_name, optarg); - return (1); - } + { + enum demangling_styles style; + + style = cplus_demangle_name_to_style (optarg); + if (style == unknown_demangling) + { + fprintf (stderr, "%s: unknown demangling style `%s'\n", + program_name, optarg); + return (1); + } + else + cplus_demangle_set_style (style); + } break; } } @@ -4603,6 +4951,9 @@ main (argc, argv) case hp_demangling: valid_symbols = hp_symbol_characters (); break; + case gnu_new_abi_demangling: + valid_symbols = gnu_new_abi_symbol_characters (); + break; default: /* Folks should explicitly indicate the appropriate alphabet for each demangling. Providing a default would allow the @@ -4652,6 +5003,7 @@ main (argc, argv) if (c == EOF) break; putchar (c); + fflush (stdout); } } diff --git a/gnu/dist/toolchain/libiberty/dyn-string.c b/gnu/dist/toolchain/libiberty/dyn-string.c new file mode 100644 index 000000000000..69897f84c5e6 --- /dev/null +++ b/gnu/dist/toolchain/libiberty/dyn-string.c @@ -0,0 +1,409 @@ +/* An abstract string datatype. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by Mark Mitchell (mark@markmitchell.com). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#ifdef HAVE_STRING_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#include "libiberty.h" +#include "dyn-string.h" + +/* If this file is being compiled for inclusion in the C++ runtime + library, as part of the demangler implementation, we don't want to + abort if an allocation fails. Instead, percolate an error code up + through the call chain. */ + +#ifdef IN_LIBGCC2 +#define RETURN_ON_ALLOCATION_FAILURE +#endif + +/* Performs in-place initialization of a dyn_string struct. This + function can be used with a dyn_string struct on the stack or + embedded in another object. The contents of of the string itself + are still dynamically allocated. The string initially is capable + of holding at least SPACE characeters, including the terminating + NUL. If SPACE is 0, it will silently be increated to 1. + + If RETURN_ON_ALLOCATION_FAILURE is defined and memory allocation + fails, returns 0. Otherwise returns 1. */ + +int +dyn_string_init (ds_struct_ptr, space) + struct dyn_string *ds_struct_ptr; + int space; +{ + /* We need at least one byte in which to store the terminating NUL. */ + if (space == 0) + space = 1; + +#ifdef RETURN_ON_ALLOCATION_FAILURE + ds_struct_ptr->s = (char *) malloc (space); + if (ds_struct_ptr->s == NULL) + return 0; +#else + ds_struct_ptr->s = (char *) xmalloc (space); +#endif + ds_struct_ptr->allocated = space; + ds_struct_ptr->length = 0; + ds_struct_ptr->s[0] = '\0'; + + return 1; +} + +/* Create a new dynamic string capable of holding at least SPACE + characters, including the terminating NUL. If SPACE is 0, it will + be silently increased to 1. If RETURN_ON_ALLOCATION_FAILURE is + defined and memory allocation fails, returns NULL. Otherwise + returns the newly allocated string. */ + +dyn_string_t +dyn_string_new (space) + int space; +{ + dyn_string_t result; +#ifdef RETURN_ON_ALLOCATION_FAILURE + result = (dyn_string_t) malloc (sizeof (struct dyn_string)); + if (result == NULL) + return NULL; + if (!dyn_string_init (result, space)) + { + free (result); + return NULL; + } +#else + result = (dyn_string_t) xmalloc (sizeof (struct dyn_string)); + dyn_string_init (result, space); +#endif + return result; +} + +/* Free the memory used by DS. */ + +void +dyn_string_delete (ds) + dyn_string_t ds; +{ + free (ds->s); + free (ds); +} + +/* Returns the contents of DS in a buffer allocated with malloc. It + is the caller's responsibility to deallocate the buffer using free. + DS is then set to the empty string. Deletes DS itself. */ + +char* +dyn_string_release (ds) + dyn_string_t ds; +{ + /* Store the old buffer. */ + char* result = ds->s; + /* The buffer is no longer owned by DS. */ + ds->s = NULL; + /* Delete DS. */ + free (ds); + /* Return the old buffer. */ + return result; +} + +/* Increase the capacity of DS so it can hold at least SPACE + characters, plus the terminating NUL. This function will not (at + present) reduce the capacity of DS. Returns DS on success. + + If RETURN_ON_ALLOCATION_FAILURE is defined and a memory allocation + operation fails, deletes DS and returns NULL. */ + +dyn_string_t +dyn_string_resize (ds, space) + dyn_string_t ds; + int space; +{ + int new_allocated = ds->allocated; + + /* Increase SPACE to hold the NUL termination. */ + ++space; + + /* Increase allocation by factors of two. */ + while (space > new_allocated) + new_allocated *= 2; + + if (new_allocated != ds->allocated) + { + ds->allocated = new_allocated; + /* We actually need more space. */ +#ifdef RETURN_ON_ALLOCATION_FAILURE + ds->s = (char *) realloc (ds->s, ds->allocated); + if (ds->s == NULL) + { + free (ds); + return NULL; + } +#else + ds->s = (char *) xrealloc (ds->s, ds->allocated); +#endif + } + + return ds; +} + +/* Sets the contents of DS to the empty string. */ + +void +dyn_string_clear (ds) + dyn_string_t ds; +{ + /* A dyn_string always has room for at least the NUL terminator. */ + ds->s[0] = '\0'; + ds->length = 0; +} + +/* Makes the contents of DEST the same as the contents of SRC. DEST + and SRC must be distinct. Returns 1 on success. On failure, if + RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ + +int +dyn_string_copy (dest, src) + dyn_string_t dest; + dyn_string_t src; +{ + if (dest == src) + abort (); + + /* Make room in DEST. */ + if (dyn_string_resize (dest, src->length) == NULL) + return 0; + /* Copy DEST into SRC. */ + strcpy (dest->s, src->s); + /* Update the size of DEST. */ + dest->length = src->length; + return 1; +} + +/* Copies SRC, a NUL-terminated string, into DEST. Returns 1 on + success. On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST + and returns 0. */ + +int +dyn_string_copy_cstr (dest, src) + dyn_string_t dest; + const char *src; +{ + int length = strlen (src); + /* Make room in DEST. */ + if (dyn_string_resize (dest, length) == NULL) + return 0; + /* Copy DEST into SRC. */ + strcpy (dest->s, src); + /* Update the size of DEST. */ + dest->length = length; + return 1; +} + +/* Inserts SRC at the beginning of DEST. DEST is expanded as + necessary. SRC and DEST must be distinct. Returns 1 on success. + On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and + returns 0. */ + +int +dyn_string_prepend (dest, src) + dyn_string_t dest; + dyn_string_t src; +{ + return dyn_string_insert (dest, 0, src); +} + +/* Inserts SRC, a NUL-terminated string, at the beginning of DEST. + DEST is expanded as necessary. Returns 1 on success. On failure, + if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ + +int +dyn_string_prepend_cstr (dest, src) + dyn_string_t dest; + const char *src; +{ + return dyn_string_insert_cstr (dest, 0, src); +} + +/* Inserts SRC into DEST starting at position POS. DEST is expanded + as necessary. SRC and DEST must be distinct. Returns 1 on + success. On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST + and returns 0. */ + +int +dyn_string_insert (dest, pos, src) + dyn_string_t dest; + int pos; + dyn_string_t src; +{ + int i; + + if (src == dest) + abort (); + + if (dyn_string_resize (dest, dest->length + src->length) == NULL) + return 0; + /* Make room for the insertion. Be sure to copy the NUL. */ + for (i = dest->length; i >= pos; --i) + dest->s[i + src->length] = dest->s[i]; + /* Splice in the new stuff. */ + strncpy (dest->s + pos, src->s, src->length); + /* Compute the new length. */ + dest->length += src->length; + return 1; +} + +/* Inserts SRC, a NUL-terminated string, into DEST starting at + position POS. DEST is expanded as necessary. Returns 1 on + success. On failure, RETURN_ON_ALLOCATION_FAILURE, deletes DEST + and returns 0. */ + +int +dyn_string_insert_cstr (dest, pos, src) + dyn_string_t dest; + int pos; + const char *src; +{ + int i; + int length = strlen (src); + + if (dyn_string_resize (dest, dest->length + length) == NULL) + return 0; + /* Make room for the insertion. Be sure to copy the NUL. */ + for (i = dest->length; i >= pos; --i) + dest->s[i + length] = dest->s[i]; + /* Splice in the new stuff. */ + strncpy (dest->s + pos, src, length); + /* Compute the new length. */ + dest->length += length; + return 1; +} + +/* Append S to DS, resizing DS if necessary. Returns 1 on success. + On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and + returns 0. */ + +int +dyn_string_append (dest, s) + dyn_string_t dest; + dyn_string_t s; +{ + if (dyn_string_resize (dest, dest->length + s->length) == 0) + return 0; + strcpy (dest->s + dest->length, s->s); + dest->length += s->length; + return 1; +} + +/* Append the NUL-terminated string S to DS, resizing DS if necessary. + Returns 1 on success. On failure, if RETURN_ON_ALLOCATION_FAILURE, + deletes DEST and returns 0. */ + +int +dyn_string_append_cstr (dest, s) + dyn_string_t dest; + const char *s; +{ + int len = strlen (s); + + /* The new length is the old length plus the size of our string, plus + one for the null at the end. */ + if (dyn_string_resize (dest, dest->length + len) == NULL) + return 0; + strcpy (dest->s + dest->length, s); + dest->length += len; + return 1; +} + +/* Appends C to the end of DEST. Returns 1 on success. On failiure, + if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ + +int +dyn_string_append_char (dest, c) + dyn_string_t dest; + int c; +{ + /* Make room for the extra character. */ + if (dyn_string_resize (dest, dest->length + 1) == NULL) + return 0; + /* Append the character; it will overwrite the old NUL. */ + dest->s[dest->length] = c; + /* Add a new NUL at the end. */ + dest->s[dest->length + 1] = '\0'; + /* Update the length. */ + ++(dest->length); + return 1; +} + +/* Sets the contents of DEST to the substring of SRC starting at START + and ending before END. START must be less than or equal to END, + and both must be between zero and the length of SRC, inclusive. + Returns 1 on success. On failure, if RETURN_ON_ALLOCATION_FAILURE, + deletes DEST and returns 0. */ + +int +dyn_string_substring (dest, src, start, end) + dyn_string_t dest; + dyn_string_t src; + int start; + int end; +{ + int i; + int length = end - start; + + if (start > end || start > src->length || end > src->length) + abort (); + + /* Make room for the substring. */ + if (dyn_string_resize (dest, length) == NULL) + return 0; + /* Copy the characters in the substring, */ + for (i = length; --i >= 0; ) + dest->s[i] = src->s[start + i]; + /* NUL-terimate the result. */ + dest->s[length] = '\0'; + /* Record the length of the substring. */ + dest->length = length; + + return 1; +} + +/* Returns non-zero if DS1 and DS2 have the same contents. */ + +int +dyn_string_eq (ds1, ds2) + dyn_string_t ds1; + dyn_string_t ds2; +{ + /* If DS1 and DS2 have different lengths, they must not be the same. */ + if (ds1->length != ds2->length) + return 0; + else + return !strcmp (ds1->s, ds2->s); +} diff --git a/gnu/dist/toolchain/libiberty/testsuite/demangle-expected b/gnu/dist/toolchain/libiberty/testsuite/demangle-expected index d3a1fe43890d..a5d72fab0fe6 100644 --- a/gnu/dist/toolchain/libiberty/testsuite/demangle-expected +++ b/gnu/dist/toolchain/libiberty/testsuite/demangle-expected @@ -2486,3 +2486,83 @@ f(Bar<21>, int) --format=gnu f__FGt3Bar1i24XY_t f(Bar<2>, XY_t) +# +--format=gnu +foo__H1Zt2TA2ZRCiZt2NA1Ui9_X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZcZt2NA1Ui_20__X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZiZt8N___A___1Ui_99__X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZRCiZt2NA1im1_X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZRCiZt2NA1im9_X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZcZt2NA1i_m20__X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZcZt2NA1im1_X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZiZt4N__A1im9_X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZiZt4N__A1i_m99__X01_i +int foo > >(TA >) +# +--format=gnu +__opi__t2TA2ZiZt4N__A1i9 +TA >::operator int(void) +# +--format=gnu +__opi__t2TA2ZiZt8N___A___1i_m99_ +TA >::operator int(void) +# +--format=gnu +foo___bar__baz_____H1Zt2TA2ZiZt8N___A___1i_99__X01_i +int foo___bar__baz___ > >(TA >) +# +--format=gnu +foo__bar___foobar_____t2TA2ZiZt8N___A___1i_m99_ +TA >::foo__bar___foobar___(void) +# +--format=gnu +foo__bar___foobar_____t2TA2ZiZt4N__A1i9 +TA >::foo__bar___foobar___(void) +# +--format=gnu +__tfP8sockaddr +sockaddr * type_info function +# +--format=gnu +__tfPQ25libcwt16option_event_tct1Z12burst_app_ct +libcw::option_event_tct * type_info function +# +--format=gnu +__tiP8sockaddr +sockaddr * type_info node +# +--format=gnu +__tiPQ25libcwt16option_event_tct1Z12burst_app_ct +libcw::option_event_tct * type_info node +# +--format=gnu +_27_GLOBAL_.N.__12burst_app_ct.app_instance +{anonymous}::app_instance +# +--format=gnu +_26_GLOBAL_\$N\$_tmp_n.iilg4Gya\$app_instance +{anonymous}::app_instance diff --git a/gnu/dist/toolchain/libiberty/testsuite/regress-demangle b/gnu/dist/toolchain/libiberty/testsuite/regress-demangle index bd48ce9013ec..1086762dbb26 100755 --- a/gnu/dist/toolchain/libiberty/testsuite/regress-demangle +++ b/gnu/dist/toolchain/libiberty/testsuite/regress-demangle @@ -15,6 +15,8 @@ sed -e '/^#/ d' "$1" | ( if test "x$x" != "x$demangled"; then failures=`expr $failures + 1` echo "FAIL: $type $mangled" + echo " result: $x" + echo " expected: $demangled" fi done diff --git a/gnu/dist/toolchain/ltconfig b/gnu/dist/toolchain/ltconfig index ab304fd3b731..a01334f9212c 100755 --- a/gnu/dist/toolchain/ltconfig +++ b/gnu/dist/toolchain/ltconfig @@ -2,7 +2,7 @@ # ltconfig - Create a system-specific libtool. # Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 +# Originally by Gordon Matzigkeit , 1996 # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -32,12 +32,8 @@ if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null`" = 'X\t'; then # Yippee, $echo works! : @@ -46,9 +42,18 @@ else exec "$SHELL" "$0" --no-reexec ${1+"$@"} fi +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null`} case X$UNAME in *-DOS) PATH_SEPARATOR=';' ;; @@ -58,9 +63,9 @@ fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi -if test "X${echo_test_string+set}" != "Xset"; then +if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... @@ -82,7 +87,7 @@ if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do - if test -f $dir/echo && + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$dir/echo" @@ -97,7 +102,8 @@ if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' - elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" export ORIGINAL_CONFIG_SHELL @@ -163,10 +169,10 @@ progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool -VERSION=1.2f -TIMESTAMP=" (1.385 1999/03/15 17:24:54)" -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' +VERSION=1.3.4 +TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)" +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." @@ -175,10 +181,12 @@ help="Try \`$progname --help' for more information." default_ofile=libtool can_build_shared=yes enable_shared=yes -# All known linkers require a `.a' archive for static linking. +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). enable_static=yes enable_fast_install=yes enable_dlopen=unknown +enable_win32_dll=no ltmain= silent= srcdir= @@ -194,17 +202,21 @@ need_locks=yes ac_ext=c objext=o libext=a +exeext= cache_file= old_AR="$AR" old_CC="$CC" old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" +old_LDFLAGS="$LDFLAGS" old_LD="$LD" old_LN_S="$LN_S" +old_LIBS="$LIBS" old_NM="$NM" old_RANLIB="$RANLIB" old_DLLTOOL="$DLLTOOL" +old_OBJDUMP="$OBJDUMP" old_AS="$AS" # Parse the command line options. @@ -235,7 +247,7 @@ Generate a system-specific libtool script. --disable-static do not build static libraries --disable-fast-install do not optimize for fast installation --enable-dlopen enable dlopen support - --enable-dlopen-self enable support for dlopening programs + --enable-win32-dll enable building dlls on win32 hosts --help display this help and exit --no-verify do not verify that HOST is a valid host type -o, --output=FILE specify the output file [default=$default_ofile] @@ -269,6 +281,8 @@ EOM --enable-dlopen) enable_dlopen=yes ;; + --enable-win32-dll) enable_win32_dll=yes ;; + --quiet | --silent) silent=yes ;; --srcdir) prev=srcdir ;; @@ -355,8 +369,8 @@ exec 5>>./config.log # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi +if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi if test -n "$cache_file" && test -r "$cache_file"; then echo "loading cache $cache_file within ltconfig" @@ -448,7 +462,7 @@ aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "${COLLECT_NAMES+set}" != set; then + if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -463,6 +477,9 @@ old_postuninstall_cmds= # Set a sane default for `AR'. test -z "$AR" && AR=ar +# Set a sane default for `OBJDUMP'. +test -z "$OBJDUMP" && OBJDUMP=objdump + # If RANLIB is not set, then run the test. if test "${RANLIB+set}" != "set"; then result=no @@ -471,7 +488,7 @@ if test "${RANLIB+set}" != "set"; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. - if test -f $dir/ranlib; then + if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then RANLIB="ranlib" result="ranlib" break @@ -487,8 +504,9 @@ if test -n "$RANLIB"; then old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi -# Set sane defaults for `DLLTOOL' and `AS', used on cygwin. +# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$AS" && AS=as # Check to see if we are using GCC. @@ -498,9 +516,8 @@ if test "$with_gcc" != yes || test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do - IFS="$save_ifs" test -z "$dir" && dir=. - if test -f $dir/gcc; then + if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then CC="gcc" break fi @@ -521,7 +538,7 @@ if test "$with_gcc" != yes || test -z "$CC"; then cc_rejected=no for dir in $PATH; do test -z "$dir" && dir=. - if test -f $dir/cc; then + if test -f $dir/cc || test -f $dir/cc$ac_exeext; then if test "$dir/cc" = "/usr/ucb/cc"; then cc_rejected=yes continue @@ -561,7 +578,7 @@ if test "$with_gcc" != yes || test -z "$CC"; then # Now see if the compiler is really GCC. with_gcc=no echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 - echo "$progname:564: checking whether we are using GNU C" >&5 + echo "$progname:581: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c @@ -583,8 +600,8 @@ compiler="$2" echo $ac_n "checking for object suffix... $ac_c" 1>&6 $rm conftest* echo 'int i = 1;' > conftest.c -echo "$progname:586: checking for object suffix" >& 5 -if { (eval echo $progname:587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then +echo "$progname:603: checking for object suffix" >& 5 +if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 @@ -602,6 +619,38 @@ fi $rm conftest* echo "$ac_t$objext" 1>&6 +echo $ac_n "checking for executable suffix... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_exeext="no" + $rm conftest* + echo 'main () { return 0; }' > conftest.c + echo "$progname:629: checking for executable suffix" >& 5 + if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + + for ac_file in conftest.*; do + case $ac_file in + *.c | *.err | *.$objext ) ;; + *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; + esac + done + else + cat conftest.err 1>&5 + echo "$progname: failed program was:" >&5 + cat conftest.c >&5 + fi + $rm conftest* +fi +if test "X$ac_cv_exeext" = Xno; then + exeext="" +else + exeext="$ac_cv_exeext" +fi +echo "$ac_t$ac_cv_exeext" 1>&6 + echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 pic_flag= special_shlib_compile_flags= @@ -614,7 +663,7 @@ if test "$with_gcc" = yes; then link_static_flag='-static' case "$host_os" in - beos* | irix5* | irix6* | osf3* | osf4*) + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) @@ -635,6 +684,11 @@ if test "$with_gcc" = yes; then # like `-m68040'. pic_flag='-m68020 -resident32 -malways-restore-a4' ;; + sysv4*MP*) + if test -d /usr/nec; then + pic_flag=-Kconform_pic + fi + ;; *) pic_flag='-fPIC' ;; @@ -664,7 +718,7 @@ else # We can build DLLs from non-PIC. ;; - osf3* | osf4*) + osf3* | osf4* | osf5*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' @@ -688,7 +742,7 @@ else wl='-Qoption ld ' ;; - sysv4.2uw2* | sysv4.3* | sysv5*) + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' @@ -698,7 +752,12 @@ else pic_flag='-pic' link_static_flag='-Bstatic' ;; - + sysv4*MP*) + if test -d /usr/nec ;then + pic_flag='-Kconform_pic' + link_static_flag='-Bstatic' + fi + ;; *) can_build_shared=no ;; @@ -714,8 +773,8 @@ if test -n "$pic_flag"; then echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" - echo "$progname:717: checking if $compiler PIC flag $pic_flag works" >&5 - if { (eval echo $progname:718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then + echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 + if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 @@ -753,16 +812,26 @@ fi # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 +$rm -r conftest 2>/dev/null +mkdir conftest +cd conftest $rm conftest* echo "int some_variable = 0;" > conftest.c +mkdir out +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers +# that will create temporary files in the current directory regardless of +# the output directory. Thus, making CWD read-only will cause this test +# to fail, enabling locking or at least warning the user not to do parallel +# builds. +chmod -w . save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -c -o conftest2.o" -echo "$progname:760: checking if $compiler supports -c -o file.o" >&5 -if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then +CFLAGS="$CFLAGS -o out/conftest2.o" +echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 +if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - if test -s conftest.err; then + if test -s out/conftest.err; then echo "$ac_t"no 1>&6 compiler_c_o=no else @@ -771,12 +840,17 @@ if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conft fi else # Append any errors to the config.log. - cat conftest.err 1>&5 + cat out/conftest.err 1>&5 compiler_c_o=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" -$rm conftest* +chmod u+w . +$rm conftest* out/* +rmdir out +cd .. +rmdir conftest +$rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo @@ -785,8 +859,8 @@ if test x"$compiler_c_o" = x"yes"; then echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" - echo "$progname:788: checking if $compiler supports -c -o file.lo" >&5 -if { (eval echo $progname:789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then + echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 +if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -837,8 +911,8 @@ if test "$with_gcc" = yes; then echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" - echo "$progname:840: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 - if { (eval echo $progname:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then + echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 + if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -881,8 +955,8 @@ $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" -echo "$progname:884: checking if $compiler static flag $link_static_flag works" >&5 -if { (eval echo $progname:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 +if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then echo "$ac_t$link_static_flag" 1>&6 else echo "$ac_t"none 1>&6 @@ -894,9 +968,9 @@ $rm conftest* if test -z "$LN_S"; then # Check to see if we can use ln -s, or we need hard links. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 - $rm conftestdata - if ln -s X conftestdata 2>/dev/null; then - $rm conftestdata + $rm conftest.dat + if ln -s X conftest.dat 2>/dev/null; then + $rm conftest.dat LN_S="ln -s" else LN_S=ln @@ -914,11 +988,11 @@ if test -z "$LD"; then if test "$with_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 - echo "$progname:917: checking for ld used by GCC" >&5 + echo "$progname:991: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. - /* | [A-Za-z]:[\\/]*) + [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` @@ -938,17 +1012,17 @@ if test -z "$LD"; then esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld... $ac_c" 1>&6 - echo "$progname:941: checking for GNU ld" >&5 + echo "$progname:1015: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 - echo "$progname:944: checking for non-GNU ld" >&5 + echo "$progname:1018: checking for non-GNU ld" >&5 fi if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog"; then + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. @@ -1007,7 +1081,7 @@ hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= always_export_symbols=no -export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= @@ -1015,7 +1089,12 @@ include_expsyms= # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. -exclude_expsyms= +exclude_expsyms="_GLOBAL_OFFSET_TABLE_" +# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +# platforms (ab)use it in PIC code, but their linkers get confused if +# the symbol is explicitly referenced. Since portable code cannot +# rely on this symbol name, it's probably fine to never include it in +# preloaded symbol tables. case "$host_os" in cygwin* | mingw*) @@ -1027,10 +1106,6 @@ cygwin* | mingw*) fi ;; -freebsd2* | sunos4*) - exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - ;; - esac ld_shlibs=yes @@ -1058,18 +1133,21 @@ EOF archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes - ;; - sunos4*) - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' - wlarc= - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no @@ -1086,25 +1164,64 @@ EOF # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. - export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~ - sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ - (cd $objdir && $CC -c $soname-ltdll.c)~ - $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~ + export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ + test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ + $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; for symbol in `cat $export_symbols`; do - echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; + echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; _lt_hint=`expr 1 + \$_lt_hint`; done~ + test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ + test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' - old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' + old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' + # can we support soname and/or expsyms with a.out? -oliva + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no ;; *) @@ -1121,7 +1238,20 @@ EOF runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + case $host_os in + cygwin* | mingw*) + # dlltool doesn't understand --whole-archive et. al. + whole_archive_flag_spec= + ;; + *) + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + ;; + esac fi else # PORTME fill in a description of your system's linker (not GNU ld) @@ -1141,35 +1271,45 @@ else ;; aix4*) - allow_undefined_flag= + hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' + hardcode_libdir_separator=':' if test "$with_gcc" = yes; then - if strings `${CC} -print-prog-name=collect2` | \ - grep resolve_lib_name >/dev/null + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= fi - archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts' + shared_flag='-shared' else - always_export_symbols=yes - archive_expsym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry' + shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi - hardcode_minus_L=yes - # Though LIBPATH variable hardcodes shlibpath into executable, - # it doesn't affect searching for -l* libraries; this confuses - # tests in mdemo. - hardcode_shlibpath_var=unsupported - hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=' ${wl}-berok' + archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' + archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' + case "$host_os" in aix4.[01]|aix4.[01].*) + # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on + always_export_symbols=yes ;; + esac ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no ;; cygwin* | mingw*) @@ -1192,7 +1332,6 @@ else freebsd1*) ld_shlibs=no - can_build_shared=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor @@ -1203,7 +1342,6 @@ else archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes - hardcode_minus_L=no # verified on 2.2.6 hardcode_shlibpath_var=no ;; @@ -1220,31 +1358,27 @@ else archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes - hardcode_minus_L=no hardcode_shlibpath_var=no ;; - hpux9*) - archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' + hpux9* | hpux10* | hpux11*) + case "$host_os" in + hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; + *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; + esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: hardcode_direct=yes - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10* | hpux11*) - archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_direct=yes - hardcode_minus_L=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$with_gcc" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else - archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' + archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: @@ -1276,21 +1410,35 @@ else old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; - osf3* | osf4*) + osf3*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # As osf3* with the addition of the -msym flag + if test "$with_gcc" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; sco3.2v5*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes ;; solaris*) @@ -1302,63 +1450,100 @@ else $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no + case "$host_os" in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac ;; sunos4*) - # Why do we need -Bstatic? To avoid inter-library dependencies, maybe... - if test "$with_gcc" = yes; then - # Use -fPIC here because libgcc is multilibbed - archive_cmds='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs $linkopts' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' - fi + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; + sysv4) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=no - hardcode_minus_L=no hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no - hardcode_minus_L=no hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no + hardcode_shlibpath_var=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + unixware7*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no ;; *) ld_shlibs=no - can_build_shared=no ;; esac fi echo "$ac_t$ld_shlibs" 1>&6 +test "$ld_shlibs" = no && can_build_shared=no if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 case "$NM" in - /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path. + [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm; then + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored @@ -1416,6 +1601,9 @@ irix*) solaris*) symcode='[BDT]' ;; +sysv4) + symcode='[DFNSTU]' + ;; esac # If we're using GNU nm, then use its standard symbol codes. @@ -1444,11 +1632,11 @@ void nm_test_func(){} main(){nm_test_var='a';nm_test_func();return(0);} EOF - echo "$progname:1447: checking if global_symbol_pipe works" >&5 - if { (eval echo $progname:1448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + echo "$progname:1635: checking if global_symbol_pipe works" >&5 + if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm - if { echo "$progname:1451: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -1495,12 +1683,12 @@ EOF #endif EOF # Now try linking the two files. - mv conftest.$objext conftestm.$objext + mv conftest.$objext conftstm.$objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" - LIBS="conftestm.$objext" + LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 @@ -1520,7 +1708,7 @@ EOF echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi - $rm conftest* + $rm conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then @@ -1529,7 +1717,11 @@ EOF global_symbol_pipe= fi done -echo "$ac_t$pipe_works" 1>&6 +if test "$pipe_works" = yes; then + echo "${ac_t}ok" 1>&6 +else + echo "${ac_t}failed" 1>&6 +fi if test -z "$global_symbol_pipe"; then global_symbol_to_cdecl= @@ -1542,10 +1734,12 @@ if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && \ - test "$hardcode_minus_L" != no && \ - test "$hardcode_shlibpath_var" != no; then - + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else @@ -1628,19 +1822,25 @@ beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH + deplibs_check_method=pass_all + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes ;; bsdi4*) version_type=linux - library_names_spec='${libname}.so$major ${libname}.so' - soname_spec='${libname}.so' - finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir' + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH - deplibs_check_method='file_magic ELF 32-bit LSB shared object' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs @@ -1648,17 +1848,20 @@ bsdi4*) cygwin* | mingw*) version_type=windows + need_version=no + need_lib_prefix=no if test "$with_gcc" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' - deplibs_check_method='file_magic file format pei*-i386.*architecture: i386' - file_magic_cmd='objdump -f' - need_lib_prefix=no + deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + file_magic_cmd='${OBJDUMP} -f' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= ;; freebsd1*) @@ -1683,13 +1886,23 @@ freebsd*) need_version=yes ;; esac - finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH + case "$host_os" in + freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + ;; + esac ;; gnu*) version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}.so' + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -1701,46 +1914,41 @@ hpux9* | hpux10* | hpux11*) need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; -irix5*) - version_type=irix - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" # or should it be pass_all? - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.so*` - shlibpath_overrides_runpath=no - ;; - -irix6*) +irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - case "$LD" in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; + soname_spec='${libname}${release}.so.$major' + library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' + case "$host_os" in + irix5*) + libsuff= shlibsuff= + # this will be overridden with pass_all, but let us keep it just in case + deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case "$LD" in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - # even though /usr/local/lib is always searched, the man-page says - # shared libraries should not be installed there if they use an ABI - # different from -32, so we'd better not search for shared libraries - # there either - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" # or should it be pass_all? + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib${libsuff}/libc.so*` + deplibs_check_method='pass_all' ;; # No shared lib support for Linux oldld, aout, or coff. @@ -1755,7 +1963,7 @@ linux-gnu*) need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' @@ -1777,7 +1985,7 @@ netbsd*) version_type=sunos if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' @@ -1806,19 +2014,17 @@ os2*) shlibpath_var=LIBPATH ;; -osf3* | osf4*) +osf3* | osf4* | osf5*) version_type=osf + need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH - # deplibs_check_method='pass_all' - # Although pass_all appears to work, it copies symbols from static libraries - # into shared ones and exports them. So, when a program is linked with two - # or more libraries that have got copies of the same symbols, link fails - # This was only tested on osf4: + # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so + deplibs_check_method='pass_all' sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; @@ -1857,7 +2063,7 @@ sunos4*) need_version=yes ;; -sysv4.2uw2* | sysv4.3* | sysv5*) +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' @@ -1866,6 +2072,15 @@ sysv4.2uw2* | sysv4.3* | sysv5*) ncr) deplibs_check_method='pass_all' ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /usr/lib/libc.so*` + ;; esac ;; @@ -1885,6 +2100,15 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + *) dynamic_linker=no ;; @@ -1895,6 +2119,17 @@ test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 +# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in +# configure.in, otherwise build static only libraries. +case "$host_os" in +cygwin* | mingw* | os2*) + if test x$can_build_shared = xyes; then + test x$enable_win32_dll = xno && can_build_shared=no + echo "checking if package supports dlls... $can_build_shared" 1>&6 + fi +;; +esac + if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then case "$deplibs_check_method" in "file_magic "*) @@ -1973,53 +2208,8 @@ if test "x$enable_dlopen" != xyes; then else if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= -echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:1977: checking for dlopen" >&5 -if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -dlopen(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_dlopen=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_dlopen=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" -else - echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:2022: checking for dlopen in -ldl" >&5 +echo "$progname:2212: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2027,17 +2217,20 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2055,8 +2248,55 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dlopen""... $ac_c" 1>&6 +echo "$progname:2252: checking for dlopen" >&5 +if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +dlopen(); +#endif + +; return 0; } +EOF +if { (eval echo $progname:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_dlopen=yes" +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_dlopen=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" +else + echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:2059: checking for dld_link in -ldld" >&5 +echo "$progname:2299: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2064,17 +2304,20 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2093,18 +2336,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:2096: checking for shl_load" >&5 +echo "$progname:2339: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char shl_load(); int main() { @@ -2120,7 +2366,7 @@ shl_load(); ; return 0; } EOF -if { (eval echo $progname:2123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -2137,54 +2383,50 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 -echo $ac_n "checking for LoadLibrary""... $ac_c" 1>&6 -echo "$progname:2141: checking for LoadLibrary" >&5 -if eval "test \"`echo '$''{'ac_cv_func_LoadLibrary'+set}'`\" = set"; then +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "$progname:2387: checking for shl_load in -ldld" >&5 +ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_LoadLibrary=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_LoadLibrary=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'LoadLibrary`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 fi - + fi @@ -2207,17 +2449,17 @@ fi for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:2210: checking for $ac_hdr" >&5 +echo "$progname:2452: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF -ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo $progname:2220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_try="$ac_compile >/dev/null 2>conftest.out" +{ (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2245,7 +2487,7 @@ done LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2248: checking whether a program can dlopen itself" >&5 +echo "$progname:2490: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2253,7 +2495,7 @@ else lt_cv_dlopen_self=cross else cat > conftest.c < @@ -2296,10 +2538,10 @@ else fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) exit(0); } exit(1); } + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else @@ -2318,7 +2560,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2321: checking whether a statically linked program can dlopen itself" >&5 +echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2326,7 +2568,7 @@ else lt_cv_dlopen_self_static=cross else cat > conftest.c < @@ -2369,10 +2611,10 @@ else fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) exit(0); } exit(1); } + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else @@ -2416,8 +2658,10 @@ LTCONFIG_VERSION="$VERSION" case "$ltmain" in *.sh) # Now quote all the things that may contain metacharacters. - for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ - old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ + for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ + old_LD old_LDFLAGS old_LIBS \ + old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ + AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ @@ -2462,7 +2706,7 @@ case "$ltmain" in # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 +# Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -2488,7 +2732,7 @@ Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF @@ -2497,8 +2741,9 @@ EOF *) # Double-quote the variables that need it (for aesthetics). - for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ - old_LN_S old_DLLTOOL old_AS; do + for var in old_CC old_CFLAGS old_CPPFLAGS \ + old_LD old_LDFLAGS old_LIBS \ + old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do eval "$var=\\\"\$var\\\"" done @@ -2518,8 +2763,9 @@ cat <> "$cfgfile" # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ -# LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ -# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\ +# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ +# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ +# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for @@ -2565,6 +2811,9 @@ NM=$NM # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + # Used on cygwin: assembler. AS="$AS" @@ -2584,10 +2833,13 @@ objext="$objext" # Old archive suffix (normally "a"). libext="$libext" +# Executable file suffix (normally ""). +exeext="$exeext" + # Additional compiler flags for building library objects. pic_flag=$pic_flag -# Does compiler simultaneously support -c and -o options +# Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o # Can we write directly to a .lo ? @@ -2657,7 +2909,7 @@ postuninstall_cmds=$postuninstall_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$deplibs_check_method -# Command to use when deplibs_check_method == file_magic +# Command to use when deplibs_check_method == file_magic. file_magic_cmd=$file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. @@ -2718,16 +2970,16 @@ sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" -# Set to yes if exported symbols are required +# Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols -# The command to extract exported symbols +# The commands to list exported symbols. export_symbols_cmds=$export_symbols_cmds -# Symbols that should not be listed in the preloaded symbols +# Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$exclude_expsyms -# Symbols that must always be exported +# Symbols that must always be exported. include_expsyms=$include_expsyms EOF @@ -2743,7 +2995,7 @@ case "$ltmain" in # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "${COLLECT_NAMES+set}" != set; then +if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -2752,7 +3004,11 @@ EOF esac # Append the ltmain.sh script. - cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) + sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? chmod +x "$ofile" ;; diff --git a/gnu/dist/toolchain/ltmain.sh b/gnu/dist/toolchain/ltmain.sh index bfc7e9d7ad30..c32939ee8333 100644 --- a/gnu/dist/toolchain/ltmain.sh +++ b/gnu/dist/toolchain/ltmain.sh @@ -1,8 +1,8 @@ # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun ltconfig. # -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 +# Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,12 +28,8 @@ if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null`" = 'X\t'; then # Yippee, $echo works! : @@ -42,6 +38,15 @@ else exec $SHELL "$0" --no-reexec ${1+"$@"} fi +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat < # -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif # +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); +# #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY @@ -780,8 +828,8 @@ compiler." allow_undefined=yes ;; esac - compile_command="$CC" - finalize_command="$CC" + compile_command="$nonopt" + finalize_command="$nonopt" compile_rpath= finalize_rpath= @@ -815,6 +863,7 @@ compiler." ltlibs= module=no objs= + prefer_static_libs=no preload=no prev= prevarg= @@ -831,11 +880,21 @@ compiler." do case "$arg" in -all-static | -static) - if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + if test "X$arg" = "X-all-static"; then + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi fi build_libtool_libs=no build_old_libs=yes + prefer_static_libs=yes break ;; esac @@ -868,18 +927,32 @@ compiler." fi case "$arg" in *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes + else + dlself=needless + export_dynamic=yes fi prev= continue ;; *) - dlprefiles="$dlprefiles $arg" - test "$prev" = dlfiles && dlfiles="$dlfiles $arg" + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi prev= ;; esac @@ -903,13 +976,26 @@ compiler." prev= continue ;; - rpath) - rpath="$rpath $arg" - prev= - continue - ;; - xrpath) - xrpath="$xrpath $arg" + rpath | xrpath) + # We need an absolute path. + case "$arg" in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi prev= continue ;; @@ -928,7 +1014,6 @@ compiler." if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" - dlopen_self=$dlopen_self_static fi continue ;; @@ -955,22 +1040,16 @@ compiler." ;; -export-dynamic) - if test "$export_dynamic" != yes; then - export_dynamic=yes - if test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - else - arg= - fi - fi + export_dynamic=yes + continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: cannot have more than one -exported-symbols" + $echo "$modename: not more than one -exported-symbols argument allowed" exit 1 fi - if test "$arg" = "-export-symbols"; then + if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex @@ -979,14 +1058,18 @@ compiler." ;; -L*) - dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'` + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. case "$dir" in - /* | [A-Za-z]:[/\\]*) - # Add the corresponding hardcode_libdir_flag, if it is not identical. - ;; + [\\/]* | [A-Za-z]:[\\/]*) ;; *) - $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2 - exit 1 + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + absdir="$dir" + fi + dir="$absdir" ;; esac case " $deplibs " in @@ -1010,20 +1093,29 @@ compiler." ;; -l*) + if test "$arg" = "-lc"; then + case "$host" in + *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) + # These systems don't actually have c library (as such) + continue + ;; + esac + elif test "$arg" = "-lm"; then + case "$host" in + *-*-cygwin* | *-*-beos*) + # These systems don't actually have math library (as such) + continue + ;; + esac + fi deplibs="$deplibs $arg" ;; -module) - if test "$module" != yes; then - module=yes - if test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - else - arg= - fi - fi + module=yes + continue ;; - + -no-undefined) allow_undefined=no continue @@ -1047,7 +1139,19 @@ compiler." ;; -R*) - xrpath="$xrpath "`$echo "X$arg" | $Xsed -e 's/^-R//'` + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case "$dir" in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac continue ;; @@ -1056,7 +1160,6 @@ compiler." if test -z "$pic_flag" && test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" - dlopen_self=$dlopen_self_static fi continue ;; @@ -1128,6 +1231,7 @@ compiler." # it will not redefine variable installed. installed=yes + # Read the .la file # If there is no directory component, then add one. case "$arg" in */* | *\\*) . $arg ;; @@ -1160,7 +1264,7 @@ compiler." fi if test -n "$dependency_libs"; then - # Extract -R from dependency_libs + # Extract -R and -L from dependency_libs temp_deplibs= for deplib in $dependency_libs; do case "$deplib" in @@ -1172,7 +1276,13 @@ compiler." -L*) case "$compile_command $temp_deplibs " in *" $deplib "*) ;; *) temp_deplibs="$temp_deplibs $deplib";; - esac;; + esac + temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` + case " $lib_search_path " in + *" $temp_dir "*) ;; + *) lib_search_path="$lib_search_path $temp_dir";; + esac + ;; *) temp_deplibs="$temp_deplibs $deplib";; esac done @@ -1218,7 +1328,8 @@ compiler." prev= fi - if test "$build_libtool_libs" = yes && test -n "$library_names"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then link_against_libtool_libs="$link_against_libtool_libs $arg" if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. @@ -1230,12 +1341,13 @@ compiler." # We need an absolute path. case "$dir" in - /* | [A-Za-z]:[/\\]*) absdir="$dir" ;; + [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$libdir'" 1>&2 - exit 1 + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + absdir="$dir" fi ;; esac @@ -1244,24 +1356,24 @@ compiler." # Skip directories that are in the system default run-time # search path, unless they have been requested with -R. case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; + *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; - esac + esac case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; + *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; - esac + esac lib_linked=yes case "$hardcode_action" in @@ -1419,6 +1531,12 @@ compiler." exit 1 fi + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` @@ -1441,7 +1559,7 @@ compiler." $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi - if test -n "$dlfiles$dlprefiles"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi @@ -1461,7 +1579,7 @@ compiler." $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi - if test -n "$export_symbols"; then + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi @@ -1500,11 +1618,6 @@ compiler." output_objdir="$output_objdir/$objdir" fi - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - if test -n "$objs"; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 exit 1 @@ -1516,7 +1629,7 @@ compiler." exit 1 fi - if test -n "$dlfiles$dlprefiles"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 fi @@ -1699,7 +1812,7 @@ compiler." dependency_libs="$deplibs" case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) + *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *) @@ -1747,12 +1860,13 @@ compiler." droppeddeps=no case "$deplibs_check_method" in pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behaviour. newdeplibs=$deplibs - ;; # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behaviour. + ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it @@ -1763,7 +1877,7 @@ compiler." int main() { return 0; } EOF $rm conftest - $C_compiler -o conftest conftest.c $deplibs + $CC -o conftest conftest.c $deplibs if test $? -eq 0 ; then ldd_output=`ldd conftest` for i in $deplibs; do @@ -1796,24 +1910,24 @@ EOF # If $name is empty we are operating on a -L argument. if test "$name" != "" ; then $rm conftest - $C_compiler -o conftest conftest.c $i + $CC -o conftest conftest.c $i # Did it work? if test $? -eq 0 ; then ldd_output=`ldd conftest` - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi + libname=`eval \\$echo \"$libname_spec\"` + deplib_matches=`eval \\$echo \"$library_names_spec\"` + set dummy $deplib_matches + deplib_match=$2 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" + else + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $i." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi else droppeddeps=yes echo @@ -1827,7 +1941,6 @@ EOF fi done fi - deplibs=$newdeplibs ;; file_magic*) set dummy $deplibs_check_method @@ -1841,7 +1954,7 @@ EOF potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do # Follow soft links. - if ls -lLd "$potlib" 2>/dev/null \ + if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi @@ -1854,11 +1967,11 @@ EOF while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` case "$potliblink" in - /*) potlib="$potliblink";; + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done - if eval $file_magic_cmd \"\$potlib\" \ + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | sed 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" @@ -1881,7 +1994,8 @@ EOF fi done # Gone through all deplibs. ;; - none | unknown | *) newdeplibs="" + none | unknown | *) + newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then @@ -1923,21 +2037,23 @@ EOF else build_libtool_libs=no fi - dlname= - library_names= else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." fi fi + # Done checking deplibs! + deplibs=$newdeplibs fi - # test again, we may have decided not to build it any more + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then - deplibs=$newdeplibs - # Done checking deplibs! - # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names @@ -1957,52 +2073,30 @@ EOF done # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) incase we are running --disable-static + # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do - oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` - test -f $oldobj || ${LN_S} $obj $oldobj + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + if test ! -f $xdir/$oldobj; then + $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" + $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? + fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - if test -n "$whole_archive_flag_spec"; then - if test -n "$convenience"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - else - for xlib in $convenience; do - # Extract the objects. - xdir="$xlib"x - generated="$generated $xdir" - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x ../$xlib)" - $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $? - - libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - - linkopts="$linkopts $flag" - fi - # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" - export_symbols="$objdir/$libname.exp" + export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' @@ -2025,6 +2119,51 @@ EOF $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case "$xlib" in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linkopts="$linkopts $flag" + fi + # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" @@ -2065,7 +2204,7 @@ EOF $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi - if test -n "$dlfiles$dlprefiles"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi @@ -2103,8 +2242,58 @@ EOF # Delete the old objects. $run $rm $obj $libobj + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case "$xlib" in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + # Create the old-style object. - reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` + reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" output="$obj" eval cmds=\"$reload_cmds\" @@ -2117,9 +2306,21 @@ EOF IFS="$save_ifs" # Exit if we aren't doing a library object file. - test -z "$libobj" && exit 0 + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + fi if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" @@ -2129,7 +2330,7 @@ EOF if test -n "$pic_flag"; then # Only do commands if we really have different PIC objects. - reload_objs="$libobjs" + reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' @@ -2143,8 +2344,21 @@ EOF # Just create a symlink. $show $rm $libobj $run $rm $libobj - $show "$LN_S $obj $libobj" - $run $LN_S $obj $libobj || exit $? + xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$libobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + $show "(cd $xdir && $LN_S $oldobj $baseobj)" + $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop fi exit 0 @@ -2167,11 +2381,6 @@ EOF fi fi - if test "$dlself" = yes && test "$export_dynamic" = no; then - $echo "$modename: error: \`-dlopen self' requires \`-export-dynamic'" 1>&2 - exit 1 - fi - if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do @@ -2207,7 +2416,6 @@ EOF fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" fi elif test -n "$runpath_var"; then @@ -2244,7 +2452,6 @@ EOF fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" fi elif test -n "$runpath_var"; then @@ -2269,6 +2476,16 @@ EOF output_objdir="$output_objdir/$objdir" fi + # Create the binary in the object directory, then wrap it. + if test ! -d $output_objdir; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test $status -ne 0 && test ! -d $output_objdir; then + exit $status + fi + fi + if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` @@ -2276,7 +2493,7 @@ EOF fi dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else @@ -2289,24 +2506,15 @@ EOF "") ;; *.c) # Discover the nlist of each of the dlfiles. - nlist="$objdir/${output}.nm" + nlist="$output_objdir/${outputname}.nm" - if test -d $objdir; then - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - else - $show "$mkdir $objdir" - $run $mkdir $objdir - status=$? - if test $status -ne 0 && test ! -d $objdir; then - exit $status - fi - fi + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. - $show "creating $objdir/$dlsyms" + $show "creating $output_objdir/$dlsyms" - $echo > "$objdir/$dlsyms" "\ + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ @@ -2323,7 +2531,7 @@ extern \"C\" { if test "$dlself" = yes; then $show "generating symbol list for \`$output'" - echo ': @PROGRAM@ ' > "$nlist" + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` @@ -2344,13 +2552,12 @@ extern \"C\" { # Prepare the list of exported symbols if test -z "$export_symbols"; then - export_symbols="$objdir/$output.exp" + export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else - $run $rm $export_symbols - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$objdir/$output.exp"' - $run eval 'grep -f "$objdir/$output.exp" < "$nlist" > "$nlist"T' + $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' + $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi @@ -2426,26 +2633,35 @@ static const void *lt_preloaded_setup() { fi pic_flag_for_symtable= - case "$host" in + case "$host" in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*) + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. - $show "(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"` + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 @@ -2470,7 +2686,15 @@ static const void *lt_preloaded_setup() { # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" - exit $? + status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $status fi if test -n "$shlibpath_var"; then @@ -2478,7 +2702,7 @@ static const void *lt_preloaded_setup() { rpath= for dir in $temp_rpath; do case "$dir" in - /* | [A-Za-z]:[/\\]*) + [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; @@ -2524,7 +2748,6 @@ static const void *lt_preloaded_setup() { link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" - # AGH! Flame the AIX and HP-UX people for me, will ya? $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else @@ -2545,17 +2768,7 @@ static const void *lt_preloaded_setup() { # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - # Create the binary in the object directory, then wrap it. - if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $objdir; then - exit $status - fi - fi - - # Delete the old output file. + # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" @@ -2572,7 +2785,7 @@ static const void *lt_preloaded_setup() { # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case "$0" in - /* | [A-Za-z]:[/\\]*) qecho="$SHELL $0 --fallback-echo";; + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` @@ -2609,7 +2822,7 @@ sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" @@ -2649,7 +2862,7 @@ else # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in - /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;; + [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi @@ -2787,31 +3000,65 @@ fi\ addlibs="$old_convenience" fi - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - xdir="$xlib"x - generated="$generated $xdir" - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" status=$? - if test $status -ne 0 && test ! -d "$xdir"; then + if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi - $show "(cd $xdir && $AR x ../$xlib)" - $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $? + generated="$generated $gentop" + + # Add in members from convenience archives. + for xlib in $addlibs; do + # Extract the objects. + case "$xlib" in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" - oldobjs="$oldobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` + done + fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else + # Ensure that we have .o objects in place in case we decided + # not to build a shared library, and have fallen back to building + # static libs even though --disable-static was passed! + for oldobj in $oldobjs; do + if test ! -f $oldobj; then + xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$oldobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` + obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` + $show "(cd $xdir && ${LN_S} $obj $baseobj)" + $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? + fi + done + eval cmds=\"$old_archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' @@ -2845,9 +3092,20 @@ fi\ # Only create the output if not a dry run. if test -z "$run"; then - $echo > $output "\ -# $output - a libtool library file + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + fi + $rm $output + $echo > $output "\ +# $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. # The name that we can dlopen(3). dlname='$dlname' @@ -2867,15 +3125,12 @@ age=$age revision=$revision # Is this an already installed library? -installed=no +installed=$installed # Directory that this library needs to be installed in: libdir='$install_libdir'\ " - - $rm "$output_objdir/$outputname"i - sed 's/^installed=no$/installed=yes/' \ - < "$output" > "$output_objdir/$outputname"i || exit 1 + done fi # Do a symbolic link so that the libtool archive can be found in @@ -3012,7 +3267,7 @@ libdir='$install_libdir'\ fi fi case "$destdir" in - /* | [A-Za-z]:[/\\]*) ;; + [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case "$file" in @@ -3088,13 +3343,11 @@ libdir='$install_libdir'\ # Install the shared library and build the symlinks. $show "$install_prog $dir/$realname $destdir/$realname" $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? - test "X$dlname" = "X$realname" && dlname= if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do - test "X$dlname" = "X$linkname" && dlname= if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" @@ -3102,12 +3355,6 @@ libdir='$install_libdir'\ done fi - if test -n "$dlname"; then - # Install the dynamically-loadable library. - $show "$install_prog $dir/$dlname $destdir/$dlname" - $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $? - fi - # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" @@ -3123,12 +3370,6 @@ libdir='$install_libdir'\ # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i - if test ! -f "$instname"; then - # Just in case it was removed... - $show "Creating $instname" - $rm "$instname" - sed 's/^installed=no$/installed=yes/' "$file" > "$instname" - fi $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? @@ -3226,21 +3467,29 @@ libdir='$install_libdir'\ outputname= if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes; then - outputname="/tmp/$$-$file" + if test "$finalize" = yes && test -z "$run"; then + tmpdir="/tmp" + test -n "$TMPDIR" && tmpdir="$TMPDIR" + tmpdir="$tmpdir/libtool-$$" + if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : + else + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 + continue + fi + outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" continue fi file="$outputname" else - $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2 + $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. @@ -3250,7 +3499,7 @@ libdir='$install_libdir'\ $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && $rm $outputname + test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done @@ -3476,8 +3725,10 @@ libdir='$install_libdir'\ done if test -z "$run"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then @@ -3494,8 +3745,10 @@ libdir='$install_libdir'\ exit 1 else # Display what would be done. - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi $echo "$cmd$args" exit 0 fi @@ -3537,9 +3790,7 @@ libdir='$install_libdir'\ # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $dir/$n" - test "X$n" = "X$dlname" && dlname= done - test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname" test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" $show "$rm $rmfiles" @@ -3718,6 +3969,8 @@ The following components of LINK-COMMAND are treated specially: -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened @@ -3748,7 +4001,7 @@ is created, otherwise an executable program is created." ;; uninstall) - $echo + $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. diff --git a/gnu/dist/toolchain/makefile.vms b/gnu/dist/toolchain/makefile.vms new file mode 100644 index 000000000000..a9e363403b5b --- /dev/null +++ b/gnu/dist/toolchain/makefile.vms @@ -0,0 +1,71 @@ +# +# makefile for bfd, binutils and gas +# +# Created by Klaus K"ampf (kkaempf@rmi.de) +# +# You must use Version 3.76 of GNU Make +# +# + +ifeq ($(ARCH),ALPHA) +CC = gcc +GASCC = $(CC) +else +CC = cc +GASCC = gcc +endif + +ifeq ($(CC),cc) + CHECK-COMPILER = check_compiler +else + CHECK-COMPILER = +endif + +all: check_cc $(CHECK-COMPILER) [.binutils]makefile.vms + $(CD) [.bfd] + @gmake "CC=$(CC)" + $(CD) [-.opcodes] + @gmake "CC=$(CC)" + $(CD) [-.libiberty] + @gmake "CC=$(CC)" + $(CD) [-.binutils] + @gmake "CC=$(CC)" + $(CD) [-.gas] + @gmake "CC=$(GASCC)" + $(CD) [-] + +check_cc: +ifeq ($CC,) + @$(ECHO) "Please edit MAKEFILE.VMS and select a C Compiler." + stop +endif + +check_compiler: + @$(ECHO) "Perform a '$$ @setup' before starting make" + +[.binutils]makefile.vms: + $(CD) [.binutils] + $$ @configure + $(CD) [-] + +install: all + $(CD) [.binutils] + @gmake "CC=$(CC)" install + $(CD) [-] + $(CD) [.gas] + @gmake "CC=$(GASCC)" install + $(CD) [-] + +clean: + $(CD) [.bfd] + @gmake clean + $(CD) [-.opcodes] + @gmake clean + $(CD) [-.libiberty] + @gmake clean + $(CD) [-.binutils] + @gmake clean + $(CD) [-.gas] + @gmake clean + $(CD) [-] + diff --git a/gnu/dist/toolchain/missing b/gnu/dist/toolchain/missing index cbe2b0ef0e3a..7789652e877f 100755 --- a/gnu/dist/toolchain/missing +++ b/gnu/dist/toolchain/missing @@ -82,15 +82,17 @@ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in` - if test -z "$files"; then - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in` - test -z "$files" || files="$files.in" - else - files=`echo "$files" | sed -e 's/:/ /g'` - fi - test -z "$files" && files="config.h.in" - touch $files + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files ;; automake) @@ -99,9 +101,9 @@ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." - find . -type f -name Makefile.am -print \ - | sed 's/^\(.*\).am$/touch \1.in/' \ - | sh + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done ;; bison|yacc) diff --git a/gnu/dist/toolchain/mkdep b/gnu/dist/toolchain/mkdep new file mode 100755 index 000000000000..3c5b508f1427 --- /dev/null +++ b/gnu/dist/toolchain/mkdep @@ -0,0 +1,87 @@ +#!/bin/sh - +# +# Copyright (c) 1987 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)mkdep.sh 5.12 (Berkeley) 6/30/88 +# + +MAKE=Makefile # default makefile name is "Makefile" + +while : + do case "$1" in + # -f allows you to select a makefile name + -f) + MAKE=$2 + shift; shift ;; + + # the -p flag produces "program: program.c" style dependencies + # so .o's don't get produced + -p) + SED='s;\.o;;' + shift ;; + *) + break ;; + esac +done + +if [ $# = 0 ] ; then + echo 'usage: mkdep [-p] [-f makefile] [flags] file ...' + exit 1 +fi + +if [ ! -w $MAKE ]; then + echo "mkdep: no writeable file \"$MAKE\"" + exit 1 +fi + +TMP=/tmp/mkdep$$ + +trap 'rm -f $TMP ; exit 1' 1 2 3 13 15 + +cp $MAKE ${MAKE}.bak + +sed -e '/DO NOT DELETE THIS LINE/,$d' < $MAKE > $TMP + +cat << _EOF_ >> $TMP +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +_EOF_ + +# If your compiler doesn't have -M, add it. If you can't, the next two +# lines will try and replace the "cc -M". The real problem is that this +# hack can't deal with anything that requires a search path, and doesn't +# even try for anything using bracket (<>) syntax. +# +# egrep '^#include[ ]*".*"' /dev/null $* | +# sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' | + +gcc -MM $* | +sed " + s; \./; ;g + $SED" >> $TMP + +cat << _EOF_ >> $TMP + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY +_EOF_ + +# copy to preserve permissions +cp $TMP $MAKE +rm -f ${MAKE}.bak $TMP +exit 0 + + diff --git a/gnu/dist/toolchain/mpw-README b/gnu/dist/toolchain/mpw-README new file mode 100644 index 000000000000..767140b5b263 --- /dev/null +++ b/gnu/dist/toolchain/mpw-README @@ -0,0 +1,376 @@ +This is basic information about the Macintosh(tm) MPW(tm) port of the +GNU tools. The information below applies to both native and cross +compilers. + +(Please note that there are two versions of this file; "mpw-README" +is the source form, and "Read Me for MPW" is the distribution form. +"Read Me for MPW" has 8-bit chars such as \Option-d embedded in it.) + +INSTALLING GNU TOOLS + +* System Requirements + +To use these tools, you will need a Mac with a 68020 or better or else +any PowerMac, System 7.1 or later, and MPW 3.3 or 3.4. You will *not* +need any other MPW compiler unless you want to rebuild from sources, +nor even any include files, unless you are building actual Mac +applications. For PowerMac native you will need PPCLink, however; +also the executables are PowerPC-only. + +* Automated Installation + +The simplest way to install GNU tools is to run the Install script. +The script will copy things to where you want to keep them, will build +a UserStartup file with settings corresponding to where things were +copied, and offer to put that UserStartup file in your MPW folder. + +The Install script does not alter anything in the System Folder, and +it does not take any action without confirmation. + +The Install script will be at the top level of the binary +distribution, or at the top level of the object directory if +rebuilding from source. (The sources include a file called +"mpw-install" at the top level, but it is the source to the Install +script and cannot be run directly.) + +* Manual Installation + +If you don't want to run the Install script, you can do installation +manually; this section describes the steps involved. + +The GNU tools can go in any directory that is in your {Commands} list. +We generally put all the tools somewhere like {Boot}Cygnus:latest:bin, +and then add to a UserStartup file: + + set Commands "{Boot}Cygnus:latest:bin:,{Commands}" + +However, the cpp and cc1 programs of GCC are not normally stored here. +Instead, they will be in a "lib" directory that is alongside "bin", +and organized by target and version underneath, with names like + + :lib:gcc-lib::cygnus-: + +If you build and install everything yourself according to the build +instructions below, then you will not have any problems. However, you +may discover that GCC seems unable to find the right cpp and cc1; +usually this will be because directory names have changed. (Even +renaming your hard disk will make this happen.) In such cases, you +have several choices. One is just to add this directory to +{Commands}, but then you will not be able to get any other cpp or cc1, +such as those used by a different target or version. Another way is +to rename your disk and directories to match the prefix used when the +tools were compiled. Finally, you can set the variable +GCC_EXEC_PREFIX to point to the library directory: + + set GCC_EXEC_PREFIX MyDisk:Stuff:lib:gcc-lib: + export GCC_EXEC_PREFIX + +You may also want to edit MPW's HEXA 128 resource. When GCC is built +using a native GCC, it is compiled to use a special stack allocator +function alloca(). While this is very efficient, it means that GCC +will need considerable stack space to run, especially when compiling +large programs with optimization turned on. You give MPW more stack +by editing the HEXA 128 resource of the MPW Shell. A value of "0008 +0000" gives 512K of stack size, which is usually sufficient. + +USING GNU TOOLS + +* Using Native PowerMac GCC + +Using a native PowerMac GCC to produce MPW tools or MacOS applications +is more complicated than just "gC foo.c", although no more complicated +than with other Mac compilers. + +To build a native PowerMac MPW tool, use this sequence, where hello.c +is the usual "hello world" program, and genericcfrg.r is the Rez file +with the code fragment resource: + +gC -I{CIncludes} -fno-builtin -Dpascal= -c -g hello.c +PPCLink hello.o -o hello \Option-d + "{PPCLibraries}"StdCRuntime.o \Option-d + "{SharedLibraries}"InterfaceLib \Option-d + "{SharedLibraries}"StdCLib \Option-d + "{PPCLibraries}"PPCToolLibs.o \Option-d + "{PPCLibraries}"PPCCRuntime.o \Option-d + "{GCCPPCLibraries}"libgcc.xcoff +rez -d APPNAME='"'hello'"' GenericCFRG.r -o hello +setfile -t 'MPST' -c 'MPS ' hello + +The same sequence works to build a MacOS application, but you set the file +type to 'APPL' and don't link in PPCToolLibs.o. For further details on +using MPW to build Mac applications, see the general MPW documentation. + +Recent versions of PPCLink have an option to generate the code +fragment resource and automatically set creator and file type; +here is what GenericCFRG.r should look like if you have an older +PPCLink or are using GNU ld: + +#include "CodeFragmentTypes.r" + +resource 'cfrg' (0) { + { + kPowerPC, + kFullLib, + kNoVersionNum,kNoVersionNum, + 0,0, + kIsApp,kOnDiskFlat,kZeroOffset,kWholeFork, + APPNAME // must be defined on Rez command line with -d option + } +}; + +In general this port of GCC supports the same option syntax and +behavior as its Unix counterpart. It also has similar compilation +rules, so it will run the assembler on .s files and so forth. + +The GCC manual includes full information on the available options. +One option that may be especially useful is "-v", which shows you what +tools and options are being used; unlike most Mac C compilers, GCC +directs assembly and linking in addition to compilation. + +MPW GCC does feature two extensions to the option syntax; '-d macro=name' +works just as '-Dmacro=name' does in Unix, and '-i directory' works the +same as '-Idirectory'. + +MPW GCC supports the usual Pascal-style strings and alignment pragmas. + +To find standard include files you can set the variable GCCIncludes: + + set GCCIncludes MyDisk:MyIncludes: + export GCCIncludes + +GCCIncludes is similar to MPW's CIncludes or CW's MWCIncludes. In +order to use MPW's usual include files, just say: + + set GCCIncludes "{CIncludes}" + export GCCIncludes + +* Using GCC as a Cross-Compiler + +If you have a cross-compiler, and you have all of the correct +target-side crt0 and libraries available, then to compile and link a +file "foo.c", you can say just + + gC foo.c + +The output file will be an MPW binary file named "a.out"; the format +of the contents will depend on which target is in use, so for instance +a MIPS-targeting GCC will produce ECOFF or ELF executables. + +Note that using MPW include files with a cross-compiler is somewhat +dangerous. + +* Using the Assembler and Friends + +The assembler ("as") and linker ("ld") are faithful ports of their +Unix counterparts. Similarly, the binutils "ar", "cplusfilt", "nm", +"objcopy", "objdump", "ranlib", "size", "strings", and "strip" are all +like they are under Unix. (Note that "cplusfilt" is usually called +"c++filt" under Unix.) + +* Using GDB + +There are two flavors of GDB. "gdb" is an MPW tool that works very +much like it does in Unix; put a command into the MPW worksheet and +type the key to send it to GDB. While "gdb" is running, you +cannot do anything else in MPW, although you can switch to other +Mac applications and use them. + +"SiowGDB" is also a Mac application, but it is GDB using the SIOW +package to provide console emulation. Commands are exactly as for the +MPW tool, but since this is its own application, you can switch +between it and MPW. + +BUILDING GNU TOOLS + +This port of the GNU tools uses a configure script similar to +that used for GNU tools under Unix, but rewritten for MPW. As with +Unix configuration, there is an "object" directory that may be +different from the "source" directory. In the example commands below, +we will assume that we are currently in the object directory, and that +the source directory is "{Boot}Cygnus:src:". + +* Requirements for Building + +In addition to the sources, you will need a set of tools that the +configure and build scripts assume to be available. These tools +(and their versions, if relevant) are as follows: + + byacc tool + flex (2.3.7) tool (and Flex.skel file) + forward-include script + MoveIfChange script + mpw-touch script + mpw-true script + NewFolderRecursive script + null-command script + open-brace script + sed (1.13) tool + tr-7to8 script + true script + +The scripts are in the sources, under utils:mpw:. You must arrange to +get the other tools yourself (they are readily available from the +"usual" net sites, and are also on many CDROMS). In addition, there +will usually be a set of these available at ftp.cygnus.com, in pub/mac. + +You may put the build tools in your usual Tools or Scripts +directories, or keep them in a separate directories. We prefer to +make a directory called "buildtools" and we put this in one of our +UserStartup files: + + set Commands "{Boot}Cygnus:buildtools:,{Commands}" + +Flex uses an environment variable FLEX_SKELETON to locate its skeleton +file, so you need to do something like this, preferably in a UserStartup: + + Set FLEX_SKELETON "{Boot}"Cygnus:buildtools:Flex.skel + Export FLEX_SKELETON + +* Configuring + +Before you can build anything, you must configure. You do this by +creating an directory where object files will be stored, setdirectory +to that directory and do a configure command: + + {Boot}Cygnus:src:mpw-configure --target --cc --srcdir {Boot}Cygnus:src: --prefix + +If the source directory is not in your {Commands} list, then you must +supply a full pathname to mpw-configure, since mpw-configure invokes +itself after switching into each subdirectory. Using a relative +pathname, even something like ':mpw-configure', will therefore not work. + + must be a known target. Valid ones include "m68k-apple-macos", +"powerpc-apple-macos", "i386-unknown-go32", "mips-idt-ecoff", and +"sh-hitachi-hms". Not all target types are accepted for all of the +tools yet. + + must be the name of the compiler to use. It defaults to "mpwc". + + (m68k) + mpwc MPW C + sc68k Symantec C + mwc68k Metrowerks C (Codewarrior) + gcc68k GCC + + (powerpc) + ppcc PPCC + mrc Macintosh on RisC (Mister C, aka(?) Frankenstein) + scppc Symantec C + mwcppc Metrowerks C (Codewarrior) + gccppc GCC + +Not all compilers will compile all tools equally well! For m68k Macs, +MPW C has the best record so far (it has problems, but they can be +worked around), while for PowerMacs, CodeWarrior is the only compiler +that has successfully compiled everything into running code. + + is the path that "gcc" will prepend when looking for tools +to execute. GCC_EXEC_PREFIX overrides this value, so you need not +include it if you plan to use GCC_EXEC_PREFIX. + +As an example, here is the configure line that you could use to build +native PowerMac GCC: + +"{Boot}"Cygnus:src:mpw-configure --cc mwcppc --target powerpc-apple-macos --srcdir "{Boot}"Cygnus:src: --prefix "{Boot}"GNUTools: + +* Building + +If you use CodeWarrior, you *must* first set MWCIncludes to +{CIncludes}. This is because you will be building MPW tools, and +their standard I/O works by making references to data that is part of +the MPW Shell, which means that the code must be compiled and linked +with macros that refer to that data, and those macros are in +{CIncludes}, not the default {MWCIncludes}. Without this change, you +will encounter problems compiling libiberty/mpw.c, but tweaking that +file only masks the real problem, and does not fix it. + +The command + + mpw-build + +will build everything. Building will take over an hour on a Quadra 800 +or PowerMac 8100/110, longer if the sources are on a shared volume. + +You may see some warnings; these are mostly likely benign, typically +disagreements about declarations of library and system functions. + +* Installing + +To install the just-built tools, use the command + + mpw-build install + +This part of the installation procedure just copies files to the +location specified at configure time by , and, in some cases, +renames them from temporary internal names to their usual names. This +install process is *not* the same as what the Install script does; +Install can copy tools from the installation location chosen at +configuration time to a user-chosen place, and sets up a UserStartup +file. Note that while the Install script is optional, the install +build action performs some tasks would be very hard to replicate +manually, so you should always do it before using the tools. + +* Known Problems With Using Various Compilers to Build + +Most versions of MPW C have problems with compiling GNU software. + +MPW C 3.2.x has preprocessing bugs that render it incapable of +compiling the BFD library, so it can't be used at all for building BFD. + +MPW C 3.3, 3.3.1, and 3.3.2 will spontaneously claim to have found +errors in the source code, but in fact the code is perfectly fine. If +this happens, just set the working directory back to the top-level +objdir (where the configure command above was performed), and type +"mpw-build all" again. If it goes on through the supposed error, then +you got one of the spurious errors. A full build may require a number +of these restarts. + +MPW C 3.3.3 seems to work OK, at least with the aid of a number of +workarounds that are in the sources (look for #ifdef MPW_C). + +Versions of MPW Make earlier than 4.0d2 have exhibited bizarre behavior, +failure to substitute variables and the like. + +Metrowerks CW6 PPC linker (MWLinkPPC) seems to do bad things with memory +if the "Modern Memory Manager" is turned on (in the Memory control panel), +but works OK if it is turned off. + +Metrowerks CW6 loses bigtime compiling opcodes:ppc-opc.c, which has +some deeply nested macros. (CW7 is OK.) There is a way to patch the +file, by substituting constant values. If you need to do this, +contact shebs@cygnus.com for details. + + is missing from {CIncludes} in the MPW version that comes +with CW7. You can just copy the one in CW7's {MWCIncludes}. + +CW8 and later have changes to headers and such that will require changes +to the source in order to be able to use them to rebuild. + +KNOWN BUGS + +The declarations for memcpy and memcmp in some versions of header files +may conflict with GCC's builtin definition. Either use -fno-builtin +or ignore the warnings. + +This is not a bug, but - watch out for cr/nl translation! For instance, +if config/mpw-mh-mpw is not properly translated because it has been +copied or updated separately, then everything will almost build, but +you will get puzzling error messages from make or the compiler. + +'/' or ' ' embedded in any device, directory, or file name may or may +not work. + +objcopy -O srec foo.o makes random output filenames. + +Mac-x-mips requires -mgas but Unix hosts don't. + +GDB will frequently require a '/' on the front of a device name in order +to recognize it as an absolute rather than a relative pathname. + +GDB doesn't seem to use the printer port correctly, although it tries. + +The cursor doesn't always spin as much as it should. To get elaborate +statistics and warnings about spin rates, add this to UserStartup: + + set MEASURE_SPIN all + export MEASURE_SPIN diff --git a/gnu/dist/toolchain/mpw-build.in b/gnu/dist/toolchain/mpw-build.in new file mode 100644 index 000000000000..86d9530fa3b5 --- /dev/null +++ b/gnu/dist/toolchain/mpw-build.in @@ -0,0 +1,204 @@ +# Top-level script fragment to build everything for MPW. + +Set savedir "`Directory`" + +#Set Echo 1 + +Set ThisScript "{0}" + +Set objdir ":" + +Set verify 0 + +Set BuildTarget "none" + +# Parse arguments. + +Loop + Break If {#} == 0 + If "{BuildTarget}" =~ /none/ + Set BuildTarget "{1}" + Else + Echo Only one build target allowed, ignoring "{1}" + End If + Shift 1 +End Loop + +If "{BuildTarget}" =~ /none/ + Set BuildTarget "all" +End If + +If {verify} == 1 + Echo "#" Doing "{ThisScript}" "{BuildTarget}" in "`Directory`" ... +End If + +Set ranmake 0 + +If "`Exists Makefile`" != "" + Echo "Set Echo 1" >{BuildTarget}.makeout + Make -f Makefile {BuildTarget} >>{BuildTarget}.makeout + {BuildTarget}.makeout + Delete {BuildTarget}.makeout + Set ranmake 1 +End If + +If "`Exists Makefile.PPC`" != "" + Echo "Set Echo 1" >{BuildTarget}.makeout.ppc + Make -f Makefile.PPC {BuildTarget} >>{BuildTarget}.makeout.ppc + {BuildTarget}.makeout.ppc + Delete {BuildTarget}.makeout.ppc + Set ranmake 1 +End If + +If {ranmake} == 1 + Exit +End If + +# Dispatch on various pseudo-targets. + +If "{BuildTarget}" =~ /all/ + Echo Started `Date` + "{ThisScript}" all-gcc + "{ThisScript}" all-gdb + Echo Finished `Date` +Else If "{BuildTarget}" =~ /all-libiberty/ + "{ThisScript}" do-libiberty +Else If "{BuildTarget}" =~ /all-bfd/ + "{ThisScript}" do-bfd +Else If "{BuildTarget}" =~ /all-opcodes/ + "{ThisScript}" do-opcodes +Else If "{BuildTarget}" =~ /all-byacc/ + "{ThisScript}" do-byacc +Else If "{BuildTarget}" =~ /all-flex/ + "{ThisScript}" all-libiberty + "{ThisScript}" do-flex +Else If "{BuildTarget}" =~ /all-binutils/ + "{ThisScript}" all-libiberty + "{ThisScript}" all-bfd + "{ThisScript}" all-opcodes + "{ThisScript}" do-binutils +Else If "{BuildTarget}" =~ /all-gas/ + "{ThisScript}" all-libiberty + "{ThisScript}" all-bfd + "{ThisScript}" all-opcodes + "{ThisScript}" do-gas +Else If "{BuildTarget}" =~ /all-gcc/ + "{ThisScript}" all-libiberty + "{ThisScript}" all-gas + "{ThisScript}" all-binutils + "{ThisScript}" all-ld + "{ThisScript}" do-gcc +Else If "{BuildTarget}" =~ /all-gdb/ + "{ThisScript}" all-libiberty + "{ThisScript}" all-bfd + "{ThisScript}" all-opcodes + "{ThisScript}" do-gdb +Else If "{BuildTarget}" =~ /all-grez/ + "{ThisScript}" all-libiberty + "{ThisScript}" all-bfd + "{ThisScript}" do-grez +Else If "{BuildTarget}" =~ /all-ld/ + "{ThisScript}" all-libiberty + "{ThisScript}" all-bfd + "{ThisScript}" all-opcodes + "{ThisScript}" do-ld +Else If "{BuildTarget}" =~ /do-byacc/ + SetDirectory :byacc: + ::mpw-build all +Else If "{BuildTarget}" =~ /do-flex/ + SetDirectory :flex: + ::mpw-build _bootstrap + ::mpw-build all +Else If "{BuildTarget}" =~ /do-bfd/ + SetDirectory :bfd: + ::mpw-build all +Else If "{BuildTarget}" =~ /do-libiberty/ + SetDirectory :libiberty: + ::mpw-build all +Else If "{BuildTarget}" =~ /do-opcodes/ + SetDirectory :opcodes: + ::mpw-build all +Else If "{BuildTarget}" =~ /do-binutils/ + SetDirectory :binutils: + ::mpw-build stamps + ::mpw-build all +Else If "{BuildTarget}" =~ /do-gas/ + SetDirectory :gas: + ::mpw-build stamps + ::mpw-build all +Else If "{BuildTarget}" =~ /do-gcc/ + SetDirectory :gcc: + :mpw-build all +Else If "{BuildTarget}" =~ /do-gdb/ + SetDirectory :gdb: + ::mpw-build all +Else If "{BuildTarget}" =~ /do-grez/ + SetDirectory :grez: + ::mpw-build all +Else If "{BuildTarget}" =~ /do-ld/ + SetDirectory :ld: + ::mpw-build all +Else If "{BuildTarget}" =~ /do-newlib/ + SetDirectory :newlib: + ::mpw-build all +Else If "{BuildTarget}" =~ /install/ + "{ThisScript}" install-only-top + "{ThisScript}" install-binutils + "{ThisScript}" install-gas + "{ThisScript}" install-gcc + "{ThisScript}" install-ld + "{ThisScript}" install-gdb +Else If "{BuildTarget}" =~ /install-binutils/ + SetDirectory :binutils: + ::mpw-build install +Else If "{BuildTarget}" =~ /install-gas/ + SetDirectory :gas: + ::mpw-build install +Else If "{BuildTarget}" =~ /install-gcc/ + SetDirectory :gcc: + :mpw-build install +Else If "{BuildTarget}" =~ /install-gdb/ + SetDirectory :gdb: + ::mpw-build install +Else If "{BuildTarget}" =~ /install-grez/ + SetDirectory :grez: + ::mpw-build install +Else If "{BuildTarget}" =~ /install-ld/ + SetDirectory :ld: + ::mpw-build install +Else If "{BuildTarget}" =~ /install-only/ + "{ThisScript}" install-only-top + "{ThisScript}" install-only-binutils + "{ThisScript}" install-only-gas + "{ThisScript}" install-only-gcc + "{ThisScript}" install-only-gdb + "{ThisScript}" install-only-ld +Else If "{BuildTarget}" =~ /install-only-binutils/ + SetDirectory :binutils: + ::mpw-build install-only +Else If "{BuildTarget}" =~ /install-only-gas/ + SetDirectory :gas: + ::mpw-build install-only +Else If "{BuildTarget}" =~ /install-only-gcc/ + SetDirectory :gcc: + :mpw-build install-only +Else If "{BuildTarget}" =~ /install-only-gdb/ + SetDirectory :gdb: + ::mpw-build install-only +Else If "{BuildTarget}" =~ /install-only-grez/ + SetDirectory :grez: + ::mpw-build install-only +Else If "{BuildTarget}" =~ /install-only-ld/ + SetDirectory :ld: + ::mpw-build install-only +Else If "{BuildTarget}" =~ /install-only-top/ + NewFolderRecursive "{prefix}" + If "{prefix}" != "`Directory`" + Duplicate -y 'Read Me for MPW' "{prefix}"'Read Me for MPW' + Duplicate -y Install "{prefix}"Install + End If +Else + Echo {BuildTarget} not understood, ignoring +End If + +SetDirectory "{savedir}" diff --git a/gnu/dist/toolchain/mpw-config.in b/gnu/dist/toolchain/mpw-config.in new file mode 100644 index 000000000000..8028737a8b61 --- /dev/null +++ b/gnu/dist/toolchain/mpw-config.in @@ -0,0 +1,113 @@ +# Configuration fragment for Cygnus source tree. + +# Check that we can find all the special tools that we will need. +# The test for sed is semi-pointless, because it's already been invoked +# by the calculation of target_cpu in the main configure script, but +# the test will also show which one is being used. + +Set Exit 0 +Echo byacc is `Which byacc` +Echo flex is `Which flex` +Echo forward-include is `Which forward-include` +Echo MoveIfChange is `Which MoveIfChange` +Echo mpw-touch is `Which mpw-touch` +Echo mpw-true is `Which mpw-true` +Echo NewFolderRecursive is `Which NewFolderRecursive` +Echo null-command is `Which null-command` +Echo open-brace is `Which open-brace` +Echo sed is `Which sed` +Echo 'tr-7to8' is `Which tr-7to8` +Echo true is `Which true` +Set Exit 1 + +Set host_libs "mmalloc libiberty opcodes bfd readline gash tcl tk tclX" + +Set host_tools "texinfo byacc flex bison binutils ld gas gcc gdb make patch \Option-d + prms send-pr gprof gdbtest tgas etc expect dejagnu sim bash \Option-d + m4 autoconf ispell grep diff rcs cvs fileutils shellutils time \Option-d + textutils wdiff find emacs emacs19 uudecode hello tar gzip indent \Option-d + recode release sed utils guile perl apache inet gawk" + +Set target_libs "newlib" + +Set target_tools "examples" + +# Configure the resource compiler if targeting Macs. +If {target_os} =~ /macos/ || {target_os} =~ /mpw/ + Set host_tools "{host_tools} grez" +End If + +Set configdirs "{host_libs} {host_tools} {target_libs} {target_tools}" +Export configdirs + +# Make up a special include directory that tools will share. + +If "`Exists "{objdir}"extra-include`" == "" + NewFolder "{objdir}"extra-include +End If + +Set edir "{objdir}extra-include:" + +forward-include "{srcdir}"include:mpw:sys:file.h "{edir}"'sys/file.h' +forward-include "{srcdir}"include:mpw:sys:ioctl.h "{edir}"'sys/ioctl.h' +forward-include "{srcdir}"include:mpw:sys:param.h "{edir}"'sys/param.h' +forward-include "{srcdir}"include:mpw:sys:resource.h "{edir}"'sys/resource.h' +forward-include "{srcdir}"include:mpw:sys:stat.h "{edir}"'sys/stat.h' +forward-include "{srcdir}"include:mpw:sys:time.h "{edir}"'sys/time.h' +forward-include "{srcdir}"include:mpw:sys:types.h "{edir}"'sys/types.h' + +forward-include "{srcroot}"include:aout:aout64.h "{edir}"'aout/aout64.h' +forward-include "{srcroot}"include:aout:ar.h "{edir}"'aout/ar.h' +forward-include "{srcroot}"include:aout:ranlib.h "{edir}"'aout/ranlib.h' +forward-include "{srcroot}"include:aout:reloc.h "{edir}"'aout/reloc.h' +forward-include "{srcroot}"include:aout:stab.def "{edir}"'aout/stab.def' +forward-include "{srcroot}"include:aout:stab_gnu.h "{edir}"'aout/stab_gnu.h' + +If "`Exists "{srcroot}"include:aout:"{target_cpu}".h`" != "" + forward-include "{srcroot}"include:aout:"{target_cpu}".h "{edir}"'aout/'"{target_cpu}"'.h' +End If + +forward-include "{srcroot}"include:coff:ecoff.h "{edir}"'coff/ecoff.h' +forward-include "{srcroot}"include:coff:internal.h "{edir}"'coff/internal.h' +forward-include "{srcroot}"include:coff:sym.h "{edir}"'coff/sym.h' +forward-include "{srcroot}"include:coff:symconst.h "{edir}"'coff/symconst.h' + +If "`Exists "{srcroot}"include:coff:"{target_cpu}".h`" != "" + forward-include "{srcroot}"include:coff:"{target_cpu}".h "{edir}"'coff/'"{target_cpu}"'.h' +End If +If "{target_cpu}" =~ /powerpc/ + forward-include "{srcroot}"include:coff:rs6000.h "{edir}"'coff/rs6000.h' +End If + +forward-include "{srcroot}"include:elf:common.h "{edir}"'elf/common.h' +forward-include "{srcroot}"include:elf:dwarf.h "{edir}"'elf/dwarf.h' +forward-include "{srcroot}"include:elf:dwarf2.h "{edir}"'elf/dwarf2.h' +forward-include "{srcroot}"include:elf:external.h "{edir}"'elf/external.h' +forward-include "{srcroot}"include:elf:internal.h "{edir}"'elf/internal.h' + +# Believe it or not, GDB needs this for all targets. +forward-include "{srcroot}"include:elf:mips.h "{edir}"'elf/mips.h' + +If "`Exists "{srcroot}"include:elf:"{target_cpu}".h`" != "" + forward-include "{srcroot}"include:elf:"{target_cpu}".h "{edir}"'elf/'"{target_cpu}"'.h' +End If +If "{target_cpu}" =~ /powerpc/ + forward-include "{srcroot}"include:elf:ppc.h "{edir}"'elf/ppc.h' +End If + +If "`Exists "{srcroot}"include:opcode:"{target_cpu}".h`" != "" + forward-include "{srcroot}"include:opcode:"{target_cpu}".h "{edir}"'opcode/'"{target_cpu}"'.h' +End If +If "{target_cpu}" =~ /powerpc/ + forward-include "{srcroot}"include:opcode:ppc.h "{edir}"'opcode/ppc.h' +End If + +# Add some bfd includes that get mentioned outside the bfd dir. + +forward-include "{srcroot}"bfd:libcoff.h "{edir}"'bfd/libcoff.h' +forward-include "{srcroot}"bfd:libecoff.h "{edir}"'bfd/libecoff.h' + +# Translate random files into MPW-only character set. + +tr-7to8 "{srcdir}"mpw-README > "{objdir}Read Me for MPW" +tr-7to8 "{srcdir}"mpw-install > "{objdir}"Install diff --git a/gnu/dist/toolchain/mpw-configure b/gnu/dist/toolchain/mpw-configure new file mode 100644 index 000000000000..cf45148ec636 --- /dev/null +++ b/gnu/dist/toolchain/mpw-configure @@ -0,0 +1,448 @@ +# Configuration script +# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +### WARNING +### This script must NOT use any 8-bit chars! +### WARNING + +# This is an MPW Shell script that sets everything up for compilation, +# mainly creating directories, and editing copies of files. + +Set savedir "`Directory`" + +#Set Echo 1 + +Set ThisScript "{0}" + +Set srcroot "--------" + +Set srcdir ":" + +Set objdir ":" + +Set prefix "{MPW}":GNUTools: + +Set exec_prefix "" + +Set bindir "" + +Set host_alias "m68k-apple-mpw" + +Set target_alias {host_alias} + +Set host_cc "mpwc" + +Set with_gnu_ld 0 + +Set helpoutput 0 + +Set recurse 1 + +Set verify 0 +Set verifystr "" + +Set enable_options "" +Set disable_options "" + +# Parse arguments. + +Loop + Break If {#} == 0 + If "{1}" =~ /--cc/ + Set host_cc "{2}" + Shift 1 + Else If "{1}" =~ /--bindir/ + Set bindir "{2}" + Shift 1 + Else If "{1}" =~ /--disable-?+/ + Set `Echo {1} | sed -e 's/--disable-/enable_/'` no + Set disable_options "{disable_options} '{1}'" + Else If "{1}" =~ /--enable-?+/ + Set `Echo {1} | sed -e 's/--enable-/enable_/'` yes + Set enable_options "{enable_options} '{1}'" + Else If "{1}" =~ /--exec-prefix/ + Set exec_prefix "{2}" + Shift 1 + Else If "{1}" =~ /--help/ + Set helpoutput 1 + Else If "{1}" =~ /--host/ + Set host_alias "{2}" + Shift 1 + Else If "{1}" =~ /--norecursion/ + Set recurse 0 + Else If "{1}" =~ /--prefix/ + Set prefix "{2}" + Shift 1 + Else If "{1}" =~ /--srcdir/ + Set srcdir "{2}" + Shift 1 + Else If "{1}" =~ /--srcroot/ + Set srcroot "{2}" + Shift 1 + Else If "{1}" =~ /--target/ + Set target_alias "{2}" + Shift 1 + Else If "{1}" =~ /-v/ + Set verify 1 + Set verifystr "-v" + Else If "{1}" =~ /--with-gnu-ld/ + Set with_gnu_ld 1 + Else + Echo -n 'mpw-configure: Unrecognized option: "' + Echo -n "{1}" + Echo '"; use --help for usage.' + Exit 1 + End If + Shift 1 +End Loop + +If {helpoutput} == 1 + Echo "Usage: mpw-configure [OPTIONS]" + Echo "" + Echo "Options: [defaults in brackets]" + Echo "--bindir DIR directory for binaries []" + Echo "--cc CC use C compiler CC [mpwc]" + Echo "--disable-FOO do not include feature FOO" + Echo "--enable-FOO include feature FOO" + Echo "--exec-prefix DIR install host-dependent files into DIR []" + Echo "--help print this message" + Echo "--host HOST configure for HOST [m68k-apple-mpw]" + Echo "--norecursion configure this directory only [recurse]" + Echo "--prefix DIR install into DIR [{MPW}:GNUTools:]" + Echo "--srcdir DIR find the sources in DIR [:]" + Echo "--srcroot DIR find the toplevel sources in DIR [:]" + Echo "--target TARGET configure for TARGET [TARGET=HOST]" + Echo "-v verbose" + Echo "--with-gnu-ld link using GNU ld [no]" + Exit 0 +End If + +Set Exit 0 + +# Default exec_prefix from prefix. + +If "{exec_prefix}" == "" + Set exec_prefix "{prefix}" +End If + +If "{bindir}" == "" + Set bindir "{prefix}"bin: +End If + +# Point to the correct set of tools to use with the chosen compiler. + +If "{host_cc}" =~ /mpwc/ + Set host_alias "m68k-apple-mpw" + Set cc_name '{CC_MPW_C}' + Set segment_flag '-s ' + Set ar_name '{AR_LIB}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_LINK}' + Set prog_ext_name '{PROG_EXT_68K}' + Set extralibs_name '{EXTRALIBS_C}' + Set makepef_name '{MAKEPEF_NULL}' + Set rez_name '{REZ_68K}' +Else If "{host_cc}" =~ /sc68k/ + Set host_alias "m68k-apple-mpw" + Set cc_name '{CC_SC}' + Set segment_flag '-s ' + Set ar_name '{AR_LIB}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_LINK}' + Set prog_ext_name '{PROG_EXT_68K}' + Set extralibs_name '{EXTRALIBS_C}' + Set makepef_name '{MAKEPEF_NULL}' + Set rez_name '{REZ_68K}' +Else If "{host_cc}" =~ /mwc68k/ + Set host_alias "m68k-apple-mpw" + Set cc_name '{CC_MWC68K}' + Set segment_flag '-s ' + Set ar_name '{AR_MWLINK68K}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_MWLINK68K}' + Set prog_ext_name '{PROG_EXT_68K}' + Set extralibs_name '{EXTRALIBS_MWC68K}' + Set makepef_name '{MAKEPEF_NULL}' + Set rez_name '{REZ_68K}' +Else If "{host_cc}" =~ /gcc68k/ + Set host_alias "m68k-apple-mpw" + Set cc_name '{CC_68K_GCC}' + Set segment_flag '-s ' + Set ar_name '{AR_68K_AR}' + Set ranlib_name '{RANLIB_RANLIB}' + Set cc_ld_name '{CC_68K_GCC}' + Set prog_ext_name '{PROG_EXT_68K}' + Set extralibs_name '{EXTRALIBS_C}' + Set makepef_name '{MAKEPEF_NULL}' + Set rez_name '{REZ_68K}' +Else If "{host_cc}" =~ /ppcc/ + Set host_alias "powerpc-apple-mpw" + Set cc_name '{CC_PPCC}' + Set segment_flag '-d ___s_e_g___=' + Set ar_name '{AR_PPCLINK}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_PPCLINK}' + Set prog_ext_name '{PROG_EXT_XCOFF}' + Set extralibs_name '{EXTRALIBS_PPC}' + Set makepef_name '{MAKEPEF_PPC}' + Set rez_name '{REZ_PPC}' +Else If "{host_cc}" =~ /mrc/ + Set host_alias "powerpc-apple-mpw" + Set cc_name '{CC_MRC}' + Set segment_flag '-d ___s_e_g___=' + Set ar_name '{AR_PPCLINK}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_PPCLINK}' + Set prog_ext_name '{PROG_EXT_XCOFF}' + Set extralibs_name '{EXTRALIBS_PPC}' + Set makepef_name '{MAKEPEF_PPC}' + Set rez_name '{REZ_PPC}' +Else If "{host_cc}" =~ /scppc/ + Set host_alias "powerpc-apple-mpw" + Set cc_name '{CC_SC}' + Set segment_flag '-d ___s_e_g___=' + Set ar_name '{AR_PPCLINK}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_PPCLINK}' + Set prog_ext_name '{PROG_EXT_XCOFF}' + Set extralibs_name '{EXTRALIBS_PPC}' + Set makepef_name '{MAKEPEF_PPC}' + Set rez_name '{REZ_PPC}' +Else If "{host_cc}" =~ /mwcppc/ + Set host_alias "powerpc-apple-mpw" + Set cc_name '{CC_MWCPPC}' + Set segment_flag '-d ___s_e_g___=' + Set ar_name '{AR_MWLINKPPC}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_MWLINKPPC}' + # Misleading, but we don't need a PEF step. + Set prog_ext_name '{PROG_EXT_68K}' + Set extralibs_name '{EXTRALIBS_MWCPPC}' + Set makepef_name '{MAKEPEF_NULL}' + Set rez_name '{REZ_PPC}' +Else If "{host_cc}" =~ /gccppc/ + Set host_alias "powerpc-apple-mpw" + Set cc_name '{CC_PPC_GCC}' + Set segment_flag '-d ___s_e_g___=' + Set ar_name '{AR_PPCLINK}' + If {with_gnu_ld} == 1 + Set ranlib_name '{RANLIB_RANLIB}' + Set cc_ld_name '{CC_LD_GLD}' + Else + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_PPCLINK}' + End If + Set prog_ext_name '{PROG_EXT_XCOFF}' + Set extralibs_name '{EXTRALIBS_PPC}' + Set makepef_name '{MAKEPEF_PPC}' + Set rez_name '{REZ_PPC}' +Else + Echo "{host_cc}" is not a known MPW compiler type +End If + +Set dash_c_flag '' +If "{host_cc}" =~ /gcc68k/ + Set dash_c_flag '-c' +Else If "{host_cc}" =~ /gccppc/ + Set dash_c_flag '-c' +End If + +# (should interpret aliases if not in canonical form) + +Set host_canonical "{host_alias}" + +Set target_canonical "{target_alias}" + +Set configdirs "" + +If "{srcroot}" =~ /--------/ + Set srcroot "{srcdir}" +End If +If "`Exists "{srcdir}"`" == "" + Echo Source directory {srcdir} does not exist! + Exit 1 +End If +If "`Exists "{srcroot}"`" == "" + Echo Top-level source directory {srcroot} does not exist! + Exit 1 +End If + +Set target_cpu "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`" +Set target_vendor "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`" +Set target_os "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`" + +# Create a file that is guaranteed to be older than any other here. + +If "`Exists "{objdir}"_oldest`" == "" + mpw-touch _oldest +End If + +# Record this before creating any files, makefiles sometimes mention +# dependencies on config.status. + +Echo "# This directory was configured as follows:" >config.new +Echo "{ThisScript} --host {host_alias} --target {target_alias} --srcdir {srcdir} --srcroot {srcroot} --prefix {prefix} --cc {host_cc} {verifystr} {enable_options} {disable_options} --norecursion" >>config.new +MoveIfChange config.new config.status + +If "`Exists "{srcdir}"mpw-config.in`" != "" + tr-7to8 "{srcdir}"mpw-config.in >"{objdir}"mpw-config.in + Execute "{objdir}"mpw-config.in +End If + +# Start Makefile construction by defining all the variables chosen by +# configuration. + +Echo "# This Makefile produced by mpw-configure. Changes may get lost!" > "{objdir}"Makefile.tem +Echo "srcroot = " {srcroot} >> "{objdir}"Makefile.tem +Echo "topsrcdir = " {srcroot} >> "{objdir}"Makefile.tem +Echo "srcdir = " {srcdir} >> "{objdir}"Makefile.tem +Echo "mpw_prefix = " {prefix} >> "{objdir}"Makefile.tem +Echo "mpw_exec_prefix = " {exec_prefix} >> "{objdir}"Makefile.tem +Echo "mpw_bindir = " {bindir} >> "{objdir}"Makefile.tem +Echo "host_alias = " {host_alias} >> "{objdir}"Makefile.tem +Echo "target_alias = " {target_alias} >> "{objdir}"Makefile.tem +Echo "target_cpu = " {target_cpu} >> "{objdir}"Makefile.tem +Echo "target_vendor = " {target_vendor} >> "{objdir}"Makefile.tem +Echo "target_os = " {target_os} >> "{objdir}"Makefile.tem +Echo "target_canonical = " {target_canonical} >> "{objdir}"Makefile.tem +Echo "host_makefile_frag = " >> "{objdir}"Makefile.tem +Echo "target_makefile_frag = " >> "{objdir}"Makefile.tem +Echo "CC = " {cc_name} >> "{objdir}"Makefile.tem +Echo "AR = " {ar_name} >> "{objdir}"Makefile.tem +Echo "RANLIB = " {ranlib_name} >> "{objdir}"Makefile.tem +Echo "CC_LD = " {cc_ld_name} >> "{objdir}"Makefile.tem +Echo "PROG_EXT = " {prog_ext_name} >> "{objdir}"Makefile.tem +Echo "EXTRALIBS = " {extralibs_name} >> "{objdir}"Makefile.tem +Echo "MAKEPEF = " {makepef_name} >> "{objdir}"Makefile.tem +Echo "REZ = " {rez_name} >> "{objdir}"Makefile.tem + +If {host_cc} =~ /gccppc/ + Echo -n "dq =\Option-d\Option-d\Option-d" > "{objdir}"Makefile.tem0 + Echo '"' >> "{objdir}"Makefile.tem0 + tr-7to8 "{objdir}"Makefile.tem0 >>"{objdir}"Makefile.tem +Else + Echo -n "dq ='" >> "{objdir}"Makefile.tem + Echo -n '"' >> "{objdir}"Makefile.tem + Echo "'" >> "{objdir}"Makefile.tem +End If + +# Append the master set of definitions for the various compilers. + +If "`Exists "{srcdir}"config:mpw-mh-mpw`" != "" + tr-7to8 "{srcdir}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem +Else If "`Exists "{srcroot}"config:mpw-mh-mpw`" != "" + tr-7to8 "{srcroot}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem +Else + Echo "can't find a host config file!" + Exit 0 +End If + +# Append anything produced by the directory's mpw-config.in. + +If "`Exists "{objdir}"mk.tmp`" != "" + Catenate "{objdir}"mk.tmp >>"{objdir}"Makefile.tem + # An mpw-config.in might change so as not to create this + # anymore, so get rid of it now to be safe. + Delete -i -y "{objdir}"mk.tmp +End If + +# If there are sed scripts to edit the Unix Makefile.in, use them; otherwise +# use an mpw-make.in if present. + +If "`Exists "{srcdir}"mpw-make.sed`" != "" + If "`Exists "{objdir}"hacked_Makefile.in`" != "" + Set MakefileIn "{objdir}"hacked_Makefile.in + Else + Set MakefileIn "{srcdir}"Makefile.in + End If + # Find the generic makefile editing script. + If "`Exists "{srcroot}"config:mpw:g-mpw-make.sed`" != "" + sed -f "{srcroot}"config:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1 + Else If "`Exists "{srcroot}"utils:mpw:g-mpw-make.sed`" != "" + sed -f "{srcroot}"utils:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1 + Else If "`Exists "{srcdir}"g-mpw-make.sed`" != "" + sed -f "{srcdir}"g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1 + Else + Echo Warning: g-mpw-make.sed not found, copying "{MakefileIn}" verbatim... + Catenate "{MakefileIn}" >"{objdir}"Makefile.tem1 + End If + sed -f "{srcdir}"mpw-make.sed "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2 + sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' -e 's/^exec_prefix = .*$/exec_prefix = {mpw_exec_prefix}/g' -e 's/^bindir = @bindir@/bindir = {mpw_bindir}/g' "{objdir}"Makefile.tem2 >"{objdir}"Makefile.tem3 + sed -e "s/@DASH_C_FLAG@/{dash_c_flag}/" -e "s/@SEGMENT_FLAG(\([^)]*\))@/{segment_flag}\1/" "{objdir}"Makefile.tem3 >"{objdir}"mpw-make.in + tr-7to8 "{objdir}"mpw-make.in >>"{objdir}"Makefile.tem + If "`Exists "{objdir}"mk.sed`" != "" + sed -f "{objdir}"mk.sed "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2 + Rename -y "{objdir}"Makefile.tem2 "{objdir}"Makefile.tem + End If + MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile + Delete -i -y "{objdir}"Makefile.tem[12] + If {verify} == 1 + Echo Created Makefile in "`Directory`" + End If +Else If "`Exists "{srcdir}"mpw-make.in`" != "" + sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' "{srcdir}"mpw-make.in >"{objdir}"Makefile.tem1 + sed -e "s/@DASH_C_FLAG@/{dash_c_flag}/" -e "s/@SEGMENT_FLAG(\([^)]*\))@/{segment_flag}}\1/" "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2 + tr-7to8 "{objdir}"Makefile.tem2 >>"{objdir}"Makefile.tem + If "`Exists "{objdir}"mk.sed`" != "" + sed -f "{objdir}"mk.sed "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2 + Rename -y "{objdir}"Makefile.tem2 "{objdir}"Makefile.tem + End If + MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile + Delete -i -y "{objdir}"Makefile.tem[12] + If {verify} == 1 + Echo Created Makefile in "`Directory`" + End If +End If + +# Produce a build script if the source is defined. + +If "`Exists "{srcdir}"mpw-build.in`" != "" + Echo "Set srcroot " {srcroot} > "{objdir}"mpw-build.tem + Echo "Set srcdir " {srcdir} >> "{objdir}"mpw-build.tem + Echo "Set target_canonical " {target_canonical} >> "{objdir}"mpw-build.tem + Echo "Set prefix " {prefix} >> "{objdir}"mpw-build.tem + tr-7to8 "{srcdir}"mpw-build.in >>"{objdir}"mpw-build.tem + MoveIfChange "{objdir}"mpw-build.tem "{objdir}"mpw-build + If {verify} == 1 + Echo Created mpw-build in "`Directory`" + End If +End If + +# Apply ourselves recursively to the list of subdirectories to configure. + +If {recurse} == 1 + For subdir In {configdirs} + Set savedir "`Directory`" + If "`Exists "{srcdir}{subdir}:"`" == "" + If {verify} == 1 + Echo No "{srcdir}{subdir}:" found, skipping + End If + Continue + End If + If {verify} == 1 + Echo Configuring {subdir}... + End If + If "`Exists "{objdir}{subdir}:"`" == "" + NewFolder "{objdir}{subdir}" + End If + SetDirectory "{objdir}{subdir}:" + "{ThisScript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" --prefix "{prefix}" --cc "{host_cc}" {verifystr} {enable_options} {disable_options} + SetDirectory "{savedir}" + End For +End If + +SetDirectory "{savedir}" diff --git a/gnu/dist/toolchain/mpw-install b/gnu/dist/toolchain/mpw-install new file mode 100644 index 000000000000..04c5aac2a4f4 --- /dev/null +++ b/gnu/dist/toolchain/mpw-install @@ -0,0 +1,122 @@ +# GNU Install script for MPW. + +Set OldExit "{Exit}" +Set Exit 0 + +Set TempUserStartup "{TempFolder}"__temp__UserStartup + +Echo '# UserStartup generated by GNU Install script' > "{TempUserStartup}" +Echo '' >> "{TempUserStartup}" + +# (should) Check that disk space is sufficient for installation. + +# Assume that the install script is where everything else is. + +Set thisdir "`Directory`" + +# Copy the binaries to the desired place. + +Confirm -t "Copy the binaries to somewhere else?" +Set TmpStatus {Status} +If {TmpStatus} == 0 + Set bindest "`GetFileName -d -m "Where to install the binaries?"`" + If {Status} == 0 + If "`Exists "{thisdir}bin"`" != "" + For afile In "{thisdir}"bin:\Option-x + Duplicate -y "{afile}" "{bindest}" + End For + Else + Echo "bin directory not found, exiting" + Exit 1 + End If + Else + Echo "No destination supplied, exiting" + Exit 1 + End If +Else If {TmpStatus} == 4 + # Use the existing directory. + Set bindest "{thisdir}bin:" +Else + # Cancelled from confirmation, escape altogether. + Exit 1 +End If + +# Copy the libraries to the desired place. + +Confirm -t "Copy the libraries to somewhere else?" +Set TmpStatus {Status} +If {TmpStatus} == 0 + Set libdest "`GetFileName -d -m "Where to install the libraries?"`" + If {Status} == 0 + If "`Exists "{thisdir}lib:"`" != "" + For afile In "{thisdir}"lib:\Option-x + Duplicate -y "{afile}" "{libdest}" + End For + Else + Echo "lib directory not found, exiting" + Exit 1 + End If + Else + Echo "No destination supplied, exiting" + Exit 1 + End If +Else If {TmpStatus} == 4 + # Use the existing directory. + Set libdest "{thisdir}lib:" +Else + # Cancelled from confirmation, escape altogether. + Exit 1 +End If + + +# Add the location of the binaries to the command path. + +Echo -n 'Set Commands "' >> "{TempUserStartup}" +Echo -n "{bindest}" >> "{TempUserStartup}" +Echo ',{Commands}"' >> "{TempUserStartup}" +Echo '' >> "{TempUserStartup}" + +# Set up GCC exec prefix. + +Set gcclibdir "{libdest}"gcc-lib: + +Echo -n 'Set GCC_EXEC_PREFIX "' >> "{TempUserStartup}" +Echo -n "{gcclibdir}" >> "{TempUserStartup}" +Echo '"' >> "{TempUserStartup}" +Echo "Export GCC_EXEC_PREFIX" >> "{TempUserStartup}" +Echo '' >> "{TempUserStartup}" + +# Set up path to libgcc.xcoff etc. + +Echo -n 'Set GCCPPCLibraries "' >> "{TempUserStartup}" +Echo -n "{libdest}" >> "{TempUserStartup}" +Echo '"' >> "{TempUserStartup}" +Echo "Export GCCPPCLibraries" >> "{TempUserStartup}" +Echo '' >> "{TempUserStartup}" + +# Display contents of UserStartup, confirm installation. + +Set UserStartupName "UserStartup\Option-8GNU" + +Echo "Contents of" {UserStartupName} "will be:" +Catenate "{TempUserStartup}" + +Confirm "Install {UserStartupName} into the MPW folder {MPW} ?" +If {Status} == 0 + Duplicate "{TempUserStartup}" "{MPW}{UserStartupName}" + Delete -y "{TempUserStartup}" +Else + Echo "{UserStartupName} file not installed" +End If + +# (should) Check HEXA resource, warn if low. + +# (should) Check for spaces in pathnames, warn if found. + +Echo "Installation was successful." +Echo "" +Echo "Be sure to review the usage notes in 'Read Me for MPW' before proceeding!" + +# Restore previous settings. + +Set Exit "{OldExit}" diff --git a/gnu/dist/toolchain/setup.com b/gnu/dist/toolchain/setup.com new file mode 100644 index 000000000000..553afd55ae1c --- /dev/null +++ b/gnu/dist/toolchain/setup.com @@ -0,0 +1,8 @@ +$! setup files for openVMS/Alpha +$! +$ define aout [-.INCLUDE.AOUT] +$ define coff [-.INCLUDE.COFF] +$ define elf [-.INCLUDE.ELF] +$ define mpw [-.INCLUDE.MPW] +$ define nlm [-.INCLUDE.NLM] +$ define opcode [-.INCLUDE.OPCODE] diff --git a/gnu/dist/toolchain/texinfo/texinfo.tex b/gnu/dist/toolchain/texinfo/texinfo.tex index eb620254d559..550bd8787324 100644 --- a/gnu/dist/toolchain/texinfo/texinfo.tex +++ b/gnu/dist/toolchain/texinfo/texinfo.tex @@ -1,32 +1,54 @@ -%% TeX macros to handle Texinfo files. -%% $Id: texinfo.tex,v 1.2 1998/03/24 17:58:28 law Exp $ - -% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, -% 94, 95, 96, 97 Free Software Foundation, Inc. - -%This texinfo.tex file is free software; you can redistribute it and/or -%modify it under the terms of the GNU General Public License as -%published by the Free Software Foundation; either version 2, or (at -%your option) any later version. - -%This texinfo.tex file is distributed in the hope that it will be -%useful, but WITHOUT ANY WARRANTY; without even the implied warranty -%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -%General Public License for more details. - -%You should have received a copy of the GNU General Public License -%along with this texinfo.tex file; see the file COPYING. If not, write -%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -%Boston, MA 02111-1307, USA. - - -%In other words, you are welcome to use, share and improve this program. -%You are forbidden to forbid anyone else to use, share and improve -%what you give them. Help stamp out software-hoarding! - - -% Send bug reports to bug-texinfo@prep.ai.mit.edu. -% Please include a *precise* test case in each bug report. +% texinfo.tex -- TeX macros to handle Texinfo files. +% $Id: texinfo.tex,v 1.1 1999/06/12 09:59:55 ian Exp $ +% +% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98 +% Free Software Foundation, Inc. +% +% This texinfo.tex file is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License as +% published by the Free Software Foundation; either version 2, or (at +% your option) any later version. +% +% This texinfo.tex file is distributed in the hope that it will be +% useful, but WITHOUT ANY WARRANTY; without even the implied warranty +% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this texinfo.tex file; see the file COPYING. If not, write +% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +% Boston, MA 02111-1307, USA. +% +% In other words, you are welcome to use, share and improve this program. +% You are forbidden to forbid anyone else to use, share and improve +% what you give them. Help stamp out software-hoarding! +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% ftp://ftp.gnu.org/pub/gnu/texinfo.tex +% /home/gd/gnu/doc/texinfo.tex on the GNU machines. +% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) +% ftp://tug.org/tex/texinfo.tex +% ftp://ctan.org/macros/texinfo/texinfo.tex +% (and all CTAN mirrors, finger ctan@ctan.org for a list). +% The texinfo.tex in the texinfo distribution itself could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. +% Please include a precise test case in each bug report, +% including a complete document with which we can reproduce the problem. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For simple +% manuals, however, you can get away with: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever, to process the dvi file. +% The extra runs of TeX get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. % Make it possible to create a .fmt file just by loading this file: @@ -36,7 +58,7 @@ % This automatically updates the version number based on RCS. \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} -\deftexinfoversion$Revision: 1.2 $ +\deftexinfoversion$Revision: 1.1 $ \message{Loading texinfo package [Version \texinfoversion]:} % If in a .fmt file, print the version number @@ -54,24 +76,17 @@ \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end -\let\ptexequiv = \equiv +\let\ptexequiv=\equiv +\let\ptexexclam=\! \let\ptexi=\i \let\ptexlbrace=\{ \let\ptexrbrace=\} \let\ptexstar=\* \let\ptext=\t -% Be sure we're in horizontal mode when doing a tie, since we make space -% equivalent to this in @example-like environments. Otherwise, a space -% at the beginning of a line will start with \penalty -- and -% since \penalty is valid in vertical mode, we'd end up putting the -% penalty on the vertical list instead of in the new paragraph. -{\catcode`@ = 11 - % Avoid using \@M directly, because that causes trouble - % if the definition is written into an index file. - \global\let\tiepenalty = \@M - \gdef\tie{\leavevmode\penalty\tiepenalty\ } -} +% We never want plain's outer \+ definition in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax \message{Basics,} @@ -81,18 +96,20 @@ % starts a new line in the output. \newlinechar = `^^J -% Set up fixed words for English. -\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi% -\def\putwordInfo{Info}% -\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi% -\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi% -\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi% -\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi% -\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi% -\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi% -\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi% -\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi% -\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi% +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortContents\undefined \gdef\putwordShortContents{Short Contents}\fi +\ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi % Ignore a token. % @@ -113,11 +130,21 @@ % since that produces some useless output on the terminal. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\ifx\eTeXversion\undefined \def\loggingall{\tracingcommands2 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% +\else +\def\loggingall{\tracingcommands3 \tracingstats2 + \tracingpages1 \tracingoutput1 \tracinglostchars1 + \tracingmacros2 \tracingparagraphs1 \tracingrestores1 + \tracingscantokens1 \tracingassigns1 \tracingifs1 + \tracinggroups1 \tracingnesting2 + \showboxbreadth\maxdimen\showboxdepth\maxdimen +}% +\fi % For @cropmarks command. % Do @cropmarks to get crop marks. @@ -128,15 +155,10 @@ % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % -\newdimen\cornerlong \newdimen\cornerthick -\newdimen\topandbottommargin -\newdimen\outerhsize \newdimen\outervsize -\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks -\outerhsize=7in -%\outervsize=9.5in -% Alternative @smallbook page size is 9.25in -\outervsize=9.25in -\topandbottommargin=.75in +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in % Main output routine. \chardef\PAGE = 255 @@ -321,11 +343,11 @@ %% Call \inENV within environments (after a \begingroup) \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} \def\ENVcheck{% -\ifENV\errmessage{Still within an environment. Type Return to continue.} +\ifENV\errmessage{Still within an environment; press RETURN to continue} \endgroup\fi} % This is not perfect, but it should reduce lossage % @begin foo is the same as @foo, for now. -\newhelp\EMsimple{Type to continue.} +\newhelp\EMsimple{Press RETURN to continue.} \outer\def\begin{\parsearg\beginxxx} @@ -384,7 +406,7 @@ % @@ prints an @ % Kludge this until the fonts are right (grr). -\def\@{{\tt \char '100}} +\def\@{{\tt\char64}} % This is turned off because it was never documented % and you can use @w{...} around a quote to suppress ligatures. @@ -394,8 +416,8 @@ %\def\'{{'}} % Used to generate quoted braces. -\def\mylbrace {{\tt \char '173}} -\def\myrbrace {{\tt \char '175}} +\def\mylbrace {{\tt\char123}} +\def\myrbrace {{\tt\char125}} \let\{=\mylbrace \let\}=\myrbrace \begingroup @@ -432,6 +454,18 @@ \fi\fi } +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } @@ -441,14 +475,11 @@ % @. is an end-of-sentence period. \def\.{.\spacefactor=3000 } -% @enddots{} is an end-of-sentence ellipsis. -\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000} - % @! is an end-of-sentence bang. -\gdef\!{!\spacefactor=3000 } +\def\!{!\spacefactor=3000 } % @? is an end-of-sentence query. -\gdef\?{?\spacefactor=3000 } +\def\?{?\spacefactor=3000 } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would @@ -532,7 +563,7 @@ where each line of input produces a line of output.} %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% -%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000 +%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak %\prevdepth=-1000pt %}} @@ -573,12 +604,34 @@ where each line of input produces a line of output.} \let\br = \par -% @dots{} output some dots +% @dots{} output an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in a typewriter +% font as three actual period characters. +% +\def\dots{% + \leavevmode + \hbox to 1.5em{% + \hskip 0pt plus 0.25fil minus 0.25fil + .\hss.\hss.% + \hskip 0pt plus 0.5fil minus 0.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \leavevmode + \hbox to 2em{% + \hskip 0pt plus 0.25fil minus 0.25fil + .\hss.\hss.\hss.% + \hskip 0pt plus 0.5fil minus 0.5fil + }% + \spacefactor=3000 +} -\def\dots{$\ldots$} % @page forces the start of a new page - +% \def\page{\par\vfill\supereject} % @exdent text.... @@ -645,10 +698,10 @@ where each line of input produces a line of output.} % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment -\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other% -\parsearg \commentxxx} - -\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} \let\c=\comment @@ -745,12 +798,6 @@ where each line of input produces a line of output.} \def\menu{\doignore{menu}} \def\direntry{\doignore{direntry}} -% Also ignore @macro ... @end macro. The user must run texi2dvi, -% which runs makeinfo to do macro expansion. Ignore @unmacro, too. -\def\macro{\doignore{macro}} -\let\unmacro = \comment - - % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory = \comment @@ -762,7 +809,9 @@ where each line of input produces a line of output.} \ignoresections % % Define a command to swallow text until we reach `@end #1'. - \long\def\doignoretext##1\end #1{\enddoignore}% + % This @ is a catcode 12 token (that is the normal catcode of @ in + % this texinfo.tex file). We change the catcode of @ below to match. + \long\def\doignoretext##1@end #1{\enddoignore}% % % Make sure that spaces turn into tokens that match what \doignoretext wants. \catcode32 = 10 @@ -771,6 +820,16 @@ where each line of input produces a line of output.} \catcode`\{ = 9 \catcode`\} = 9 % + % We must not have @c interpreted as a control sequence. + \catcode`\@ = 12 + % + % Make the letter c a comment character so that the rest of the line + % will be ignored. This way, the document can have (for example) + % @c @end ifinfo + % and the @end ifinfo will be properly ignored. + % (We've just changed @ to catcode 12.) + \catcode`\c = 14 + % % And now expand that command. \doignoretext } @@ -863,6 +922,9 @@ where each line of input produces a line of output.} % % Do not execute instructions in @tex \def\tex{\doignore{tex}}% + % Do not execute macro definitions. + % `c' is a comment character, so the word `macro' will get cut off. + \def\macro{\doignore{ma}}% } % @set VAR sets the variable VAR to an empty value. @@ -897,16 +959,35 @@ where each line of input produces a line of output.} % @value{foo} gets the text saved in variable foo. % -\def\value{\begingroup - \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - \valuexxx} -\def\valuexxx#1{% +{ + \catcode`\_ = \active + % + % We might end up with active _ or - characters in the argument if + % we're called from @code, as @code{@value{foo-bar_}}. So \let any + % such active characters to their normal equivalents. + \gdef\value{\begingroup + \catcode`\-=12 \catcode`\_=12 + \indexbreaks \let_\normalunderscore + \valuexxx} +} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we \let\value to this in \indexdummies). Ones +% whose names contain - or _ still won't work, but we can't do anything +% about that. The command has to be fully expandable, since the result +% winds up in the index file. This means that if the variable's value +% contains other Texinfo commands, it's almost certain it will fail +% (although perhaps we could fix that with sufficient work to do a +% one-level expansion on the result, instead of complete). +% +\def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax - {\{No value for ``#1''\}}% + {[No value for ``#1'']v}% \else \csname SET#1\endcsname \fi -\endgroup} +} % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. @@ -993,33 +1074,23 @@ where each line of input produces a line of output.} \def\bullet{\implicitmath\ptexbullet\implicitmath} \def\minus{\implicitmath-\implicitmath} -\def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx [#1,]} -\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} -\let\nwnode=\node -\let\lastnode=\relax - -\def\donoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\setref{\lastnode}\fi -\global\let\lastnode=\relax} - -\def\unnumbnoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi -\global\let\lastnode=\relax} - -\def\appendixnoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi -\global\let\lastnode=\relax} - % @refill is a no-op. \let\refill=\relax +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% - \readauxfile - \opencontents + \iflinks + \readauxfile + \fi % \openindices needs to do some work in any case. \openindices \fixbackslash % Turn off hack to swallow `\input texinfo'. \global\let\setfilename=\comment % Ignore extra @setfilename cmds. @@ -1035,30 +1106,25 @@ where each line of input produces a line of output.} \comment % Ignore the actual filename. } +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} -% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx} -% \def\macroxxx#1#2 \end macro{% -% \expandafter\gdef\macrotemp#1{#2}% -% \endgroup} - -%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx} -%\def\linemacroxxx#1#2 \end linemacro{% -%\let\parsearg=\relax -%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}% -%\expandafter\xdef\macrotemp{\parsearg\macrotempx}% -%\expandafter\gdef\macrotempx#1{#2}% -%\endgroup} - -%\def\butfirst#1{} - \message{fonts,} - % Font-change commands. -% Texinfo supports the sans serif font style, which plain TeX does not. +% Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf analogous to plain's \rm, etc. \newfam\sffam \def\sf{\fam=\sffam \tensf} @@ -1130,11 +1196,12 @@ where each line of input produces a line of output.} % Do not make many font distinctions in general in the index, since they % aren't very useful. \setfont\ninett\ttshape{9}{1000} +\setfont\ninettsl\ttslshape{10}{900} \setfont\indrm\rmshape{9}{1000} -\setfont\indit\slshape{9}{1000} -\let\indsl=\indit +\setfont\indit\itshape{9}{1000} +\setfont\indsl\slshape{9}{1000} \let\indtt=\ninett -\let\indttsl=\ninett +\let\indttsl=\ninettsl \let\indsf=\indrm \let\indbf=\indrm \setfont\indsc\scshape{10}{900} @@ -1236,7 +1303,7 @@ where each line of input produces a line of output.} \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \resetmathfonts \setleading{25pt}} -\def\titlefont#1{{\titlefonts #1}} +\def\titlefont#1{{\titlefonts\rm #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc @@ -1263,6 +1330,10 @@ where each line of input produces a line of output.} % \textfonts +% Define these so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 @@ -1277,13 +1348,14 @@ where each line of input produces a line of output.} % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} -\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx} +\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} \let\i=\smartitalic -\let\var=\smartitalic -\let\dfn=\smartitalic +\let\var=\smartslanted +\let\dfn=\smartslanted \let\emph=\smartitalic -\let\cite=\smartitalic +\let\cite=\smartslanted \def\b#1{{\bf #1}} \let\strong=\b @@ -1300,20 +1372,22 @@ where each line of input produces a line of output.} \null } \let\ttfont=\t -\def\samp #1{`\tclose{#1}'\null} +\def\samp#1{`\tclose{#1}'\null} \setfont\smallrm\rmshape{8}{1000} \font\smallsy=cmsy9 \def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% - \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{% + \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% \vbox{\hrule\kern-0.4pt - \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}% + \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% \kern-0.4pt\hrule}% - \kern-.06em\raise0.4pt\hbox{$\rangle$}}}} + \kern-.06em\raise0.4pt\hbox{\angleright}}}} % The old definition, with no lozenge: %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} +% @file, @option are the same as @samp. \let\file=\samp +\let\option=\samp % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. @@ -1348,20 +1422,18 @@ where each line of input produces a line of output.} % and arrange explicitly to hyphenate at a dash. % -- rms. { -\catcode`\-=\active -\catcode`\_=\active -\catcode`\|=\active -\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} -% The following is used by \doprintindex to insure that long function names -% wrap around. It is necessary for - and _ to be active before the index is -% read from the file, as \entry parses the arguments long before \code is -% ever called. -- mycroft -% _ is always active; and it shouldn't be \let = to an _ that is a -% subscript character anyway. Then, @cindex @samp{_} (for example) -% fails. --karl -\global\def\indexbreaks{% - \catcode`\-=\active \let-\realdash -} + \catcode`\-=\active + \catcode`\_=\active + % + \global\def\code{\begingroup + \catcode`\-=\active \let-\codedash + \catcode`\_=\active \let_\codeunder + \codex + } + % + % If we end up with any active - characters when handling the index, + % just treat them as a normal -. + \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} } \def\realdash{-} @@ -1402,8 +1474,10 @@ where each line of input produces a line of output.} \else{\tclose{\kbdfont\look}}\fi \else{\tclose{\kbdfont\look}}\fi} -% @url. Quotes do not seem necessary, so use \code. +% For @url, @env, @command quotes seem unnecessary, so use \code. \let\url=\code +\let\env=\code +\let\command=\code % @uref (abbreviation for `urlref') takes an optional second argument % specifying the text to display. First (mandatory) arg is the url. @@ -1421,7 +1495,7 @@ where each line of input produces a line of output.} % rms does not like the angle brackets --karl, 17may97. % So now @email is just like @uref. -%\def\email#1{$\langle${\tt #1}$\rangle$} +%\def\email#1{\angleleft{\tt #1}\angleright} \let\email=\uref % Check if we are currently using a typewriter font. Since all the @@ -1432,8 +1506,7 @@ where each line of input produces a line of output.} \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the -% argument is to make the input look right: @dmn{pt} instead of -% @dmn{}pt. +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} @@ -1444,11 +1517,14 @@ where each line of input produces a line of output.} % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} +% Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font -% Use of \lowercase was suggested. \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font +% @acronym downcases the argument and prints in smallcaps. +\def\acronym#1{{\smallcaps \lowercase{#1}}} + % @pounds{} is a sterling sign. \def\pounds{{\it\$}} @@ -1462,15 +1538,20 @@ where each line of input produces a line of output.} \newif\ifseenauthor \newif\iffinishedtitlepage +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @contentsaftertitlepage or @shortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue + \def\shorttitlepage{\parsearg\shorttitlepagezzz} \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \def\titlepage{\begingroup \parindent=0pt \textfonts \let\subtitlerm=\tenrm -% I deinstalled the following change because \cmr12 is undefined. -% This change was not in the ChangeLog anyway. --rms. -% \let\subtitlerm=\cmr12 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% % \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% @@ -1519,6 +1600,21 @@ where each line of input produces a line of output.} % after the title page, which we certainly don't want. \oldpage \endgroup + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi + % \HEADINGSon } @@ -1532,10 +1628,10 @@ where each line of input produces a line of output.} \let\thispage=\folio -\newtoks \evenheadline % Token sequence for heading line of even pages -\newtoks \oddheadline % Token sequence for heading line of odd pages -\newtoks \evenfootline % Token sequence for footing line of even pages -\newtoks \oddfootline % Token sequence for footing line of odd pages +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages % Now make Tex use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline @@ -1674,18 +1770,6 @@ July\or August\or September\or October\or November\or December\fi \message{tables,} - -% @tabs -- simple alignment - -% These don't work. For one thing, \+ is defined as outer. -% So these macros cannot even be defined. - -%\def\tabs{\parsearg\tabszzz} -%\def\tabszzz #1{\settabs\+#1\cr} -%\def\tabline{\parsearg\tablinezzz} -%\def\tablinezzz #1{\+#1\cr} -%\def\&{&} - % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). % default indentation of table text @@ -1729,11 +1813,6 @@ July\or August\or September\or October\or November\or December\fi \itemindex{#1}% \nobreak % This prevents a break before @itemx. % - % Be sure we are not still in the middle of a paragraph. - %{\parskip = 0in - %\par - %}% - % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next @@ -1762,13 +1841,17 @@ July\or August\or September\or October\or November\or December\fi \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the - % following text (if any) will end up on the same line. Since that - % text will be indented by \tableindent, we make the item text be in - % a zero-width box. + % following text (if any) will end up on the same line. \noindent - \rlap{\hskip -\tableindent\box0}\ignorespaces% - \endgroup% - \itemxneedsnegativevskiptrue% + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue \fi } @@ -1779,9 +1862,10 @@ July\or August\or September\or October\or November\or December\fi \def\xitem{\errmessage{@xitem while not in a table}} \def\xitemx{\errmessage{@xitemx while not in a table}} -%% Contains a kludge to get @end[description] to work +% Contains a kludge to get @end[description] to work. \def\description{\tablez{\dontindex}{1}{}{}{}{}} +% @table, @ftable, @vtable. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} {\obeylines\obeyspaces% \gdef\tablex #1^^M{% @@ -1841,7 +1925,7 @@ July\or August\or September\or October\or November\or December\fi \def\itemize{\parsearg\itemizezzz} \def\itemizezzz #1{% - \begingroup % ended by the @end itemsize + \begingroup % ended by the @end itemize \itemizey {#1}{\Eitemize} } @@ -2043,10 +2127,7 @@ July\or August\or September\or October\or November\or December\fi % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. - -%%%% -% Dimensions - +% \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace @@ -2056,15 +2137,15 @@ July\or August\or September\or October\or November\or December\fi \multitablecolspace=12pt \multitablelinespace=0pt -%%%% % Macros used to set up halign preamble: +% \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent -%% 2/1/96, to allow fractions to be given with more than one digit. +% 2/1/96, to allow fractions to be given with more than one digit. \def\pickupwholefraction#1 {\global\advance\colcount by1 % \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% \setuptable} @@ -2090,80 +2171,84 @@ July\or August\or September\or October\or November\or December\fi \ifx\go\pickupwholefraction\else\let\go\setuptable\fi% \fi\go} -%%%% % multitable syntax \def\tab{&\hskip1sp\relax} % 2/2/96 % tiny skip here makes sure this column space is % maintained, even if it is never used. - -%%%% % @multitable ... @end multitable definitions: \def\multitable{\parsearg\dotable} - \def\dotable#1{\bgroup -\let\item\cr -\tolerance=9500 -\hbadness=9500 -\setmultitablespacing -\parskip=\multitableparskip -\parindent=\multitableparindent -\overfullrule=0pt -\global\colcount=0\relax% -\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% - % To parse everything between @multitable and @item : -\setuptable#1 \endsetuptable - % Need to reset this to 0 after \setuptable. -\global\colcount=0\relax% - % - % This preamble sets up a generic column definition, which will - % be used as many times as user calls for columns. - % \vtop will set a single line and will also let text wrap and - % continue for many paragraphs if desired. -\halign\bgroup&\global\advance\colcount by 1\relax% -\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname - % In order to keep entries from bumping into each other - % we will add a \leftskip of \multitablecolspace to all columns after - % the first one. - % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % If user has set preamble in terms of percent of \hsize - % we will use that dimension as the width of the column, and - % the \leftskip will keep entries from bumping into each other. - % Table will start at left margin and final column will justify at - % right margin. -\ifnum\colcount=1 -\else - \ifsetpercent + \vskip\parskip + \let\item\crcr + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% + % + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % \everycr will reset column counter, \colcount, at the end of + % each line. Every column entry will cause \colcount to advance by one. + % The table preamble + % looks at the current \colcount to find the correct column width. + \everycr{\noalign{% + % + % \filbreak%% keeps underfull box messages off when table breaks over pages. + % Maybe so, but it also creates really weird page breaks when the table + % breaks over pages. Wouldn't \vfil be better? Wait until the problem + % manifests itself, so it can be fixed for real --karl. + \global\colcount=0\relax}}% + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup&\global\advance\colcount by 1\relax + \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip \else - % If user has set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace - \advance\hsize by \multitablecolspace + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace \fi - % In either case we will make \leftskip=\multitablecolspace: -\leftskip=\multitablecolspace -\fi - % Ignoring space at the beginning and end avoids an occasional spurious - % blank line, when TeX decides to break the line at the space before the - % box from the multistrut, so the strut ends up on a line by itself. - % For example: - % @multitable @columnfractions .11 .89 - % @item @code{#} - % @tab Legal holiday which is valid in major parts of the whole country. - % Is automatically provided with highlighting sequences respectively marking - % characters. - \noindent\ignorespaces##\unskip\multistrut}\cr - % \everycr will reset column counter, \colcount, at the end of - % each line. Every column entry will cause \colcount to advance by one. - % The table preamble - % looks at the current \colcount to find the correct column width. -\global\everycr{\noalign{% -% \filbreak%% keeps underfull box messages off when table breaks over pages. -% Maybe so, but it also creates really weird page breaks when the table -% breaks over pages Wouldn't \vfil be better? Wait until the problem -% manifests itself, so it can be fixed for real --karl. -\global\colcount=0\relax}} + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively marking + % characters. + \noindent\ignorespaces##\unskip\multistrut}\cr } \def\setmultitablespacing{% test to see if user has set \multitablelinespace. @@ -2206,12 +2291,14 @@ width0pt\relax} \fi % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. - -\def\newindex #1{ -\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file -\openout \csname#1indfile\endcsname \jobname.#1 % Open the file -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\doindex {#1}} +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} @@ -2220,31 +2307,37 @@ width0pt\relax} \fi % Define @defcodeindex, like @defindex except put all entries in @code. -\def\newcodeindex #1{ -\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file -\openout \csname#1indfile\endcsname \jobname.#1 % Open the file -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\docodeindex {#1}} +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}} } \def\defcodeindex{\parsearg\newcodeindex} % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. -\def\synindex #1 #2 {% -\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname -\expandafter\let\csname#1indfile\endcsname=\synindexfoo -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\doindex {#2}}% +% The \closeout helps reduce unnecessary open files; the limit on the +% Acorn RISC OS is a mere 16 files. +\def\synindex#1 #2 {% + \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname + \expandafter\closeout\csname#1indfile\endcsname + \expandafter\let\csname#1indfile\endcsname=\synindexfoo + \expandafter\xdef\csname#1index\endcsname{% define \xxxindex + \noexpand\doindex{#2}}% } % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. -\def\syncodeindex #1 #2 {% -\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname -\expandafter\let\csname#1indfile\endcsname=\synindexfoo -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\docodeindex {#2}}% +\def\syncodeindex#1 #2 {% + \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname + \expandafter\closeout\csname#1indfile\endcsname + \expandafter\let\csname#1indfile\endcsname=\synindexfoo + \expandafter\xdef\csname#1index\endcsname{% define \xxxindex + \noexpand\docodeindex{#2}}% } % Define \doindex, the driver for all \fooindex macros. @@ -2265,6 +2358,7 @@ width0pt\relax} \fi \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} \def\indexdummies{% +\def\ { }% % Take care of the plain tex accent commands. \def\"{\realbackslash "}% \def\`{\realbackslash `}% @@ -2306,7 +2400,6 @@ width0pt\relax} \fi \def\gtr{\realbackslash gtr}% \def\less{\realbackslash less}% \def\hat{\realbackslash hat}% -%\def\char{\realbackslash char}% \def\TeX{\realbackslash TeX}% \def\dots{\realbackslash dots }% \def\result{\realbackslash result}% @@ -2333,7 +2426,12 @@ width0pt\relax} \fi \def\kbd##1{\realbackslash kbd {##1}}% \def\dfn##1{\realbackslash dfn {##1}}% \def\emph##1{\realbackslash emph {##1}}% -\def\value##1{\realbackslash value {##1}}% +% +% Handle some cases of @value -- where the variable name does not +% contain - or _, and the value does not contain any +% (non-fully-expandable) commands. +\let\value = \expandablevalue +% \unsepspaces } @@ -2406,14 +2504,24 @@ width0pt\relax} \fi % so we do not become unable to do a definition. {\catcode`\@=0 \catcode`\\=\other -@gdef@realbackslash{\}} + @gdef@realbackslash{\}} \let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? -\let\SETmarginindex=\relax %initialize! -% workhorse for all \fooindexes -% #1 is name of index, #2 is stuff to put there -\def\doind #1#2{% +% For \ifx comparisons. +\def\emptymacro{\empty} + +% Most index entries go through here, but \dosubind is the general case. +% +\def\doind#1#2{\dosubind{#1}{#2}\empty} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% \empty if called from \doind, as we usually are. The main exception +% is with defuns, which call us directly. +% +\def\dosubind#1#2#3{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% @@ -2424,13 +2532,22 @@ width0pt\relax} \fi \indexdummies % Must do this here, since \bf, etc expand at this stage \escapechar=`\\ {% - \let\folio=0% We will expand all macros now EXCEPT \folio. + \let\folio = 0% We will expand all macros now EXCEPT \folio. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % + \def\thirdarg{#3}% + % + % If third arg is present, precede it with space in sort key. + \ifx\thirdarg\emptymacro + \let\subentry = \empty + \else + \def\subentry{ #3}% + \fi + % % First process the index-string with all font commands turned off % to get the string to sort by. - {\indexnofonts \xdef\indexsorttmp{#2}}% + {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% % % Now produce the complete index entry, with both the sort key and the % original text, including any font commands. @@ -2439,33 +2556,47 @@ width0pt\relax} \fi \write\csname#1indfile\endcsname{% \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% }% - \temp + % + % If third (subentry) arg is present, add it to the index string. + \ifx\thirdarg\emptymacro \else + \toks0 = {#3}% + \edef\temp{\temp{\the\toks0}}% + \fi + % + % If a skip is the last thing on the list now, preserve it + % by backing up by \lastskip, doing the \write, then inserting + % the skip again. Otherwise, the whatsit generated by the + % \write will make \lastskip zero. The result is that sequences + % like this: + % @end defun + % @tindex whatever + % @defun ... + % will have extra space inserted, because the \medbreak in the + % start of the @defun won't see the skip inserted by the @end of + % the previous defun. + % + % But don't do any of this if we're not in vertical mode. We + % don't want to do a \vskip and prematurely end a paragraph. + % + % Avoid page breaks due to these extra skips, too. + % + \iflinks + \ifvmode + \skip0 = \lastskip + \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi + \fi + % + \temp % do the write + % + % + \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi + \fi }% }% \penalty\count255 }% } -\def\dosubind #1#2#3{% -{\count10=\lastpenalty % -{\indexdummies % Must do this here, since \bf, etc expand at this stage -\escapechar=`\\% -{\let\folio=0% -\def\rawbackslashxx{\indexbackslash}% -% -% Now process the index-string once, with all font commands turned off, -% to get the string to sort the index by. -{\indexnofonts -\xdef\temp1{#2 #3}% -}% -% Now produce the complete index entry. We process the index-string again, -% this time with font commands expanded, to get what to print in the index. -\edef\temp{% -\write \csname#1indfile\endcsname{% -\realbackslash entry {\temp1}{\folio}{#2}{#3}}}% -\temp }% -}\penalty\count10}} - % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or @@ -2510,6 +2641,11 @@ width0pt\relax} \fi \indexbreaks % % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, @@ -2531,7 +2667,6 @@ width0pt\relax} \fi % to make right now. \def\indexbackslash{\rawbackslashxx}% \catcode`\\ = 0 - \catcode`\@ = 11 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s @@ -2544,21 +2679,35 @@ width0pt\relax} \fi % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. -% Same as \bigskipamount except no shrink. -% \balancecolumns gets confused if there is any shrink. -\newskip\initialskipamount \initialskipamount 12pt plus4pt - -\def\initial #1{% -{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt -\ifdim\lastskip<\initialskipamount -\removelastskip \penalty-200 \vskip \initialskipamount\fi -\line{\secbf#1\hfill}\kern 2pt\penalty10000}} +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \penalty -300 + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + \vskip .33\baselineskip plus .1\baselineskip + % + % Do our best not to break after the initial. + \nobreak +}} % This typesets a paragraph consisting of #1, dot leaders, and then #2 % flush to the right margin. It is used for index and table of contents % entries. The paragraph is indented by \leftskip. % -\def\entry #1#2{\begingroup +\def\entry#1#2{\begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. @@ -2581,12 +2730,15 @@ width0pt\relax} \fi % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. - \hangindent=2em + \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % + % A bit of stretch before each entry for the benefit of balancing columns. + \vskip 0pt plus1pt + % % Start a ``paragraph'' for the index entry so the line breaking % parameters we've set above will have an effect. \noindent @@ -2685,14 +2837,21 @@ width0pt\relax} \fi % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) + \advance\vsize by -\ht\partialpage \vsize = 2\vsize } + +% The double-column output routine for all double-column pages except +% the last. +% \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. - \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage + \dimen@ = \vsize + \divide\dimen@ by 2 + % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar @@ -2701,35 +2860,60 @@ width0pt\relax} \fi } \def\pagesofar{% % Re-output the contents of the output page -- any previous material, - % followed by the two boxes we just split. + % followed by the two boxes we just split, in box0 and box2. + \advance\vsize by \ht\partialpage \unvbox\partialpage + % \hsize = \doublecolumnhsize - \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% + \wd0=\hsize \wd2=\hsize + \hbox to\pagewidth{\box0\hfil\box2}% } \def\enddoublecolumns{% - \output = {\balancecolumns}\eject % split what we have + \output = {% + % Split the last of the double-column material. Leave on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize. + \pagegoal = \vsize + }% + \eject \endgroup % started in \begindoublecolumns - % - % Back to normal single-column typesetting, but take account of the - % fact that we just accumulated some stuff on the output page. - \pagegoal = \vsize } \def\balancecolumns{% % Called at the end of the double column material. - \setbox0 = \vbox{\unvbox255}% + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip - \divide\dimen@ by 2 + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. - {\vbadness=10000 \loop - \global\setbox3=\copy0 - \global\setbox1=\vsplit3 to\dimen@ - \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt - \repeat}% + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% + % \pagesofar } \catcode`\@ = \other @@ -2747,56 +2931,10 @@ width0pt\relax} \fi \newcount\appendixno \appendixno = `\@ \def\appendixletter{\char\the\appendixno} -\newwrite\contentsfile -% This is called from \setfilename. -\def\opencontents{\openout\contentsfile = \jobname.toc } - % Each @chapter defines this as the name of the chapter. -% page headings and footings can use it. @section does likewise - -\def\thischapter{} \def\thissection{} -\def\seccheck#1{\ifnum \pageno<0 - \errmessage{@#1 not allowed after generating table of contents}% -\fi} - -\def\chapternofonts{% - \let\rawbackslash=\relax - \let\frenchspacing=\relax - \def\result{\realbackslash result}% - \def\equiv{\realbackslash equiv}% - \def\expansion{\realbackslash expansion}% - \def\print{\realbackslash print}% - \def\TeX{\realbackslash TeX}% - \def\dots{\realbackslash dots}% - \def\result{\realbackslash result}% - \def\equiv{\realbackslash equiv}% - \def\expansion{\realbackslash expansion}% - \def\print{\realbackslash print}% - \def\error{\realbackslash error}% - \def\point{\realbackslash point}% - \def\copyright{\realbackslash copyright}% - \def\tt{\realbackslash tt}% - \def\bf{\realbackslash bf}% - \def\w{\realbackslash w}% - \def\less{\realbackslash less}% - \def\gtr{\realbackslash gtr}% - \def\hat{\realbackslash hat}% - \def\char{\realbackslash char}% - \def\tclose##1{\realbackslash tclose{##1}}% - \def\code##1{\realbackslash code{##1}}% - \def\samp##1{\realbackslash samp{##1}}% - \def\r##1{\realbackslash r{##1}}% - \def\b##1{\realbackslash b{##1}}% - \def\key##1{\realbackslash key{##1}}% - \def\file##1{\realbackslash file{##1}}% - \def\kbd##1{\realbackslash kbd{##1}}% - % These are redefined because @smartitalic wouldn't work inside xdef. - \def\i##1{\realbackslash i{##1}}% - \def\cite##1{\realbackslash cite{##1}}% - \def\var##1{\realbackslash var{##1}}% - \def\emph##1{\realbackslash emph{##1}}% - \def\dfn##1{\realbackslash dfn{##1}}% -} +% page headings and footings can use it. @section does likewise. +\def\thischapter{} +\def\thissection{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raise/lowersections modify this count @@ -2868,59 +3006,59 @@ width0pt\relax} \fi \fi } - +% @chapter, @appendix, @unnumbered. \def\thischaptername{No Chapter Title} \outer\def\chapter{\parsearg\chapteryyy} \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz #1{\seccheck{chapter}% +\def\chapterzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}% +\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% \chapmacro {#1}{\the\chapno}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% % We don't substitute the actual chapter name into \thischapter % because we don't want its macros evaluated now. \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % +\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% + {\the\chapno}}}% +\temp +\donoderef \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec -}} +} \outer\def\appendix{\parsearg\appendixyyy} \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz -\def\appendixzzz #1{\seccheck{appendix}% +\def\appendixzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \appendixno by 1 \message{Appendix \appendixletter}% +\global\advance \appendixno by 1 +\message{\putwordAppendix\space \appendixletter}% \chapmacro {#1}{\putwordAppendix{} \appendixletter}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash chapentry{\the\toks0}% - {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % +\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% + {\putwordAppendix{} \appendixletter}}}% +\temp +\appendixnoderef \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec -}} +} % @centerchap is like @unnumbered, but the heading is centered. \outer\def\centerchap{\parsearg\centerchapyyy} \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} +% @top is like @unnumbered. \outer\def\top{\parsearg\unnumberedyyy} + \outer\def\unnumbered{\parsearg\unnumberedyyy} \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz #1{\seccheck{unnumbered}% +\def\unnumberedzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 % % This used to be simply \message{#1}, but TeX fully expands the @@ -2932,155 +3070,139 @@ width0pt\relax} \fi % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, -% simply yielding the contents of the . +% simply yielding the contents of . (We also do this for +% the toc entries.) \toks0 = {#1}\message{(\the\toks0)}% % \unnumbchapmacro {#1}% \gdef\thischapter{#1}\gdef\thissection{#1}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% +\temp +\unnumbnoderef \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec -}} +} +% Sections. \outer\def\numberedsec{\parsearg\secyyy} \def\secyyy #1{\numhead1{#1}} % normally calls seczzz -\def\seczzz #1{\seccheck{section}% +\def\seczzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash secentry % -{\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} +\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% + {\the\chapno}{\the\secno}}}% +\temp +\donoderef +\nobreak +} \outer\def\appendixsection{\parsearg\appendixsecyyy} \outer\def\appendixsec{\parsearg\appendixsecyyy} \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz #1{\seccheck{appendixsection}% +\def\appendixsectionzzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash secentry % -{\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} +\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% + {\appendixletter}{\the\secno}}}% +\temp +\appendixnoderef +\nobreak +} \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz #1{\seccheck{unnumberedsec}% +\def\unnumberedseczzz #1{% \plainsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% +\temp +\unnumbnoderef +\nobreak +} +% Subsections. \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz #1{\seccheck{subsection}% +\def\numberedsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash subsecentry % -{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} +\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% + {\the\chapno}{\the\secno}{\the\subsecno}}}% +\temp +\donoderef +\nobreak +} \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz #1{\seccheck{appendixsubsec}% +\def\appendixsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash subsecentry % -{\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} +\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% + {\appendixletter}{\the\secno}{\the\subsecno}}}% +\temp +\appendixnoderef +\nobreak +} \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% +\def\unnumberedsubseczzz #1{% \plainsubsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% + {\the\toks0}}}% +\temp +\unnumbnoderef +\nobreak +} +% Subsubsections. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz #1{\seccheck{subsubsection}% +\def\numberedsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash subsubsecentry{\the\toks0} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} - {\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} +\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% + {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% +\temp +\donoderef +\nobreak +} \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% +\def\appendixsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash subsubsecentry{\the\toks0}% - {\appendixletter} - {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} +\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% + {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% +\temp +\appendixnoderef +\nobreak +} \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% +\def\unnumberedsubsubseczzz #1{% \plainsubsubsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% \toks0 = {#1}% -\edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% + {\the\toks0}}}% +\temp +\unnumbnoderef +\nobreak +} % These are variants which are not "outer", so they can appear in @ifinfo. % Actually, they should now be obsolete; ordinary section commands should work. @@ -3109,8 +3231,7 @@ width0pt\relax} \fi % Define @majorheading, @heading and @subheading -% NOTE on use of \vbox for chapter headings, section headings, and -% such: +% NOTE on use of \vbox for chapter headings, section headings, and such: % 1) We use \vbox rather than the earlier \line to permit % overlong headings to fold. % 2) \hyphenpenalty is set to 10000 because hyphenation in a @@ -3157,12 +3278,12 @@ width0pt\relax} \fi \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} -\def\CHAPPAGoff{ +\def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} -\def\CHAPPAGon{ +\def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager @@ -3216,7 +3337,7 @@ width0pt\relax} \fi \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 10000 % + \rm #1\hfill}}\bigskip \par\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts @@ -3227,7 +3348,7 @@ width0pt\relax} \fi \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt - \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 % + \hfill {\rm #1}\hfill}}\bigskip \par\nobreak } \def\CHAPFopen{ @@ -3280,24 +3401,44 @@ width0pt\relax} \fi } -\message{toc printing,} -% Finish up the main text and prepare to read what we've written -% to \contentsfile. +\message{toc,} +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. We supply {\folio} at the end of the +% argument, which will end up as the last argument to the \...entry macro. +% +% We open the .toc file here instead of at @setfilename or any other +% given time so that @contents can be put in the document anywhere. +% +\newif\iftocfileopened +\def\writetocentry#1{% + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + \iflinks \write\tocfile{#1{\folio}}\fi +} \newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Finish up the main text and prepare to read what we've written +% to \tocfile. +% \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro - \immediate\closeout \contentsfile - \ifnum \pageno>0 - \pageno = -1 % Request roman numbered pages. - \fi + \immediate\closeout\tocfile + % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \unnumbchapmacro{#1}\def\thischapter{}% + \savepageno = \pageno \begingroup % Set up to handle contents files properly. \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 % We can't do this, because then an actual ^ in a section @@ -3305,19 +3446,28 @@ width0pt\relax} \fi %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \pageno = \lastnegativepageno \fi } % Normal (long) toc. -\outer\def\contents{% +\def\contents{% \startcontents{\putwordTableofContents}% - \input \jobname.toc + \openin 1 \jobname.toc + \ifeof 1 \else + \closein 1 + \input \jobname.toc + \fi + \vfill \eject \endgroup - \vfill \eject + \lastnegativepageno = \pageno + \pageno = \savepageno } % And just the chapters. -\outer\def\summarycontents{% +\def\summarycontents{% \startcontents{\putwordShortContents}% % \let\chapentry = \shortchapentry @@ -3334,9 +3484,15 @@ width0pt\relax} \fi \def\unnumbsubsecentry ##1##2{} \def\subsubsecentry ##1##2##3##4##5##6{} \def\unnumbsubsubsecentry ##1##2{} - \input \jobname.toc + \openin 1 \jobname.toc + \ifeof 1 \else + \closein 1 + \input \jobname.toc + \fi + \vfill \eject \endgroup - \vfill \eject + \lastnegativepageno = \pageno + \pageno = \savepageno } \let\shortcontents = \summarycontents @@ -3427,11 +3583,12 @@ width0pt\relax} \fi % the index entries, but we want to suppress hyphenation here. (We % can't do that in the \entry macro, since index entries might consist % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) -% -% \turnoffactive is for the sake of @" used for umlauts. \def\tocentry#1#2{\begingroup \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks - \entry{\turnoffactive #1}{\turnoffactive #2}% + % Do not use \turnoffactive in these arguments. Since the toc is + % typeset in cmr, so characters such as _ would come out wrong; we + % have to do the usual translation tricks. + \entry{#1}{#2}% \endgroup} % Space between chapter (or whatever) number and the title. @@ -3497,30 +3654,36 @@ width0pt\relax} \fi % But \@ or @@ will get a plain tex @ character. \def\tex{\begingroup -\catcode `\\=0 \catcode `\{=1 \catcode `\}=2 -\catcode `\$=3 \catcode `\&=4 \catcode `\#=6 -\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie -\catcode `\%=14 -\catcode 43=12 % plus -\catcode`\"=12 -\catcode`\==12 -\catcode`\|=12 -\catcode`\<=12 -\catcode`\>=12 -\escapechar=`\\ -% -\let\,=\ptexcomma -\let\{=\ptexlbrace -\let\}=\ptexrbrace -\let\.=\ptexdot -\let\*=\ptexstar -\let\dots=\ptexdots -\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% -\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% -\def\@{@}% -\let\bullet=\ptexbullet -\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext -% + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie + \catcode `\%=14 + \catcode 43=12 % plus + \catcode`\"=12 + \catcode`\==12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \escapechar=`\\ + % + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\*=\ptexstar + \let\t=\ptext + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% \let\Etex=\endgroup} % Define @lisp ... @endlisp. @@ -3565,8 +3728,8 @@ width0pt\relax} \fi % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. \let\nonarrowing=\relax -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \cartouche: draw rectangle w/rounded corners around argument +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner @@ -3593,9 +3756,9 @@ width0pt\relax} \fi \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize - \advance\cartouter by 18pt % allow for 3pt kerns on either + \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from -% each corner char +% each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing=\comment @@ -3649,49 +3812,52 @@ width0pt\relax} \fi \fi } -% To ending an @example-like environment, we first end the paragraph -% (via \afterenvbreak's vertical glue), and then the group. That way we -% keep the zero \parskip that the environments set -- \parskip glue -% will be inserted at the beginning of the next paragraph in the -% document, after the environment. +% Define the \E... control sequence only if we are inside the particular +% environment, so the error checking in \end will work. +% +% To end an @example-like environment, we first end the paragraph (via +% \afterenvbreak's vertical glue), and then the group. That way we keep +% the zero \parskip that the environments set -- \parskip glue will be +% inserted at the beginning of the next paragraph in the document, after +% the environment. % -\def\nonfillfinish{\afterenvbreak\endgroup}% +\def\nonfillfinish{\afterenvbreak\endgroup} +% @lisp: indented, narrowed, typewriter font. \def\lisp{\begingroup \nonfillstart \let\Elisp = \nonfillfinish \tt - % Make @kbd do something special, if requested. - \let\kbdfont\kbdexamplefont - \rawbackslash % have \ input char produce \ char from current font - \gobble + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return } -% Define the \E... control sequence only if we are inside the -% environment, so the error checking in \end will work. -% -% We must call \lisp last in the definition, since it reads the -% return following the @example (or whatever) command. -% +% @example: Same as @lisp. \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} -\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp} -\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp} -% @smallexample and @smalllisp. This is not used unless the @smallbook -% command is given. Originally contributed by Pavel@xerox. +% @small... is usually equivalent to the non-small (@smallbook +% redefines). We must call \example (or whatever) last in the +% definition, since it reads the return following the @example (or +% whatever) command. +% +% This actually allows (for example) @end display inside an +% @smalldisplay. Too bad, but makeinfo will catch the error anyway. % +\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} +\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} +\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} +\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} + +% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. +% Originally contributed by Pavel@xerox. \def\smalllispx{\begingroup - \nonfillstart - \let\Esmalllisp = \nonfillfinish - \let\Esmallexample = \nonfillfinish - % - % Smaller fonts for small examples. - \indexfonts \tt - \rawbackslash % make \ output the \ character from the current font (tt) - \gobble + \def\Esmalllisp{\nonfillfinish\endgroup}% + \def\Esmallexample{\nonfillfinish\endgroup}% + \indexfonts + \lisp } -% This is @display; same as @lisp except use roman font. +% @display: same as @lisp except keep current font. % \def\display{\begingroup \nonfillstart @@ -3699,7 +3865,15 @@ width0pt\relax} \fi \gobble } -% This is @format; same as @display except don't narrow margins. +% @smalldisplay (when @smallbook): @display plus smaller fonts. +% +\def\smalldisplayx{\begingroup + \def\Esmalldisplay{\nonfillfinish\endgroup}% + \indexfonts \rm + \display +} + +% @format: same as @display except don't narrow margins. % \def\format{\begingroup \let\nonarrowing = t @@ -3708,20 +3882,27 @@ width0pt\relax} \fi \gobble } -% @flushleft (same as @format) and @flushright. +% @smallformat (when @smallbook): @format plus smaller fonts. % -\def\flushleft{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eflushleft = \nonfillfinish - \gobble +\def\smallformatx{\begingroup + \def\Esmallformat{\nonfillfinish\endgroup}% + \indexfonts \rm + \format } + +% @flushleft (same as @format). +% +\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} + +% @flushright. +% \def\flushright{\begingroup \let\nonarrowing = t \nonfillstart \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill - \gobble} + \gobble +} % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. @@ -3744,6 +3925,7 @@ width0pt\relax} \fi \fi } + \message{defuns,} % Define formatter for defuns % First, allow user to change definition object font (\df) internally @@ -3813,20 +3995,18 @@ width0pt\relax} \fi % outside the @def... \dimen2=\leftskip \advance\dimen2 by -\defbodyindent -\dimen3=\rightskip -\advance\dimen3 by -\defbodyindent -\noindent % +\noindent \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations -\parshape 2 0in \dimen0 \defargsindent \dimen1 % +\parshape 2 0in \dimen0 \defargsindent \dimen1 % Now output arg 2 ("Function" or some such) % ending at \deftypemargin from the right margin, % but stuck inside a box of width 0 so it does not interfere with linebreaking {% Adjust \hsize to exclude the ambient margins, % so that \rightline will obey them. -\advance \hsize by -\dimen2 \advance \hsize by -\dimen3 -\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}% +\advance \hsize by -\dimen2 +\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% % Make all lines underfull and no complaints: \tolerance=10000 \hbadness=10000 \advance\leftskip by -\defbodyindent @@ -3847,23 +4027,46 @@ width0pt\relax} \fi \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\activeparens\spacesplit#3}% \parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % 61 is `=' \obeylines\activeparens\spacesplit#3} -\def\defmethparsebody #1#2#3#4 {\begingroup\inENV % +% #1 is the \E... control sequence to end the definition (which we define). +% #2 is the \...x control sequence for consecutive fns (which we define). +% #3 is the control sequence to call to resume processing. +% #4, delimited by the space, is the class name. +% +\def\defmethparsebody#1#2#3#4 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% \parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#4}}} +% @deftypemethod has an extra argument that nothing else does. Sigh. +% #1 is the \E... control sequence to end the definition (which we define). +% #2 is the \...x control sequence for consecutive fns (which we define). +% #3 is the control sequence to call to resume processing. +% #4, delimited by the space, is the class name. +% #5 is the method's return type. +% +\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV % +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% +\parindent=0in +\advance\leftskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} + \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies @@ -3872,7 +4075,7 @@ width0pt\relax} \fi \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% \parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#5}}} @@ -3887,7 +4090,7 @@ width0pt\relax} \fi \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\spacesplit#3}% \parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % @@ -3904,7 +4107,7 @@ width0pt\relax} \fi \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% \parindent=0in - \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent + \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines } @@ -3949,7 +4152,7 @@ width0pt\relax} \fi \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\spacesplit{#3{##2}}}% \parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\spacesplit{#3{#5}}} @@ -3982,7 +4185,7 @@ width0pt\relax} \fi \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil -\endgraf\penalty 10000\vskip -\parskip\penalty 10000% +\endgraf\nobreak\vskip -\parskip\nobreak } \def\deftypefunargs #1{% @@ -3993,7 +4196,7 @@ width0pt\relax} \fi \tclose{#1}% avoid \code because of side effects on active chars \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil -\endgraf\penalty 10000\vskip -\parskip\penalty 10000% +\endgraf\nobreak\vskip -\parskip\nobreak } % Do complete processing of one @defun or @defunx line already parsed. @@ -4081,39 +4284,46 @@ width0pt\relax} \fi \def\defspecx #1 {\errmessage{@defspecx in invalid context}} \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}} -\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} +\def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}} % @defmethod, and so on -% @defop {Funny Method} foo-class frobnicate argument +% @defop CATEGORY CLASS OPERATION ARG... \def\defop #1 {\def\defoptype{#1}% \defopparsebody\Edefop\defopx\defopheader\defoptype} \def\defopheader #1#2#3{% -\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index +\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index \begingroup\defname {#2}{\defoptype{} on #1}% \defunargs {#3}\endgroup % } -% @deftypemethod foo-class return-type foo-method args +% @deftypemethod CLASS RETURN-TYPE METHOD ARG... % \def\deftypemethod{% - \defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} + \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} % % #1 is the class name, #2 the data type, #3 the method name, #4 the args. \def\deftypemethodheader#1#2#3#4{% - \deftypefnheaderx{Method on #1}{#2}#3 #4\relax + \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index + \begingroup + \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}% + \deftypefunargs{#4}% + \endgroup } % @defmethod == @defop Method - +% \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} - -\def\defmethodheader #1#2#3{% -\dosubind {fn}{\code{#2}}{on #1}% entry in function index -\begingroup\defname {#2}{Method on #1}% -\defunargs {#3}\endgroup % +% +% #1 is the class name, #2 the method name, #3 the args. +\def\defmethodheader#1#2#3{% + \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index + \begingroup + \defname{#2}{\putwordMethodon\ \code{#1}}% + \defunargs{#3}% + \endgroup } % @defcv {Class Option} foo-class foo-flag @@ -4152,7 +4362,7 @@ width0pt\relax} \fi % This must expand the args and terminate the paragraph they make up \def\defvarargs #1{\normalparens #1% \interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000} +\endgraf\nobreak\vskip -\parskip\nobreak} % @defvr Counter foo-count @@ -4189,7 +4399,7 @@ width0pt\relax} \fi \dovarind#2 \relax% Make entry in variables index \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% \interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000 +\endgraf\nobreak\vskip -\parskip\nobreak \endgroup} \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} @@ -4200,7 +4410,7 @@ width0pt\relax} \fi \def\deftypevrheader #1#2#3{\dovarind#3 \relax% \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} \interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000 +\endgraf\nobreak\vskip -\parskip\nobreak \endgroup} % This definition is run if you use @defvarx @@ -4230,40 +4440,289 @@ width0pt\relax} \fi \def\deftpx #1 {\errmessage{@deftpx in invalid context}} -\message{cross reference,} -% Define cross-reference macros -\newwrite \auxfile +\message{macros,} +% @macro. -\newif\ifhavexrefs % True if xref values are known. +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\undefined + \newwrite\macscribble + \def\scanmacro#1{% + \begingroup \newlinechar`\^^M + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{#1}% + \immediate\closeout\macscribble + \let\xeatspaces\eatspaces + \input \jobname.tmp + \endgroup +} +\else +\def\scanmacro#1{% +\begingroup \newlinechar`\^^M +\let\xeatspaces\eatspaces\scantokens{#1}\endgroup} +\fi + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% Utility routines. +% Thisdoes \let #1 = #2, except with \csnames. +\def\cslet#1#2{% +\expandafter\expandafter +\expandafter\let +\expandafter\expandafter +\csname#1\endcsname +\csname#2\endcsname} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=12\catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \. + +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. + +\def\macrobodyctxt{% + \catcode`\~=12 + \catcode`\^=12 + \catcode`\_=12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \catcode`\+=12 + \catcode`\{=12 + \catcode`\}=12 + \catcode`\@=12 + \catcode`\^^M=12 + \usembodybackslash} + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. + +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0% + \else + \expandafter\parsemargdef \argl;% + \fi + \expandafter\ifx \csname macsave.\the\macname\endcsname \relax + \cslet{macsave.\the\macname}{\the\macname}% + \else + \message{Warning: redefining \the\macname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\def\unmacro{\parsearg\unmacroxxx} +\def\unmacroxxx#1{% + \expandafter\ifx \csname macsave.\the\macname\endcsname \relax + \errmessage{Macro \the\macname\ not defined.}% + \else + \cslet{#1}{macsave.#1}% + \expandafter\let \csname macsave.\the\macname\endcsname \undefined + \fi +} + +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname #1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.blah for each blah +% in the params list, to be ##N where N is the position in that list. +% That gets used by \mbodybackslash (above). + +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. + +\def\parsemargdef#1;{\paramno=0\def\paramlist{}% + \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1% + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) + +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% + +% This defines the macro itself. There are six cases: recursive and +% nonrecursive macros of zero, one, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\braceorline\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \noexpand\scanmacro{\temp}}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname##1{% + \csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\noexpand\scanmacro{\temp}}% + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\braceorline\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname##1{% + \csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \fi + \fi} + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg) +\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \next} + + +\message{cross references,} +\newwrite\auxfile + +\newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. -% @inforef is simple. +% @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} -% \setref{foo} defines a cross-reference point named foo. +% @node's job is to define \lastnode. +\def\node{\ENVcheck\parsearg\nodezzz} +\def\nodezzz#1{\nodexxx [#1,]} +\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} +\let\nwnode=\node +\let\lastnode=\relax -\def\setref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Ysectionnumberandtype}} +% The sectioning commands (@chapter, etc.) call these. +\def\donoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}% + {Ysectionnumberandtype}% + \global\let\lastnode=\relax + \fi +} +\def\unnumbnoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% + \global\let\lastnode=\relax + \fi +} +\def\appendixnoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}% + {Yappendixletterandtype}% + \global\let\lastnode=\relax + \fi +} -\def\unnumbsetref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Ynothing}} -\def\appendixsetref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Yappendixletterandtype}} +% @anchor{NAME} -- define xref target at arbitrary point. +% +\def\anchor#1{\setref{#1}{Ynothing}} -% \xref, \pxref, and \ref generate cross-references to specified points. -% For \xrefX, #1 is the node name, #2 the name of the Info -% cross-reference, #3 the printed node name, #4 the name of the Info -% file, #5 the name of the printed manual. All but the node name can be -% omitted. + +% \setref{NAME}{SNT} defines a cross-reference point NAME, namely +% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have +% to set \indexdummies so commands such as @code in a section title +% aren't expanded. It would be nicer not to expand the titles in the +% first place, but there's so many layers that that is hard to do. +% +\def\setref#1#2{{% + \indexdummies + \dosetq{#1-title}{Ytitle}% + \dosetq{#1-pg}{Ypagenumber}% + \dosetq{#1-snt}{#2} +}} + +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} @@ -4281,7 +4740,7 @@ width0pt\relax} \fi \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. - \ifdim \wd1>0pt% + \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. \def\printednodename{\ignorespaces #1}% \else @@ -4310,19 +4769,32 @@ width0pt\relax} \fi % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. - {\turnoffactive \refx{#1-snt}{}}% - \space [\printednodename],\space + {\normalturnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % [mynode], + [\printednodename],\space + % page 3 \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi \endgroup} % \dosetq is the interface for calls from other macros -% Use \turnoffactive so that punctuation chars such as underscore -% work in node names. -\def\dosetq #1#2{{\let\folio=0 \turnoffactive -\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% -\next}} +% Use \normalturnoffactive so that punctuation chars such as underscore +% and backslash work in node names. (\turnoffactive doesn't do \.) +\def\dosetq#1#2{% + {\let\folio=0 + \normalturnoffactive + \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% + \iflinks + \next + \fi + }% +} % \internalsetq {foo}{page} expands into % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} @@ -4373,13 +4845,15 @@ width0pt\relax} \fi \def\refx#1#2{% \expandafter\ifx\csname X#1\endcsname\relax % If not defined, say something at least. - $\langle$un\-de\-fined$\rangle$% - \ifhavexrefs - \message{\linenumber Undefined cross reference `#1'.}% - \else - \ifwarnedxrefs\else - \global\warnedxrefstrue - \message{Cross reference values unknown; you must run TeX again.}% + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + \message{\linenumber Undefined cross reference `#1'.}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi \fi \fi \else @@ -4390,10 +4864,13 @@ width0pt\relax} \fi } % This is the macro invoked by entries in the aux file. -\def\xrdef #1#2{{% - \catcode`\'=\other - \expandafter\gdef\csname X#1\endcsname{#2}% -}} +% +\def\xrdef#1{\begingroup + % Reenable \ as an escape while reading the second argument. + \catcode`\\ = 0 + \afterassignment\endgroup + \expandafter\gdef\csname X#1\endcsname +} % Read the last existing aux file, if any. No error if none exists. \def\readauxfile{\begingroup @@ -4450,8 +4927,7 @@ width0pt\relax} \fi \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other - % `\+ does not work, so use 43. - \catcode43=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % Make the characters 128-255 be printing characters {% \count 1=128 @@ -4617,10 +5093,12 @@ width0pt\relax} \fi % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. -\openin 1 = xepsf.tex +\openin 1 = epsf.tex \ifeof 1 \else \closein 1 - \def\epsfannounce{\toks0 = }% do not bother showing banner + % Do not bother showing banner with post-v2.7 epsf.tex (available in + % doc/epsf.tex until it shows up on ctan). + \def\epsfannounce{\toks0 = }% \input epsf.tex \fi % @@ -4650,39 +5128,32 @@ width0pt\relax} \fi % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi - \epsfbox{#1.eps}% + % If the image is by itself, center it. + \ifvmode + \nobreak\medskip + \nobreak + \centerline{\epsfbox{#1.eps}}% + \bigbreak + \else + \epsfbox{#1.eps}% + \fi } -% End of control word definitions. +\message{paper sizes,} +% And other related parameters. -\message{and turning on texinfo input format.} - -\def\openindices{% - \newindex{cp}% - \newcodeindex{fn}% - \newcodeindex{vr}% - \newcodeindex{tp}% - \newcodeindex{ky}% - \newcodeindex{pg}% -} - -% Set some numeric style parameters, for 8.5 x 11 format. - -\hsize = 6in -\hoffset = .25in \newdimen\defaultparindent \defaultparindent = 15pt -\parindent = \defaultparindent -\parskip 3pt plus 2pt minus 1pt -\setleading{13.2pt} -\advance\topskip by 1.2cm \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. -\vbadness=10000 +\vbadness = 10000 + +% Don't be so finicky about underfull hboxes, either. +\hbadness = 2000 % Following George Bush, just get rid of widows and orphans. \widowpenalty=10000 @@ -4691,101 +5162,126 @@ width0pt\relax} \fi % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on -% \hsize. This makes it come to about 9pt for the 8.5x11 format. +% \hsize. This makes it come to about 9pt for the 8.5x11 format. We +% call this whenever the paper size is set. % -\ifx\emergencystretch\thisisundefined - % Allow us to assign to \emergencystretch anyway. - \def\emergencystretch{\dimen0}% -\else - \emergencystretch = \hsize - \divide\emergencystretch by 45 -\fi - -% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) -\def\smallbook{ - \global\chapheadingskip = 15pt plus 4pt minus 2pt - \global\secheadingskip = 12pt plus 3pt minus 2pt - \global\subsecheadingskip = 9pt plus 2pt minus 2pt - % - \global\lispnarrowing = 0.3in - \setleading{12pt} - \advance\topskip by -1cm - \global\parskip 2pt plus 1pt - \global\hsize = 5in - \global\vsize=7.5in - \global\tolerance=700 - \global\hfuzz=1pt - \global\contentsrightmargin=0pt - \global\deftypemargin=0pt - \global\defbodyindent=.5cm - % - \global\pagewidth=\hsize - \global\pageheight=\vsize - % - \global\let\smalllisp=\smalllispx - \global\let\smallexample=\smalllispx - \global\def\Esmallexample{\Esmalllisp} +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = \hsize + \divide\emergencystretch by 45 + \fi } +% Parameters in order: 1) textheight; 2) textwidth; 3) voffset; +% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can +% set \parskip and call \setleading for \baselineskip. +% +\def\internalpagesizes#1#2#3#4#5#6{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 0.6in + \pageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \pagewidth = \hsize + % + \normaloffset = #4\relax + \bindingoffset = #5\relax + % + \parindent = \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \setleading{13.2pt}% + % + % If page is nothing but text, make it come out even. + \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% +}} + +% Use @smallbook to reset parameters for 7x9.5 (or so) format. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \setleading{12pt}% + % + \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \deftypemargin = 0pt + \defbodyindent = .5cm + % + \let\smalldisplay = \smalldisplayx + \let\smallexample = \smalllispx + \let\smallformat = \smallformatx + \let\smalllisp = \smalllispx +}} + % Use @afourpaper to print on European A4 paper. -\def\afourpaper{ -\global\tolerance=700 -\global\hfuzz=1pt -\setleading{12pt} -\global\parskip 15pt plus 1pt - -\global\vsize= 53\baselineskip -\advance\vsize by \topskip -%\global\hsize= 5.85in % A4 wide 10pt -\global\hsize= 6.5in -\global\outerhsize=\hsize -\global\advance\outerhsize by 0.5in -\global\outervsize=\vsize -\global\advance\outervsize by 0.6in - -\global\pagewidth=\hsize -\global\pageheight=\vsize -} - -\bindingoffset=0pt -\normaloffset=\hoffset -\pagewidth=\hsize -\pageheight=\vsize - -% Allow control of the text dimensions. Parameters in order: textheight; -% textwidth; voffset; hoffset; binding offset; topskip. -% All require a dimension; -% header is additional; added length extends the bottom of the page. - -\def\changepagesizes#1#2#3#4#5#6{ - \global\vsize= #1 - \global\topskip= #6 - \advance\vsize by \topskip - \global\voffset= #3 - \global\hsize= #2 - \global\outerhsize=\hsize - \global\advance\outerhsize by 0.5in - \global\outervsize=\vsize - \global\advance\outervsize by 0.6in - \global\pagewidth=\hsize - \global\pageheight=\vsize - \global\normaloffset= #4 - \global\bindingoffset= #5} +\def\afourpaper{{\globaldefs = 1 + \setleading{12pt}% + \parskip = 3pt plus 2pt minus 1pt + % + \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% + % + \tolerance = 700 + \hfuzz = 1pt +}} % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin % 29mm, hence bottom margin 28mm, nominal side margin 3cm. -\def\afourlatex - {\global\tolerance=700 - \global\hfuzz=1pt - \setleading{12pt} - \global\parskip 15pt plus 1pt - \advance\baselineskip by 1.6pt - \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm} - } +\def\afourlatex{{\globaldefs = 1 + \setleading{13.6pt}% + % + \afourpaper + \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% + % + \globaldefs = 0 +}} % Use @afourwide to print on European A4 paper in wide format. -\def\afourwide{\afourpaper -\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}} +\def\afourwide{% + \afourpaper + \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% + % + \globaldefs = 0 +} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\def\pagesizes{\parsearg\pagesizesxxx} +\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{13.2pt}% + % + \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% +}} + +% Set default to letter. +% +\letterpaper + +\message{and turning on texinfo input format.} % Define macros to output various characters with catcode for normal text. \catcode`\"=\other @@ -4822,10 +5318,10 @@ width0pt\relax} \fi % use math or other variants that look better in normal text. \catcode`\"=\active -\def\activedoublequote{{\tt \char '042}} +\def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active -\def~{{\tt \char '176}} +\def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} @@ -4836,7 +5332,7 @@ width0pt\relax} \fi \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} \catcode`\|=\active -\def|{{\tt \char '174}} +\def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} @@ -4923,8 +5419,8 @@ width0pt\relax} \fi @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active} -%% These look ok in all fonts, so just make them not special. The @rm below -%% makes sure that the current font starts out as the newly loaded cmr10 +% These look ok in all fonts, so just make them not special. The @rm below +% makes sure that the current font starts out as the newly loaded cmr10 @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other @textfonts